@limetech/lime-elements 38.31.0 → 38.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
- package/dist/cjs/limel-collapsible-section.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-drag-handle.cjs.entry.js +34 -0
- package/dist/cjs/limel-drag-handle.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +3220 -305
- package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-list-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-d2be6dd7.js → translations-a42886f2.js} +17 -1
- package/dist/cjs/translations-a42886f2.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +3 -0
- package/dist/collection/components/action-bar/action-bar.css +3 -0
- package/dist/collection/components/badge/badge.css +3 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +3 -0
- package/dist/collection/components/button/button.css +3 -0
- package/dist/collection/components/button-group/button-group.css +3 -0
- package/dist/collection/components/card/card.css +3 -0
- package/dist/collection/components/chart/chart.css +6 -0
- package/dist/collection/components/checkbox/checkbox.css +3 -0
- package/dist/collection/components/chip/chip.css +3 -0
- package/dist/collection/components/chip-set/chip-set.css +6 -0
- package/dist/collection/components/circular-progress/circular-progress.css +3 -0
- package/dist/collection/components/code-editor/code-editor.css +3 -0
- package/dist/collection/components/collapsible-section/collapsible-section.css +17 -8
- package/dist/collection/components/color-picker/color-picker-palette.css +3 -0
- package/dist/collection/components/color-picker/color-picker.css +3 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +3 -0
- package/dist/collection/components/dialog/dialog.css +3 -0
- package/dist/collection/components/dock/dock-button/dock-button.css +3 -0
- package/dist/collection/components/dock/dock.css +3 -0
- package/dist/collection/components/drag-handle/drag-handle.css +174 -0
- package/dist/collection/components/drag-handle/drag-handle.js +125 -0
- package/dist/collection/components/drag-handle/drag-handle.js.map +1 -0
- package/dist/collection/components/file/file.css +3 -0
- package/dist/collection/components/file-viewer/file-viewer.css +3 -0
- package/dist/collection/components/form/form.css +143 -14
- package/dist/collection/components/form/templates/array-field-collapsible-item.js +13 -16
- package/dist/collection/components/form/templates/array-field-collapsible-item.js.map +1 -1
- package/dist/collection/components/form/templates/array-field-simple-item.js +16 -49
- package/dist/collection/components/form/templates/array-field-simple-item.js.map +1 -1
- package/dist/collection/components/form/templates/array-field.js +306 -19
- package/dist/collection/components/form/templates/array-field.js.map +1 -1
- package/dist/collection/components/header/header.css +3 -0
- package/dist/collection/components/help/help.css +3 -0
- package/dist/collection/components/help/limel-help-content.css +3 -0
- package/dist/collection/components/icon-button/icon-button.css +3 -0
- package/dist/collection/components/info-tile/info-tile.css +3 -0
- package/dist/collection/components/input-field/input-field.css +3 -0
- package/dist/collection/components/list/list.css +6 -0
- package/dist/collection/components/list-item/list-item.css +3 -0
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.css +3 -0
- package/dist/collection/components/markdown/markdown.css +3 -0
- package/dist/collection/components/menu-list/menu-list.css +6 -0
- package/dist/collection/components/notched-outline/notched-outline.css +3 -0
- package/dist/collection/components/popover-surface/popover-surface.css +3 -0
- package/dist/collection/components/profile-picture/profile-picture.css +3 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +3 -0
- package/dist/collection/components/radio-button-group/radio-button.css +3 -0
- package/dist/collection/components/select/select.css +6 -0
- package/dist/collection/components/shortcut/shortcut.css +3 -0
- package/dist/collection/components/slider/slider.css +3 -0
- package/dist/collection/components/split-button/split-button.css +3 -0
- package/dist/collection/components/switch/switch.css +3 -0
- package/dist/collection/components/tab-bar/tab-bar.css +3 -0
- package/dist/collection/components/table/table.css +12 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +3 -0
- package/dist/collection/components/text-editor/text-editor.css +3 -0
- package/dist/collection/style/mixins.scss +53 -0
- package/dist/collection/translations/da.js +2 -0
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/de.js +2 -0
- package/dist/collection/translations/de.js.map +1 -1
- package/dist/collection/translations/en.js +2 -0
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +2 -0
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/fr.js +2 -0
- package/dist/collection/translations/fr.js.map +1 -1
- package/dist/collection/translations/nl.js +2 -0
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +2 -0
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +2 -0
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_2.entry.js +1 -1
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +2 -2
- package/dist/esm/limel-collapsible-section.entry.js.map +1 -1
- package/dist/esm/limel-drag-handle.entry.js +30 -0
- package/dist/esm/limel-drag-handle.entry.js.map +1 -0
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +3214 -299
- package/dist/esm/limel-form.entry.js.map +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/esm/limel-linear-progress.entry.js +1 -1
- package/dist/esm/limel-list-item.entry.js +1 -1
- package/dist/esm/limel-profile-picture.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-91c611da.js → translations-9bfde9f4.js} +17 -1
- package/dist/esm/translations-9bfde9f4.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/p-309d0652.entry.js +2 -0
- package/dist/lime-elements/{p-e6245ef7.entry.js.map → p-309d0652.entry.js.map} +1 -1
- package/dist/lime-elements/p-31f1cb08.entry.js +2 -0
- package/dist/lime-elements/p-31f1cb08.entry.js.map +1 -0
- package/dist/lime-elements/{p-cc7f4c81.entry.js → p-3311eaf3.entry.js} +2 -2
- package/dist/lime-elements/{p-aeba4aa4.entry.js → p-40542ccc.entry.js} +2 -2
- package/dist/lime-elements/{p-d349e355.entry.js → p-42e889d8.entry.js} +2 -2
- package/dist/lime-elements/p-5df2361b.js +2 -0
- package/dist/lime-elements/p-5df2361b.js.map +1 -0
- package/dist/lime-elements/{p-b5abf284.entry.js → p-5e976a59.entry.js} +2 -2
- package/dist/lime-elements/{p-6c60172e.entry.js → p-787be044.entry.js} +2 -2
- package/dist/lime-elements/p-8ea3b80a.entry.js +2 -0
- package/dist/lime-elements/p-8ea3b80a.entry.js.map +1 -0
- package/dist/lime-elements/{p-d1aa44e1.entry.js → p-92aa9610.entry.js} +2 -2
- package/dist/lime-elements/{p-8e3c4418.entry.js → p-aa1e7319.entry.js} +2 -2
- package/dist/lime-elements/p-ae267255.entry.js +27 -0
- package/dist/lime-elements/p-ae267255.entry.js.map +1 -0
- package/dist/lime-elements/{p-ed04acfc.entry.js → p-b0acf522.entry.js} +2 -2
- package/dist/lime-elements/{p-f83ebd28.entry.js → p-b7bbb6a5.entry.js} +2 -2
- package/dist/lime-elements/{p-eb396630.entry.js → p-cd2f780a.entry.js} +2 -2
- package/dist/lime-elements/{p-aae161ef.entry.js → p-d79c85e2.entry.js} +2 -2
- package/dist/lime-elements/{p-1b036add.entry.js → p-e00465fa.entry.js} +2 -2
- package/dist/lime-elements/{p-29c2cdc6.entry.js → p-ee5c4112.entry.js} +2 -2
- package/dist/lime-elements/{p-e6bb4d1a.entry.js → p-fbac230b.entry.js} +2 -2
- package/dist/lime-elements/style/mixins.scss +53 -0
- package/dist/scss/mixins.scss +53 -0
- package/dist/types/components/drag-handle/drag-handle.d.ts +46 -0
- package/dist/types/components/form/templates/array-field-collapsible-item.d.ts +3 -1
- package/dist/types/components/form/templates/array-field-simple-item.d.ts +5 -9
- package/dist/types/components/form/templates/array-field.d.ts +35 -4
- package/dist/types/components.d.ts +113 -0
- package/dist/types/translations/da.d.ts +2 -0
- package/dist/types/translations/de.d.ts +2 -0
- package/dist/types/translations/en.d.ts +2 -0
- package/dist/types/translations/fi.d.ts +2 -0
- package/dist/types/translations/fr.d.ts +2 -0
- package/dist/types/translations/nl.d.ts +2 -0
- package/dist/types/translations/no.d.ts +2 -0
- package/dist/types/translations/sv.d.ts +2 -0
- package/package.json +5 -2
- package/dist/cjs/translations-d2be6dd7.js.map +0 -1
- package/dist/esm/translations-91c611da.js.map +0 -1
- package/dist/lime-elements/p-4c88e5d3.js +0 -2
- package/dist/lime-elements/p-4c88e5d3.js.map +0 -1
- package/dist/lime-elements/p-d6d66daa.entry.js +0 -21
- package/dist/lime-elements/p-d6d66daa.entry.js.map +0 -1
- package/dist/lime-elements/p-e6245ef7.entry.js +0 -2
- package/dist/lime-elements/p-ed8aa16c.entry.js +0 -2
- package/dist/lime-elements/p-ed8aa16c.entry.js.map +0 -1
- /package/dist/lime-elements/{p-cc7f4c81.entry.js.map → p-3311eaf3.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-aeba4aa4.entry.js.map → p-40542ccc.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d349e355.entry.js.map → p-42e889d8.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-b5abf284.entry.js.map → p-5e976a59.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-6c60172e.entry.js.map → p-787be044.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d1aa44e1.entry.js.map → p-92aa9610.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8e3c4418.entry.js.map → p-aa1e7319.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ed04acfc.entry.js.map → p-b0acf522.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-f83ebd28.entry.js.map → p-b7bbb6a5.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-eb396630.entry.js.map → p-cd2f780a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-aae161ef.entry.js.map → p-d79c85e2.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-1b036add.entry.js.map → p-e00465fa.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-29c2cdc6.entry.js.map → p-ee5c4112.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e6bb4d1a.entry.js.map → p-fbac230b.entry.js.map} +0 -0
|
@@ -972,7 +972,7 @@ var useSyncExternalStore = function (
|
|
|
972
972
|
var useTransition = function () {
|
|
973
973
|
return ReactSharedInternals$2.H.useTransition();
|
|
974
974
|
};
|
|
975
|
-
var version$
|
|
975
|
+
var version$4 = "19.1.1";
|
|
976
976
|
|
|
977
977
|
var react_production = {
|
|
978
978
|
Children: Children,
|
|
@@ -1013,7 +1013,7 @@ var react_production = {
|
|
|
1013
1013
|
useState: useState,
|
|
1014
1014
|
useSyncExternalStore: useSyncExternalStore,
|
|
1015
1015
|
useTransition: useTransition,
|
|
1016
|
-
version: version$
|
|
1016
|
+
version: version$4
|
|
1017
1017
|
};
|
|
1018
1018
|
|
|
1019
1019
|
createCommonjsModule(function (module, exports) {
|
|
@@ -1565,7 +1565,7 @@ var useFormState = function (action, initialState, permalink) {
|
|
|
1565
1565
|
var useFormStatus = function () {
|
|
1566
1566
|
return ReactSharedInternals$1.H.useHostTransitionStatus();
|
|
1567
1567
|
};
|
|
1568
|
-
var version$
|
|
1568
|
+
var version$3 = "19.1.1";
|
|
1569
1569
|
|
|
1570
1570
|
var reactDom_production = {
|
|
1571
1571
|
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
@@ -1581,7 +1581,7 @@ var reactDom_production = {
|
|
|
1581
1581
|
unstable_batchedUpdates: unstable_batchedUpdates,
|
|
1582
1582
|
useFormState: useFormState,
|
|
1583
1583
|
useFormStatus: useFormStatus,
|
|
1584
|
-
version: version$
|
|
1584
|
+
version: version$3
|
|
1585
1585
|
};
|
|
1586
1586
|
|
|
1587
1587
|
createCommonjsModule(function (module, exports) {
|
|
@@ -1832,17 +1832,17 @@ var isArrayImpl = Array.isArray,
|
|
|
1832
1832
|
action: null
|
|
1833
1833
|
},
|
|
1834
1834
|
valueStack = [],
|
|
1835
|
-
index = -1;
|
|
1835
|
+
index$1 = -1;
|
|
1836
1836
|
function createCursor(defaultValue) {
|
|
1837
1837
|
return { current: defaultValue };
|
|
1838
1838
|
}
|
|
1839
1839
|
function pop(cursor) {
|
|
1840
|
-
0 > index ||
|
|
1841
|
-
((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
|
|
1840
|
+
0 > index$1 ||
|
|
1841
|
+
((cursor.current = valueStack[index$1]), (valueStack[index$1] = null), index$1--);
|
|
1842
1842
|
}
|
|
1843
1843
|
function push(cursor, value) {
|
|
1844
|
-
index++;
|
|
1845
|
-
valueStack[index] = cursor.current;
|
|
1844
|
+
index$1++;
|
|
1845
|
+
valueStack[index$1] = cursor.current;
|
|
1846
1846
|
cursor.current = value;
|
|
1847
1847
|
}
|
|
1848
1848
|
var contextStackCursor = createCursor(null),
|
|
@@ -13507,7 +13507,7 @@ function addTrappedEventListener(
|
|
|
13507
13507
|
listenerWrapper = dispatchContinuousEvent;
|
|
13508
13508
|
break;
|
|
13509
13509
|
default:
|
|
13510
|
-
listenerWrapper = dispatchEvent$
|
|
13510
|
+
listenerWrapper = dispatchEvent$2;
|
|
13511
13511
|
}
|
|
13512
13512
|
eventSystemFlags = listenerWrapper.bind(
|
|
13513
13513
|
null,
|
|
@@ -16252,7 +16252,7 @@ function dispatchDiscreteEvent(
|
|
|
16252
16252
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
16253
16253
|
try {
|
|
16254
16254
|
(ReactDOMSharedInternals.p = 2),
|
|
16255
|
-
dispatchEvent$
|
|
16255
|
+
dispatchEvent$2(domEventName, eventSystemFlags, container, nativeEvent);
|
|
16256
16256
|
} finally {
|
|
16257
16257
|
(ReactDOMSharedInternals.p = previousPriority),
|
|
16258
16258
|
(ReactSharedInternals.T = prevTransition);
|
|
@@ -16269,13 +16269,13 @@ function dispatchContinuousEvent(
|
|
|
16269
16269
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
16270
16270
|
try {
|
|
16271
16271
|
(ReactDOMSharedInternals.p = 8),
|
|
16272
|
-
dispatchEvent$
|
|
16272
|
+
dispatchEvent$2(domEventName, eventSystemFlags, container, nativeEvent);
|
|
16273
16273
|
} finally {
|
|
16274
16274
|
(ReactDOMSharedInternals.p = previousPriority),
|
|
16275
16275
|
(ReactSharedInternals.T = prevTransition);
|
|
16276
16276
|
}
|
|
16277
16277
|
}
|
|
16278
|
-
function dispatchEvent$
|
|
16278
|
+
function dispatchEvent$2(
|
|
16279
16279
|
domEventName,
|
|
16280
16280
|
eventSystemFlags,
|
|
16281
16281
|
targetContainer,
|
|
@@ -16978,12 +16978,12 @@ var hydrateRoot = function (container, initialChildren, options) {
|
|
|
16978
16978
|
listenToAllSupportedEvents(container);
|
|
16979
16979
|
return new ReactDOMHydrationRoot(initialChildren);
|
|
16980
16980
|
};
|
|
16981
|
-
var version$
|
|
16981
|
+
var version$2 = "19.1.1";
|
|
16982
16982
|
|
|
16983
16983
|
var reactDomClient_production = {
|
|
16984
16984
|
createRoot: createRoot,
|
|
16985
16985
|
hydrateRoot: hydrateRoot,
|
|
16986
|
-
version: version$
|
|
16986
|
+
version: version$2
|
|
16987
16987
|
};
|
|
16988
16988
|
|
|
16989
16989
|
createCommonjsModule(function (module, exports) {
|
|
@@ -18030,24 +18030,24 @@ for (var i = 0; i < DOMIterables.length; i++) {
|
|
|
18030
18030
|
|
|
18031
18031
|
var iterator = _wksExt.f('iterator');
|
|
18032
18032
|
|
|
18033
|
-
function _typeof(o) {
|
|
18033
|
+
function _typeof$1(o) {
|
|
18034
18034
|
"@babel/helpers - typeof";
|
|
18035
18035
|
|
|
18036
|
-
return _typeof = "function" == typeof symbol && "symbol" == typeof iterator ? function (o) {
|
|
18036
|
+
return _typeof$1 = "function" == typeof symbol && "symbol" == typeof iterator ? function (o) {
|
|
18037
18037
|
return typeof o;
|
|
18038
18038
|
} : function (o) {
|
|
18039
18039
|
return o && "function" == typeof symbol && o.constructor === symbol && o !== symbol.prototype ? "symbol" : typeof o;
|
|
18040
|
-
}, _typeof(o);
|
|
18040
|
+
}, _typeof$1(o);
|
|
18041
18041
|
}
|
|
18042
18042
|
|
|
18043
18043
|
var toPrimitive$2 = _wksExt.f('toPrimitive');
|
|
18044
18044
|
|
|
18045
18045
|
function toPrimitive$1(t, r) {
|
|
18046
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
18046
|
+
if ("object" != _typeof$1(t) || !t) return t;
|
|
18047
18047
|
var e = t[toPrimitive$2];
|
|
18048
18048
|
if (void 0 !== e) {
|
|
18049
18049
|
var i = e.call(t, r || "default");
|
|
18050
|
-
if ("object" != _typeof(i)) return i;
|
|
18050
|
+
if ("object" != _typeof$1(i)) return i;
|
|
18051
18051
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18052
18052
|
}
|
|
18053
18053
|
return ("string" === r ? String : Number)(t);
|
|
@@ -18055,10 +18055,10 @@ function toPrimitive$1(t, r) {
|
|
|
18055
18055
|
|
|
18056
18056
|
function toPropertyKey(t) {
|
|
18057
18057
|
var i = toPrimitive$1(t, "string");
|
|
18058
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
18058
|
+
return "symbol" == _typeof$1(i) ? i : i + "";
|
|
18059
18059
|
}
|
|
18060
18060
|
|
|
18061
|
-
function _defineProperty$
|
|
18061
|
+
function _defineProperty$2(e, r, t) {
|
|
18062
18062
|
return (r = toPropertyKey(r)) in e ? defineProperty$1(e, r, {
|
|
18063
18063
|
value: t,
|
|
18064
18064
|
enumerable: !0,
|
|
@@ -18074,7 +18074,7 @@ function _objectSpread(e) {
|
|
|
18074
18074
|
"function" == typeof getOwnPropertySymbols && o.push.apply(o, getOwnPropertySymbols(t).filter(function (e) {
|
|
18075
18075
|
return getOwnPropertyDescriptor(t, e).enumerable;
|
|
18076
18076
|
})), o.forEach(function (r) {
|
|
18077
|
-
_defineProperty$
|
|
18077
|
+
_defineProperty$2(e, r, t[r]);
|
|
18078
18078
|
});
|
|
18079
18079
|
}
|
|
18080
18080
|
return e;
|
|
@@ -18113,7 +18113,7 @@ function _assertThisInitialized(e) {
|
|
|
18113
18113
|
}
|
|
18114
18114
|
|
|
18115
18115
|
function _possibleConstructorReturn(t, e) {
|
|
18116
|
-
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
18116
|
+
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
18117
18117
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
18118
18118
|
return _assertThisInitialized(t);
|
|
18119
18119
|
}
|
|
@@ -19493,7 +19493,7 @@ var defineProperty = (function() {
|
|
|
19493
19493
|
} catch (e) {}
|
|
19494
19494
|
}());
|
|
19495
19495
|
|
|
19496
|
-
var _defineProperty = defineProperty;
|
|
19496
|
+
var _defineProperty$1 = defineProperty;
|
|
19497
19497
|
|
|
19498
19498
|
/**
|
|
19499
19499
|
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
@@ -19505,8 +19505,8 @@ var _defineProperty = defineProperty;
|
|
|
19505
19505
|
* @param {*} value The value to assign.
|
|
19506
19506
|
*/
|
|
19507
19507
|
function baseAssignValue(object, key, value) {
|
|
19508
|
-
if (key == '__proto__' && _defineProperty) {
|
|
19509
|
-
_defineProperty(object, key, {
|
|
19508
|
+
if (key == '__proto__' && _defineProperty$1) {
|
|
19509
|
+
_defineProperty$1(object, key, {
|
|
19510
19510
|
'configurable': true,
|
|
19511
19511
|
'enumerable': true,
|
|
19512
19512
|
'value': value,
|
|
@@ -20035,8 +20035,8 @@ var identity_1 = identity;
|
|
|
20035
20035
|
* @param {Function} string The `toString` result.
|
|
20036
20036
|
* @returns {Function} Returns `func`.
|
|
20037
20037
|
*/
|
|
20038
|
-
var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
|
|
20039
|
-
return _defineProperty(func, 'toString', {
|
|
20038
|
+
var baseSetToString = !_defineProperty$1 ? identity_1 : function(func, string) {
|
|
20039
|
+
return _defineProperty$1(func, 'toString', {
|
|
20040
20040
|
'configurable': true,
|
|
20041
20041
|
'enumerable': false,
|
|
20042
20042
|
'value': constant_1(string),
|
|
@@ -21203,17 +21203,17 @@ _export(_export.S + _export.F, 'Object', { assign: _objectAssign });
|
|
|
21203
21203
|
|
|
21204
21204
|
var assign = _core.Object.assign;
|
|
21205
21205
|
|
|
21206
|
-
function _extends() {
|
|
21207
|
-
return _extends = assign ? assign.bind() : function (n) {
|
|
21206
|
+
function _extends$1() {
|
|
21207
|
+
return _extends$1 = assign ? assign.bind() : function (n) {
|
|
21208
21208
|
for (var e = 1; e < arguments.length; e++) {
|
|
21209
21209
|
var t = arguments[e];
|
|
21210
21210
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
21211
21211
|
}
|
|
21212
21212
|
return n;
|
|
21213
|
-
}, _extends.apply(null, arguments);
|
|
21213
|
+
}, _extends$1.apply(null, arguments);
|
|
21214
21214
|
}
|
|
21215
21215
|
|
|
21216
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
21216
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
21217
21217
|
if (null == r) return {};
|
|
21218
21218
|
var t = {};
|
|
21219
21219
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -21223,11 +21223,11 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
21223
21223
|
return t;
|
|
21224
21224
|
}
|
|
21225
21225
|
|
|
21226
|
-
function _objectWithoutProperties(e, t) {
|
|
21226
|
+
function _objectWithoutProperties$1(e, t) {
|
|
21227
21227
|
if (null == e) return {};
|
|
21228
21228
|
var o,
|
|
21229
21229
|
r,
|
|
21230
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
21230
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
21231
21231
|
if (getOwnPropertySymbols) {
|
|
21232
21232
|
var n = getOwnPropertySymbols(e);
|
|
21233
21233
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
@@ -23768,7 +23768,7 @@ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
|
23768
23768
|
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
|
|
23769
23769
|
* // => { 'a': 1, 'b': 2 }
|
|
23770
23770
|
*/
|
|
23771
|
-
var defaults = _baseRest(function(object, sources) {
|
|
23771
|
+
var defaults$1 = _baseRest(function(object, sources) {
|
|
23772
23772
|
object = Object(object);
|
|
23773
23773
|
|
|
23774
23774
|
var index = -1;
|
|
@@ -23799,7 +23799,7 @@ var defaults = _baseRest(function(object, sources) {
|
|
|
23799
23799
|
return object;
|
|
23800
23800
|
});
|
|
23801
23801
|
|
|
23802
|
-
var defaults_1 = defaults;
|
|
23802
|
+
var defaults_1 = defaults$1;
|
|
23803
23803
|
|
|
23804
23804
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
23805
23805
|
var nativeMin = Math.min;
|
|
@@ -26036,9 +26036,9 @@ function IconButton$1(props) {
|
|
|
26036
26036
|
type = _props$type === void 0 ? "default" : _props$type,
|
|
26037
26037
|
icon = props.icon,
|
|
26038
26038
|
className = props.className,
|
|
26039
|
-
otherProps = _objectWithoutProperties(props, ["type", "icon", "className"]);
|
|
26039
|
+
otherProps = _objectWithoutProperties$1(props, ["type", "icon", "className"]);
|
|
26040
26040
|
|
|
26041
|
-
return react.createElement("button", _extends({
|
|
26041
|
+
return react.createElement("button", _extends$1({
|
|
26042
26042
|
type: "button",
|
|
26043
26043
|
className: "btn btn-".concat(type, " ").concat(className)
|
|
26044
26044
|
}, otherProps), react.createElement("i", {
|
|
@@ -26326,7 +26326,7 @@ var REDUCE_TIME = 1567752802062;
|
|
|
26326
26326
|
|
|
26327
26327
|
// don't change unless we change the algos or REDUCE_TIME
|
|
26328
26328
|
// must be an integer and less than 16
|
|
26329
|
-
var version = 7;
|
|
26329
|
+
var version$1 = 7;
|
|
26330
26330
|
|
|
26331
26331
|
// Counter is used when shortid is called multiple times in one second.
|
|
26332
26332
|
var counter$1;
|
|
@@ -26350,7 +26350,7 @@ function build(clusterWorkerId) {
|
|
|
26350
26350
|
previousSeconds = seconds;
|
|
26351
26351
|
}
|
|
26352
26352
|
|
|
26353
|
-
str = str + generate_1(version);
|
|
26353
|
+
str = str + generate_1(version$1);
|
|
26354
26354
|
str = str + generate_1(clusterWorkerId);
|
|
26355
26355
|
if (counter$1 > 0) {
|
|
26356
26356
|
str = str + generate_1(counter$1);
|
|
@@ -26604,7 +26604,7 @@ function (_Component) {
|
|
|
26604
26604
|
|
|
26605
26605
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayField).call(this, props));
|
|
26606
26606
|
|
|
26607
|
-
_defineProperty$
|
|
26607
|
+
_defineProperty$2(_assertThisInitialized(_this), "_getNewFormDataRow", function () {
|
|
26608
26608
|
var _this$props = _this.props,
|
|
26609
26609
|
schema = _this$props.schema,
|
|
26610
26610
|
_this$props$registry = _this$props.registry,
|
|
@@ -26619,7 +26619,7 @@ function (_Component) {
|
|
|
26619
26619
|
return getDefaultFormState$1(itemSchema, undefined, rootSchema);
|
|
26620
26620
|
});
|
|
26621
26621
|
|
|
26622
|
-
_defineProperty$
|
|
26622
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddClick", function (event) {
|
|
26623
26623
|
if (event) {
|
|
26624
26624
|
event.preventDefault();
|
|
26625
26625
|
}
|
|
@@ -26639,7 +26639,7 @@ function (_Component) {
|
|
|
26639
26639
|
});
|
|
26640
26640
|
});
|
|
26641
26641
|
|
|
26642
|
-
_defineProperty$
|
|
26642
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddIndexClick", function (index) {
|
|
26643
26643
|
return function (event) {
|
|
26644
26644
|
if (event) {
|
|
26645
26645
|
event.preventDefault();
|
|
@@ -26664,7 +26664,7 @@ function (_Component) {
|
|
|
26664
26664
|
};
|
|
26665
26665
|
});
|
|
26666
26666
|
|
|
26667
|
-
_defineProperty$
|
|
26667
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropIndexClick", function (index) {
|
|
26668
26668
|
return function (event) {
|
|
26669
26669
|
if (event) {
|
|
26670
26670
|
event.preventDefault();
|
|
@@ -26703,7 +26703,7 @@ function (_Component) {
|
|
|
26703
26703
|
};
|
|
26704
26704
|
});
|
|
26705
26705
|
|
|
26706
|
-
_defineProperty$
|
|
26706
|
+
_defineProperty$2(_assertThisInitialized(_this), "onReorderClick", function (index, newIndex) {
|
|
26707
26707
|
return function (event) {
|
|
26708
26708
|
if (event) {
|
|
26709
26709
|
event.preventDefault();
|
|
@@ -26752,7 +26752,7 @@ function (_Component) {
|
|
|
26752
26752
|
};
|
|
26753
26753
|
});
|
|
26754
26754
|
|
|
26755
|
-
_defineProperty$
|
|
26755
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChangeForIndex", function (index) {
|
|
26756
26756
|
return function (value, errorSchema) {
|
|
26757
26757
|
var _this$props2 = _this.props,
|
|
26758
26758
|
formData = _this$props2.formData,
|
|
@@ -26763,11 +26763,11 @@ function (_Component) {
|
|
|
26763
26763
|
var jsonValue = typeof value === "undefined" ? null : value;
|
|
26764
26764
|
return index === i ? jsonValue : item;
|
|
26765
26765
|
});
|
|
26766
|
-
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
26766
|
+
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, index, errorSchema)));
|
|
26767
26767
|
};
|
|
26768
26768
|
});
|
|
26769
26769
|
|
|
26770
|
-
_defineProperty$
|
|
26770
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSelectChange", function (value) {
|
|
26771
26771
|
_this.props.onChange(value);
|
|
26772
26772
|
});
|
|
26773
26773
|
|
|
@@ -26956,7 +26956,7 @@ function (_Component) {
|
|
|
26956
26956
|
}),
|
|
26957
26957
|
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
26958
26958
|
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
26959
|
-
options = _objectWithoutProperties(_getUiOptions$enumOpt, ["widget"]);
|
|
26959
|
+
options = _objectWithoutProperties$1(_getUiOptions$enumOpt, ["widget"]);
|
|
26960
26960
|
|
|
26961
26961
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
26962
26962
|
return react.createElement(Widget, {
|
|
@@ -27003,7 +27003,7 @@ function (_Component) {
|
|
|
27003
27003
|
var _getUiOptions2 = getUiOptions$1(uiSchema),
|
|
27004
27004
|
_getUiOptions2$widget = _getUiOptions2.widget,
|
|
27005
27005
|
widget = _getUiOptions2$widget === void 0 ? "files" : _getUiOptions2$widget,
|
|
27006
|
-
options = _objectWithoutProperties(_getUiOptions2, ["widget"]);
|
|
27006
|
+
options = _objectWithoutProperties$1(_getUiOptions2, ["widget"]);
|
|
27007
27007
|
|
|
27008
27008
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
27009
27009
|
return react.createElement(Widget, {
|
|
@@ -27217,7 +27217,7 @@ function (_Component) {
|
|
|
27217
27217
|
return ArrayField;
|
|
27218
27218
|
}(react.Component);
|
|
27219
27219
|
|
|
27220
|
-
_defineProperty$
|
|
27220
|
+
_defineProperty$2(ArrayField$2, "defaultProps", {
|
|
27221
27221
|
uiSchema: {},
|
|
27222
27222
|
formData: [],
|
|
27223
27223
|
idSchema: {},
|
|
@@ -27251,7 +27251,7 @@ function BooleanField$1(props) {
|
|
|
27251
27251
|
var _getUiOptions = getUiOptions$1(uiSchema),
|
|
27252
27252
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
27253
27253
|
widget = _getUiOptions$widget === void 0 ? "checkbox" : _getUiOptions$widget,
|
|
27254
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
27254
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
27255
27255
|
|
|
27256
27256
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
27257
27257
|
var enumOptions;
|
|
@@ -27343,7 +27343,7 @@ function (_Component) {
|
|
|
27343
27343
|
|
|
27344
27344
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AnyOfField).call(this, props));
|
|
27345
27345
|
|
|
27346
|
-
_defineProperty$
|
|
27346
|
+
_defineProperty$2(_assertThisInitialized(_this), "onOptionChange", function (option) {
|
|
27347
27347
|
var selectedOption = _parseInt(option, 10);
|
|
27348
27348
|
|
|
27349
27349
|
var _this$props = _this.props,
|
|
@@ -27358,7 +27358,7 @@ function (_Component) {
|
|
|
27358
27358
|
var newFormData = undefined;
|
|
27359
27359
|
|
|
27360
27360
|
if (guessType$1(formData) === "object" && (newOption.type === "object" || newOption.properties)) {
|
|
27361
|
-
newFormData = _extends({}, formData);
|
|
27361
|
+
newFormData = _extends$1({}, formData);
|
|
27362
27362
|
var optionsToDiscard = options.slice();
|
|
27363
27363
|
optionsToDiscard.splice(selectedOption, 1); // Discard any data added using other options
|
|
27364
27364
|
|
|
@@ -27464,7 +27464,7 @@ function (_Component) {
|
|
|
27464
27464
|
var _getUiOptions = getUiOptions$1(uiSchema),
|
|
27465
27465
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
27466
27466
|
widget = _getUiOptions$widget === void 0 ? "select" : _getUiOptions$widget,
|
|
27467
|
-
uiOptions = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
27467
|
+
uiOptions = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
27468
27468
|
|
|
27469
27469
|
var Widget = getWidget$1({
|
|
27470
27470
|
type: "number"
|
|
@@ -27475,7 +27475,7 @@ function (_Component) {
|
|
|
27475
27475
|
if (option) {
|
|
27476
27476
|
// If the subschema doesn't declare a type, infer the type from the
|
|
27477
27477
|
// parent schema
|
|
27478
|
-
optionSchema = option.type ? option : _extends({}, option, {
|
|
27478
|
+
optionSchema = option.type ? option : _extends$1({}, option, {
|
|
27479
27479
|
type: baseType
|
|
27480
27480
|
});
|
|
27481
27481
|
}
|
|
@@ -27490,7 +27490,7 @@ function (_Component) {
|
|
|
27490
27490
|
className: "panel panel-default panel-body"
|
|
27491
27491
|
}, react.createElement("div", {
|
|
27492
27492
|
className: "form-group"
|
|
27493
|
-
}, react.createElement(Widget, _extends({
|
|
27493
|
+
}, react.createElement(Widget, _extends$1({
|
|
27494
27494
|
id: "".concat(idSchema.$id).concat(schema.oneOf ? "__oneof_select" : "__anyof_select"),
|
|
27495
27495
|
schema: {
|
|
27496
27496
|
type: "number",
|
|
@@ -27569,7 +27569,7 @@ function (_React$Component) {
|
|
|
27569
27569
|
|
|
27570
27570
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(NumberField).call(this, props));
|
|
27571
27571
|
|
|
27572
|
-
_defineProperty$
|
|
27572
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleChange", function (value) {
|
|
27573
27573
|
// Cache the original value in component state
|
|
27574
27574
|
_this.setState({
|
|
27575
27575
|
lastValue: value
|
|
@@ -27602,7 +27602,7 @@ function (_React$Component) {
|
|
|
27602
27602
|
|
|
27603
27603
|
var _this$props = this.props,
|
|
27604
27604
|
formData = _this$props.formData,
|
|
27605
|
-
props = _objectWithoutProperties(_this$props, ["formData"]);
|
|
27605
|
+
props = _objectWithoutProperties$1(_this$props, ["formData"]);
|
|
27606
27606
|
|
|
27607
27607
|
var lastValue = this.state.lastValue;
|
|
27608
27608
|
var value = formData;
|
|
@@ -27619,7 +27619,7 @@ function (_React$Component) {
|
|
|
27619
27619
|
}
|
|
27620
27620
|
}
|
|
27621
27621
|
|
|
27622
|
-
return react.createElement(StringField, _extends({}, props, {
|
|
27622
|
+
return react.createElement(StringField, _extends$1({}, props, {
|
|
27623
27623
|
formData: value,
|
|
27624
27624
|
onChange: this.handleChange
|
|
27625
27625
|
}));
|
|
@@ -27681,12 +27681,12 @@ function (_Component) {
|
|
|
27681
27681
|
|
|
27682
27682
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ObjectField)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
27683
27683
|
|
|
27684
|
-
_defineProperty$
|
|
27684
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", {
|
|
27685
27685
|
wasPropertyKeyModified: false,
|
|
27686
27686
|
additionalProperties: {}
|
|
27687
27687
|
});
|
|
27688
27688
|
|
|
27689
|
-
_defineProperty$
|
|
27689
|
+
_defineProperty$2(_assertThisInitialized(_this), "onPropertyChange", function (name) {
|
|
27690
27690
|
var addedByAdditionalProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
27691
27691
|
return function (value, errorSchema) {
|
|
27692
27692
|
if (!value && addedByAdditionalProperties) {
|
|
@@ -27700,13 +27700,13 @@ function (_Component) {
|
|
|
27700
27700
|
value = "";
|
|
27701
27701
|
}
|
|
27702
27702
|
|
|
27703
|
-
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$
|
|
27703
|
+
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$2({}, name, value));
|
|
27704
27704
|
|
|
27705
|
-
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
27705
|
+
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, name, errorSchema)));
|
|
27706
27706
|
};
|
|
27707
27707
|
});
|
|
27708
27708
|
|
|
27709
|
-
_defineProperty$
|
|
27709
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropPropertyClick", function (key) {
|
|
27710
27710
|
return function (event) {
|
|
27711
27711
|
event.preventDefault();
|
|
27712
27712
|
var _this$props = _this.props,
|
|
@@ -27720,7 +27720,7 @@ function (_Component) {
|
|
|
27720
27720
|
};
|
|
27721
27721
|
});
|
|
27722
27722
|
|
|
27723
|
-
_defineProperty$
|
|
27723
|
+
_defineProperty$2(_assertThisInitialized(_this), "getAvailableKey", function (preferredKey, formData) {
|
|
27724
27724
|
var index = 0;
|
|
27725
27725
|
var newKey = preferredKey;
|
|
27726
27726
|
|
|
@@ -27731,7 +27731,7 @@ function (_Component) {
|
|
|
27731
27731
|
return newKey;
|
|
27732
27732
|
});
|
|
27733
27733
|
|
|
27734
|
-
_defineProperty$
|
|
27734
|
+
_defineProperty$2(_assertThisInitialized(_this), "onKeyChange", function (oldValue) {
|
|
27735
27735
|
return function (value, errorSchema) {
|
|
27736
27736
|
if (oldValue === value) {
|
|
27737
27737
|
return;
|
|
@@ -27741,24 +27741,24 @@ function (_Component) {
|
|
|
27741
27741
|
|
|
27742
27742
|
var newFormData = _objectSpread({}, _this.props.formData);
|
|
27743
27743
|
|
|
27744
|
-
var newKeys = _defineProperty$
|
|
27744
|
+
var newKeys = _defineProperty$2({}, oldValue, value);
|
|
27745
27745
|
|
|
27746
27746
|
var keyValues = keys$3(newFormData).map(function (key) {
|
|
27747
27747
|
var newKey = newKeys[key] || key;
|
|
27748
|
-
return _defineProperty$
|
|
27748
|
+
return _defineProperty$2({}, newKey, newFormData[key]);
|
|
27749
27749
|
});
|
|
27750
27750
|
|
|
27751
|
-
var renamedObj = _extends.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
27751
|
+
var renamedObj = _extends$1.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
27752
27752
|
|
|
27753
27753
|
_this.setState({
|
|
27754
27754
|
wasPropertyKeyModified: true
|
|
27755
27755
|
});
|
|
27756
27756
|
|
|
27757
|
-
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
27757
|
+
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, value, errorSchema)));
|
|
27758
27758
|
};
|
|
27759
27759
|
});
|
|
27760
27760
|
|
|
27761
|
-
_defineProperty$
|
|
27761
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleAddClick", function (schema) {
|
|
27762
27762
|
return function () {
|
|
27763
27763
|
var type = schema.additionalProperties.type;
|
|
27764
27764
|
|
|
@@ -27902,7 +27902,7 @@ function (_Component) {
|
|
|
27902
27902
|
formData: formData,
|
|
27903
27903
|
formContext: formContext
|
|
27904
27904
|
};
|
|
27905
|
-
return react.createElement(Template, _extends({}, templateProps, {
|
|
27905
|
+
return react.createElement(Template, _extends$1({}, templateProps, {
|
|
27906
27906
|
onAddClick: this.handleAddClick
|
|
27907
27907
|
}));
|
|
27908
27908
|
}
|
|
@@ -27911,7 +27911,7 @@ function (_Component) {
|
|
|
27911
27911
|
return ObjectField;
|
|
27912
27912
|
}(react.Component);
|
|
27913
27913
|
|
|
27914
|
-
_defineProperty$
|
|
27914
|
+
_defineProperty$2(ObjectField$2, "defaultProps", {
|
|
27915
27915
|
uiSchema: {},
|
|
27916
27916
|
formData: {},
|
|
27917
27917
|
errorSchema: {},
|
|
@@ -28151,10 +28151,10 @@ function SchemaFieldRender$1(props) {
|
|
|
28151
28151
|
var displayLabel = getDisplayLabel$1(schema, uiSchema, rootSchema);
|
|
28152
28152
|
|
|
28153
28153
|
var __errors = errorSchema.__errors,
|
|
28154
|
-
fieldErrorSchema = _objectWithoutProperties(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
28154
|
+
fieldErrorSchema = _objectWithoutProperties$1(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
28155
28155
|
|
|
28156
28156
|
|
|
28157
|
-
var field = react.createElement(FieldComponent, _extends({}, props, {
|
|
28157
|
+
var field = react.createElement(FieldComponent, _extends$1({}, props, {
|
|
28158
28158
|
idSchema: idSchema,
|
|
28159
28159
|
schema: schema,
|
|
28160
28160
|
uiSchema: _objectSpread({}, uiSchema, {
|
|
@@ -28315,7 +28315,7 @@ function StringField$1(props) {
|
|
|
28315
28315
|
widget = _getUiOptions$widget === void 0 ? defaultWidget : _getUiOptions$widget,
|
|
28316
28316
|
_getUiOptions$placeho = _getUiOptions.placeholder,
|
|
28317
28317
|
placeholder = _getUiOptions$placeho === void 0 ? "" : _getUiOptions$placeho,
|
|
28318
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget", "placeholder"]);
|
|
28318
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget", "placeholder"]);
|
|
28319
28319
|
|
|
28320
28320
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
28321
28321
|
return react.createElement(Widget, {
|
|
@@ -28478,8 +28478,8 @@ function (_Component) {
|
|
|
28478
28478
|
|
|
28479
28479
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AltDateWidget).call(this, props));
|
|
28480
28480
|
|
|
28481
|
-
_defineProperty$
|
|
28482
|
-
_this.setState(_defineProperty$
|
|
28481
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (property, value) {
|
|
28482
|
+
_this.setState(_defineProperty$2({}, property, typeof value === "undefined" ? -1 : value), function () {
|
|
28483
28483
|
// Only propagate to parent state if we have a complete date{time}
|
|
28484
28484
|
if (readyForChange$1(_this.state)) {
|
|
28485
28485
|
_this.props.onChange(toDateString$1(_this.state, _this.props.time));
|
|
@@ -28487,7 +28487,7 @@ function (_Component) {
|
|
|
28487
28487
|
});
|
|
28488
28488
|
});
|
|
28489
28489
|
|
|
28490
|
-
_defineProperty$
|
|
28490
|
+
_defineProperty$2(_assertThisInitialized(_this), "setNow", function (event) {
|
|
28491
28491
|
event.preventDefault();
|
|
28492
28492
|
var _this$props = _this.props,
|
|
28493
28493
|
time = _this$props.time,
|
|
@@ -28506,7 +28506,7 @@ function (_Component) {
|
|
|
28506
28506
|
});
|
|
28507
28507
|
});
|
|
28508
28508
|
|
|
28509
|
-
_defineProperty$
|
|
28509
|
+
_defineProperty$2(_assertThisInitialized(_this), "clear", function (event) {
|
|
28510
28510
|
event.preventDefault();
|
|
28511
28511
|
var _this$props2 = _this.props,
|
|
28512
28512
|
time = _this$props2.time,
|
|
@@ -28555,7 +28555,7 @@ function (_Component) {
|
|
|
28555
28555
|
}, this.dateElementProps.map(function (elemProps, i) {
|
|
28556
28556
|
return react.createElement("li", {
|
|
28557
28557
|
key: i
|
|
28558
|
-
}, react.createElement(DateElement$1, _extends({
|
|
28558
|
+
}, react.createElement(DateElement$1, _extends$1({
|
|
28559
28559
|
rootId: id,
|
|
28560
28560
|
select: _this2.onChange
|
|
28561
28561
|
}, elemProps, {
|
|
@@ -28625,7 +28625,7 @@ function (_Component) {
|
|
|
28625
28625
|
return AltDateWidget;
|
|
28626
28626
|
}(react.Component);
|
|
28627
28627
|
|
|
28628
|
-
_defineProperty$
|
|
28628
|
+
_defineProperty$2(AltDateWidget$1, "defaultProps", {
|
|
28629
28629
|
time: false,
|
|
28630
28630
|
disabled: false,
|
|
28631
28631
|
readonly: false,
|
|
@@ -28637,7 +28637,7 @@ _defineProperty$1(AltDateWidget$1, "defaultProps", {
|
|
|
28637
28637
|
|
|
28638
28638
|
function AltDateTimeWidget$1(props) {
|
|
28639
28639
|
var AltDateWidget = props.registry.widgets.AltDateWidget;
|
|
28640
|
-
return react.createElement(AltDateWidget, _extends({
|
|
28640
|
+
return react.createElement(AltDateWidget, _extends$1({
|
|
28641
28641
|
time: true
|
|
28642
28642
|
}, props));
|
|
28643
28643
|
}
|
|
@@ -28662,7 +28662,7 @@ function BaseInput$1(props) {
|
|
|
28662
28662
|
onFocus = props.onFocus,
|
|
28663
28663
|
options = props.options,
|
|
28664
28664
|
schema = props.schema,
|
|
28665
|
-
inputProps = _objectWithoutProperties(props, ["value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors"]); // If options.inputType is set use that as the input type
|
|
28665
|
+
inputProps = _objectWithoutProperties$1(props, ["value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors"]); // If options.inputType is set use that as the input type
|
|
28666
28666
|
|
|
28667
28667
|
|
|
28668
28668
|
if (options.inputType) {
|
|
@@ -28707,7 +28707,7 @@ function BaseInput$1(props) {
|
|
|
28707
28707
|
return props.onChange(value === "" ? options.emptyValue : value);
|
|
28708
28708
|
};
|
|
28709
28709
|
|
|
28710
|
-
return [react.createElement("input", _extends({
|
|
28710
|
+
return [react.createElement("input", _extends$1({
|
|
28711
28711
|
key: inputProps.id,
|
|
28712
28712
|
className: "form-control",
|
|
28713
28713
|
readOnly: readonly,
|
|
@@ -28857,7 +28857,7 @@ function ColorWidget$1(props) {
|
|
|
28857
28857
|
var disabled = props.disabled,
|
|
28858
28858
|
readonly = props.readonly,
|
|
28859
28859
|
BaseInput = props.registry.widgets.BaseInput;
|
|
28860
|
-
return react.createElement(BaseInput, _extends({
|
|
28860
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28861
28861
|
type: "color"
|
|
28862
28862
|
}, props, {
|
|
28863
28863
|
disabled: disabled || readonly
|
|
@@ -28867,7 +28867,7 @@ function ColorWidget$1(props) {
|
|
|
28867
28867
|
function DateWidget$1(props) {
|
|
28868
28868
|
var _onChange = props.onChange,
|
|
28869
28869
|
BaseInput = props.registry.widgets.BaseInput;
|
|
28870
|
-
return react.createElement(BaseInput, _extends({
|
|
28870
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28871
28871
|
type: "date"
|
|
28872
28872
|
}, props, {
|
|
28873
28873
|
onChange: function onChange(value) {
|
|
@@ -28880,7 +28880,7 @@ function DateTimeWidget$1(props) {
|
|
|
28880
28880
|
var value = props.value,
|
|
28881
28881
|
_onChange = props.onChange,
|
|
28882
28882
|
BaseInput = props.registry.widgets.BaseInput;
|
|
28883
|
-
return react.createElement(BaseInput, _extends({
|
|
28883
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28884
28884
|
type: "datetime-local"
|
|
28885
28885
|
}, props, {
|
|
28886
28886
|
value: utcToLocal$1(value),
|
|
@@ -28892,7 +28892,7 @@ function DateTimeWidget$1(props) {
|
|
|
28892
28892
|
|
|
28893
28893
|
function EmailWidget$1(props) {
|
|
28894
28894
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
28895
|
-
return react.createElement(BaseInput, _extends({
|
|
28895
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28896
28896
|
type: "email"
|
|
28897
28897
|
}, props));
|
|
28898
28898
|
}
|
|
@@ -29497,7 +29497,7 @@ function (_Component) {
|
|
|
29497
29497
|
|
|
29498
29498
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(FileWidget).call(this, props));
|
|
29499
29499
|
|
|
29500
|
-
_defineProperty$
|
|
29500
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (event) {
|
|
29501
29501
|
var _this$props = _this.props,
|
|
29502
29502
|
multiple = _this$props.multiple,
|
|
29503
29503
|
onChange = _this$props.onChange;
|
|
@@ -29583,7 +29583,7 @@ function HiddenWidget$1(_ref) {
|
|
|
29583
29583
|
|
|
29584
29584
|
function PasswordWidget$1(props) {
|
|
29585
29585
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
29586
|
-
return react.createElement(BaseInput, _extends({
|
|
29586
|
+
return react.createElement(BaseInput, _extends$1({
|
|
29587
29587
|
type: "password"
|
|
29588
29588
|
}, props));
|
|
29589
29589
|
}
|
|
@@ -29651,7 +29651,7 @@ function RangeWidget$1(props) {
|
|
|
29651
29651
|
BaseInput = props.registry.widgets.BaseInput;
|
|
29652
29652
|
return react.createElement("div", {
|
|
29653
29653
|
className: "field-range-wrapper"
|
|
29654
|
-
}, react.createElement(BaseInput, _extends({
|
|
29654
|
+
}, react.createElement(BaseInput, _extends$1({
|
|
29655
29655
|
type: "range"
|
|
29656
29656
|
}, props, rangeSpec$1(schema))), react.createElement("span", {
|
|
29657
29657
|
className: "range-view"
|
|
@@ -29814,14 +29814,14 @@ function TextWidget$1(props) {
|
|
|
29814
29814
|
|
|
29815
29815
|
function URLWidget$1(props) {
|
|
29816
29816
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
29817
|
-
return react.createElement(BaseInput, _extends({
|
|
29817
|
+
return react.createElement(BaseInput, _extends$1({
|
|
29818
29818
|
type: "url"
|
|
29819
29819
|
}, props));
|
|
29820
29820
|
}
|
|
29821
29821
|
|
|
29822
29822
|
function UpDownWidget$1(props) {
|
|
29823
29823
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
29824
|
-
return react.createElement(BaseInput, _extends({
|
|
29824
|
+
return react.createElement(BaseInput, _extends$1({
|
|
29825
29825
|
type: "number"
|
|
29826
29826
|
}, props, rangeSpec$1(props.schema)));
|
|
29827
29827
|
}
|
|
@@ -37098,13 +37098,13 @@ function createErrorHandler$1(formData) {
|
|
|
37098
37098
|
|
|
37099
37099
|
if (isObject$1(formData)) {
|
|
37100
37100
|
return keys$3(formData).reduce(function (acc, key) {
|
|
37101
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37101
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler$1(formData[key])));
|
|
37102
37102
|
}, handler);
|
|
37103
37103
|
}
|
|
37104
37104
|
|
|
37105
37105
|
if (isArray$2(formData)) {
|
|
37106
37106
|
return formData.reduce(function (acc, value, key) {
|
|
37107
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37107
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler$1(value)));
|
|
37108
37108
|
}, handler);
|
|
37109
37109
|
}
|
|
37110
37110
|
|
|
@@ -37116,10 +37116,10 @@ function unwrapErrorHandler$1(errorHandler) {
|
|
|
37116
37116
|
if (key === "addError") {
|
|
37117
37117
|
return acc;
|
|
37118
37118
|
} else if (key === "__errors") {
|
|
37119
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37119
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, errorHandler[key]));
|
|
37120
37120
|
}
|
|
37121
37121
|
|
|
37122
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37122
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, unwrapErrorHandler$1(errorHandler[key])));
|
|
37123
37123
|
}, {});
|
|
37124
37124
|
}
|
|
37125
37125
|
/**
|
|
@@ -37255,9 +37255,9 @@ function isValid$1(schema, data) {
|
|
|
37255
37255
|
}
|
|
37256
37256
|
}
|
|
37257
37257
|
|
|
37258
|
-
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
37258
|
+
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
37259
37259
|
|
|
37260
|
-
function _toPrimitive$1(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
37260
|
+
function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
37261
37261
|
var ADDITIONAL_PROPERTY_FLAG$1 = "__additional_property";
|
|
37262
37262
|
var widgetMap$1 = {
|
|
37263
37263
|
"boolean": {
|
|
@@ -37376,9 +37376,9 @@ function getWidget$1(schema, widget) {
|
|
|
37376
37376
|
Widget.MergedWidget = function (_ref) {
|
|
37377
37377
|
var _ref$options = _ref.options,
|
|
37378
37378
|
options = _ref$options === void 0 ? {} : _ref$options,
|
|
37379
|
-
props = _objectWithoutProperties(_ref, ["options"]);
|
|
37379
|
+
props = _objectWithoutProperties$1(_ref, ["options"]);
|
|
37380
37380
|
|
|
37381
|
-
return react.createElement(Widget, _extends({
|
|
37381
|
+
return react.createElement(Widget, _extends$1({
|
|
37382
37382
|
options: _objectSpread({}, defaultOptions, options)
|
|
37383
37383
|
}, props));
|
|
37384
37384
|
};
|
|
@@ -37392,7 +37392,7 @@ function getWidget$1(schema, widget) {
|
|
|
37392
37392
|
}
|
|
37393
37393
|
|
|
37394
37394
|
if (typeof widget !== "string") {
|
|
37395
|
-
throw new Error("Unsupported widget definition: ".concat(_typeof(widget)));
|
|
37395
|
+
throw new Error("Unsupported widget definition: ".concat(_typeof$1(widget)));
|
|
37396
37396
|
}
|
|
37397
37397
|
|
|
37398
37398
|
if (registeredWidgets.hasOwnProperty(widget)) {
|
|
@@ -37565,7 +37565,7 @@ function mergeDefaultsWithFormData$1(defaults, formData) {
|
|
|
37565
37565
|
return value;
|
|
37566
37566
|
});
|
|
37567
37567
|
} else if (isObject$1(formData)) {
|
|
37568
|
-
var acc = _extends({}, defaults); // Prevent mutation of source object.
|
|
37568
|
+
var acc = _extends$1({}, defaults); // Prevent mutation of source object.
|
|
37569
37569
|
|
|
37570
37570
|
|
|
37571
37571
|
return keys$3(formData).reduce(function (acc, key) {
|
|
@@ -37594,7 +37594,7 @@ function getUiOptions$1(uiSchema) {
|
|
|
37594
37594
|
return _objectSpread({}, options, value);
|
|
37595
37595
|
}
|
|
37596
37596
|
|
|
37597
|
-
return _objectSpread({}, options, _defineProperty$
|
|
37597
|
+
return _objectSpread({}, options, _defineProperty$2({}, key.substring(3), value));
|
|
37598
37598
|
}, {});
|
|
37599
37599
|
}
|
|
37600
37600
|
function getDisplayLabel$1(schema, uiSchema, rootSchema) {
|
|
@@ -37625,13 +37625,13 @@ function isObject$1(thing) {
|
|
|
37625
37625
|
return false;
|
|
37626
37626
|
}
|
|
37627
37627
|
|
|
37628
|
-
return _typeof(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
37628
|
+
return _typeof$1(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
37629
37629
|
}
|
|
37630
37630
|
function mergeObjects$1(obj1, obj2) {
|
|
37631
37631
|
var concatArrays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
37632
37632
|
|
|
37633
37633
|
// Recursively merge deeply nested objects.
|
|
37634
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
37634
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
37635
37635
|
|
|
37636
37636
|
|
|
37637
37637
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -37847,7 +37847,7 @@ var guessType$1 = function guessType(value) {
|
|
|
37847
37847
|
return "boolean";
|
|
37848
37848
|
} else if (!isNaN(value)) {
|
|
37849
37849
|
return "number";
|
|
37850
|
-
} else if (_typeof(value) === "object") {
|
|
37850
|
+
} else if (_typeof$1(value) === "object") {
|
|
37851
37851
|
return "object";
|
|
37852
37852
|
} // Default to string if we can't figure it out
|
|
37853
37853
|
|
|
@@ -37916,7 +37916,7 @@ function resolveReference$1(schema, rootSchema, formData) {
|
|
|
37916
37916
|
// Retrieve the referenced schema definition.
|
|
37917
37917
|
var $refSchema = findSchemaDefinition$1(schema.$ref, rootSchema); // Drop the $ref property of the source schema.
|
|
37918
37918
|
|
|
37919
|
-
var localSchema = _objectWithoutProperties(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
37919
|
+
var localSchema = _objectWithoutProperties$1(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
37920
37920
|
|
|
37921
37921
|
|
|
37922
37922
|
return retrieveSchema$1(_objectSpread({}, $refSchema, localSchema), rootSchema, formData);
|
|
@@ -37941,7 +37941,7 @@ function retrieveSchema$1(schema) {
|
|
|
37941
37941
|
console.warn("could not merge subschemas in allOf:\n" + e);
|
|
37942
37942
|
|
|
37943
37943
|
var _resolvedSchema = resolvedSchema,
|
|
37944
|
-
resolvedSchemaWithoutAllOf = _objectWithoutProperties(_resolvedSchema, ["allOf"]);
|
|
37944
|
+
resolvedSchemaWithoutAllOf = _objectWithoutProperties$1(_resolvedSchema, ["allOf"]);
|
|
37945
37945
|
|
|
37946
37946
|
return resolvedSchemaWithoutAllOf;
|
|
37947
37947
|
}
|
|
@@ -37960,7 +37960,7 @@ function resolveDependencies$1(schema, rootSchema, formData) {
|
|
|
37960
37960
|
// Drop the dependencies from the source schema.
|
|
37961
37961
|
var _schema$dependencies = schema.dependencies,
|
|
37962
37962
|
dependencies = _schema$dependencies === void 0 ? {} : _schema$dependencies,
|
|
37963
|
-
resolvedSchema = _objectWithoutProperties(schema, ["dependencies"]);
|
|
37963
|
+
resolvedSchema = _objectWithoutProperties$1(schema, ["dependencies"]);
|
|
37964
37964
|
|
|
37965
37965
|
if ("oneOf" in resolvedSchema) {
|
|
37966
37966
|
resolvedSchema = resolvedSchema.oneOf[getMatchingOption$1(formData, resolvedSchema.oneOf)];
|
|
@@ -37985,7 +37985,7 @@ function processDependencies$1(dependencies, resolvedSchema, rootSchema, formDat
|
|
|
37985
37985
|
}
|
|
37986
37986
|
|
|
37987
37987
|
var dependencyValue = dependencies[dependencyKey],
|
|
37988
|
-
remainingDependencies = _objectWithoutProperties(dependencies, [dependencyKey].map(_toPropertyKey$1));
|
|
37988
|
+
remainingDependencies = _objectWithoutProperties$1(dependencies, [dependencyKey].map(_toPropertyKey$1));
|
|
37989
37989
|
|
|
37990
37990
|
if (isArray$2(dependencyValue)) {
|
|
37991
37991
|
resolvedSchema = withDependentProperties$1(resolvedSchema, dependencyValue);
|
|
@@ -38013,14 +38013,14 @@ function withDependentProperties$1(schema, additionallyRequired) {
|
|
|
38013
38013
|
function withDependentSchema$1(schema, rootSchema, formData, dependencyKey, dependencyValue) {
|
|
38014
38014
|
var _retrieveSchema = retrieveSchema$1(dependencyValue, rootSchema, formData),
|
|
38015
38015
|
oneOf = _retrieveSchema.oneOf,
|
|
38016
|
-
dependentSchema = _objectWithoutProperties(_retrieveSchema, ["oneOf"]);
|
|
38016
|
+
dependentSchema = _objectWithoutProperties$1(_retrieveSchema, ["oneOf"]);
|
|
38017
38017
|
|
|
38018
38018
|
schema = mergeSchemas$1(schema, dependentSchema); // Since it does not contain oneOf, we return the original schema.
|
|
38019
38019
|
|
|
38020
38020
|
if (oneOf === undefined) {
|
|
38021
38021
|
return schema;
|
|
38022
38022
|
} else if (!isArray$2(oneOf)) {
|
|
38023
|
-
throw new Error("invalid: it is some ".concat(_typeof(oneOf), " instead of an array"));
|
|
38023
|
+
throw new Error("invalid: it is some ".concat(_typeof$1(oneOf), " instead of an array"));
|
|
38024
38024
|
} // Resolve $refs inside oneOf.
|
|
38025
38025
|
|
|
38026
38026
|
|
|
@@ -38041,7 +38041,7 @@ function withExactlyOneSubschema$1(schema, rootSchema, formData, dependencyKey,
|
|
|
38041
38041
|
if (conditionPropertySchema) {
|
|
38042
38042
|
var conditionSchema = {
|
|
38043
38043
|
type: "object",
|
|
38044
|
-
properties: _defineProperty$
|
|
38044
|
+
properties: _defineProperty$2({}, dependencyKey, conditionPropertySchema)
|
|
38045
38045
|
};
|
|
38046
38046
|
|
|
38047
38047
|
var _validateFormData = validateFormData$1(formData, conditionSchema),
|
|
@@ -38059,7 +38059,7 @@ function withExactlyOneSubschema$1(schema, rootSchema, formData, dependencyKey,
|
|
|
38059
38059
|
var subschema = validSubschemas[0];
|
|
38060
38060
|
|
|
38061
38061
|
var _subschema$properties = subschema.properties,
|
|
38062
|
-
dependentSubschema = _objectWithoutProperties(_subschema$properties, [dependencyKey].map(_toPropertyKey$1));
|
|
38062
|
+
dependentSubschema = _objectWithoutProperties$1(_subschema$properties, [dependencyKey].map(_toPropertyKey$1));
|
|
38063
38063
|
|
|
38064
38064
|
var dependentSchema = _objectSpread({}, subschema, {
|
|
38065
38065
|
properties: dependentSubschema
|
|
@@ -38074,7 +38074,7 @@ function withExactlyOneSubschema$1(schema, rootSchema, formData, dependencyKey,
|
|
|
38074
38074
|
|
|
38075
38075
|
|
|
38076
38076
|
function mergeSchemas$1(obj1, obj2) {
|
|
38077
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
38077
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
38078
38078
|
|
|
38079
38079
|
|
|
38080
38080
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -38112,7 +38112,7 @@ function deepEquals$1(a, b) {
|
|
|
38112
38112
|
// Assume all functions are equivalent
|
|
38113
38113
|
// see https://github.com/rjsf-team/react-jsonschema-form/issues/255
|
|
38114
38114
|
return true;
|
|
38115
|
-
} else if (_typeof(a) !== "object" || _typeof(b) !== "object") {
|
|
38115
|
+
} else if (_typeof$1(a) !== "object" || _typeof$1(b) !== "object") {
|
|
38116
38116
|
return false;
|
|
38117
38117
|
} else if (a === null || b === null) {
|
|
38118
38118
|
return false;
|
|
@@ -38406,7 +38406,7 @@ function getMatchingOption$1(formData, options, rootSchema) {
|
|
|
38406
38406
|
|
|
38407
38407
|
if (option.anyOf) {
|
|
38408
38408
|
// Create a shallow clone of the option
|
|
38409
|
-
var shallowClone = _extends({}, option);
|
|
38409
|
+
var shallowClone = _extends$1({}, option);
|
|
38410
38410
|
|
|
38411
38411
|
if (!shallowClone.allOf) {
|
|
38412
38412
|
shallowClone.allOf = [];
|
|
@@ -38418,7 +38418,7 @@ function getMatchingOption$1(formData, options, rootSchema) {
|
|
|
38418
38418
|
shallowClone.allOf.push(requiresAnyOf);
|
|
38419
38419
|
augmentedSchema = shallowClone;
|
|
38420
38420
|
} else {
|
|
38421
|
-
augmentedSchema = _extends({}, option, requiresAnyOf);
|
|
38421
|
+
augmentedSchema = _extends$1({}, option, requiresAnyOf);
|
|
38422
38422
|
} // Remove the "required" field as it's likely that not all fields have
|
|
38423
38423
|
// been filled in yet, which will mean that the schema is not valid
|
|
38424
38424
|
|
|
@@ -38478,9 +38478,9 @@ function (_Component) {
|
|
|
38478
38478
|
|
|
38479
38479
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(Form).call(this, props));
|
|
38480
38480
|
|
|
38481
|
-
_defineProperty$
|
|
38481
|
+
_defineProperty$2(_assertThisInitialized(_this), "getUsedFormData", function (formData, fields) {
|
|
38482
38482
|
//for the case of a single input form
|
|
38483
|
-
if (fields.length === 0 && _typeof(formData) !== "object") {
|
|
38483
|
+
if (fields.length === 0 && _typeof$1(formData) !== "object") {
|
|
38484
38484
|
return formData;
|
|
38485
38485
|
}
|
|
38486
38486
|
|
|
@@ -38495,13 +38495,13 @@ function (_Component) {
|
|
|
38495
38495
|
return data;
|
|
38496
38496
|
});
|
|
38497
38497
|
|
|
38498
|
-
_defineProperty$
|
|
38498
|
+
_defineProperty$2(_assertThisInitialized(_this), "getFieldNames", function (pathSchema, formData) {
|
|
38499
38499
|
var getAllPaths = function getAllPaths(_obj) {
|
|
38500
38500
|
var acc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
38501
38501
|
var paths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [""];
|
|
38502
38502
|
|
|
38503
38503
|
keys$3(_obj).forEach(function (key) {
|
|
38504
|
-
if (_typeof(_obj[key]) === "object") {
|
|
38504
|
+
if (_typeof$1(_obj[key]) === "object") {
|
|
38505
38505
|
var newPaths = paths.map(function (path) {
|
|
38506
38506
|
return "".concat(path, ".").concat(key);
|
|
38507
38507
|
}); // If an object is marked with additionalProperties, all its keys are valid
|
|
@@ -38519,7 +38519,7 @@ function (_Component) {
|
|
|
38519
38519
|
// or an empty object/array
|
|
38520
38520
|
|
|
38521
38521
|
|
|
38522
|
-
if (_typeof(formValue) !== "object" || isEmpty_1(formValue)) {
|
|
38522
|
+
if (_typeof$1(formValue) !== "object" || isEmpty_1(formValue)) {
|
|
38523
38523
|
acc.push(path);
|
|
38524
38524
|
}
|
|
38525
38525
|
});
|
|
@@ -38532,7 +38532,7 @@ function (_Component) {
|
|
|
38532
38532
|
return getAllPaths(pathSchema);
|
|
38533
38533
|
});
|
|
38534
38534
|
|
|
38535
|
-
_defineProperty$
|
|
38535
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (formData, newErrorSchema) {
|
|
38536
38536
|
if (isObject$1(formData) || isArray$2(formData)) {
|
|
38537
38537
|
var newState = _this.getStateFromProps(_this.props, formData);
|
|
38538
38538
|
|
|
@@ -38592,7 +38592,7 @@ function (_Component) {
|
|
|
38592
38592
|
});
|
|
38593
38593
|
});
|
|
38594
38594
|
|
|
38595
|
-
_defineProperty$
|
|
38595
|
+
_defineProperty$2(_assertThisInitialized(_this), "onBlur", function () {
|
|
38596
38596
|
if (_this.props.onBlur) {
|
|
38597
38597
|
var _this$props;
|
|
38598
38598
|
|
|
@@ -38600,7 +38600,7 @@ function (_Component) {
|
|
|
38600
38600
|
}
|
|
38601
38601
|
});
|
|
38602
38602
|
|
|
38603
|
-
_defineProperty$
|
|
38603
|
+
_defineProperty$2(_assertThisInitialized(_this), "onFocus", function () {
|
|
38604
38604
|
if (_this.props.onFocus) {
|
|
38605
38605
|
var _this$props2;
|
|
38606
38606
|
|
|
@@ -38608,7 +38608,7 @@ function (_Component) {
|
|
|
38608
38608
|
}
|
|
38609
38609
|
});
|
|
38610
38610
|
|
|
38611
|
-
_defineProperty$
|
|
38611
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSubmit", function (event) {
|
|
38612
38612
|
event.preventDefault();
|
|
38613
38613
|
|
|
38614
38614
|
if (event.target !== event.currentTarget) {
|
|
@@ -38928,7 +38928,7 @@ function (_Component) {
|
|
|
38928
38928
|
return Form;
|
|
38929
38929
|
}(react.Component);
|
|
38930
38930
|
|
|
38931
|
-
_defineProperty$
|
|
38931
|
+
_defineProperty$2(Form$1, "defaultProps", {
|
|
38932
38932
|
uiSchema: {},
|
|
38933
38933
|
noValidate: false,
|
|
38934
38934
|
liveValidate: false,
|
|
@@ -38982,11 +38982,11 @@ var reactShadowDomRetargetEvents = function retargetEvents(shadowRoot) {
|
|
|
38982
38982
|
}
|
|
38983
38983
|
|
|
38984
38984
|
if (reactComponent && props) {
|
|
38985
|
-
dispatchEvent(event, reactEventName, props);
|
|
38985
|
+
dispatchEvent$1(event, reactEventName, props);
|
|
38986
38986
|
}
|
|
38987
38987
|
|
|
38988
38988
|
if (reactComponent && props && mimickedReactEvents[reactEventName]) {
|
|
38989
|
-
dispatchEvent(event, mimickedReactEvents[reactEventName], props);
|
|
38989
|
+
dispatchEvent$1(event, mimickedReactEvents[reactEventName], props);
|
|
38990
38990
|
}
|
|
38991
38991
|
|
|
38992
38992
|
if (event.cancelBubble) {
|
|
@@ -39036,7 +39036,7 @@ function findReactProps(component) {
|
|
|
39036
39036
|
|
|
39037
39037
|
}
|
|
39038
39038
|
|
|
39039
|
-
function dispatchEvent(event, eventType, componentProps) {
|
|
39039
|
+
function dispatchEvent$1(event, eventType, componentProps) {
|
|
39040
39040
|
event.persist = function() {
|
|
39041
39041
|
event.isPersistent = function(){ return true};
|
|
39042
39042
|
};
|
|
@@ -39284,31 +39284,28 @@ class CollapsibleItemTemplate extends react.Component {
|
|
|
39284
39284
|
if (this.state.isOpen) {
|
|
39285
39285
|
children = this.props.item.children;
|
|
39286
39286
|
}
|
|
39287
|
+
const dragHandle = this.props.allowItemReorder
|
|
39288
|
+
? react.createElement('limel-drag-handle', {
|
|
39289
|
+
slot: 'header',
|
|
39290
|
+
class: 'drag-handle',
|
|
39291
|
+
})
|
|
39292
|
+
: null;
|
|
39287
39293
|
return react.createElement('limel-collapsible-section', {
|
|
39288
39294
|
header: findTitle(data, schema, formSchema) || 'New item',
|
|
39289
|
-
class: 'limel-form-array-item--object',
|
|
39295
|
+
class: 'array-item limel-form-array-item--object',
|
|
39290
39296
|
ref: (section) => {
|
|
39291
39297
|
this.section = section;
|
|
39292
39298
|
},
|
|
39293
39299
|
'is-open': this.state.isOpen,
|
|
39294
|
-
|
|
39300
|
+
'data-reorder-id': String(this.props.index),
|
|
39301
|
+
'data-reorderable': this.props.allowItemReorder
|
|
39302
|
+
? 'true'
|
|
39303
|
+
: 'false',
|
|
39304
|
+
}, dragHandle, children);
|
|
39295
39305
|
}
|
|
39296
39306
|
setActions(element) {
|
|
39297
|
-
const { item, index, allowItemRemoval
|
|
39307
|
+
const { item, index, allowItemRemoval } = this.props;
|
|
39298
39308
|
const actions = [];
|
|
39299
|
-
if (allowItemReorder) {
|
|
39300
|
-
actions.push({
|
|
39301
|
-
id: 'down',
|
|
39302
|
-
icon: 'down_arrow',
|
|
39303
|
-
disabled: !item.hasMoveDown,
|
|
39304
|
-
run: item.onReorderClick(index, index + 1),
|
|
39305
|
-
}, {
|
|
39306
|
-
id: 'up',
|
|
39307
|
-
icon: 'up_arrow',
|
|
39308
|
-
disabled: !item.hasMoveUp,
|
|
39309
|
-
run: item.onReorderClick(index, index - 1),
|
|
39310
|
-
});
|
|
39311
|
-
}
|
|
39312
39309
|
if (allowItemRemoval) {
|
|
39313
39310
|
actions.push({
|
|
39314
39311
|
id: 'remove',
|
|
@@ -39343,14 +39340,6 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39343
39340
|
const { item, index } = this.props;
|
|
39344
39341
|
item.onDropIndexClick(index)(event);
|
|
39345
39342
|
};
|
|
39346
|
-
this.handleMoveUp = (event) => {
|
|
39347
|
-
const { item, index } = this.props;
|
|
39348
|
-
item.onReorderClick(index, index - 1)(event);
|
|
39349
|
-
};
|
|
39350
|
-
this.handleMoveDown = (event) => {
|
|
39351
|
-
const { item, index } = this.props;
|
|
39352
|
-
item.onReorderClick(index, index + 1)(event);
|
|
39353
|
-
};
|
|
39354
39343
|
this.setRemoveButton = (button) => {
|
|
39355
39344
|
if (this.removeButton) {
|
|
39356
39345
|
this.removeButton.removeEventListener('click', this.handleRemove);
|
|
@@ -39360,39 +39349,30 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39360
39349
|
this.removeButton.addEventListener('click', this.handleRemove);
|
|
39361
39350
|
}
|
|
39362
39351
|
};
|
|
39363
|
-
this.setMoveUpButton = (button) => {
|
|
39364
|
-
if (this.moveUpButton) {
|
|
39365
|
-
this.moveUpButton.removeEventListener('click', this.handleMoveUp);
|
|
39366
|
-
}
|
|
39367
|
-
this.moveUpButton = button || undefined;
|
|
39368
|
-
if (this.moveUpButton) {
|
|
39369
|
-
this.moveUpButton.addEventListener('click', this.handleMoveUp);
|
|
39370
|
-
}
|
|
39371
|
-
};
|
|
39372
|
-
this.setMoveDownButton = (button) => {
|
|
39373
|
-
if (this.moveDownButton) {
|
|
39374
|
-
this.moveDownButton.removeEventListener('click', this.handleMoveDown);
|
|
39375
|
-
}
|
|
39376
|
-
this.moveDownButton = button || undefined;
|
|
39377
|
-
if (this.moveDownButton) {
|
|
39378
|
-
this.moveDownButton.addEventListener('click', this.handleMoveDown);
|
|
39379
|
-
}
|
|
39380
|
-
};
|
|
39381
39352
|
}
|
|
39382
39353
|
componentWillUnmount() {
|
|
39383
39354
|
this.setRemoveButton(undefined);
|
|
39384
|
-
this.setMoveUpButton(undefined);
|
|
39385
|
-
this.setMoveDownButton(undefined);
|
|
39386
39355
|
}
|
|
39387
39356
|
render() {
|
|
39388
|
-
const { item } = this.props;
|
|
39357
|
+
const { item, allowItemReorder } = this.props;
|
|
39389
39358
|
return react.createElement('div', {
|
|
39390
|
-
className: 'limel-form-array-item--simple',
|
|
39391
|
-
|
|
39392
|
-
?
|
|
39393
|
-
|
|
39359
|
+
className: 'array-item limel-form-array-item--simple',
|
|
39360
|
+
'data-reorder-id': String(this.props.dataIndex),
|
|
39361
|
+
'data-reorderable': allowItemReorder ? 'true' : 'false',
|
|
39362
|
+
}, this.props.item.children, this.renderRemoveButton(item), this.renderDragHandle());
|
|
39363
|
+
}
|
|
39364
|
+
renderDragHandle() {
|
|
39365
|
+
if (!this.props.allowItemReorder) {
|
|
39366
|
+
return;
|
|
39367
|
+
}
|
|
39368
|
+
return react.createElement('limel-drag-handle', {
|
|
39369
|
+
class: 'drag-handle',
|
|
39370
|
+
});
|
|
39394
39371
|
}
|
|
39395
39372
|
renderRemoveButton(item) {
|
|
39373
|
+
if (!this.props.allowItemRemoval) {
|
|
39374
|
+
return;
|
|
39375
|
+
}
|
|
39396
39376
|
const props = {
|
|
39397
39377
|
icon: 'trash',
|
|
39398
39378
|
disabled: !item.hasRemove,
|
|
@@ -39400,33 +39380,2794 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39400
39380
|
};
|
|
39401
39381
|
return react.createElement(LIMEL_ICON_BUTTON, props);
|
|
39402
39382
|
}
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39383
|
+
}
|
|
39384
|
+
|
|
39385
|
+
/**!
|
|
39386
|
+
* Sortable 1.15.6
|
|
39387
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
39388
|
+
* @author owenm <owen23355@gmail.com>
|
|
39389
|
+
* @license MIT
|
|
39390
|
+
*/
|
|
39391
|
+
function ownKeys(object, enumerableOnly) {
|
|
39392
|
+
var keys = Object.keys(object);
|
|
39393
|
+
if (Object.getOwnPropertySymbols) {
|
|
39394
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
39395
|
+
if (enumerableOnly) {
|
|
39396
|
+
symbols = symbols.filter(function (sym) {
|
|
39397
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
39398
|
+
});
|
|
39399
|
+
}
|
|
39400
|
+
keys.push.apply(keys, symbols);
|
|
39401
|
+
}
|
|
39402
|
+
return keys;
|
|
39403
|
+
}
|
|
39404
|
+
function _objectSpread2(target) {
|
|
39405
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39406
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
39407
|
+
if (i % 2) {
|
|
39408
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
39409
|
+
_defineProperty(target, key, source[key]);
|
|
39410
|
+
});
|
|
39411
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
39412
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
39413
|
+
} else {
|
|
39414
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
39415
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
39416
|
+
});
|
|
39417
|
+
}
|
|
39418
|
+
}
|
|
39419
|
+
return target;
|
|
39420
|
+
}
|
|
39421
|
+
function _typeof(obj) {
|
|
39422
|
+
"@babel/helpers - typeof";
|
|
39423
|
+
|
|
39424
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
39425
|
+
_typeof = function (obj) {
|
|
39426
|
+
return typeof obj;
|
|
39427
|
+
};
|
|
39428
|
+
} else {
|
|
39429
|
+
_typeof = function (obj) {
|
|
39430
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
39408
39431
|
};
|
|
39409
|
-
return react.createElement(LIMEL_ICON_BUTTON, props);
|
|
39410
39432
|
}
|
|
39411
|
-
|
|
39412
|
-
|
|
39413
|
-
|
|
39414
|
-
|
|
39415
|
-
|
|
39433
|
+
return _typeof(obj);
|
|
39434
|
+
}
|
|
39435
|
+
function _defineProperty(obj, key, value) {
|
|
39436
|
+
if (key in obj) {
|
|
39437
|
+
Object.defineProperty(obj, key, {
|
|
39438
|
+
value: value,
|
|
39439
|
+
enumerable: true,
|
|
39440
|
+
configurable: true,
|
|
39441
|
+
writable: true
|
|
39442
|
+
});
|
|
39443
|
+
} else {
|
|
39444
|
+
obj[key] = value;
|
|
39445
|
+
}
|
|
39446
|
+
return obj;
|
|
39447
|
+
}
|
|
39448
|
+
function _extends() {
|
|
39449
|
+
_extends = Object.assign || function (target) {
|
|
39450
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39451
|
+
var source = arguments[i];
|
|
39452
|
+
for (var key in source) {
|
|
39453
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
39454
|
+
target[key] = source[key];
|
|
39455
|
+
}
|
|
39456
|
+
}
|
|
39457
|
+
}
|
|
39458
|
+
return target;
|
|
39459
|
+
};
|
|
39460
|
+
return _extends.apply(this, arguments);
|
|
39461
|
+
}
|
|
39462
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
39463
|
+
if (source == null) return {};
|
|
39464
|
+
var target = {};
|
|
39465
|
+
var sourceKeys = Object.keys(source);
|
|
39466
|
+
var key, i;
|
|
39467
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
39468
|
+
key = sourceKeys[i];
|
|
39469
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39470
|
+
target[key] = source[key];
|
|
39471
|
+
}
|
|
39472
|
+
return target;
|
|
39473
|
+
}
|
|
39474
|
+
function _objectWithoutProperties(source, excluded) {
|
|
39475
|
+
if (source == null) return {};
|
|
39476
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
39477
|
+
var key, i;
|
|
39478
|
+
if (Object.getOwnPropertySymbols) {
|
|
39479
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
39480
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
39481
|
+
key = sourceSymbolKeys[i];
|
|
39482
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39483
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39484
|
+
target[key] = source[key];
|
|
39485
|
+
}
|
|
39486
|
+
}
|
|
39487
|
+
return target;
|
|
39488
|
+
}
|
|
39489
|
+
|
|
39490
|
+
var version = "1.15.6";
|
|
39491
|
+
|
|
39492
|
+
function userAgent(pattern) {
|
|
39493
|
+
if (typeof window !== 'undefined' && window.navigator) {
|
|
39494
|
+
return !! /*@__PURE__*/navigator.userAgent.match(pattern);
|
|
39495
|
+
}
|
|
39496
|
+
}
|
|
39497
|
+
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
|
39498
|
+
var Edge = userAgent(/Edge/i);
|
|
39499
|
+
var FireFox = userAgent(/firefox/i);
|
|
39500
|
+
var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
|
|
39501
|
+
var IOS = userAgent(/iP(ad|od|hone)/i);
|
|
39502
|
+
var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
|
|
39503
|
+
|
|
39504
|
+
var captureMode = {
|
|
39505
|
+
capture: false,
|
|
39506
|
+
passive: false
|
|
39507
|
+
};
|
|
39508
|
+
function on(el, event, fn) {
|
|
39509
|
+
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
|
39510
|
+
}
|
|
39511
|
+
function off(el, event, fn) {
|
|
39512
|
+
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
|
39513
|
+
}
|
|
39514
|
+
function matches( /**HTMLElement*/el, /**String*/selector) {
|
|
39515
|
+
if (!selector) return;
|
|
39516
|
+
selector[0] === '>' && (selector = selector.substring(1));
|
|
39517
|
+
if (el) {
|
|
39518
|
+
try {
|
|
39519
|
+
if (el.matches) {
|
|
39520
|
+
return el.matches(selector);
|
|
39521
|
+
} else if (el.msMatchesSelector) {
|
|
39522
|
+
return el.msMatchesSelector(selector);
|
|
39523
|
+
} else if (el.webkitMatchesSelector) {
|
|
39524
|
+
return el.webkitMatchesSelector(selector);
|
|
39525
|
+
}
|
|
39526
|
+
} catch (_) {
|
|
39527
|
+
return false;
|
|
39528
|
+
}
|
|
39529
|
+
}
|
|
39530
|
+
return false;
|
|
39531
|
+
}
|
|
39532
|
+
function getParentOrHost(el) {
|
|
39533
|
+
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
|
39534
|
+
}
|
|
39535
|
+
function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
|
|
39536
|
+
if (el) {
|
|
39537
|
+
ctx = ctx || document;
|
|
39538
|
+
do {
|
|
39539
|
+
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
|
39540
|
+
return el;
|
|
39541
|
+
}
|
|
39542
|
+
if (el === ctx) break;
|
|
39543
|
+
/* jshint boss:true */
|
|
39544
|
+
} while (el = getParentOrHost(el));
|
|
39545
|
+
}
|
|
39546
|
+
return null;
|
|
39547
|
+
}
|
|
39548
|
+
var R_SPACE = /\s+/g;
|
|
39549
|
+
function toggleClass(el, name, state) {
|
|
39550
|
+
if (el && name) {
|
|
39551
|
+
if (el.classList) {
|
|
39552
|
+
el.classList[state ? 'add' : 'remove'](name);
|
|
39553
|
+
} else {
|
|
39554
|
+
var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
|
|
39555
|
+
el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
|
|
39556
|
+
}
|
|
39557
|
+
}
|
|
39558
|
+
}
|
|
39559
|
+
function css(el, prop, val) {
|
|
39560
|
+
var style = el && el.style;
|
|
39561
|
+
if (style) {
|
|
39562
|
+
if (val === void 0) {
|
|
39563
|
+
if (document.defaultView && document.defaultView.getComputedStyle) {
|
|
39564
|
+
val = document.defaultView.getComputedStyle(el, '');
|
|
39565
|
+
} else if (el.currentStyle) {
|
|
39566
|
+
val = el.currentStyle;
|
|
39567
|
+
}
|
|
39568
|
+
return prop === void 0 ? val : val[prop];
|
|
39569
|
+
} else {
|
|
39570
|
+
if (!(prop in style) && prop.indexOf('webkit') === -1) {
|
|
39571
|
+
prop = '-webkit-' + prop;
|
|
39572
|
+
}
|
|
39573
|
+
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
|
39574
|
+
}
|
|
39575
|
+
}
|
|
39576
|
+
}
|
|
39577
|
+
function matrix(el, selfOnly) {
|
|
39578
|
+
var appliedTransforms = '';
|
|
39579
|
+
if (typeof el === 'string') {
|
|
39580
|
+
appliedTransforms = el;
|
|
39581
|
+
} else {
|
|
39582
|
+
do {
|
|
39583
|
+
var transform = css(el, 'transform');
|
|
39584
|
+
if (transform && transform !== 'none') {
|
|
39585
|
+
appliedTransforms = transform + ' ' + appliedTransforms;
|
|
39586
|
+
}
|
|
39587
|
+
/* jshint boss:true */
|
|
39588
|
+
} while (!selfOnly && (el = el.parentNode));
|
|
39589
|
+
}
|
|
39590
|
+
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
39591
|
+
/*jshint -W056 */
|
|
39592
|
+
return matrixFn && new matrixFn(appliedTransforms);
|
|
39593
|
+
}
|
|
39594
|
+
function find(ctx, tagName, iterator) {
|
|
39595
|
+
if (ctx) {
|
|
39596
|
+
var list = ctx.getElementsByTagName(tagName),
|
|
39597
|
+
i = 0,
|
|
39598
|
+
n = list.length;
|
|
39599
|
+
if (iterator) {
|
|
39600
|
+
for (; i < n; i++) {
|
|
39601
|
+
iterator(list[i], i);
|
|
39602
|
+
}
|
|
39603
|
+
}
|
|
39604
|
+
return list;
|
|
39605
|
+
}
|
|
39606
|
+
return [];
|
|
39607
|
+
}
|
|
39608
|
+
function getWindowScrollingElement() {
|
|
39609
|
+
var scrollingElement = document.scrollingElement;
|
|
39610
|
+
if (scrollingElement) {
|
|
39611
|
+
return scrollingElement;
|
|
39612
|
+
} else {
|
|
39613
|
+
return document.documentElement;
|
|
39614
|
+
}
|
|
39615
|
+
}
|
|
39616
|
+
|
|
39617
|
+
/**
|
|
39618
|
+
* Returns the "bounding client rect" of given element
|
|
39619
|
+
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
|
39620
|
+
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
|
39621
|
+
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
|
39622
|
+
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
|
39623
|
+
* @param {[HTMLElement]} container The parent the element will be placed in
|
|
39624
|
+
* @return {Object} The boundingClientRect of el, with specified adjustments
|
|
39625
|
+
*/
|
|
39626
|
+
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
|
39627
|
+
if (!el.getBoundingClientRect && el !== window) return;
|
|
39628
|
+
var elRect, top, left, bottom, right, height, width;
|
|
39629
|
+
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
|
39630
|
+
elRect = el.getBoundingClientRect();
|
|
39631
|
+
top = elRect.top;
|
|
39632
|
+
left = elRect.left;
|
|
39633
|
+
bottom = elRect.bottom;
|
|
39634
|
+
right = elRect.right;
|
|
39635
|
+
height = elRect.height;
|
|
39636
|
+
width = elRect.width;
|
|
39637
|
+
} else {
|
|
39638
|
+
top = 0;
|
|
39639
|
+
left = 0;
|
|
39640
|
+
bottom = window.innerHeight;
|
|
39641
|
+
right = window.innerWidth;
|
|
39642
|
+
height = window.innerHeight;
|
|
39643
|
+
width = window.innerWidth;
|
|
39644
|
+
}
|
|
39645
|
+
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
|
39646
|
+
// Adjust for translate()
|
|
39647
|
+
container = container || el.parentNode;
|
|
39648
|
+
|
|
39649
|
+
// solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
|
39650
|
+
// Not needed on <= IE11
|
|
39651
|
+
if (!IE11OrLess) {
|
|
39652
|
+
do {
|
|
39653
|
+
if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
|
|
39654
|
+
var containerRect = container.getBoundingClientRect();
|
|
39655
|
+
|
|
39656
|
+
// Set relative to edges of padding box of container
|
|
39657
|
+
top -= containerRect.top + parseInt(css(container, 'border-top-width'));
|
|
39658
|
+
left -= containerRect.left + parseInt(css(container, 'border-left-width'));
|
|
39659
|
+
bottom = top + elRect.height;
|
|
39660
|
+
right = left + elRect.width;
|
|
39661
|
+
break;
|
|
39662
|
+
}
|
|
39663
|
+
/* jshint boss:true */
|
|
39664
|
+
} while (container = container.parentNode);
|
|
39665
|
+
}
|
|
39666
|
+
}
|
|
39667
|
+
if (undoScale && el !== window) {
|
|
39668
|
+
// Adjust for scale()
|
|
39669
|
+
var elMatrix = matrix(container || el),
|
|
39670
|
+
scaleX = elMatrix && elMatrix.a,
|
|
39671
|
+
scaleY = elMatrix && elMatrix.d;
|
|
39672
|
+
if (elMatrix) {
|
|
39673
|
+
top /= scaleY;
|
|
39674
|
+
left /= scaleX;
|
|
39675
|
+
width /= scaleX;
|
|
39676
|
+
height /= scaleY;
|
|
39677
|
+
bottom = top + height;
|
|
39678
|
+
right = left + width;
|
|
39679
|
+
}
|
|
39680
|
+
}
|
|
39681
|
+
return {
|
|
39682
|
+
top: top,
|
|
39683
|
+
left: left,
|
|
39684
|
+
bottom: bottom,
|
|
39685
|
+
right: right,
|
|
39686
|
+
width: width,
|
|
39687
|
+
height: height
|
|
39688
|
+
};
|
|
39689
|
+
}
|
|
39690
|
+
|
|
39691
|
+
/**
|
|
39692
|
+
* Checks if a side of an element is scrolled past a side of its parents
|
|
39693
|
+
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
|
39694
|
+
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
|
39695
|
+
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
|
39696
|
+
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
|
39697
|
+
*/
|
|
39698
|
+
function isScrolledPast(el, elSide, parentSide) {
|
|
39699
|
+
var parent = getParentAutoScrollElement(el, true),
|
|
39700
|
+
elSideVal = getRect(el)[elSide];
|
|
39701
|
+
|
|
39702
|
+
/* jshint boss:true */
|
|
39703
|
+
while (parent) {
|
|
39704
|
+
var parentSideVal = getRect(parent)[parentSide],
|
|
39705
|
+
visible = void 0;
|
|
39706
|
+
if (parentSide === 'top' || parentSide === 'left') {
|
|
39707
|
+
visible = elSideVal >= parentSideVal;
|
|
39708
|
+
} else {
|
|
39709
|
+
visible = elSideVal <= parentSideVal;
|
|
39710
|
+
}
|
|
39711
|
+
if (!visible) return parent;
|
|
39712
|
+
if (parent === getWindowScrollingElement()) break;
|
|
39713
|
+
parent = getParentAutoScrollElement(parent, false);
|
|
39714
|
+
}
|
|
39715
|
+
return false;
|
|
39716
|
+
}
|
|
39717
|
+
|
|
39718
|
+
/**
|
|
39719
|
+
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
|
39720
|
+
* and non-draggable elements
|
|
39721
|
+
* @param {HTMLElement} el The parent element
|
|
39722
|
+
* @param {Number} childNum The index of the child
|
|
39723
|
+
* @param {Object} options Parent Sortable's options
|
|
39724
|
+
* @return {HTMLElement} The child at index childNum, or null if not found
|
|
39725
|
+
*/
|
|
39726
|
+
function getChild(el, childNum, options, includeDragEl) {
|
|
39727
|
+
var currentChild = 0,
|
|
39728
|
+
i = 0,
|
|
39729
|
+
children = el.children;
|
|
39730
|
+
while (i < children.length) {
|
|
39731
|
+
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
|
39732
|
+
if (currentChild === childNum) {
|
|
39733
|
+
return children[i];
|
|
39734
|
+
}
|
|
39735
|
+
currentChild++;
|
|
39736
|
+
}
|
|
39737
|
+
i++;
|
|
39738
|
+
}
|
|
39739
|
+
return null;
|
|
39740
|
+
}
|
|
39741
|
+
|
|
39742
|
+
/**
|
|
39743
|
+
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
|
39744
|
+
* @param {HTMLElement} el Parent element
|
|
39745
|
+
* @param {selector} selector Any other elements that should be ignored
|
|
39746
|
+
* @return {HTMLElement} The last child, ignoring ghostEl
|
|
39747
|
+
*/
|
|
39748
|
+
function lastChild(el, selector) {
|
|
39749
|
+
var last = el.lastElementChild;
|
|
39750
|
+
while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
|
|
39751
|
+
last = last.previousElementSibling;
|
|
39752
|
+
}
|
|
39753
|
+
return last || null;
|
|
39754
|
+
}
|
|
39755
|
+
|
|
39756
|
+
/**
|
|
39757
|
+
* Returns the index of an element within its parent for a selected set of
|
|
39758
|
+
* elements
|
|
39759
|
+
* @param {HTMLElement} el
|
|
39760
|
+
* @param {selector} selector
|
|
39761
|
+
* @return {number}
|
|
39762
|
+
*/
|
|
39763
|
+
function index(el, selector) {
|
|
39764
|
+
var index = 0;
|
|
39765
|
+
if (!el || !el.parentNode) {
|
|
39766
|
+
return -1;
|
|
39767
|
+
}
|
|
39768
|
+
|
|
39769
|
+
/* jshint boss:true */
|
|
39770
|
+
while (el = el.previousElementSibling) {
|
|
39771
|
+
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
|
39772
|
+
index++;
|
|
39773
|
+
}
|
|
39774
|
+
}
|
|
39775
|
+
return index;
|
|
39776
|
+
}
|
|
39777
|
+
|
|
39778
|
+
/**
|
|
39779
|
+
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
|
39780
|
+
* The value is returned in real pixels.
|
|
39781
|
+
* @param {HTMLElement} el
|
|
39782
|
+
* @return {Array} Offsets in the format of [left, top]
|
|
39783
|
+
*/
|
|
39784
|
+
function getRelativeScrollOffset(el) {
|
|
39785
|
+
var offsetLeft = 0,
|
|
39786
|
+
offsetTop = 0,
|
|
39787
|
+
winScroller = getWindowScrollingElement();
|
|
39788
|
+
if (el) {
|
|
39789
|
+
do {
|
|
39790
|
+
var elMatrix = matrix(el),
|
|
39791
|
+
scaleX = elMatrix.a,
|
|
39792
|
+
scaleY = elMatrix.d;
|
|
39793
|
+
offsetLeft += el.scrollLeft * scaleX;
|
|
39794
|
+
offsetTop += el.scrollTop * scaleY;
|
|
39795
|
+
} while (el !== winScroller && (el = el.parentNode));
|
|
39796
|
+
}
|
|
39797
|
+
return [offsetLeft, offsetTop];
|
|
39798
|
+
}
|
|
39799
|
+
|
|
39800
|
+
/**
|
|
39801
|
+
* Returns the index of the object within the given array
|
|
39802
|
+
* @param {Array} arr Array that may or may not hold the object
|
|
39803
|
+
* @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
|
|
39804
|
+
* @return {Number} The index of the object in the array, or -1
|
|
39805
|
+
*/
|
|
39806
|
+
function indexOfObject(arr, obj) {
|
|
39807
|
+
for (var i in arr) {
|
|
39808
|
+
if (!arr.hasOwnProperty(i)) continue;
|
|
39809
|
+
for (var key in obj) {
|
|
39810
|
+
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
|
39811
|
+
}
|
|
39812
|
+
}
|
|
39813
|
+
return -1;
|
|
39814
|
+
}
|
|
39815
|
+
function getParentAutoScrollElement(el, includeSelf) {
|
|
39816
|
+
// skip to window
|
|
39817
|
+
if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
|
|
39818
|
+
var elem = el;
|
|
39819
|
+
var gotSelf = false;
|
|
39820
|
+
do {
|
|
39821
|
+
// we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
|
39822
|
+
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
|
39823
|
+
var elemCSS = css(elem);
|
|
39824
|
+
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
|
39825
|
+
if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
|
|
39826
|
+
if (gotSelf || includeSelf) return elem;
|
|
39827
|
+
gotSelf = true;
|
|
39828
|
+
}
|
|
39829
|
+
}
|
|
39830
|
+
/* jshint boss:true */
|
|
39831
|
+
} while (elem = elem.parentNode);
|
|
39832
|
+
return getWindowScrollingElement();
|
|
39833
|
+
}
|
|
39834
|
+
function extend(dst, src) {
|
|
39835
|
+
if (dst && src) {
|
|
39836
|
+
for (var key in src) {
|
|
39837
|
+
if (src.hasOwnProperty(key)) {
|
|
39838
|
+
dst[key] = src[key];
|
|
39839
|
+
}
|
|
39840
|
+
}
|
|
39841
|
+
}
|
|
39842
|
+
return dst;
|
|
39843
|
+
}
|
|
39844
|
+
function isRectEqual(rect1, rect2) {
|
|
39845
|
+
return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
|
|
39846
|
+
}
|
|
39847
|
+
var _throttleTimeout;
|
|
39848
|
+
function throttle(callback, ms) {
|
|
39849
|
+
return function () {
|
|
39850
|
+
if (!_throttleTimeout) {
|
|
39851
|
+
var args = arguments,
|
|
39852
|
+
_this = this;
|
|
39853
|
+
if (args.length === 1) {
|
|
39854
|
+
callback.call(_this, args[0]);
|
|
39855
|
+
} else {
|
|
39856
|
+
callback.apply(_this, args);
|
|
39857
|
+
}
|
|
39858
|
+
_throttleTimeout = setTimeout(function () {
|
|
39859
|
+
_throttleTimeout = void 0;
|
|
39860
|
+
}, ms);
|
|
39861
|
+
}
|
|
39862
|
+
};
|
|
39863
|
+
}
|
|
39864
|
+
function cancelThrottle() {
|
|
39865
|
+
clearTimeout(_throttleTimeout);
|
|
39866
|
+
_throttleTimeout = void 0;
|
|
39867
|
+
}
|
|
39868
|
+
function scrollBy(el, x, y) {
|
|
39869
|
+
el.scrollLeft += x;
|
|
39870
|
+
el.scrollTop += y;
|
|
39871
|
+
}
|
|
39872
|
+
function clone(el) {
|
|
39873
|
+
var Polymer = window.Polymer;
|
|
39874
|
+
var $ = window.jQuery || window.Zepto;
|
|
39875
|
+
if (Polymer && Polymer.dom) {
|
|
39876
|
+
return Polymer.dom(el).cloneNode(true);
|
|
39877
|
+
} else if ($) {
|
|
39878
|
+
return $(el).clone(true)[0];
|
|
39879
|
+
} else {
|
|
39880
|
+
return el.cloneNode(true);
|
|
39881
|
+
}
|
|
39882
|
+
}
|
|
39883
|
+
function getChildContainingRectFromElement(container, options, ghostEl) {
|
|
39884
|
+
var rect = {};
|
|
39885
|
+
Array.from(container.children).forEach(function (child) {
|
|
39886
|
+
var _rect$left, _rect$top, _rect$right, _rect$bottom;
|
|
39887
|
+
if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
|
|
39888
|
+
var childRect = getRect(child);
|
|
39889
|
+
rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
|
|
39890
|
+
rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
|
|
39891
|
+
rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
|
|
39892
|
+
rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
|
|
39893
|
+
});
|
|
39894
|
+
rect.width = rect.right - rect.left;
|
|
39895
|
+
rect.height = rect.bottom - rect.top;
|
|
39896
|
+
rect.x = rect.left;
|
|
39897
|
+
rect.y = rect.top;
|
|
39898
|
+
return rect;
|
|
39899
|
+
}
|
|
39900
|
+
var expando = 'Sortable' + new Date().getTime();
|
|
39901
|
+
|
|
39902
|
+
function AnimationStateManager() {
|
|
39903
|
+
var animationStates = [],
|
|
39904
|
+
animationCallbackId;
|
|
39905
|
+
return {
|
|
39906
|
+
captureAnimationState: function captureAnimationState() {
|
|
39907
|
+
animationStates = [];
|
|
39908
|
+
if (!this.options.animation) return;
|
|
39909
|
+
var children = [].slice.call(this.el.children);
|
|
39910
|
+
children.forEach(function (child) {
|
|
39911
|
+
if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
|
|
39912
|
+
animationStates.push({
|
|
39913
|
+
target: child,
|
|
39914
|
+
rect: getRect(child)
|
|
39915
|
+
});
|
|
39916
|
+
var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
|
|
39917
|
+
|
|
39918
|
+
// If animating: compensate for current animation
|
|
39919
|
+
if (child.thisAnimationDuration) {
|
|
39920
|
+
var childMatrix = matrix(child, true);
|
|
39921
|
+
if (childMatrix) {
|
|
39922
|
+
fromRect.top -= childMatrix.f;
|
|
39923
|
+
fromRect.left -= childMatrix.e;
|
|
39924
|
+
}
|
|
39925
|
+
}
|
|
39926
|
+
child.fromRect = fromRect;
|
|
39927
|
+
});
|
|
39928
|
+
},
|
|
39929
|
+
addAnimationState: function addAnimationState(state) {
|
|
39930
|
+
animationStates.push(state);
|
|
39931
|
+
},
|
|
39932
|
+
removeAnimationState: function removeAnimationState(target) {
|
|
39933
|
+
animationStates.splice(indexOfObject(animationStates, {
|
|
39934
|
+
target: target
|
|
39935
|
+
}), 1);
|
|
39936
|
+
},
|
|
39937
|
+
animateAll: function animateAll(callback) {
|
|
39938
|
+
var _this = this;
|
|
39939
|
+
if (!this.options.animation) {
|
|
39940
|
+
clearTimeout(animationCallbackId);
|
|
39941
|
+
if (typeof callback === 'function') callback();
|
|
39942
|
+
return;
|
|
39943
|
+
}
|
|
39944
|
+
var animating = false,
|
|
39945
|
+
animationTime = 0;
|
|
39946
|
+
animationStates.forEach(function (state) {
|
|
39947
|
+
var time = 0,
|
|
39948
|
+
target = state.target,
|
|
39949
|
+
fromRect = target.fromRect,
|
|
39950
|
+
toRect = getRect(target),
|
|
39951
|
+
prevFromRect = target.prevFromRect,
|
|
39952
|
+
prevToRect = target.prevToRect,
|
|
39953
|
+
animatingRect = state.rect,
|
|
39954
|
+
targetMatrix = matrix(target, true);
|
|
39955
|
+
if (targetMatrix) {
|
|
39956
|
+
// Compensate for current animation
|
|
39957
|
+
toRect.top -= targetMatrix.f;
|
|
39958
|
+
toRect.left -= targetMatrix.e;
|
|
39959
|
+
}
|
|
39960
|
+
target.toRect = toRect;
|
|
39961
|
+
if (target.thisAnimationDuration) {
|
|
39962
|
+
// Could also check if animatingRect is between fromRect and toRect
|
|
39963
|
+
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
|
39964
|
+
// Make sure animatingRect is on line between toRect & fromRect
|
|
39965
|
+
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
|
39966
|
+
// If returning to same place as started from animation and on same axis
|
|
39967
|
+
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
|
39968
|
+
}
|
|
39969
|
+
}
|
|
39970
|
+
|
|
39971
|
+
// if fromRect != toRect: animate
|
|
39972
|
+
if (!isRectEqual(toRect, fromRect)) {
|
|
39973
|
+
target.prevFromRect = fromRect;
|
|
39974
|
+
target.prevToRect = toRect;
|
|
39975
|
+
if (!time) {
|
|
39976
|
+
time = _this.options.animation;
|
|
39977
|
+
}
|
|
39978
|
+
_this.animate(target, animatingRect, toRect, time);
|
|
39979
|
+
}
|
|
39980
|
+
if (time) {
|
|
39981
|
+
animating = true;
|
|
39982
|
+
animationTime = Math.max(animationTime, time);
|
|
39983
|
+
clearTimeout(target.animationResetTimer);
|
|
39984
|
+
target.animationResetTimer = setTimeout(function () {
|
|
39985
|
+
target.animationTime = 0;
|
|
39986
|
+
target.prevFromRect = null;
|
|
39987
|
+
target.fromRect = null;
|
|
39988
|
+
target.prevToRect = null;
|
|
39989
|
+
target.thisAnimationDuration = null;
|
|
39990
|
+
}, time);
|
|
39991
|
+
target.thisAnimationDuration = time;
|
|
39992
|
+
}
|
|
39993
|
+
});
|
|
39994
|
+
clearTimeout(animationCallbackId);
|
|
39995
|
+
if (!animating) {
|
|
39996
|
+
if (typeof callback === 'function') callback();
|
|
39997
|
+
} else {
|
|
39998
|
+
animationCallbackId = setTimeout(function () {
|
|
39999
|
+
if (typeof callback === 'function') callback();
|
|
40000
|
+
}, animationTime);
|
|
40001
|
+
}
|
|
40002
|
+
animationStates = [];
|
|
40003
|
+
},
|
|
40004
|
+
animate: function animate(target, currentRect, toRect, duration) {
|
|
40005
|
+
if (duration) {
|
|
40006
|
+
css(target, 'transition', '');
|
|
40007
|
+
css(target, 'transform', '');
|
|
40008
|
+
var elMatrix = matrix(this.el),
|
|
40009
|
+
scaleX = elMatrix && elMatrix.a,
|
|
40010
|
+
scaleY = elMatrix && elMatrix.d,
|
|
40011
|
+
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
|
40012
|
+
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
|
40013
|
+
target.animatingX = !!translateX;
|
|
40014
|
+
target.animatingY = !!translateY;
|
|
40015
|
+
css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
|
40016
|
+
this.forRepaintDummy = repaint(target); // repaint
|
|
40017
|
+
|
|
40018
|
+
css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
|
|
40019
|
+
css(target, 'transform', 'translate3d(0,0,0)');
|
|
40020
|
+
typeof target.animated === 'number' && clearTimeout(target.animated);
|
|
40021
|
+
target.animated = setTimeout(function () {
|
|
40022
|
+
css(target, 'transition', '');
|
|
40023
|
+
css(target, 'transform', '');
|
|
40024
|
+
target.animated = false;
|
|
40025
|
+
target.animatingX = false;
|
|
40026
|
+
target.animatingY = false;
|
|
40027
|
+
}, duration);
|
|
40028
|
+
}
|
|
40029
|
+
}
|
|
40030
|
+
};
|
|
40031
|
+
}
|
|
40032
|
+
function repaint(target) {
|
|
40033
|
+
return target.offsetWidth;
|
|
40034
|
+
}
|
|
40035
|
+
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
|
40036
|
+
return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
|
|
40037
|
+
}
|
|
40038
|
+
|
|
40039
|
+
var plugins = [];
|
|
40040
|
+
var defaults = {
|
|
40041
|
+
initializeByDefault: true
|
|
40042
|
+
};
|
|
40043
|
+
var PluginManager = {
|
|
40044
|
+
mount: function mount(plugin) {
|
|
40045
|
+
// Set default static properties
|
|
40046
|
+
for (var option in defaults) {
|
|
40047
|
+
if (defaults.hasOwnProperty(option) && !(option in plugin)) {
|
|
40048
|
+
plugin[option] = defaults[option];
|
|
40049
|
+
}
|
|
40050
|
+
}
|
|
40051
|
+
plugins.forEach(function (p) {
|
|
40052
|
+
if (p.pluginName === plugin.pluginName) {
|
|
40053
|
+
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
|
40054
|
+
}
|
|
40055
|
+
});
|
|
40056
|
+
plugins.push(plugin);
|
|
40057
|
+
},
|
|
40058
|
+
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
|
40059
|
+
var _this = this;
|
|
40060
|
+
this.eventCanceled = false;
|
|
40061
|
+
evt.cancel = function () {
|
|
40062
|
+
_this.eventCanceled = true;
|
|
39416
40063
|
};
|
|
39417
|
-
|
|
40064
|
+
var eventNameGlobal = eventName + 'Global';
|
|
40065
|
+
plugins.forEach(function (plugin) {
|
|
40066
|
+
if (!sortable[plugin.pluginName]) return;
|
|
40067
|
+
// Fire global events if it exists in this sortable
|
|
40068
|
+
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
|
40069
|
+
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
|
|
40070
|
+
sortable: sortable
|
|
40071
|
+
}, evt));
|
|
40072
|
+
}
|
|
40073
|
+
|
|
40074
|
+
// Only fire plugin event if plugin is enabled in this sortable,
|
|
40075
|
+
// and plugin has event defined
|
|
40076
|
+
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
|
40077
|
+
sortable[plugin.pluginName][eventName](_objectSpread2({
|
|
40078
|
+
sortable: sortable
|
|
40079
|
+
}, evt));
|
|
40080
|
+
}
|
|
40081
|
+
});
|
|
40082
|
+
},
|
|
40083
|
+
initializePlugins: function initializePlugins(sortable, el, defaults, options) {
|
|
40084
|
+
plugins.forEach(function (plugin) {
|
|
40085
|
+
var pluginName = plugin.pluginName;
|
|
40086
|
+
if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
|
|
40087
|
+
var initialized = new plugin(sortable, el, sortable.options);
|
|
40088
|
+
initialized.sortable = sortable;
|
|
40089
|
+
initialized.options = sortable.options;
|
|
40090
|
+
sortable[pluginName] = initialized;
|
|
40091
|
+
|
|
40092
|
+
// Add default options from plugin
|
|
40093
|
+
_extends(defaults, initialized.defaults);
|
|
40094
|
+
});
|
|
40095
|
+
for (var option in sortable.options) {
|
|
40096
|
+
if (!sortable.options.hasOwnProperty(option)) continue;
|
|
40097
|
+
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
|
40098
|
+
if (typeof modified !== 'undefined') {
|
|
40099
|
+
sortable.options[option] = modified;
|
|
40100
|
+
}
|
|
40101
|
+
}
|
|
40102
|
+
},
|
|
40103
|
+
getEventProperties: function getEventProperties(name, sortable) {
|
|
40104
|
+
var eventProperties = {};
|
|
40105
|
+
plugins.forEach(function (plugin) {
|
|
40106
|
+
if (typeof plugin.eventProperties !== 'function') return;
|
|
40107
|
+
_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
|
40108
|
+
});
|
|
40109
|
+
return eventProperties;
|
|
40110
|
+
},
|
|
40111
|
+
modifyOption: function modifyOption(sortable, name, value) {
|
|
40112
|
+
var modifiedValue;
|
|
40113
|
+
plugins.forEach(function (plugin) {
|
|
40114
|
+
// Plugin must exist on the Sortable
|
|
40115
|
+
if (!sortable[plugin.pluginName]) return;
|
|
40116
|
+
|
|
40117
|
+
// If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
|
40118
|
+
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
|
|
40119
|
+
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
|
40120
|
+
}
|
|
40121
|
+
});
|
|
40122
|
+
return modifiedValue;
|
|
40123
|
+
}
|
|
40124
|
+
};
|
|
40125
|
+
|
|
40126
|
+
function dispatchEvent(_ref) {
|
|
40127
|
+
var sortable = _ref.sortable,
|
|
40128
|
+
rootEl = _ref.rootEl,
|
|
40129
|
+
name = _ref.name,
|
|
40130
|
+
targetEl = _ref.targetEl,
|
|
40131
|
+
cloneEl = _ref.cloneEl,
|
|
40132
|
+
toEl = _ref.toEl,
|
|
40133
|
+
fromEl = _ref.fromEl,
|
|
40134
|
+
oldIndex = _ref.oldIndex,
|
|
40135
|
+
newIndex = _ref.newIndex,
|
|
40136
|
+
oldDraggableIndex = _ref.oldDraggableIndex,
|
|
40137
|
+
newDraggableIndex = _ref.newDraggableIndex,
|
|
40138
|
+
originalEvent = _ref.originalEvent,
|
|
40139
|
+
putSortable = _ref.putSortable,
|
|
40140
|
+
extraEventProperties = _ref.extraEventProperties;
|
|
40141
|
+
sortable = sortable || rootEl && rootEl[expando];
|
|
40142
|
+
if (!sortable) return;
|
|
40143
|
+
var evt,
|
|
40144
|
+
options = sortable.options,
|
|
40145
|
+
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
|
40146
|
+
// Support for new CustomEvent feature
|
|
40147
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
40148
|
+
evt = new CustomEvent(name, {
|
|
40149
|
+
bubbles: true,
|
|
40150
|
+
cancelable: true
|
|
40151
|
+
});
|
|
40152
|
+
} else {
|
|
40153
|
+
evt = document.createEvent('Event');
|
|
40154
|
+
evt.initEvent(name, true, true);
|
|
40155
|
+
}
|
|
40156
|
+
evt.to = toEl || rootEl;
|
|
40157
|
+
evt.from = fromEl || rootEl;
|
|
40158
|
+
evt.item = targetEl || rootEl;
|
|
40159
|
+
evt.clone = cloneEl;
|
|
40160
|
+
evt.oldIndex = oldIndex;
|
|
40161
|
+
evt.newIndex = newIndex;
|
|
40162
|
+
evt.oldDraggableIndex = oldDraggableIndex;
|
|
40163
|
+
evt.newDraggableIndex = newDraggableIndex;
|
|
40164
|
+
evt.originalEvent = originalEvent;
|
|
40165
|
+
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
|
40166
|
+
var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
|
|
40167
|
+
for (var option in allEventProperties) {
|
|
40168
|
+
evt[option] = allEventProperties[option];
|
|
40169
|
+
}
|
|
40170
|
+
if (rootEl) {
|
|
40171
|
+
rootEl.dispatchEvent(evt);
|
|
40172
|
+
}
|
|
40173
|
+
if (options[onName]) {
|
|
40174
|
+
options[onName].call(sortable, evt);
|
|
40175
|
+
}
|
|
40176
|
+
}
|
|
40177
|
+
|
|
40178
|
+
var _excluded = ["evt"];
|
|
40179
|
+
var pluginEvent = function pluginEvent(eventName, sortable) {
|
|
40180
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
40181
|
+
originalEvent = _ref.evt,
|
|
40182
|
+
data = _objectWithoutProperties(_ref, _excluded);
|
|
40183
|
+
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
|
|
40184
|
+
dragEl: dragEl,
|
|
40185
|
+
parentEl: parentEl,
|
|
40186
|
+
ghostEl: ghostEl,
|
|
40187
|
+
rootEl: rootEl,
|
|
40188
|
+
nextEl: nextEl,
|
|
40189
|
+
lastDownEl: lastDownEl,
|
|
40190
|
+
cloneEl: cloneEl,
|
|
40191
|
+
cloneHidden: cloneHidden,
|
|
40192
|
+
dragStarted: moved,
|
|
40193
|
+
putSortable: putSortable,
|
|
40194
|
+
activeSortable: Sortable.active,
|
|
40195
|
+
originalEvent: originalEvent,
|
|
40196
|
+
oldIndex: oldIndex,
|
|
40197
|
+
oldDraggableIndex: oldDraggableIndex,
|
|
40198
|
+
newIndex: newIndex,
|
|
40199
|
+
newDraggableIndex: newDraggableIndex,
|
|
40200
|
+
hideGhostForTarget: _hideGhostForTarget,
|
|
40201
|
+
unhideGhostForTarget: _unhideGhostForTarget,
|
|
40202
|
+
cloneNowHidden: function cloneNowHidden() {
|
|
40203
|
+
cloneHidden = true;
|
|
40204
|
+
},
|
|
40205
|
+
cloneNowShown: function cloneNowShown() {
|
|
40206
|
+
cloneHidden = false;
|
|
40207
|
+
},
|
|
40208
|
+
dispatchSortableEvent: function dispatchSortableEvent(name) {
|
|
40209
|
+
_dispatchEvent({
|
|
40210
|
+
sortable: sortable,
|
|
40211
|
+
name: name,
|
|
40212
|
+
originalEvent: originalEvent
|
|
40213
|
+
});
|
|
40214
|
+
}
|
|
40215
|
+
}, data));
|
|
40216
|
+
};
|
|
40217
|
+
function _dispatchEvent(info) {
|
|
40218
|
+
dispatchEvent(_objectSpread2({
|
|
40219
|
+
putSortable: putSortable,
|
|
40220
|
+
cloneEl: cloneEl,
|
|
40221
|
+
targetEl: dragEl,
|
|
40222
|
+
rootEl: rootEl,
|
|
40223
|
+
oldIndex: oldIndex,
|
|
40224
|
+
oldDraggableIndex: oldDraggableIndex,
|
|
40225
|
+
newIndex: newIndex,
|
|
40226
|
+
newDraggableIndex: newDraggableIndex
|
|
40227
|
+
}, info));
|
|
40228
|
+
}
|
|
40229
|
+
var dragEl,
|
|
40230
|
+
parentEl,
|
|
40231
|
+
ghostEl,
|
|
40232
|
+
rootEl,
|
|
40233
|
+
nextEl,
|
|
40234
|
+
lastDownEl,
|
|
40235
|
+
cloneEl,
|
|
40236
|
+
cloneHidden,
|
|
40237
|
+
oldIndex,
|
|
40238
|
+
newIndex,
|
|
40239
|
+
oldDraggableIndex,
|
|
40240
|
+
newDraggableIndex,
|
|
40241
|
+
activeGroup,
|
|
40242
|
+
putSortable,
|
|
40243
|
+
awaitingDragStarted = false,
|
|
40244
|
+
ignoreNextClick = false,
|
|
40245
|
+
sortables = [],
|
|
40246
|
+
tapEvt,
|
|
40247
|
+
touchEvt,
|
|
40248
|
+
lastDx,
|
|
40249
|
+
lastDy,
|
|
40250
|
+
tapDistanceLeft,
|
|
40251
|
+
tapDistanceTop,
|
|
40252
|
+
moved,
|
|
40253
|
+
lastTarget,
|
|
40254
|
+
lastDirection,
|
|
40255
|
+
pastFirstInvertThresh = false,
|
|
40256
|
+
isCircumstantialInvert = false,
|
|
40257
|
+
targetMoveDistance,
|
|
40258
|
+
// For positioning ghost absolutely
|
|
40259
|
+
ghostRelativeParent,
|
|
40260
|
+
ghostRelativeParentInitialScroll = [],
|
|
40261
|
+
// (left, top)
|
|
40262
|
+
|
|
40263
|
+
_silent = false,
|
|
40264
|
+
savedInputChecked = [];
|
|
40265
|
+
|
|
40266
|
+
/** @const */
|
|
40267
|
+
var documentExists = typeof document !== 'undefined',
|
|
40268
|
+
PositionGhostAbsolutely = IOS,
|
|
40269
|
+
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
|
|
40270
|
+
// This will not pass for IE9, because IE9 DnD only works on anchors
|
|
40271
|
+
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
|
40272
|
+
supportCssPointerEvents = function () {
|
|
40273
|
+
if (!documentExists) return;
|
|
40274
|
+
// false when <= IE11
|
|
40275
|
+
if (IE11OrLess) {
|
|
40276
|
+
return false;
|
|
40277
|
+
}
|
|
40278
|
+
var el = document.createElement('x');
|
|
40279
|
+
el.style.cssText = 'pointer-events:auto';
|
|
40280
|
+
return el.style.pointerEvents === 'auto';
|
|
40281
|
+
}(),
|
|
40282
|
+
_detectDirection = function _detectDirection(el, options) {
|
|
40283
|
+
var elCSS = css(el),
|
|
40284
|
+
elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
|
|
40285
|
+
child1 = getChild(el, 0, options),
|
|
40286
|
+
child2 = getChild(el, 1, options),
|
|
40287
|
+
firstChildCSS = child1 && css(child1),
|
|
40288
|
+
secondChildCSS = child2 && css(child2),
|
|
40289
|
+
firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
|
|
40290
|
+
secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
|
|
40291
|
+
if (elCSS.display === 'flex') {
|
|
40292
|
+
return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
|
40293
|
+
}
|
|
40294
|
+
if (elCSS.display === 'grid') {
|
|
40295
|
+
return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
|
40296
|
+
}
|
|
40297
|
+
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
|
40298
|
+
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
|
40299
|
+
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
|
40300
|
+
}
|
|
40301
|
+
return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
|
|
40302
|
+
},
|
|
40303
|
+
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
|
40304
|
+
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
|
40305
|
+
dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
|
|
40306
|
+
dragElOppLength = vertical ? dragRect.width : dragRect.height,
|
|
40307
|
+
targetS1Opp = vertical ? targetRect.left : targetRect.top,
|
|
40308
|
+
targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
|
|
40309
|
+
targetOppLength = vertical ? targetRect.width : targetRect.height;
|
|
40310
|
+
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
|
40311
|
+
},
|
|
40312
|
+
/**
|
|
40313
|
+
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
|
40314
|
+
* @param {Number} x X position
|
|
40315
|
+
* @param {Number} y Y position
|
|
40316
|
+
* @return {HTMLElement} Element of the first found nearest Sortable
|
|
40317
|
+
*/
|
|
40318
|
+
_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
|
40319
|
+
var ret;
|
|
40320
|
+
sortables.some(function (sortable) {
|
|
40321
|
+
var threshold = sortable[expando].options.emptyInsertThreshold;
|
|
40322
|
+
if (!threshold || lastChild(sortable)) return;
|
|
40323
|
+
var rect = getRect(sortable),
|
|
40324
|
+
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
|
|
40325
|
+
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
|
40326
|
+
if (insideHorizontally && insideVertically) {
|
|
40327
|
+
return ret = sortable;
|
|
40328
|
+
}
|
|
40329
|
+
});
|
|
40330
|
+
return ret;
|
|
40331
|
+
},
|
|
40332
|
+
_prepareGroup = function _prepareGroup(options) {
|
|
40333
|
+
function toFn(value, pull) {
|
|
40334
|
+
return function (to, from, dragEl, evt) {
|
|
40335
|
+
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
|
40336
|
+
if (value == null && (pull || sameGroup)) {
|
|
40337
|
+
// Default pull value
|
|
40338
|
+
// Default pull and put value if same group
|
|
40339
|
+
return true;
|
|
40340
|
+
} else if (value == null || value === false) {
|
|
40341
|
+
return false;
|
|
40342
|
+
} else if (pull && value === 'clone') {
|
|
40343
|
+
return value;
|
|
40344
|
+
} else if (typeof value === 'function') {
|
|
40345
|
+
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
|
40346
|
+
} else {
|
|
40347
|
+
var otherGroup = (pull ? to : from).options.group.name;
|
|
40348
|
+
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
|
40349
|
+
}
|
|
40350
|
+
};
|
|
40351
|
+
}
|
|
40352
|
+
var group = {};
|
|
40353
|
+
var originalGroup = options.group;
|
|
40354
|
+
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
|
40355
|
+
originalGroup = {
|
|
40356
|
+
name: originalGroup
|
|
40357
|
+
};
|
|
40358
|
+
}
|
|
40359
|
+
group.name = originalGroup.name;
|
|
40360
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
|
40361
|
+
group.checkPut = toFn(originalGroup.put);
|
|
40362
|
+
group.revertClone = originalGroup.revertClone;
|
|
40363
|
+
options.group = group;
|
|
40364
|
+
},
|
|
40365
|
+
_hideGhostForTarget = function _hideGhostForTarget() {
|
|
40366
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
40367
|
+
css(ghostEl, 'display', 'none');
|
|
40368
|
+
}
|
|
40369
|
+
},
|
|
40370
|
+
_unhideGhostForTarget = function _unhideGhostForTarget() {
|
|
40371
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
40372
|
+
css(ghostEl, 'display', '');
|
|
40373
|
+
}
|
|
40374
|
+
};
|
|
40375
|
+
|
|
40376
|
+
// #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
|
40377
|
+
if (documentExists && !ChromeForAndroid) {
|
|
40378
|
+
document.addEventListener('click', function (evt) {
|
|
40379
|
+
if (ignoreNextClick) {
|
|
40380
|
+
evt.preventDefault();
|
|
40381
|
+
evt.stopPropagation && evt.stopPropagation();
|
|
40382
|
+
evt.stopImmediatePropagation && evt.stopImmediatePropagation();
|
|
40383
|
+
ignoreNextClick = false;
|
|
40384
|
+
return false;
|
|
40385
|
+
}
|
|
40386
|
+
}, true);
|
|
40387
|
+
}
|
|
40388
|
+
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
|
40389
|
+
if (dragEl) {
|
|
40390
|
+
evt = evt.touches ? evt.touches[0] : evt;
|
|
40391
|
+
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
|
40392
|
+
if (nearest) {
|
|
40393
|
+
// Create imitation event
|
|
40394
|
+
var event = {};
|
|
40395
|
+
for (var i in evt) {
|
|
40396
|
+
if (evt.hasOwnProperty(i)) {
|
|
40397
|
+
event[i] = evt[i];
|
|
40398
|
+
}
|
|
40399
|
+
}
|
|
40400
|
+
event.target = event.rootEl = nearest;
|
|
40401
|
+
event.preventDefault = void 0;
|
|
40402
|
+
event.stopPropagation = void 0;
|
|
40403
|
+
nearest[expando]._onDragOver(event);
|
|
40404
|
+
}
|
|
40405
|
+
}
|
|
40406
|
+
};
|
|
40407
|
+
var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
|
40408
|
+
if (dragEl) {
|
|
40409
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
40410
|
+
}
|
|
40411
|
+
};
|
|
40412
|
+
|
|
40413
|
+
/**
|
|
40414
|
+
* @class Sortable
|
|
40415
|
+
* @param {HTMLElement} el
|
|
40416
|
+
* @param {Object} [options]
|
|
40417
|
+
*/
|
|
40418
|
+
function Sortable(el, options) {
|
|
40419
|
+
if (!(el && el.nodeType && el.nodeType === 1)) {
|
|
40420
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
|
40421
|
+
}
|
|
40422
|
+
this.el = el; // root element
|
|
40423
|
+
this.options = options = _extends({}, options);
|
|
40424
|
+
|
|
40425
|
+
// Export instance
|
|
40426
|
+
el[expando] = this;
|
|
40427
|
+
var defaults = {
|
|
40428
|
+
group: null,
|
|
40429
|
+
sort: true,
|
|
40430
|
+
disabled: false,
|
|
40431
|
+
store: null,
|
|
40432
|
+
handle: null,
|
|
40433
|
+
draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
|
|
40434
|
+
swapThreshold: 1,
|
|
40435
|
+
// percentage; 0 <= x <= 1
|
|
40436
|
+
invertSwap: false,
|
|
40437
|
+
// invert always
|
|
40438
|
+
invertedSwapThreshold: null,
|
|
40439
|
+
// will be set to same as swapThreshold if default
|
|
40440
|
+
removeCloneOnHide: true,
|
|
40441
|
+
direction: function direction() {
|
|
40442
|
+
return _detectDirection(el, this.options);
|
|
40443
|
+
},
|
|
40444
|
+
ghostClass: 'sortable-ghost',
|
|
40445
|
+
chosenClass: 'sortable-chosen',
|
|
40446
|
+
dragClass: 'sortable-drag',
|
|
40447
|
+
ignore: 'a, img',
|
|
40448
|
+
filter: null,
|
|
40449
|
+
preventOnFilter: true,
|
|
40450
|
+
animation: 0,
|
|
40451
|
+
easing: null,
|
|
40452
|
+
setData: function setData(dataTransfer, dragEl) {
|
|
40453
|
+
dataTransfer.setData('Text', dragEl.textContent);
|
|
40454
|
+
},
|
|
40455
|
+
dropBubble: false,
|
|
40456
|
+
dragoverBubble: false,
|
|
40457
|
+
dataIdAttr: 'data-id',
|
|
40458
|
+
delay: 0,
|
|
40459
|
+
delayOnTouchOnly: false,
|
|
40460
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
40461
|
+
forceFallback: false,
|
|
40462
|
+
fallbackClass: 'sortable-fallback',
|
|
40463
|
+
fallbackOnBody: false,
|
|
40464
|
+
fallbackTolerance: 0,
|
|
40465
|
+
fallbackOffset: {
|
|
40466
|
+
x: 0,
|
|
40467
|
+
y: 0
|
|
40468
|
+
},
|
|
40469
|
+
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
40470
|
+
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
|
|
40471
|
+
emptyInsertThreshold: 5
|
|
40472
|
+
};
|
|
40473
|
+
PluginManager.initializePlugins(this, el, defaults);
|
|
40474
|
+
|
|
40475
|
+
// Set default options
|
|
40476
|
+
for (var name in defaults) {
|
|
40477
|
+
!(name in options) && (options[name] = defaults[name]);
|
|
40478
|
+
}
|
|
40479
|
+
_prepareGroup(options);
|
|
40480
|
+
|
|
40481
|
+
// Bind all private methods
|
|
40482
|
+
for (var fn in this) {
|
|
40483
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
40484
|
+
this[fn] = this[fn].bind(this);
|
|
40485
|
+
}
|
|
40486
|
+
}
|
|
40487
|
+
|
|
40488
|
+
// Setup drag mode
|
|
40489
|
+
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
|
40490
|
+
if (this.nativeDraggable) {
|
|
40491
|
+
// Touch start threshold cannot be greater than the native dragstart threshold
|
|
40492
|
+
this.options.touchStartThreshold = 1;
|
|
40493
|
+
}
|
|
40494
|
+
|
|
40495
|
+
// Bind events
|
|
40496
|
+
if (options.supportPointer) {
|
|
40497
|
+
on(el, 'pointerdown', this._onTapStart);
|
|
40498
|
+
} else {
|
|
40499
|
+
on(el, 'mousedown', this._onTapStart);
|
|
40500
|
+
on(el, 'touchstart', this._onTapStart);
|
|
40501
|
+
}
|
|
40502
|
+
if (this.nativeDraggable) {
|
|
40503
|
+
on(el, 'dragover', this);
|
|
40504
|
+
on(el, 'dragenter', this);
|
|
40505
|
+
}
|
|
40506
|
+
sortables.push(this.el);
|
|
40507
|
+
|
|
40508
|
+
// Restore sorting
|
|
40509
|
+
options.store && options.store.get && this.sort(options.store.get(this) || []);
|
|
40510
|
+
|
|
40511
|
+
// Add animation state manager
|
|
40512
|
+
_extends(this, AnimationStateManager());
|
|
40513
|
+
}
|
|
40514
|
+
Sortable.prototype = /** @lends Sortable.prototype */{
|
|
40515
|
+
constructor: Sortable,
|
|
40516
|
+
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
|
40517
|
+
if (!this.el.contains(target) && target !== this.el) {
|
|
40518
|
+
lastTarget = null;
|
|
40519
|
+
}
|
|
40520
|
+
},
|
|
40521
|
+
_getDirection: function _getDirection(evt, target) {
|
|
40522
|
+
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
|
40523
|
+
},
|
|
40524
|
+
_onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
|
|
40525
|
+
if (!evt.cancelable) return;
|
|
40526
|
+
var _this = this,
|
|
40527
|
+
el = this.el,
|
|
40528
|
+
options = this.options,
|
|
40529
|
+
preventOnFilter = options.preventOnFilter,
|
|
40530
|
+
type = evt.type,
|
|
40531
|
+
touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
|
|
40532
|
+
target = (touch || evt).target,
|
|
40533
|
+
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
|
|
40534
|
+
filter = options.filter;
|
|
40535
|
+
_saveInputCheckedState(el);
|
|
40536
|
+
|
|
40537
|
+
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
|
40538
|
+
if (dragEl) {
|
|
40539
|
+
return;
|
|
40540
|
+
}
|
|
40541
|
+
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
|
40542
|
+
return; // only left button and enabled
|
|
40543
|
+
}
|
|
40544
|
+
|
|
40545
|
+
// cancel dnd if original target is content editable
|
|
40546
|
+
if (originalTarget.isContentEditable) {
|
|
40547
|
+
return;
|
|
40548
|
+
}
|
|
40549
|
+
|
|
40550
|
+
// Safari ignores further event handling after mousedown
|
|
40551
|
+
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
|
|
40552
|
+
return;
|
|
40553
|
+
}
|
|
40554
|
+
target = closest(target, options.draggable, el, false);
|
|
40555
|
+
if (target && target.animated) {
|
|
40556
|
+
return;
|
|
40557
|
+
}
|
|
40558
|
+
if (lastDownEl === target) {
|
|
40559
|
+
// Ignoring duplicate `down`
|
|
40560
|
+
return;
|
|
40561
|
+
}
|
|
40562
|
+
|
|
40563
|
+
// Get the index of the dragged element within its parent
|
|
40564
|
+
oldIndex = index(target);
|
|
40565
|
+
oldDraggableIndex = index(target, options.draggable);
|
|
40566
|
+
|
|
40567
|
+
// Check filter
|
|
40568
|
+
if (typeof filter === 'function') {
|
|
40569
|
+
if (filter.call(this, evt, target, this)) {
|
|
40570
|
+
_dispatchEvent({
|
|
40571
|
+
sortable: _this,
|
|
40572
|
+
rootEl: originalTarget,
|
|
40573
|
+
name: 'filter',
|
|
40574
|
+
targetEl: target,
|
|
40575
|
+
toEl: el,
|
|
40576
|
+
fromEl: el
|
|
40577
|
+
});
|
|
40578
|
+
pluginEvent('filter', _this, {
|
|
40579
|
+
evt: evt
|
|
40580
|
+
});
|
|
40581
|
+
preventOnFilter && evt.preventDefault();
|
|
40582
|
+
return; // cancel dnd
|
|
40583
|
+
}
|
|
40584
|
+
} else if (filter) {
|
|
40585
|
+
filter = filter.split(',').some(function (criteria) {
|
|
40586
|
+
criteria = closest(originalTarget, criteria.trim(), el, false);
|
|
40587
|
+
if (criteria) {
|
|
40588
|
+
_dispatchEvent({
|
|
40589
|
+
sortable: _this,
|
|
40590
|
+
rootEl: criteria,
|
|
40591
|
+
name: 'filter',
|
|
40592
|
+
targetEl: target,
|
|
40593
|
+
fromEl: el,
|
|
40594
|
+
toEl: el
|
|
40595
|
+
});
|
|
40596
|
+
pluginEvent('filter', _this, {
|
|
40597
|
+
evt: evt
|
|
40598
|
+
});
|
|
40599
|
+
return true;
|
|
40600
|
+
}
|
|
40601
|
+
});
|
|
40602
|
+
if (filter) {
|
|
40603
|
+
preventOnFilter && evt.preventDefault();
|
|
40604
|
+
return; // cancel dnd
|
|
40605
|
+
}
|
|
40606
|
+
}
|
|
40607
|
+
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
|
40608
|
+
return;
|
|
40609
|
+
}
|
|
40610
|
+
|
|
40611
|
+
// Prepare `dragstart`
|
|
40612
|
+
this._prepareDragStart(evt, touch, target);
|
|
40613
|
+
},
|
|
40614
|
+
_prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
|
|
40615
|
+
var _this = this,
|
|
40616
|
+
el = _this.el,
|
|
40617
|
+
options = _this.options,
|
|
40618
|
+
ownerDocument = el.ownerDocument,
|
|
40619
|
+
dragStartFn;
|
|
40620
|
+
if (target && !dragEl && target.parentNode === el) {
|
|
40621
|
+
var dragRect = getRect(target);
|
|
40622
|
+
rootEl = el;
|
|
40623
|
+
dragEl = target;
|
|
40624
|
+
parentEl = dragEl.parentNode;
|
|
40625
|
+
nextEl = dragEl.nextSibling;
|
|
40626
|
+
lastDownEl = target;
|
|
40627
|
+
activeGroup = options.group;
|
|
40628
|
+
Sortable.dragged = dragEl;
|
|
40629
|
+
tapEvt = {
|
|
40630
|
+
target: dragEl,
|
|
40631
|
+
clientX: (touch || evt).clientX,
|
|
40632
|
+
clientY: (touch || evt).clientY
|
|
40633
|
+
};
|
|
40634
|
+
tapDistanceLeft = tapEvt.clientX - dragRect.left;
|
|
40635
|
+
tapDistanceTop = tapEvt.clientY - dragRect.top;
|
|
40636
|
+
this._lastX = (touch || evt).clientX;
|
|
40637
|
+
this._lastY = (touch || evt).clientY;
|
|
40638
|
+
dragEl.style['will-change'] = 'all';
|
|
40639
|
+
dragStartFn = function dragStartFn() {
|
|
40640
|
+
pluginEvent('delayEnded', _this, {
|
|
40641
|
+
evt: evt
|
|
40642
|
+
});
|
|
40643
|
+
if (Sortable.eventCanceled) {
|
|
40644
|
+
_this._onDrop();
|
|
40645
|
+
return;
|
|
40646
|
+
}
|
|
40647
|
+
// Delayed drag has been triggered
|
|
40648
|
+
// we can re-enable the events: touchmove/mousemove
|
|
40649
|
+
_this._disableDelayedDragEvents();
|
|
40650
|
+
if (!FireFox && _this.nativeDraggable) {
|
|
40651
|
+
dragEl.draggable = true;
|
|
40652
|
+
}
|
|
40653
|
+
|
|
40654
|
+
// Bind the events: dragstart/dragend
|
|
40655
|
+
_this._triggerDragStart(evt, touch);
|
|
40656
|
+
|
|
40657
|
+
// Drag start event
|
|
40658
|
+
_dispatchEvent({
|
|
40659
|
+
sortable: _this,
|
|
40660
|
+
name: 'choose',
|
|
40661
|
+
originalEvent: evt
|
|
40662
|
+
});
|
|
40663
|
+
|
|
40664
|
+
// Chosen item
|
|
40665
|
+
toggleClass(dragEl, options.chosenClass, true);
|
|
40666
|
+
};
|
|
40667
|
+
|
|
40668
|
+
// Disable "draggable"
|
|
40669
|
+
options.ignore.split(',').forEach(function (criteria) {
|
|
40670
|
+
find(dragEl, criteria.trim(), _disableDraggable);
|
|
40671
|
+
});
|
|
40672
|
+
on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
|
|
40673
|
+
on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
|
|
40674
|
+
on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
|
|
40675
|
+
if (options.supportPointer) {
|
|
40676
|
+
on(ownerDocument, 'pointerup', _this._onDrop);
|
|
40677
|
+
// Native D&D triggers pointercancel
|
|
40678
|
+
!this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
|
|
40679
|
+
} else {
|
|
40680
|
+
on(ownerDocument, 'mouseup', _this._onDrop);
|
|
40681
|
+
on(ownerDocument, 'touchend', _this._onDrop);
|
|
40682
|
+
on(ownerDocument, 'touchcancel', _this._onDrop);
|
|
40683
|
+
}
|
|
40684
|
+
|
|
40685
|
+
// Make dragEl draggable (must be before delay for FireFox)
|
|
40686
|
+
if (FireFox && this.nativeDraggable) {
|
|
40687
|
+
this.options.touchStartThreshold = 4;
|
|
40688
|
+
dragEl.draggable = true;
|
|
40689
|
+
}
|
|
40690
|
+
pluginEvent('delayStart', this, {
|
|
40691
|
+
evt: evt
|
|
40692
|
+
});
|
|
40693
|
+
|
|
40694
|
+
// Delay is impossible for native DnD in Edge or IE
|
|
40695
|
+
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
|
40696
|
+
if (Sortable.eventCanceled) {
|
|
40697
|
+
this._onDrop();
|
|
40698
|
+
return;
|
|
40699
|
+
}
|
|
40700
|
+
// If the user moves the pointer or let go the click or touch
|
|
40701
|
+
// before the delay has been reached:
|
|
40702
|
+
// disable the delayed drag
|
|
40703
|
+
if (options.supportPointer) {
|
|
40704
|
+
on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
|
|
40705
|
+
on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
|
|
40706
|
+
} else {
|
|
40707
|
+
on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
|
40708
|
+
on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
|
40709
|
+
on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
|
40710
|
+
}
|
|
40711
|
+
on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
|
|
40712
|
+
on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
|
|
40713
|
+
options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
|
|
40714
|
+
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
|
40715
|
+
} else {
|
|
40716
|
+
dragStartFn();
|
|
40717
|
+
}
|
|
40718
|
+
}
|
|
40719
|
+
},
|
|
40720
|
+
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
|
|
40721
|
+
var touch = e.touches ? e.touches[0] : e;
|
|
40722
|
+
if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
|
|
40723
|
+
this._disableDelayedDrag();
|
|
40724
|
+
}
|
|
40725
|
+
},
|
|
40726
|
+
_disableDelayedDrag: function _disableDelayedDrag() {
|
|
40727
|
+
dragEl && _disableDraggable(dragEl);
|
|
40728
|
+
clearTimeout(this._dragStartTimer);
|
|
40729
|
+
this._disableDelayedDragEvents();
|
|
40730
|
+
},
|
|
40731
|
+
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
|
40732
|
+
var ownerDocument = this.el.ownerDocument;
|
|
40733
|
+
off(ownerDocument, 'mouseup', this._disableDelayedDrag);
|
|
40734
|
+
off(ownerDocument, 'touchend', this._disableDelayedDrag);
|
|
40735
|
+
off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
|
|
40736
|
+
off(ownerDocument, 'pointerup', this._disableDelayedDrag);
|
|
40737
|
+
off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
|
|
40738
|
+
off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
|
|
40739
|
+
off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
|
40740
|
+
off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
|
40741
|
+
},
|
|
40742
|
+
_triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
|
|
40743
|
+
touch = touch || evt.pointerType == 'touch' && evt;
|
|
40744
|
+
if (!this.nativeDraggable || touch) {
|
|
40745
|
+
if (this.options.supportPointer) {
|
|
40746
|
+
on(document, 'pointermove', this._onTouchMove);
|
|
40747
|
+
} else if (touch) {
|
|
40748
|
+
on(document, 'touchmove', this._onTouchMove);
|
|
40749
|
+
} else {
|
|
40750
|
+
on(document, 'mousemove', this._onTouchMove);
|
|
40751
|
+
}
|
|
40752
|
+
} else {
|
|
40753
|
+
on(dragEl, 'dragend', this);
|
|
40754
|
+
on(rootEl, 'dragstart', this._onDragStart);
|
|
40755
|
+
}
|
|
40756
|
+
try {
|
|
40757
|
+
if (document.selection) {
|
|
40758
|
+
_nextTick(function () {
|
|
40759
|
+
document.selection.empty();
|
|
40760
|
+
});
|
|
40761
|
+
} else {
|
|
40762
|
+
window.getSelection().removeAllRanges();
|
|
40763
|
+
}
|
|
40764
|
+
} catch (err) {}
|
|
40765
|
+
},
|
|
40766
|
+
_dragStarted: function _dragStarted(fallback, evt) {
|
|
40767
|
+
awaitingDragStarted = false;
|
|
40768
|
+
if (rootEl && dragEl) {
|
|
40769
|
+
pluginEvent('dragStarted', this, {
|
|
40770
|
+
evt: evt
|
|
40771
|
+
});
|
|
40772
|
+
if (this.nativeDraggable) {
|
|
40773
|
+
on(document, 'dragover', _checkOutsideTargetEl);
|
|
40774
|
+
}
|
|
40775
|
+
var options = this.options;
|
|
40776
|
+
|
|
40777
|
+
// Apply effect
|
|
40778
|
+
!fallback && toggleClass(dragEl, options.dragClass, false);
|
|
40779
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
40780
|
+
Sortable.active = this;
|
|
40781
|
+
fallback && this._appendGhost();
|
|
40782
|
+
|
|
40783
|
+
// Drag start event
|
|
40784
|
+
_dispatchEvent({
|
|
40785
|
+
sortable: this,
|
|
40786
|
+
name: 'start',
|
|
40787
|
+
originalEvent: evt
|
|
40788
|
+
});
|
|
40789
|
+
} else {
|
|
40790
|
+
this._nulling();
|
|
40791
|
+
}
|
|
40792
|
+
},
|
|
40793
|
+
_emulateDragOver: function _emulateDragOver() {
|
|
40794
|
+
if (touchEvt) {
|
|
40795
|
+
this._lastX = touchEvt.clientX;
|
|
40796
|
+
this._lastY = touchEvt.clientY;
|
|
40797
|
+
_hideGhostForTarget();
|
|
40798
|
+
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
40799
|
+
var parent = target;
|
|
40800
|
+
while (target && target.shadowRoot) {
|
|
40801
|
+
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
40802
|
+
if (target === parent) break;
|
|
40803
|
+
parent = target;
|
|
40804
|
+
}
|
|
40805
|
+
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
|
40806
|
+
if (parent) {
|
|
40807
|
+
do {
|
|
40808
|
+
if (parent[expando]) {
|
|
40809
|
+
var inserted = void 0;
|
|
40810
|
+
inserted = parent[expando]._onDragOver({
|
|
40811
|
+
clientX: touchEvt.clientX,
|
|
40812
|
+
clientY: touchEvt.clientY,
|
|
40813
|
+
target: target,
|
|
40814
|
+
rootEl: parent
|
|
40815
|
+
});
|
|
40816
|
+
if (inserted && !this.options.dragoverBubble) {
|
|
40817
|
+
break;
|
|
40818
|
+
}
|
|
40819
|
+
}
|
|
40820
|
+
target = parent; // store last element
|
|
40821
|
+
}
|
|
40822
|
+
/* jshint boss:true */ while (parent = getParentOrHost(parent));
|
|
40823
|
+
}
|
|
40824
|
+
_unhideGhostForTarget();
|
|
40825
|
+
}
|
|
40826
|
+
},
|
|
40827
|
+
_onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
|
|
40828
|
+
if (tapEvt) {
|
|
40829
|
+
var options = this.options,
|
|
40830
|
+
fallbackTolerance = options.fallbackTolerance,
|
|
40831
|
+
fallbackOffset = options.fallbackOffset,
|
|
40832
|
+
touch = evt.touches ? evt.touches[0] : evt,
|
|
40833
|
+
ghostMatrix = ghostEl && matrix(ghostEl, true),
|
|
40834
|
+
scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
|
|
40835
|
+
scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
|
|
40836
|
+
relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
|
|
40837
|
+
dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
|
|
40838
|
+
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
|
|
40839
|
+
|
|
40840
|
+
// only set the status to dragging, when we are actually dragging
|
|
40841
|
+
if (!Sortable.active && !awaitingDragStarted) {
|
|
40842
|
+
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
|
40843
|
+
return;
|
|
40844
|
+
}
|
|
40845
|
+
this._onDragStart(evt, true);
|
|
40846
|
+
}
|
|
40847
|
+
if (ghostEl) {
|
|
40848
|
+
if (ghostMatrix) {
|
|
40849
|
+
ghostMatrix.e += dx - (lastDx || 0);
|
|
40850
|
+
ghostMatrix.f += dy - (lastDy || 0);
|
|
40851
|
+
} else {
|
|
40852
|
+
ghostMatrix = {
|
|
40853
|
+
a: 1,
|
|
40854
|
+
b: 0,
|
|
40855
|
+
c: 0,
|
|
40856
|
+
d: 1,
|
|
40857
|
+
e: dx,
|
|
40858
|
+
f: dy
|
|
40859
|
+
};
|
|
40860
|
+
}
|
|
40861
|
+
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
|
40862
|
+
css(ghostEl, 'webkitTransform', cssMatrix);
|
|
40863
|
+
css(ghostEl, 'mozTransform', cssMatrix);
|
|
40864
|
+
css(ghostEl, 'msTransform', cssMatrix);
|
|
40865
|
+
css(ghostEl, 'transform', cssMatrix);
|
|
40866
|
+
lastDx = dx;
|
|
40867
|
+
lastDy = dy;
|
|
40868
|
+
touchEvt = touch;
|
|
40869
|
+
}
|
|
40870
|
+
evt.cancelable && evt.preventDefault();
|
|
40871
|
+
}
|
|
40872
|
+
},
|
|
40873
|
+
_appendGhost: function _appendGhost() {
|
|
40874
|
+
// Bug if using scale(): https://stackoverflow.com/questions/2637058
|
|
40875
|
+
// Not being adjusted for
|
|
40876
|
+
if (!ghostEl) {
|
|
40877
|
+
var container = this.options.fallbackOnBody ? document.body : rootEl,
|
|
40878
|
+
rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
|
|
40879
|
+
options = this.options;
|
|
40880
|
+
|
|
40881
|
+
// Position absolutely
|
|
40882
|
+
if (PositionGhostAbsolutely) {
|
|
40883
|
+
// Get relatively positioned parent
|
|
40884
|
+
ghostRelativeParent = container;
|
|
40885
|
+
while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
|
|
40886
|
+
ghostRelativeParent = ghostRelativeParent.parentNode;
|
|
40887
|
+
}
|
|
40888
|
+
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
|
40889
|
+
if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
|
|
40890
|
+
rect.top += ghostRelativeParent.scrollTop;
|
|
40891
|
+
rect.left += ghostRelativeParent.scrollLeft;
|
|
40892
|
+
} else {
|
|
40893
|
+
ghostRelativeParent = getWindowScrollingElement();
|
|
40894
|
+
}
|
|
40895
|
+
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
|
40896
|
+
}
|
|
40897
|
+
ghostEl = dragEl.cloneNode(true);
|
|
40898
|
+
toggleClass(ghostEl, options.ghostClass, false);
|
|
40899
|
+
toggleClass(ghostEl, options.fallbackClass, true);
|
|
40900
|
+
toggleClass(ghostEl, options.dragClass, true);
|
|
40901
|
+
css(ghostEl, 'transition', '');
|
|
40902
|
+
css(ghostEl, 'transform', '');
|
|
40903
|
+
css(ghostEl, 'box-sizing', 'border-box');
|
|
40904
|
+
css(ghostEl, 'margin', 0);
|
|
40905
|
+
css(ghostEl, 'top', rect.top);
|
|
40906
|
+
css(ghostEl, 'left', rect.left);
|
|
40907
|
+
css(ghostEl, 'width', rect.width);
|
|
40908
|
+
css(ghostEl, 'height', rect.height);
|
|
40909
|
+
css(ghostEl, 'opacity', '0.8');
|
|
40910
|
+
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
|
|
40911
|
+
css(ghostEl, 'zIndex', '100000');
|
|
40912
|
+
css(ghostEl, 'pointerEvents', 'none');
|
|
40913
|
+
Sortable.ghost = ghostEl;
|
|
40914
|
+
container.appendChild(ghostEl);
|
|
40915
|
+
|
|
40916
|
+
// Set transform-origin
|
|
40917
|
+
css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
|
|
40918
|
+
}
|
|
40919
|
+
},
|
|
40920
|
+
_onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
|
|
40921
|
+
var _this = this;
|
|
40922
|
+
var dataTransfer = evt.dataTransfer;
|
|
40923
|
+
var options = _this.options;
|
|
40924
|
+
pluginEvent('dragStart', this, {
|
|
40925
|
+
evt: evt
|
|
40926
|
+
});
|
|
40927
|
+
if (Sortable.eventCanceled) {
|
|
40928
|
+
this._onDrop();
|
|
40929
|
+
return;
|
|
40930
|
+
}
|
|
40931
|
+
pluginEvent('setupClone', this);
|
|
40932
|
+
if (!Sortable.eventCanceled) {
|
|
40933
|
+
cloneEl = clone(dragEl);
|
|
40934
|
+
cloneEl.removeAttribute("id");
|
|
40935
|
+
cloneEl.draggable = false;
|
|
40936
|
+
cloneEl.style['will-change'] = '';
|
|
40937
|
+
this._hideClone();
|
|
40938
|
+
toggleClass(cloneEl, this.options.chosenClass, false);
|
|
40939
|
+
Sortable.clone = cloneEl;
|
|
40940
|
+
}
|
|
40941
|
+
|
|
40942
|
+
// #1143: IFrame support workaround
|
|
40943
|
+
_this.cloneId = _nextTick(function () {
|
|
40944
|
+
pluginEvent('clone', _this);
|
|
40945
|
+
if (Sortable.eventCanceled) return;
|
|
40946
|
+
if (!_this.options.removeCloneOnHide) {
|
|
40947
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
40948
|
+
}
|
|
40949
|
+
_this._hideClone();
|
|
40950
|
+
_dispatchEvent({
|
|
40951
|
+
sortable: _this,
|
|
40952
|
+
name: 'clone'
|
|
40953
|
+
});
|
|
40954
|
+
});
|
|
40955
|
+
!fallback && toggleClass(dragEl, options.dragClass, true);
|
|
40956
|
+
|
|
40957
|
+
// Set proper drop events
|
|
40958
|
+
if (fallback) {
|
|
40959
|
+
ignoreNextClick = true;
|
|
40960
|
+
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
|
40961
|
+
} else {
|
|
40962
|
+
// Undo what was set in _prepareDragStart before drag started
|
|
40963
|
+
off(document, 'mouseup', _this._onDrop);
|
|
40964
|
+
off(document, 'touchend', _this._onDrop);
|
|
40965
|
+
off(document, 'touchcancel', _this._onDrop);
|
|
40966
|
+
if (dataTransfer) {
|
|
40967
|
+
dataTransfer.effectAllowed = 'move';
|
|
40968
|
+
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
|
40969
|
+
}
|
|
40970
|
+
on(document, 'drop', _this);
|
|
40971
|
+
|
|
40972
|
+
// #1276 fix:
|
|
40973
|
+
css(dragEl, 'transform', 'translateZ(0)');
|
|
40974
|
+
}
|
|
40975
|
+
awaitingDragStarted = true;
|
|
40976
|
+
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
|
40977
|
+
on(document, 'selectstart', _this);
|
|
40978
|
+
moved = true;
|
|
40979
|
+
window.getSelection().removeAllRanges();
|
|
40980
|
+
if (Safari) {
|
|
40981
|
+
css(document.body, 'user-select', 'none');
|
|
40982
|
+
}
|
|
40983
|
+
},
|
|
40984
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
40985
|
+
_onDragOver: function _onDragOver( /**Event*/evt) {
|
|
40986
|
+
var el = this.el,
|
|
40987
|
+
target = evt.target,
|
|
40988
|
+
dragRect,
|
|
40989
|
+
targetRect,
|
|
40990
|
+
revert,
|
|
40991
|
+
options = this.options,
|
|
40992
|
+
group = options.group,
|
|
40993
|
+
activeSortable = Sortable.active,
|
|
40994
|
+
isOwner = activeGroup === group,
|
|
40995
|
+
canSort = options.sort,
|
|
40996
|
+
fromSortable = putSortable || activeSortable,
|
|
40997
|
+
vertical,
|
|
40998
|
+
_this = this,
|
|
40999
|
+
completedFired = false;
|
|
41000
|
+
if (_silent) return;
|
|
41001
|
+
function dragOverEvent(name, extra) {
|
|
41002
|
+
pluginEvent(name, _this, _objectSpread2({
|
|
41003
|
+
evt: evt,
|
|
41004
|
+
isOwner: isOwner,
|
|
41005
|
+
axis: vertical ? 'vertical' : 'horizontal',
|
|
41006
|
+
revert: revert,
|
|
41007
|
+
dragRect: dragRect,
|
|
41008
|
+
targetRect: targetRect,
|
|
41009
|
+
canSort: canSort,
|
|
41010
|
+
fromSortable: fromSortable,
|
|
41011
|
+
target: target,
|
|
41012
|
+
completed: completed,
|
|
41013
|
+
onMove: function onMove(target, after) {
|
|
41014
|
+
return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
|
|
41015
|
+
},
|
|
41016
|
+
changed: changed
|
|
41017
|
+
}, extra));
|
|
41018
|
+
}
|
|
41019
|
+
|
|
41020
|
+
// Capture animation state
|
|
41021
|
+
function capture() {
|
|
41022
|
+
dragOverEvent('dragOverAnimationCapture');
|
|
41023
|
+
_this.captureAnimationState();
|
|
41024
|
+
if (_this !== fromSortable) {
|
|
41025
|
+
fromSortable.captureAnimationState();
|
|
41026
|
+
}
|
|
41027
|
+
}
|
|
41028
|
+
|
|
41029
|
+
// Return invocation when dragEl is inserted (or completed)
|
|
41030
|
+
function completed(insertion) {
|
|
41031
|
+
dragOverEvent('dragOverCompleted', {
|
|
41032
|
+
insertion: insertion
|
|
41033
|
+
});
|
|
41034
|
+
if (insertion) {
|
|
41035
|
+
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
|
41036
|
+
if (isOwner) {
|
|
41037
|
+
activeSortable._hideClone();
|
|
41038
|
+
} else {
|
|
41039
|
+
activeSortable._showClone(_this);
|
|
41040
|
+
}
|
|
41041
|
+
if (_this !== fromSortable) {
|
|
41042
|
+
// Set ghost class to new sortable's ghost class
|
|
41043
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
|
41044
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
41045
|
+
}
|
|
41046
|
+
if (putSortable !== _this && _this !== Sortable.active) {
|
|
41047
|
+
putSortable = _this;
|
|
41048
|
+
} else if (_this === Sortable.active && putSortable) {
|
|
41049
|
+
putSortable = null;
|
|
41050
|
+
}
|
|
41051
|
+
|
|
41052
|
+
// Animation
|
|
41053
|
+
if (fromSortable === _this) {
|
|
41054
|
+
_this._ignoreWhileAnimating = target;
|
|
41055
|
+
}
|
|
41056
|
+
_this.animateAll(function () {
|
|
41057
|
+
dragOverEvent('dragOverAnimationComplete');
|
|
41058
|
+
_this._ignoreWhileAnimating = null;
|
|
41059
|
+
});
|
|
41060
|
+
if (_this !== fromSortable) {
|
|
41061
|
+
fromSortable.animateAll();
|
|
41062
|
+
fromSortable._ignoreWhileAnimating = null;
|
|
41063
|
+
}
|
|
41064
|
+
}
|
|
41065
|
+
|
|
41066
|
+
// Null lastTarget if it is not inside a previously swapped element
|
|
41067
|
+
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
|
41068
|
+
lastTarget = null;
|
|
41069
|
+
}
|
|
41070
|
+
|
|
41071
|
+
// no bubbling and not fallback
|
|
41072
|
+
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
|
41073
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
41074
|
+
|
|
41075
|
+
// Do not detect for empty insert if already inserted
|
|
41076
|
+
!insertion && nearestEmptyInsertDetectEvent(evt);
|
|
41077
|
+
}
|
|
41078
|
+
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
|
41079
|
+
return completedFired = true;
|
|
41080
|
+
}
|
|
41081
|
+
|
|
41082
|
+
// Call when dragEl has been inserted
|
|
41083
|
+
function changed() {
|
|
41084
|
+
newIndex = index(dragEl);
|
|
41085
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41086
|
+
_dispatchEvent({
|
|
41087
|
+
sortable: _this,
|
|
41088
|
+
name: 'change',
|
|
41089
|
+
toEl: el,
|
|
41090
|
+
newIndex: newIndex,
|
|
41091
|
+
newDraggableIndex: newDraggableIndex,
|
|
41092
|
+
originalEvent: evt
|
|
41093
|
+
});
|
|
41094
|
+
}
|
|
41095
|
+
if (evt.preventDefault !== void 0) {
|
|
41096
|
+
evt.cancelable && evt.preventDefault();
|
|
41097
|
+
}
|
|
41098
|
+
target = closest(target, options.draggable, el, true);
|
|
41099
|
+
dragOverEvent('dragOver');
|
|
41100
|
+
if (Sortable.eventCanceled) return completedFired;
|
|
41101
|
+
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
|
41102
|
+
return completed(false);
|
|
41103
|
+
}
|
|
41104
|
+
ignoreNextClick = false;
|
|
41105
|
+
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
|
|
41106
|
+
: putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
|
41107
|
+
vertical = this._getDirection(evt, target) === 'vertical';
|
|
41108
|
+
dragRect = getRect(dragEl);
|
|
41109
|
+
dragOverEvent('dragOverValid');
|
|
41110
|
+
if (Sortable.eventCanceled) return completedFired;
|
|
41111
|
+
if (revert) {
|
|
41112
|
+
parentEl = rootEl; // actualization
|
|
41113
|
+
capture();
|
|
41114
|
+
this._hideClone();
|
|
41115
|
+
dragOverEvent('revert');
|
|
41116
|
+
if (!Sortable.eventCanceled) {
|
|
41117
|
+
if (nextEl) {
|
|
41118
|
+
rootEl.insertBefore(dragEl, nextEl);
|
|
41119
|
+
} else {
|
|
41120
|
+
rootEl.appendChild(dragEl);
|
|
41121
|
+
}
|
|
41122
|
+
}
|
|
41123
|
+
return completed(true);
|
|
41124
|
+
}
|
|
41125
|
+
var elLastChild = lastChild(el, options.draggable);
|
|
41126
|
+
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
|
41127
|
+
// Insert to end of list
|
|
41128
|
+
|
|
41129
|
+
// If already at end of list: Do not insert
|
|
41130
|
+
if (elLastChild === dragEl) {
|
|
41131
|
+
return completed(false);
|
|
41132
|
+
}
|
|
41133
|
+
|
|
41134
|
+
// if there is a last element, it is the target
|
|
41135
|
+
if (elLastChild && el === evt.target) {
|
|
41136
|
+
target = elLastChild;
|
|
41137
|
+
}
|
|
41138
|
+
if (target) {
|
|
41139
|
+
targetRect = getRect(target);
|
|
41140
|
+
}
|
|
41141
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
|
41142
|
+
capture();
|
|
41143
|
+
if (elLastChild && elLastChild.nextSibling) {
|
|
41144
|
+
// the last draggable element is not the last node
|
|
41145
|
+
el.insertBefore(dragEl, elLastChild.nextSibling);
|
|
41146
|
+
} else {
|
|
41147
|
+
el.appendChild(dragEl);
|
|
41148
|
+
}
|
|
41149
|
+
parentEl = el; // actualization
|
|
41150
|
+
|
|
41151
|
+
changed();
|
|
41152
|
+
return completed(true);
|
|
41153
|
+
}
|
|
41154
|
+
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
|
41155
|
+
// Insert to start of list
|
|
41156
|
+
var firstChild = getChild(el, 0, options, true);
|
|
41157
|
+
if (firstChild === dragEl) {
|
|
41158
|
+
return completed(false);
|
|
41159
|
+
}
|
|
41160
|
+
target = firstChild;
|
|
41161
|
+
targetRect = getRect(target);
|
|
41162
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
|
41163
|
+
capture();
|
|
41164
|
+
el.insertBefore(dragEl, firstChild);
|
|
41165
|
+
parentEl = el; // actualization
|
|
41166
|
+
|
|
41167
|
+
changed();
|
|
41168
|
+
return completed(true);
|
|
41169
|
+
}
|
|
41170
|
+
} else if (target.parentNode === el) {
|
|
41171
|
+
targetRect = getRect(target);
|
|
41172
|
+
var direction = 0,
|
|
41173
|
+
targetBeforeFirstSwap,
|
|
41174
|
+
differentLevel = dragEl.parentNode !== el,
|
|
41175
|
+
differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
|
|
41176
|
+
side1 = vertical ? 'top' : 'left',
|
|
41177
|
+
scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
|
|
41178
|
+
scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
|
41179
|
+
if (lastTarget !== target) {
|
|
41180
|
+
targetBeforeFirstSwap = targetRect[side1];
|
|
41181
|
+
pastFirstInvertThresh = false;
|
|
41182
|
+
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
|
41183
|
+
}
|
|
41184
|
+
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
|
41185
|
+
var sibling;
|
|
41186
|
+
if (direction !== 0) {
|
|
41187
|
+
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
|
41188
|
+
var dragIndex = index(dragEl);
|
|
41189
|
+
do {
|
|
41190
|
+
dragIndex -= direction;
|
|
41191
|
+
sibling = parentEl.children[dragIndex];
|
|
41192
|
+
} while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
|
|
41193
|
+
}
|
|
41194
|
+
// If dragEl is already beside target: Do not insert
|
|
41195
|
+
if (direction === 0 || sibling === target) {
|
|
41196
|
+
return completed(false);
|
|
41197
|
+
}
|
|
41198
|
+
lastTarget = target;
|
|
41199
|
+
lastDirection = direction;
|
|
41200
|
+
var nextSibling = target.nextElementSibling,
|
|
41201
|
+
after = false;
|
|
41202
|
+
after = direction === 1;
|
|
41203
|
+
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
|
41204
|
+
if (moveVector !== false) {
|
|
41205
|
+
if (moveVector === 1 || moveVector === -1) {
|
|
41206
|
+
after = moveVector === 1;
|
|
41207
|
+
}
|
|
41208
|
+
_silent = true;
|
|
41209
|
+
setTimeout(_unsilent, 30);
|
|
41210
|
+
capture();
|
|
41211
|
+
if (after && !nextSibling) {
|
|
41212
|
+
el.appendChild(dragEl);
|
|
41213
|
+
} else {
|
|
41214
|
+
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
|
41215
|
+
}
|
|
41216
|
+
|
|
41217
|
+
// Undo chrome's scroll adjustment (has no effect on other browsers)
|
|
41218
|
+
if (scrolledPastTop) {
|
|
41219
|
+
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
|
41220
|
+
}
|
|
41221
|
+
parentEl = dragEl.parentNode; // actualization
|
|
41222
|
+
|
|
41223
|
+
// must be done before animation
|
|
41224
|
+
if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
|
|
41225
|
+
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
|
|
41226
|
+
}
|
|
41227
|
+
changed();
|
|
41228
|
+
return completed(true);
|
|
41229
|
+
}
|
|
41230
|
+
}
|
|
41231
|
+
if (el.contains(dragEl)) {
|
|
41232
|
+
return completed(false);
|
|
41233
|
+
}
|
|
41234
|
+
}
|
|
41235
|
+
return false;
|
|
41236
|
+
},
|
|
41237
|
+
_ignoreWhileAnimating: null,
|
|
41238
|
+
_offMoveEvents: function _offMoveEvents() {
|
|
41239
|
+
off(document, 'mousemove', this._onTouchMove);
|
|
41240
|
+
off(document, 'touchmove', this._onTouchMove);
|
|
41241
|
+
off(document, 'pointermove', this._onTouchMove);
|
|
41242
|
+
off(document, 'dragover', nearestEmptyInsertDetectEvent);
|
|
41243
|
+
off(document, 'mousemove', nearestEmptyInsertDetectEvent);
|
|
41244
|
+
off(document, 'touchmove', nearestEmptyInsertDetectEvent);
|
|
41245
|
+
},
|
|
41246
|
+
_offUpEvents: function _offUpEvents() {
|
|
41247
|
+
var ownerDocument = this.el.ownerDocument;
|
|
41248
|
+
off(ownerDocument, 'mouseup', this._onDrop);
|
|
41249
|
+
off(ownerDocument, 'touchend', this._onDrop);
|
|
41250
|
+
off(ownerDocument, 'pointerup', this._onDrop);
|
|
41251
|
+
off(ownerDocument, 'pointercancel', this._onDrop);
|
|
41252
|
+
off(ownerDocument, 'touchcancel', this._onDrop);
|
|
41253
|
+
off(document, 'selectstart', this);
|
|
41254
|
+
},
|
|
41255
|
+
_onDrop: function _onDrop( /**Event*/evt) {
|
|
41256
|
+
var el = this.el,
|
|
41257
|
+
options = this.options;
|
|
41258
|
+
|
|
41259
|
+
// Get the index of the dragged element within its parent
|
|
41260
|
+
newIndex = index(dragEl);
|
|
41261
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41262
|
+
pluginEvent('drop', this, {
|
|
41263
|
+
evt: evt
|
|
41264
|
+
});
|
|
41265
|
+
parentEl = dragEl && dragEl.parentNode;
|
|
41266
|
+
|
|
41267
|
+
// Get again after plugin event
|
|
41268
|
+
newIndex = index(dragEl);
|
|
41269
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41270
|
+
if (Sortable.eventCanceled) {
|
|
41271
|
+
this._nulling();
|
|
41272
|
+
return;
|
|
41273
|
+
}
|
|
41274
|
+
awaitingDragStarted = false;
|
|
41275
|
+
isCircumstantialInvert = false;
|
|
41276
|
+
pastFirstInvertThresh = false;
|
|
41277
|
+
clearInterval(this._loopId);
|
|
41278
|
+
clearTimeout(this._dragStartTimer);
|
|
41279
|
+
_cancelNextTick(this.cloneId);
|
|
41280
|
+
_cancelNextTick(this._dragStartId);
|
|
41281
|
+
|
|
41282
|
+
// Unbind events
|
|
41283
|
+
if (this.nativeDraggable) {
|
|
41284
|
+
off(document, 'drop', this);
|
|
41285
|
+
off(el, 'dragstart', this._onDragStart);
|
|
41286
|
+
}
|
|
41287
|
+
this._offMoveEvents();
|
|
41288
|
+
this._offUpEvents();
|
|
41289
|
+
if (Safari) {
|
|
41290
|
+
css(document.body, 'user-select', '');
|
|
41291
|
+
}
|
|
41292
|
+
css(dragEl, 'transform', '');
|
|
41293
|
+
if (evt) {
|
|
41294
|
+
if (moved) {
|
|
41295
|
+
evt.cancelable && evt.preventDefault();
|
|
41296
|
+
!options.dropBubble && evt.stopPropagation();
|
|
41297
|
+
}
|
|
41298
|
+
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
|
41299
|
+
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
|
|
41300
|
+
// Remove clone(s)
|
|
41301
|
+
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
|
41302
|
+
}
|
|
41303
|
+
if (dragEl) {
|
|
41304
|
+
if (this.nativeDraggable) {
|
|
41305
|
+
off(dragEl, 'dragend', this);
|
|
41306
|
+
}
|
|
41307
|
+
_disableDraggable(dragEl);
|
|
41308
|
+
dragEl.style['will-change'] = '';
|
|
41309
|
+
|
|
41310
|
+
// Remove classes
|
|
41311
|
+
// ghostClass is added in dragStarted
|
|
41312
|
+
if (moved && !awaitingDragStarted) {
|
|
41313
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
|
41314
|
+
}
|
|
41315
|
+
toggleClass(dragEl, this.options.chosenClass, false);
|
|
41316
|
+
|
|
41317
|
+
// Drag stop event
|
|
41318
|
+
_dispatchEvent({
|
|
41319
|
+
sortable: this,
|
|
41320
|
+
name: 'unchoose',
|
|
41321
|
+
toEl: parentEl,
|
|
41322
|
+
newIndex: null,
|
|
41323
|
+
newDraggableIndex: null,
|
|
41324
|
+
originalEvent: evt
|
|
41325
|
+
});
|
|
41326
|
+
if (rootEl !== parentEl) {
|
|
41327
|
+
if (newIndex >= 0) {
|
|
41328
|
+
// Add event
|
|
41329
|
+
_dispatchEvent({
|
|
41330
|
+
rootEl: parentEl,
|
|
41331
|
+
name: 'add',
|
|
41332
|
+
toEl: parentEl,
|
|
41333
|
+
fromEl: rootEl,
|
|
41334
|
+
originalEvent: evt
|
|
41335
|
+
});
|
|
41336
|
+
|
|
41337
|
+
// Remove event
|
|
41338
|
+
_dispatchEvent({
|
|
41339
|
+
sortable: this,
|
|
41340
|
+
name: 'remove',
|
|
41341
|
+
toEl: parentEl,
|
|
41342
|
+
originalEvent: evt
|
|
41343
|
+
});
|
|
41344
|
+
|
|
41345
|
+
// drag from one list and drop into another
|
|
41346
|
+
_dispatchEvent({
|
|
41347
|
+
rootEl: parentEl,
|
|
41348
|
+
name: 'sort',
|
|
41349
|
+
toEl: parentEl,
|
|
41350
|
+
fromEl: rootEl,
|
|
41351
|
+
originalEvent: evt
|
|
41352
|
+
});
|
|
41353
|
+
_dispatchEvent({
|
|
41354
|
+
sortable: this,
|
|
41355
|
+
name: 'sort',
|
|
41356
|
+
toEl: parentEl,
|
|
41357
|
+
originalEvent: evt
|
|
41358
|
+
});
|
|
41359
|
+
}
|
|
41360
|
+
putSortable && putSortable.save();
|
|
41361
|
+
} else {
|
|
41362
|
+
if (newIndex !== oldIndex) {
|
|
41363
|
+
if (newIndex >= 0) {
|
|
41364
|
+
// drag & drop within the same list
|
|
41365
|
+
_dispatchEvent({
|
|
41366
|
+
sortable: this,
|
|
41367
|
+
name: 'update',
|
|
41368
|
+
toEl: parentEl,
|
|
41369
|
+
originalEvent: evt
|
|
41370
|
+
});
|
|
41371
|
+
_dispatchEvent({
|
|
41372
|
+
sortable: this,
|
|
41373
|
+
name: 'sort',
|
|
41374
|
+
toEl: parentEl,
|
|
41375
|
+
originalEvent: evt
|
|
41376
|
+
});
|
|
41377
|
+
}
|
|
41378
|
+
}
|
|
41379
|
+
}
|
|
41380
|
+
if (Sortable.active) {
|
|
41381
|
+
/* jshint eqnull:true */
|
|
41382
|
+
if (newIndex == null || newIndex === -1) {
|
|
41383
|
+
newIndex = oldIndex;
|
|
41384
|
+
newDraggableIndex = oldDraggableIndex;
|
|
41385
|
+
}
|
|
41386
|
+
_dispatchEvent({
|
|
41387
|
+
sortable: this,
|
|
41388
|
+
name: 'end',
|
|
41389
|
+
toEl: parentEl,
|
|
41390
|
+
originalEvent: evt
|
|
41391
|
+
});
|
|
41392
|
+
|
|
41393
|
+
// Save sorting
|
|
41394
|
+
this.save();
|
|
41395
|
+
}
|
|
41396
|
+
}
|
|
41397
|
+
}
|
|
41398
|
+
this._nulling();
|
|
41399
|
+
},
|
|
41400
|
+
_nulling: function _nulling() {
|
|
41401
|
+
pluginEvent('nulling', this);
|
|
41402
|
+
rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
|
|
41403
|
+
savedInputChecked.forEach(function (el) {
|
|
41404
|
+
el.checked = true;
|
|
41405
|
+
});
|
|
41406
|
+
savedInputChecked.length = lastDx = lastDy = 0;
|
|
41407
|
+
},
|
|
41408
|
+
handleEvent: function handleEvent( /**Event*/evt) {
|
|
41409
|
+
switch (evt.type) {
|
|
41410
|
+
case 'drop':
|
|
41411
|
+
case 'dragend':
|
|
41412
|
+
this._onDrop(evt);
|
|
41413
|
+
break;
|
|
41414
|
+
case 'dragenter':
|
|
41415
|
+
case 'dragover':
|
|
41416
|
+
if (dragEl) {
|
|
41417
|
+
this._onDragOver(evt);
|
|
41418
|
+
_globalDragOver(evt);
|
|
41419
|
+
}
|
|
41420
|
+
break;
|
|
41421
|
+
case 'selectstart':
|
|
41422
|
+
evt.preventDefault();
|
|
41423
|
+
break;
|
|
41424
|
+
}
|
|
41425
|
+
},
|
|
41426
|
+
/**
|
|
41427
|
+
* Serializes the item into an array of string.
|
|
41428
|
+
* @returns {String[]}
|
|
41429
|
+
*/
|
|
41430
|
+
toArray: function toArray() {
|
|
41431
|
+
var order = [],
|
|
41432
|
+
el,
|
|
41433
|
+
children = this.el.children,
|
|
41434
|
+
i = 0,
|
|
41435
|
+
n = children.length,
|
|
41436
|
+
options = this.options;
|
|
41437
|
+
for (; i < n; i++) {
|
|
41438
|
+
el = children[i];
|
|
41439
|
+
if (closest(el, options.draggable, this.el, false)) {
|
|
41440
|
+
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
|
41441
|
+
}
|
|
41442
|
+
}
|
|
41443
|
+
return order;
|
|
41444
|
+
},
|
|
41445
|
+
/**
|
|
41446
|
+
* Sorts the elements according to the array.
|
|
41447
|
+
* @param {String[]} order order of the items
|
|
41448
|
+
*/
|
|
41449
|
+
sort: function sort(order, useAnimation) {
|
|
41450
|
+
var items = {},
|
|
41451
|
+
rootEl = this.el;
|
|
41452
|
+
this.toArray().forEach(function (id, i) {
|
|
41453
|
+
var el = rootEl.children[i];
|
|
41454
|
+
if (closest(el, this.options.draggable, rootEl, false)) {
|
|
41455
|
+
items[id] = el;
|
|
41456
|
+
}
|
|
41457
|
+
}, this);
|
|
41458
|
+
useAnimation && this.captureAnimationState();
|
|
41459
|
+
order.forEach(function (id) {
|
|
41460
|
+
if (items[id]) {
|
|
41461
|
+
rootEl.removeChild(items[id]);
|
|
41462
|
+
rootEl.appendChild(items[id]);
|
|
41463
|
+
}
|
|
41464
|
+
});
|
|
41465
|
+
useAnimation && this.animateAll();
|
|
41466
|
+
},
|
|
41467
|
+
/**
|
|
41468
|
+
* Save the current sorting
|
|
41469
|
+
*/
|
|
41470
|
+
save: function save() {
|
|
41471
|
+
var store = this.options.store;
|
|
41472
|
+
store && store.set && store.set(this);
|
|
41473
|
+
},
|
|
41474
|
+
/**
|
|
41475
|
+
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
|
41476
|
+
* @param {HTMLElement} el
|
|
41477
|
+
* @param {String} [selector] default: `options.draggable`
|
|
41478
|
+
* @returns {HTMLElement|null}
|
|
41479
|
+
*/
|
|
41480
|
+
closest: function closest$1(el, selector) {
|
|
41481
|
+
return closest(el, selector || this.options.draggable, this.el, false);
|
|
41482
|
+
},
|
|
41483
|
+
/**
|
|
41484
|
+
* Set/get option
|
|
41485
|
+
* @param {string} name
|
|
41486
|
+
* @param {*} [value]
|
|
41487
|
+
* @returns {*}
|
|
41488
|
+
*/
|
|
41489
|
+
option: function option(name, value) {
|
|
41490
|
+
var options = this.options;
|
|
41491
|
+
if (value === void 0) {
|
|
41492
|
+
return options[name];
|
|
41493
|
+
} else {
|
|
41494
|
+
var modifiedValue = PluginManager.modifyOption(this, name, value);
|
|
41495
|
+
if (typeof modifiedValue !== 'undefined') {
|
|
41496
|
+
options[name] = modifiedValue;
|
|
41497
|
+
} else {
|
|
41498
|
+
options[name] = value;
|
|
41499
|
+
}
|
|
41500
|
+
if (name === 'group') {
|
|
41501
|
+
_prepareGroup(options);
|
|
41502
|
+
}
|
|
41503
|
+
}
|
|
41504
|
+
},
|
|
41505
|
+
/**
|
|
41506
|
+
* Destroy
|
|
41507
|
+
*/
|
|
41508
|
+
destroy: function destroy() {
|
|
41509
|
+
pluginEvent('destroy', this);
|
|
41510
|
+
var el = this.el;
|
|
41511
|
+
el[expando] = null;
|
|
41512
|
+
off(el, 'mousedown', this._onTapStart);
|
|
41513
|
+
off(el, 'touchstart', this._onTapStart);
|
|
41514
|
+
off(el, 'pointerdown', this._onTapStart);
|
|
41515
|
+
if (this.nativeDraggable) {
|
|
41516
|
+
off(el, 'dragover', this);
|
|
41517
|
+
off(el, 'dragenter', this);
|
|
41518
|
+
}
|
|
41519
|
+
// Remove draggable attributes
|
|
41520
|
+
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
|
41521
|
+
el.removeAttribute('draggable');
|
|
41522
|
+
});
|
|
41523
|
+
this._onDrop();
|
|
41524
|
+
this._disableDelayedDragEvents();
|
|
41525
|
+
sortables.splice(sortables.indexOf(this.el), 1);
|
|
41526
|
+
this.el = el = null;
|
|
41527
|
+
},
|
|
41528
|
+
_hideClone: function _hideClone() {
|
|
41529
|
+
if (!cloneHidden) {
|
|
41530
|
+
pluginEvent('hideClone', this);
|
|
41531
|
+
if (Sortable.eventCanceled) return;
|
|
41532
|
+
css(cloneEl, 'display', 'none');
|
|
41533
|
+
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
|
41534
|
+
cloneEl.parentNode.removeChild(cloneEl);
|
|
41535
|
+
}
|
|
41536
|
+
cloneHidden = true;
|
|
41537
|
+
}
|
|
41538
|
+
},
|
|
41539
|
+
_showClone: function _showClone(putSortable) {
|
|
41540
|
+
if (putSortable.lastPutMode !== 'clone') {
|
|
41541
|
+
this._hideClone();
|
|
41542
|
+
return;
|
|
41543
|
+
}
|
|
41544
|
+
if (cloneHidden) {
|
|
41545
|
+
pluginEvent('showClone', this);
|
|
41546
|
+
if (Sortable.eventCanceled) return;
|
|
41547
|
+
|
|
41548
|
+
// show clone at dragEl or original position
|
|
41549
|
+
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
|
41550
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
41551
|
+
} else if (nextEl) {
|
|
41552
|
+
rootEl.insertBefore(cloneEl, nextEl);
|
|
41553
|
+
} else {
|
|
41554
|
+
rootEl.appendChild(cloneEl);
|
|
41555
|
+
}
|
|
41556
|
+
if (this.options.group.revertClone) {
|
|
41557
|
+
this.animate(dragEl, cloneEl);
|
|
41558
|
+
}
|
|
41559
|
+
css(cloneEl, 'display', '');
|
|
41560
|
+
cloneHidden = false;
|
|
41561
|
+
}
|
|
41562
|
+
}
|
|
41563
|
+
};
|
|
41564
|
+
function _globalDragOver( /**Event*/evt) {
|
|
41565
|
+
if (evt.dataTransfer) {
|
|
41566
|
+
evt.dataTransfer.dropEffect = 'move';
|
|
41567
|
+
}
|
|
41568
|
+
evt.cancelable && evt.preventDefault();
|
|
41569
|
+
}
|
|
41570
|
+
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
|
41571
|
+
var evt,
|
|
41572
|
+
sortable = fromEl[expando],
|
|
41573
|
+
onMoveFn = sortable.options.onMove,
|
|
41574
|
+
retVal;
|
|
41575
|
+
// Support for new CustomEvent feature
|
|
41576
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
41577
|
+
evt = new CustomEvent('move', {
|
|
41578
|
+
bubbles: true,
|
|
41579
|
+
cancelable: true
|
|
41580
|
+
});
|
|
41581
|
+
} else {
|
|
41582
|
+
evt = document.createEvent('Event');
|
|
41583
|
+
evt.initEvent('move', true, true);
|
|
41584
|
+
}
|
|
41585
|
+
evt.to = toEl;
|
|
41586
|
+
evt.from = fromEl;
|
|
41587
|
+
evt.dragged = dragEl;
|
|
41588
|
+
evt.draggedRect = dragRect;
|
|
41589
|
+
evt.related = targetEl || toEl;
|
|
41590
|
+
evt.relatedRect = targetRect || getRect(toEl);
|
|
41591
|
+
evt.willInsertAfter = willInsertAfter;
|
|
41592
|
+
evt.originalEvent = originalEvent;
|
|
41593
|
+
fromEl.dispatchEvent(evt);
|
|
41594
|
+
if (onMoveFn) {
|
|
41595
|
+
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
|
41596
|
+
}
|
|
41597
|
+
return retVal;
|
|
41598
|
+
}
|
|
41599
|
+
function _disableDraggable(el) {
|
|
41600
|
+
el.draggable = false;
|
|
41601
|
+
}
|
|
41602
|
+
function _unsilent() {
|
|
41603
|
+
_silent = false;
|
|
41604
|
+
}
|
|
41605
|
+
function _ghostIsFirst(evt, vertical, sortable) {
|
|
41606
|
+
var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
|
|
41607
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
41608
|
+
var spacer = 10;
|
|
41609
|
+
return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
|
|
41610
|
+
}
|
|
41611
|
+
function _ghostIsLast(evt, vertical, sortable) {
|
|
41612
|
+
var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
|
|
41613
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
41614
|
+
var spacer = 10;
|
|
41615
|
+
return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
|
|
41616
|
+
}
|
|
41617
|
+
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
|
41618
|
+
var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
|
|
41619
|
+
targetLength = vertical ? targetRect.height : targetRect.width,
|
|
41620
|
+
targetS1 = vertical ? targetRect.top : targetRect.left,
|
|
41621
|
+
targetS2 = vertical ? targetRect.bottom : targetRect.right,
|
|
41622
|
+
invert = false;
|
|
41623
|
+
if (!invertSwap) {
|
|
41624
|
+
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
|
41625
|
+
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
|
41626
|
+
// multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
|
|
41627
|
+
// check if past first invert threshold on side opposite of lastDirection
|
|
41628
|
+
if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
|
|
41629
|
+
// past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
|
41630
|
+
pastFirstInvertThresh = true;
|
|
41631
|
+
}
|
|
41632
|
+
if (!pastFirstInvertThresh) {
|
|
41633
|
+
// dragEl shadow (target move distance shadow)
|
|
41634
|
+
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
|
|
41635
|
+
: mouseOnAxis > targetS2 - targetMoveDistance) {
|
|
41636
|
+
return -lastDirection;
|
|
41637
|
+
}
|
|
41638
|
+
} else {
|
|
41639
|
+
invert = true;
|
|
41640
|
+
}
|
|
41641
|
+
} else {
|
|
41642
|
+
// Regular
|
|
41643
|
+
if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
|
|
41644
|
+
return _getInsertDirection(target);
|
|
41645
|
+
}
|
|
41646
|
+
}
|
|
41647
|
+
}
|
|
41648
|
+
invert = invert || invertSwap;
|
|
41649
|
+
if (invert) {
|
|
41650
|
+
// Invert of regular
|
|
41651
|
+
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
|
41652
|
+
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
|
41653
|
+
}
|
|
41654
|
+
}
|
|
41655
|
+
return 0;
|
|
41656
|
+
}
|
|
41657
|
+
|
|
41658
|
+
/**
|
|
41659
|
+
* Gets the direction dragEl must be swapped relative to target in order to make it
|
|
41660
|
+
* seem that dragEl has been "inserted" into that element's position
|
|
41661
|
+
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
|
41662
|
+
* @return {Number} Direction dragEl must be swapped
|
|
41663
|
+
*/
|
|
41664
|
+
function _getInsertDirection(target) {
|
|
41665
|
+
if (index(dragEl) < index(target)) {
|
|
41666
|
+
return 1;
|
|
41667
|
+
} else {
|
|
41668
|
+
return -1;
|
|
41669
|
+
}
|
|
41670
|
+
}
|
|
41671
|
+
|
|
41672
|
+
/**
|
|
41673
|
+
* Generate id
|
|
41674
|
+
* @param {HTMLElement} el
|
|
41675
|
+
* @returns {String}
|
|
41676
|
+
* @private
|
|
41677
|
+
*/
|
|
41678
|
+
function _generateId(el) {
|
|
41679
|
+
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
|
41680
|
+
i = str.length,
|
|
41681
|
+
sum = 0;
|
|
41682
|
+
while (i--) {
|
|
41683
|
+
sum += str.charCodeAt(i);
|
|
41684
|
+
}
|
|
41685
|
+
return sum.toString(36);
|
|
41686
|
+
}
|
|
41687
|
+
function _saveInputCheckedState(root) {
|
|
41688
|
+
savedInputChecked.length = 0;
|
|
41689
|
+
var inputs = root.getElementsByTagName('input');
|
|
41690
|
+
var idx = inputs.length;
|
|
41691
|
+
while (idx--) {
|
|
41692
|
+
var el = inputs[idx];
|
|
41693
|
+
el.checked && savedInputChecked.push(el);
|
|
41694
|
+
}
|
|
41695
|
+
}
|
|
41696
|
+
function _nextTick(fn) {
|
|
41697
|
+
return setTimeout(fn, 0);
|
|
41698
|
+
}
|
|
41699
|
+
function _cancelNextTick(id) {
|
|
41700
|
+
return clearTimeout(id);
|
|
41701
|
+
}
|
|
41702
|
+
|
|
41703
|
+
// Fixed #973:
|
|
41704
|
+
if (documentExists) {
|
|
41705
|
+
on(document, 'touchmove', function (evt) {
|
|
41706
|
+
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
|
41707
|
+
evt.preventDefault();
|
|
41708
|
+
}
|
|
41709
|
+
});
|
|
41710
|
+
}
|
|
41711
|
+
|
|
41712
|
+
// Export utils
|
|
41713
|
+
Sortable.utils = {
|
|
41714
|
+
on: on,
|
|
41715
|
+
off: off,
|
|
41716
|
+
css: css,
|
|
41717
|
+
find: find,
|
|
41718
|
+
is: function is(el, selector) {
|
|
41719
|
+
return !!closest(el, selector, el, false);
|
|
41720
|
+
},
|
|
41721
|
+
extend: extend,
|
|
41722
|
+
throttle: throttle,
|
|
41723
|
+
closest: closest,
|
|
41724
|
+
toggleClass: toggleClass,
|
|
41725
|
+
clone: clone,
|
|
41726
|
+
index: index,
|
|
41727
|
+
nextTick: _nextTick,
|
|
41728
|
+
cancelNextTick: _cancelNextTick,
|
|
41729
|
+
detectDirection: _detectDirection,
|
|
41730
|
+
getChild: getChild,
|
|
41731
|
+
expando: expando
|
|
41732
|
+
};
|
|
41733
|
+
|
|
41734
|
+
/**
|
|
41735
|
+
* Get the Sortable instance of an element
|
|
41736
|
+
* @param {HTMLElement} element The element
|
|
41737
|
+
* @return {Sortable|undefined} The instance of Sortable
|
|
41738
|
+
*/
|
|
41739
|
+
Sortable.get = function (element) {
|
|
41740
|
+
return element[expando];
|
|
41741
|
+
};
|
|
41742
|
+
|
|
41743
|
+
/**
|
|
41744
|
+
* Mount a plugin to Sortable
|
|
41745
|
+
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
|
41746
|
+
*/
|
|
41747
|
+
Sortable.mount = function () {
|
|
41748
|
+
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41749
|
+
plugins[_key] = arguments[_key];
|
|
41750
|
+
}
|
|
41751
|
+
if (plugins[0].constructor === Array) plugins = plugins[0];
|
|
41752
|
+
plugins.forEach(function (plugin) {
|
|
41753
|
+
if (!plugin.prototype || !plugin.prototype.constructor) {
|
|
41754
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
|
41755
|
+
}
|
|
41756
|
+
if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
|
|
41757
|
+
PluginManager.mount(plugin);
|
|
41758
|
+
});
|
|
41759
|
+
};
|
|
41760
|
+
|
|
41761
|
+
/**
|
|
41762
|
+
* Create sortable instance
|
|
41763
|
+
* @param {HTMLElement} el
|
|
41764
|
+
* @param {Object} [options]
|
|
41765
|
+
*/
|
|
41766
|
+
Sortable.create = function (el, options) {
|
|
41767
|
+
return new Sortable(el, options);
|
|
41768
|
+
};
|
|
41769
|
+
|
|
41770
|
+
// Export
|
|
41771
|
+
Sortable.version = version;
|
|
41772
|
+
|
|
41773
|
+
var autoScrolls = [],
|
|
41774
|
+
scrollEl,
|
|
41775
|
+
scrollRootEl,
|
|
41776
|
+
scrolling = false,
|
|
41777
|
+
lastAutoScrollX,
|
|
41778
|
+
lastAutoScrollY,
|
|
41779
|
+
touchEvt$1,
|
|
41780
|
+
pointerElemChangedInterval;
|
|
41781
|
+
function AutoScrollPlugin() {
|
|
41782
|
+
function AutoScroll() {
|
|
41783
|
+
this.defaults = {
|
|
41784
|
+
scroll: true,
|
|
41785
|
+
forceAutoScrollFallback: false,
|
|
41786
|
+
scrollSensitivity: 30,
|
|
41787
|
+
scrollSpeed: 10,
|
|
41788
|
+
bubbleScroll: true
|
|
41789
|
+
};
|
|
41790
|
+
|
|
41791
|
+
// Bind all private methods
|
|
41792
|
+
for (var fn in this) {
|
|
41793
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
41794
|
+
this[fn] = this[fn].bind(this);
|
|
41795
|
+
}
|
|
41796
|
+
}
|
|
39418
41797
|
}
|
|
41798
|
+
AutoScroll.prototype = {
|
|
41799
|
+
dragStarted: function dragStarted(_ref) {
|
|
41800
|
+
var originalEvent = _ref.originalEvent;
|
|
41801
|
+
if (this.sortable.nativeDraggable) {
|
|
41802
|
+
on(document, 'dragover', this._handleAutoScroll);
|
|
41803
|
+
} else {
|
|
41804
|
+
if (this.options.supportPointer) {
|
|
41805
|
+
on(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
41806
|
+
} else if (originalEvent.touches) {
|
|
41807
|
+
on(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
41808
|
+
} else {
|
|
41809
|
+
on(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
41810
|
+
}
|
|
41811
|
+
}
|
|
41812
|
+
},
|
|
41813
|
+
dragOverCompleted: function dragOverCompleted(_ref2) {
|
|
41814
|
+
var originalEvent = _ref2.originalEvent;
|
|
41815
|
+
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
|
41816
|
+
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
|
41817
|
+
this._handleAutoScroll(originalEvent);
|
|
41818
|
+
}
|
|
41819
|
+
},
|
|
41820
|
+
drop: function drop() {
|
|
41821
|
+
if (this.sortable.nativeDraggable) {
|
|
41822
|
+
off(document, 'dragover', this._handleAutoScroll);
|
|
41823
|
+
} else {
|
|
41824
|
+
off(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
41825
|
+
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
41826
|
+
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
41827
|
+
}
|
|
41828
|
+
clearPointerElemChangedInterval();
|
|
41829
|
+
clearAutoScrolls();
|
|
41830
|
+
cancelThrottle();
|
|
41831
|
+
},
|
|
41832
|
+
nulling: function nulling() {
|
|
41833
|
+
touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
|
|
41834
|
+
autoScrolls.length = 0;
|
|
41835
|
+
},
|
|
41836
|
+
_handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
|
|
41837
|
+
this._handleAutoScroll(evt, true);
|
|
41838
|
+
},
|
|
41839
|
+
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
|
41840
|
+
var _this = this;
|
|
41841
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
41842
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
41843
|
+
elem = document.elementFromPoint(x, y);
|
|
41844
|
+
touchEvt$1 = evt;
|
|
41845
|
+
|
|
41846
|
+
// IE does not seem to have native autoscroll,
|
|
41847
|
+
// Edge's autoscroll seems too conditional,
|
|
41848
|
+
// MACOS Safari does not have autoscroll,
|
|
41849
|
+
// Firefox and Chrome are good
|
|
41850
|
+
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
|
41851
|
+
autoScroll(evt, this.options, elem, fallback);
|
|
41852
|
+
|
|
41853
|
+
// Listener for pointer element change
|
|
41854
|
+
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
|
41855
|
+
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
|
41856
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
|
41857
|
+
// Detect for pointer elem change, emulating native DnD behaviour
|
|
41858
|
+
pointerElemChangedInterval = setInterval(function () {
|
|
41859
|
+
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
|
41860
|
+
if (newElem !== ogElemScroller) {
|
|
41861
|
+
ogElemScroller = newElem;
|
|
41862
|
+
clearAutoScrolls();
|
|
41863
|
+
}
|
|
41864
|
+
autoScroll(evt, _this.options, newElem, fallback);
|
|
41865
|
+
}, 10);
|
|
41866
|
+
lastAutoScrollX = x;
|
|
41867
|
+
lastAutoScrollY = y;
|
|
41868
|
+
}
|
|
41869
|
+
} else {
|
|
41870
|
+
// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
|
|
41871
|
+
if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
|
|
41872
|
+
clearAutoScrolls();
|
|
41873
|
+
return;
|
|
41874
|
+
}
|
|
41875
|
+
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
|
41876
|
+
}
|
|
41877
|
+
}
|
|
41878
|
+
};
|
|
41879
|
+
return _extends(AutoScroll, {
|
|
41880
|
+
pluginName: 'scroll',
|
|
41881
|
+
initializeByDefault: true
|
|
41882
|
+
});
|
|
39419
41883
|
}
|
|
41884
|
+
function clearAutoScrolls() {
|
|
41885
|
+
autoScrolls.forEach(function (autoScroll) {
|
|
41886
|
+
clearInterval(autoScroll.pid);
|
|
41887
|
+
});
|
|
41888
|
+
autoScrolls = [];
|
|
41889
|
+
}
|
|
41890
|
+
function clearPointerElemChangedInterval() {
|
|
41891
|
+
clearInterval(pointerElemChangedInterval);
|
|
41892
|
+
}
|
|
41893
|
+
var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
|
41894
|
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
|
41895
|
+
if (!options.scroll) return;
|
|
41896
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
41897
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
41898
|
+
sens = options.scrollSensitivity,
|
|
41899
|
+
speed = options.scrollSpeed,
|
|
41900
|
+
winScroller = getWindowScrollingElement();
|
|
41901
|
+
var scrollThisInstance = false,
|
|
41902
|
+
scrollCustomFn;
|
|
41903
|
+
|
|
41904
|
+
// New scroll root, set scrollEl
|
|
41905
|
+
if (scrollRootEl !== rootEl) {
|
|
41906
|
+
scrollRootEl = rootEl;
|
|
41907
|
+
clearAutoScrolls();
|
|
41908
|
+
scrollEl = options.scroll;
|
|
41909
|
+
scrollCustomFn = options.scrollFn;
|
|
41910
|
+
if (scrollEl === true) {
|
|
41911
|
+
scrollEl = getParentAutoScrollElement(rootEl, true);
|
|
41912
|
+
}
|
|
41913
|
+
}
|
|
41914
|
+
var layersOut = 0;
|
|
41915
|
+
var currentParent = scrollEl;
|
|
41916
|
+
do {
|
|
41917
|
+
var el = currentParent,
|
|
41918
|
+
rect = getRect(el),
|
|
41919
|
+
top = rect.top,
|
|
41920
|
+
bottom = rect.bottom,
|
|
41921
|
+
left = rect.left,
|
|
41922
|
+
right = rect.right,
|
|
41923
|
+
width = rect.width,
|
|
41924
|
+
height = rect.height,
|
|
41925
|
+
canScrollX = void 0,
|
|
41926
|
+
canScrollY = void 0,
|
|
41927
|
+
scrollWidth = el.scrollWidth,
|
|
41928
|
+
scrollHeight = el.scrollHeight,
|
|
41929
|
+
elCSS = css(el),
|
|
41930
|
+
scrollPosX = el.scrollLeft,
|
|
41931
|
+
scrollPosY = el.scrollTop;
|
|
41932
|
+
if (el === winScroller) {
|
|
41933
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
|
41934
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
|
41935
|
+
} else {
|
|
41936
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
|
41937
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
|
41938
|
+
}
|
|
41939
|
+
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
|
41940
|
+
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
|
41941
|
+
if (!autoScrolls[layersOut]) {
|
|
41942
|
+
for (var i = 0; i <= layersOut; i++) {
|
|
41943
|
+
if (!autoScrolls[i]) {
|
|
41944
|
+
autoScrolls[i] = {};
|
|
41945
|
+
}
|
|
41946
|
+
}
|
|
41947
|
+
}
|
|
41948
|
+
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
|
41949
|
+
autoScrolls[layersOut].el = el;
|
|
41950
|
+
autoScrolls[layersOut].vx = vx;
|
|
41951
|
+
autoScrolls[layersOut].vy = vy;
|
|
41952
|
+
clearInterval(autoScrolls[layersOut].pid);
|
|
41953
|
+
if (vx != 0 || vy != 0) {
|
|
41954
|
+
scrollThisInstance = true;
|
|
41955
|
+
/* jshint loopfunc:true */
|
|
41956
|
+
autoScrolls[layersOut].pid = setInterval(function () {
|
|
41957
|
+
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
|
41958
|
+
if (isFallback && this.layer === 0) {
|
|
41959
|
+
Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
|
|
41960
|
+
}
|
|
41961
|
+
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
|
41962
|
+
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
|
41963
|
+
if (typeof scrollCustomFn === 'function') {
|
|
41964
|
+
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
|
|
41965
|
+
return;
|
|
41966
|
+
}
|
|
41967
|
+
}
|
|
41968
|
+
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
41969
|
+
}.bind({
|
|
41970
|
+
layer: layersOut
|
|
41971
|
+
}), 24);
|
|
41972
|
+
}
|
|
41973
|
+
}
|
|
41974
|
+
layersOut++;
|
|
41975
|
+
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
|
41976
|
+
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
|
41977
|
+
}, 30);
|
|
41978
|
+
|
|
41979
|
+
var drop = function drop(_ref) {
|
|
41980
|
+
var originalEvent = _ref.originalEvent,
|
|
41981
|
+
putSortable = _ref.putSortable,
|
|
41982
|
+
dragEl = _ref.dragEl,
|
|
41983
|
+
activeSortable = _ref.activeSortable,
|
|
41984
|
+
dispatchSortableEvent = _ref.dispatchSortableEvent,
|
|
41985
|
+
hideGhostForTarget = _ref.hideGhostForTarget,
|
|
41986
|
+
unhideGhostForTarget = _ref.unhideGhostForTarget;
|
|
41987
|
+
if (!originalEvent) return;
|
|
41988
|
+
var toSortable = putSortable || activeSortable;
|
|
41989
|
+
hideGhostForTarget();
|
|
41990
|
+
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
|
41991
|
+
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
41992
|
+
unhideGhostForTarget();
|
|
41993
|
+
if (toSortable && !toSortable.el.contains(target)) {
|
|
41994
|
+
dispatchSortableEvent('spill');
|
|
41995
|
+
this.onSpill({
|
|
41996
|
+
dragEl: dragEl,
|
|
41997
|
+
putSortable: putSortable
|
|
41998
|
+
});
|
|
41999
|
+
}
|
|
42000
|
+
};
|
|
42001
|
+
function Revert() {}
|
|
42002
|
+
Revert.prototype = {
|
|
42003
|
+
startIndex: null,
|
|
42004
|
+
dragStart: function dragStart(_ref2) {
|
|
42005
|
+
var oldDraggableIndex = _ref2.oldDraggableIndex;
|
|
42006
|
+
this.startIndex = oldDraggableIndex;
|
|
42007
|
+
},
|
|
42008
|
+
onSpill: function onSpill(_ref3) {
|
|
42009
|
+
var dragEl = _ref3.dragEl,
|
|
42010
|
+
putSortable = _ref3.putSortable;
|
|
42011
|
+
this.sortable.captureAnimationState();
|
|
42012
|
+
if (putSortable) {
|
|
42013
|
+
putSortable.captureAnimationState();
|
|
42014
|
+
}
|
|
42015
|
+
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
|
42016
|
+
if (nextSibling) {
|
|
42017
|
+
this.sortable.el.insertBefore(dragEl, nextSibling);
|
|
42018
|
+
} else {
|
|
42019
|
+
this.sortable.el.appendChild(dragEl);
|
|
42020
|
+
}
|
|
42021
|
+
this.sortable.animateAll();
|
|
42022
|
+
if (putSortable) {
|
|
42023
|
+
putSortable.animateAll();
|
|
42024
|
+
}
|
|
42025
|
+
},
|
|
42026
|
+
drop: drop
|
|
42027
|
+
};
|
|
42028
|
+
_extends(Revert, {
|
|
42029
|
+
pluginName: 'revertOnSpill'
|
|
42030
|
+
});
|
|
42031
|
+
function Remove() {}
|
|
42032
|
+
Remove.prototype = {
|
|
42033
|
+
onSpill: function onSpill(_ref4) {
|
|
42034
|
+
var dragEl = _ref4.dragEl,
|
|
42035
|
+
putSortable = _ref4.putSortable;
|
|
42036
|
+
var parentSortable = putSortable || this.sortable;
|
|
42037
|
+
parentSortable.captureAnimationState();
|
|
42038
|
+
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
|
42039
|
+
parentSortable.animateAll();
|
|
42040
|
+
},
|
|
42041
|
+
drop: drop
|
|
42042
|
+
};
|
|
42043
|
+
_extends(Remove, {
|
|
42044
|
+
pluginName: 'removeOnSpill'
|
|
42045
|
+
});
|
|
39420
42046
|
|
|
42047
|
+
Sortable.mount(new AutoScrollPlugin());
|
|
42048
|
+
Sortable.mount(Remove, Revert);
|
|
42049
|
+
|
|
42050
|
+
const DRAG_HANDLE_SELECTOR = '[data-drag-handle]';
|
|
42051
|
+
const DRAGGABLE_ITEM_SELECTOR = '.array-item[data-reorderable="true"]';
|
|
42052
|
+
const DEFAULT_CONTAINER_CLASS = 'has-an-item-which-is-being-dragged';
|
|
42053
|
+
const DEFAULT_DROP_ELEVATION_CLASS = 'is-elevated';
|
|
42054
|
+
const DROP_ELEVATION_DURATION = 1000;
|
|
42055
|
+
const TOUCH_DRAG_DELAY_MS = 200; // Adds a short hold on touch (long-press) so scroll gestures do not reorder items.
|
|
39421
42056
|
class ArrayFieldTemplate extends react.Component {
|
|
39422
42057
|
constructor(props) {
|
|
39423
42058
|
super(props);
|
|
39424
|
-
this.
|
|
39425
|
-
this.
|
|
39426
|
-
|
|
42059
|
+
this.itemByIndex = new Map();
|
|
42060
|
+
this.handleAddClick = (event) => {
|
|
42061
|
+
event.stopPropagation();
|
|
42062
|
+
this.props.onAddClick(event);
|
|
42063
|
+
};
|
|
42064
|
+
this.setContainer = (element) => {
|
|
42065
|
+
if (this.container === element) {
|
|
42066
|
+
return;
|
|
42067
|
+
}
|
|
42068
|
+
this.teardownDragController();
|
|
42069
|
+
this.container = element !== null && element !== void 0 ? element : undefined;
|
|
42070
|
+
this.setupDragController();
|
|
42071
|
+
};
|
|
42072
|
+
this.handleSortStart = (event) => {
|
|
42073
|
+
if (!this.canReorderItems()) {
|
|
42074
|
+
return;
|
|
42075
|
+
}
|
|
42076
|
+
this.dragSnapshot = [...this.state.order];
|
|
42077
|
+
this.draggedItemIndex = this.getReorderId(event.item);
|
|
42078
|
+
if (this.container) {
|
|
42079
|
+
this.container.classList.add(DEFAULT_CONTAINER_CLASS);
|
|
42080
|
+
}
|
|
42081
|
+
if (event.item instanceof HTMLElement) {
|
|
42082
|
+
this.applyDropElevation(event.item);
|
|
42083
|
+
}
|
|
42084
|
+
};
|
|
42085
|
+
this.handleSortEnd = (event) => {
|
|
42086
|
+
var _a;
|
|
42087
|
+
if (!this.canReorderItems()) {
|
|
42088
|
+
return;
|
|
42089
|
+
}
|
|
42090
|
+
if (this.container) {
|
|
42091
|
+
this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
|
|
42092
|
+
}
|
|
42093
|
+
const snapshot = this.dragSnapshot;
|
|
42094
|
+
const draggedItemIndex = this.draggedItemIndex;
|
|
42095
|
+
this.dragSnapshot = undefined;
|
|
42096
|
+
this.draggedItemIndex = undefined;
|
|
42097
|
+
if (event.item instanceof HTMLElement) {
|
|
42098
|
+
this.dropElevationTarget = event.item;
|
|
42099
|
+
}
|
|
42100
|
+
const finalOrder = this.readOrderFromDom();
|
|
42101
|
+
if (!this.arraysEqual(this.state.order, finalOrder)) {
|
|
42102
|
+
this.setState({ order: finalOrder });
|
|
42103
|
+
}
|
|
42104
|
+
if (snapshot === undefined ||
|
|
42105
|
+
draggedItemIndex === undefined ||
|
|
42106
|
+
!(event.item instanceof HTMLElement)) {
|
|
42107
|
+
this.scheduleDropElevationRemoval();
|
|
42108
|
+
return;
|
|
42109
|
+
}
|
|
42110
|
+
const fromPosition = snapshot.indexOf(draggedItemIndex);
|
|
42111
|
+
const toPosition = finalOrder.indexOf(draggedItemIndex);
|
|
42112
|
+
if (fromPosition === -1 ||
|
|
42113
|
+
toPosition === -1 ||
|
|
42114
|
+
fromPosition === toPosition) {
|
|
42115
|
+
this.scheduleDropElevationRemoval();
|
|
42116
|
+
return;
|
|
42117
|
+
}
|
|
42118
|
+
const targetItem = ((_a = this.props.items) !== null && _a !== void 0 ? _a : []).find((entry) => {
|
|
42119
|
+
var _a;
|
|
42120
|
+
return ((_a = entry.index) !== null && _a !== void 0 ? _a : -1) === draggedItemIndex;
|
|
42121
|
+
});
|
|
42122
|
+
if (!targetItem || typeof targetItem.onReorderClick !== 'function') {
|
|
42123
|
+
this.scheduleDropElevationRemoval();
|
|
42124
|
+
return;
|
|
42125
|
+
}
|
|
42126
|
+
requestAnimationFrame(() => {
|
|
42127
|
+
const reorder = targetItem.onReorderClick(draggedItemIndex, toPosition);
|
|
42128
|
+
if (typeof reorder === 'function') {
|
|
42129
|
+
reorder();
|
|
42130
|
+
}
|
|
42131
|
+
});
|
|
42132
|
+
this.scheduleDropElevationRemoval();
|
|
42133
|
+
};
|
|
42134
|
+
this.state = {
|
|
42135
|
+
order: this.extractIndices(props.items),
|
|
42136
|
+
};
|
|
42137
|
+
}
|
|
42138
|
+
componentWillUnmount() {
|
|
42139
|
+
this.teardownDragController();
|
|
42140
|
+
}
|
|
42141
|
+
componentDidMount() {
|
|
42142
|
+
this.setupDragController();
|
|
42143
|
+
}
|
|
42144
|
+
componentDidUpdate(previousProps) {
|
|
42145
|
+
if (previousProps.items !== this.props.items) {
|
|
42146
|
+
const nextOrder = this.extractIndices(this.props.items);
|
|
42147
|
+
if (!this.arraysEqual(this.state.order, nextOrder)) {
|
|
42148
|
+
this.setState({
|
|
42149
|
+
order: nextOrder,
|
|
42150
|
+
}, () => {
|
|
42151
|
+
this.setupDragController();
|
|
42152
|
+
});
|
|
42153
|
+
return;
|
|
42154
|
+
}
|
|
42155
|
+
}
|
|
42156
|
+
if (previousProps.items !== this.props.items ||
|
|
42157
|
+
previousProps.schema !== this.props.schema ||
|
|
42158
|
+
previousProps.disabled !== this.props.disabled ||
|
|
42159
|
+
previousProps.readonly !== this.props.readonly) {
|
|
42160
|
+
this.setupDragController();
|
|
42161
|
+
}
|
|
39427
42162
|
}
|
|
39428
42163
|
render() {
|
|
39429
|
-
|
|
42164
|
+
const controls = this.getItemControls();
|
|
42165
|
+
const { ordered: orderedItems, byIndex } = this.getOrderedItems();
|
|
42166
|
+
this.itemByIndex = byIndex;
|
|
42167
|
+
return react.createElement('div', {}, renderTitle(this.props.title), renderDescription(this.props.schema.description), react.createElement('div', {
|
|
42168
|
+
className: 'array-items',
|
|
42169
|
+
ref: this.setContainer,
|
|
42170
|
+
}, orderedItems.map((item, index) => this.renderItem(item, index, controls))), this.renderAddButton());
|
|
39430
42171
|
}
|
|
39431
42172
|
renderAddButton() {
|
|
39432
42173
|
if (!this.props.canAdd) {
|
|
@@ -39439,40 +42180,214 @@ class ArrayFieldTemplate extends react.Component {
|
|
|
39439
42180
|
class: 'button-add-new',
|
|
39440
42181
|
});
|
|
39441
42182
|
}
|
|
39442
|
-
|
|
42183
|
+
getItemControls() {
|
|
42184
|
+
return {
|
|
42185
|
+
allowItemRemoval: this.canRemoveItems(),
|
|
42186
|
+
};
|
|
42187
|
+
}
|
|
42188
|
+
renderItem(item, index, controls) {
|
|
42189
|
+
var _a;
|
|
39443
42190
|
const { schema, formData, formContext } = this.props;
|
|
39444
|
-
const
|
|
42191
|
+
const itemIndex = (_a = item.index) !== null && _a !== void 0 ? _a : index;
|
|
42192
|
+
const allowItemReorder = this.isItemReorderable(item);
|
|
39445
42193
|
if (isObjectType(schema.items)) {
|
|
39446
42194
|
return react.createElement(CollapsibleItemTemplate, {
|
|
39447
42195
|
key: item.key,
|
|
39448
42196
|
item: item,
|
|
39449
|
-
data: formData[
|
|
42197
|
+
data: Array.isArray(formData) ? formData[itemIndex] : undefined,
|
|
39450
42198
|
schema: schema,
|
|
39451
42199
|
formSchema: formContext.schema,
|
|
39452
|
-
index:
|
|
42200
|
+
index: itemIndex,
|
|
39453
42201
|
allowItemRemoval: controls.allowItemRemoval,
|
|
39454
|
-
allowItemReorder:
|
|
42202
|
+
allowItemReorder: allowItemReorder,
|
|
39455
42203
|
});
|
|
39456
42204
|
}
|
|
39457
42205
|
return react.createElement(SimpleItemTemplate, {
|
|
39458
42206
|
key: item.key,
|
|
39459
42207
|
item: item,
|
|
39460
|
-
index:
|
|
42208
|
+
index: itemIndex,
|
|
42209
|
+
dataIndex: itemIndex,
|
|
39461
42210
|
allowItemRemoval: controls.allowItemRemoval,
|
|
39462
|
-
allowItemReorder:
|
|
42211
|
+
allowItemReorder: allowItemReorder,
|
|
39463
42212
|
});
|
|
39464
42213
|
}
|
|
39465
|
-
|
|
39466
|
-
var _a;
|
|
39467
|
-
const
|
|
42214
|
+
getOrderedItems() {
|
|
42215
|
+
var _a, _b;
|
|
42216
|
+
const items = (_a = this.props.items) !== null && _a !== void 0 ? _a : [];
|
|
42217
|
+
const byIndex = new Map();
|
|
42218
|
+
let entryIndex = 0;
|
|
42219
|
+
for (const entry of items) {
|
|
42220
|
+
byIndex.set((_b = entry.index) !== null && _b !== void 0 ? _b : entryIndex, entry);
|
|
42221
|
+
entryIndex += 1;
|
|
42222
|
+
}
|
|
42223
|
+
const ordered = [];
|
|
42224
|
+
const used = new Set();
|
|
42225
|
+
for (const index of this.state.order) {
|
|
42226
|
+
const entry = byIndex.get(index);
|
|
42227
|
+
if (!entry) {
|
|
42228
|
+
continue;
|
|
42229
|
+
}
|
|
42230
|
+
ordered.push(entry);
|
|
42231
|
+
used.add(index);
|
|
42232
|
+
}
|
|
42233
|
+
for (const [index, entry] of byIndex.entries()) {
|
|
42234
|
+
if (!used.has(index)) {
|
|
42235
|
+
ordered.push(entry);
|
|
42236
|
+
}
|
|
42237
|
+
}
|
|
39468
42238
|
return {
|
|
39469
|
-
|
|
39470
|
-
|
|
42239
|
+
ordered,
|
|
42240
|
+
byIndex,
|
|
39471
42241
|
};
|
|
39472
42242
|
}
|
|
39473
|
-
|
|
39474
|
-
|
|
39475
|
-
|
|
42243
|
+
setupDragController() {
|
|
42244
|
+
if (!this.container || !this.canReorderItems()) {
|
|
42245
|
+
this.teardownDragController();
|
|
42246
|
+
return;
|
|
42247
|
+
}
|
|
42248
|
+
const reorderableCount = this.getReorderableOrder().length;
|
|
42249
|
+
if (reorderableCount < 2) {
|
|
42250
|
+
this.teardownDragController();
|
|
42251
|
+
return;
|
|
42252
|
+
}
|
|
42253
|
+
if (this.sortable) {
|
|
42254
|
+
this.sortable.option('handle', DRAG_HANDLE_SELECTOR);
|
|
42255
|
+
this.sortable.option('draggable', DRAGGABLE_ITEM_SELECTOR);
|
|
42256
|
+
this.sortable.option('disabled', false);
|
|
42257
|
+
this.sortable.option('delay', TOUCH_DRAG_DELAY_MS);
|
|
42258
|
+
this.sortable.option('delayOnTouchOnly', true);
|
|
42259
|
+
return;
|
|
42260
|
+
}
|
|
42261
|
+
this.sortable = Sortable.create(this.container, {
|
|
42262
|
+
animation: 150,
|
|
42263
|
+
handle: DRAG_HANDLE_SELECTOR,
|
|
42264
|
+
draggable: DRAGGABLE_ITEM_SELECTOR,
|
|
42265
|
+
delay: TOUCH_DRAG_DELAY_MS,
|
|
42266
|
+
delayOnTouchOnly: true,
|
|
42267
|
+
onStart: this.handleSortStart,
|
|
42268
|
+
onEnd: this.handleSortEnd,
|
|
42269
|
+
});
|
|
42270
|
+
}
|
|
42271
|
+
teardownDragController() {
|
|
42272
|
+
if (this.sortable) {
|
|
42273
|
+
this.sortable.destroy();
|
|
42274
|
+
this.sortable = undefined;
|
|
42275
|
+
}
|
|
42276
|
+
this.clearDropElevationTimer();
|
|
42277
|
+
if (this.dropElevationTarget) {
|
|
42278
|
+
this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42279
|
+
this.dropElevationTarget = undefined;
|
|
42280
|
+
}
|
|
42281
|
+
if (this.container) {
|
|
42282
|
+
this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
|
|
42283
|
+
}
|
|
42284
|
+
this.dragSnapshot = undefined;
|
|
42285
|
+
this.draggedItemIndex = undefined;
|
|
42286
|
+
}
|
|
42287
|
+
canReorderItems() {
|
|
42288
|
+
if (this.props.disabled || this.props.readonly) {
|
|
42289
|
+
return false;
|
|
42290
|
+
}
|
|
42291
|
+
const schema = this.props.schema;
|
|
42292
|
+
const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
|
|
42293
|
+
return limeOptions.allowItemReorder !== false;
|
|
42294
|
+
}
|
|
42295
|
+
canRemoveItems() {
|
|
42296
|
+
const schema = this.props.schema;
|
|
42297
|
+
const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
|
|
42298
|
+
return limeOptions.allowItemRemoval !== false;
|
|
42299
|
+
}
|
|
42300
|
+
isItemReorderable(item) {
|
|
42301
|
+
return (this.canReorderItems() &&
|
|
42302
|
+
Boolean((item === null || item === void 0 ? void 0 : item.hasMoveDown) || (item === null || item === void 0 ? void 0 : item.hasMoveUp)));
|
|
42303
|
+
}
|
|
42304
|
+
isIndexReorderable(index) {
|
|
42305
|
+
const item = this.itemByIndex.get(index);
|
|
42306
|
+
if (!item) {
|
|
42307
|
+
return false;
|
|
42308
|
+
}
|
|
42309
|
+
return this.isItemReorderable(item);
|
|
42310
|
+
}
|
|
42311
|
+
getReorderableOrder(order = this.state.order) {
|
|
42312
|
+
const result = [];
|
|
42313
|
+
for (const index of order) {
|
|
42314
|
+
if (this.isIndexReorderable(index)) {
|
|
42315
|
+
result.push(index);
|
|
42316
|
+
}
|
|
42317
|
+
}
|
|
42318
|
+
return result;
|
|
42319
|
+
}
|
|
42320
|
+
readOrderFromDom() {
|
|
42321
|
+
if (!this.container) {
|
|
42322
|
+
return [];
|
|
42323
|
+
}
|
|
42324
|
+
const items = [...this.container.querySelectorAll('.array-item')];
|
|
42325
|
+
const order = [];
|
|
42326
|
+
for (const element of items) {
|
|
42327
|
+
const index = this.getReorderId(element);
|
|
42328
|
+
if (index !== undefined) {
|
|
42329
|
+
order.push(index);
|
|
42330
|
+
}
|
|
42331
|
+
}
|
|
42332
|
+
return order;
|
|
42333
|
+
}
|
|
42334
|
+
getReorderId(element) {
|
|
42335
|
+
if (!element) {
|
|
42336
|
+
return undefined;
|
|
42337
|
+
}
|
|
42338
|
+
if (!(element instanceof HTMLElement)) {
|
|
42339
|
+
return undefined;
|
|
42340
|
+
}
|
|
42341
|
+
const value = element.dataset.reorderId;
|
|
42342
|
+
if (value === undefined) {
|
|
42343
|
+
return undefined;
|
|
42344
|
+
}
|
|
42345
|
+
const parsed = Number.parseInt(value, 10);
|
|
42346
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
42347
|
+
}
|
|
42348
|
+
applyDropElevation(item) {
|
|
42349
|
+
if (this.dropElevationTarget && this.dropElevationTarget !== item) {
|
|
42350
|
+
this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42351
|
+
}
|
|
42352
|
+
this.clearDropElevationTimer();
|
|
42353
|
+
item.classList.add(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42354
|
+
this.dropElevationTarget = item;
|
|
42355
|
+
}
|
|
42356
|
+
scheduleDropElevationRemoval() {
|
|
42357
|
+
if (!this.dropElevationTarget) {
|
|
42358
|
+
return;
|
|
42359
|
+
}
|
|
42360
|
+
const target = this.dropElevationTarget;
|
|
42361
|
+
this.clearDropElevationTimer();
|
|
42362
|
+
this.dropElevationTimeout = globalThis.setTimeout(() => {
|
|
42363
|
+
target.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42364
|
+
if (this.dropElevationTarget === target) {
|
|
42365
|
+
this.dropElevationTarget = undefined;
|
|
42366
|
+
}
|
|
42367
|
+
this.dropElevationTimeout = undefined;
|
|
42368
|
+
}, DROP_ELEVATION_DURATION);
|
|
42369
|
+
}
|
|
42370
|
+
clearDropElevationTimer() {
|
|
42371
|
+
if (this.dropElevationTimeout !== undefined) {
|
|
42372
|
+
clearTimeout(this.dropElevationTimeout);
|
|
42373
|
+
this.dropElevationTimeout = undefined;
|
|
42374
|
+
}
|
|
42375
|
+
}
|
|
42376
|
+
arraysEqual(a, b) {
|
|
42377
|
+
if (a.length !== b.length) {
|
|
42378
|
+
return false;
|
|
42379
|
+
}
|
|
42380
|
+
let index = 0;
|
|
42381
|
+
for (const value of a) {
|
|
42382
|
+
if (value !== b[index]) {
|
|
42383
|
+
return false;
|
|
42384
|
+
}
|
|
42385
|
+
index += 1;
|
|
42386
|
+
}
|
|
42387
|
+
return true;
|
|
42388
|
+
}
|
|
42389
|
+
extractIndices(items = []) {
|
|
42390
|
+
return (items !== null && items !== void 0 ? items : []).map((item, index) => { var _a; return (_a = item.index) !== null && _a !== void 0 ? _a : index; });
|
|
39476
42391
|
}
|
|
39477
42392
|
}
|
|
39478
42393
|
|
|
@@ -39680,9 +42595,9 @@ function IconButton(props) {
|
|
|
39680
42595
|
type = _props$type === void 0 ? "default" : _props$type,
|
|
39681
42596
|
icon = props.icon,
|
|
39682
42597
|
className = props.className,
|
|
39683
|
-
otherProps = _objectWithoutProperties(props, ["type", "icon", "className"]);
|
|
42598
|
+
otherProps = _objectWithoutProperties$1(props, ["type", "icon", "className"]);
|
|
39684
42599
|
|
|
39685
|
-
return react.createElement("button", _extends({
|
|
42600
|
+
return react.createElement("button", _extends$1({
|
|
39686
42601
|
type: "button",
|
|
39687
42602
|
className: "btn btn-".concat(type, " ").concat(className)
|
|
39688
42603
|
}, otherProps), react.createElement("i", {
|
|
@@ -39906,7 +42821,7 @@ function (_Component) {
|
|
|
39906
42821
|
|
|
39907
42822
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayField).call(this, props));
|
|
39908
42823
|
|
|
39909
|
-
_defineProperty$
|
|
42824
|
+
_defineProperty$2(_assertThisInitialized(_this), "_getNewFormDataRow", function () {
|
|
39910
42825
|
var _this$props = _this.props,
|
|
39911
42826
|
schema = _this$props.schema,
|
|
39912
42827
|
_this$props$registry = _this$props.registry,
|
|
@@ -39921,7 +42836,7 @@ function (_Component) {
|
|
|
39921
42836
|
return getDefaultFormState(itemSchema, undefined, rootSchema);
|
|
39922
42837
|
});
|
|
39923
42838
|
|
|
39924
|
-
_defineProperty$
|
|
42839
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddClick", function (event) {
|
|
39925
42840
|
if (event) {
|
|
39926
42841
|
event.preventDefault();
|
|
39927
42842
|
}
|
|
@@ -39941,7 +42856,7 @@ function (_Component) {
|
|
|
39941
42856
|
});
|
|
39942
42857
|
});
|
|
39943
42858
|
|
|
39944
|
-
_defineProperty$
|
|
42859
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddIndexClick", function (index) {
|
|
39945
42860
|
return function (event) {
|
|
39946
42861
|
if (event) {
|
|
39947
42862
|
event.preventDefault();
|
|
@@ -39966,7 +42881,7 @@ function (_Component) {
|
|
|
39966
42881
|
};
|
|
39967
42882
|
});
|
|
39968
42883
|
|
|
39969
|
-
_defineProperty$
|
|
42884
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropIndexClick", function (index) {
|
|
39970
42885
|
return function (event) {
|
|
39971
42886
|
if (event) {
|
|
39972
42887
|
event.preventDefault();
|
|
@@ -40005,7 +42920,7 @@ function (_Component) {
|
|
|
40005
42920
|
};
|
|
40006
42921
|
});
|
|
40007
42922
|
|
|
40008
|
-
_defineProperty$
|
|
42923
|
+
_defineProperty$2(_assertThisInitialized(_this), "onReorderClick", function (index, newIndex) {
|
|
40009
42924
|
return function (event) {
|
|
40010
42925
|
if (event) {
|
|
40011
42926
|
event.preventDefault();
|
|
@@ -40054,7 +42969,7 @@ function (_Component) {
|
|
|
40054
42969
|
};
|
|
40055
42970
|
});
|
|
40056
42971
|
|
|
40057
|
-
_defineProperty$
|
|
42972
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChangeForIndex", function (index) {
|
|
40058
42973
|
return function (value, errorSchema) {
|
|
40059
42974
|
var _this$props2 = _this.props,
|
|
40060
42975
|
formData = _this$props2.formData,
|
|
@@ -40065,11 +42980,11 @@ function (_Component) {
|
|
|
40065
42980
|
var jsonValue = typeof value === "undefined" ? null : value;
|
|
40066
42981
|
return index === i ? jsonValue : item;
|
|
40067
42982
|
});
|
|
40068
|
-
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
42983
|
+
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, index, errorSchema)));
|
|
40069
42984
|
};
|
|
40070
42985
|
});
|
|
40071
42986
|
|
|
40072
|
-
_defineProperty$
|
|
42987
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSelectChange", function (value) {
|
|
40073
42988
|
_this.props.onChange(value);
|
|
40074
42989
|
});
|
|
40075
42990
|
|
|
@@ -40258,7 +43173,7 @@ function (_Component) {
|
|
|
40258
43173
|
}),
|
|
40259
43174
|
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
40260
43175
|
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
40261
|
-
options = _objectWithoutProperties(_getUiOptions$enumOpt, ["widget"]);
|
|
43176
|
+
options = _objectWithoutProperties$1(_getUiOptions$enumOpt, ["widget"]);
|
|
40262
43177
|
|
|
40263
43178
|
var Widget = getWidget(schema, widget, widgets);
|
|
40264
43179
|
return react.createElement(Widget, {
|
|
@@ -40305,7 +43220,7 @@ function (_Component) {
|
|
|
40305
43220
|
var _getUiOptions2 = getUiOptions(uiSchema),
|
|
40306
43221
|
_getUiOptions2$widget = _getUiOptions2.widget,
|
|
40307
43222
|
widget = _getUiOptions2$widget === void 0 ? "files" : _getUiOptions2$widget,
|
|
40308
|
-
options = _objectWithoutProperties(_getUiOptions2, ["widget"]);
|
|
43223
|
+
options = _objectWithoutProperties$1(_getUiOptions2, ["widget"]);
|
|
40309
43224
|
|
|
40310
43225
|
var Widget = getWidget(schema, widget, widgets);
|
|
40311
43226
|
return react.createElement(Widget, {
|
|
@@ -40519,7 +43434,7 @@ function (_Component) {
|
|
|
40519
43434
|
return ArrayField;
|
|
40520
43435
|
}(react.Component);
|
|
40521
43436
|
|
|
40522
|
-
_defineProperty$
|
|
43437
|
+
_defineProperty$2(ArrayField$1, "defaultProps", {
|
|
40523
43438
|
uiSchema: {},
|
|
40524
43439
|
formData: [],
|
|
40525
43440
|
idSchema: {},
|
|
@@ -40553,7 +43468,7 @@ function BooleanField(props) {
|
|
|
40553
43468
|
var _getUiOptions = getUiOptions(uiSchema),
|
|
40554
43469
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
40555
43470
|
widget = _getUiOptions$widget === void 0 ? "checkbox" : _getUiOptions$widget,
|
|
40556
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
43471
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
40557
43472
|
|
|
40558
43473
|
var Widget = getWidget(schema, widget, widgets);
|
|
40559
43474
|
var enumOptions;
|
|
@@ -40635,7 +43550,7 @@ function (_Component) {
|
|
|
40635
43550
|
|
|
40636
43551
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AnyOfField).call(this, props));
|
|
40637
43552
|
|
|
40638
|
-
_defineProperty$
|
|
43553
|
+
_defineProperty$2(_assertThisInitialized(_this), "onOptionChange", function (option) {
|
|
40639
43554
|
var selectedOption = _parseInt(option, 10);
|
|
40640
43555
|
|
|
40641
43556
|
var _this$props = _this.props,
|
|
@@ -40650,7 +43565,7 @@ function (_Component) {
|
|
|
40650
43565
|
var newFormData = undefined;
|
|
40651
43566
|
|
|
40652
43567
|
if (guessType(formData) === "object" && (newOption.type === "object" || newOption.properties)) {
|
|
40653
|
-
newFormData = _extends({}, formData);
|
|
43568
|
+
newFormData = _extends$1({}, formData);
|
|
40654
43569
|
var optionsToDiscard = options.slice();
|
|
40655
43570
|
optionsToDiscard.splice(selectedOption, 1); // Discard any data added using other options
|
|
40656
43571
|
|
|
@@ -40756,7 +43671,7 @@ function (_Component) {
|
|
|
40756
43671
|
var _getUiOptions = getUiOptions(uiSchema),
|
|
40757
43672
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
40758
43673
|
widget = _getUiOptions$widget === void 0 ? "select" : _getUiOptions$widget,
|
|
40759
|
-
uiOptions = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
43674
|
+
uiOptions = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
40760
43675
|
|
|
40761
43676
|
var Widget = getWidget({
|
|
40762
43677
|
type: "number"
|
|
@@ -40767,7 +43682,7 @@ function (_Component) {
|
|
|
40767
43682
|
if (option) {
|
|
40768
43683
|
// If the subschema doesn't declare a type, infer the type from the
|
|
40769
43684
|
// parent schema
|
|
40770
|
-
optionSchema = option.type ? option : _extends({}, option, {
|
|
43685
|
+
optionSchema = option.type ? option : _extends$1({}, option, {
|
|
40771
43686
|
type: baseType
|
|
40772
43687
|
});
|
|
40773
43688
|
}
|
|
@@ -40782,7 +43697,7 @@ function (_Component) {
|
|
|
40782
43697
|
className: "panel panel-default panel-body"
|
|
40783
43698
|
}, react.createElement("div", {
|
|
40784
43699
|
className: "form-group"
|
|
40785
|
-
}, react.createElement(Widget, _extends({
|
|
43700
|
+
}, react.createElement(Widget, _extends$1({
|
|
40786
43701
|
id: "".concat(idSchema.$id).concat(schema.oneOf ? "__oneof_select" : "__anyof_select"),
|
|
40787
43702
|
schema: {
|
|
40788
43703
|
type: "number",
|
|
@@ -40861,7 +43776,7 @@ function (_React$Component) {
|
|
|
40861
43776
|
|
|
40862
43777
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(NumberField).call(this, props));
|
|
40863
43778
|
|
|
40864
|
-
_defineProperty$
|
|
43779
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleChange", function (value) {
|
|
40865
43780
|
// Cache the original value in component state
|
|
40866
43781
|
_this.setState({
|
|
40867
43782
|
lastValue: value
|
|
@@ -40894,7 +43809,7 @@ function (_React$Component) {
|
|
|
40894
43809
|
|
|
40895
43810
|
var _this$props = this.props,
|
|
40896
43811
|
formData = _this$props.formData,
|
|
40897
|
-
props = _objectWithoutProperties(_this$props, ["formData"]);
|
|
43812
|
+
props = _objectWithoutProperties$1(_this$props, ["formData"]);
|
|
40898
43813
|
|
|
40899
43814
|
var lastValue = this.state.lastValue;
|
|
40900
43815
|
var value = formData;
|
|
@@ -40911,7 +43826,7 @@ function (_React$Component) {
|
|
|
40911
43826
|
}
|
|
40912
43827
|
}
|
|
40913
43828
|
|
|
40914
|
-
return react.createElement(StringField, _extends({}, props, {
|
|
43829
|
+
return react.createElement(StringField, _extends$1({}, props, {
|
|
40915
43830
|
formData: value,
|
|
40916
43831
|
onChange: this.handleChange
|
|
40917
43832
|
}));
|
|
@@ -40966,12 +43881,12 @@ function (_Component) {
|
|
|
40966
43881
|
|
|
40967
43882
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ObjectField)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
40968
43883
|
|
|
40969
|
-
_defineProperty$
|
|
43884
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", {
|
|
40970
43885
|
wasPropertyKeyModified: false,
|
|
40971
43886
|
additionalProperties: {}
|
|
40972
43887
|
});
|
|
40973
43888
|
|
|
40974
|
-
_defineProperty$
|
|
43889
|
+
_defineProperty$2(_assertThisInitialized(_this), "onPropertyChange", function (name) {
|
|
40975
43890
|
var addedByAdditionalProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40976
43891
|
return function (value, errorSchema) {
|
|
40977
43892
|
if (!value && addedByAdditionalProperties) {
|
|
@@ -40985,13 +43900,13 @@ function (_Component) {
|
|
|
40985
43900
|
value = "";
|
|
40986
43901
|
}
|
|
40987
43902
|
|
|
40988
|
-
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$
|
|
43903
|
+
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$2({}, name, value));
|
|
40989
43904
|
|
|
40990
|
-
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
43905
|
+
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, name, errorSchema)));
|
|
40991
43906
|
};
|
|
40992
43907
|
});
|
|
40993
43908
|
|
|
40994
|
-
_defineProperty$
|
|
43909
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropPropertyClick", function (key) {
|
|
40995
43910
|
return function (event) {
|
|
40996
43911
|
event.preventDefault();
|
|
40997
43912
|
var _this$props = _this.props,
|
|
@@ -41005,7 +43920,7 @@ function (_Component) {
|
|
|
41005
43920
|
};
|
|
41006
43921
|
});
|
|
41007
43922
|
|
|
41008
|
-
_defineProperty$
|
|
43923
|
+
_defineProperty$2(_assertThisInitialized(_this), "getAvailableKey", function (preferredKey, formData) {
|
|
41009
43924
|
var index = 0;
|
|
41010
43925
|
var newKey = preferredKey;
|
|
41011
43926
|
|
|
@@ -41016,7 +43931,7 @@ function (_Component) {
|
|
|
41016
43931
|
return newKey;
|
|
41017
43932
|
});
|
|
41018
43933
|
|
|
41019
|
-
_defineProperty$
|
|
43934
|
+
_defineProperty$2(_assertThisInitialized(_this), "onKeyChange", function (oldValue) {
|
|
41020
43935
|
return function (value, errorSchema) {
|
|
41021
43936
|
if (oldValue === value) {
|
|
41022
43937
|
return;
|
|
@@ -41026,24 +43941,24 @@ function (_Component) {
|
|
|
41026
43941
|
|
|
41027
43942
|
var newFormData = _objectSpread({}, _this.props.formData);
|
|
41028
43943
|
|
|
41029
|
-
var newKeys = _defineProperty$
|
|
43944
|
+
var newKeys = _defineProperty$2({}, oldValue, value);
|
|
41030
43945
|
|
|
41031
43946
|
var keyValues = keys$3(newFormData).map(function (key) {
|
|
41032
43947
|
var newKey = newKeys[key] || key;
|
|
41033
|
-
return _defineProperty$
|
|
43948
|
+
return _defineProperty$2({}, newKey, newFormData[key]);
|
|
41034
43949
|
});
|
|
41035
43950
|
|
|
41036
|
-
var renamedObj = _extends.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
43951
|
+
var renamedObj = _extends$1.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
41037
43952
|
|
|
41038
43953
|
_this.setState({
|
|
41039
43954
|
wasPropertyKeyModified: true
|
|
41040
43955
|
});
|
|
41041
43956
|
|
|
41042
|
-
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
43957
|
+
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, value, errorSchema)));
|
|
41043
43958
|
};
|
|
41044
43959
|
});
|
|
41045
43960
|
|
|
41046
|
-
_defineProperty$
|
|
43961
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleAddClick", function (schema) {
|
|
41047
43962
|
return function () {
|
|
41048
43963
|
var type = schema.additionalProperties.type;
|
|
41049
43964
|
|
|
@@ -41187,7 +44102,7 @@ function (_Component) {
|
|
|
41187
44102
|
formData: formData,
|
|
41188
44103
|
formContext: formContext
|
|
41189
44104
|
};
|
|
41190
|
-
return react.createElement(Template, _extends({}, templateProps, {
|
|
44105
|
+
return react.createElement(Template, _extends$1({}, templateProps, {
|
|
41191
44106
|
onAddClick: this.handleAddClick
|
|
41192
44107
|
}));
|
|
41193
44108
|
}
|
|
@@ -41196,7 +44111,7 @@ function (_Component) {
|
|
|
41196
44111
|
return ObjectField;
|
|
41197
44112
|
}(react.Component);
|
|
41198
44113
|
|
|
41199
|
-
_defineProperty$
|
|
44114
|
+
_defineProperty$2(ObjectField$1, "defaultProps", {
|
|
41200
44115
|
uiSchema: {},
|
|
41201
44116
|
formData: {},
|
|
41202
44117
|
errorSchema: {},
|
|
@@ -41238,7 +44153,7 @@ function StringField(props) {
|
|
|
41238
44153
|
widget = _getUiOptions$widget === void 0 ? defaultWidget : _getUiOptions$widget,
|
|
41239
44154
|
_getUiOptions$placeho = _getUiOptions.placeholder,
|
|
41240
44155
|
placeholder = _getUiOptions$placeho === void 0 ? "" : _getUiOptions$placeho,
|
|
41241
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget", "placeholder"]);
|
|
44156
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget", "placeholder"]);
|
|
41242
44157
|
|
|
41243
44158
|
var Widget = getWidget(schema, widget, widgets);
|
|
41244
44159
|
return react.createElement(Widget, {
|
|
@@ -41401,8 +44316,8 @@ function (_Component) {
|
|
|
41401
44316
|
|
|
41402
44317
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AltDateWidget).call(this, props));
|
|
41403
44318
|
|
|
41404
|
-
_defineProperty$
|
|
41405
|
-
_this.setState(_defineProperty$
|
|
44319
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (property, value) {
|
|
44320
|
+
_this.setState(_defineProperty$2({}, property, typeof value === "undefined" ? -1 : value), function () {
|
|
41406
44321
|
// Only propagate to parent state if we have a complete date{time}
|
|
41407
44322
|
if (readyForChange(_this.state)) {
|
|
41408
44323
|
_this.props.onChange(toDateString(_this.state, _this.props.time));
|
|
@@ -41410,7 +44325,7 @@ function (_Component) {
|
|
|
41410
44325
|
});
|
|
41411
44326
|
});
|
|
41412
44327
|
|
|
41413
|
-
_defineProperty$
|
|
44328
|
+
_defineProperty$2(_assertThisInitialized(_this), "setNow", function (event) {
|
|
41414
44329
|
event.preventDefault();
|
|
41415
44330
|
var _this$props = _this.props,
|
|
41416
44331
|
time = _this$props.time,
|
|
@@ -41429,7 +44344,7 @@ function (_Component) {
|
|
|
41429
44344
|
});
|
|
41430
44345
|
});
|
|
41431
44346
|
|
|
41432
|
-
_defineProperty$
|
|
44347
|
+
_defineProperty$2(_assertThisInitialized(_this), "clear", function (event) {
|
|
41433
44348
|
event.preventDefault();
|
|
41434
44349
|
var _this$props2 = _this.props,
|
|
41435
44350
|
time = _this$props2.time,
|
|
@@ -41478,7 +44393,7 @@ function (_Component) {
|
|
|
41478
44393
|
}, this.dateElementProps.map(function (elemProps, i) {
|
|
41479
44394
|
return react.createElement("li", {
|
|
41480
44395
|
key: i
|
|
41481
|
-
}, react.createElement(DateElement, _extends({
|
|
44396
|
+
}, react.createElement(DateElement, _extends$1({
|
|
41482
44397
|
rootId: id,
|
|
41483
44398
|
select: _this2.onChange
|
|
41484
44399
|
}, elemProps, {
|
|
@@ -41548,7 +44463,7 @@ function (_Component) {
|
|
|
41548
44463
|
return AltDateWidget;
|
|
41549
44464
|
}(react.Component);
|
|
41550
44465
|
|
|
41551
|
-
_defineProperty$
|
|
44466
|
+
_defineProperty$2(AltDateWidget, "defaultProps", {
|
|
41552
44467
|
time: false,
|
|
41553
44468
|
disabled: false,
|
|
41554
44469
|
readonly: false,
|
|
@@ -41560,7 +44475,7 @@ _defineProperty$1(AltDateWidget, "defaultProps", {
|
|
|
41560
44475
|
|
|
41561
44476
|
function AltDateTimeWidget(props) {
|
|
41562
44477
|
var AltDateWidget = props.registry.widgets.AltDateWidget;
|
|
41563
|
-
return react.createElement(AltDateWidget, _extends({
|
|
44478
|
+
return react.createElement(AltDateWidget, _extends$1({
|
|
41564
44479
|
time: true
|
|
41565
44480
|
}, props));
|
|
41566
44481
|
}
|
|
@@ -41585,7 +44500,7 @@ function BaseInput(props) {
|
|
|
41585
44500
|
onFocus = props.onFocus,
|
|
41586
44501
|
options = props.options,
|
|
41587
44502
|
schema = props.schema,
|
|
41588
|
-
inputProps = _objectWithoutProperties(props, ["value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors"]); // If options.inputType is set use that as the input type
|
|
44503
|
+
inputProps = _objectWithoutProperties$1(props, ["value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors"]); // If options.inputType is set use that as the input type
|
|
41589
44504
|
|
|
41590
44505
|
|
|
41591
44506
|
if (options.inputType) {
|
|
@@ -41630,7 +44545,7 @@ function BaseInput(props) {
|
|
|
41630
44545
|
return props.onChange(value === "" ? options.emptyValue : value);
|
|
41631
44546
|
};
|
|
41632
44547
|
|
|
41633
|
-
return [react.createElement("input", _extends({
|
|
44548
|
+
return [react.createElement("input", _extends$1({
|
|
41634
44549
|
key: inputProps.id,
|
|
41635
44550
|
className: "form-control",
|
|
41636
44551
|
readOnly: readonly,
|
|
@@ -41780,7 +44695,7 @@ function ColorWidget(props) {
|
|
|
41780
44695
|
var disabled = props.disabled,
|
|
41781
44696
|
readonly = props.readonly,
|
|
41782
44697
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41783
|
-
return react.createElement(BaseInput, _extends({
|
|
44698
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41784
44699
|
type: "color"
|
|
41785
44700
|
}, props, {
|
|
41786
44701
|
disabled: disabled || readonly
|
|
@@ -41790,7 +44705,7 @@ function ColorWidget(props) {
|
|
|
41790
44705
|
function DateWidget(props) {
|
|
41791
44706
|
var _onChange = props.onChange,
|
|
41792
44707
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41793
|
-
return react.createElement(BaseInput, _extends({
|
|
44708
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41794
44709
|
type: "date"
|
|
41795
44710
|
}, props, {
|
|
41796
44711
|
onChange: function onChange(value) {
|
|
@@ -41803,7 +44718,7 @@ function DateTimeWidget(props) {
|
|
|
41803
44718
|
var value = props.value,
|
|
41804
44719
|
_onChange = props.onChange,
|
|
41805
44720
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41806
|
-
return react.createElement(BaseInput, _extends({
|
|
44721
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41807
44722
|
type: "datetime-local"
|
|
41808
44723
|
}, props, {
|
|
41809
44724
|
value: utcToLocal(value),
|
|
@@ -41815,7 +44730,7 @@ function DateTimeWidget(props) {
|
|
|
41815
44730
|
|
|
41816
44731
|
function EmailWidget(props) {
|
|
41817
44732
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
41818
|
-
return react.createElement(BaseInput, _extends({
|
|
44733
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41819
44734
|
type: "email"
|
|
41820
44735
|
}, props));
|
|
41821
44736
|
}
|
|
@@ -41896,7 +44811,7 @@ function (_Component) {
|
|
|
41896
44811
|
|
|
41897
44812
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(FileWidget).call(this, props));
|
|
41898
44813
|
|
|
41899
|
-
_defineProperty$
|
|
44814
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (event) {
|
|
41900
44815
|
var _this$props = _this.props,
|
|
41901
44816
|
multiple = _this$props.multiple,
|
|
41902
44817
|
onChange = _this$props.onChange;
|
|
@@ -41982,7 +44897,7 @@ function HiddenWidget(_ref) {
|
|
|
41982
44897
|
|
|
41983
44898
|
function PasswordWidget(props) {
|
|
41984
44899
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
41985
|
-
return react.createElement(BaseInput, _extends({
|
|
44900
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41986
44901
|
type: "password"
|
|
41987
44902
|
}, props));
|
|
41988
44903
|
}
|
|
@@ -42050,7 +44965,7 @@ function RangeWidget(props) {
|
|
|
42050
44965
|
BaseInput = props.registry.widgets.BaseInput;
|
|
42051
44966
|
return react.createElement("div", {
|
|
42052
44967
|
className: "field-range-wrapper"
|
|
42053
|
-
}, react.createElement(BaseInput, _extends({
|
|
44968
|
+
}, react.createElement(BaseInput, _extends$1({
|
|
42054
44969
|
type: "range"
|
|
42055
44970
|
}, props, rangeSpec(schema))), react.createElement("span", {
|
|
42056
44971
|
className: "range-view"
|
|
@@ -42213,14 +45128,14 @@ function TextWidget(props) {
|
|
|
42213
45128
|
|
|
42214
45129
|
function URLWidget(props) {
|
|
42215
45130
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
42216
|
-
return react.createElement(BaseInput, _extends({
|
|
45131
|
+
return react.createElement(BaseInput, _extends$1({
|
|
42217
45132
|
type: "url"
|
|
42218
45133
|
}, props));
|
|
42219
45134
|
}
|
|
42220
45135
|
|
|
42221
45136
|
function UpDownWidget(props) {
|
|
42222
45137
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
42223
|
-
return react.createElement(BaseInput, _extends({
|
|
45138
|
+
return react.createElement(BaseInput, _extends$1({
|
|
42224
45139
|
type: "number"
|
|
42225
45140
|
}, props, rangeSpec(props.schema)));
|
|
42226
45141
|
}
|
|
@@ -42375,13 +45290,13 @@ function createErrorHandler(formData) {
|
|
|
42375
45290
|
|
|
42376
45291
|
if (isObject(formData)) {
|
|
42377
45292
|
return keys$3(formData).reduce(function (acc, key) {
|
|
42378
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45293
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler(formData[key])));
|
|
42379
45294
|
}, handler);
|
|
42380
45295
|
}
|
|
42381
45296
|
|
|
42382
45297
|
if (isArray$2(formData)) {
|
|
42383
45298
|
return formData.reduce(function (acc, value, key) {
|
|
42384
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45299
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler(value)));
|
|
42385
45300
|
}, handler);
|
|
42386
45301
|
}
|
|
42387
45302
|
|
|
@@ -42393,10 +45308,10 @@ function unwrapErrorHandler(errorHandler) {
|
|
|
42393
45308
|
if (key === "addError") {
|
|
42394
45309
|
return acc;
|
|
42395
45310
|
} else if (key === "__errors") {
|
|
42396
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45311
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, errorHandler[key]));
|
|
42397
45312
|
}
|
|
42398
45313
|
|
|
42399
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45314
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, unwrapErrorHandler(errorHandler[key])));
|
|
42400
45315
|
}, {});
|
|
42401
45316
|
}
|
|
42402
45317
|
/**
|
|
@@ -42532,9 +45447,9 @@ function isValid(schema, data) {
|
|
|
42532
45447
|
}
|
|
42533
45448
|
}
|
|
42534
45449
|
|
|
42535
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
45450
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
42536
45451
|
|
|
42537
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
45452
|
+
function _toPrimitive(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
42538
45453
|
var ADDITIONAL_PROPERTY_FLAG = "__additional_property";
|
|
42539
45454
|
var widgetMap = {
|
|
42540
45455
|
"boolean": {
|
|
@@ -42653,9 +45568,9 @@ function getWidget(schema, widget) {
|
|
|
42653
45568
|
Widget.MergedWidget = function (_ref) {
|
|
42654
45569
|
var _ref$options = _ref.options,
|
|
42655
45570
|
options = _ref$options === void 0 ? {} : _ref$options,
|
|
42656
|
-
props = _objectWithoutProperties(_ref, ["options"]);
|
|
45571
|
+
props = _objectWithoutProperties$1(_ref, ["options"]);
|
|
42657
45572
|
|
|
42658
|
-
return react.createElement(Widget, _extends({
|
|
45573
|
+
return react.createElement(Widget, _extends$1({
|
|
42659
45574
|
options: _objectSpread({}, defaultOptions, options)
|
|
42660
45575
|
}, props));
|
|
42661
45576
|
};
|
|
@@ -42669,7 +45584,7 @@ function getWidget(schema, widget) {
|
|
|
42669
45584
|
}
|
|
42670
45585
|
|
|
42671
45586
|
if (typeof widget !== "string") {
|
|
42672
|
-
throw new Error("Unsupported widget definition: ".concat(_typeof(widget)));
|
|
45587
|
+
throw new Error("Unsupported widget definition: ".concat(_typeof$1(widget)));
|
|
42673
45588
|
}
|
|
42674
45589
|
|
|
42675
45590
|
if (registeredWidgets.hasOwnProperty(widget)) {
|
|
@@ -42842,7 +45757,7 @@ function mergeDefaultsWithFormData(defaults, formData) {
|
|
|
42842
45757
|
return value;
|
|
42843
45758
|
});
|
|
42844
45759
|
} else if (isObject(formData)) {
|
|
42845
|
-
var acc = _extends({}, defaults); // Prevent mutation of source object.
|
|
45760
|
+
var acc = _extends$1({}, defaults); // Prevent mutation of source object.
|
|
42846
45761
|
|
|
42847
45762
|
|
|
42848
45763
|
return keys$3(formData).reduce(function (acc, key) {
|
|
@@ -42871,7 +45786,7 @@ function getUiOptions(uiSchema) {
|
|
|
42871
45786
|
return _objectSpread({}, options, value);
|
|
42872
45787
|
}
|
|
42873
45788
|
|
|
42874
|
-
return _objectSpread({}, options, _defineProperty$
|
|
45789
|
+
return _objectSpread({}, options, _defineProperty$2({}, key.substring(3), value));
|
|
42875
45790
|
}, {});
|
|
42876
45791
|
}
|
|
42877
45792
|
function getDisplayLabel(schema, uiSchema, rootSchema) {
|
|
@@ -42902,13 +45817,13 @@ function isObject(thing) {
|
|
|
42902
45817
|
return false;
|
|
42903
45818
|
}
|
|
42904
45819
|
|
|
42905
|
-
return _typeof(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
45820
|
+
return _typeof$1(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
42906
45821
|
}
|
|
42907
45822
|
function mergeObjects(obj1, obj2) {
|
|
42908
45823
|
var concatArrays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
42909
45824
|
|
|
42910
45825
|
// Recursively merge deeply nested objects.
|
|
42911
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
45826
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
42912
45827
|
|
|
42913
45828
|
|
|
42914
45829
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -43124,7 +46039,7 @@ var guessType = function guessType(value) {
|
|
|
43124
46039
|
return "boolean";
|
|
43125
46040
|
} else if (!isNaN(value)) {
|
|
43126
46041
|
return "number";
|
|
43127
|
-
} else if (_typeof(value) === "object") {
|
|
46042
|
+
} else if (_typeof$1(value) === "object") {
|
|
43128
46043
|
return "object";
|
|
43129
46044
|
} // Default to string if we can't figure it out
|
|
43130
46045
|
|
|
@@ -43193,7 +46108,7 @@ function resolveReference(schema, rootSchema, formData) {
|
|
|
43193
46108
|
// Retrieve the referenced schema definition.
|
|
43194
46109
|
var $refSchema = findSchemaDefinition(schema.$ref, rootSchema); // Drop the $ref property of the source schema.
|
|
43195
46110
|
|
|
43196
|
-
var localSchema = _objectWithoutProperties(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
46111
|
+
var localSchema = _objectWithoutProperties$1(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
43197
46112
|
|
|
43198
46113
|
|
|
43199
46114
|
return retrieveSchema(_objectSpread({}, $refSchema, localSchema), rootSchema, formData);
|
|
@@ -43218,7 +46133,7 @@ function retrieveSchema(schema) {
|
|
|
43218
46133
|
console.warn("could not merge subschemas in allOf:\n" + e);
|
|
43219
46134
|
|
|
43220
46135
|
var _resolvedSchema = resolvedSchema,
|
|
43221
|
-
resolvedSchemaWithoutAllOf = _objectWithoutProperties(_resolvedSchema, ["allOf"]);
|
|
46136
|
+
resolvedSchemaWithoutAllOf = _objectWithoutProperties$1(_resolvedSchema, ["allOf"]);
|
|
43222
46137
|
|
|
43223
46138
|
return resolvedSchemaWithoutAllOf;
|
|
43224
46139
|
}
|
|
@@ -43237,7 +46152,7 @@ function resolveDependencies(schema, rootSchema, formData) {
|
|
|
43237
46152
|
// Drop the dependencies from the source schema.
|
|
43238
46153
|
var _schema$dependencies = schema.dependencies,
|
|
43239
46154
|
dependencies = _schema$dependencies === void 0 ? {} : _schema$dependencies,
|
|
43240
|
-
resolvedSchema = _objectWithoutProperties(schema, ["dependencies"]);
|
|
46155
|
+
resolvedSchema = _objectWithoutProperties$1(schema, ["dependencies"]);
|
|
43241
46156
|
|
|
43242
46157
|
if ("oneOf" in resolvedSchema) {
|
|
43243
46158
|
resolvedSchema = resolvedSchema.oneOf[getMatchingOption(formData, resolvedSchema.oneOf)];
|
|
@@ -43262,7 +46177,7 @@ function processDependencies(dependencies, resolvedSchema, rootSchema, formData)
|
|
|
43262
46177
|
}
|
|
43263
46178
|
|
|
43264
46179
|
var dependencyValue = dependencies[dependencyKey],
|
|
43265
|
-
remainingDependencies = _objectWithoutProperties(dependencies, [dependencyKey].map(_toPropertyKey));
|
|
46180
|
+
remainingDependencies = _objectWithoutProperties$1(dependencies, [dependencyKey].map(_toPropertyKey));
|
|
43266
46181
|
|
|
43267
46182
|
if (isArray$2(dependencyValue)) {
|
|
43268
46183
|
resolvedSchema = withDependentProperties(resolvedSchema, dependencyValue);
|
|
@@ -43290,14 +46205,14 @@ function withDependentProperties(schema, additionallyRequired) {
|
|
|
43290
46205
|
function withDependentSchema(schema, rootSchema, formData, dependencyKey, dependencyValue) {
|
|
43291
46206
|
var _retrieveSchema = retrieveSchema(dependencyValue, rootSchema, formData),
|
|
43292
46207
|
oneOf = _retrieveSchema.oneOf,
|
|
43293
|
-
dependentSchema = _objectWithoutProperties(_retrieveSchema, ["oneOf"]);
|
|
46208
|
+
dependentSchema = _objectWithoutProperties$1(_retrieveSchema, ["oneOf"]);
|
|
43294
46209
|
|
|
43295
46210
|
schema = mergeSchemas(schema, dependentSchema); // Since it does not contain oneOf, we return the original schema.
|
|
43296
46211
|
|
|
43297
46212
|
if (oneOf === undefined) {
|
|
43298
46213
|
return schema;
|
|
43299
46214
|
} else if (!isArray$2(oneOf)) {
|
|
43300
|
-
throw new Error("invalid: it is some ".concat(_typeof(oneOf), " instead of an array"));
|
|
46215
|
+
throw new Error("invalid: it is some ".concat(_typeof$1(oneOf), " instead of an array"));
|
|
43301
46216
|
} // Resolve $refs inside oneOf.
|
|
43302
46217
|
|
|
43303
46218
|
|
|
@@ -43318,7 +46233,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43318
46233
|
if (conditionPropertySchema) {
|
|
43319
46234
|
var conditionSchema = {
|
|
43320
46235
|
type: "object",
|
|
43321
|
-
properties: _defineProperty$
|
|
46236
|
+
properties: _defineProperty$2({}, dependencyKey, conditionPropertySchema)
|
|
43322
46237
|
};
|
|
43323
46238
|
|
|
43324
46239
|
var _validateFormData = validateFormData(formData, conditionSchema),
|
|
@@ -43336,7 +46251,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43336
46251
|
var subschema = validSubschemas[0];
|
|
43337
46252
|
|
|
43338
46253
|
var _subschema$properties = subschema.properties,
|
|
43339
|
-
dependentSubschema = _objectWithoutProperties(_subschema$properties, [dependencyKey].map(_toPropertyKey));
|
|
46254
|
+
dependentSubschema = _objectWithoutProperties$1(_subschema$properties, [dependencyKey].map(_toPropertyKey));
|
|
43340
46255
|
|
|
43341
46256
|
var dependentSchema = _objectSpread({}, subschema, {
|
|
43342
46257
|
properties: dependentSubschema
|
|
@@ -43351,7 +46266,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43351
46266
|
|
|
43352
46267
|
|
|
43353
46268
|
function mergeSchemas(obj1, obj2) {
|
|
43354
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
46269
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
43355
46270
|
|
|
43356
46271
|
|
|
43357
46272
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -43389,7 +46304,7 @@ function deepEquals(a, b) {
|
|
|
43389
46304
|
// Assume all functions are equivalent
|
|
43390
46305
|
// see https://github.com/rjsf-team/react-jsonschema-form/issues/255
|
|
43391
46306
|
return true;
|
|
43392
|
-
} else if (_typeof(a) !== "object" || _typeof(b) !== "object") {
|
|
46307
|
+
} else if (_typeof$1(a) !== "object" || _typeof$1(b) !== "object") {
|
|
43393
46308
|
return false;
|
|
43394
46309
|
} else if (a === null || b === null) {
|
|
43395
46310
|
return false;
|
|
@@ -43651,7 +46566,7 @@ function getMatchingOption(formData, options, rootSchema) {
|
|
|
43651
46566
|
|
|
43652
46567
|
if (option.anyOf) {
|
|
43653
46568
|
// Create a shallow clone of the option
|
|
43654
|
-
var shallowClone = _extends({}, option);
|
|
46569
|
+
var shallowClone = _extends$1({}, option);
|
|
43655
46570
|
|
|
43656
46571
|
if (!shallowClone.allOf) {
|
|
43657
46572
|
shallowClone.allOf = [];
|
|
@@ -43663,7 +46578,7 @@ function getMatchingOption(formData, options, rootSchema) {
|
|
|
43663
46578
|
shallowClone.allOf.push(requiresAnyOf);
|
|
43664
46579
|
augmentedSchema = shallowClone;
|
|
43665
46580
|
} else {
|
|
43666
|
-
augmentedSchema = _extends({}, option, requiresAnyOf);
|
|
46581
|
+
augmentedSchema = _extends$1({}, option, requiresAnyOf);
|
|
43667
46582
|
} // Remove the "required" field as it's likely that not all fields have
|
|
43668
46583
|
// been filled in yet, which will mean that the schema is not valid
|
|
43669
46584
|
|
|
@@ -43941,10 +46856,10 @@ function SchemaFieldRender(props) {
|
|
|
43941
46856
|
var displayLabel = getDisplayLabel(schema, uiSchema, rootSchema);
|
|
43942
46857
|
|
|
43943
46858
|
var __errors = errorSchema.__errors,
|
|
43944
|
-
fieldErrorSchema = _objectWithoutProperties(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
46859
|
+
fieldErrorSchema = _objectWithoutProperties$1(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
43945
46860
|
|
|
43946
46861
|
|
|
43947
|
-
var field = react.createElement(FieldComponent, _extends({}, props, {
|
|
46862
|
+
var field = react.createElement(FieldComponent, _extends$1({}, props, {
|
|
43948
46863
|
idSchema: idSchema,
|
|
43949
46864
|
schema: schema,
|
|
43950
46865
|
uiSchema: _objectSpread({}, uiSchema, {
|
|
@@ -44940,7 +47855,7 @@ function isInteger(data) {
|
|
|
44940
47855
|
return Number.isInteger(Number(data));
|
|
44941
47856
|
}
|
|
44942
47857
|
|
|
44943
|
-
const formCss = "@charset \"UTF-8\"
|
|
47858
|
+
const formCss = "@charset \"UTF-8\";*,*::after,*::before{box-sizing:border-box}.form-group{min-width:0}.limel-form-array-item--simple{display:flex;align-items:center;padding:0.25rem}.limel-form-array-item--simple>*:first-child{flex:1;min-width:0}.array-items{isolation:isolate;display:flex;flex-direction:column;row-gap:var(--form-row-gap, 0.5rem);margin-top:1rem}.array-items.has-an-item-which-is-being-dragged limel-collapsible-section{--limel-cs-grid-template-rows:0fr;--limel-cs-opacity-transition-speed:0.2s;--limel-cs-grid-template-rows-transition-speed:0.2s;--limel-cs-open-header-bottom-border-radius:0.75rem}.array-item:has(limel-drag-handle:hover),.array-item:has(limel-drag-handle:focus-within),.array-item.is-elevated,.array-item.sortable-chosen{will-change:transform, box-shadow, border-radius, background-color}.array-item.sortable-ghost{border-radius:0.5rem;box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}.array-item.sortable-chosen{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color)}.array-item.is-elevated[draggable=false]{animation:sit-here 0.8s forwards}@keyframes sit-here{0%{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}100%{box-shadow:none}}limel-drag-handle{order:10}limel-collapsible-section.is-being-dragged{border-radius:0.75rem !important}.limel-form-layout--default{display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem)}.limel-form-layout--grid{--min-height-of-one-row:2.5rem;display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem);grid-template-columns:repeat(var(--number-of-columns), minmax(0, 1fr))}.limel-form-layout--grid.auto-reorder-to-avoid-empty-cells{grid-auto-flow:dense}.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5{grid-column:span 5}.limel-form-layout--grid .limel-form-layout-colspan--all{grid-column:1/-1}.limel-form-layout--grid limel-checkbox,.limel-form-layout--grid limel-switch{min-height:var(--min-height-of-one-row)}.limel-form-layout--grid limel-checkbox{display:block}.limel-form-layout--grid limel-switch{margin-left:0.5rem}.form-error{color:var(--limel-theme-error-color);font-size:0.6875rem;line-height:1.5;visibility:inherit;padding-right:1rem;padding-left:1rem;padding-top:0.25rem}.button-add-new{margin-top:0.5rem;width:100%}h1{position:relative;margin-top:0;margin-bottom:0;word-break:break-word;hyphens:auto;-webkit-hyphens:auto;text-wrap:balance;font-size:var(--limel-form-h1-font-size);line-height:calc(var(--limel-form-h1-font-size) * 1.42857);letter-spacing:-0.01rem;font-weight:500}p{margin-top:0;margin-bottom:0.75rem;font-size:var(--limel-theme-default-font-size)}.form-group{position:relative}.form-group limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5)}.form-group h1,.form-group p{color:rgb(var(--contrast-1400), 0.8)}.form-group h1{--limel-form-h1-font-size:1.476rem;font-weight:800}.form-group .form-group h1{--limel-form-h1-font-size:1.383rem;font-weight:700}.form-group .form-group h1:before{content:\"\";display:block;position:absolute;top:0;bottom:0;margin:auto;left:-0.75rem;background-color:var(--lime-primary-color, var(--limel-theme-primary-color));width:0.125rem;height:1.5rem;border-radius:0.125rem;opacity:0.6}.form-group .form-group .form-group h1{--limel-form-h1-font-size:1.296rem;font-weight:600}.form-group .form-group .form-group h1:before{display:none}.form-group .form-group .form-group .form-group h1{--limel-form-h1-font-size:1.215rem}.form-group .form-group .form-group .form-group h1:before{display:none}.form-group .form-group .form-group .form-group .form-group h1{--limel-form-h1-font-size:1.138rem}.form-group .form-group .form-group .form-group .form-group h1:before{display:none}.form-group .form-group .form-group .form-group .form-group .form-group h1{--limel-form-h1-font-size:1.067rem}.form-group .form-group .form-group .form-group .form-group .form-group h1:before{display:none}.limel-form-row--layout{--limel-form-row-border-radius:0.375rem;--limel-form-row-icon-size:1.75rem;--limel-form-row-main-information-gap:0.5rem;display:flex;flex-direction:column}.limel-form-row--layout .row{display:flex;gap:0.5rem;flex-direction:column;padding:0.5rem 1rem}.limel-form-row--layout .row:nth-child(odd){background-color:var(--form-background-color-of-odd-rows, rgb(var(--contrast-200)))}.limel-form-row--layout .row:nth-child(even){background-color:var(--form-background-color-of-even-rows, transparent)}.limel-form-row--layout .row:first-child{border-radius:var(--limel-form-row-border-radius) var(--limel-form-row-border-radius) 0 0}.limel-form-row--layout .row:last-child{border-radius:0 0 var(--limel-form-row-border-radius) var(--limel-form-row-border-radius)}.limel-form-row--layout .main-information{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--limel-form-row-main-information-gap);min-width:0}.limel-form-row--layout .main-information{position:relative}.limel-form-row--layout .main-information>.form-group.field{position:unset}.limel-form-row--layout .main-information>.form-group.field limel-help{top:0}.limel-form-row--layout limel-icon{color:rgb(var(--contrast-1200));width:var(--limel-form-row-icon-size);flex-shrink:0;min-width:0}.limel-form-row--layout .title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;font-weight:normal;flex-grow:1;color:var(--limel-theme-on-surface-color);font-size:0.875rem}.limel-form-row--layout .description{margin:0;color:var(--limel-theme-text-secondary-on-background-color);font-size:var(--limel-theme-default-small-font-size);line-height:1.5}.limel-form-row--layout .has-icon .description{padding-left:calc(var(--limel-form-row-icon-size) + var(--limel-form-row-main-information-gap))}.limel-form-row--layout .form-group.field{flex-shrink:0;display:flex;align-content:center}.limel-form-row--layout .form-group.field limel-slider{min-width:8rem;display:block}";
|
|
44944
47859
|
|
|
44945
47860
|
const Form = class {
|
|
44946
47861
|
constructor(hostRef) {
|