-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
220b336
commit 4b40fd7
Showing
11 changed files
with
323 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
define(['exports', 'babel-runtime/helpers/create-class', 'babel-runtime/helpers/class-call-check', 'babel-runtime/core-js/object/assign', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', './options', './dragula'], function (exports, _babelRuntimeHelpersCreateClass, _babelRuntimeHelpersClassCallCheck, _babelRuntimeCoreJsObjectAssign, _aureliaTemplating, _aureliaBinding, _aureliaDependencyInjection, _options, _dragula) { | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
|
||
var DragulaAndDrop = (function () { | ||
function DragulaAndDrop(globalOptions) { | ||
(0, _babelRuntimeHelpersClassCallCheck['default'])(this, _DragulaAndDrop); | ||
|
||
this.globalOptions = globalOptions; | ||
this.drake; | ||
} | ||
|
||
(0, _babelRuntimeHelpersCreateClass['default'])(DragulaAndDrop, [{ | ||
key: 'bind', | ||
value: function bind() { | ||
var boundOptions = { | ||
moves: this.moves, | ||
accepts: this.accepts, | ||
invalid: this.invalid, | ||
containers: this.containers, | ||
isContainer: this.isContainer, | ||
copy: this.copy, | ||
copySortSource: this.copySortSource, | ||
revertOnSpill: this.revertOnSpill, | ||
removeOnSpill: this.removeOnSpill, | ||
direction: this.direction, | ||
ignoreInputTextSelection: this.ignoreInputTextSelection, | ||
mirrorContainer: this.mirrorContainer | ||
}; | ||
|
||
var options = (0, _babelRuntimeCoreJsObjectAssign['default'])({}, this.globalOptions, boundOptions); | ||
this.drake = new _dragula.Dragula(options); | ||
} | ||
}, { | ||
key: 'unbind', | ||
value: function unbind() { | ||
this.drake.destroy(); | ||
} | ||
}]); | ||
var _DragulaAndDrop = DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.noView)()(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaDependencyInjection.inject)(_options.GLOBAL_OPTIONS)(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.customElement)('dragula-and-drop')(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'direction', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copySortSource', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copy', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'containers', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'invalid', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'accepts', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'moves', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
return DragulaAndDrop; | ||
})(); | ||
|
||
exports.DragulaAndDrop = DragulaAndDrop; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
'use strict'; | ||
|
||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
|
||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
|
||
var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; | ||
|
||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
|
||
var _aureliaTemplating = require('aurelia-templating'); | ||
|
||
var _aureliaBinding = require('aurelia-binding'); | ||
|
||
var _aureliaDependencyInjection = require('aurelia-dependency-injection'); | ||
|
||
var _options = require('./options'); | ||
|
||
var _dragula = require('./dragula'); | ||
|
||
var DragulaAndDrop = (function () { | ||
function DragulaAndDrop(globalOptions) { | ||
_classCallCheck(this, _DragulaAndDrop); | ||
|
||
this.globalOptions = globalOptions; | ||
this.drake; | ||
} | ||
|
||
_createClass(DragulaAndDrop, [{ | ||
key: 'bind', | ||
value: function bind() { | ||
var boundOptions = { | ||
moves: this.moves, | ||
accepts: this.accepts, | ||
invalid: this.invalid, | ||
containers: this.containers, | ||
isContainer: this.isContainer, | ||
copy: this.copy, | ||
copySortSource: this.copySortSource, | ||
revertOnSpill: this.revertOnSpill, | ||
removeOnSpill: this.removeOnSpill, | ||
direction: this.direction, | ||
ignoreInputTextSelection: this.ignoreInputTextSelection, | ||
mirrorContainer: this.mirrorContainer | ||
}; | ||
|
||
var options = _Object$assign({}, this.globalOptions, boundOptions); | ||
this.drake = new _dragula.Dragula(options); | ||
} | ||
}, { | ||
key: 'unbind', | ||
value: function unbind() { | ||
this.drake.destroy(); | ||
} | ||
}]); | ||
|
||
var _DragulaAndDrop = DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.noView)()(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaDependencyInjection.inject)(_options.GLOBAL_OPTIONS)(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.customElement)('dragula-and-drop')(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'direction', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copySortSource', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copy', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'containers', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'invalid', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'accepts', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'moves', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; | ||
return DragulaAndDrop; | ||
})(); | ||
|
||
exports.DragulaAndDrop = DragulaAndDrop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import {customElement, bindable, noView} from 'aurelia-templating'; | ||
import {bindingMode} from 'aurelia-binding'; | ||
import {inject} from 'aurelia-dependency-injection'; | ||
|
||
import {Options, DIRECTION, GLOBAL_OPTIONS} from './options'; | ||
import {Dragula} from './dragula'; | ||
|
||
@bindable({ name: 'moves', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'accepts', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'invalid', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'containers', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'copy', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'copySortSource', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'direction', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: bindingMode.oneTime }) | ||
@bindable({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: bindingMode.oneTime }) | ||
@customElement('dragula-and-drop') | ||
@inject(GLOBAL_OPTIONS) | ||
@noView() | ||
export class DragulaAndDrop { | ||
|
||
constructor(globalOptions) { | ||
this.globalOptions = globalOptions; | ||
this.drake; | ||
} | ||
|
||
bind() { | ||
let boundOptions = { | ||
moves: this.moves, | ||
accepts: this.accepts, | ||
invalid: this.invalid, | ||
containers: this.containers, | ||
isContainer: this.isContainer, | ||
copy: this.copy, | ||
copySortSource: this.copySortSource, | ||
revertOnSpill: this.revertOnSpill, | ||
removeOnSpill: this.removeOnSpill, | ||
direction: this.direction, | ||
ignoreInputTextSelection: this.ignoreInputTextSelection, | ||
mirrorContainer: this.mirrorContainer | ||
}; | ||
|
||
let options = Object.assign({}, this.globalOptions, boundOptions); | ||
this.drake = new Dragula(options); | ||
} | ||
|
||
unbind() { | ||
this.drake.destroy(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.