Replaced knockout-sortable with a slimmed down version (for now)

This commit is contained in:
djmaze 2020-09-19 13:46:02 +02:00
parent 4da5543c27
commit 3ea2f5f452
5 changed files with 551 additions and 5 deletions

21
vendors/knockout-sortable/LICENSE vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Ryan Niemeyer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

151
vendors/knockout-sortable/README.md vendored Normal file
View file

@ -0,0 +1,151 @@
**knockout-sortable** is a binding for [Knockout.js](http://knockoutjs.com/) designed to connect observableArrays with jQuery UI's sortable functionality. This allows a user to drag and drop items within a list or between lists and have the corresponding observableArrays updated appropriately.
**Basic Usage**
* using anonymous templates:
```html
<ul data-bind="sortable: items">
<li data-bind="text: name"></li>
</ul>
```
* using named templates:
```html
<ul data-bind="sortable: { template: 'itemTmpl', data: items }"></ul>
<script id="itemTmpl" type="text/html"><li data-bind="text: name"></li></script>
```
Note: The sortable binding assumes that the child "templates" have a single container element. You cannot use containerless bindings (comment-based) bindings at the top-level of your template, as the jQuery draggable/sortable functionality needs an element to operate on.
Note2: (*Update: 0.9.0 adds code to automatically strip leading/trailing whitespace*) When using named templates, you will have the best results across browsers, if you ensure that there is only a single top-level node inside your template with no surrounding text nodes. Inside of the top-level nodes, you can freely use whitespace/text nodes. So, you will want:
```html
<!-- good - no text nodes surrounding template root node -->
<script id="goodTmpl" type="text/html"><li data-bind="text: name">
<span data-bind="text: name"></span>
</li></script>
<!-- bad -->
<script id="badTmpl" type="text/html">
<li>
<span data-bind="text: name"></span>
</li>
</script>
```
**Additional Options**
* **connectClass** - specify the class that should be used to indicate a droppable target. The default class is "ko_container". This value can be passed in the binding or configured globally by setting `ko.bindingHandlers.sortable.connectClass`.
* **allowDrop** - specify whether this container should be a target for drops. This can be a static value, observable, or a function that is passed the observableArray as its first argument. If a function is specified, then it will be executed in a computed observable, so it will run again whenever any dependencies are updated. This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.sortable.allowDrop`.
* **beforeMove** - specify a function to execute prior to an item being moved from its original position to its new position in the data. This function receives an object for its first argument that contains the following information:
* `arg.item` - the actual item being moved
* `arg.sourceIndex` - the position of the item in the original observableArray
* `arg.sourceParent` - the original observableArray
* `arg.sourceParentNode` - the container node of the original list
* `arg.targetIndex` - the position of the item in the destination observableArray
* `arg.targetParent` - the destination observableArray
* `arg.cancelDrop` - this defaults to false and can be set to true to indicate that the drop should be cancelled.
This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.sortable.beforeMove`. This callback also receives the `event` and `ui` objects as the second and third arguments.
* **afterMove** - specify a function to execute after an item has been moved to its new destination. This function receives an object for its first argument that contains the following information:
* `arg.item` - the actual item being moved
* `arg.sourceIndex` - the position of the item in the original observableArray
* `arg.sourceParent` - the original observableArray
* `arg.sourceParentNode` - the container node of the original list. Useful if moving items between lists, but within a single array. The value of `this` in the callback will be the target container node.
* `arg.targetIndex` - the position of the item in the destination observableArray
* `arg.targetParent` - the destination observableArray
This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.sortable.afterMove`. This callback also receives the `event` and `ui` objects as the second and third arguments.
* **dragged** - specify a function to execute after a draggable item has been dropped into a sortable. This callback receives the drag item as the first argument, the `event` as the second argument, and the `ui` object as the third argument. If the function returns a value, then it will be used as item that is dropped into the sortable. This can be used as an alternative to the original item including a `clone` function.
* **isEnabled** - specify whether the sortable widget should be enabled. If this is an observable, then it will enable/disable the widget when the observable's value changes. This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.sortable.isEnabled`.
* **strategyMove** - specify whether dropping an item within the same list should move the same item to the new index rather than removing and re-adding the item in the new location (which is the default and causes the item to be re-rendered). This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.sortable.strategyMove`. The default value is `false`.
* **options** - specify any additional options to pass on to the `.sortable` jQuery UI call. These options can be specified in the binding or specified globally by setting `ko.bindingHandlers.sortable.options`.
* **afterAdd, beforeRemove, afterRender, includeDestroyed, templateEngine, as** - this binding will pass these options on to the template binding.
**Draggable binding**
This library also includes a `draggable` binding that you can place on single items that can be moved into a `sortable` collection. When the item is dropped into a sortable, the plugin will attempt to call a `clone` function on the item to make a suitable copy of it, otherwise it will use the item directly. Additionally, the `dragged` callback can be used to provide a copy of the object, as described above.
* using anonymous templates:
```html
<div data-bind="draggable: item">
<span data-bind="text: name"></span>
</div>
```
* using named templates:
```html
<div data-bind="draggable: { template: 'itemTmpl', data: item }"></div>
<script id="itemTmpl" type="text/html"><span data-bind="text: name"></span></script>
```
**Additional Options**
* **connectClass** - specify a class used to indicate which sortables that this draggable should be allowed to drop into. The default class is "ko_container". This value can be passed in the binding or configured globally by setting `ko.bindingHandlers.draggable.connectClass`.
* **isEnabled** - specify whether the draggable widget should be enabled. If this is an observable, then it will enable/disable the widget when the observable's value changes. This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.draggable.isEnabled`.
* **options** - specify any additional options to pass on to the `.draggable` jQuery UI call. These options can be specified in the binding or specified globally by setting `ko.bindingHandlers.draggable.options`.
**Droppable binding**
This library also includes a `droppable` binding that you can place on items which are targets for any `draggable` item. The binding can update an `observable` or a simple `function` on your viewmodel.
```html
<div data-bind="droppable: dropTo">
<span>Drop Items Here</span>
</div>
```
**Additional options**
* **isEnabled** - specify whether the droppable widget should be enabled. If this is an observable, then it will enable/disable the widget when the observable's value changes. This option can be passed in the binding or configured globally by setting `ko.bindingHandlers.droppable.isEnabled`.
* **options** - specify any additional option to pass to the `.droppable` jQuery UI call. When using options, your method or observable should be provided on the `data` property.
```html
<div data-bind="droppable: {data:dropTo, isEnabled:enableDrop, options:{greedy:true}}">
<span>Drop Items Here</span>
</div
```
**Dependencies**
* Knockout 2.0+
* jQuery - no specific version identified yet as minimum
* jQuery UI - If needing AMD/CommonJS support, then it requires >=1.12 (or ensuring that paths are mapped via config properly - it looks for `jquery-ui/ui/widgets/sortable` and `jquery-ui/ui/widgets/draggable`)
**Touch Support** - for touch support take a look at: http://touchpunch.furf.com/
**Build:** This project uses [grunt](http://gruntjs.com/) for building/minifying.
**Examples** The `examples` directory contains samples that include a simple sortable list, connected lists, and a seating chart that takes advantage of many of the additional options.
**Fiddles**
* simple: http://jsfiddle.net/rniemeyer/hw9B2/
* connected: http://jsfiddle.net/rniemeyer/Jr2rE/
* draggable: http://jsfiddle.net/rniemeyer/AC49j/
* seating chart: http://jsfiddle.net/rniemeyer/UdXr4/
**License**: MIT [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)

View file

@ -0,0 +1,377 @@
// knockout-sortable 1.2.0 | (c) 2019 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
(function(ko, $) {
var ITEMKEY = "ko_sortItem",
INDEXKEY = "ko_sourceIndex",
LISTKEY = "ko_sortList",
PARENTKEY = "ko_parentList",
DRAGKEY = "ko_dragItem",
unwrap = ko.utils.unwrapObservable,
dataGet = ko.utils.domData.get,
dataSet = ko.utils.domData.set;
//internal afterRender that adds meta-data to children
var addMetaDataAfterRender = function(elements, data) {
ko.utils.arrayForEach(elements, function(element) {
if (element.nodeType === 1) {
dataSet(element, ITEMKEY, data);
dataSet(element, PARENTKEY, dataGet(element.parentNode, LISTKEY));
}
});
};
//prepare the proper options for the template binding
var prepareTemplateOptions = function(valueAccessor, dataName) {
var result = {},
options = {},
actualAfterRender;
//build our options to pass to the template engine
if (ko.utils.peekObservable(valueAccessor()).data) {
options = unwrap(valueAccessor() || {});
result[dataName] = options.data;
if (options.hasOwnProperty("template")) {
result.name = options.template;
}
} else {
result[dataName] = valueAccessor();
}
ko.utils.arrayForEach(["afterAdd", "afterRender", "as", "beforeRemove",
"includeDestroyed", "templateEngine", "templateOptions", "nodes"], function (option) {
if (options.hasOwnProperty(option)) {
result[option] = options[option];
} else if (ko.bindingHandlers.sortable.hasOwnProperty(option)) {
result[option] = ko.bindingHandlers.sortable[option];
}
});
//use an afterRender function to add meta-data
if (dataName === "foreach") {
if (result.afterRender) {
//wrap the existing function, if it was passed
actualAfterRender = result.afterRender;
result.afterRender = function(element, data) {
addMetaDataAfterRender.call(data, element, data);
actualAfterRender.call(data, element, data);
};
} else {
result.afterRender = addMetaDataAfterRender;
}
}
//return options to pass to the template binding
return result;
};
var updateIndexFromDestroyedItems = function(index, items) {
var unwrapped = unwrap(items);
if (unwrapped) {
for (var i = 0; i <= index; i++) {
//add one for every destroyed item we find before the targetIndex in the target array
if (unwrapped[i] && unwrap(unwrapped[i]._destroy)) {
index++;
}
}
}
return index;
};
//remove problematic leading/trailing whitespace from templates
var stripTemplateWhitespace = function(element, name) {
var templateSource,
templateElement;
//process named templates
if (name) {
templateElement = document.getElementById(name);
if (templateElement) {
templateSource = new ko.templateSources.domElement(templateElement);
templateSource.text($.trim(templateSource.text()));
}
}
else {
//remove leading/trailing non-elements from anonymous templates
$(element).contents().each(function() {
if (this && this.nodeType !== 1) {
element.removeChild(this);
}
});
}
};
//connect items with observableArrays
ko.bindingHandlers.sortable = {
init: function(element, valueAccessor, allBindingsAccessor, data, context) {
var $element = $(element),
value = unwrap(valueAccessor()) || {},
templateOptions = prepareTemplateOptions(valueAccessor, "foreach"),
sortable = {},
startActual, updateActual;
stripTemplateWhitespace(element, templateOptions.name);
//build a new object that has the global options with overrides from the binding
$.extend(true, sortable, ko.bindingHandlers.sortable);
if (value.options && sortable.options) {
ko.utils.extend(sortable.options, value.options);
delete value.options;
}
ko.utils.extend(sortable, value);
//if allowDrop is an observable or a function, then execute it in a computed observable
if (sortable.connectClass && (ko.isObservable(sortable.allowDrop) || typeof sortable.allowDrop == "function")) {
ko.computed({
read: function() {
var value = unwrap(sortable.allowDrop),
shouldAdd = typeof value == "function" ? value.call(this, templateOptions.foreach) : value;
ko.utils.toggleDomNodeCssClass(element, sortable.connectClass, shouldAdd);
},
disposeWhenNodeIsRemoved: element
}, this);
} else {
ko.utils.toggleDomNodeCssClass(element, sortable.connectClass, sortable.allowDrop);
}
//wrap the template binding
ko.bindingHandlers.template.init(element, function() { return templateOptions; }, allBindingsAccessor, data, context);
//keep a reference to start/update functions that might have been passed in
startActual = sortable.options.start;
updateActual = sortable.options.update;
//ensure draggable table row cells maintain their width while dragging (unless a helper is provided)
if ( !sortable.options.helper ) {
sortable.options.helper = function(e, ui) {
if (ui.is("tr")) {
ui.children().each(function() {
$(this).width($(this).width());
});
}
return ui;
};
}
//initialize sortable binding after template binding has rendered in update function
var createTimeout = setTimeout(function() {
var dragItem;
var originalReceive = sortable.options.receive;
$element.sortable(ko.utils.extend(sortable.options, {
start: function(event, ui) {
//track original index
var el = ui.item[0];
dataSet(el, INDEXKEY, ko.utils.arrayIndexOf(ui.item.parent().children(), el));
//make sure that fields have a chance to update model
ui.item.find("input:focus").change();
if (startActual) {
startActual.apply(this, arguments);
}
},
receive: function(event, ui) {
//optionally apply an existing receive handler
if (typeof originalReceive === "function") {
originalReceive.call(this, event, ui);
}
dragItem = dataGet(ui.item[0], DRAGKEY);
if (dragItem) {
//copy the model item, if a clone option is provided
if (dragItem.clone) {
dragItem = dragItem.clone();
}
//configure a handler to potentially manipulate item before drop
if (sortable.dragged) {
dragItem = sortable.dragged.call(this, dragItem, event, ui) || dragItem;
}
}
},
update: function(event, ui) {
var sourceParent, targetParent, sourceIndex, targetIndex, arg,
el = ui.item[0],
parentEl = ui.item.parent()[0],
item = dataGet(el, ITEMKEY) || dragItem;
if (!item) {
$(el).remove();
}
dragItem = null;
//make sure that moves only run once, as update fires on multiple containers
if (item && (this === parentEl)) {
//identify parents
sourceParent = dataGet(el, PARENTKEY);
sourceIndex = dataGet(el, INDEXKEY);
targetParent = dataGet(el.parentNode, LISTKEY);
targetIndex = ko.utils.arrayIndexOf(ui.item.parent().children(), el);
//take destroyed items into consideration
if (!templateOptions.includeDestroyed) {
sourceIndex = updateIndexFromDestroyedItems(sourceIndex, sourceParent);
targetIndex = updateIndexFromDestroyedItems(targetIndex, targetParent);
}
//build up args for the callbacks
if (sortable.beforeMove || sortable.afterMove) {
arg = {
item: item,
sourceParent: sourceParent,
sourceParentNode: sourceParent && ui.sender || el.parentNode,
sourceIndex: sourceIndex,
targetParent: targetParent,
targetIndex: targetIndex,
cancelDrop: false
};
//execute the configured callback prior to actually moving items
if (sortable.beforeMove) {
sortable.beforeMove.call(this, arg, event, ui);
}
}
//call cancel on the correct list, so KO can take care of DOM manipulation
if (sourceParent) {
$(sourceParent === targetParent ? this : ui.sender || this).sortable("cancel");
}
//for a draggable item just remove the element
else {
$(el).remove();
}
//if beforeMove told us to cancel, then we are done
if (arg && arg.cancelDrop) {
return;
}
//if the strategy option is unset or false, employ the order strategy involving removal and insertion of items
if (!sortable.hasOwnProperty("strategyMove") || sortable.strategyMove === false) {
//do the actual move
if (targetIndex >= 0) {
if (sourceParent) {
sourceParent.splice(sourceIndex, 1);
//if using deferred updates plugin, force updates
if (ko.processAllDeferredBindingUpdates) {
ko.processAllDeferredBindingUpdates();
}
//if using deferred updates on knockout 3.4, force updates
if (ko.options && ko.options.deferUpdates) {
ko.tasks.runEarly();
}
}
targetParent.splice(targetIndex, 0, item);
}
//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);
}
else { //employ the strategy of moving items
if (targetIndex >= 0) {
if (sourceParent) {
if (sourceParent !== targetParent) {
// moving from one list to another
sourceParent.splice(sourceIndex, 1);
targetParent.splice(targetIndex, 0, item);
//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);
ui.item.remove();
}
else {
// moving within same list
var underlyingList = unwrap(sourceParent);
// notify 'beforeChange' subscribers
if (sourceParent.valueWillMutate) {
sourceParent.valueWillMutate();
}
// move from source index ...
underlyingList.splice(sourceIndex, 1);
// ... to target index
underlyingList.splice(targetIndex, 0, item);
// notify subscribers
if (sourceParent.valueHasMutated) {
sourceParent.valueHasMutated();
}
}
}
else {
// drop new element from outside
targetParent.splice(targetIndex, 0, item);
//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);
ui.item.remove();
}
}
}
//if using deferred updates plugin, force updates
if (ko.processAllDeferredBindingUpdates) {
ko.processAllDeferredBindingUpdates();
}
//allow binding to accept a function to execute after moving the item
if (sortable.afterMove) {
sortable.afterMove.call(this, arg, event, ui);
}
}
if (updateActual) {
updateActual.apply(this, arguments);
}
},
connectWith: sortable.connectClass ? "." + sortable.connectClass : false
}));
//handle enabling/disabling sorting
if (sortable.isEnabled !== undefined) {
ko.computed({
read: function() {
$element.sortable(unwrap(sortable.isEnabled) ? "enable" : "disable");
},
disposeWhenNodeIsRemoved: element
});
}
}, 0);
//handle disposal
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
//only call destroy if sortable has been created
if ($element.data("ui-sortable") || $element.data("sortable")) {
$element.sortable("destroy");
}
ko.utils.toggleDomNodeCssClass(element, sortable.connectClass, false);
//do not create the sortable if the element has been removed from DOM
clearTimeout(createTimeout);
});
return { 'controlsDescendantBindings': true };
},
update: function(element, valueAccessor, allBindingsAccessor, data, context) {
var templateOptions = prepareTemplateOptions(valueAccessor, "foreach");
//attach meta-data
dataSet(element, LISTKEY, templateOptions.foreach);
//call template binding's update with correct options
ko.bindingHandlers.template.update(element, function() { return templateOptions; }, allBindingsAccessor, data, context);
},
connectClass: 'ko_container',
allowDrop: true,
afterMove: null,
beforeMove: null,
options: {}
};
})(this.ko, this.jQuery);

View file

@ -0,0 +1,2 @@
// knockout-sortable 1.2.0 | (c) 2019 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
!function(e,t){var n="ko_sortItem",o=e.utils.unwrapObservable,s=e.utils.domData.get,r=e.utils.domData.set,a=function(t,o){e.utils.arrayForEach(t,function(e){1===e.nodeType&&(r(e,n,o),r(e,"ko_parentList",s(e.parentNode,"ko_sortList")))})},i=function(t,n){var s,r={},i={};return e.utils.peekObservable(t()).data?(i=o(t()||{}),r[n]=i.data,i.hasOwnProperty("template")&&(r.name=i.template)):r[n]=t(),e.utils.arrayForEach(["afterAdd","afterRender","as","beforeRemove","includeDestroyed","templateEngine","templateOptions","nodes"],function(t){i.hasOwnProperty(t)?r[t]=i[t]:e.bindingHandlers.sortable.hasOwnProperty(t)&&(r[t]=e.bindingHandlers.sortable[t])}),"foreach"===n&&(r.afterRender?(s=r.afterRender,r.afterRender=function(e,t){a.call(t,e,t),s.call(t,e,t)}):r.afterRender=a),r},l=function(e,t){var n=o(t);if(n)for(var s=0;s<=e;s++)n[s]&&o(n[s]._destroy)&&e++;return e};e.bindingHandlers.sortable={init:function(a,d,c,u,p){var f,m,h=t(a),v=o(d())||{},b=i(d,"foreach"),g={};!function(n,o){var s,r;o?(r=document.getElementById(o))&&(s=new e.templateSources.domElement(r)).text(t.trim(s.text())):t(n).contents().each(function(){this&&1!==this.nodeType&&n.removeChild(this)})}(a,b.name),t.extend(!0,g,e.bindingHandlers.sortable),v.options&&g.options&&(e.utils.extend(g.options,v.options),delete v.options),e.utils.extend(g,v),g.connectClass&&(e.isObservable(g.allowDrop)||"function"==typeof g.allowDrop)?e.computed({read:function(){var t=o(g.allowDrop),n="function"==typeof t?t.call(this,b.foreach):t;e.utils.toggleDomNodeCssClass(a,g.connectClass,n)},disposeWhenNodeIsRemoved:a},this):e.utils.toggleDomNodeCssClass(a,g.connectClass,g.allowDrop),e.bindingHandlers.template.init(a,function(){return b},c,u,p),f=g.options.start,m=g.options.update,g.options.helper||(g.options.helper=function(e,n){return n.is("tr")&&n.children().each(function(){t(this).width(t(this).width())}),n});var y=setTimeout(function(){var i,d=g.options.receive;h.sortable(e.utils.extend(g.options,{start:function(t,n){var o=n.item[0];r(o,"ko_sourceIndex",e.utils.arrayIndexOf(n.item.parent().children(),o)),n.item.find("input:focus").change(),f&&f.apply(this,arguments)},receive:function(e,t){"function"==typeof d&&d.call(this,e,t),(i=s(t.item[0],"ko_dragItem"))&&(i.clone&&(i=i.clone()),g.dragged&&(i=g.dragged.call(this,i,e,t)||i))},update:function(a,d){var c,u,p,f,h,v=d.item[0],y=d.item.parent()[0],D=s(v,n)||i;if(D||t(v).remove(),i=null,D&&this===y){if(c=s(v,"ko_parentList"),p=s(v,"ko_sourceIndex"),u=s(v.parentNode,"ko_sortList"),f=e.utils.arrayIndexOf(d.item.parent().children(),v),b.includeDestroyed||(p=l(p,c),f=l(f,u)),(g.beforeMove||g.afterMove)&&(h={item:D,sourceParent:c,sourceParentNode:c&&d.sender||v.parentNode,sourceIndex:p,targetParent:u,targetIndex:f,cancelDrop:!1},g.beforeMove&&g.beforeMove.call(this,h,a,d)),c?t(c===u?this:d.sender||this).sortable("cancel"):t(v).remove(),h&&h.cancelDrop)return;if(g.hasOwnProperty("strategyMove")&&!1!==g.strategyMove){if(f>=0)if(c)if(c!==u)c.splice(p,1),u.splice(f,0,D),r(v,n,null),d.item.remove();else{var C=o(c);c.valueWillMutate&&c.valueWillMutate(),C.splice(p,1),C.splice(f,0,D),c.valueHasMutated&&c.valueHasMutated()}else u.splice(f,0,D),r(v,n,null),d.item.remove()}else f>=0&&(c&&(c.splice(p,1),e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),e.options&&e.options.deferUpdates&&e.tasks.runEarly()),u.splice(f,0,D)),r(v,n,null);e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),g.afterMove&&g.afterMove.call(this,h,a,d)}m&&m.apply(this,arguments)},connectWith:!!g.connectClass&&"."+g.connectClass})),void 0!==g.isEnabled&&e.computed({read:function(){h.sortable(o(g.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:a})},0);return e.utils.domNodeDisposal.addDisposeCallback(a,function(){(h.data("ui-sortable")||h.data("sortable"))&&h.sortable("destroy"),e.utils.toggleDomNodeCssClass(a,g.connectClass,!1),clearTimeout(y)}),{controlsDescendantBindings:!0}},update:function(t,n,o,s,a){var l=i(n,"foreach");r(t,"ko_sortList",l.foreach),e.bindingHandlers.template.update(t,function(){return l},o,s,a)},connectClass:"ko_container",allowDrop:!0,afterMove:null,beforeMove:null,options:{}}}(this.ko,this.jQuery);

View file

@ -4063,11 +4063,6 @@ kind-of@^6.0.0, kind-of@^6.0.2:
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
knockout-sortable@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/knockout-sortable/-/knockout-sortable-1.2.0.tgz#e63c21a009cd0686bf1d40effa3ff12c12372566"
integrity sha512-cJq4jm4SWdaCIkuYIrNZpVaNYFUafJT83RlFEP/dsPOqIi3xWkCnm1Y5zLEQ2QqMDRT9GI9HxN9Jz+lhZNFHPA==
last-run@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b"