@limetech/lime-elements 38.31.1 → 38.32.0
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/README.md +1 -1
- 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-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-color-picker.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 +3227 -307
- 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-portal_3.cjs.entry.js.map +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-snackbar.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js.map +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/checkbox/checkbox.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- 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 +3 -0
- 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/color-picker/color-picker.js +1 -1
- package/dist/collection/components/color-picker/color-picker.js.map +1 -1
- 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 +147 -20
- package/dist/collection/components/form/row/row.js +4 -1
- package/dist/collection/components/form/row/row.js.map +1 -1
- 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/form/templates/common.js +3 -1
- package/dist/collection/components/form/templates/common.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/snackbar/snackbar.js +2 -2
- package/dist/collection/components/snackbar/snackbar.js.map +1 -1
- package/dist/collection/components/split-button/split-button.css +3 -0
- package/dist/collection/components/switch/switch.css +3 -0
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/switch/switch.js.map +1 -1
- 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/components/tooltip/tooltip.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- 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-checkbox.entry.js.map +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-color-picker.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 +3221 -301
- 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-portal_3.entry.js.map +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-snackbar.entry.js.map +1 -1
- package/dist/esm/limel-switch.entry.js.map +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-f507000e.entry.js → p-31f1cb08.entry.js} +2 -2
- 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-40542ccc.entry.js.map +1 -0
- package/dist/lime-elements/{p-d349e355.entry.js → p-42e889d8.entry.js} +2 -2
- package/dist/lime-elements/p-489d7f63.entry.js.map +1 -1
- package/dist/lime-elements/p-51d475d8.entry.js.map +1 -1
- 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-8539647d.entry.js.map +1 -1
- 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-a1a32893.entry.js +27 -0
- package/dist/lime-elements/p-a1a32893.entry.js.map +1 -0
- package/dist/lime-elements/{p-8e3c4418.entry.js → p-aa1e7319.entry.js} +2 -2
- package/dist/lime-elements/{p-ed04acfc.entry.js → p-b0acf522.entry.js} +2 -2
- package/dist/lime-elements/p-b5a96409.entry.js.map +1 -1
- 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/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +1 -1
- 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/form/templates/common.d.ts +3 -3
- package/dist/types/components/snackbar/snackbar.d.ts +2 -2
- package/dist/types/components/switch/switch.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components.d.ts +141 -28
- 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-aeba4aa4.entry.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-f507000e.entry.js.map → p-31f1cb08.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-cc7f4c81.entry.js.map → p-3311eaf3.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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index$
|
|
5
|
+
const index$2 = require('./index-174a078a.js');
|
|
6
6
|
const _commonjsHelpers = require('./_commonjsHelpers-a5111d61.js');
|
|
7
7
|
const isEmpty$1 = require('./isEmpty-bf9f840f.js');
|
|
8
8
|
const _baseIteratee$1 = require('./_baseIteratee-891227cd.js');
|
|
@@ -976,7 +976,7 @@ var useSyncExternalStore = function (
|
|
|
976
976
|
var useTransition = function () {
|
|
977
977
|
return ReactSharedInternals$2.H.useTransition();
|
|
978
978
|
};
|
|
979
|
-
var version$
|
|
979
|
+
var version$4 = "19.1.1";
|
|
980
980
|
|
|
981
981
|
var react_production = {
|
|
982
982
|
Children: Children,
|
|
@@ -1017,7 +1017,7 @@ var react_production = {
|
|
|
1017
1017
|
useState: useState,
|
|
1018
1018
|
useSyncExternalStore: useSyncExternalStore,
|
|
1019
1019
|
useTransition: useTransition,
|
|
1020
|
-
version: version$
|
|
1020
|
+
version: version$4
|
|
1021
1021
|
};
|
|
1022
1022
|
|
|
1023
1023
|
_commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
@@ -1569,7 +1569,7 @@ var useFormState = function (action, initialState, permalink) {
|
|
|
1569
1569
|
var useFormStatus = function () {
|
|
1570
1570
|
return ReactSharedInternals$1.H.useHostTransitionStatus();
|
|
1571
1571
|
};
|
|
1572
|
-
var version$
|
|
1572
|
+
var version$3 = "19.1.1";
|
|
1573
1573
|
|
|
1574
1574
|
var reactDom_production = {
|
|
1575
1575
|
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
@@ -1585,7 +1585,7 @@ var reactDom_production = {
|
|
|
1585
1585
|
unstable_batchedUpdates: unstable_batchedUpdates,
|
|
1586
1586
|
useFormState: useFormState,
|
|
1587
1587
|
useFormStatus: useFormStatus,
|
|
1588
|
-
version: version$
|
|
1588
|
+
version: version$3
|
|
1589
1589
|
};
|
|
1590
1590
|
|
|
1591
1591
|
_commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
@@ -1836,17 +1836,17 @@ var isArrayImpl = Array.isArray,
|
|
|
1836
1836
|
action: null
|
|
1837
1837
|
},
|
|
1838
1838
|
valueStack = [],
|
|
1839
|
-
index = -1;
|
|
1839
|
+
index$1 = -1;
|
|
1840
1840
|
function createCursor(defaultValue) {
|
|
1841
1841
|
return { current: defaultValue };
|
|
1842
1842
|
}
|
|
1843
1843
|
function pop(cursor) {
|
|
1844
|
-
0 > index ||
|
|
1845
|
-
((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
|
|
1844
|
+
0 > index$1 ||
|
|
1845
|
+
((cursor.current = valueStack[index$1]), (valueStack[index$1] = null), index$1--);
|
|
1846
1846
|
}
|
|
1847
1847
|
function push(cursor, value) {
|
|
1848
|
-
index++;
|
|
1849
|
-
valueStack[index] = cursor.current;
|
|
1848
|
+
index$1++;
|
|
1849
|
+
valueStack[index$1] = cursor.current;
|
|
1850
1850
|
cursor.current = value;
|
|
1851
1851
|
}
|
|
1852
1852
|
var contextStackCursor = createCursor(null),
|
|
@@ -13511,7 +13511,7 @@ function addTrappedEventListener(
|
|
|
13511
13511
|
listenerWrapper = dispatchContinuousEvent;
|
|
13512
13512
|
break;
|
|
13513
13513
|
default:
|
|
13514
|
-
listenerWrapper = dispatchEvent$
|
|
13514
|
+
listenerWrapper = dispatchEvent$2;
|
|
13515
13515
|
}
|
|
13516
13516
|
eventSystemFlags = listenerWrapper.bind(
|
|
13517
13517
|
null,
|
|
@@ -16256,7 +16256,7 @@ function dispatchDiscreteEvent(
|
|
|
16256
16256
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
16257
16257
|
try {
|
|
16258
16258
|
(ReactDOMSharedInternals.p = 2),
|
|
16259
|
-
dispatchEvent$
|
|
16259
|
+
dispatchEvent$2(domEventName, eventSystemFlags, container, nativeEvent);
|
|
16260
16260
|
} finally {
|
|
16261
16261
|
(ReactDOMSharedInternals.p = previousPriority),
|
|
16262
16262
|
(ReactSharedInternals.T = prevTransition);
|
|
@@ -16273,13 +16273,13 @@ function dispatchContinuousEvent(
|
|
|
16273
16273
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
16274
16274
|
try {
|
|
16275
16275
|
(ReactDOMSharedInternals.p = 8),
|
|
16276
|
-
dispatchEvent$
|
|
16276
|
+
dispatchEvent$2(domEventName, eventSystemFlags, container, nativeEvent);
|
|
16277
16277
|
} finally {
|
|
16278
16278
|
(ReactDOMSharedInternals.p = previousPriority),
|
|
16279
16279
|
(ReactSharedInternals.T = prevTransition);
|
|
16280
16280
|
}
|
|
16281
16281
|
}
|
|
16282
|
-
function dispatchEvent$
|
|
16282
|
+
function dispatchEvent$2(
|
|
16283
16283
|
domEventName,
|
|
16284
16284
|
eventSystemFlags,
|
|
16285
16285
|
targetContainer,
|
|
@@ -16982,12 +16982,12 @@ var hydrateRoot = function (container, initialChildren, options) {
|
|
|
16982
16982
|
listenToAllSupportedEvents(container);
|
|
16983
16983
|
return new ReactDOMHydrationRoot(initialChildren);
|
|
16984
16984
|
};
|
|
16985
|
-
var version$
|
|
16985
|
+
var version$2 = "19.1.1";
|
|
16986
16986
|
|
|
16987
16987
|
var reactDomClient_production = {
|
|
16988
16988
|
createRoot: createRoot,
|
|
16989
16989
|
hydrateRoot: hydrateRoot,
|
|
16990
|
-
version: version$
|
|
16990
|
+
version: version$2
|
|
16991
16991
|
};
|
|
16992
16992
|
|
|
16993
16993
|
_commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
@@ -18034,24 +18034,24 @@ for (var i = 0; i < DOMIterables.length; i++) {
|
|
|
18034
18034
|
|
|
18035
18035
|
var iterator = _wksExt.f('iterator');
|
|
18036
18036
|
|
|
18037
|
-
function _typeof(o) {
|
|
18037
|
+
function _typeof$1(o) {
|
|
18038
18038
|
"@babel/helpers - typeof";
|
|
18039
18039
|
|
|
18040
|
-
return _typeof = "function" == typeof symbol && "symbol" == typeof iterator ? function (o) {
|
|
18040
|
+
return _typeof$1 = "function" == typeof symbol && "symbol" == typeof iterator ? function (o) {
|
|
18041
18041
|
return typeof o;
|
|
18042
18042
|
} : function (o) {
|
|
18043
18043
|
return o && "function" == typeof symbol && o.constructor === symbol && o !== symbol.prototype ? "symbol" : typeof o;
|
|
18044
|
-
}, _typeof(o);
|
|
18044
|
+
}, _typeof$1(o);
|
|
18045
18045
|
}
|
|
18046
18046
|
|
|
18047
18047
|
var toPrimitive$2 = _wksExt.f('toPrimitive');
|
|
18048
18048
|
|
|
18049
18049
|
function toPrimitive$1(t, r) {
|
|
18050
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
18050
|
+
if ("object" != _typeof$1(t) || !t) return t;
|
|
18051
18051
|
var e = t[toPrimitive$2];
|
|
18052
18052
|
if (void 0 !== e) {
|
|
18053
18053
|
var i = e.call(t, r || "default");
|
|
18054
|
-
if ("object" != _typeof(i)) return i;
|
|
18054
|
+
if ("object" != _typeof$1(i)) return i;
|
|
18055
18055
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18056
18056
|
}
|
|
18057
18057
|
return ("string" === r ? String : Number)(t);
|
|
@@ -18059,10 +18059,10 @@ function toPrimitive$1(t, r) {
|
|
|
18059
18059
|
|
|
18060
18060
|
function toPropertyKey(t) {
|
|
18061
18061
|
var i = toPrimitive$1(t, "string");
|
|
18062
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
18062
|
+
return "symbol" == _typeof$1(i) ? i : i + "";
|
|
18063
18063
|
}
|
|
18064
18064
|
|
|
18065
|
-
function _defineProperty$
|
|
18065
|
+
function _defineProperty$2(e, r, t) {
|
|
18066
18066
|
return (r = toPropertyKey(r)) in e ? defineProperty$1(e, r, {
|
|
18067
18067
|
value: t,
|
|
18068
18068
|
enumerable: !0,
|
|
@@ -18078,7 +18078,7 @@ function _objectSpread(e) {
|
|
|
18078
18078
|
"function" == typeof getOwnPropertySymbols && o.push.apply(o, getOwnPropertySymbols(t).filter(function (e) {
|
|
18079
18079
|
return getOwnPropertyDescriptor(t, e).enumerable;
|
|
18080
18080
|
})), o.forEach(function (r) {
|
|
18081
|
-
_defineProperty$
|
|
18081
|
+
_defineProperty$2(e, r, t[r]);
|
|
18082
18082
|
});
|
|
18083
18083
|
}
|
|
18084
18084
|
return e;
|
|
@@ -18117,7 +18117,7 @@ function _assertThisInitialized(e) {
|
|
|
18117
18117
|
}
|
|
18118
18118
|
|
|
18119
18119
|
function _possibleConstructorReturn(t, e) {
|
|
18120
|
-
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
18120
|
+
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
18121
18121
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
18122
18122
|
return _assertThisInitialized(t);
|
|
18123
18123
|
}
|
|
@@ -19497,7 +19497,7 @@ var defineProperty = (function() {
|
|
|
19497
19497
|
} catch (e) {}
|
|
19498
19498
|
}());
|
|
19499
19499
|
|
|
19500
|
-
var _defineProperty = defineProperty;
|
|
19500
|
+
var _defineProperty$1 = defineProperty;
|
|
19501
19501
|
|
|
19502
19502
|
/**
|
|
19503
19503
|
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
@@ -19509,8 +19509,8 @@ var _defineProperty = defineProperty;
|
|
|
19509
19509
|
* @param {*} value The value to assign.
|
|
19510
19510
|
*/
|
|
19511
19511
|
function baseAssignValue(object, key, value) {
|
|
19512
|
-
if (key == '__proto__' && _defineProperty) {
|
|
19513
|
-
_defineProperty(object, key, {
|
|
19512
|
+
if (key == '__proto__' && _defineProperty$1) {
|
|
19513
|
+
_defineProperty$1(object, key, {
|
|
19514
19514
|
'configurable': true,
|
|
19515
19515
|
'enumerable': true,
|
|
19516
19516
|
'value': value,
|
|
@@ -20039,8 +20039,8 @@ var identity_1 = identity;
|
|
|
20039
20039
|
* @param {Function} string The `toString` result.
|
|
20040
20040
|
* @returns {Function} Returns `func`.
|
|
20041
20041
|
*/
|
|
20042
|
-
var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
|
|
20043
|
-
return _defineProperty(func, 'toString', {
|
|
20042
|
+
var baseSetToString = !_defineProperty$1 ? identity_1 : function(func, string) {
|
|
20043
|
+
return _defineProperty$1(func, 'toString', {
|
|
20044
20044
|
'configurable': true,
|
|
20045
20045
|
'enumerable': false,
|
|
20046
20046
|
'value': constant_1(string),
|
|
@@ -21207,17 +21207,17 @@ _export(_export.S + _export.F, 'Object', { assign: _objectAssign });
|
|
|
21207
21207
|
|
|
21208
21208
|
var assign = _core.Object.assign;
|
|
21209
21209
|
|
|
21210
|
-
function _extends() {
|
|
21211
|
-
return _extends = assign ? assign.bind() : function (n) {
|
|
21210
|
+
function _extends$1() {
|
|
21211
|
+
return _extends$1 = assign ? assign.bind() : function (n) {
|
|
21212
21212
|
for (var e = 1; e < arguments.length; e++) {
|
|
21213
21213
|
var t = arguments[e];
|
|
21214
21214
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
21215
21215
|
}
|
|
21216
21216
|
return n;
|
|
21217
|
-
}, _extends.apply(null, arguments);
|
|
21217
|
+
}, _extends$1.apply(null, arguments);
|
|
21218
21218
|
}
|
|
21219
21219
|
|
|
21220
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
21220
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
21221
21221
|
if (null == r) return {};
|
|
21222
21222
|
var t = {};
|
|
21223
21223
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -21227,11 +21227,11 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
21227
21227
|
return t;
|
|
21228
21228
|
}
|
|
21229
21229
|
|
|
21230
|
-
function _objectWithoutProperties(e, t) {
|
|
21230
|
+
function _objectWithoutProperties$1(e, t) {
|
|
21231
21231
|
if (null == e) return {};
|
|
21232
21232
|
var o,
|
|
21233
21233
|
r,
|
|
21234
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
21234
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
21235
21235
|
if (getOwnPropertySymbols) {
|
|
21236
21236
|
var n = getOwnPropertySymbols(e);
|
|
21237
21237
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
@@ -23772,7 +23772,7 @@ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
|
23772
23772
|
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
|
|
23773
23773
|
* // => { 'a': 1, 'b': 2 }
|
|
23774
23774
|
*/
|
|
23775
|
-
var defaults = _baseRest(function(object, sources) {
|
|
23775
|
+
var defaults$1 = _baseRest(function(object, sources) {
|
|
23776
23776
|
object = Object(object);
|
|
23777
23777
|
|
|
23778
23778
|
var index = -1;
|
|
@@ -23803,7 +23803,7 @@ var defaults = _baseRest(function(object, sources) {
|
|
|
23803
23803
|
return object;
|
|
23804
23804
|
});
|
|
23805
23805
|
|
|
23806
|
-
var defaults_1 = defaults;
|
|
23806
|
+
var defaults_1 = defaults$1;
|
|
23807
23807
|
|
|
23808
23808
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
23809
23809
|
var nativeMin = Math.min;
|
|
@@ -26040,9 +26040,9 @@ function IconButton$1(props) {
|
|
|
26040
26040
|
type = _props$type === void 0 ? "default" : _props$type,
|
|
26041
26041
|
icon = props.icon,
|
|
26042
26042
|
className = props.className,
|
|
26043
|
-
otherProps = _objectWithoutProperties(props, ["type", "icon", "className"]);
|
|
26043
|
+
otherProps = _objectWithoutProperties$1(props, ["type", "icon", "className"]);
|
|
26044
26044
|
|
|
26045
|
-
return react.createElement("button", _extends({
|
|
26045
|
+
return react.createElement("button", _extends$1({
|
|
26046
26046
|
type: "button",
|
|
26047
26047
|
className: "btn btn-".concat(type, " ").concat(className)
|
|
26048
26048
|
}, otherProps), react.createElement("i", {
|
|
@@ -26330,7 +26330,7 @@ var REDUCE_TIME = 1567752802062;
|
|
|
26330
26330
|
|
|
26331
26331
|
// don't change unless we change the algos or REDUCE_TIME
|
|
26332
26332
|
// must be an integer and less than 16
|
|
26333
|
-
var version = 7;
|
|
26333
|
+
var version$1 = 7;
|
|
26334
26334
|
|
|
26335
26335
|
// Counter is used when shortid is called multiple times in one second.
|
|
26336
26336
|
var counter$1;
|
|
@@ -26354,7 +26354,7 @@ function build(clusterWorkerId) {
|
|
|
26354
26354
|
previousSeconds = seconds;
|
|
26355
26355
|
}
|
|
26356
26356
|
|
|
26357
|
-
str = str + generate_1(version);
|
|
26357
|
+
str = str + generate_1(version$1);
|
|
26358
26358
|
str = str + generate_1(clusterWorkerId);
|
|
26359
26359
|
if (counter$1 > 0) {
|
|
26360
26360
|
str = str + generate_1(counter$1);
|
|
@@ -26608,7 +26608,7 @@ function (_Component) {
|
|
|
26608
26608
|
|
|
26609
26609
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayField).call(this, props));
|
|
26610
26610
|
|
|
26611
|
-
_defineProperty$
|
|
26611
|
+
_defineProperty$2(_assertThisInitialized(_this), "_getNewFormDataRow", function () {
|
|
26612
26612
|
var _this$props = _this.props,
|
|
26613
26613
|
schema = _this$props.schema,
|
|
26614
26614
|
_this$props$registry = _this$props.registry,
|
|
@@ -26623,7 +26623,7 @@ function (_Component) {
|
|
|
26623
26623
|
return getDefaultFormState$1(itemSchema, undefined, rootSchema);
|
|
26624
26624
|
});
|
|
26625
26625
|
|
|
26626
|
-
_defineProperty$
|
|
26626
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddClick", function (event) {
|
|
26627
26627
|
if (event) {
|
|
26628
26628
|
event.preventDefault();
|
|
26629
26629
|
}
|
|
@@ -26643,7 +26643,7 @@ function (_Component) {
|
|
|
26643
26643
|
});
|
|
26644
26644
|
});
|
|
26645
26645
|
|
|
26646
|
-
_defineProperty$
|
|
26646
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddIndexClick", function (index) {
|
|
26647
26647
|
return function (event) {
|
|
26648
26648
|
if (event) {
|
|
26649
26649
|
event.preventDefault();
|
|
@@ -26668,7 +26668,7 @@ function (_Component) {
|
|
|
26668
26668
|
};
|
|
26669
26669
|
});
|
|
26670
26670
|
|
|
26671
|
-
_defineProperty$
|
|
26671
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropIndexClick", function (index) {
|
|
26672
26672
|
return function (event) {
|
|
26673
26673
|
if (event) {
|
|
26674
26674
|
event.preventDefault();
|
|
@@ -26707,7 +26707,7 @@ function (_Component) {
|
|
|
26707
26707
|
};
|
|
26708
26708
|
});
|
|
26709
26709
|
|
|
26710
|
-
_defineProperty$
|
|
26710
|
+
_defineProperty$2(_assertThisInitialized(_this), "onReorderClick", function (index, newIndex) {
|
|
26711
26711
|
return function (event) {
|
|
26712
26712
|
if (event) {
|
|
26713
26713
|
event.preventDefault();
|
|
@@ -26756,7 +26756,7 @@ function (_Component) {
|
|
|
26756
26756
|
};
|
|
26757
26757
|
});
|
|
26758
26758
|
|
|
26759
|
-
_defineProperty$
|
|
26759
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChangeForIndex", function (index) {
|
|
26760
26760
|
return function (value, errorSchema) {
|
|
26761
26761
|
var _this$props2 = _this.props,
|
|
26762
26762
|
formData = _this$props2.formData,
|
|
@@ -26767,11 +26767,11 @@ function (_Component) {
|
|
|
26767
26767
|
var jsonValue = typeof value === "undefined" ? null : value;
|
|
26768
26768
|
return index === i ? jsonValue : item;
|
|
26769
26769
|
});
|
|
26770
|
-
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
26770
|
+
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, index, errorSchema)));
|
|
26771
26771
|
};
|
|
26772
26772
|
});
|
|
26773
26773
|
|
|
26774
|
-
_defineProperty$
|
|
26774
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSelectChange", function (value) {
|
|
26775
26775
|
_this.props.onChange(value);
|
|
26776
26776
|
});
|
|
26777
26777
|
|
|
@@ -26960,7 +26960,7 @@ function (_Component) {
|
|
|
26960
26960
|
}),
|
|
26961
26961
|
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
26962
26962
|
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
26963
|
-
options = _objectWithoutProperties(_getUiOptions$enumOpt, ["widget"]);
|
|
26963
|
+
options = _objectWithoutProperties$1(_getUiOptions$enumOpt, ["widget"]);
|
|
26964
26964
|
|
|
26965
26965
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
26966
26966
|
return react.createElement(Widget, {
|
|
@@ -27007,7 +27007,7 @@ function (_Component) {
|
|
|
27007
27007
|
var _getUiOptions2 = getUiOptions$1(uiSchema),
|
|
27008
27008
|
_getUiOptions2$widget = _getUiOptions2.widget,
|
|
27009
27009
|
widget = _getUiOptions2$widget === void 0 ? "files" : _getUiOptions2$widget,
|
|
27010
|
-
options = _objectWithoutProperties(_getUiOptions2, ["widget"]);
|
|
27010
|
+
options = _objectWithoutProperties$1(_getUiOptions2, ["widget"]);
|
|
27011
27011
|
|
|
27012
27012
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
27013
27013
|
return react.createElement(Widget, {
|
|
@@ -27221,7 +27221,7 @@ function (_Component) {
|
|
|
27221
27221
|
return ArrayField;
|
|
27222
27222
|
}(react.Component);
|
|
27223
27223
|
|
|
27224
|
-
_defineProperty$
|
|
27224
|
+
_defineProperty$2(ArrayField$2, "defaultProps", {
|
|
27225
27225
|
uiSchema: {},
|
|
27226
27226
|
formData: [],
|
|
27227
27227
|
idSchema: {},
|
|
@@ -27255,7 +27255,7 @@ function BooleanField$1(props) {
|
|
|
27255
27255
|
var _getUiOptions = getUiOptions$1(uiSchema),
|
|
27256
27256
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
27257
27257
|
widget = _getUiOptions$widget === void 0 ? "checkbox" : _getUiOptions$widget,
|
|
27258
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
27258
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
27259
27259
|
|
|
27260
27260
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
27261
27261
|
var enumOptions;
|
|
@@ -27347,7 +27347,7 @@ function (_Component) {
|
|
|
27347
27347
|
|
|
27348
27348
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AnyOfField).call(this, props));
|
|
27349
27349
|
|
|
27350
|
-
_defineProperty$
|
|
27350
|
+
_defineProperty$2(_assertThisInitialized(_this), "onOptionChange", function (option) {
|
|
27351
27351
|
var selectedOption = _parseInt(option, 10);
|
|
27352
27352
|
|
|
27353
27353
|
var _this$props = _this.props,
|
|
@@ -27362,7 +27362,7 @@ function (_Component) {
|
|
|
27362
27362
|
var newFormData = undefined;
|
|
27363
27363
|
|
|
27364
27364
|
if (guessType$1(formData) === "object" && (newOption.type === "object" || newOption.properties)) {
|
|
27365
|
-
newFormData = _extends({}, formData);
|
|
27365
|
+
newFormData = _extends$1({}, formData);
|
|
27366
27366
|
var optionsToDiscard = options.slice();
|
|
27367
27367
|
optionsToDiscard.splice(selectedOption, 1); // Discard any data added using other options
|
|
27368
27368
|
|
|
@@ -27468,7 +27468,7 @@ function (_Component) {
|
|
|
27468
27468
|
var _getUiOptions = getUiOptions$1(uiSchema),
|
|
27469
27469
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
27470
27470
|
widget = _getUiOptions$widget === void 0 ? "select" : _getUiOptions$widget,
|
|
27471
|
-
uiOptions = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
27471
|
+
uiOptions = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
27472
27472
|
|
|
27473
27473
|
var Widget = getWidget$1({
|
|
27474
27474
|
type: "number"
|
|
@@ -27479,7 +27479,7 @@ function (_Component) {
|
|
|
27479
27479
|
if (option) {
|
|
27480
27480
|
// If the subschema doesn't declare a type, infer the type from the
|
|
27481
27481
|
// parent schema
|
|
27482
|
-
optionSchema = option.type ? option : _extends({}, option, {
|
|
27482
|
+
optionSchema = option.type ? option : _extends$1({}, option, {
|
|
27483
27483
|
type: baseType
|
|
27484
27484
|
});
|
|
27485
27485
|
}
|
|
@@ -27494,7 +27494,7 @@ function (_Component) {
|
|
|
27494
27494
|
className: "panel panel-default panel-body"
|
|
27495
27495
|
}, react.createElement("div", {
|
|
27496
27496
|
className: "form-group"
|
|
27497
|
-
}, react.createElement(Widget, _extends({
|
|
27497
|
+
}, react.createElement(Widget, _extends$1({
|
|
27498
27498
|
id: "".concat(idSchema.$id).concat(schema.oneOf ? "__oneof_select" : "__anyof_select"),
|
|
27499
27499
|
schema: {
|
|
27500
27500
|
type: "number",
|
|
@@ -27573,7 +27573,7 @@ function (_React$Component) {
|
|
|
27573
27573
|
|
|
27574
27574
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(NumberField).call(this, props));
|
|
27575
27575
|
|
|
27576
|
-
_defineProperty$
|
|
27576
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleChange", function (value) {
|
|
27577
27577
|
// Cache the original value in component state
|
|
27578
27578
|
_this.setState({
|
|
27579
27579
|
lastValue: value
|
|
@@ -27606,7 +27606,7 @@ function (_React$Component) {
|
|
|
27606
27606
|
|
|
27607
27607
|
var _this$props = this.props,
|
|
27608
27608
|
formData = _this$props.formData,
|
|
27609
|
-
props = _objectWithoutProperties(_this$props, ["formData"]);
|
|
27609
|
+
props = _objectWithoutProperties$1(_this$props, ["formData"]);
|
|
27610
27610
|
|
|
27611
27611
|
var lastValue = this.state.lastValue;
|
|
27612
27612
|
var value = formData;
|
|
@@ -27623,7 +27623,7 @@ function (_React$Component) {
|
|
|
27623
27623
|
}
|
|
27624
27624
|
}
|
|
27625
27625
|
|
|
27626
|
-
return react.createElement(StringField, _extends({}, props, {
|
|
27626
|
+
return react.createElement(StringField, _extends$1({}, props, {
|
|
27627
27627
|
formData: value,
|
|
27628
27628
|
onChange: this.handleChange
|
|
27629
27629
|
}));
|
|
@@ -27685,12 +27685,12 @@ function (_Component) {
|
|
|
27685
27685
|
|
|
27686
27686
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ObjectField)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
27687
27687
|
|
|
27688
|
-
_defineProperty$
|
|
27688
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", {
|
|
27689
27689
|
wasPropertyKeyModified: false,
|
|
27690
27690
|
additionalProperties: {}
|
|
27691
27691
|
});
|
|
27692
27692
|
|
|
27693
|
-
_defineProperty$
|
|
27693
|
+
_defineProperty$2(_assertThisInitialized(_this), "onPropertyChange", function (name) {
|
|
27694
27694
|
var addedByAdditionalProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
27695
27695
|
return function (value, errorSchema) {
|
|
27696
27696
|
if (!value && addedByAdditionalProperties) {
|
|
@@ -27704,13 +27704,13 @@ function (_Component) {
|
|
|
27704
27704
|
value = "";
|
|
27705
27705
|
}
|
|
27706
27706
|
|
|
27707
|
-
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$
|
|
27707
|
+
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$2({}, name, value));
|
|
27708
27708
|
|
|
27709
|
-
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
27709
|
+
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, name, errorSchema)));
|
|
27710
27710
|
};
|
|
27711
27711
|
});
|
|
27712
27712
|
|
|
27713
|
-
_defineProperty$
|
|
27713
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropPropertyClick", function (key) {
|
|
27714
27714
|
return function (event) {
|
|
27715
27715
|
event.preventDefault();
|
|
27716
27716
|
var _this$props = _this.props,
|
|
@@ -27724,7 +27724,7 @@ function (_Component) {
|
|
|
27724
27724
|
};
|
|
27725
27725
|
});
|
|
27726
27726
|
|
|
27727
|
-
_defineProperty$
|
|
27727
|
+
_defineProperty$2(_assertThisInitialized(_this), "getAvailableKey", function (preferredKey, formData) {
|
|
27728
27728
|
var index = 0;
|
|
27729
27729
|
var newKey = preferredKey;
|
|
27730
27730
|
|
|
@@ -27735,7 +27735,7 @@ function (_Component) {
|
|
|
27735
27735
|
return newKey;
|
|
27736
27736
|
});
|
|
27737
27737
|
|
|
27738
|
-
_defineProperty$
|
|
27738
|
+
_defineProperty$2(_assertThisInitialized(_this), "onKeyChange", function (oldValue) {
|
|
27739
27739
|
return function (value, errorSchema) {
|
|
27740
27740
|
if (oldValue === value) {
|
|
27741
27741
|
return;
|
|
@@ -27745,24 +27745,24 @@ function (_Component) {
|
|
|
27745
27745
|
|
|
27746
27746
|
var newFormData = _objectSpread({}, _this.props.formData);
|
|
27747
27747
|
|
|
27748
|
-
var newKeys = _defineProperty$
|
|
27748
|
+
var newKeys = _defineProperty$2({}, oldValue, value);
|
|
27749
27749
|
|
|
27750
27750
|
var keyValues = keys$3(newFormData).map(function (key) {
|
|
27751
27751
|
var newKey = newKeys[key] || key;
|
|
27752
|
-
return _defineProperty$
|
|
27752
|
+
return _defineProperty$2({}, newKey, newFormData[key]);
|
|
27753
27753
|
});
|
|
27754
27754
|
|
|
27755
|
-
var renamedObj = _extends.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
27755
|
+
var renamedObj = _extends$1.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
27756
27756
|
|
|
27757
27757
|
_this.setState({
|
|
27758
27758
|
wasPropertyKeyModified: true
|
|
27759
27759
|
});
|
|
27760
27760
|
|
|
27761
|
-
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
27761
|
+
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, value, errorSchema)));
|
|
27762
27762
|
};
|
|
27763
27763
|
});
|
|
27764
27764
|
|
|
27765
|
-
_defineProperty$
|
|
27765
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleAddClick", function (schema) {
|
|
27766
27766
|
return function () {
|
|
27767
27767
|
var type = schema.additionalProperties.type;
|
|
27768
27768
|
|
|
@@ -27906,7 +27906,7 @@ function (_Component) {
|
|
|
27906
27906
|
formData: formData,
|
|
27907
27907
|
formContext: formContext
|
|
27908
27908
|
};
|
|
27909
|
-
return react.createElement(Template, _extends({}, templateProps, {
|
|
27909
|
+
return react.createElement(Template, _extends$1({}, templateProps, {
|
|
27910
27910
|
onAddClick: this.handleAddClick
|
|
27911
27911
|
}));
|
|
27912
27912
|
}
|
|
@@ -27915,7 +27915,7 @@ function (_Component) {
|
|
|
27915
27915
|
return ObjectField;
|
|
27916
27916
|
}(react.Component);
|
|
27917
27917
|
|
|
27918
|
-
_defineProperty$
|
|
27918
|
+
_defineProperty$2(ObjectField$2, "defaultProps", {
|
|
27919
27919
|
uiSchema: {},
|
|
27920
27920
|
formData: {},
|
|
27921
27921
|
errorSchema: {},
|
|
@@ -28155,10 +28155,10 @@ function SchemaFieldRender$1(props) {
|
|
|
28155
28155
|
var displayLabel = getDisplayLabel$1(schema, uiSchema, rootSchema);
|
|
28156
28156
|
|
|
28157
28157
|
var __errors = errorSchema.__errors,
|
|
28158
|
-
fieldErrorSchema = _objectWithoutProperties(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
28158
|
+
fieldErrorSchema = _objectWithoutProperties$1(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
28159
28159
|
|
|
28160
28160
|
|
|
28161
|
-
var field = react.createElement(FieldComponent, _extends({}, props, {
|
|
28161
|
+
var field = react.createElement(FieldComponent, _extends$1({}, props, {
|
|
28162
28162
|
idSchema: idSchema,
|
|
28163
28163
|
schema: schema,
|
|
28164
28164
|
uiSchema: _objectSpread({}, uiSchema, {
|
|
@@ -28319,7 +28319,7 @@ function StringField$1(props) {
|
|
|
28319
28319
|
widget = _getUiOptions$widget === void 0 ? defaultWidget : _getUiOptions$widget,
|
|
28320
28320
|
_getUiOptions$placeho = _getUiOptions.placeholder,
|
|
28321
28321
|
placeholder = _getUiOptions$placeho === void 0 ? "" : _getUiOptions$placeho,
|
|
28322
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget", "placeholder"]);
|
|
28322
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget", "placeholder"]);
|
|
28323
28323
|
|
|
28324
28324
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
28325
28325
|
return react.createElement(Widget, {
|
|
@@ -28482,8 +28482,8 @@ function (_Component) {
|
|
|
28482
28482
|
|
|
28483
28483
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AltDateWidget).call(this, props));
|
|
28484
28484
|
|
|
28485
|
-
_defineProperty$
|
|
28486
|
-
_this.setState(_defineProperty$
|
|
28485
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (property, value) {
|
|
28486
|
+
_this.setState(_defineProperty$2({}, property, typeof value === "undefined" ? -1 : value), function () {
|
|
28487
28487
|
// Only propagate to parent state if we have a complete date{time}
|
|
28488
28488
|
if (readyForChange$1(_this.state)) {
|
|
28489
28489
|
_this.props.onChange(toDateString$1(_this.state, _this.props.time));
|
|
@@ -28491,7 +28491,7 @@ function (_Component) {
|
|
|
28491
28491
|
});
|
|
28492
28492
|
});
|
|
28493
28493
|
|
|
28494
|
-
_defineProperty$
|
|
28494
|
+
_defineProperty$2(_assertThisInitialized(_this), "setNow", function (event) {
|
|
28495
28495
|
event.preventDefault();
|
|
28496
28496
|
var _this$props = _this.props,
|
|
28497
28497
|
time = _this$props.time,
|
|
@@ -28510,7 +28510,7 @@ function (_Component) {
|
|
|
28510
28510
|
});
|
|
28511
28511
|
});
|
|
28512
28512
|
|
|
28513
|
-
_defineProperty$
|
|
28513
|
+
_defineProperty$2(_assertThisInitialized(_this), "clear", function (event) {
|
|
28514
28514
|
event.preventDefault();
|
|
28515
28515
|
var _this$props2 = _this.props,
|
|
28516
28516
|
time = _this$props2.time,
|
|
@@ -28559,7 +28559,7 @@ function (_Component) {
|
|
|
28559
28559
|
}, this.dateElementProps.map(function (elemProps, i) {
|
|
28560
28560
|
return react.createElement("li", {
|
|
28561
28561
|
key: i
|
|
28562
|
-
}, react.createElement(DateElement$1, _extends({
|
|
28562
|
+
}, react.createElement(DateElement$1, _extends$1({
|
|
28563
28563
|
rootId: id,
|
|
28564
28564
|
select: _this2.onChange
|
|
28565
28565
|
}, elemProps, {
|
|
@@ -28629,7 +28629,7 @@ function (_Component) {
|
|
|
28629
28629
|
return AltDateWidget;
|
|
28630
28630
|
}(react.Component);
|
|
28631
28631
|
|
|
28632
|
-
_defineProperty$
|
|
28632
|
+
_defineProperty$2(AltDateWidget$1, "defaultProps", {
|
|
28633
28633
|
time: false,
|
|
28634
28634
|
disabled: false,
|
|
28635
28635
|
readonly: false,
|
|
@@ -28641,7 +28641,7 @@ _defineProperty$1(AltDateWidget$1, "defaultProps", {
|
|
|
28641
28641
|
|
|
28642
28642
|
function AltDateTimeWidget$1(props) {
|
|
28643
28643
|
var AltDateWidget = props.registry.widgets.AltDateWidget;
|
|
28644
|
-
return react.createElement(AltDateWidget, _extends({
|
|
28644
|
+
return react.createElement(AltDateWidget, _extends$1({
|
|
28645
28645
|
time: true
|
|
28646
28646
|
}, props));
|
|
28647
28647
|
}
|
|
@@ -28666,7 +28666,7 @@ function BaseInput$1(props) {
|
|
|
28666
28666
|
onFocus = props.onFocus,
|
|
28667
28667
|
options = props.options,
|
|
28668
28668
|
schema = props.schema,
|
|
28669
|
-
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
|
|
28669
|
+
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
|
|
28670
28670
|
|
|
28671
28671
|
|
|
28672
28672
|
if (options.inputType) {
|
|
@@ -28711,7 +28711,7 @@ function BaseInput$1(props) {
|
|
|
28711
28711
|
return props.onChange(value === "" ? options.emptyValue : value);
|
|
28712
28712
|
};
|
|
28713
28713
|
|
|
28714
|
-
return [react.createElement("input", _extends({
|
|
28714
|
+
return [react.createElement("input", _extends$1({
|
|
28715
28715
|
key: inputProps.id,
|
|
28716
28716
|
className: "form-control",
|
|
28717
28717
|
readOnly: readonly,
|
|
@@ -28861,7 +28861,7 @@ function ColorWidget$1(props) {
|
|
|
28861
28861
|
var disabled = props.disabled,
|
|
28862
28862
|
readonly = props.readonly,
|
|
28863
28863
|
BaseInput = props.registry.widgets.BaseInput;
|
|
28864
|
-
return react.createElement(BaseInput, _extends({
|
|
28864
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28865
28865
|
type: "color"
|
|
28866
28866
|
}, props, {
|
|
28867
28867
|
disabled: disabled || readonly
|
|
@@ -28871,7 +28871,7 @@ function ColorWidget$1(props) {
|
|
|
28871
28871
|
function DateWidget$1(props) {
|
|
28872
28872
|
var _onChange = props.onChange,
|
|
28873
28873
|
BaseInput = props.registry.widgets.BaseInput;
|
|
28874
|
-
return react.createElement(BaseInput, _extends({
|
|
28874
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28875
28875
|
type: "date"
|
|
28876
28876
|
}, props, {
|
|
28877
28877
|
onChange: function onChange(value) {
|
|
@@ -28884,7 +28884,7 @@ function DateTimeWidget$1(props) {
|
|
|
28884
28884
|
var value = props.value,
|
|
28885
28885
|
_onChange = props.onChange,
|
|
28886
28886
|
BaseInput = props.registry.widgets.BaseInput;
|
|
28887
|
-
return react.createElement(BaseInput, _extends({
|
|
28887
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28888
28888
|
type: "datetime-local"
|
|
28889
28889
|
}, props, {
|
|
28890
28890
|
value: utcToLocal$1(value),
|
|
@@ -28896,7 +28896,7 @@ function DateTimeWidget$1(props) {
|
|
|
28896
28896
|
|
|
28897
28897
|
function EmailWidget$1(props) {
|
|
28898
28898
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
28899
|
-
return react.createElement(BaseInput, _extends({
|
|
28899
|
+
return react.createElement(BaseInput, _extends$1({
|
|
28900
28900
|
type: "email"
|
|
28901
28901
|
}, props));
|
|
28902
28902
|
}
|
|
@@ -29501,7 +29501,7 @@ function (_Component) {
|
|
|
29501
29501
|
|
|
29502
29502
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(FileWidget).call(this, props));
|
|
29503
29503
|
|
|
29504
|
-
_defineProperty$
|
|
29504
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (event) {
|
|
29505
29505
|
var _this$props = _this.props,
|
|
29506
29506
|
multiple = _this$props.multiple,
|
|
29507
29507
|
onChange = _this$props.onChange;
|
|
@@ -29587,7 +29587,7 @@ function HiddenWidget$1(_ref) {
|
|
|
29587
29587
|
|
|
29588
29588
|
function PasswordWidget$1(props) {
|
|
29589
29589
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
29590
|
-
return react.createElement(BaseInput, _extends({
|
|
29590
|
+
return react.createElement(BaseInput, _extends$1({
|
|
29591
29591
|
type: "password"
|
|
29592
29592
|
}, props));
|
|
29593
29593
|
}
|
|
@@ -29655,7 +29655,7 @@ function RangeWidget$1(props) {
|
|
|
29655
29655
|
BaseInput = props.registry.widgets.BaseInput;
|
|
29656
29656
|
return react.createElement("div", {
|
|
29657
29657
|
className: "field-range-wrapper"
|
|
29658
|
-
}, react.createElement(BaseInput, _extends({
|
|
29658
|
+
}, react.createElement(BaseInput, _extends$1({
|
|
29659
29659
|
type: "range"
|
|
29660
29660
|
}, props, rangeSpec$1(schema))), react.createElement("span", {
|
|
29661
29661
|
className: "range-view"
|
|
@@ -29818,14 +29818,14 @@ function TextWidget$1(props) {
|
|
|
29818
29818
|
|
|
29819
29819
|
function URLWidget$1(props) {
|
|
29820
29820
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
29821
|
-
return react.createElement(BaseInput, _extends({
|
|
29821
|
+
return react.createElement(BaseInput, _extends$1({
|
|
29822
29822
|
type: "url"
|
|
29823
29823
|
}, props));
|
|
29824
29824
|
}
|
|
29825
29825
|
|
|
29826
29826
|
function UpDownWidget$1(props) {
|
|
29827
29827
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
29828
|
-
return react.createElement(BaseInput, _extends({
|
|
29828
|
+
return react.createElement(BaseInput, _extends$1({
|
|
29829
29829
|
type: "number"
|
|
29830
29830
|
}, props, rangeSpec$1(props.schema)));
|
|
29831
29831
|
}
|
|
@@ -37102,13 +37102,13 @@ function createErrorHandler$1(formData) {
|
|
|
37102
37102
|
|
|
37103
37103
|
if (isObject$1(formData)) {
|
|
37104
37104
|
return keys$3(formData).reduce(function (acc, key) {
|
|
37105
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37105
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler$1(formData[key])));
|
|
37106
37106
|
}, handler);
|
|
37107
37107
|
}
|
|
37108
37108
|
|
|
37109
37109
|
if (isArray$2(formData)) {
|
|
37110
37110
|
return formData.reduce(function (acc, value, key) {
|
|
37111
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37111
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler$1(value)));
|
|
37112
37112
|
}, handler);
|
|
37113
37113
|
}
|
|
37114
37114
|
|
|
@@ -37120,10 +37120,10 @@ function unwrapErrorHandler$1(errorHandler) {
|
|
|
37120
37120
|
if (key === "addError") {
|
|
37121
37121
|
return acc;
|
|
37122
37122
|
} else if (key === "__errors") {
|
|
37123
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37123
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, errorHandler[key]));
|
|
37124
37124
|
}
|
|
37125
37125
|
|
|
37126
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
37126
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, unwrapErrorHandler$1(errorHandler[key])));
|
|
37127
37127
|
}, {});
|
|
37128
37128
|
}
|
|
37129
37129
|
/**
|
|
@@ -37259,9 +37259,9 @@ function isValid$1(schema, data) {
|
|
|
37259
37259
|
}
|
|
37260
37260
|
}
|
|
37261
37261
|
|
|
37262
|
-
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
37262
|
+
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
37263
37263
|
|
|
37264
|
-
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); }
|
|
37264
|
+
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); }
|
|
37265
37265
|
var ADDITIONAL_PROPERTY_FLAG$1 = "__additional_property";
|
|
37266
37266
|
var widgetMap$1 = {
|
|
37267
37267
|
"boolean": {
|
|
@@ -37380,9 +37380,9 @@ function getWidget$1(schema, widget) {
|
|
|
37380
37380
|
Widget.MergedWidget = function (_ref) {
|
|
37381
37381
|
var _ref$options = _ref.options,
|
|
37382
37382
|
options = _ref$options === void 0 ? {} : _ref$options,
|
|
37383
|
-
props = _objectWithoutProperties(_ref, ["options"]);
|
|
37383
|
+
props = _objectWithoutProperties$1(_ref, ["options"]);
|
|
37384
37384
|
|
|
37385
|
-
return react.createElement(Widget, _extends({
|
|
37385
|
+
return react.createElement(Widget, _extends$1({
|
|
37386
37386
|
options: _objectSpread({}, defaultOptions, options)
|
|
37387
37387
|
}, props));
|
|
37388
37388
|
};
|
|
@@ -37396,7 +37396,7 @@ function getWidget$1(schema, widget) {
|
|
|
37396
37396
|
}
|
|
37397
37397
|
|
|
37398
37398
|
if (typeof widget !== "string") {
|
|
37399
|
-
throw new Error("Unsupported widget definition: ".concat(_typeof(widget)));
|
|
37399
|
+
throw new Error("Unsupported widget definition: ".concat(_typeof$1(widget)));
|
|
37400
37400
|
}
|
|
37401
37401
|
|
|
37402
37402
|
if (registeredWidgets.hasOwnProperty(widget)) {
|
|
@@ -37569,7 +37569,7 @@ function mergeDefaultsWithFormData$1(defaults, formData) {
|
|
|
37569
37569
|
return value;
|
|
37570
37570
|
});
|
|
37571
37571
|
} else if (isObject$1(formData)) {
|
|
37572
|
-
var acc = _extends({}, defaults); // Prevent mutation of source object.
|
|
37572
|
+
var acc = _extends$1({}, defaults); // Prevent mutation of source object.
|
|
37573
37573
|
|
|
37574
37574
|
|
|
37575
37575
|
return keys$3(formData).reduce(function (acc, key) {
|
|
@@ -37598,7 +37598,7 @@ function getUiOptions$1(uiSchema) {
|
|
|
37598
37598
|
return _objectSpread({}, options, value);
|
|
37599
37599
|
}
|
|
37600
37600
|
|
|
37601
|
-
return _objectSpread({}, options, _defineProperty$
|
|
37601
|
+
return _objectSpread({}, options, _defineProperty$2({}, key.substring(3), value));
|
|
37602
37602
|
}, {});
|
|
37603
37603
|
}
|
|
37604
37604
|
function getDisplayLabel$1(schema, uiSchema, rootSchema) {
|
|
@@ -37629,13 +37629,13 @@ function isObject$1(thing) {
|
|
|
37629
37629
|
return false;
|
|
37630
37630
|
}
|
|
37631
37631
|
|
|
37632
|
-
return _typeof(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
37632
|
+
return _typeof$1(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
37633
37633
|
}
|
|
37634
37634
|
function mergeObjects$1(obj1, obj2) {
|
|
37635
37635
|
var concatArrays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
37636
37636
|
|
|
37637
37637
|
// Recursively merge deeply nested objects.
|
|
37638
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
37638
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
37639
37639
|
|
|
37640
37640
|
|
|
37641
37641
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -37851,7 +37851,7 @@ var guessType$1 = function guessType(value) {
|
|
|
37851
37851
|
return "boolean";
|
|
37852
37852
|
} else if (!isNaN(value)) {
|
|
37853
37853
|
return "number";
|
|
37854
|
-
} else if (_typeof(value) === "object") {
|
|
37854
|
+
} else if (_typeof$1(value) === "object") {
|
|
37855
37855
|
return "object";
|
|
37856
37856
|
} // Default to string if we can't figure it out
|
|
37857
37857
|
|
|
@@ -37920,7 +37920,7 @@ function resolveReference$1(schema, rootSchema, formData) {
|
|
|
37920
37920
|
// Retrieve the referenced schema definition.
|
|
37921
37921
|
var $refSchema = findSchemaDefinition$1(schema.$ref, rootSchema); // Drop the $ref property of the source schema.
|
|
37922
37922
|
|
|
37923
|
-
var localSchema = _objectWithoutProperties(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
37923
|
+
var localSchema = _objectWithoutProperties$1(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
37924
37924
|
|
|
37925
37925
|
|
|
37926
37926
|
return retrieveSchema$1(_objectSpread({}, $refSchema, localSchema), rootSchema, formData);
|
|
@@ -37945,7 +37945,7 @@ function retrieveSchema$1(schema) {
|
|
|
37945
37945
|
console.warn("could not merge subschemas in allOf:\n" + e);
|
|
37946
37946
|
|
|
37947
37947
|
var _resolvedSchema = resolvedSchema,
|
|
37948
|
-
resolvedSchemaWithoutAllOf = _objectWithoutProperties(_resolvedSchema, ["allOf"]);
|
|
37948
|
+
resolvedSchemaWithoutAllOf = _objectWithoutProperties$1(_resolvedSchema, ["allOf"]);
|
|
37949
37949
|
|
|
37950
37950
|
return resolvedSchemaWithoutAllOf;
|
|
37951
37951
|
}
|
|
@@ -37964,7 +37964,7 @@ function resolveDependencies$1(schema, rootSchema, formData) {
|
|
|
37964
37964
|
// Drop the dependencies from the source schema.
|
|
37965
37965
|
var _schema$dependencies = schema.dependencies,
|
|
37966
37966
|
dependencies = _schema$dependencies === void 0 ? {} : _schema$dependencies,
|
|
37967
|
-
resolvedSchema = _objectWithoutProperties(schema, ["dependencies"]);
|
|
37967
|
+
resolvedSchema = _objectWithoutProperties$1(schema, ["dependencies"]);
|
|
37968
37968
|
|
|
37969
37969
|
if ("oneOf" in resolvedSchema) {
|
|
37970
37970
|
resolvedSchema = resolvedSchema.oneOf[getMatchingOption$1(formData, resolvedSchema.oneOf)];
|
|
@@ -37989,7 +37989,7 @@ function processDependencies$1(dependencies, resolvedSchema, rootSchema, formDat
|
|
|
37989
37989
|
}
|
|
37990
37990
|
|
|
37991
37991
|
var dependencyValue = dependencies[dependencyKey],
|
|
37992
|
-
remainingDependencies = _objectWithoutProperties(dependencies, [dependencyKey].map(_toPropertyKey$1));
|
|
37992
|
+
remainingDependencies = _objectWithoutProperties$1(dependencies, [dependencyKey].map(_toPropertyKey$1));
|
|
37993
37993
|
|
|
37994
37994
|
if (isArray$2(dependencyValue)) {
|
|
37995
37995
|
resolvedSchema = withDependentProperties$1(resolvedSchema, dependencyValue);
|
|
@@ -38017,14 +38017,14 @@ function withDependentProperties$1(schema, additionallyRequired) {
|
|
|
38017
38017
|
function withDependentSchema$1(schema, rootSchema, formData, dependencyKey, dependencyValue) {
|
|
38018
38018
|
var _retrieveSchema = retrieveSchema$1(dependencyValue, rootSchema, formData),
|
|
38019
38019
|
oneOf = _retrieveSchema.oneOf,
|
|
38020
|
-
dependentSchema = _objectWithoutProperties(_retrieveSchema, ["oneOf"]);
|
|
38020
|
+
dependentSchema = _objectWithoutProperties$1(_retrieveSchema, ["oneOf"]);
|
|
38021
38021
|
|
|
38022
38022
|
schema = mergeSchemas$1(schema, dependentSchema); // Since it does not contain oneOf, we return the original schema.
|
|
38023
38023
|
|
|
38024
38024
|
if (oneOf === undefined) {
|
|
38025
38025
|
return schema;
|
|
38026
38026
|
} else if (!isArray$2(oneOf)) {
|
|
38027
|
-
throw new Error("invalid: it is some ".concat(_typeof(oneOf), " instead of an array"));
|
|
38027
|
+
throw new Error("invalid: it is some ".concat(_typeof$1(oneOf), " instead of an array"));
|
|
38028
38028
|
} // Resolve $refs inside oneOf.
|
|
38029
38029
|
|
|
38030
38030
|
|
|
@@ -38045,7 +38045,7 @@ function withExactlyOneSubschema$1(schema, rootSchema, formData, dependencyKey,
|
|
|
38045
38045
|
if (conditionPropertySchema) {
|
|
38046
38046
|
var conditionSchema = {
|
|
38047
38047
|
type: "object",
|
|
38048
|
-
properties: _defineProperty$
|
|
38048
|
+
properties: _defineProperty$2({}, dependencyKey, conditionPropertySchema)
|
|
38049
38049
|
};
|
|
38050
38050
|
|
|
38051
38051
|
var _validateFormData = validateFormData$1(formData, conditionSchema),
|
|
@@ -38063,7 +38063,7 @@ function withExactlyOneSubschema$1(schema, rootSchema, formData, dependencyKey,
|
|
|
38063
38063
|
var subschema = validSubschemas[0];
|
|
38064
38064
|
|
|
38065
38065
|
var _subschema$properties = subschema.properties,
|
|
38066
|
-
dependentSubschema = _objectWithoutProperties(_subschema$properties, [dependencyKey].map(_toPropertyKey$1));
|
|
38066
|
+
dependentSubschema = _objectWithoutProperties$1(_subschema$properties, [dependencyKey].map(_toPropertyKey$1));
|
|
38067
38067
|
|
|
38068
38068
|
var dependentSchema = _objectSpread({}, subschema, {
|
|
38069
38069
|
properties: dependentSubschema
|
|
@@ -38078,7 +38078,7 @@ function withExactlyOneSubschema$1(schema, rootSchema, formData, dependencyKey,
|
|
|
38078
38078
|
|
|
38079
38079
|
|
|
38080
38080
|
function mergeSchemas$1(obj1, obj2) {
|
|
38081
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
38081
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
38082
38082
|
|
|
38083
38083
|
|
|
38084
38084
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -38116,7 +38116,7 @@ function deepEquals$1(a, b) {
|
|
|
38116
38116
|
// Assume all functions are equivalent
|
|
38117
38117
|
// see https://github.com/rjsf-team/react-jsonschema-form/issues/255
|
|
38118
38118
|
return true;
|
|
38119
|
-
} else if (_typeof(a) !== "object" || _typeof(b) !== "object") {
|
|
38119
|
+
} else if (_typeof$1(a) !== "object" || _typeof$1(b) !== "object") {
|
|
38120
38120
|
return false;
|
|
38121
38121
|
} else if (a === null || b === null) {
|
|
38122
38122
|
return false;
|
|
@@ -38410,7 +38410,7 @@ function getMatchingOption$1(formData, options, rootSchema) {
|
|
|
38410
38410
|
|
|
38411
38411
|
if (option.anyOf) {
|
|
38412
38412
|
// Create a shallow clone of the option
|
|
38413
|
-
var shallowClone = _extends({}, option);
|
|
38413
|
+
var shallowClone = _extends$1({}, option);
|
|
38414
38414
|
|
|
38415
38415
|
if (!shallowClone.allOf) {
|
|
38416
38416
|
shallowClone.allOf = [];
|
|
@@ -38422,7 +38422,7 @@ function getMatchingOption$1(formData, options, rootSchema) {
|
|
|
38422
38422
|
shallowClone.allOf.push(requiresAnyOf);
|
|
38423
38423
|
augmentedSchema = shallowClone;
|
|
38424
38424
|
} else {
|
|
38425
|
-
augmentedSchema = _extends({}, option, requiresAnyOf);
|
|
38425
|
+
augmentedSchema = _extends$1({}, option, requiresAnyOf);
|
|
38426
38426
|
} // Remove the "required" field as it's likely that not all fields have
|
|
38427
38427
|
// been filled in yet, which will mean that the schema is not valid
|
|
38428
38428
|
|
|
@@ -38482,9 +38482,9 @@ function (_Component) {
|
|
|
38482
38482
|
|
|
38483
38483
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(Form).call(this, props));
|
|
38484
38484
|
|
|
38485
|
-
_defineProperty$
|
|
38485
|
+
_defineProperty$2(_assertThisInitialized(_this), "getUsedFormData", function (formData, fields) {
|
|
38486
38486
|
//for the case of a single input form
|
|
38487
|
-
if (fields.length === 0 && _typeof(formData) !== "object") {
|
|
38487
|
+
if (fields.length === 0 && _typeof$1(formData) !== "object") {
|
|
38488
38488
|
return formData;
|
|
38489
38489
|
}
|
|
38490
38490
|
|
|
@@ -38499,13 +38499,13 @@ function (_Component) {
|
|
|
38499
38499
|
return data;
|
|
38500
38500
|
});
|
|
38501
38501
|
|
|
38502
|
-
_defineProperty$
|
|
38502
|
+
_defineProperty$2(_assertThisInitialized(_this), "getFieldNames", function (pathSchema, formData) {
|
|
38503
38503
|
var getAllPaths = function getAllPaths(_obj) {
|
|
38504
38504
|
var acc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
38505
38505
|
var paths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [""];
|
|
38506
38506
|
|
|
38507
38507
|
keys$3(_obj).forEach(function (key) {
|
|
38508
|
-
if (_typeof(_obj[key]) === "object") {
|
|
38508
|
+
if (_typeof$1(_obj[key]) === "object") {
|
|
38509
38509
|
var newPaths = paths.map(function (path) {
|
|
38510
38510
|
return "".concat(path, ".").concat(key);
|
|
38511
38511
|
}); // If an object is marked with additionalProperties, all its keys are valid
|
|
@@ -38523,7 +38523,7 @@ function (_Component) {
|
|
|
38523
38523
|
// or an empty object/array
|
|
38524
38524
|
|
|
38525
38525
|
|
|
38526
|
-
if (_typeof(formValue) !== "object" || isEmpty_1(formValue)) {
|
|
38526
|
+
if (_typeof$1(formValue) !== "object" || isEmpty_1(formValue)) {
|
|
38527
38527
|
acc.push(path);
|
|
38528
38528
|
}
|
|
38529
38529
|
});
|
|
@@ -38536,7 +38536,7 @@ function (_Component) {
|
|
|
38536
38536
|
return getAllPaths(pathSchema);
|
|
38537
38537
|
});
|
|
38538
38538
|
|
|
38539
|
-
_defineProperty$
|
|
38539
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (formData, newErrorSchema) {
|
|
38540
38540
|
if (isObject$1(formData) || isArray$2(formData)) {
|
|
38541
38541
|
var newState = _this.getStateFromProps(_this.props, formData);
|
|
38542
38542
|
|
|
@@ -38596,7 +38596,7 @@ function (_Component) {
|
|
|
38596
38596
|
});
|
|
38597
38597
|
});
|
|
38598
38598
|
|
|
38599
|
-
_defineProperty$
|
|
38599
|
+
_defineProperty$2(_assertThisInitialized(_this), "onBlur", function () {
|
|
38600
38600
|
if (_this.props.onBlur) {
|
|
38601
38601
|
var _this$props;
|
|
38602
38602
|
|
|
@@ -38604,7 +38604,7 @@ function (_Component) {
|
|
|
38604
38604
|
}
|
|
38605
38605
|
});
|
|
38606
38606
|
|
|
38607
|
-
_defineProperty$
|
|
38607
|
+
_defineProperty$2(_assertThisInitialized(_this), "onFocus", function () {
|
|
38608
38608
|
if (_this.props.onFocus) {
|
|
38609
38609
|
var _this$props2;
|
|
38610
38610
|
|
|
@@ -38612,7 +38612,7 @@ function (_Component) {
|
|
|
38612
38612
|
}
|
|
38613
38613
|
});
|
|
38614
38614
|
|
|
38615
|
-
_defineProperty$
|
|
38615
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSubmit", function (event) {
|
|
38616
38616
|
event.preventDefault();
|
|
38617
38617
|
|
|
38618
38618
|
if (event.target !== event.currentTarget) {
|
|
@@ -38932,7 +38932,7 @@ function (_Component) {
|
|
|
38932
38932
|
return Form;
|
|
38933
38933
|
}(react.Component);
|
|
38934
38934
|
|
|
38935
|
-
_defineProperty$
|
|
38935
|
+
_defineProperty$2(Form$1, "defaultProps", {
|
|
38936
38936
|
uiSchema: {},
|
|
38937
38937
|
noValidate: false,
|
|
38938
38938
|
liveValidate: false,
|
|
@@ -38986,11 +38986,11 @@ var reactShadowDomRetargetEvents = function retargetEvents(shadowRoot) {
|
|
|
38986
38986
|
}
|
|
38987
38987
|
|
|
38988
38988
|
if (reactComponent && props) {
|
|
38989
|
-
dispatchEvent(event, reactEventName, props);
|
|
38989
|
+
dispatchEvent$1(event, reactEventName, props);
|
|
38990
38990
|
}
|
|
38991
38991
|
|
|
38992
38992
|
if (reactComponent && props && mimickedReactEvents[reactEventName]) {
|
|
38993
|
-
dispatchEvent(event, mimickedReactEvents[reactEventName], props);
|
|
38993
|
+
dispatchEvent$1(event, mimickedReactEvents[reactEventName], props);
|
|
38994
38994
|
}
|
|
38995
38995
|
|
|
38996
38996
|
if (event.cancelBubble) {
|
|
@@ -39040,7 +39040,7 @@ function findReactProps(component) {
|
|
|
39040
39040
|
|
|
39041
39041
|
}
|
|
39042
39042
|
|
|
39043
|
-
function dispatchEvent(event, eventType, componentProps) {
|
|
39043
|
+
function dispatchEvent$1(event, eventType, componentProps) {
|
|
39044
39044
|
event.persist = function() {
|
|
39045
39045
|
event.isPersistent = function(){ return true};
|
|
39046
39046
|
};
|
|
@@ -39157,7 +39157,9 @@ function renderDescription(description) {
|
|
|
39157
39157
|
if (!description) {
|
|
39158
39158
|
return;
|
|
39159
39159
|
}
|
|
39160
|
-
return react.createElement('
|
|
39160
|
+
return react.createElement('limel-markdown', {
|
|
39161
|
+
value: description,
|
|
39162
|
+
});
|
|
39161
39163
|
}
|
|
39162
39164
|
/**
|
|
39163
39165
|
* Find a suitable title for a nested structure.
|
|
@@ -39288,31 +39290,28 @@ class CollapsibleItemTemplate extends react.Component {
|
|
|
39288
39290
|
if (this.state.isOpen) {
|
|
39289
39291
|
children = this.props.item.children;
|
|
39290
39292
|
}
|
|
39293
|
+
const dragHandle = this.props.allowItemReorder
|
|
39294
|
+
? react.createElement('limel-drag-handle', {
|
|
39295
|
+
slot: 'header',
|
|
39296
|
+
class: 'drag-handle',
|
|
39297
|
+
})
|
|
39298
|
+
: null;
|
|
39291
39299
|
return react.createElement('limel-collapsible-section', {
|
|
39292
39300
|
header: findTitle(data, schema, formSchema) || 'New item',
|
|
39293
|
-
class: 'limel-form-array-item--object',
|
|
39301
|
+
class: 'array-item limel-form-array-item--object',
|
|
39294
39302
|
ref: (section) => {
|
|
39295
39303
|
this.section = section;
|
|
39296
39304
|
},
|
|
39297
39305
|
'is-open': this.state.isOpen,
|
|
39298
|
-
|
|
39306
|
+
'data-reorder-id': String(this.props.index),
|
|
39307
|
+
'data-reorderable': this.props.allowItemReorder
|
|
39308
|
+
? 'true'
|
|
39309
|
+
: 'false',
|
|
39310
|
+
}, dragHandle, children);
|
|
39299
39311
|
}
|
|
39300
39312
|
setActions(element) {
|
|
39301
|
-
const { item, index, allowItemRemoval
|
|
39313
|
+
const { item, index, allowItemRemoval } = this.props;
|
|
39302
39314
|
const actions = [];
|
|
39303
|
-
if (allowItemReorder) {
|
|
39304
|
-
actions.push({
|
|
39305
|
-
id: 'down',
|
|
39306
|
-
icon: 'down_arrow',
|
|
39307
|
-
disabled: !item.hasMoveDown,
|
|
39308
|
-
run: item.onReorderClick(index, index + 1),
|
|
39309
|
-
}, {
|
|
39310
|
-
id: 'up',
|
|
39311
|
-
icon: 'up_arrow',
|
|
39312
|
-
disabled: !item.hasMoveUp,
|
|
39313
|
-
run: item.onReorderClick(index, index - 1),
|
|
39314
|
-
});
|
|
39315
|
-
}
|
|
39316
39315
|
if (allowItemRemoval) {
|
|
39317
39316
|
actions.push({
|
|
39318
39317
|
id: 'remove',
|
|
@@ -39347,14 +39346,6 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39347
39346
|
const { item, index } = this.props;
|
|
39348
39347
|
item.onDropIndexClick(index)(event);
|
|
39349
39348
|
};
|
|
39350
|
-
this.handleMoveUp = (event) => {
|
|
39351
|
-
const { item, index } = this.props;
|
|
39352
|
-
item.onReorderClick(index, index - 1)(event);
|
|
39353
|
-
};
|
|
39354
|
-
this.handleMoveDown = (event) => {
|
|
39355
|
-
const { item, index } = this.props;
|
|
39356
|
-
item.onReorderClick(index, index + 1)(event);
|
|
39357
|
-
};
|
|
39358
39349
|
this.setRemoveButton = (button) => {
|
|
39359
39350
|
if (this.removeButton) {
|
|
39360
39351
|
this.removeButton.removeEventListener('click', this.handleRemove);
|
|
@@ -39364,39 +39355,30 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39364
39355
|
this.removeButton.addEventListener('click', this.handleRemove);
|
|
39365
39356
|
}
|
|
39366
39357
|
};
|
|
39367
|
-
this.setMoveUpButton = (button) => {
|
|
39368
|
-
if (this.moveUpButton) {
|
|
39369
|
-
this.moveUpButton.removeEventListener('click', this.handleMoveUp);
|
|
39370
|
-
}
|
|
39371
|
-
this.moveUpButton = button || undefined;
|
|
39372
|
-
if (this.moveUpButton) {
|
|
39373
|
-
this.moveUpButton.addEventListener('click', this.handleMoveUp);
|
|
39374
|
-
}
|
|
39375
|
-
};
|
|
39376
|
-
this.setMoveDownButton = (button) => {
|
|
39377
|
-
if (this.moveDownButton) {
|
|
39378
|
-
this.moveDownButton.removeEventListener('click', this.handleMoveDown);
|
|
39379
|
-
}
|
|
39380
|
-
this.moveDownButton = button || undefined;
|
|
39381
|
-
if (this.moveDownButton) {
|
|
39382
|
-
this.moveDownButton.addEventListener('click', this.handleMoveDown);
|
|
39383
|
-
}
|
|
39384
|
-
};
|
|
39385
39358
|
}
|
|
39386
39359
|
componentWillUnmount() {
|
|
39387
39360
|
this.setRemoveButton(undefined);
|
|
39388
|
-
this.setMoveUpButton(undefined);
|
|
39389
|
-
this.setMoveDownButton(undefined);
|
|
39390
39361
|
}
|
|
39391
39362
|
render() {
|
|
39392
|
-
const { item } = this.props;
|
|
39363
|
+
const { item, allowItemReorder } = this.props;
|
|
39393
39364
|
return react.createElement('div', {
|
|
39394
|
-
className: 'limel-form-array-item--simple',
|
|
39395
|
-
|
|
39396
|
-
?
|
|
39397
|
-
|
|
39365
|
+
className: 'array-item limel-form-array-item--simple',
|
|
39366
|
+
'data-reorder-id': String(this.props.dataIndex),
|
|
39367
|
+
'data-reorderable': allowItemReorder ? 'true' : 'false',
|
|
39368
|
+
}, this.props.item.children, this.renderRemoveButton(item), this.renderDragHandle());
|
|
39369
|
+
}
|
|
39370
|
+
renderDragHandle() {
|
|
39371
|
+
if (!this.props.allowItemReorder) {
|
|
39372
|
+
return;
|
|
39373
|
+
}
|
|
39374
|
+
return react.createElement('limel-drag-handle', {
|
|
39375
|
+
class: 'drag-handle',
|
|
39376
|
+
});
|
|
39398
39377
|
}
|
|
39399
39378
|
renderRemoveButton(item) {
|
|
39379
|
+
if (!this.props.allowItemRemoval) {
|
|
39380
|
+
return;
|
|
39381
|
+
}
|
|
39400
39382
|
const props = {
|
|
39401
39383
|
icon: 'trash',
|
|
39402
39384
|
disabled: !item.hasRemove,
|
|
@@ -39404,33 +39386,2794 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39404
39386
|
};
|
|
39405
39387
|
return react.createElement(LIMEL_ICON_BUTTON, props);
|
|
39406
39388
|
}
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39410
|
-
|
|
39411
|
-
|
|
39389
|
+
}
|
|
39390
|
+
|
|
39391
|
+
/**!
|
|
39392
|
+
* Sortable 1.15.6
|
|
39393
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
39394
|
+
* @author owenm <owen23355@gmail.com>
|
|
39395
|
+
* @license MIT
|
|
39396
|
+
*/
|
|
39397
|
+
function ownKeys(object, enumerableOnly) {
|
|
39398
|
+
var keys = Object.keys(object);
|
|
39399
|
+
if (Object.getOwnPropertySymbols) {
|
|
39400
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
39401
|
+
if (enumerableOnly) {
|
|
39402
|
+
symbols = symbols.filter(function (sym) {
|
|
39403
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
39404
|
+
});
|
|
39405
|
+
}
|
|
39406
|
+
keys.push.apply(keys, symbols);
|
|
39407
|
+
}
|
|
39408
|
+
return keys;
|
|
39409
|
+
}
|
|
39410
|
+
function _objectSpread2(target) {
|
|
39411
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39412
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
39413
|
+
if (i % 2) {
|
|
39414
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
39415
|
+
_defineProperty(target, key, source[key]);
|
|
39416
|
+
});
|
|
39417
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
39418
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
39419
|
+
} else {
|
|
39420
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
39421
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
39422
|
+
});
|
|
39423
|
+
}
|
|
39424
|
+
}
|
|
39425
|
+
return target;
|
|
39426
|
+
}
|
|
39427
|
+
function _typeof(obj) {
|
|
39428
|
+
"@babel/helpers - typeof";
|
|
39429
|
+
|
|
39430
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
39431
|
+
_typeof = function (obj) {
|
|
39432
|
+
return typeof obj;
|
|
39433
|
+
};
|
|
39434
|
+
} else {
|
|
39435
|
+
_typeof = function (obj) {
|
|
39436
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
39412
39437
|
};
|
|
39413
|
-
return react.createElement(LIMEL_ICON_BUTTON, props);
|
|
39414
39438
|
}
|
|
39415
|
-
|
|
39416
|
-
|
|
39417
|
-
|
|
39418
|
-
|
|
39419
|
-
|
|
39439
|
+
return _typeof(obj);
|
|
39440
|
+
}
|
|
39441
|
+
function _defineProperty(obj, key, value) {
|
|
39442
|
+
if (key in obj) {
|
|
39443
|
+
Object.defineProperty(obj, key, {
|
|
39444
|
+
value: value,
|
|
39445
|
+
enumerable: true,
|
|
39446
|
+
configurable: true,
|
|
39447
|
+
writable: true
|
|
39448
|
+
});
|
|
39449
|
+
} else {
|
|
39450
|
+
obj[key] = value;
|
|
39451
|
+
}
|
|
39452
|
+
return obj;
|
|
39453
|
+
}
|
|
39454
|
+
function _extends() {
|
|
39455
|
+
_extends = Object.assign || function (target) {
|
|
39456
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39457
|
+
var source = arguments[i];
|
|
39458
|
+
for (var key in source) {
|
|
39459
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
39460
|
+
target[key] = source[key];
|
|
39461
|
+
}
|
|
39462
|
+
}
|
|
39463
|
+
}
|
|
39464
|
+
return target;
|
|
39465
|
+
};
|
|
39466
|
+
return _extends.apply(this, arguments);
|
|
39467
|
+
}
|
|
39468
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
39469
|
+
if (source == null) return {};
|
|
39470
|
+
var target = {};
|
|
39471
|
+
var sourceKeys = Object.keys(source);
|
|
39472
|
+
var key, i;
|
|
39473
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
39474
|
+
key = sourceKeys[i];
|
|
39475
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39476
|
+
target[key] = source[key];
|
|
39477
|
+
}
|
|
39478
|
+
return target;
|
|
39479
|
+
}
|
|
39480
|
+
function _objectWithoutProperties(source, excluded) {
|
|
39481
|
+
if (source == null) return {};
|
|
39482
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
39483
|
+
var key, i;
|
|
39484
|
+
if (Object.getOwnPropertySymbols) {
|
|
39485
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
39486
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
39487
|
+
key = sourceSymbolKeys[i];
|
|
39488
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39489
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39490
|
+
target[key] = source[key];
|
|
39491
|
+
}
|
|
39492
|
+
}
|
|
39493
|
+
return target;
|
|
39494
|
+
}
|
|
39495
|
+
|
|
39496
|
+
var version = "1.15.6";
|
|
39497
|
+
|
|
39498
|
+
function userAgent(pattern) {
|
|
39499
|
+
if (typeof window !== 'undefined' && window.navigator) {
|
|
39500
|
+
return !! /*@__PURE__*/navigator.userAgent.match(pattern);
|
|
39501
|
+
}
|
|
39502
|
+
}
|
|
39503
|
+
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
|
39504
|
+
var Edge = userAgent(/Edge/i);
|
|
39505
|
+
var FireFox = userAgent(/firefox/i);
|
|
39506
|
+
var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
|
|
39507
|
+
var IOS = userAgent(/iP(ad|od|hone)/i);
|
|
39508
|
+
var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
|
|
39509
|
+
|
|
39510
|
+
var captureMode = {
|
|
39511
|
+
capture: false,
|
|
39512
|
+
passive: false
|
|
39513
|
+
};
|
|
39514
|
+
function on(el, event, fn) {
|
|
39515
|
+
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
|
39516
|
+
}
|
|
39517
|
+
function off(el, event, fn) {
|
|
39518
|
+
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
|
39519
|
+
}
|
|
39520
|
+
function matches( /**HTMLElement*/el, /**String*/selector) {
|
|
39521
|
+
if (!selector) return;
|
|
39522
|
+
selector[0] === '>' && (selector = selector.substring(1));
|
|
39523
|
+
if (el) {
|
|
39524
|
+
try {
|
|
39525
|
+
if (el.matches) {
|
|
39526
|
+
return el.matches(selector);
|
|
39527
|
+
} else if (el.msMatchesSelector) {
|
|
39528
|
+
return el.msMatchesSelector(selector);
|
|
39529
|
+
} else if (el.webkitMatchesSelector) {
|
|
39530
|
+
return el.webkitMatchesSelector(selector);
|
|
39531
|
+
}
|
|
39532
|
+
} catch (_) {
|
|
39533
|
+
return false;
|
|
39534
|
+
}
|
|
39535
|
+
}
|
|
39536
|
+
return false;
|
|
39537
|
+
}
|
|
39538
|
+
function getParentOrHost(el) {
|
|
39539
|
+
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
|
39540
|
+
}
|
|
39541
|
+
function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
|
|
39542
|
+
if (el) {
|
|
39543
|
+
ctx = ctx || document;
|
|
39544
|
+
do {
|
|
39545
|
+
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
|
39546
|
+
return el;
|
|
39547
|
+
}
|
|
39548
|
+
if (el === ctx) break;
|
|
39549
|
+
/* jshint boss:true */
|
|
39550
|
+
} while (el = getParentOrHost(el));
|
|
39551
|
+
}
|
|
39552
|
+
return null;
|
|
39553
|
+
}
|
|
39554
|
+
var R_SPACE = /\s+/g;
|
|
39555
|
+
function toggleClass(el, name, state) {
|
|
39556
|
+
if (el && name) {
|
|
39557
|
+
if (el.classList) {
|
|
39558
|
+
el.classList[state ? 'add' : 'remove'](name);
|
|
39559
|
+
} else {
|
|
39560
|
+
var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
|
|
39561
|
+
el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
|
|
39562
|
+
}
|
|
39563
|
+
}
|
|
39564
|
+
}
|
|
39565
|
+
function css(el, prop, val) {
|
|
39566
|
+
var style = el && el.style;
|
|
39567
|
+
if (style) {
|
|
39568
|
+
if (val === void 0) {
|
|
39569
|
+
if (document.defaultView && document.defaultView.getComputedStyle) {
|
|
39570
|
+
val = document.defaultView.getComputedStyle(el, '');
|
|
39571
|
+
} else if (el.currentStyle) {
|
|
39572
|
+
val = el.currentStyle;
|
|
39573
|
+
}
|
|
39574
|
+
return prop === void 0 ? val : val[prop];
|
|
39575
|
+
} else {
|
|
39576
|
+
if (!(prop in style) && prop.indexOf('webkit') === -1) {
|
|
39577
|
+
prop = '-webkit-' + prop;
|
|
39578
|
+
}
|
|
39579
|
+
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
|
39580
|
+
}
|
|
39581
|
+
}
|
|
39582
|
+
}
|
|
39583
|
+
function matrix(el, selfOnly) {
|
|
39584
|
+
var appliedTransforms = '';
|
|
39585
|
+
if (typeof el === 'string') {
|
|
39586
|
+
appliedTransforms = el;
|
|
39587
|
+
} else {
|
|
39588
|
+
do {
|
|
39589
|
+
var transform = css(el, 'transform');
|
|
39590
|
+
if (transform && transform !== 'none') {
|
|
39591
|
+
appliedTransforms = transform + ' ' + appliedTransforms;
|
|
39592
|
+
}
|
|
39593
|
+
/* jshint boss:true */
|
|
39594
|
+
} while (!selfOnly && (el = el.parentNode));
|
|
39595
|
+
}
|
|
39596
|
+
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
39597
|
+
/*jshint -W056 */
|
|
39598
|
+
return matrixFn && new matrixFn(appliedTransforms);
|
|
39599
|
+
}
|
|
39600
|
+
function find(ctx, tagName, iterator) {
|
|
39601
|
+
if (ctx) {
|
|
39602
|
+
var list = ctx.getElementsByTagName(tagName),
|
|
39603
|
+
i = 0,
|
|
39604
|
+
n = list.length;
|
|
39605
|
+
if (iterator) {
|
|
39606
|
+
for (; i < n; i++) {
|
|
39607
|
+
iterator(list[i], i);
|
|
39608
|
+
}
|
|
39609
|
+
}
|
|
39610
|
+
return list;
|
|
39611
|
+
}
|
|
39612
|
+
return [];
|
|
39613
|
+
}
|
|
39614
|
+
function getWindowScrollingElement() {
|
|
39615
|
+
var scrollingElement = document.scrollingElement;
|
|
39616
|
+
if (scrollingElement) {
|
|
39617
|
+
return scrollingElement;
|
|
39618
|
+
} else {
|
|
39619
|
+
return document.documentElement;
|
|
39620
|
+
}
|
|
39621
|
+
}
|
|
39622
|
+
|
|
39623
|
+
/**
|
|
39624
|
+
* Returns the "bounding client rect" of given element
|
|
39625
|
+
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
|
39626
|
+
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
|
39627
|
+
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
|
39628
|
+
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
|
39629
|
+
* @param {[HTMLElement]} container The parent the element will be placed in
|
|
39630
|
+
* @return {Object} The boundingClientRect of el, with specified adjustments
|
|
39631
|
+
*/
|
|
39632
|
+
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
|
39633
|
+
if (!el.getBoundingClientRect && el !== window) return;
|
|
39634
|
+
var elRect, top, left, bottom, right, height, width;
|
|
39635
|
+
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
|
39636
|
+
elRect = el.getBoundingClientRect();
|
|
39637
|
+
top = elRect.top;
|
|
39638
|
+
left = elRect.left;
|
|
39639
|
+
bottom = elRect.bottom;
|
|
39640
|
+
right = elRect.right;
|
|
39641
|
+
height = elRect.height;
|
|
39642
|
+
width = elRect.width;
|
|
39643
|
+
} else {
|
|
39644
|
+
top = 0;
|
|
39645
|
+
left = 0;
|
|
39646
|
+
bottom = window.innerHeight;
|
|
39647
|
+
right = window.innerWidth;
|
|
39648
|
+
height = window.innerHeight;
|
|
39649
|
+
width = window.innerWidth;
|
|
39650
|
+
}
|
|
39651
|
+
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
|
39652
|
+
// Adjust for translate()
|
|
39653
|
+
container = container || el.parentNode;
|
|
39654
|
+
|
|
39655
|
+
// solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
|
39656
|
+
// Not needed on <= IE11
|
|
39657
|
+
if (!IE11OrLess) {
|
|
39658
|
+
do {
|
|
39659
|
+
if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
|
|
39660
|
+
var containerRect = container.getBoundingClientRect();
|
|
39661
|
+
|
|
39662
|
+
// Set relative to edges of padding box of container
|
|
39663
|
+
top -= containerRect.top + parseInt(css(container, 'border-top-width'));
|
|
39664
|
+
left -= containerRect.left + parseInt(css(container, 'border-left-width'));
|
|
39665
|
+
bottom = top + elRect.height;
|
|
39666
|
+
right = left + elRect.width;
|
|
39667
|
+
break;
|
|
39668
|
+
}
|
|
39669
|
+
/* jshint boss:true */
|
|
39670
|
+
} while (container = container.parentNode);
|
|
39671
|
+
}
|
|
39672
|
+
}
|
|
39673
|
+
if (undoScale && el !== window) {
|
|
39674
|
+
// Adjust for scale()
|
|
39675
|
+
var elMatrix = matrix(container || el),
|
|
39676
|
+
scaleX = elMatrix && elMatrix.a,
|
|
39677
|
+
scaleY = elMatrix && elMatrix.d;
|
|
39678
|
+
if (elMatrix) {
|
|
39679
|
+
top /= scaleY;
|
|
39680
|
+
left /= scaleX;
|
|
39681
|
+
width /= scaleX;
|
|
39682
|
+
height /= scaleY;
|
|
39683
|
+
bottom = top + height;
|
|
39684
|
+
right = left + width;
|
|
39685
|
+
}
|
|
39686
|
+
}
|
|
39687
|
+
return {
|
|
39688
|
+
top: top,
|
|
39689
|
+
left: left,
|
|
39690
|
+
bottom: bottom,
|
|
39691
|
+
right: right,
|
|
39692
|
+
width: width,
|
|
39693
|
+
height: height
|
|
39694
|
+
};
|
|
39695
|
+
}
|
|
39696
|
+
|
|
39697
|
+
/**
|
|
39698
|
+
* Checks if a side of an element is scrolled past a side of its parents
|
|
39699
|
+
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
|
39700
|
+
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
|
39701
|
+
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
|
39702
|
+
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
|
39703
|
+
*/
|
|
39704
|
+
function isScrolledPast(el, elSide, parentSide) {
|
|
39705
|
+
var parent = getParentAutoScrollElement(el, true),
|
|
39706
|
+
elSideVal = getRect(el)[elSide];
|
|
39707
|
+
|
|
39708
|
+
/* jshint boss:true */
|
|
39709
|
+
while (parent) {
|
|
39710
|
+
var parentSideVal = getRect(parent)[parentSide],
|
|
39711
|
+
visible = void 0;
|
|
39712
|
+
if (parentSide === 'top' || parentSide === 'left') {
|
|
39713
|
+
visible = elSideVal >= parentSideVal;
|
|
39714
|
+
} else {
|
|
39715
|
+
visible = elSideVal <= parentSideVal;
|
|
39716
|
+
}
|
|
39717
|
+
if (!visible) return parent;
|
|
39718
|
+
if (parent === getWindowScrollingElement()) break;
|
|
39719
|
+
parent = getParentAutoScrollElement(parent, false);
|
|
39720
|
+
}
|
|
39721
|
+
return false;
|
|
39722
|
+
}
|
|
39723
|
+
|
|
39724
|
+
/**
|
|
39725
|
+
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
|
39726
|
+
* and non-draggable elements
|
|
39727
|
+
* @param {HTMLElement} el The parent element
|
|
39728
|
+
* @param {Number} childNum The index of the child
|
|
39729
|
+
* @param {Object} options Parent Sortable's options
|
|
39730
|
+
* @return {HTMLElement} The child at index childNum, or null if not found
|
|
39731
|
+
*/
|
|
39732
|
+
function getChild(el, childNum, options, includeDragEl) {
|
|
39733
|
+
var currentChild = 0,
|
|
39734
|
+
i = 0,
|
|
39735
|
+
children = el.children;
|
|
39736
|
+
while (i < children.length) {
|
|
39737
|
+
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
|
39738
|
+
if (currentChild === childNum) {
|
|
39739
|
+
return children[i];
|
|
39740
|
+
}
|
|
39741
|
+
currentChild++;
|
|
39742
|
+
}
|
|
39743
|
+
i++;
|
|
39744
|
+
}
|
|
39745
|
+
return null;
|
|
39746
|
+
}
|
|
39747
|
+
|
|
39748
|
+
/**
|
|
39749
|
+
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
|
39750
|
+
* @param {HTMLElement} el Parent element
|
|
39751
|
+
* @param {selector} selector Any other elements that should be ignored
|
|
39752
|
+
* @return {HTMLElement} The last child, ignoring ghostEl
|
|
39753
|
+
*/
|
|
39754
|
+
function lastChild(el, selector) {
|
|
39755
|
+
var last = el.lastElementChild;
|
|
39756
|
+
while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
|
|
39757
|
+
last = last.previousElementSibling;
|
|
39758
|
+
}
|
|
39759
|
+
return last || null;
|
|
39760
|
+
}
|
|
39761
|
+
|
|
39762
|
+
/**
|
|
39763
|
+
* Returns the index of an element within its parent for a selected set of
|
|
39764
|
+
* elements
|
|
39765
|
+
* @param {HTMLElement} el
|
|
39766
|
+
* @param {selector} selector
|
|
39767
|
+
* @return {number}
|
|
39768
|
+
*/
|
|
39769
|
+
function index(el, selector) {
|
|
39770
|
+
var index = 0;
|
|
39771
|
+
if (!el || !el.parentNode) {
|
|
39772
|
+
return -1;
|
|
39773
|
+
}
|
|
39774
|
+
|
|
39775
|
+
/* jshint boss:true */
|
|
39776
|
+
while (el = el.previousElementSibling) {
|
|
39777
|
+
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
|
39778
|
+
index++;
|
|
39779
|
+
}
|
|
39780
|
+
}
|
|
39781
|
+
return index;
|
|
39782
|
+
}
|
|
39783
|
+
|
|
39784
|
+
/**
|
|
39785
|
+
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
|
39786
|
+
* The value is returned in real pixels.
|
|
39787
|
+
* @param {HTMLElement} el
|
|
39788
|
+
* @return {Array} Offsets in the format of [left, top]
|
|
39789
|
+
*/
|
|
39790
|
+
function getRelativeScrollOffset(el) {
|
|
39791
|
+
var offsetLeft = 0,
|
|
39792
|
+
offsetTop = 0,
|
|
39793
|
+
winScroller = getWindowScrollingElement();
|
|
39794
|
+
if (el) {
|
|
39795
|
+
do {
|
|
39796
|
+
var elMatrix = matrix(el),
|
|
39797
|
+
scaleX = elMatrix.a,
|
|
39798
|
+
scaleY = elMatrix.d;
|
|
39799
|
+
offsetLeft += el.scrollLeft * scaleX;
|
|
39800
|
+
offsetTop += el.scrollTop * scaleY;
|
|
39801
|
+
} while (el !== winScroller && (el = el.parentNode));
|
|
39802
|
+
}
|
|
39803
|
+
return [offsetLeft, offsetTop];
|
|
39804
|
+
}
|
|
39805
|
+
|
|
39806
|
+
/**
|
|
39807
|
+
* Returns the index of the object within the given array
|
|
39808
|
+
* @param {Array} arr Array that may or may not hold the object
|
|
39809
|
+
* @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
|
|
39810
|
+
* @return {Number} The index of the object in the array, or -1
|
|
39811
|
+
*/
|
|
39812
|
+
function indexOfObject(arr, obj) {
|
|
39813
|
+
for (var i in arr) {
|
|
39814
|
+
if (!arr.hasOwnProperty(i)) continue;
|
|
39815
|
+
for (var key in obj) {
|
|
39816
|
+
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
|
39817
|
+
}
|
|
39818
|
+
}
|
|
39819
|
+
return -1;
|
|
39820
|
+
}
|
|
39821
|
+
function getParentAutoScrollElement(el, includeSelf) {
|
|
39822
|
+
// skip to window
|
|
39823
|
+
if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
|
|
39824
|
+
var elem = el;
|
|
39825
|
+
var gotSelf = false;
|
|
39826
|
+
do {
|
|
39827
|
+
// we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
|
39828
|
+
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
|
39829
|
+
var elemCSS = css(elem);
|
|
39830
|
+
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
|
39831
|
+
if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
|
|
39832
|
+
if (gotSelf || includeSelf) return elem;
|
|
39833
|
+
gotSelf = true;
|
|
39834
|
+
}
|
|
39835
|
+
}
|
|
39836
|
+
/* jshint boss:true */
|
|
39837
|
+
} while (elem = elem.parentNode);
|
|
39838
|
+
return getWindowScrollingElement();
|
|
39839
|
+
}
|
|
39840
|
+
function extend(dst, src) {
|
|
39841
|
+
if (dst && src) {
|
|
39842
|
+
for (var key in src) {
|
|
39843
|
+
if (src.hasOwnProperty(key)) {
|
|
39844
|
+
dst[key] = src[key];
|
|
39845
|
+
}
|
|
39846
|
+
}
|
|
39847
|
+
}
|
|
39848
|
+
return dst;
|
|
39849
|
+
}
|
|
39850
|
+
function isRectEqual(rect1, rect2) {
|
|
39851
|
+
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);
|
|
39852
|
+
}
|
|
39853
|
+
var _throttleTimeout;
|
|
39854
|
+
function throttle(callback, ms) {
|
|
39855
|
+
return function () {
|
|
39856
|
+
if (!_throttleTimeout) {
|
|
39857
|
+
var args = arguments,
|
|
39858
|
+
_this = this;
|
|
39859
|
+
if (args.length === 1) {
|
|
39860
|
+
callback.call(_this, args[0]);
|
|
39861
|
+
} else {
|
|
39862
|
+
callback.apply(_this, args);
|
|
39863
|
+
}
|
|
39864
|
+
_throttleTimeout = setTimeout(function () {
|
|
39865
|
+
_throttleTimeout = void 0;
|
|
39866
|
+
}, ms);
|
|
39867
|
+
}
|
|
39868
|
+
};
|
|
39869
|
+
}
|
|
39870
|
+
function cancelThrottle() {
|
|
39871
|
+
clearTimeout(_throttleTimeout);
|
|
39872
|
+
_throttleTimeout = void 0;
|
|
39873
|
+
}
|
|
39874
|
+
function scrollBy(el, x, y) {
|
|
39875
|
+
el.scrollLeft += x;
|
|
39876
|
+
el.scrollTop += y;
|
|
39877
|
+
}
|
|
39878
|
+
function clone(el) {
|
|
39879
|
+
var Polymer = window.Polymer;
|
|
39880
|
+
var $ = window.jQuery || window.Zepto;
|
|
39881
|
+
if (Polymer && Polymer.dom) {
|
|
39882
|
+
return Polymer.dom(el).cloneNode(true);
|
|
39883
|
+
} else if ($) {
|
|
39884
|
+
return $(el).clone(true)[0];
|
|
39885
|
+
} else {
|
|
39886
|
+
return el.cloneNode(true);
|
|
39887
|
+
}
|
|
39888
|
+
}
|
|
39889
|
+
function getChildContainingRectFromElement(container, options, ghostEl) {
|
|
39890
|
+
var rect = {};
|
|
39891
|
+
Array.from(container.children).forEach(function (child) {
|
|
39892
|
+
var _rect$left, _rect$top, _rect$right, _rect$bottom;
|
|
39893
|
+
if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
|
|
39894
|
+
var childRect = getRect(child);
|
|
39895
|
+
rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
|
|
39896
|
+
rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
|
|
39897
|
+
rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
|
|
39898
|
+
rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
|
|
39899
|
+
});
|
|
39900
|
+
rect.width = rect.right - rect.left;
|
|
39901
|
+
rect.height = rect.bottom - rect.top;
|
|
39902
|
+
rect.x = rect.left;
|
|
39903
|
+
rect.y = rect.top;
|
|
39904
|
+
return rect;
|
|
39905
|
+
}
|
|
39906
|
+
var expando = 'Sortable' + new Date().getTime();
|
|
39907
|
+
|
|
39908
|
+
function AnimationStateManager() {
|
|
39909
|
+
var animationStates = [],
|
|
39910
|
+
animationCallbackId;
|
|
39911
|
+
return {
|
|
39912
|
+
captureAnimationState: function captureAnimationState() {
|
|
39913
|
+
animationStates = [];
|
|
39914
|
+
if (!this.options.animation) return;
|
|
39915
|
+
var children = [].slice.call(this.el.children);
|
|
39916
|
+
children.forEach(function (child) {
|
|
39917
|
+
if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
|
|
39918
|
+
animationStates.push({
|
|
39919
|
+
target: child,
|
|
39920
|
+
rect: getRect(child)
|
|
39921
|
+
});
|
|
39922
|
+
var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
|
|
39923
|
+
|
|
39924
|
+
// If animating: compensate for current animation
|
|
39925
|
+
if (child.thisAnimationDuration) {
|
|
39926
|
+
var childMatrix = matrix(child, true);
|
|
39927
|
+
if (childMatrix) {
|
|
39928
|
+
fromRect.top -= childMatrix.f;
|
|
39929
|
+
fromRect.left -= childMatrix.e;
|
|
39930
|
+
}
|
|
39931
|
+
}
|
|
39932
|
+
child.fromRect = fromRect;
|
|
39933
|
+
});
|
|
39934
|
+
},
|
|
39935
|
+
addAnimationState: function addAnimationState(state) {
|
|
39936
|
+
animationStates.push(state);
|
|
39937
|
+
},
|
|
39938
|
+
removeAnimationState: function removeAnimationState(target) {
|
|
39939
|
+
animationStates.splice(indexOfObject(animationStates, {
|
|
39940
|
+
target: target
|
|
39941
|
+
}), 1);
|
|
39942
|
+
},
|
|
39943
|
+
animateAll: function animateAll(callback) {
|
|
39944
|
+
var _this = this;
|
|
39945
|
+
if (!this.options.animation) {
|
|
39946
|
+
clearTimeout(animationCallbackId);
|
|
39947
|
+
if (typeof callback === 'function') callback();
|
|
39948
|
+
return;
|
|
39949
|
+
}
|
|
39950
|
+
var animating = false,
|
|
39951
|
+
animationTime = 0;
|
|
39952
|
+
animationStates.forEach(function (state) {
|
|
39953
|
+
var time = 0,
|
|
39954
|
+
target = state.target,
|
|
39955
|
+
fromRect = target.fromRect,
|
|
39956
|
+
toRect = getRect(target),
|
|
39957
|
+
prevFromRect = target.prevFromRect,
|
|
39958
|
+
prevToRect = target.prevToRect,
|
|
39959
|
+
animatingRect = state.rect,
|
|
39960
|
+
targetMatrix = matrix(target, true);
|
|
39961
|
+
if (targetMatrix) {
|
|
39962
|
+
// Compensate for current animation
|
|
39963
|
+
toRect.top -= targetMatrix.f;
|
|
39964
|
+
toRect.left -= targetMatrix.e;
|
|
39965
|
+
}
|
|
39966
|
+
target.toRect = toRect;
|
|
39967
|
+
if (target.thisAnimationDuration) {
|
|
39968
|
+
// Could also check if animatingRect is between fromRect and toRect
|
|
39969
|
+
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
|
39970
|
+
// Make sure animatingRect is on line between toRect & fromRect
|
|
39971
|
+
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
|
39972
|
+
// If returning to same place as started from animation and on same axis
|
|
39973
|
+
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
|
39974
|
+
}
|
|
39975
|
+
}
|
|
39976
|
+
|
|
39977
|
+
// if fromRect != toRect: animate
|
|
39978
|
+
if (!isRectEqual(toRect, fromRect)) {
|
|
39979
|
+
target.prevFromRect = fromRect;
|
|
39980
|
+
target.prevToRect = toRect;
|
|
39981
|
+
if (!time) {
|
|
39982
|
+
time = _this.options.animation;
|
|
39983
|
+
}
|
|
39984
|
+
_this.animate(target, animatingRect, toRect, time);
|
|
39985
|
+
}
|
|
39986
|
+
if (time) {
|
|
39987
|
+
animating = true;
|
|
39988
|
+
animationTime = Math.max(animationTime, time);
|
|
39989
|
+
clearTimeout(target.animationResetTimer);
|
|
39990
|
+
target.animationResetTimer = setTimeout(function () {
|
|
39991
|
+
target.animationTime = 0;
|
|
39992
|
+
target.prevFromRect = null;
|
|
39993
|
+
target.fromRect = null;
|
|
39994
|
+
target.prevToRect = null;
|
|
39995
|
+
target.thisAnimationDuration = null;
|
|
39996
|
+
}, time);
|
|
39997
|
+
target.thisAnimationDuration = time;
|
|
39998
|
+
}
|
|
39999
|
+
});
|
|
40000
|
+
clearTimeout(animationCallbackId);
|
|
40001
|
+
if (!animating) {
|
|
40002
|
+
if (typeof callback === 'function') callback();
|
|
40003
|
+
} else {
|
|
40004
|
+
animationCallbackId = setTimeout(function () {
|
|
40005
|
+
if (typeof callback === 'function') callback();
|
|
40006
|
+
}, animationTime);
|
|
40007
|
+
}
|
|
40008
|
+
animationStates = [];
|
|
40009
|
+
},
|
|
40010
|
+
animate: function animate(target, currentRect, toRect, duration) {
|
|
40011
|
+
if (duration) {
|
|
40012
|
+
css(target, 'transition', '');
|
|
40013
|
+
css(target, 'transform', '');
|
|
40014
|
+
var elMatrix = matrix(this.el),
|
|
40015
|
+
scaleX = elMatrix && elMatrix.a,
|
|
40016
|
+
scaleY = elMatrix && elMatrix.d,
|
|
40017
|
+
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
|
40018
|
+
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
|
40019
|
+
target.animatingX = !!translateX;
|
|
40020
|
+
target.animatingY = !!translateY;
|
|
40021
|
+
css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
|
40022
|
+
this.forRepaintDummy = repaint(target); // repaint
|
|
40023
|
+
|
|
40024
|
+
css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
|
|
40025
|
+
css(target, 'transform', 'translate3d(0,0,0)');
|
|
40026
|
+
typeof target.animated === 'number' && clearTimeout(target.animated);
|
|
40027
|
+
target.animated = setTimeout(function () {
|
|
40028
|
+
css(target, 'transition', '');
|
|
40029
|
+
css(target, 'transform', '');
|
|
40030
|
+
target.animated = false;
|
|
40031
|
+
target.animatingX = false;
|
|
40032
|
+
target.animatingY = false;
|
|
40033
|
+
}, duration);
|
|
40034
|
+
}
|
|
40035
|
+
}
|
|
40036
|
+
};
|
|
40037
|
+
}
|
|
40038
|
+
function repaint(target) {
|
|
40039
|
+
return target.offsetWidth;
|
|
40040
|
+
}
|
|
40041
|
+
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
|
40042
|
+
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;
|
|
40043
|
+
}
|
|
40044
|
+
|
|
40045
|
+
var plugins = [];
|
|
40046
|
+
var defaults = {
|
|
40047
|
+
initializeByDefault: true
|
|
40048
|
+
};
|
|
40049
|
+
var PluginManager = {
|
|
40050
|
+
mount: function mount(plugin) {
|
|
40051
|
+
// Set default static properties
|
|
40052
|
+
for (var option in defaults) {
|
|
40053
|
+
if (defaults.hasOwnProperty(option) && !(option in plugin)) {
|
|
40054
|
+
plugin[option] = defaults[option];
|
|
40055
|
+
}
|
|
40056
|
+
}
|
|
40057
|
+
plugins.forEach(function (p) {
|
|
40058
|
+
if (p.pluginName === plugin.pluginName) {
|
|
40059
|
+
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
|
40060
|
+
}
|
|
40061
|
+
});
|
|
40062
|
+
plugins.push(plugin);
|
|
40063
|
+
},
|
|
40064
|
+
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
|
40065
|
+
var _this = this;
|
|
40066
|
+
this.eventCanceled = false;
|
|
40067
|
+
evt.cancel = function () {
|
|
40068
|
+
_this.eventCanceled = true;
|
|
39420
40069
|
};
|
|
39421
|
-
|
|
40070
|
+
var eventNameGlobal = eventName + 'Global';
|
|
40071
|
+
plugins.forEach(function (plugin) {
|
|
40072
|
+
if (!sortable[plugin.pluginName]) return;
|
|
40073
|
+
// Fire global events if it exists in this sortable
|
|
40074
|
+
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
|
40075
|
+
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
|
|
40076
|
+
sortable: sortable
|
|
40077
|
+
}, evt));
|
|
40078
|
+
}
|
|
40079
|
+
|
|
40080
|
+
// Only fire plugin event if plugin is enabled in this sortable,
|
|
40081
|
+
// and plugin has event defined
|
|
40082
|
+
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
|
40083
|
+
sortable[plugin.pluginName][eventName](_objectSpread2({
|
|
40084
|
+
sortable: sortable
|
|
40085
|
+
}, evt));
|
|
40086
|
+
}
|
|
40087
|
+
});
|
|
40088
|
+
},
|
|
40089
|
+
initializePlugins: function initializePlugins(sortable, el, defaults, options) {
|
|
40090
|
+
plugins.forEach(function (plugin) {
|
|
40091
|
+
var pluginName = plugin.pluginName;
|
|
40092
|
+
if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
|
|
40093
|
+
var initialized = new plugin(sortable, el, sortable.options);
|
|
40094
|
+
initialized.sortable = sortable;
|
|
40095
|
+
initialized.options = sortable.options;
|
|
40096
|
+
sortable[pluginName] = initialized;
|
|
40097
|
+
|
|
40098
|
+
// Add default options from plugin
|
|
40099
|
+
_extends(defaults, initialized.defaults);
|
|
40100
|
+
});
|
|
40101
|
+
for (var option in sortable.options) {
|
|
40102
|
+
if (!sortable.options.hasOwnProperty(option)) continue;
|
|
40103
|
+
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
|
40104
|
+
if (typeof modified !== 'undefined') {
|
|
40105
|
+
sortable.options[option] = modified;
|
|
40106
|
+
}
|
|
40107
|
+
}
|
|
40108
|
+
},
|
|
40109
|
+
getEventProperties: function getEventProperties(name, sortable) {
|
|
40110
|
+
var eventProperties = {};
|
|
40111
|
+
plugins.forEach(function (plugin) {
|
|
40112
|
+
if (typeof plugin.eventProperties !== 'function') return;
|
|
40113
|
+
_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
|
40114
|
+
});
|
|
40115
|
+
return eventProperties;
|
|
40116
|
+
},
|
|
40117
|
+
modifyOption: function modifyOption(sortable, name, value) {
|
|
40118
|
+
var modifiedValue;
|
|
40119
|
+
plugins.forEach(function (plugin) {
|
|
40120
|
+
// Plugin must exist on the Sortable
|
|
40121
|
+
if (!sortable[plugin.pluginName]) return;
|
|
40122
|
+
|
|
40123
|
+
// If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
|
40124
|
+
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
|
|
40125
|
+
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
|
40126
|
+
}
|
|
40127
|
+
});
|
|
40128
|
+
return modifiedValue;
|
|
40129
|
+
}
|
|
40130
|
+
};
|
|
40131
|
+
|
|
40132
|
+
function dispatchEvent(_ref) {
|
|
40133
|
+
var sortable = _ref.sortable,
|
|
40134
|
+
rootEl = _ref.rootEl,
|
|
40135
|
+
name = _ref.name,
|
|
40136
|
+
targetEl = _ref.targetEl,
|
|
40137
|
+
cloneEl = _ref.cloneEl,
|
|
40138
|
+
toEl = _ref.toEl,
|
|
40139
|
+
fromEl = _ref.fromEl,
|
|
40140
|
+
oldIndex = _ref.oldIndex,
|
|
40141
|
+
newIndex = _ref.newIndex,
|
|
40142
|
+
oldDraggableIndex = _ref.oldDraggableIndex,
|
|
40143
|
+
newDraggableIndex = _ref.newDraggableIndex,
|
|
40144
|
+
originalEvent = _ref.originalEvent,
|
|
40145
|
+
putSortable = _ref.putSortable,
|
|
40146
|
+
extraEventProperties = _ref.extraEventProperties;
|
|
40147
|
+
sortable = sortable || rootEl && rootEl[expando];
|
|
40148
|
+
if (!sortable) return;
|
|
40149
|
+
var evt,
|
|
40150
|
+
options = sortable.options,
|
|
40151
|
+
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
|
40152
|
+
// Support for new CustomEvent feature
|
|
40153
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
40154
|
+
evt = new CustomEvent(name, {
|
|
40155
|
+
bubbles: true,
|
|
40156
|
+
cancelable: true
|
|
40157
|
+
});
|
|
40158
|
+
} else {
|
|
40159
|
+
evt = document.createEvent('Event');
|
|
40160
|
+
evt.initEvent(name, true, true);
|
|
40161
|
+
}
|
|
40162
|
+
evt.to = toEl || rootEl;
|
|
40163
|
+
evt.from = fromEl || rootEl;
|
|
40164
|
+
evt.item = targetEl || rootEl;
|
|
40165
|
+
evt.clone = cloneEl;
|
|
40166
|
+
evt.oldIndex = oldIndex;
|
|
40167
|
+
evt.newIndex = newIndex;
|
|
40168
|
+
evt.oldDraggableIndex = oldDraggableIndex;
|
|
40169
|
+
evt.newDraggableIndex = newDraggableIndex;
|
|
40170
|
+
evt.originalEvent = originalEvent;
|
|
40171
|
+
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
|
40172
|
+
var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
|
|
40173
|
+
for (var option in allEventProperties) {
|
|
40174
|
+
evt[option] = allEventProperties[option];
|
|
40175
|
+
}
|
|
40176
|
+
if (rootEl) {
|
|
40177
|
+
rootEl.dispatchEvent(evt);
|
|
40178
|
+
}
|
|
40179
|
+
if (options[onName]) {
|
|
40180
|
+
options[onName].call(sortable, evt);
|
|
40181
|
+
}
|
|
40182
|
+
}
|
|
40183
|
+
|
|
40184
|
+
var _excluded = ["evt"];
|
|
40185
|
+
var pluginEvent = function pluginEvent(eventName, sortable) {
|
|
40186
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
40187
|
+
originalEvent = _ref.evt,
|
|
40188
|
+
data = _objectWithoutProperties(_ref, _excluded);
|
|
40189
|
+
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
|
|
40190
|
+
dragEl: dragEl,
|
|
40191
|
+
parentEl: parentEl,
|
|
40192
|
+
ghostEl: ghostEl,
|
|
40193
|
+
rootEl: rootEl,
|
|
40194
|
+
nextEl: nextEl,
|
|
40195
|
+
lastDownEl: lastDownEl,
|
|
40196
|
+
cloneEl: cloneEl,
|
|
40197
|
+
cloneHidden: cloneHidden,
|
|
40198
|
+
dragStarted: moved,
|
|
40199
|
+
putSortable: putSortable,
|
|
40200
|
+
activeSortable: Sortable.active,
|
|
40201
|
+
originalEvent: originalEvent,
|
|
40202
|
+
oldIndex: oldIndex,
|
|
40203
|
+
oldDraggableIndex: oldDraggableIndex,
|
|
40204
|
+
newIndex: newIndex,
|
|
40205
|
+
newDraggableIndex: newDraggableIndex,
|
|
40206
|
+
hideGhostForTarget: _hideGhostForTarget,
|
|
40207
|
+
unhideGhostForTarget: _unhideGhostForTarget,
|
|
40208
|
+
cloneNowHidden: function cloneNowHidden() {
|
|
40209
|
+
cloneHidden = true;
|
|
40210
|
+
},
|
|
40211
|
+
cloneNowShown: function cloneNowShown() {
|
|
40212
|
+
cloneHidden = false;
|
|
40213
|
+
},
|
|
40214
|
+
dispatchSortableEvent: function dispatchSortableEvent(name) {
|
|
40215
|
+
_dispatchEvent({
|
|
40216
|
+
sortable: sortable,
|
|
40217
|
+
name: name,
|
|
40218
|
+
originalEvent: originalEvent
|
|
40219
|
+
});
|
|
40220
|
+
}
|
|
40221
|
+
}, data));
|
|
40222
|
+
};
|
|
40223
|
+
function _dispatchEvent(info) {
|
|
40224
|
+
dispatchEvent(_objectSpread2({
|
|
40225
|
+
putSortable: putSortable,
|
|
40226
|
+
cloneEl: cloneEl,
|
|
40227
|
+
targetEl: dragEl,
|
|
40228
|
+
rootEl: rootEl,
|
|
40229
|
+
oldIndex: oldIndex,
|
|
40230
|
+
oldDraggableIndex: oldDraggableIndex,
|
|
40231
|
+
newIndex: newIndex,
|
|
40232
|
+
newDraggableIndex: newDraggableIndex
|
|
40233
|
+
}, info));
|
|
40234
|
+
}
|
|
40235
|
+
var dragEl,
|
|
40236
|
+
parentEl,
|
|
40237
|
+
ghostEl,
|
|
40238
|
+
rootEl,
|
|
40239
|
+
nextEl,
|
|
40240
|
+
lastDownEl,
|
|
40241
|
+
cloneEl,
|
|
40242
|
+
cloneHidden,
|
|
40243
|
+
oldIndex,
|
|
40244
|
+
newIndex,
|
|
40245
|
+
oldDraggableIndex,
|
|
40246
|
+
newDraggableIndex,
|
|
40247
|
+
activeGroup,
|
|
40248
|
+
putSortable,
|
|
40249
|
+
awaitingDragStarted = false,
|
|
40250
|
+
ignoreNextClick = false,
|
|
40251
|
+
sortables = [],
|
|
40252
|
+
tapEvt,
|
|
40253
|
+
touchEvt,
|
|
40254
|
+
lastDx,
|
|
40255
|
+
lastDy,
|
|
40256
|
+
tapDistanceLeft,
|
|
40257
|
+
tapDistanceTop,
|
|
40258
|
+
moved,
|
|
40259
|
+
lastTarget,
|
|
40260
|
+
lastDirection,
|
|
40261
|
+
pastFirstInvertThresh = false,
|
|
40262
|
+
isCircumstantialInvert = false,
|
|
40263
|
+
targetMoveDistance,
|
|
40264
|
+
// For positioning ghost absolutely
|
|
40265
|
+
ghostRelativeParent,
|
|
40266
|
+
ghostRelativeParentInitialScroll = [],
|
|
40267
|
+
// (left, top)
|
|
40268
|
+
|
|
40269
|
+
_silent = false,
|
|
40270
|
+
savedInputChecked = [];
|
|
40271
|
+
|
|
40272
|
+
/** @const */
|
|
40273
|
+
var documentExists = typeof document !== 'undefined',
|
|
40274
|
+
PositionGhostAbsolutely = IOS,
|
|
40275
|
+
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
|
|
40276
|
+
// This will not pass for IE9, because IE9 DnD only works on anchors
|
|
40277
|
+
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
|
40278
|
+
supportCssPointerEvents = function () {
|
|
40279
|
+
if (!documentExists) return;
|
|
40280
|
+
// false when <= IE11
|
|
40281
|
+
if (IE11OrLess) {
|
|
40282
|
+
return false;
|
|
40283
|
+
}
|
|
40284
|
+
var el = document.createElement('x');
|
|
40285
|
+
el.style.cssText = 'pointer-events:auto';
|
|
40286
|
+
return el.style.pointerEvents === 'auto';
|
|
40287
|
+
}(),
|
|
40288
|
+
_detectDirection = function _detectDirection(el, options) {
|
|
40289
|
+
var elCSS = css(el),
|
|
40290
|
+
elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
|
|
40291
|
+
child1 = getChild(el, 0, options),
|
|
40292
|
+
child2 = getChild(el, 1, options),
|
|
40293
|
+
firstChildCSS = child1 && css(child1),
|
|
40294
|
+
secondChildCSS = child2 && css(child2),
|
|
40295
|
+
firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
|
|
40296
|
+
secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
|
|
40297
|
+
if (elCSS.display === 'flex') {
|
|
40298
|
+
return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
|
40299
|
+
}
|
|
40300
|
+
if (elCSS.display === 'grid') {
|
|
40301
|
+
return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
|
40302
|
+
}
|
|
40303
|
+
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
|
40304
|
+
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
|
40305
|
+
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
|
40306
|
+
}
|
|
40307
|
+
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';
|
|
40308
|
+
},
|
|
40309
|
+
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
|
40310
|
+
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
|
40311
|
+
dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
|
|
40312
|
+
dragElOppLength = vertical ? dragRect.width : dragRect.height,
|
|
40313
|
+
targetS1Opp = vertical ? targetRect.left : targetRect.top,
|
|
40314
|
+
targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
|
|
40315
|
+
targetOppLength = vertical ? targetRect.width : targetRect.height;
|
|
40316
|
+
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
|
40317
|
+
},
|
|
40318
|
+
/**
|
|
40319
|
+
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
|
40320
|
+
* @param {Number} x X position
|
|
40321
|
+
* @param {Number} y Y position
|
|
40322
|
+
* @return {HTMLElement} Element of the first found nearest Sortable
|
|
40323
|
+
*/
|
|
40324
|
+
_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
|
40325
|
+
var ret;
|
|
40326
|
+
sortables.some(function (sortable) {
|
|
40327
|
+
var threshold = sortable[expando].options.emptyInsertThreshold;
|
|
40328
|
+
if (!threshold || lastChild(sortable)) return;
|
|
40329
|
+
var rect = getRect(sortable),
|
|
40330
|
+
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
|
|
40331
|
+
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
|
40332
|
+
if (insideHorizontally && insideVertically) {
|
|
40333
|
+
return ret = sortable;
|
|
40334
|
+
}
|
|
40335
|
+
});
|
|
40336
|
+
return ret;
|
|
40337
|
+
},
|
|
40338
|
+
_prepareGroup = function _prepareGroup(options) {
|
|
40339
|
+
function toFn(value, pull) {
|
|
40340
|
+
return function (to, from, dragEl, evt) {
|
|
40341
|
+
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
|
40342
|
+
if (value == null && (pull || sameGroup)) {
|
|
40343
|
+
// Default pull value
|
|
40344
|
+
// Default pull and put value if same group
|
|
40345
|
+
return true;
|
|
40346
|
+
} else if (value == null || value === false) {
|
|
40347
|
+
return false;
|
|
40348
|
+
} else if (pull && value === 'clone') {
|
|
40349
|
+
return value;
|
|
40350
|
+
} else if (typeof value === 'function') {
|
|
40351
|
+
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
|
40352
|
+
} else {
|
|
40353
|
+
var otherGroup = (pull ? to : from).options.group.name;
|
|
40354
|
+
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
|
40355
|
+
}
|
|
40356
|
+
};
|
|
40357
|
+
}
|
|
40358
|
+
var group = {};
|
|
40359
|
+
var originalGroup = options.group;
|
|
40360
|
+
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
|
40361
|
+
originalGroup = {
|
|
40362
|
+
name: originalGroup
|
|
40363
|
+
};
|
|
40364
|
+
}
|
|
40365
|
+
group.name = originalGroup.name;
|
|
40366
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
|
40367
|
+
group.checkPut = toFn(originalGroup.put);
|
|
40368
|
+
group.revertClone = originalGroup.revertClone;
|
|
40369
|
+
options.group = group;
|
|
40370
|
+
},
|
|
40371
|
+
_hideGhostForTarget = function _hideGhostForTarget() {
|
|
40372
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
40373
|
+
css(ghostEl, 'display', 'none');
|
|
40374
|
+
}
|
|
40375
|
+
},
|
|
40376
|
+
_unhideGhostForTarget = function _unhideGhostForTarget() {
|
|
40377
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
40378
|
+
css(ghostEl, 'display', '');
|
|
40379
|
+
}
|
|
40380
|
+
};
|
|
40381
|
+
|
|
40382
|
+
// #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
|
40383
|
+
if (documentExists && !ChromeForAndroid) {
|
|
40384
|
+
document.addEventListener('click', function (evt) {
|
|
40385
|
+
if (ignoreNextClick) {
|
|
40386
|
+
evt.preventDefault();
|
|
40387
|
+
evt.stopPropagation && evt.stopPropagation();
|
|
40388
|
+
evt.stopImmediatePropagation && evt.stopImmediatePropagation();
|
|
40389
|
+
ignoreNextClick = false;
|
|
40390
|
+
return false;
|
|
40391
|
+
}
|
|
40392
|
+
}, true);
|
|
40393
|
+
}
|
|
40394
|
+
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
|
40395
|
+
if (dragEl) {
|
|
40396
|
+
evt = evt.touches ? evt.touches[0] : evt;
|
|
40397
|
+
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
|
40398
|
+
if (nearest) {
|
|
40399
|
+
// Create imitation event
|
|
40400
|
+
var event = {};
|
|
40401
|
+
for (var i in evt) {
|
|
40402
|
+
if (evt.hasOwnProperty(i)) {
|
|
40403
|
+
event[i] = evt[i];
|
|
40404
|
+
}
|
|
40405
|
+
}
|
|
40406
|
+
event.target = event.rootEl = nearest;
|
|
40407
|
+
event.preventDefault = void 0;
|
|
40408
|
+
event.stopPropagation = void 0;
|
|
40409
|
+
nearest[expando]._onDragOver(event);
|
|
40410
|
+
}
|
|
40411
|
+
}
|
|
40412
|
+
};
|
|
40413
|
+
var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
|
40414
|
+
if (dragEl) {
|
|
40415
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
40416
|
+
}
|
|
40417
|
+
};
|
|
40418
|
+
|
|
40419
|
+
/**
|
|
40420
|
+
* @class Sortable
|
|
40421
|
+
* @param {HTMLElement} el
|
|
40422
|
+
* @param {Object} [options]
|
|
40423
|
+
*/
|
|
40424
|
+
function Sortable(el, options) {
|
|
40425
|
+
if (!(el && el.nodeType && el.nodeType === 1)) {
|
|
40426
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
|
40427
|
+
}
|
|
40428
|
+
this.el = el; // root element
|
|
40429
|
+
this.options = options = _extends({}, options);
|
|
40430
|
+
|
|
40431
|
+
// Export instance
|
|
40432
|
+
el[expando] = this;
|
|
40433
|
+
var defaults = {
|
|
40434
|
+
group: null,
|
|
40435
|
+
sort: true,
|
|
40436
|
+
disabled: false,
|
|
40437
|
+
store: null,
|
|
40438
|
+
handle: null,
|
|
40439
|
+
draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
|
|
40440
|
+
swapThreshold: 1,
|
|
40441
|
+
// percentage; 0 <= x <= 1
|
|
40442
|
+
invertSwap: false,
|
|
40443
|
+
// invert always
|
|
40444
|
+
invertedSwapThreshold: null,
|
|
40445
|
+
// will be set to same as swapThreshold if default
|
|
40446
|
+
removeCloneOnHide: true,
|
|
40447
|
+
direction: function direction() {
|
|
40448
|
+
return _detectDirection(el, this.options);
|
|
40449
|
+
},
|
|
40450
|
+
ghostClass: 'sortable-ghost',
|
|
40451
|
+
chosenClass: 'sortable-chosen',
|
|
40452
|
+
dragClass: 'sortable-drag',
|
|
40453
|
+
ignore: 'a, img',
|
|
40454
|
+
filter: null,
|
|
40455
|
+
preventOnFilter: true,
|
|
40456
|
+
animation: 0,
|
|
40457
|
+
easing: null,
|
|
40458
|
+
setData: function setData(dataTransfer, dragEl) {
|
|
40459
|
+
dataTransfer.setData('Text', dragEl.textContent);
|
|
40460
|
+
},
|
|
40461
|
+
dropBubble: false,
|
|
40462
|
+
dragoverBubble: false,
|
|
40463
|
+
dataIdAttr: 'data-id',
|
|
40464
|
+
delay: 0,
|
|
40465
|
+
delayOnTouchOnly: false,
|
|
40466
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
40467
|
+
forceFallback: false,
|
|
40468
|
+
fallbackClass: 'sortable-fallback',
|
|
40469
|
+
fallbackOnBody: false,
|
|
40470
|
+
fallbackTolerance: 0,
|
|
40471
|
+
fallbackOffset: {
|
|
40472
|
+
x: 0,
|
|
40473
|
+
y: 0
|
|
40474
|
+
},
|
|
40475
|
+
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
40476
|
+
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
|
|
40477
|
+
emptyInsertThreshold: 5
|
|
40478
|
+
};
|
|
40479
|
+
PluginManager.initializePlugins(this, el, defaults);
|
|
40480
|
+
|
|
40481
|
+
// Set default options
|
|
40482
|
+
for (var name in defaults) {
|
|
40483
|
+
!(name in options) && (options[name] = defaults[name]);
|
|
40484
|
+
}
|
|
40485
|
+
_prepareGroup(options);
|
|
40486
|
+
|
|
40487
|
+
// Bind all private methods
|
|
40488
|
+
for (var fn in this) {
|
|
40489
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
40490
|
+
this[fn] = this[fn].bind(this);
|
|
40491
|
+
}
|
|
40492
|
+
}
|
|
40493
|
+
|
|
40494
|
+
// Setup drag mode
|
|
40495
|
+
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
|
40496
|
+
if (this.nativeDraggable) {
|
|
40497
|
+
// Touch start threshold cannot be greater than the native dragstart threshold
|
|
40498
|
+
this.options.touchStartThreshold = 1;
|
|
40499
|
+
}
|
|
40500
|
+
|
|
40501
|
+
// Bind events
|
|
40502
|
+
if (options.supportPointer) {
|
|
40503
|
+
on(el, 'pointerdown', this._onTapStart);
|
|
40504
|
+
} else {
|
|
40505
|
+
on(el, 'mousedown', this._onTapStart);
|
|
40506
|
+
on(el, 'touchstart', this._onTapStart);
|
|
40507
|
+
}
|
|
40508
|
+
if (this.nativeDraggable) {
|
|
40509
|
+
on(el, 'dragover', this);
|
|
40510
|
+
on(el, 'dragenter', this);
|
|
40511
|
+
}
|
|
40512
|
+
sortables.push(this.el);
|
|
40513
|
+
|
|
40514
|
+
// Restore sorting
|
|
40515
|
+
options.store && options.store.get && this.sort(options.store.get(this) || []);
|
|
40516
|
+
|
|
40517
|
+
// Add animation state manager
|
|
40518
|
+
_extends(this, AnimationStateManager());
|
|
40519
|
+
}
|
|
40520
|
+
Sortable.prototype = /** @lends Sortable.prototype */{
|
|
40521
|
+
constructor: Sortable,
|
|
40522
|
+
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
|
40523
|
+
if (!this.el.contains(target) && target !== this.el) {
|
|
40524
|
+
lastTarget = null;
|
|
40525
|
+
}
|
|
40526
|
+
},
|
|
40527
|
+
_getDirection: function _getDirection(evt, target) {
|
|
40528
|
+
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
|
40529
|
+
},
|
|
40530
|
+
_onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
|
|
40531
|
+
if (!evt.cancelable) return;
|
|
40532
|
+
var _this = this,
|
|
40533
|
+
el = this.el,
|
|
40534
|
+
options = this.options,
|
|
40535
|
+
preventOnFilter = options.preventOnFilter,
|
|
40536
|
+
type = evt.type,
|
|
40537
|
+
touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
|
|
40538
|
+
target = (touch || evt).target,
|
|
40539
|
+
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
|
|
40540
|
+
filter = options.filter;
|
|
40541
|
+
_saveInputCheckedState(el);
|
|
40542
|
+
|
|
40543
|
+
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
|
40544
|
+
if (dragEl) {
|
|
40545
|
+
return;
|
|
40546
|
+
}
|
|
40547
|
+
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
|
40548
|
+
return; // only left button and enabled
|
|
40549
|
+
}
|
|
40550
|
+
|
|
40551
|
+
// cancel dnd if original target is content editable
|
|
40552
|
+
if (originalTarget.isContentEditable) {
|
|
40553
|
+
return;
|
|
40554
|
+
}
|
|
40555
|
+
|
|
40556
|
+
// Safari ignores further event handling after mousedown
|
|
40557
|
+
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
|
|
40558
|
+
return;
|
|
40559
|
+
}
|
|
40560
|
+
target = closest(target, options.draggable, el, false);
|
|
40561
|
+
if (target && target.animated) {
|
|
40562
|
+
return;
|
|
40563
|
+
}
|
|
40564
|
+
if (lastDownEl === target) {
|
|
40565
|
+
// Ignoring duplicate `down`
|
|
40566
|
+
return;
|
|
40567
|
+
}
|
|
40568
|
+
|
|
40569
|
+
// Get the index of the dragged element within its parent
|
|
40570
|
+
oldIndex = index(target);
|
|
40571
|
+
oldDraggableIndex = index(target, options.draggable);
|
|
40572
|
+
|
|
40573
|
+
// Check filter
|
|
40574
|
+
if (typeof filter === 'function') {
|
|
40575
|
+
if (filter.call(this, evt, target, this)) {
|
|
40576
|
+
_dispatchEvent({
|
|
40577
|
+
sortable: _this,
|
|
40578
|
+
rootEl: originalTarget,
|
|
40579
|
+
name: 'filter',
|
|
40580
|
+
targetEl: target,
|
|
40581
|
+
toEl: el,
|
|
40582
|
+
fromEl: el
|
|
40583
|
+
});
|
|
40584
|
+
pluginEvent('filter', _this, {
|
|
40585
|
+
evt: evt
|
|
40586
|
+
});
|
|
40587
|
+
preventOnFilter && evt.preventDefault();
|
|
40588
|
+
return; // cancel dnd
|
|
40589
|
+
}
|
|
40590
|
+
} else if (filter) {
|
|
40591
|
+
filter = filter.split(',').some(function (criteria) {
|
|
40592
|
+
criteria = closest(originalTarget, criteria.trim(), el, false);
|
|
40593
|
+
if (criteria) {
|
|
40594
|
+
_dispatchEvent({
|
|
40595
|
+
sortable: _this,
|
|
40596
|
+
rootEl: criteria,
|
|
40597
|
+
name: 'filter',
|
|
40598
|
+
targetEl: target,
|
|
40599
|
+
fromEl: el,
|
|
40600
|
+
toEl: el
|
|
40601
|
+
});
|
|
40602
|
+
pluginEvent('filter', _this, {
|
|
40603
|
+
evt: evt
|
|
40604
|
+
});
|
|
40605
|
+
return true;
|
|
40606
|
+
}
|
|
40607
|
+
});
|
|
40608
|
+
if (filter) {
|
|
40609
|
+
preventOnFilter && evt.preventDefault();
|
|
40610
|
+
return; // cancel dnd
|
|
40611
|
+
}
|
|
40612
|
+
}
|
|
40613
|
+
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
|
40614
|
+
return;
|
|
40615
|
+
}
|
|
40616
|
+
|
|
40617
|
+
// Prepare `dragstart`
|
|
40618
|
+
this._prepareDragStart(evt, touch, target);
|
|
40619
|
+
},
|
|
40620
|
+
_prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
|
|
40621
|
+
var _this = this,
|
|
40622
|
+
el = _this.el,
|
|
40623
|
+
options = _this.options,
|
|
40624
|
+
ownerDocument = el.ownerDocument,
|
|
40625
|
+
dragStartFn;
|
|
40626
|
+
if (target && !dragEl && target.parentNode === el) {
|
|
40627
|
+
var dragRect = getRect(target);
|
|
40628
|
+
rootEl = el;
|
|
40629
|
+
dragEl = target;
|
|
40630
|
+
parentEl = dragEl.parentNode;
|
|
40631
|
+
nextEl = dragEl.nextSibling;
|
|
40632
|
+
lastDownEl = target;
|
|
40633
|
+
activeGroup = options.group;
|
|
40634
|
+
Sortable.dragged = dragEl;
|
|
40635
|
+
tapEvt = {
|
|
40636
|
+
target: dragEl,
|
|
40637
|
+
clientX: (touch || evt).clientX,
|
|
40638
|
+
clientY: (touch || evt).clientY
|
|
40639
|
+
};
|
|
40640
|
+
tapDistanceLeft = tapEvt.clientX - dragRect.left;
|
|
40641
|
+
tapDistanceTop = tapEvt.clientY - dragRect.top;
|
|
40642
|
+
this._lastX = (touch || evt).clientX;
|
|
40643
|
+
this._lastY = (touch || evt).clientY;
|
|
40644
|
+
dragEl.style['will-change'] = 'all';
|
|
40645
|
+
dragStartFn = function dragStartFn() {
|
|
40646
|
+
pluginEvent('delayEnded', _this, {
|
|
40647
|
+
evt: evt
|
|
40648
|
+
});
|
|
40649
|
+
if (Sortable.eventCanceled) {
|
|
40650
|
+
_this._onDrop();
|
|
40651
|
+
return;
|
|
40652
|
+
}
|
|
40653
|
+
// Delayed drag has been triggered
|
|
40654
|
+
// we can re-enable the events: touchmove/mousemove
|
|
40655
|
+
_this._disableDelayedDragEvents();
|
|
40656
|
+
if (!FireFox && _this.nativeDraggable) {
|
|
40657
|
+
dragEl.draggable = true;
|
|
40658
|
+
}
|
|
40659
|
+
|
|
40660
|
+
// Bind the events: dragstart/dragend
|
|
40661
|
+
_this._triggerDragStart(evt, touch);
|
|
40662
|
+
|
|
40663
|
+
// Drag start event
|
|
40664
|
+
_dispatchEvent({
|
|
40665
|
+
sortable: _this,
|
|
40666
|
+
name: 'choose',
|
|
40667
|
+
originalEvent: evt
|
|
40668
|
+
});
|
|
40669
|
+
|
|
40670
|
+
// Chosen item
|
|
40671
|
+
toggleClass(dragEl, options.chosenClass, true);
|
|
40672
|
+
};
|
|
40673
|
+
|
|
40674
|
+
// Disable "draggable"
|
|
40675
|
+
options.ignore.split(',').forEach(function (criteria) {
|
|
40676
|
+
find(dragEl, criteria.trim(), _disableDraggable);
|
|
40677
|
+
});
|
|
40678
|
+
on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
|
|
40679
|
+
on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
|
|
40680
|
+
on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
|
|
40681
|
+
if (options.supportPointer) {
|
|
40682
|
+
on(ownerDocument, 'pointerup', _this._onDrop);
|
|
40683
|
+
// Native D&D triggers pointercancel
|
|
40684
|
+
!this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
|
|
40685
|
+
} else {
|
|
40686
|
+
on(ownerDocument, 'mouseup', _this._onDrop);
|
|
40687
|
+
on(ownerDocument, 'touchend', _this._onDrop);
|
|
40688
|
+
on(ownerDocument, 'touchcancel', _this._onDrop);
|
|
40689
|
+
}
|
|
40690
|
+
|
|
40691
|
+
// Make dragEl draggable (must be before delay for FireFox)
|
|
40692
|
+
if (FireFox && this.nativeDraggable) {
|
|
40693
|
+
this.options.touchStartThreshold = 4;
|
|
40694
|
+
dragEl.draggable = true;
|
|
40695
|
+
}
|
|
40696
|
+
pluginEvent('delayStart', this, {
|
|
40697
|
+
evt: evt
|
|
40698
|
+
});
|
|
40699
|
+
|
|
40700
|
+
// Delay is impossible for native DnD in Edge or IE
|
|
40701
|
+
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
|
40702
|
+
if (Sortable.eventCanceled) {
|
|
40703
|
+
this._onDrop();
|
|
40704
|
+
return;
|
|
40705
|
+
}
|
|
40706
|
+
// If the user moves the pointer or let go the click or touch
|
|
40707
|
+
// before the delay has been reached:
|
|
40708
|
+
// disable the delayed drag
|
|
40709
|
+
if (options.supportPointer) {
|
|
40710
|
+
on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
|
|
40711
|
+
on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
|
|
40712
|
+
} else {
|
|
40713
|
+
on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
|
40714
|
+
on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
|
40715
|
+
on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
|
40716
|
+
}
|
|
40717
|
+
on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
|
|
40718
|
+
on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
|
|
40719
|
+
options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
|
|
40720
|
+
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
|
40721
|
+
} else {
|
|
40722
|
+
dragStartFn();
|
|
40723
|
+
}
|
|
40724
|
+
}
|
|
40725
|
+
},
|
|
40726
|
+
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
|
|
40727
|
+
var touch = e.touches ? e.touches[0] : e;
|
|
40728
|
+
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))) {
|
|
40729
|
+
this._disableDelayedDrag();
|
|
40730
|
+
}
|
|
40731
|
+
},
|
|
40732
|
+
_disableDelayedDrag: function _disableDelayedDrag() {
|
|
40733
|
+
dragEl && _disableDraggable(dragEl);
|
|
40734
|
+
clearTimeout(this._dragStartTimer);
|
|
40735
|
+
this._disableDelayedDragEvents();
|
|
40736
|
+
},
|
|
40737
|
+
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
|
40738
|
+
var ownerDocument = this.el.ownerDocument;
|
|
40739
|
+
off(ownerDocument, 'mouseup', this._disableDelayedDrag);
|
|
40740
|
+
off(ownerDocument, 'touchend', this._disableDelayedDrag);
|
|
40741
|
+
off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
|
|
40742
|
+
off(ownerDocument, 'pointerup', this._disableDelayedDrag);
|
|
40743
|
+
off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
|
|
40744
|
+
off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
|
|
40745
|
+
off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
|
40746
|
+
off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
|
40747
|
+
},
|
|
40748
|
+
_triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
|
|
40749
|
+
touch = touch || evt.pointerType == 'touch' && evt;
|
|
40750
|
+
if (!this.nativeDraggable || touch) {
|
|
40751
|
+
if (this.options.supportPointer) {
|
|
40752
|
+
on(document, 'pointermove', this._onTouchMove);
|
|
40753
|
+
} else if (touch) {
|
|
40754
|
+
on(document, 'touchmove', this._onTouchMove);
|
|
40755
|
+
} else {
|
|
40756
|
+
on(document, 'mousemove', this._onTouchMove);
|
|
40757
|
+
}
|
|
40758
|
+
} else {
|
|
40759
|
+
on(dragEl, 'dragend', this);
|
|
40760
|
+
on(rootEl, 'dragstart', this._onDragStart);
|
|
40761
|
+
}
|
|
40762
|
+
try {
|
|
40763
|
+
if (document.selection) {
|
|
40764
|
+
_nextTick(function () {
|
|
40765
|
+
document.selection.empty();
|
|
40766
|
+
});
|
|
40767
|
+
} else {
|
|
40768
|
+
window.getSelection().removeAllRanges();
|
|
40769
|
+
}
|
|
40770
|
+
} catch (err) {}
|
|
40771
|
+
},
|
|
40772
|
+
_dragStarted: function _dragStarted(fallback, evt) {
|
|
40773
|
+
awaitingDragStarted = false;
|
|
40774
|
+
if (rootEl && dragEl) {
|
|
40775
|
+
pluginEvent('dragStarted', this, {
|
|
40776
|
+
evt: evt
|
|
40777
|
+
});
|
|
40778
|
+
if (this.nativeDraggable) {
|
|
40779
|
+
on(document, 'dragover', _checkOutsideTargetEl);
|
|
40780
|
+
}
|
|
40781
|
+
var options = this.options;
|
|
40782
|
+
|
|
40783
|
+
// Apply effect
|
|
40784
|
+
!fallback && toggleClass(dragEl, options.dragClass, false);
|
|
40785
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
40786
|
+
Sortable.active = this;
|
|
40787
|
+
fallback && this._appendGhost();
|
|
40788
|
+
|
|
40789
|
+
// Drag start event
|
|
40790
|
+
_dispatchEvent({
|
|
40791
|
+
sortable: this,
|
|
40792
|
+
name: 'start',
|
|
40793
|
+
originalEvent: evt
|
|
40794
|
+
});
|
|
40795
|
+
} else {
|
|
40796
|
+
this._nulling();
|
|
40797
|
+
}
|
|
40798
|
+
},
|
|
40799
|
+
_emulateDragOver: function _emulateDragOver() {
|
|
40800
|
+
if (touchEvt) {
|
|
40801
|
+
this._lastX = touchEvt.clientX;
|
|
40802
|
+
this._lastY = touchEvt.clientY;
|
|
40803
|
+
_hideGhostForTarget();
|
|
40804
|
+
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
40805
|
+
var parent = target;
|
|
40806
|
+
while (target && target.shadowRoot) {
|
|
40807
|
+
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
40808
|
+
if (target === parent) break;
|
|
40809
|
+
parent = target;
|
|
40810
|
+
}
|
|
40811
|
+
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
|
40812
|
+
if (parent) {
|
|
40813
|
+
do {
|
|
40814
|
+
if (parent[expando]) {
|
|
40815
|
+
var inserted = void 0;
|
|
40816
|
+
inserted = parent[expando]._onDragOver({
|
|
40817
|
+
clientX: touchEvt.clientX,
|
|
40818
|
+
clientY: touchEvt.clientY,
|
|
40819
|
+
target: target,
|
|
40820
|
+
rootEl: parent
|
|
40821
|
+
});
|
|
40822
|
+
if (inserted && !this.options.dragoverBubble) {
|
|
40823
|
+
break;
|
|
40824
|
+
}
|
|
40825
|
+
}
|
|
40826
|
+
target = parent; // store last element
|
|
40827
|
+
}
|
|
40828
|
+
/* jshint boss:true */ while (parent = getParentOrHost(parent));
|
|
40829
|
+
}
|
|
40830
|
+
_unhideGhostForTarget();
|
|
40831
|
+
}
|
|
40832
|
+
},
|
|
40833
|
+
_onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
|
|
40834
|
+
if (tapEvt) {
|
|
40835
|
+
var options = this.options,
|
|
40836
|
+
fallbackTolerance = options.fallbackTolerance,
|
|
40837
|
+
fallbackOffset = options.fallbackOffset,
|
|
40838
|
+
touch = evt.touches ? evt.touches[0] : evt,
|
|
40839
|
+
ghostMatrix = ghostEl && matrix(ghostEl, true),
|
|
40840
|
+
scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
|
|
40841
|
+
scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
|
|
40842
|
+
relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
|
|
40843
|
+
dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
|
|
40844
|
+
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
|
|
40845
|
+
|
|
40846
|
+
// only set the status to dragging, when we are actually dragging
|
|
40847
|
+
if (!Sortable.active && !awaitingDragStarted) {
|
|
40848
|
+
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
|
40849
|
+
return;
|
|
40850
|
+
}
|
|
40851
|
+
this._onDragStart(evt, true);
|
|
40852
|
+
}
|
|
40853
|
+
if (ghostEl) {
|
|
40854
|
+
if (ghostMatrix) {
|
|
40855
|
+
ghostMatrix.e += dx - (lastDx || 0);
|
|
40856
|
+
ghostMatrix.f += dy - (lastDy || 0);
|
|
40857
|
+
} else {
|
|
40858
|
+
ghostMatrix = {
|
|
40859
|
+
a: 1,
|
|
40860
|
+
b: 0,
|
|
40861
|
+
c: 0,
|
|
40862
|
+
d: 1,
|
|
40863
|
+
e: dx,
|
|
40864
|
+
f: dy
|
|
40865
|
+
};
|
|
40866
|
+
}
|
|
40867
|
+
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
|
40868
|
+
css(ghostEl, 'webkitTransform', cssMatrix);
|
|
40869
|
+
css(ghostEl, 'mozTransform', cssMatrix);
|
|
40870
|
+
css(ghostEl, 'msTransform', cssMatrix);
|
|
40871
|
+
css(ghostEl, 'transform', cssMatrix);
|
|
40872
|
+
lastDx = dx;
|
|
40873
|
+
lastDy = dy;
|
|
40874
|
+
touchEvt = touch;
|
|
40875
|
+
}
|
|
40876
|
+
evt.cancelable && evt.preventDefault();
|
|
40877
|
+
}
|
|
40878
|
+
},
|
|
40879
|
+
_appendGhost: function _appendGhost() {
|
|
40880
|
+
// Bug if using scale(): https://stackoverflow.com/questions/2637058
|
|
40881
|
+
// Not being adjusted for
|
|
40882
|
+
if (!ghostEl) {
|
|
40883
|
+
var container = this.options.fallbackOnBody ? document.body : rootEl,
|
|
40884
|
+
rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
|
|
40885
|
+
options = this.options;
|
|
40886
|
+
|
|
40887
|
+
// Position absolutely
|
|
40888
|
+
if (PositionGhostAbsolutely) {
|
|
40889
|
+
// Get relatively positioned parent
|
|
40890
|
+
ghostRelativeParent = container;
|
|
40891
|
+
while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
|
|
40892
|
+
ghostRelativeParent = ghostRelativeParent.parentNode;
|
|
40893
|
+
}
|
|
40894
|
+
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
|
40895
|
+
if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
|
|
40896
|
+
rect.top += ghostRelativeParent.scrollTop;
|
|
40897
|
+
rect.left += ghostRelativeParent.scrollLeft;
|
|
40898
|
+
} else {
|
|
40899
|
+
ghostRelativeParent = getWindowScrollingElement();
|
|
40900
|
+
}
|
|
40901
|
+
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
|
40902
|
+
}
|
|
40903
|
+
ghostEl = dragEl.cloneNode(true);
|
|
40904
|
+
toggleClass(ghostEl, options.ghostClass, false);
|
|
40905
|
+
toggleClass(ghostEl, options.fallbackClass, true);
|
|
40906
|
+
toggleClass(ghostEl, options.dragClass, true);
|
|
40907
|
+
css(ghostEl, 'transition', '');
|
|
40908
|
+
css(ghostEl, 'transform', '');
|
|
40909
|
+
css(ghostEl, 'box-sizing', 'border-box');
|
|
40910
|
+
css(ghostEl, 'margin', 0);
|
|
40911
|
+
css(ghostEl, 'top', rect.top);
|
|
40912
|
+
css(ghostEl, 'left', rect.left);
|
|
40913
|
+
css(ghostEl, 'width', rect.width);
|
|
40914
|
+
css(ghostEl, 'height', rect.height);
|
|
40915
|
+
css(ghostEl, 'opacity', '0.8');
|
|
40916
|
+
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
|
|
40917
|
+
css(ghostEl, 'zIndex', '100000');
|
|
40918
|
+
css(ghostEl, 'pointerEvents', 'none');
|
|
40919
|
+
Sortable.ghost = ghostEl;
|
|
40920
|
+
container.appendChild(ghostEl);
|
|
40921
|
+
|
|
40922
|
+
// Set transform-origin
|
|
40923
|
+
css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
|
|
40924
|
+
}
|
|
40925
|
+
},
|
|
40926
|
+
_onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
|
|
40927
|
+
var _this = this;
|
|
40928
|
+
var dataTransfer = evt.dataTransfer;
|
|
40929
|
+
var options = _this.options;
|
|
40930
|
+
pluginEvent('dragStart', this, {
|
|
40931
|
+
evt: evt
|
|
40932
|
+
});
|
|
40933
|
+
if (Sortable.eventCanceled) {
|
|
40934
|
+
this._onDrop();
|
|
40935
|
+
return;
|
|
40936
|
+
}
|
|
40937
|
+
pluginEvent('setupClone', this);
|
|
40938
|
+
if (!Sortable.eventCanceled) {
|
|
40939
|
+
cloneEl = clone(dragEl);
|
|
40940
|
+
cloneEl.removeAttribute("id");
|
|
40941
|
+
cloneEl.draggable = false;
|
|
40942
|
+
cloneEl.style['will-change'] = '';
|
|
40943
|
+
this._hideClone();
|
|
40944
|
+
toggleClass(cloneEl, this.options.chosenClass, false);
|
|
40945
|
+
Sortable.clone = cloneEl;
|
|
40946
|
+
}
|
|
40947
|
+
|
|
40948
|
+
// #1143: IFrame support workaround
|
|
40949
|
+
_this.cloneId = _nextTick(function () {
|
|
40950
|
+
pluginEvent('clone', _this);
|
|
40951
|
+
if (Sortable.eventCanceled) return;
|
|
40952
|
+
if (!_this.options.removeCloneOnHide) {
|
|
40953
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
40954
|
+
}
|
|
40955
|
+
_this._hideClone();
|
|
40956
|
+
_dispatchEvent({
|
|
40957
|
+
sortable: _this,
|
|
40958
|
+
name: 'clone'
|
|
40959
|
+
});
|
|
40960
|
+
});
|
|
40961
|
+
!fallback && toggleClass(dragEl, options.dragClass, true);
|
|
40962
|
+
|
|
40963
|
+
// Set proper drop events
|
|
40964
|
+
if (fallback) {
|
|
40965
|
+
ignoreNextClick = true;
|
|
40966
|
+
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
|
40967
|
+
} else {
|
|
40968
|
+
// Undo what was set in _prepareDragStart before drag started
|
|
40969
|
+
off(document, 'mouseup', _this._onDrop);
|
|
40970
|
+
off(document, 'touchend', _this._onDrop);
|
|
40971
|
+
off(document, 'touchcancel', _this._onDrop);
|
|
40972
|
+
if (dataTransfer) {
|
|
40973
|
+
dataTransfer.effectAllowed = 'move';
|
|
40974
|
+
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
|
40975
|
+
}
|
|
40976
|
+
on(document, 'drop', _this);
|
|
40977
|
+
|
|
40978
|
+
// #1276 fix:
|
|
40979
|
+
css(dragEl, 'transform', 'translateZ(0)');
|
|
40980
|
+
}
|
|
40981
|
+
awaitingDragStarted = true;
|
|
40982
|
+
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
|
40983
|
+
on(document, 'selectstart', _this);
|
|
40984
|
+
moved = true;
|
|
40985
|
+
window.getSelection().removeAllRanges();
|
|
40986
|
+
if (Safari) {
|
|
40987
|
+
css(document.body, 'user-select', 'none');
|
|
40988
|
+
}
|
|
40989
|
+
},
|
|
40990
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
40991
|
+
_onDragOver: function _onDragOver( /**Event*/evt) {
|
|
40992
|
+
var el = this.el,
|
|
40993
|
+
target = evt.target,
|
|
40994
|
+
dragRect,
|
|
40995
|
+
targetRect,
|
|
40996
|
+
revert,
|
|
40997
|
+
options = this.options,
|
|
40998
|
+
group = options.group,
|
|
40999
|
+
activeSortable = Sortable.active,
|
|
41000
|
+
isOwner = activeGroup === group,
|
|
41001
|
+
canSort = options.sort,
|
|
41002
|
+
fromSortable = putSortable || activeSortable,
|
|
41003
|
+
vertical,
|
|
41004
|
+
_this = this,
|
|
41005
|
+
completedFired = false;
|
|
41006
|
+
if (_silent) return;
|
|
41007
|
+
function dragOverEvent(name, extra) {
|
|
41008
|
+
pluginEvent(name, _this, _objectSpread2({
|
|
41009
|
+
evt: evt,
|
|
41010
|
+
isOwner: isOwner,
|
|
41011
|
+
axis: vertical ? 'vertical' : 'horizontal',
|
|
41012
|
+
revert: revert,
|
|
41013
|
+
dragRect: dragRect,
|
|
41014
|
+
targetRect: targetRect,
|
|
41015
|
+
canSort: canSort,
|
|
41016
|
+
fromSortable: fromSortable,
|
|
41017
|
+
target: target,
|
|
41018
|
+
completed: completed,
|
|
41019
|
+
onMove: function onMove(target, after) {
|
|
41020
|
+
return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
|
|
41021
|
+
},
|
|
41022
|
+
changed: changed
|
|
41023
|
+
}, extra));
|
|
41024
|
+
}
|
|
41025
|
+
|
|
41026
|
+
// Capture animation state
|
|
41027
|
+
function capture() {
|
|
41028
|
+
dragOverEvent('dragOverAnimationCapture');
|
|
41029
|
+
_this.captureAnimationState();
|
|
41030
|
+
if (_this !== fromSortable) {
|
|
41031
|
+
fromSortable.captureAnimationState();
|
|
41032
|
+
}
|
|
41033
|
+
}
|
|
41034
|
+
|
|
41035
|
+
// Return invocation when dragEl is inserted (or completed)
|
|
41036
|
+
function completed(insertion) {
|
|
41037
|
+
dragOverEvent('dragOverCompleted', {
|
|
41038
|
+
insertion: insertion
|
|
41039
|
+
});
|
|
41040
|
+
if (insertion) {
|
|
41041
|
+
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
|
41042
|
+
if (isOwner) {
|
|
41043
|
+
activeSortable._hideClone();
|
|
41044
|
+
} else {
|
|
41045
|
+
activeSortable._showClone(_this);
|
|
41046
|
+
}
|
|
41047
|
+
if (_this !== fromSortable) {
|
|
41048
|
+
// Set ghost class to new sortable's ghost class
|
|
41049
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
|
41050
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
41051
|
+
}
|
|
41052
|
+
if (putSortable !== _this && _this !== Sortable.active) {
|
|
41053
|
+
putSortable = _this;
|
|
41054
|
+
} else if (_this === Sortable.active && putSortable) {
|
|
41055
|
+
putSortable = null;
|
|
41056
|
+
}
|
|
41057
|
+
|
|
41058
|
+
// Animation
|
|
41059
|
+
if (fromSortable === _this) {
|
|
41060
|
+
_this._ignoreWhileAnimating = target;
|
|
41061
|
+
}
|
|
41062
|
+
_this.animateAll(function () {
|
|
41063
|
+
dragOverEvent('dragOverAnimationComplete');
|
|
41064
|
+
_this._ignoreWhileAnimating = null;
|
|
41065
|
+
});
|
|
41066
|
+
if (_this !== fromSortable) {
|
|
41067
|
+
fromSortable.animateAll();
|
|
41068
|
+
fromSortable._ignoreWhileAnimating = null;
|
|
41069
|
+
}
|
|
41070
|
+
}
|
|
41071
|
+
|
|
41072
|
+
// Null lastTarget if it is not inside a previously swapped element
|
|
41073
|
+
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
|
41074
|
+
lastTarget = null;
|
|
41075
|
+
}
|
|
41076
|
+
|
|
41077
|
+
// no bubbling and not fallback
|
|
41078
|
+
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
|
41079
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
41080
|
+
|
|
41081
|
+
// Do not detect for empty insert if already inserted
|
|
41082
|
+
!insertion && nearestEmptyInsertDetectEvent(evt);
|
|
41083
|
+
}
|
|
41084
|
+
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
|
41085
|
+
return completedFired = true;
|
|
41086
|
+
}
|
|
41087
|
+
|
|
41088
|
+
// Call when dragEl has been inserted
|
|
41089
|
+
function changed() {
|
|
41090
|
+
newIndex = index(dragEl);
|
|
41091
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41092
|
+
_dispatchEvent({
|
|
41093
|
+
sortable: _this,
|
|
41094
|
+
name: 'change',
|
|
41095
|
+
toEl: el,
|
|
41096
|
+
newIndex: newIndex,
|
|
41097
|
+
newDraggableIndex: newDraggableIndex,
|
|
41098
|
+
originalEvent: evt
|
|
41099
|
+
});
|
|
41100
|
+
}
|
|
41101
|
+
if (evt.preventDefault !== void 0) {
|
|
41102
|
+
evt.cancelable && evt.preventDefault();
|
|
41103
|
+
}
|
|
41104
|
+
target = closest(target, options.draggable, el, true);
|
|
41105
|
+
dragOverEvent('dragOver');
|
|
41106
|
+
if (Sortable.eventCanceled) return completedFired;
|
|
41107
|
+
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
|
41108
|
+
return completed(false);
|
|
41109
|
+
}
|
|
41110
|
+
ignoreNextClick = false;
|
|
41111
|
+
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
|
|
41112
|
+
: putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
|
41113
|
+
vertical = this._getDirection(evt, target) === 'vertical';
|
|
41114
|
+
dragRect = getRect(dragEl);
|
|
41115
|
+
dragOverEvent('dragOverValid');
|
|
41116
|
+
if (Sortable.eventCanceled) return completedFired;
|
|
41117
|
+
if (revert) {
|
|
41118
|
+
parentEl = rootEl; // actualization
|
|
41119
|
+
capture();
|
|
41120
|
+
this._hideClone();
|
|
41121
|
+
dragOverEvent('revert');
|
|
41122
|
+
if (!Sortable.eventCanceled) {
|
|
41123
|
+
if (nextEl) {
|
|
41124
|
+
rootEl.insertBefore(dragEl, nextEl);
|
|
41125
|
+
} else {
|
|
41126
|
+
rootEl.appendChild(dragEl);
|
|
41127
|
+
}
|
|
41128
|
+
}
|
|
41129
|
+
return completed(true);
|
|
41130
|
+
}
|
|
41131
|
+
var elLastChild = lastChild(el, options.draggable);
|
|
41132
|
+
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
|
41133
|
+
// Insert to end of list
|
|
41134
|
+
|
|
41135
|
+
// If already at end of list: Do not insert
|
|
41136
|
+
if (elLastChild === dragEl) {
|
|
41137
|
+
return completed(false);
|
|
41138
|
+
}
|
|
41139
|
+
|
|
41140
|
+
// if there is a last element, it is the target
|
|
41141
|
+
if (elLastChild && el === evt.target) {
|
|
41142
|
+
target = elLastChild;
|
|
41143
|
+
}
|
|
41144
|
+
if (target) {
|
|
41145
|
+
targetRect = getRect(target);
|
|
41146
|
+
}
|
|
41147
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
|
41148
|
+
capture();
|
|
41149
|
+
if (elLastChild && elLastChild.nextSibling) {
|
|
41150
|
+
// the last draggable element is not the last node
|
|
41151
|
+
el.insertBefore(dragEl, elLastChild.nextSibling);
|
|
41152
|
+
} else {
|
|
41153
|
+
el.appendChild(dragEl);
|
|
41154
|
+
}
|
|
41155
|
+
parentEl = el; // actualization
|
|
41156
|
+
|
|
41157
|
+
changed();
|
|
41158
|
+
return completed(true);
|
|
41159
|
+
}
|
|
41160
|
+
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
|
41161
|
+
// Insert to start of list
|
|
41162
|
+
var firstChild = getChild(el, 0, options, true);
|
|
41163
|
+
if (firstChild === dragEl) {
|
|
41164
|
+
return completed(false);
|
|
41165
|
+
}
|
|
41166
|
+
target = firstChild;
|
|
41167
|
+
targetRect = getRect(target);
|
|
41168
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
|
41169
|
+
capture();
|
|
41170
|
+
el.insertBefore(dragEl, firstChild);
|
|
41171
|
+
parentEl = el; // actualization
|
|
41172
|
+
|
|
41173
|
+
changed();
|
|
41174
|
+
return completed(true);
|
|
41175
|
+
}
|
|
41176
|
+
} else if (target.parentNode === el) {
|
|
41177
|
+
targetRect = getRect(target);
|
|
41178
|
+
var direction = 0,
|
|
41179
|
+
targetBeforeFirstSwap,
|
|
41180
|
+
differentLevel = dragEl.parentNode !== el,
|
|
41181
|
+
differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
|
|
41182
|
+
side1 = vertical ? 'top' : 'left',
|
|
41183
|
+
scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
|
|
41184
|
+
scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
|
41185
|
+
if (lastTarget !== target) {
|
|
41186
|
+
targetBeforeFirstSwap = targetRect[side1];
|
|
41187
|
+
pastFirstInvertThresh = false;
|
|
41188
|
+
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
|
41189
|
+
}
|
|
41190
|
+
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
|
41191
|
+
var sibling;
|
|
41192
|
+
if (direction !== 0) {
|
|
41193
|
+
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
|
41194
|
+
var dragIndex = index(dragEl);
|
|
41195
|
+
do {
|
|
41196
|
+
dragIndex -= direction;
|
|
41197
|
+
sibling = parentEl.children[dragIndex];
|
|
41198
|
+
} while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
|
|
41199
|
+
}
|
|
41200
|
+
// If dragEl is already beside target: Do not insert
|
|
41201
|
+
if (direction === 0 || sibling === target) {
|
|
41202
|
+
return completed(false);
|
|
41203
|
+
}
|
|
41204
|
+
lastTarget = target;
|
|
41205
|
+
lastDirection = direction;
|
|
41206
|
+
var nextSibling = target.nextElementSibling,
|
|
41207
|
+
after = false;
|
|
41208
|
+
after = direction === 1;
|
|
41209
|
+
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
|
41210
|
+
if (moveVector !== false) {
|
|
41211
|
+
if (moveVector === 1 || moveVector === -1) {
|
|
41212
|
+
after = moveVector === 1;
|
|
41213
|
+
}
|
|
41214
|
+
_silent = true;
|
|
41215
|
+
setTimeout(_unsilent, 30);
|
|
41216
|
+
capture();
|
|
41217
|
+
if (after && !nextSibling) {
|
|
41218
|
+
el.appendChild(dragEl);
|
|
41219
|
+
} else {
|
|
41220
|
+
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
|
41221
|
+
}
|
|
41222
|
+
|
|
41223
|
+
// Undo chrome's scroll adjustment (has no effect on other browsers)
|
|
41224
|
+
if (scrolledPastTop) {
|
|
41225
|
+
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
|
41226
|
+
}
|
|
41227
|
+
parentEl = dragEl.parentNode; // actualization
|
|
41228
|
+
|
|
41229
|
+
// must be done before animation
|
|
41230
|
+
if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
|
|
41231
|
+
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
|
|
41232
|
+
}
|
|
41233
|
+
changed();
|
|
41234
|
+
return completed(true);
|
|
41235
|
+
}
|
|
41236
|
+
}
|
|
41237
|
+
if (el.contains(dragEl)) {
|
|
41238
|
+
return completed(false);
|
|
41239
|
+
}
|
|
41240
|
+
}
|
|
41241
|
+
return false;
|
|
41242
|
+
},
|
|
41243
|
+
_ignoreWhileAnimating: null,
|
|
41244
|
+
_offMoveEvents: function _offMoveEvents() {
|
|
41245
|
+
off(document, 'mousemove', this._onTouchMove);
|
|
41246
|
+
off(document, 'touchmove', this._onTouchMove);
|
|
41247
|
+
off(document, 'pointermove', this._onTouchMove);
|
|
41248
|
+
off(document, 'dragover', nearestEmptyInsertDetectEvent);
|
|
41249
|
+
off(document, 'mousemove', nearestEmptyInsertDetectEvent);
|
|
41250
|
+
off(document, 'touchmove', nearestEmptyInsertDetectEvent);
|
|
41251
|
+
},
|
|
41252
|
+
_offUpEvents: function _offUpEvents() {
|
|
41253
|
+
var ownerDocument = this.el.ownerDocument;
|
|
41254
|
+
off(ownerDocument, 'mouseup', this._onDrop);
|
|
41255
|
+
off(ownerDocument, 'touchend', this._onDrop);
|
|
41256
|
+
off(ownerDocument, 'pointerup', this._onDrop);
|
|
41257
|
+
off(ownerDocument, 'pointercancel', this._onDrop);
|
|
41258
|
+
off(ownerDocument, 'touchcancel', this._onDrop);
|
|
41259
|
+
off(document, 'selectstart', this);
|
|
41260
|
+
},
|
|
41261
|
+
_onDrop: function _onDrop( /**Event*/evt) {
|
|
41262
|
+
var el = this.el,
|
|
41263
|
+
options = this.options;
|
|
41264
|
+
|
|
41265
|
+
// Get the index of the dragged element within its parent
|
|
41266
|
+
newIndex = index(dragEl);
|
|
41267
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41268
|
+
pluginEvent('drop', this, {
|
|
41269
|
+
evt: evt
|
|
41270
|
+
});
|
|
41271
|
+
parentEl = dragEl && dragEl.parentNode;
|
|
41272
|
+
|
|
41273
|
+
// Get again after plugin event
|
|
41274
|
+
newIndex = index(dragEl);
|
|
41275
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41276
|
+
if (Sortable.eventCanceled) {
|
|
41277
|
+
this._nulling();
|
|
41278
|
+
return;
|
|
41279
|
+
}
|
|
41280
|
+
awaitingDragStarted = false;
|
|
41281
|
+
isCircumstantialInvert = false;
|
|
41282
|
+
pastFirstInvertThresh = false;
|
|
41283
|
+
clearInterval(this._loopId);
|
|
41284
|
+
clearTimeout(this._dragStartTimer);
|
|
41285
|
+
_cancelNextTick(this.cloneId);
|
|
41286
|
+
_cancelNextTick(this._dragStartId);
|
|
41287
|
+
|
|
41288
|
+
// Unbind events
|
|
41289
|
+
if (this.nativeDraggable) {
|
|
41290
|
+
off(document, 'drop', this);
|
|
41291
|
+
off(el, 'dragstart', this._onDragStart);
|
|
41292
|
+
}
|
|
41293
|
+
this._offMoveEvents();
|
|
41294
|
+
this._offUpEvents();
|
|
41295
|
+
if (Safari) {
|
|
41296
|
+
css(document.body, 'user-select', '');
|
|
41297
|
+
}
|
|
41298
|
+
css(dragEl, 'transform', '');
|
|
41299
|
+
if (evt) {
|
|
41300
|
+
if (moved) {
|
|
41301
|
+
evt.cancelable && evt.preventDefault();
|
|
41302
|
+
!options.dropBubble && evt.stopPropagation();
|
|
41303
|
+
}
|
|
41304
|
+
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
|
41305
|
+
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
|
|
41306
|
+
// Remove clone(s)
|
|
41307
|
+
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
|
41308
|
+
}
|
|
41309
|
+
if (dragEl) {
|
|
41310
|
+
if (this.nativeDraggable) {
|
|
41311
|
+
off(dragEl, 'dragend', this);
|
|
41312
|
+
}
|
|
41313
|
+
_disableDraggable(dragEl);
|
|
41314
|
+
dragEl.style['will-change'] = '';
|
|
41315
|
+
|
|
41316
|
+
// Remove classes
|
|
41317
|
+
// ghostClass is added in dragStarted
|
|
41318
|
+
if (moved && !awaitingDragStarted) {
|
|
41319
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
|
41320
|
+
}
|
|
41321
|
+
toggleClass(dragEl, this.options.chosenClass, false);
|
|
41322
|
+
|
|
41323
|
+
// Drag stop event
|
|
41324
|
+
_dispatchEvent({
|
|
41325
|
+
sortable: this,
|
|
41326
|
+
name: 'unchoose',
|
|
41327
|
+
toEl: parentEl,
|
|
41328
|
+
newIndex: null,
|
|
41329
|
+
newDraggableIndex: null,
|
|
41330
|
+
originalEvent: evt
|
|
41331
|
+
});
|
|
41332
|
+
if (rootEl !== parentEl) {
|
|
41333
|
+
if (newIndex >= 0) {
|
|
41334
|
+
// Add event
|
|
41335
|
+
_dispatchEvent({
|
|
41336
|
+
rootEl: parentEl,
|
|
41337
|
+
name: 'add',
|
|
41338
|
+
toEl: parentEl,
|
|
41339
|
+
fromEl: rootEl,
|
|
41340
|
+
originalEvent: evt
|
|
41341
|
+
});
|
|
41342
|
+
|
|
41343
|
+
// Remove event
|
|
41344
|
+
_dispatchEvent({
|
|
41345
|
+
sortable: this,
|
|
41346
|
+
name: 'remove',
|
|
41347
|
+
toEl: parentEl,
|
|
41348
|
+
originalEvent: evt
|
|
41349
|
+
});
|
|
41350
|
+
|
|
41351
|
+
// drag from one list and drop into another
|
|
41352
|
+
_dispatchEvent({
|
|
41353
|
+
rootEl: parentEl,
|
|
41354
|
+
name: 'sort',
|
|
41355
|
+
toEl: parentEl,
|
|
41356
|
+
fromEl: rootEl,
|
|
41357
|
+
originalEvent: evt
|
|
41358
|
+
});
|
|
41359
|
+
_dispatchEvent({
|
|
41360
|
+
sortable: this,
|
|
41361
|
+
name: 'sort',
|
|
41362
|
+
toEl: parentEl,
|
|
41363
|
+
originalEvent: evt
|
|
41364
|
+
});
|
|
41365
|
+
}
|
|
41366
|
+
putSortable && putSortable.save();
|
|
41367
|
+
} else {
|
|
41368
|
+
if (newIndex !== oldIndex) {
|
|
41369
|
+
if (newIndex >= 0) {
|
|
41370
|
+
// drag & drop within the same list
|
|
41371
|
+
_dispatchEvent({
|
|
41372
|
+
sortable: this,
|
|
41373
|
+
name: 'update',
|
|
41374
|
+
toEl: parentEl,
|
|
41375
|
+
originalEvent: evt
|
|
41376
|
+
});
|
|
41377
|
+
_dispatchEvent({
|
|
41378
|
+
sortable: this,
|
|
41379
|
+
name: 'sort',
|
|
41380
|
+
toEl: parentEl,
|
|
41381
|
+
originalEvent: evt
|
|
41382
|
+
});
|
|
41383
|
+
}
|
|
41384
|
+
}
|
|
41385
|
+
}
|
|
41386
|
+
if (Sortable.active) {
|
|
41387
|
+
/* jshint eqnull:true */
|
|
41388
|
+
if (newIndex == null || newIndex === -1) {
|
|
41389
|
+
newIndex = oldIndex;
|
|
41390
|
+
newDraggableIndex = oldDraggableIndex;
|
|
41391
|
+
}
|
|
41392
|
+
_dispatchEvent({
|
|
41393
|
+
sortable: this,
|
|
41394
|
+
name: 'end',
|
|
41395
|
+
toEl: parentEl,
|
|
41396
|
+
originalEvent: evt
|
|
41397
|
+
});
|
|
41398
|
+
|
|
41399
|
+
// Save sorting
|
|
41400
|
+
this.save();
|
|
41401
|
+
}
|
|
41402
|
+
}
|
|
41403
|
+
}
|
|
41404
|
+
this._nulling();
|
|
41405
|
+
},
|
|
41406
|
+
_nulling: function _nulling() {
|
|
41407
|
+
pluginEvent('nulling', this);
|
|
41408
|
+
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;
|
|
41409
|
+
savedInputChecked.forEach(function (el) {
|
|
41410
|
+
el.checked = true;
|
|
41411
|
+
});
|
|
41412
|
+
savedInputChecked.length = lastDx = lastDy = 0;
|
|
41413
|
+
},
|
|
41414
|
+
handleEvent: function handleEvent( /**Event*/evt) {
|
|
41415
|
+
switch (evt.type) {
|
|
41416
|
+
case 'drop':
|
|
41417
|
+
case 'dragend':
|
|
41418
|
+
this._onDrop(evt);
|
|
41419
|
+
break;
|
|
41420
|
+
case 'dragenter':
|
|
41421
|
+
case 'dragover':
|
|
41422
|
+
if (dragEl) {
|
|
41423
|
+
this._onDragOver(evt);
|
|
41424
|
+
_globalDragOver(evt);
|
|
41425
|
+
}
|
|
41426
|
+
break;
|
|
41427
|
+
case 'selectstart':
|
|
41428
|
+
evt.preventDefault();
|
|
41429
|
+
break;
|
|
41430
|
+
}
|
|
41431
|
+
},
|
|
41432
|
+
/**
|
|
41433
|
+
* Serializes the item into an array of string.
|
|
41434
|
+
* @returns {String[]}
|
|
41435
|
+
*/
|
|
41436
|
+
toArray: function toArray() {
|
|
41437
|
+
var order = [],
|
|
41438
|
+
el,
|
|
41439
|
+
children = this.el.children,
|
|
41440
|
+
i = 0,
|
|
41441
|
+
n = children.length,
|
|
41442
|
+
options = this.options;
|
|
41443
|
+
for (; i < n; i++) {
|
|
41444
|
+
el = children[i];
|
|
41445
|
+
if (closest(el, options.draggable, this.el, false)) {
|
|
41446
|
+
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
|
41447
|
+
}
|
|
41448
|
+
}
|
|
41449
|
+
return order;
|
|
41450
|
+
},
|
|
41451
|
+
/**
|
|
41452
|
+
* Sorts the elements according to the array.
|
|
41453
|
+
* @param {String[]} order order of the items
|
|
41454
|
+
*/
|
|
41455
|
+
sort: function sort(order, useAnimation) {
|
|
41456
|
+
var items = {},
|
|
41457
|
+
rootEl = this.el;
|
|
41458
|
+
this.toArray().forEach(function (id, i) {
|
|
41459
|
+
var el = rootEl.children[i];
|
|
41460
|
+
if (closest(el, this.options.draggable, rootEl, false)) {
|
|
41461
|
+
items[id] = el;
|
|
41462
|
+
}
|
|
41463
|
+
}, this);
|
|
41464
|
+
useAnimation && this.captureAnimationState();
|
|
41465
|
+
order.forEach(function (id) {
|
|
41466
|
+
if (items[id]) {
|
|
41467
|
+
rootEl.removeChild(items[id]);
|
|
41468
|
+
rootEl.appendChild(items[id]);
|
|
41469
|
+
}
|
|
41470
|
+
});
|
|
41471
|
+
useAnimation && this.animateAll();
|
|
41472
|
+
},
|
|
41473
|
+
/**
|
|
41474
|
+
* Save the current sorting
|
|
41475
|
+
*/
|
|
41476
|
+
save: function save() {
|
|
41477
|
+
var store = this.options.store;
|
|
41478
|
+
store && store.set && store.set(this);
|
|
41479
|
+
},
|
|
41480
|
+
/**
|
|
41481
|
+
* 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.
|
|
41482
|
+
* @param {HTMLElement} el
|
|
41483
|
+
* @param {String} [selector] default: `options.draggable`
|
|
41484
|
+
* @returns {HTMLElement|null}
|
|
41485
|
+
*/
|
|
41486
|
+
closest: function closest$1(el, selector) {
|
|
41487
|
+
return closest(el, selector || this.options.draggable, this.el, false);
|
|
41488
|
+
},
|
|
41489
|
+
/**
|
|
41490
|
+
* Set/get option
|
|
41491
|
+
* @param {string} name
|
|
41492
|
+
* @param {*} [value]
|
|
41493
|
+
* @returns {*}
|
|
41494
|
+
*/
|
|
41495
|
+
option: function option(name, value) {
|
|
41496
|
+
var options = this.options;
|
|
41497
|
+
if (value === void 0) {
|
|
41498
|
+
return options[name];
|
|
41499
|
+
} else {
|
|
41500
|
+
var modifiedValue = PluginManager.modifyOption(this, name, value);
|
|
41501
|
+
if (typeof modifiedValue !== 'undefined') {
|
|
41502
|
+
options[name] = modifiedValue;
|
|
41503
|
+
} else {
|
|
41504
|
+
options[name] = value;
|
|
41505
|
+
}
|
|
41506
|
+
if (name === 'group') {
|
|
41507
|
+
_prepareGroup(options);
|
|
41508
|
+
}
|
|
41509
|
+
}
|
|
41510
|
+
},
|
|
41511
|
+
/**
|
|
41512
|
+
* Destroy
|
|
41513
|
+
*/
|
|
41514
|
+
destroy: function destroy() {
|
|
41515
|
+
pluginEvent('destroy', this);
|
|
41516
|
+
var el = this.el;
|
|
41517
|
+
el[expando] = null;
|
|
41518
|
+
off(el, 'mousedown', this._onTapStart);
|
|
41519
|
+
off(el, 'touchstart', this._onTapStart);
|
|
41520
|
+
off(el, 'pointerdown', this._onTapStart);
|
|
41521
|
+
if (this.nativeDraggable) {
|
|
41522
|
+
off(el, 'dragover', this);
|
|
41523
|
+
off(el, 'dragenter', this);
|
|
41524
|
+
}
|
|
41525
|
+
// Remove draggable attributes
|
|
41526
|
+
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
|
41527
|
+
el.removeAttribute('draggable');
|
|
41528
|
+
});
|
|
41529
|
+
this._onDrop();
|
|
41530
|
+
this._disableDelayedDragEvents();
|
|
41531
|
+
sortables.splice(sortables.indexOf(this.el), 1);
|
|
41532
|
+
this.el = el = null;
|
|
41533
|
+
},
|
|
41534
|
+
_hideClone: function _hideClone() {
|
|
41535
|
+
if (!cloneHidden) {
|
|
41536
|
+
pluginEvent('hideClone', this);
|
|
41537
|
+
if (Sortable.eventCanceled) return;
|
|
41538
|
+
css(cloneEl, 'display', 'none');
|
|
41539
|
+
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
|
41540
|
+
cloneEl.parentNode.removeChild(cloneEl);
|
|
41541
|
+
}
|
|
41542
|
+
cloneHidden = true;
|
|
41543
|
+
}
|
|
41544
|
+
},
|
|
41545
|
+
_showClone: function _showClone(putSortable) {
|
|
41546
|
+
if (putSortable.lastPutMode !== 'clone') {
|
|
41547
|
+
this._hideClone();
|
|
41548
|
+
return;
|
|
41549
|
+
}
|
|
41550
|
+
if (cloneHidden) {
|
|
41551
|
+
pluginEvent('showClone', this);
|
|
41552
|
+
if (Sortable.eventCanceled) return;
|
|
41553
|
+
|
|
41554
|
+
// show clone at dragEl or original position
|
|
41555
|
+
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
|
41556
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
41557
|
+
} else if (nextEl) {
|
|
41558
|
+
rootEl.insertBefore(cloneEl, nextEl);
|
|
41559
|
+
} else {
|
|
41560
|
+
rootEl.appendChild(cloneEl);
|
|
41561
|
+
}
|
|
41562
|
+
if (this.options.group.revertClone) {
|
|
41563
|
+
this.animate(dragEl, cloneEl);
|
|
41564
|
+
}
|
|
41565
|
+
css(cloneEl, 'display', '');
|
|
41566
|
+
cloneHidden = false;
|
|
41567
|
+
}
|
|
41568
|
+
}
|
|
41569
|
+
};
|
|
41570
|
+
function _globalDragOver( /**Event*/evt) {
|
|
41571
|
+
if (evt.dataTransfer) {
|
|
41572
|
+
evt.dataTransfer.dropEffect = 'move';
|
|
41573
|
+
}
|
|
41574
|
+
evt.cancelable && evt.preventDefault();
|
|
41575
|
+
}
|
|
41576
|
+
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
|
41577
|
+
var evt,
|
|
41578
|
+
sortable = fromEl[expando],
|
|
41579
|
+
onMoveFn = sortable.options.onMove,
|
|
41580
|
+
retVal;
|
|
41581
|
+
// Support for new CustomEvent feature
|
|
41582
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
41583
|
+
evt = new CustomEvent('move', {
|
|
41584
|
+
bubbles: true,
|
|
41585
|
+
cancelable: true
|
|
41586
|
+
});
|
|
41587
|
+
} else {
|
|
41588
|
+
evt = document.createEvent('Event');
|
|
41589
|
+
evt.initEvent('move', true, true);
|
|
41590
|
+
}
|
|
41591
|
+
evt.to = toEl;
|
|
41592
|
+
evt.from = fromEl;
|
|
41593
|
+
evt.dragged = dragEl;
|
|
41594
|
+
evt.draggedRect = dragRect;
|
|
41595
|
+
evt.related = targetEl || toEl;
|
|
41596
|
+
evt.relatedRect = targetRect || getRect(toEl);
|
|
41597
|
+
evt.willInsertAfter = willInsertAfter;
|
|
41598
|
+
evt.originalEvent = originalEvent;
|
|
41599
|
+
fromEl.dispatchEvent(evt);
|
|
41600
|
+
if (onMoveFn) {
|
|
41601
|
+
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
|
41602
|
+
}
|
|
41603
|
+
return retVal;
|
|
41604
|
+
}
|
|
41605
|
+
function _disableDraggable(el) {
|
|
41606
|
+
el.draggable = false;
|
|
41607
|
+
}
|
|
41608
|
+
function _unsilent() {
|
|
41609
|
+
_silent = false;
|
|
41610
|
+
}
|
|
41611
|
+
function _ghostIsFirst(evt, vertical, sortable) {
|
|
41612
|
+
var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
|
|
41613
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
41614
|
+
var spacer = 10;
|
|
41615
|
+
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;
|
|
41616
|
+
}
|
|
41617
|
+
function _ghostIsLast(evt, vertical, sortable) {
|
|
41618
|
+
var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
|
|
41619
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
41620
|
+
var spacer = 10;
|
|
41621
|
+
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;
|
|
41622
|
+
}
|
|
41623
|
+
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
|
41624
|
+
var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
|
|
41625
|
+
targetLength = vertical ? targetRect.height : targetRect.width,
|
|
41626
|
+
targetS1 = vertical ? targetRect.top : targetRect.left,
|
|
41627
|
+
targetS2 = vertical ? targetRect.bottom : targetRect.right,
|
|
41628
|
+
invert = false;
|
|
41629
|
+
if (!invertSwap) {
|
|
41630
|
+
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
|
41631
|
+
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
|
41632
|
+
// multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
|
|
41633
|
+
// check if past first invert threshold on side opposite of lastDirection
|
|
41634
|
+
if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
|
|
41635
|
+
// past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
|
41636
|
+
pastFirstInvertThresh = true;
|
|
41637
|
+
}
|
|
41638
|
+
if (!pastFirstInvertThresh) {
|
|
41639
|
+
// dragEl shadow (target move distance shadow)
|
|
41640
|
+
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
|
|
41641
|
+
: mouseOnAxis > targetS2 - targetMoveDistance) {
|
|
41642
|
+
return -lastDirection;
|
|
41643
|
+
}
|
|
41644
|
+
} else {
|
|
41645
|
+
invert = true;
|
|
41646
|
+
}
|
|
41647
|
+
} else {
|
|
41648
|
+
// Regular
|
|
41649
|
+
if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
|
|
41650
|
+
return _getInsertDirection(target);
|
|
41651
|
+
}
|
|
41652
|
+
}
|
|
41653
|
+
}
|
|
41654
|
+
invert = invert || invertSwap;
|
|
41655
|
+
if (invert) {
|
|
41656
|
+
// Invert of regular
|
|
41657
|
+
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
|
41658
|
+
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
|
41659
|
+
}
|
|
39422
41660
|
}
|
|
41661
|
+
return 0;
|
|
39423
41662
|
}
|
|
39424
41663
|
|
|
41664
|
+
/**
|
|
41665
|
+
* Gets the direction dragEl must be swapped relative to target in order to make it
|
|
41666
|
+
* seem that dragEl has been "inserted" into that element's position
|
|
41667
|
+
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
|
41668
|
+
* @return {Number} Direction dragEl must be swapped
|
|
41669
|
+
*/
|
|
41670
|
+
function _getInsertDirection(target) {
|
|
41671
|
+
if (index(dragEl) < index(target)) {
|
|
41672
|
+
return 1;
|
|
41673
|
+
} else {
|
|
41674
|
+
return -1;
|
|
41675
|
+
}
|
|
41676
|
+
}
|
|
41677
|
+
|
|
41678
|
+
/**
|
|
41679
|
+
* Generate id
|
|
41680
|
+
* @param {HTMLElement} el
|
|
41681
|
+
* @returns {String}
|
|
41682
|
+
* @private
|
|
41683
|
+
*/
|
|
41684
|
+
function _generateId(el) {
|
|
41685
|
+
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
|
41686
|
+
i = str.length,
|
|
41687
|
+
sum = 0;
|
|
41688
|
+
while (i--) {
|
|
41689
|
+
sum += str.charCodeAt(i);
|
|
41690
|
+
}
|
|
41691
|
+
return sum.toString(36);
|
|
41692
|
+
}
|
|
41693
|
+
function _saveInputCheckedState(root) {
|
|
41694
|
+
savedInputChecked.length = 0;
|
|
41695
|
+
var inputs = root.getElementsByTagName('input');
|
|
41696
|
+
var idx = inputs.length;
|
|
41697
|
+
while (idx--) {
|
|
41698
|
+
var el = inputs[idx];
|
|
41699
|
+
el.checked && savedInputChecked.push(el);
|
|
41700
|
+
}
|
|
41701
|
+
}
|
|
41702
|
+
function _nextTick(fn) {
|
|
41703
|
+
return setTimeout(fn, 0);
|
|
41704
|
+
}
|
|
41705
|
+
function _cancelNextTick(id) {
|
|
41706
|
+
return clearTimeout(id);
|
|
41707
|
+
}
|
|
41708
|
+
|
|
41709
|
+
// Fixed #973:
|
|
41710
|
+
if (documentExists) {
|
|
41711
|
+
on(document, 'touchmove', function (evt) {
|
|
41712
|
+
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
|
41713
|
+
evt.preventDefault();
|
|
41714
|
+
}
|
|
41715
|
+
});
|
|
41716
|
+
}
|
|
41717
|
+
|
|
41718
|
+
// Export utils
|
|
41719
|
+
Sortable.utils = {
|
|
41720
|
+
on: on,
|
|
41721
|
+
off: off,
|
|
41722
|
+
css: css,
|
|
41723
|
+
find: find,
|
|
41724
|
+
is: function is(el, selector) {
|
|
41725
|
+
return !!closest(el, selector, el, false);
|
|
41726
|
+
},
|
|
41727
|
+
extend: extend,
|
|
41728
|
+
throttle: throttle,
|
|
41729
|
+
closest: closest,
|
|
41730
|
+
toggleClass: toggleClass,
|
|
41731
|
+
clone: clone,
|
|
41732
|
+
index: index,
|
|
41733
|
+
nextTick: _nextTick,
|
|
41734
|
+
cancelNextTick: _cancelNextTick,
|
|
41735
|
+
detectDirection: _detectDirection,
|
|
41736
|
+
getChild: getChild,
|
|
41737
|
+
expando: expando
|
|
41738
|
+
};
|
|
41739
|
+
|
|
41740
|
+
/**
|
|
41741
|
+
* Get the Sortable instance of an element
|
|
41742
|
+
* @param {HTMLElement} element The element
|
|
41743
|
+
* @return {Sortable|undefined} The instance of Sortable
|
|
41744
|
+
*/
|
|
41745
|
+
Sortable.get = function (element) {
|
|
41746
|
+
return element[expando];
|
|
41747
|
+
};
|
|
41748
|
+
|
|
41749
|
+
/**
|
|
41750
|
+
* Mount a plugin to Sortable
|
|
41751
|
+
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
|
41752
|
+
*/
|
|
41753
|
+
Sortable.mount = function () {
|
|
41754
|
+
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41755
|
+
plugins[_key] = arguments[_key];
|
|
41756
|
+
}
|
|
41757
|
+
if (plugins[0].constructor === Array) plugins = plugins[0];
|
|
41758
|
+
plugins.forEach(function (plugin) {
|
|
41759
|
+
if (!plugin.prototype || !plugin.prototype.constructor) {
|
|
41760
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
|
41761
|
+
}
|
|
41762
|
+
if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
|
|
41763
|
+
PluginManager.mount(plugin);
|
|
41764
|
+
});
|
|
41765
|
+
};
|
|
41766
|
+
|
|
41767
|
+
/**
|
|
41768
|
+
* Create sortable instance
|
|
41769
|
+
* @param {HTMLElement} el
|
|
41770
|
+
* @param {Object} [options]
|
|
41771
|
+
*/
|
|
41772
|
+
Sortable.create = function (el, options) {
|
|
41773
|
+
return new Sortable(el, options);
|
|
41774
|
+
};
|
|
41775
|
+
|
|
41776
|
+
// Export
|
|
41777
|
+
Sortable.version = version;
|
|
41778
|
+
|
|
41779
|
+
var autoScrolls = [],
|
|
41780
|
+
scrollEl,
|
|
41781
|
+
scrollRootEl,
|
|
41782
|
+
scrolling = false,
|
|
41783
|
+
lastAutoScrollX,
|
|
41784
|
+
lastAutoScrollY,
|
|
41785
|
+
touchEvt$1,
|
|
41786
|
+
pointerElemChangedInterval;
|
|
41787
|
+
function AutoScrollPlugin() {
|
|
41788
|
+
function AutoScroll() {
|
|
41789
|
+
this.defaults = {
|
|
41790
|
+
scroll: true,
|
|
41791
|
+
forceAutoScrollFallback: false,
|
|
41792
|
+
scrollSensitivity: 30,
|
|
41793
|
+
scrollSpeed: 10,
|
|
41794
|
+
bubbleScroll: true
|
|
41795
|
+
};
|
|
41796
|
+
|
|
41797
|
+
// Bind all private methods
|
|
41798
|
+
for (var fn in this) {
|
|
41799
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
41800
|
+
this[fn] = this[fn].bind(this);
|
|
41801
|
+
}
|
|
41802
|
+
}
|
|
41803
|
+
}
|
|
41804
|
+
AutoScroll.prototype = {
|
|
41805
|
+
dragStarted: function dragStarted(_ref) {
|
|
41806
|
+
var originalEvent = _ref.originalEvent;
|
|
41807
|
+
if (this.sortable.nativeDraggable) {
|
|
41808
|
+
on(document, 'dragover', this._handleAutoScroll);
|
|
41809
|
+
} else {
|
|
41810
|
+
if (this.options.supportPointer) {
|
|
41811
|
+
on(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
41812
|
+
} else if (originalEvent.touches) {
|
|
41813
|
+
on(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
41814
|
+
} else {
|
|
41815
|
+
on(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
41816
|
+
}
|
|
41817
|
+
}
|
|
41818
|
+
},
|
|
41819
|
+
dragOverCompleted: function dragOverCompleted(_ref2) {
|
|
41820
|
+
var originalEvent = _ref2.originalEvent;
|
|
41821
|
+
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
|
41822
|
+
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
|
41823
|
+
this._handleAutoScroll(originalEvent);
|
|
41824
|
+
}
|
|
41825
|
+
},
|
|
41826
|
+
drop: function drop() {
|
|
41827
|
+
if (this.sortable.nativeDraggable) {
|
|
41828
|
+
off(document, 'dragover', this._handleAutoScroll);
|
|
41829
|
+
} else {
|
|
41830
|
+
off(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
41831
|
+
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
41832
|
+
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
41833
|
+
}
|
|
41834
|
+
clearPointerElemChangedInterval();
|
|
41835
|
+
clearAutoScrolls();
|
|
41836
|
+
cancelThrottle();
|
|
41837
|
+
},
|
|
41838
|
+
nulling: function nulling() {
|
|
41839
|
+
touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
|
|
41840
|
+
autoScrolls.length = 0;
|
|
41841
|
+
},
|
|
41842
|
+
_handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
|
|
41843
|
+
this._handleAutoScroll(evt, true);
|
|
41844
|
+
},
|
|
41845
|
+
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
|
41846
|
+
var _this = this;
|
|
41847
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
41848
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
41849
|
+
elem = document.elementFromPoint(x, y);
|
|
41850
|
+
touchEvt$1 = evt;
|
|
41851
|
+
|
|
41852
|
+
// IE does not seem to have native autoscroll,
|
|
41853
|
+
// Edge's autoscroll seems too conditional,
|
|
41854
|
+
// MACOS Safari does not have autoscroll,
|
|
41855
|
+
// Firefox and Chrome are good
|
|
41856
|
+
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
|
41857
|
+
autoScroll(evt, this.options, elem, fallback);
|
|
41858
|
+
|
|
41859
|
+
// Listener for pointer element change
|
|
41860
|
+
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
|
41861
|
+
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
|
41862
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
|
41863
|
+
// Detect for pointer elem change, emulating native DnD behaviour
|
|
41864
|
+
pointerElemChangedInterval = setInterval(function () {
|
|
41865
|
+
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
|
41866
|
+
if (newElem !== ogElemScroller) {
|
|
41867
|
+
ogElemScroller = newElem;
|
|
41868
|
+
clearAutoScrolls();
|
|
41869
|
+
}
|
|
41870
|
+
autoScroll(evt, _this.options, newElem, fallback);
|
|
41871
|
+
}, 10);
|
|
41872
|
+
lastAutoScrollX = x;
|
|
41873
|
+
lastAutoScrollY = y;
|
|
41874
|
+
}
|
|
41875
|
+
} else {
|
|
41876
|
+
// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
|
|
41877
|
+
if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
|
|
41878
|
+
clearAutoScrolls();
|
|
41879
|
+
return;
|
|
41880
|
+
}
|
|
41881
|
+
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
|
41882
|
+
}
|
|
41883
|
+
}
|
|
41884
|
+
};
|
|
41885
|
+
return _extends(AutoScroll, {
|
|
41886
|
+
pluginName: 'scroll',
|
|
41887
|
+
initializeByDefault: true
|
|
41888
|
+
});
|
|
41889
|
+
}
|
|
41890
|
+
function clearAutoScrolls() {
|
|
41891
|
+
autoScrolls.forEach(function (autoScroll) {
|
|
41892
|
+
clearInterval(autoScroll.pid);
|
|
41893
|
+
});
|
|
41894
|
+
autoScrolls = [];
|
|
41895
|
+
}
|
|
41896
|
+
function clearPointerElemChangedInterval() {
|
|
41897
|
+
clearInterval(pointerElemChangedInterval);
|
|
41898
|
+
}
|
|
41899
|
+
var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
|
41900
|
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
|
41901
|
+
if (!options.scroll) return;
|
|
41902
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
41903
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
41904
|
+
sens = options.scrollSensitivity,
|
|
41905
|
+
speed = options.scrollSpeed,
|
|
41906
|
+
winScroller = getWindowScrollingElement();
|
|
41907
|
+
var scrollThisInstance = false,
|
|
41908
|
+
scrollCustomFn;
|
|
41909
|
+
|
|
41910
|
+
// New scroll root, set scrollEl
|
|
41911
|
+
if (scrollRootEl !== rootEl) {
|
|
41912
|
+
scrollRootEl = rootEl;
|
|
41913
|
+
clearAutoScrolls();
|
|
41914
|
+
scrollEl = options.scroll;
|
|
41915
|
+
scrollCustomFn = options.scrollFn;
|
|
41916
|
+
if (scrollEl === true) {
|
|
41917
|
+
scrollEl = getParentAutoScrollElement(rootEl, true);
|
|
41918
|
+
}
|
|
41919
|
+
}
|
|
41920
|
+
var layersOut = 0;
|
|
41921
|
+
var currentParent = scrollEl;
|
|
41922
|
+
do {
|
|
41923
|
+
var el = currentParent,
|
|
41924
|
+
rect = getRect(el),
|
|
41925
|
+
top = rect.top,
|
|
41926
|
+
bottom = rect.bottom,
|
|
41927
|
+
left = rect.left,
|
|
41928
|
+
right = rect.right,
|
|
41929
|
+
width = rect.width,
|
|
41930
|
+
height = rect.height,
|
|
41931
|
+
canScrollX = void 0,
|
|
41932
|
+
canScrollY = void 0,
|
|
41933
|
+
scrollWidth = el.scrollWidth,
|
|
41934
|
+
scrollHeight = el.scrollHeight,
|
|
41935
|
+
elCSS = css(el),
|
|
41936
|
+
scrollPosX = el.scrollLeft,
|
|
41937
|
+
scrollPosY = el.scrollTop;
|
|
41938
|
+
if (el === winScroller) {
|
|
41939
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
|
41940
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
|
41941
|
+
} else {
|
|
41942
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
|
41943
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
|
41944
|
+
}
|
|
41945
|
+
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
|
41946
|
+
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
|
41947
|
+
if (!autoScrolls[layersOut]) {
|
|
41948
|
+
for (var i = 0; i <= layersOut; i++) {
|
|
41949
|
+
if (!autoScrolls[i]) {
|
|
41950
|
+
autoScrolls[i] = {};
|
|
41951
|
+
}
|
|
41952
|
+
}
|
|
41953
|
+
}
|
|
41954
|
+
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
|
41955
|
+
autoScrolls[layersOut].el = el;
|
|
41956
|
+
autoScrolls[layersOut].vx = vx;
|
|
41957
|
+
autoScrolls[layersOut].vy = vy;
|
|
41958
|
+
clearInterval(autoScrolls[layersOut].pid);
|
|
41959
|
+
if (vx != 0 || vy != 0) {
|
|
41960
|
+
scrollThisInstance = true;
|
|
41961
|
+
/* jshint loopfunc:true */
|
|
41962
|
+
autoScrolls[layersOut].pid = setInterval(function () {
|
|
41963
|
+
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
|
41964
|
+
if (isFallback && this.layer === 0) {
|
|
41965
|
+
Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
|
|
41966
|
+
}
|
|
41967
|
+
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
|
41968
|
+
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
|
41969
|
+
if (typeof scrollCustomFn === 'function') {
|
|
41970
|
+
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
|
|
41971
|
+
return;
|
|
41972
|
+
}
|
|
41973
|
+
}
|
|
41974
|
+
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
41975
|
+
}.bind({
|
|
41976
|
+
layer: layersOut
|
|
41977
|
+
}), 24);
|
|
41978
|
+
}
|
|
41979
|
+
}
|
|
41980
|
+
layersOut++;
|
|
41981
|
+
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
|
41982
|
+
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
|
41983
|
+
}, 30);
|
|
41984
|
+
|
|
41985
|
+
var drop = function drop(_ref) {
|
|
41986
|
+
var originalEvent = _ref.originalEvent,
|
|
41987
|
+
putSortable = _ref.putSortable,
|
|
41988
|
+
dragEl = _ref.dragEl,
|
|
41989
|
+
activeSortable = _ref.activeSortable,
|
|
41990
|
+
dispatchSortableEvent = _ref.dispatchSortableEvent,
|
|
41991
|
+
hideGhostForTarget = _ref.hideGhostForTarget,
|
|
41992
|
+
unhideGhostForTarget = _ref.unhideGhostForTarget;
|
|
41993
|
+
if (!originalEvent) return;
|
|
41994
|
+
var toSortable = putSortable || activeSortable;
|
|
41995
|
+
hideGhostForTarget();
|
|
41996
|
+
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
|
41997
|
+
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
41998
|
+
unhideGhostForTarget();
|
|
41999
|
+
if (toSortable && !toSortable.el.contains(target)) {
|
|
42000
|
+
dispatchSortableEvent('spill');
|
|
42001
|
+
this.onSpill({
|
|
42002
|
+
dragEl: dragEl,
|
|
42003
|
+
putSortable: putSortable
|
|
42004
|
+
});
|
|
42005
|
+
}
|
|
42006
|
+
};
|
|
42007
|
+
function Revert() {}
|
|
42008
|
+
Revert.prototype = {
|
|
42009
|
+
startIndex: null,
|
|
42010
|
+
dragStart: function dragStart(_ref2) {
|
|
42011
|
+
var oldDraggableIndex = _ref2.oldDraggableIndex;
|
|
42012
|
+
this.startIndex = oldDraggableIndex;
|
|
42013
|
+
},
|
|
42014
|
+
onSpill: function onSpill(_ref3) {
|
|
42015
|
+
var dragEl = _ref3.dragEl,
|
|
42016
|
+
putSortable = _ref3.putSortable;
|
|
42017
|
+
this.sortable.captureAnimationState();
|
|
42018
|
+
if (putSortable) {
|
|
42019
|
+
putSortable.captureAnimationState();
|
|
42020
|
+
}
|
|
42021
|
+
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
|
42022
|
+
if (nextSibling) {
|
|
42023
|
+
this.sortable.el.insertBefore(dragEl, nextSibling);
|
|
42024
|
+
} else {
|
|
42025
|
+
this.sortable.el.appendChild(dragEl);
|
|
42026
|
+
}
|
|
42027
|
+
this.sortable.animateAll();
|
|
42028
|
+
if (putSortable) {
|
|
42029
|
+
putSortable.animateAll();
|
|
42030
|
+
}
|
|
42031
|
+
},
|
|
42032
|
+
drop: drop
|
|
42033
|
+
};
|
|
42034
|
+
_extends(Revert, {
|
|
42035
|
+
pluginName: 'revertOnSpill'
|
|
42036
|
+
});
|
|
42037
|
+
function Remove() {}
|
|
42038
|
+
Remove.prototype = {
|
|
42039
|
+
onSpill: function onSpill(_ref4) {
|
|
42040
|
+
var dragEl = _ref4.dragEl,
|
|
42041
|
+
putSortable = _ref4.putSortable;
|
|
42042
|
+
var parentSortable = putSortable || this.sortable;
|
|
42043
|
+
parentSortable.captureAnimationState();
|
|
42044
|
+
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
|
42045
|
+
parentSortable.animateAll();
|
|
42046
|
+
},
|
|
42047
|
+
drop: drop
|
|
42048
|
+
};
|
|
42049
|
+
_extends(Remove, {
|
|
42050
|
+
pluginName: 'removeOnSpill'
|
|
42051
|
+
});
|
|
42052
|
+
|
|
42053
|
+
Sortable.mount(new AutoScrollPlugin());
|
|
42054
|
+
Sortable.mount(Remove, Revert);
|
|
42055
|
+
|
|
42056
|
+
const DRAG_HANDLE_SELECTOR = '[data-drag-handle]';
|
|
42057
|
+
const DRAGGABLE_ITEM_SELECTOR = '.array-item[data-reorderable="true"]';
|
|
42058
|
+
const DEFAULT_CONTAINER_CLASS = 'has-an-item-which-is-being-dragged';
|
|
42059
|
+
const DEFAULT_DROP_ELEVATION_CLASS = 'is-elevated';
|
|
42060
|
+
const DROP_ELEVATION_DURATION = 1000;
|
|
42061
|
+
const TOUCH_DRAG_DELAY_MS = 200; // Adds a short hold on touch (long-press) so scroll gestures do not reorder items.
|
|
39425
42062
|
class ArrayFieldTemplate extends react.Component {
|
|
39426
42063
|
constructor(props) {
|
|
39427
42064
|
super(props);
|
|
39428
|
-
this.
|
|
39429
|
-
this.
|
|
39430
|
-
|
|
42065
|
+
this.itemByIndex = new Map();
|
|
42066
|
+
this.handleAddClick = (event) => {
|
|
42067
|
+
event.stopPropagation();
|
|
42068
|
+
this.props.onAddClick(event);
|
|
42069
|
+
};
|
|
42070
|
+
this.setContainer = (element) => {
|
|
42071
|
+
if (this.container === element) {
|
|
42072
|
+
return;
|
|
42073
|
+
}
|
|
42074
|
+
this.teardownDragController();
|
|
42075
|
+
this.container = element !== null && element !== void 0 ? element : undefined;
|
|
42076
|
+
this.setupDragController();
|
|
42077
|
+
};
|
|
42078
|
+
this.handleSortStart = (event) => {
|
|
42079
|
+
if (!this.canReorderItems()) {
|
|
42080
|
+
return;
|
|
42081
|
+
}
|
|
42082
|
+
this.dragSnapshot = [...this.state.order];
|
|
42083
|
+
this.draggedItemIndex = this.getReorderId(event.item);
|
|
42084
|
+
if (this.container) {
|
|
42085
|
+
this.container.classList.add(DEFAULT_CONTAINER_CLASS);
|
|
42086
|
+
}
|
|
42087
|
+
if (event.item instanceof HTMLElement) {
|
|
42088
|
+
this.applyDropElevation(event.item);
|
|
42089
|
+
}
|
|
42090
|
+
};
|
|
42091
|
+
this.handleSortEnd = (event) => {
|
|
42092
|
+
var _a;
|
|
42093
|
+
if (!this.canReorderItems()) {
|
|
42094
|
+
return;
|
|
42095
|
+
}
|
|
42096
|
+
if (this.container) {
|
|
42097
|
+
this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
|
|
42098
|
+
}
|
|
42099
|
+
const snapshot = this.dragSnapshot;
|
|
42100
|
+
const draggedItemIndex = this.draggedItemIndex;
|
|
42101
|
+
this.dragSnapshot = undefined;
|
|
42102
|
+
this.draggedItemIndex = undefined;
|
|
42103
|
+
if (event.item instanceof HTMLElement) {
|
|
42104
|
+
this.dropElevationTarget = event.item;
|
|
42105
|
+
}
|
|
42106
|
+
const finalOrder = this.readOrderFromDom();
|
|
42107
|
+
if (!this.arraysEqual(this.state.order, finalOrder)) {
|
|
42108
|
+
this.setState({ order: finalOrder });
|
|
42109
|
+
}
|
|
42110
|
+
if (snapshot === undefined ||
|
|
42111
|
+
draggedItemIndex === undefined ||
|
|
42112
|
+
!(event.item instanceof HTMLElement)) {
|
|
42113
|
+
this.scheduleDropElevationRemoval();
|
|
42114
|
+
return;
|
|
42115
|
+
}
|
|
42116
|
+
const fromPosition = snapshot.indexOf(draggedItemIndex);
|
|
42117
|
+
const toPosition = finalOrder.indexOf(draggedItemIndex);
|
|
42118
|
+
if (fromPosition === -1 ||
|
|
42119
|
+
toPosition === -1 ||
|
|
42120
|
+
fromPosition === toPosition) {
|
|
42121
|
+
this.scheduleDropElevationRemoval();
|
|
42122
|
+
return;
|
|
42123
|
+
}
|
|
42124
|
+
const targetItem = ((_a = this.props.items) !== null && _a !== void 0 ? _a : []).find((entry) => {
|
|
42125
|
+
var _a;
|
|
42126
|
+
return ((_a = entry.index) !== null && _a !== void 0 ? _a : -1) === draggedItemIndex;
|
|
42127
|
+
});
|
|
42128
|
+
if (!targetItem || typeof targetItem.onReorderClick !== 'function') {
|
|
42129
|
+
this.scheduleDropElevationRemoval();
|
|
42130
|
+
return;
|
|
42131
|
+
}
|
|
42132
|
+
requestAnimationFrame(() => {
|
|
42133
|
+
const reorder = targetItem.onReorderClick(draggedItemIndex, toPosition);
|
|
42134
|
+
if (typeof reorder === 'function') {
|
|
42135
|
+
reorder();
|
|
42136
|
+
}
|
|
42137
|
+
});
|
|
42138
|
+
this.scheduleDropElevationRemoval();
|
|
42139
|
+
};
|
|
42140
|
+
this.state = {
|
|
42141
|
+
order: this.extractIndices(props.items),
|
|
42142
|
+
};
|
|
42143
|
+
}
|
|
42144
|
+
componentWillUnmount() {
|
|
42145
|
+
this.teardownDragController();
|
|
42146
|
+
}
|
|
42147
|
+
componentDidMount() {
|
|
42148
|
+
this.setupDragController();
|
|
42149
|
+
}
|
|
42150
|
+
componentDidUpdate(previousProps) {
|
|
42151
|
+
if (previousProps.items !== this.props.items) {
|
|
42152
|
+
const nextOrder = this.extractIndices(this.props.items);
|
|
42153
|
+
if (!this.arraysEqual(this.state.order, nextOrder)) {
|
|
42154
|
+
this.setState({
|
|
42155
|
+
order: nextOrder,
|
|
42156
|
+
}, () => {
|
|
42157
|
+
this.setupDragController();
|
|
42158
|
+
});
|
|
42159
|
+
return;
|
|
42160
|
+
}
|
|
42161
|
+
}
|
|
42162
|
+
if (previousProps.items !== this.props.items ||
|
|
42163
|
+
previousProps.schema !== this.props.schema ||
|
|
42164
|
+
previousProps.disabled !== this.props.disabled ||
|
|
42165
|
+
previousProps.readonly !== this.props.readonly) {
|
|
42166
|
+
this.setupDragController();
|
|
42167
|
+
}
|
|
39431
42168
|
}
|
|
39432
42169
|
render() {
|
|
39433
|
-
|
|
42170
|
+
const controls = this.getItemControls();
|
|
42171
|
+
const { ordered: orderedItems, byIndex } = this.getOrderedItems();
|
|
42172
|
+
this.itemByIndex = byIndex;
|
|
42173
|
+
return react.createElement('div', {}, renderTitle(this.props.title), renderDescription(this.props.schema.description), react.createElement('div', {
|
|
42174
|
+
className: 'array-items',
|
|
42175
|
+
ref: this.setContainer,
|
|
42176
|
+
}, orderedItems.map((item, index) => this.renderItem(item, index, controls))), this.renderAddButton());
|
|
39434
42177
|
}
|
|
39435
42178
|
renderAddButton() {
|
|
39436
42179
|
if (!this.props.canAdd) {
|
|
@@ -39443,40 +42186,214 @@ class ArrayFieldTemplate extends react.Component {
|
|
|
39443
42186
|
class: 'button-add-new',
|
|
39444
42187
|
});
|
|
39445
42188
|
}
|
|
39446
|
-
|
|
42189
|
+
getItemControls() {
|
|
42190
|
+
return {
|
|
42191
|
+
allowItemRemoval: this.canRemoveItems(),
|
|
42192
|
+
};
|
|
42193
|
+
}
|
|
42194
|
+
renderItem(item, index, controls) {
|
|
42195
|
+
var _a;
|
|
39447
42196
|
const { schema, formData, formContext } = this.props;
|
|
39448
|
-
const
|
|
42197
|
+
const itemIndex = (_a = item.index) !== null && _a !== void 0 ? _a : index;
|
|
42198
|
+
const allowItemReorder = this.isItemReorderable(item);
|
|
39449
42199
|
if (isObjectType(schema.items)) {
|
|
39450
42200
|
return react.createElement(CollapsibleItemTemplate, {
|
|
39451
42201
|
key: item.key,
|
|
39452
42202
|
item: item,
|
|
39453
|
-
data: formData[
|
|
42203
|
+
data: Array.isArray(formData) ? formData[itemIndex] : undefined,
|
|
39454
42204
|
schema: schema,
|
|
39455
42205
|
formSchema: formContext.schema,
|
|
39456
|
-
index:
|
|
42206
|
+
index: itemIndex,
|
|
39457
42207
|
allowItemRemoval: controls.allowItemRemoval,
|
|
39458
|
-
allowItemReorder:
|
|
42208
|
+
allowItemReorder: allowItemReorder,
|
|
39459
42209
|
});
|
|
39460
42210
|
}
|
|
39461
42211
|
return react.createElement(SimpleItemTemplate, {
|
|
39462
42212
|
key: item.key,
|
|
39463
42213
|
item: item,
|
|
39464
|
-
index:
|
|
42214
|
+
index: itemIndex,
|
|
42215
|
+
dataIndex: itemIndex,
|
|
39465
42216
|
allowItemRemoval: controls.allowItemRemoval,
|
|
39466
|
-
allowItemReorder:
|
|
42217
|
+
allowItemReorder: allowItemReorder,
|
|
39467
42218
|
});
|
|
39468
42219
|
}
|
|
39469
|
-
|
|
39470
|
-
var _a;
|
|
39471
|
-
const
|
|
42220
|
+
getOrderedItems() {
|
|
42221
|
+
var _a, _b;
|
|
42222
|
+
const items = (_a = this.props.items) !== null && _a !== void 0 ? _a : [];
|
|
42223
|
+
const byIndex = new Map();
|
|
42224
|
+
let entryIndex = 0;
|
|
42225
|
+
for (const entry of items) {
|
|
42226
|
+
byIndex.set((_b = entry.index) !== null && _b !== void 0 ? _b : entryIndex, entry);
|
|
42227
|
+
entryIndex += 1;
|
|
42228
|
+
}
|
|
42229
|
+
const ordered = [];
|
|
42230
|
+
const used = new Set();
|
|
42231
|
+
for (const index of this.state.order) {
|
|
42232
|
+
const entry = byIndex.get(index);
|
|
42233
|
+
if (!entry) {
|
|
42234
|
+
continue;
|
|
42235
|
+
}
|
|
42236
|
+
ordered.push(entry);
|
|
42237
|
+
used.add(index);
|
|
42238
|
+
}
|
|
42239
|
+
for (const [index, entry] of byIndex.entries()) {
|
|
42240
|
+
if (!used.has(index)) {
|
|
42241
|
+
ordered.push(entry);
|
|
42242
|
+
}
|
|
42243
|
+
}
|
|
39472
42244
|
return {
|
|
39473
|
-
|
|
39474
|
-
|
|
42245
|
+
ordered,
|
|
42246
|
+
byIndex,
|
|
39475
42247
|
};
|
|
39476
42248
|
}
|
|
39477
|
-
|
|
39478
|
-
|
|
39479
|
-
|
|
42249
|
+
setupDragController() {
|
|
42250
|
+
if (!this.container || !this.canReorderItems()) {
|
|
42251
|
+
this.teardownDragController();
|
|
42252
|
+
return;
|
|
42253
|
+
}
|
|
42254
|
+
const reorderableCount = this.getReorderableOrder().length;
|
|
42255
|
+
if (reorderableCount < 2) {
|
|
42256
|
+
this.teardownDragController();
|
|
42257
|
+
return;
|
|
42258
|
+
}
|
|
42259
|
+
if (this.sortable) {
|
|
42260
|
+
this.sortable.option('handle', DRAG_HANDLE_SELECTOR);
|
|
42261
|
+
this.sortable.option('draggable', DRAGGABLE_ITEM_SELECTOR);
|
|
42262
|
+
this.sortable.option('disabled', false);
|
|
42263
|
+
this.sortable.option('delay', TOUCH_DRAG_DELAY_MS);
|
|
42264
|
+
this.sortable.option('delayOnTouchOnly', true);
|
|
42265
|
+
return;
|
|
42266
|
+
}
|
|
42267
|
+
this.sortable = Sortable.create(this.container, {
|
|
42268
|
+
animation: 150,
|
|
42269
|
+
handle: DRAG_HANDLE_SELECTOR,
|
|
42270
|
+
draggable: DRAGGABLE_ITEM_SELECTOR,
|
|
42271
|
+
delay: TOUCH_DRAG_DELAY_MS,
|
|
42272
|
+
delayOnTouchOnly: true,
|
|
42273
|
+
onStart: this.handleSortStart,
|
|
42274
|
+
onEnd: this.handleSortEnd,
|
|
42275
|
+
});
|
|
42276
|
+
}
|
|
42277
|
+
teardownDragController() {
|
|
42278
|
+
if (this.sortable) {
|
|
42279
|
+
this.sortable.destroy();
|
|
42280
|
+
this.sortable = undefined;
|
|
42281
|
+
}
|
|
42282
|
+
this.clearDropElevationTimer();
|
|
42283
|
+
if (this.dropElevationTarget) {
|
|
42284
|
+
this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42285
|
+
this.dropElevationTarget = undefined;
|
|
42286
|
+
}
|
|
42287
|
+
if (this.container) {
|
|
42288
|
+
this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
|
|
42289
|
+
}
|
|
42290
|
+
this.dragSnapshot = undefined;
|
|
42291
|
+
this.draggedItemIndex = undefined;
|
|
42292
|
+
}
|
|
42293
|
+
canReorderItems() {
|
|
42294
|
+
if (this.props.disabled || this.props.readonly) {
|
|
42295
|
+
return false;
|
|
42296
|
+
}
|
|
42297
|
+
const schema = this.props.schema;
|
|
42298
|
+
const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
|
|
42299
|
+
return limeOptions.allowItemReorder !== false;
|
|
42300
|
+
}
|
|
42301
|
+
canRemoveItems() {
|
|
42302
|
+
const schema = this.props.schema;
|
|
42303
|
+
const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
|
|
42304
|
+
return limeOptions.allowItemRemoval !== false;
|
|
42305
|
+
}
|
|
42306
|
+
isItemReorderable(item) {
|
|
42307
|
+
return (this.canReorderItems() &&
|
|
42308
|
+
Boolean((item === null || item === void 0 ? void 0 : item.hasMoveDown) || (item === null || item === void 0 ? void 0 : item.hasMoveUp)));
|
|
42309
|
+
}
|
|
42310
|
+
isIndexReorderable(index) {
|
|
42311
|
+
const item = this.itemByIndex.get(index);
|
|
42312
|
+
if (!item) {
|
|
42313
|
+
return false;
|
|
42314
|
+
}
|
|
42315
|
+
return this.isItemReorderable(item);
|
|
42316
|
+
}
|
|
42317
|
+
getReorderableOrder(order = this.state.order) {
|
|
42318
|
+
const result = [];
|
|
42319
|
+
for (const index of order) {
|
|
42320
|
+
if (this.isIndexReorderable(index)) {
|
|
42321
|
+
result.push(index);
|
|
42322
|
+
}
|
|
42323
|
+
}
|
|
42324
|
+
return result;
|
|
42325
|
+
}
|
|
42326
|
+
readOrderFromDom() {
|
|
42327
|
+
if (!this.container) {
|
|
42328
|
+
return [];
|
|
42329
|
+
}
|
|
42330
|
+
const items = [...this.container.querySelectorAll('.array-item')];
|
|
42331
|
+
const order = [];
|
|
42332
|
+
for (const element of items) {
|
|
42333
|
+
const index = this.getReorderId(element);
|
|
42334
|
+
if (index !== undefined) {
|
|
42335
|
+
order.push(index);
|
|
42336
|
+
}
|
|
42337
|
+
}
|
|
42338
|
+
return order;
|
|
42339
|
+
}
|
|
42340
|
+
getReorderId(element) {
|
|
42341
|
+
if (!element) {
|
|
42342
|
+
return undefined;
|
|
42343
|
+
}
|
|
42344
|
+
if (!(element instanceof HTMLElement)) {
|
|
42345
|
+
return undefined;
|
|
42346
|
+
}
|
|
42347
|
+
const value = element.dataset.reorderId;
|
|
42348
|
+
if (value === undefined) {
|
|
42349
|
+
return undefined;
|
|
42350
|
+
}
|
|
42351
|
+
const parsed = Number.parseInt(value, 10);
|
|
42352
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
42353
|
+
}
|
|
42354
|
+
applyDropElevation(item) {
|
|
42355
|
+
if (this.dropElevationTarget && this.dropElevationTarget !== item) {
|
|
42356
|
+
this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42357
|
+
}
|
|
42358
|
+
this.clearDropElevationTimer();
|
|
42359
|
+
item.classList.add(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42360
|
+
this.dropElevationTarget = item;
|
|
42361
|
+
}
|
|
42362
|
+
scheduleDropElevationRemoval() {
|
|
42363
|
+
if (!this.dropElevationTarget) {
|
|
42364
|
+
return;
|
|
42365
|
+
}
|
|
42366
|
+
const target = this.dropElevationTarget;
|
|
42367
|
+
this.clearDropElevationTimer();
|
|
42368
|
+
this.dropElevationTimeout = globalThis.setTimeout(() => {
|
|
42369
|
+
target.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42370
|
+
if (this.dropElevationTarget === target) {
|
|
42371
|
+
this.dropElevationTarget = undefined;
|
|
42372
|
+
}
|
|
42373
|
+
this.dropElevationTimeout = undefined;
|
|
42374
|
+
}, DROP_ELEVATION_DURATION);
|
|
42375
|
+
}
|
|
42376
|
+
clearDropElevationTimer() {
|
|
42377
|
+
if (this.dropElevationTimeout !== undefined) {
|
|
42378
|
+
clearTimeout(this.dropElevationTimeout);
|
|
42379
|
+
this.dropElevationTimeout = undefined;
|
|
42380
|
+
}
|
|
42381
|
+
}
|
|
42382
|
+
arraysEqual(a, b) {
|
|
42383
|
+
if (a.length !== b.length) {
|
|
42384
|
+
return false;
|
|
42385
|
+
}
|
|
42386
|
+
let index = 0;
|
|
42387
|
+
for (const value of a) {
|
|
42388
|
+
if (value !== b[index]) {
|
|
42389
|
+
return false;
|
|
42390
|
+
}
|
|
42391
|
+
index += 1;
|
|
42392
|
+
}
|
|
42393
|
+
return true;
|
|
42394
|
+
}
|
|
42395
|
+
extractIndices(items = []) {
|
|
42396
|
+
return (items !== null && items !== void 0 ? items : []).map((item, index) => { var _a; return (_a = item.index) !== null && _a !== void 0 ? _a : index; });
|
|
39480
42397
|
}
|
|
39481
42398
|
}
|
|
39482
42399
|
|
|
@@ -39580,7 +42497,10 @@ class Row extends react.Component {
|
|
|
39580
42497
|
renderDescription() {
|
|
39581
42498
|
var _a;
|
|
39582
42499
|
if ((_a = this.schema) === null || _a === void 0 ? void 0 : _a.description) {
|
|
39583
|
-
return react.createElement('
|
|
42500
|
+
return react.createElement('limel-markdown', {
|
|
42501
|
+
class: 'description',
|
|
42502
|
+
value: this.schema.description,
|
|
42503
|
+
});
|
|
39584
42504
|
}
|
|
39585
42505
|
}
|
|
39586
42506
|
renderChildren() {
|
|
@@ -39684,9 +42604,9 @@ function IconButton(props) {
|
|
|
39684
42604
|
type = _props$type === void 0 ? "default" : _props$type,
|
|
39685
42605
|
icon = props.icon,
|
|
39686
42606
|
className = props.className,
|
|
39687
|
-
otherProps = _objectWithoutProperties(props, ["type", "icon", "className"]);
|
|
42607
|
+
otherProps = _objectWithoutProperties$1(props, ["type", "icon", "className"]);
|
|
39688
42608
|
|
|
39689
|
-
return react.createElement("button", _extends({
|
|
42609
|
+
return react.createElement("button", _extends$1({
|
|
39690
42610
|
type: "button",
|
|
39691
42611
|
className: "btn btn-".concat(type, " ").concat(className)
|
|
39692
42612
|
}, otherProps), react.createElement("i", {
|
|
@@ -39910,7 +42830,7 @@ function (_Component) {
|
|
|
39910
42830
|
|
|
39911
42831
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayField).call(this, props));
|
|
39912
42832
|
|
|
39913
|
-
_defineProperty$
|
|
42833
|
+
_defineProperty$2(_assertThisInitialized(_this), "_getNewFormDataRow", function () {
|
|
39914
42834
|
var _this$props = _this.props,
|
|
39915
42835
|
schema = _this$props.schema,
|
|
39916
42836
|
_this$props$registry = _this$props.registry,
|
|
@@ -39925,7 +42845,7 @@ function (_Component) {
|
|
|
39925
42845
|
return getDefaultFormState(itemSchema, undefined, rootSchema);
|
|
39926
42846
|
});
|
|
39927
42847
|
|
|
39928
|
-
_defineProperty$
|
|
42848
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddClick", function (event) {
|
|
39929
42849
|
if (event) {
|
|
39930
42850
|
event.preventDefault();
|
|
39931
42851
|
}
|
|
@@ -39945,7 +42865,7 @@ function (_Component) {
|
|
|
39945
42865
|
});
|
|
39946
42866
|
});
|
|
39947
42867
|
|
|
39948
|
-
_defineProperty$
|
|
42868
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddIndexClick", function (index) {
|
|
39949
42869
|
return function (event) {
|
|
39950
42870
|
if (event) {
|
|
39951
42871
|
event.preventDefault();
|
|
@@ -39970,7 +42890,7 @@ function (_Component) {
|
|
|
39970
42890
|
};
|
|
39971
42891
|
});
|
|
39972
42892
|
|
|
39973
|
-
_defineProperty$
|
|
42893
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropIndexClick", function (index) {
|
|
39974
42894
|
return function (event) {
|
|
39975
42895
|
if (event) {
|
|
39976
42896
|
event.preventDefault();
|
|
@@ -40009,7 +42929,7 @@ function (_Component) {
|
|
|
40009
42929
|
};
|
|
40010
42930
|
});
|
|
40011
42931
|
|
|
40012
|
-
_defineProperty$
|
|
42932
|
+
_defineProperty$2(_assertThisInitialized(_this), "onReorderClick", function (index, newIndex) {
|
|
40013
42933
|
return function (event) {
|
|
40014
42934
|
if (event) {
|
|
40015
42935
|
event.preventDefault();
|
|
@@ -40058,7 +42978,7 @@ function (_Component) {
|
|
|
40058
42978
|
};
|
|
40059
42979
|
});
|
|
40060
42980
|
|
|
40061
|
-
_defineProperty$
|
|
42981
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChangeForIndex", function (index) {
|
|
40062
42982
|
return function (value, errorSchema) {
|
|
40063
42983
|
var _this$props2 = _this.props,
|
|
40064
42984
|
formData = _this$props2.formData,
|
|
@@ -40069,11 +42989,11 @@ function (_Component) {
|
|
|
40069
42989
|
var jsonValue = typeof value === "undefined" ? null : value;
|
|
40070
42990
|
return index === i ? jsonValue : item;
|
|
40071
42991
|
});
|
|
40072
|
-
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
42992
|
+
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, index, errorSchema)));
|
|
40073
42993
|
};
|
|
40074
42994
|
});
|
|
40075
42995
|
|
|
40076
|
-
_defineProperty$
|
|
42996
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSelectChange", function (value) {
|
|
40077
42997
|
_this.props.onChange(value);
|
|
40078
42998
|
});
|
|
40079
42999
|
|
|
@@ -40262,7 +43182,7 @@ function (_Component) {
|
|
|
40262
43182
|
}),
|
|
40263
43183
|
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
40264
43184
|
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
40265
|
-
options = _objectWithoutProperties(_getUiOptions$enumOpt, ["widget"]);
|
|
43185
|
+
options = _objectWithoutProperties$1(_getUiOptions$enumOpt, ["widget"]);
|
|
40266
43186
|
|
|
40267
43187
|
var Widget = getWidget(schema, widget, widgets);
|
|
40268
43188
|
return react.createElement(Widget, {
|
|
@@ -40309,7 +43229,7 @@ function (_Component) {
|
|
|
40309
43229
|
var _getUiOptions2 = getUiOptions(uiSchema),
|
|
40310
43230
|
_getUiOptions2$widget = _getUiOptions2.widget,
|
|
40311
43231
|
widget = _getUiOptions2$widget === void 0 ? "files" : _getUiOptions2$widget,
|
|
40312
|
-
options = _objectWithoutProperties(_getUiOptions2, ["widget"]);
|
|
43232
|
+
options = _objectWithoutProperties$1(_getUiOptions2, ["widget"]);
|
|
40313
43233
|
|
|
40314
43234
|
var Widget = getWidget(schema, widget, widgets);
|
|
40315
43235
|
return react.createElement(Widget, {
|
|
@@ -40523,7 +43443,7 @@ function (_Component) {
|
|
|
40523
43443
|
return ArrayField;
|
|
40524
43444
|
}(react.Component);
|
|
40525
43445
|
|
|
40526
|
-
_defineProperty$
|
|
43446
|
+
_defineProperty$2(ArrayField$1, "defaultProps", {
|
|
40527
43447
|
uiSchema: {},
|
|
40528
43448
|
formData: [],
|
|
40529
43449
|
idSchema: {},
|
|
@@ -40557,7 +43477,7 @@ function BooleanField(props) {
|
|
|
40557
43477
|
var _getUiOptions = getUiOptions(uiSchema),
|
|
40558
43478
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
40559
43479
|
widget = _getUiOptions$widget === void 0 ? "checkbox" : _getUiOptions$widget,
|
|
40560
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
43480
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
40561
43481
|
|
|
40562
43482
|
var Widget = getWidget(schema, widget, widgets);
|
|
40563
43483
|
var enumOptions;
|
|
@@ -40639,7 +43559,7 @@ function (_Component) {
|
|
|
40639
43559
|
|
|
40640
43560
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AnyOfField).call(this, props));
|
|
40641
43561
|
|
|
40642
|
-
_defineProperty$
|
|
43562
|
+
_defineProperty$2(_assertThisInitialized(_this), "onOptionChange", function (option) {
|
|
40643
43563
|
var selectedOption = _parseInt(option, 10);
|
|
40644
43564
|
|
|
40645
43565
|
var _this$props = _this.props,
|
|
@@ -40654,7 +43574,7 @@ function (_Component) {
|
|
|
40654
43574
|
var newFormData = undefined;
|
|
40655
43575
|
|
|
40656
43576
|
if (guessType(formData) === "object" && (newOption.type === "object" || newOption.properties)) {
|
|
40657
|
-
newFormData = _extends({}, formData);
|
|
43577
|
+
newFormData = _extends$1({}, formData);
|
|
40658
43578
|
var optionsToDiscard = options.slice();
|
|
40659
43579
|
optionsToDiscard.splice(selectedOption, 1); // Discard any data added using other options
|
|
40660
43580
|
|
|
@@ -40760,7 +43680,7 @@ function (_Component) {
|
|
|
40760
43680
|
var _getUiOptions = getUiOptions(uiSchema),
|
|
40761
43681
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
40762
43682
|
widget = _getUiOptions$widget === void 0 ? "select" : _getUiOptions$widget,
|
|
40763
|
-
uiOptions = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
43683
|
+
uiOptions = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
40764
43684
|
|
|
40765
43685
|
var Widget = getWidget({
|
|
40766
43686
|
type: "number"
|
|
@@ -40771,7 +43691,7 @@ function (_Component) {
|
|
|
40771
43691
|
if (option) {
|
|
40772
43692
|
// If the subschema doesn't declare a type, infer the type from the
|
|
40773
43693
|
// parent schema
|
|
40774
|
-
optionSchema = option.type ? option : _extends({}, option, {
|
|
43694
|
+
optionSchema = option.type ? option : _extends$1({}, option, {
|
|
40775
43695
|
type: baseType
|
|
40776
43696
|
});
|
|
40777
43697
|
}
|
|
@@ -40786,7 +43706,7 @@ function (_Component) {
|
|
|
40786
43706
|
className: "panel panel-default panel-body"
|
|
40787
43707
|
}, react.createElement("div", {
|
|
40788
43708
|
className: "form-group"
|
|
40789
|
-
}, react.createElement(Widget, _extends({
|
|
43709
|
+
}, react.createElement(Widget, _extends$1({
|
|
40790
43710
|
id: "".concat(idSchema.$id).concat(schema.oneOf ? "__oneof_select" : "__anyof_select"),
|
|
40791
43711
|
schema: {
|
|
40792
43712
|
type: "number",
|
|
@@ -40865,7 +43785,7 @@ function (_React$Component) {
|
|
|
40865
43785
|
|
|
40866
43786
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(NumberField).call(this, props));
|
|
40867
43787
|
|
|
40868
|
-
_defineProperty$
|
|
43788
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleChange", function (value) {
|
|
40869
43789
|
// Cache the original value in component state
|
|
40870
43790
|
_this.setState({
|
|
40871
43791
|
lastValue: value
|
|
@@ -40898,7 +43818,7 @@ function (_React$Component) {
|
|
|
40898
43818
|
|
|
40899
43819
|
var _this$props = this.props,
|
|
40900
43820
|
formData = _this$props.formData,
|
|
40901
|
-
props = _objectWithoutProperties(_this$props, ["formData"]);
|
|
43821
|
+
props = _objectWithoutProperties$1(_this$props, ["formData"]);
|
|
40902
43822
|
|
|
40903
43823
|
var lastValue = this.state.lastValue;
|
|
40904
43824
|
var value = formData;
|
|
@@ -40915,7 +43835,7 @@ function (_React$Component) {
|
|
|
40915
43835
|
}
|
|
40916
43836
|
}
|
|
40917
43837
|
|
|
40918
|
-
return react.createElement(StringField, _extends({}, props, {
|
|
43838
|
+
return react.createElement(StringField, _extends$1({}, props, {
|
|
40919
43839
|
formData: value,
|
|
40920
43840
|
onChange: this.handleChange
|
|
40921
43841
|
}));
|
|
@@ -40970,12 +43890,12 @@ function (_Component) {
|
|
|
40970
43890
|
|
|
40971
43891
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ObjectField)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
40972
43892
|
|
|
40973
|
-
_defineProperty$
|
|
43893
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", {
|
|
40974
43894
|
wasPropertyKeyModified: false,
|
|
40975
43895
|
additionalProperties: {}
|
|
40976
43896
|
});
|
|
40977
43897
|
|
|
40978
|
-
_defineProperty$
|
|
43898
|
+
_defineProperty$2(_assertThisInitialized(_this), "onPropertyChange", function (name) {
|
|
40979
43899
|
var addedByAdditionalProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40980
43900
|
return function (value, errorSchema) {
|
|
40981
43901
|
if (!value && addedByAdditionalProperties) {
|
|
@@ -40989,13 +43909,13 @@ function (_Component) {
|
|
|
40989
43909
|
value = "";
|
|
40990
43910
|
}
|
|
40991
43911
|
|
|
40992
|
-
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$
|
|
43912
|
+
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$2({}, name, value));
|
|
40993
43913
|
|
|
40994
|
-
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
43914
|
+
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, name, errorSchema)));
|
|
40995
43915
|
};
|
|
40996
43916
|
});
|
|
40997
43917
|
|
|
40998
|
-
_defineProperty$
|
|
43918
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropPropertyClick", function (key) {
|
|
40999
43919
|
return function (event) {
|
|
41000
43920
|
event.preventDefault();
|
|
41001
43921
|
var _this$props = _this.props,
|
|
@@ -41009,7 +43929,7 @@ function (_Component) {
|
|
|
41009
43929
|
};
|
|
41010
43930
|
});
|
|
41011
43931
|
|
|
41012
|
-
_defineProperty$
|
|
43932
|
+
_defineProperty$2(_assertThisInitialized(_this), "getAvailableKey", function (preferredKey, formData) {
|
|
41013
43933
|
var index = 0;
|
|
41014
43934
|
var newKey = preferredKey;
|
|
41015
43935
|
|
|
@@ -41020,7 +43940,7 @@ function (_Component) {
|
|
|
41020
43940
|
return newKey;
|
|
41021
43941
|
});
|
|
41022
43942
|
|
|
41023
|
-
_defineProperty$
|
|
43943
|
+
_defineProperty$2(_assertThisInitialized(_this), "onKeyChange", function (oldValue) {
|
|
41024
43944
|
return function (value, errorSchema) {
|
|
41025
43945
|
if (oldValue === value) {
|
|
41026
43946
|
return;
|
|
@@ -41030,24 +43950,24 @@ function (_Component) {
|
|
|
41030
43950
|
|
|
41031
43951
|
var newFormData = _objectSpread({}, _this.props.formData);
|
|
41032
43952
|
|
|
41033
|
-
var newKeys = _defineProperty$
|
|
43953
|
+
var newKeys = _defineProperty$2({}, oldValue, value);
|
|
41034
43954
|
|
|
41035
43955
|
var keyValues = keys$3(newFormData).map(function (key) {
|
|
41036
43956
|
var newKey = newKeys[key] || key;
|
|
41037
|
-
return _defineProperty$
|
|
43957
|
+
return _defineProperty$2({}, newKey, newFormData[key]);
|
|
41038
43958
|
});
|
|
41039
43959
|
|
|
41040
|
-
var renamedObj = _extends.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
43960
|
+
var renamedObj = _extends$1.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
41041
43961
|
|
|
41042
43962
|
_this.setState({
|
|
41043
43963
|
wasPropertyKeyModified: true
|
|
41044
43964
|
});
|
|
41045
43965
|
|
|
41046
|
-
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
43966
|
+
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, value, errorSchema)));
|
|
41047
43967
|
};
|
|
41048
43968
|
});
|
|
41049
43969
|
|
|
41050
|
-
_defineProperty$
|
|
43970
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleAddClick", function (schema) {
|
|
41051
43971
|
return function () {
|
|
41052
43972
|
var type = schema.additionalProperties.type;
|
|
41053
43973
|
|
|
@@ -41191,7 +44111,7 @@ function (_Component) {
|
|
|
41191
44111
|
formData: formData,
|
|
41192
44112
|
formContext: formContext
|
|
41193
44113
|
};
|
|
41194
|
-
return react.createElement(Template, _extends({}, templateProps, {
|
|
44114
|
+
return react.createElement(Template, _extends$1({}, templateProps, {
|
|
41195
44115
|
onAddClick: this.handleAddClick
|
|
41196
44116
|
}));
|
|
41197
44117
|
}
|
|
@@ -41200,7 +44120,7 @@ function (_Component) {
|
|
|
41200
44120
|
return ObjectField;
|
|
41201
44121
|
}(react.Component);
|
|
41202
44122
|
|
|
41203
|
-
_defineProperty$
|
|
44123
|
+
_defineProperty$2(ObjectField$1, "defaultProps", {
|
|
41204
44124
|
uiSchema: {},
|
|
41205
44125
|
formData: {},
|
|
41206
44126
|
errorSchema: {},
|
|
@@ -41242,7 +44162,7 @@ function StringField(props) {
|
|
|
41242
44162
|
widget = _getUiOptions$widget === void 0 ? defaultWidget : _getUiOptions$widget,
|
|
41243
44163
|
_getUiOptions$placeho = _getUiOptions.placeholder,
|
|
41244
44164
|
placeholder = _getUiOptions$placeho === void 0 ? "" : _getUiOptions$placeho,
|
|
41245
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget", "placeholder"]);
|
|
44165
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget", "placeholder"]);
|
|
41246
44166
|
|
|
41247
44167
|
var Widget = getWidget(schema, widget, widgets);
|
|
41248
44168
|
return react.createElement(Widget, {
|
|
@@ -41405,8 +44325,8 @@ function (_Component) {
|
|
|
41405
44325
|
|
|
41406
44326
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AltDateWidget).call(this, props));
|
|
41407
44327
|
|
|
41408
|
-
_defineProperty$
|
|
41409
|
-
_this.setState(_defineProperty$
|
|
44328
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (property, value) {
|
|
44329
|
+
_this.setState(_defineProperty$2({}, property, typeof value === "undefined" ? -1 : value), function () {
|
|
41410
44330
|
// Only propagate to parent state if we have a complete date{time}
|
|
41411
44331
|
if (readyForChange(_this.state)) {
|
|
41412
44332
|
_this.props.onChange(toDateString(_this.state, _this.props.time));
|
|
@@ -41414,7 +44334,7 @@ function (_Component) {
|
|
|
41414
44334
|
});
|
|
41415
44335
|
});
|
|
41416
44336
|
|
|
41417
|
-
_defineProperty$
|
|
44337
|
+
_defineProperty$2(_assertThisInitialized(_this), "setNow", function (event) {
|
|
41418
44338
|
event.preventDefault();
|
|
41419
44339
|
var _this$props = _this.props,
|
|
41420
44340
|
time = _this$props.time,
|
|
@@ -41433,7 +44353,7 @@ function (_Component) {
|
|
|
41433
44353
|
});
|
|
41434
44354
|
});
|
|
41435
44355
|
|
|
41436
|
-
_defineProperty$
|
|
44356
|
+
_defineProperty$2(_assertThisInitialized(_this), "clear", function (event) {
|
|
41437
44357
|
event.preventDefault();
|
|
41438
44358
|
var _this$props2 = _this.props,
|
|
41439
44359
|
time = _this$props2.time,
|
|
@@ -41482,7 +44402,7 @@ function (_Component) {
|
|
|
41482
44402
|
}, this.dateElementProps.map(function (elemProps, i) {
|
|
41483
44403
|
return react.createElement("li", {
|
|
41484
44404
|
key: i
|
|
41485
|
-
}, react.createElement(DateElement, _extends({
|
|
44405
|
+
}, react.createElement(DateElement, _extends$1({
|
|
41486
44406
|
rootId: id,
|
|
41487
44407
|
select: _this2.onChange
|
|
41488
44408
|
}, elemProps, {
|
|
@@ -41552,7 +44472,7 @@ function (_Component) {
|
|
|
41552
44472
|
return AltDateWidget;
|
|
41553
44473
|
}(react.Component);
|
|
41554
44474
|
|
|
41555
|
-
_defineProperty$
|
|
44475
|
+
_defineProperty$2(AltDateWidget, "defaultProps", {
|
|
41556
44476
|
time: false,
|
|
41557
44477
|
disabled: false,
|
|
41558
44478
|
readonly: false,
|
|
@@ -41564,7 +44484,7 @@ _defineProperty$1(AltDateWidget, "defaultProps", {
|
|
|
41564
44484
|
|
|
41565
44485
|
function AltDateTimeWidget(props) {
|
|
41566
44486
|
var AltDateWidget = props.registry.widgets.AltDateWidget;
|
|
41567
|
-
return react.createElement(AltDateWidget, _extends({
|
|
44487
|
+
return react.createElement(AltDateWidget, _extends$1({
|
|
41568
44488
|
time: true
|
|
41569
44489
|
}, props));
|
|
41570
44490
|
}
|
|
@@ -41589,7 +44509,7 @@ function BaseInput(props) {
|
|
|
41589
44509
|
onFocus = props.onFocus,
|
|
41590
44510
|
options = props.options,
|
|
41591
44511
|
schema = props.schema,
|
|
41592
|
-
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
|
|
44512
|
+
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
|
|
41593
44513
|
|
|
41594
44514
|
|
|
41595
44515
|
if (options.inputType) {
|
|
@@ -41634,7 +44554,7 @@ function BaseInput(props) {
|
|
|
41634
44554
|
return props.onChange(value === "" ? options.emptyValue : value);
|
|
41635
44555
|
};
|
|
41636
44556
|
|
|
41637
|
-
return [react.createElement("input", _extends({
|
|
44557
|
+
return [react.createElement("input", _extends$1({
|
|
41638
44558
|
key: inputProps.id,
|
|
41639
44559
|
className: "form-control",
|
|
41640
44560
|
readOnly: readonly,
|
|
@@ -41784,7 +44704,7 @@ function ColorWidget(props) {
|
|
|
41784
44704
|
var disabled = props.disabled,
|
|
41785
44705
|
readonly = props.readonly,
|
|
41786
44706
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41787
|
-
return react.createElement(BaseInput, _extends({
|
|
44707
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41788
44708
|
type: "color"
|
|
41789
44709
|
}, props, {
|
|
41790
44710
|
disabled: disabled || readonly
|
|
@@ -41794,7 +44714,7 @@ function ColorWidget(props) {
|
|
|
41794
44714
|
function DateWidget(props) {
|
|
41795
44715
|
var _onChange = props.onChange,
|
|
41796
44716
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41797
|
-
return react.createElement(BaseInput, _extends({
|
|
44717
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41798
44718
|
type: "date"
|
|
41799
44719
|
}, props, {
|
|
41800
44720
|
onChange: function onChange(value) {
|
|
@@ -41807,7 +44727,7 @@ function DateTimeWidget(props) {
|
|
|
41807
44727
|
var value = props.value,
|
|
41808
44728
|
_onChange = props.onChange,
|
|
41809
44729
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41810
|
-
return react.createElement(BaseInput, _extends({
|
|
44730
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41811
44731
|
type: "datetime-local"
|
|
41812
44732
|
}, props, {
|
|
41813
44733
|
value: utcToLocal(value),
|
|
@@ -41819,7 +44739,7 @@ function DateTimeWidget(props) {
|
|
|
41819
44739
|
|
|
41820
44740
|
function EmailWidget(props) {
|
|
41821
44741
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
41822
|
-
return react.createElement(BaseInput, _extends({
|
|
44742
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41823
44743
|
type: "email"
|
|
41824
44744
|
}, props));
|
|
41825
44745
|
}
|
|
@@ -41900,7 +44820,7 @@ function (_Component) {
|
|
|
41900
44820
|
|
|
41901
44821
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(FileWidget).call(this, props));
|
|
41902
44822
|
|
|
41903
|
-
_defineProperty$
|
|
44823
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (event) {
|
|
41904
44824
|
var _this$props = _this.props,
|
|
41905
44825
|
multiple = _this$props.multiple,
|
|
41906
44826
|
onChange = _this$props.onChange;
|
|
@@ -41986,7 +44906,7 @@ function HiddenWidget(_ref) {
|
|
|
41986
44906
|
|
|
41987
44907
|
function PasswordWidget(props) {
|
|
41988
44908
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
41989
|
-
return react.createElement(BaseInput, _extends({
|
|
44909
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41990
44910
|
type: "password"
|
|
41991
44911
|
}, props));
|
|
41992
44912
|
}
|
|
@@ -42054,7 +44974,7 @@ function RangeWidget(props) {
|
|
|
42054
44974
|
BaseInput = props.registry.widgets.BaseInput;
|
|
42055
44975
|
return react.createElement("div", {
|
|
42056
44976
|
className: "field-range-wrapper"
|
|
42057
|
-
}, react.createElement(BaseInput, _extends({
|
|
44977
|
+
}, react.createElement(BaseInput, _extends$1({
|
|
42058
44978
|
type: "range"
|
|
42059
44979
|
}, props, rangeSpec(schema))), react.createElement("span", {
|
|
42060
44980
|
className: "range-view"
|
|
@@ -42217,14 +45137,14 @@ function TextWidget(props) {
|
|
|
42217
45137
|
|
|
42218
45138
|
function URLWidget(props) {
|
|
42219
45139
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
42220
|
-
return react.createElement(BaseInput, _extends({
|
|
45140
|
+
return react.createElement(BaseInput, _extends$1({
|
|
42221
45141
|
type: "url"
|
|
42222
45142
|
}, props));
|
|
42223
45143
|
}
|
|
42224
45144
|
|
|
42225
45145
|
function UpDownWidget(props) {
|
|
42226
45146
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
42227
|
-
return react.createElement(BaseInput, _extends({
|
|
45147
|
+
return react.createElement(BaseInput, _extends$1({
|
|
42228
45148
|
type: "number"
|
|
42229
45149
|
}, props, rangeSpec(props.schema)));
|
|
42230
45150
|
}
|
|
@@ -42379,13 +45299,13 @@ function createErrorHandler(formData) {
|
|
|
42379
45299
|
|
|
42380
45300
|
if (isObject(formData)) {
|
|
42381
45301
|
return keys$3(formData).reduce(function (acc, key) {
|
|
42382
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45302
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler(formData[key])));
|
|
42383
45303
|
}, handler);
|
|
42384
45304
|
}
|
|
42385
45305
|
|
|
42386
45306
|
if (isArray$2(formData)) {
|
|
42387
45307
|
return formData.reduce(function (acc, value, key) {
|
|
42388
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45308
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler(value)));
|
|
42389
45309
|
}, handler);
|
|
42390
45310
|
}
|
|
42391
45311
|
|
|
@@ -42397,10 +45317,10 @@ function unwrapErrorHandler(errorHandler) {
|
|
|
42397
45317
|
if (key === "addError") {
|
|
42398
45318
|
return acc;
|
|
42399
45319
|
} else if (key === "__errors") {
|
|
42400
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45320
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, errorHandler[key]));
|
|
42401
45321
|
}
|
|
42402
45322
|
|
|
42403
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45323
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, unwrapErrorHandler(errorHandler[key])));
|
|
42404
45324
|
}, {});
|
|
42405
45325
|
}
|
|
42406
45326
|
/**
|
|
@@ -42536,9 +45456,9 @@ function isValid(schema, data) {
|
|
|
42536
45456
|
}
|
|
42537
45457
|
}
|
|
42538
45458
|
|
|
42539
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
45459
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
42540
45460
|
|
|
42541
|
-
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); }
|
|
45461
|
+
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); }
|
|
42542
45462
|
var ADDITIONAL_PROPERTY_FLAG = "__additional_property";
|
|
42543
45463
|
var widgetMap = {
|
|
42544
45464
|
"boolean": {
|
|
@@ -42657,9 +45577,9 @@ function getWidget(schema, widget) {
|
|
|
42657
45577
|
Widget.MergedWidget = function (_ref) {
|
|
42658
45578
|
var _ref$options = _ref.options,
|
|
42659
45579
|
options = _ref$options === void 0 ? {} : _ref$options,
|
|
42660
|
-
props = _objectWithoutProperties(_ref, ["options"]);
|
|
45580
|
+
props = _objectWithoutProperties$1(_ref, ["options"]);
|
|
42661
45581
|
|
|
42662
|
-
return react.createElement(Widget, _extends({
|
|
45582
|
+
return react.createElement(Widget, _extends$1({
|
|
42663
45583
|
options: _objectSpread({}, defaultOptions, options)
|
|
42664
45584
|
}, props));
|
|
42665
45585
|
};
|
|
@@ -42673,7 +45593,7 @@ function getWidget(schema, widget) {
|
|
|
42673
45593
|
}
|
|
42674
45594
|
|
|
42675
45595
|
if (typeof widget !== "string") {
|
|
42676
|
-
throw new Error("Unsupported widget definition: ".concat(_typeof(widget)));
|
|
45596
|
+
throw new Error("Unsupported widget definition: ".concat(_typeof$1(widget)));
|
|
42677
45597
|
}
|
|
42678
45598
|
|
|
42679
45599
|
if (registeredWidgets.hasOwnProperty(widget)) {
|
|
@@ -42846,7 +45766,7 @@ function mergeDefaultsWithFormData(defaults, formData) {
|
|
|
42846
45766
|
return value;
|
|
42847
45767
|
});
|
|
42848
45768
|
} else if (isObject(formData)) {
|
|
42849
|
-
var acc = _extends({}, defaults); // Prevent mutation of source object.
|
|
45769
|
+
var acc = _extends$1({}, defaults); // Prevent mutation of source object.
|
|
42850
45770
|
|
|
42851
45771
|
|
|
42852
45772
|
return keys$3(formData).reduce(function (acc, key) {
|
|
@@ -42875,7 +45795,7 @@ function getUiOptions(uiSchema) {
|
|
|
42875
45795
|
return _objectSpread({}, options, value);
|
|
42876
45796
|
}
|
|
42877
45797
|
|
|
42878
|
-
return _objectSpread({}, options, _defineProperty$
|
|
45798
|
+
return _objectSpread({}, options, _defineProperty$2({}, key.substring(3), value));
|
|
42879
45799
|
}, {});
|
|
42880
45800
|
}
|
|
42881
45801
|
function getDisplayLabel(schema, uiSchema, rootSchema) {
|
|
@@ -42906,13 +45826,13 @@ function isObject(thing) {
|
|
|
42906
45826
|
return false;
|
|
42907
45827
|
}
|
|
42908
45828
|
|
|
42909
|
-
return _typeof(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
45829
|
+
return _typeof$1(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
42910
45830
|
}
|
|
42911
45831
|
function mergeObjects(obj1, obj2) {
|
|
42912
45832
|
var concatArrays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
42913
45833
|
|
|
42914
45834
|
// Recursively merge deeply nested objects.
|
|
42915
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
45835
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
42916
45836
|
|
|
42917
45837
|
|
|
42918
45838
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -43128,7 +46048,7 @@ var guessType = function guessType(value) {
|
|
|
43128
46048
|
return "boolean";
|
|
43129
46049
|
} else if (!isNaN(value)) {
|
|
43130
46050
|
return "number";
|
|
43131
|
-
} else if (_typeof(value) === "object") {
|
|
46051
|
+
} else if (_typeof$1(value) === "object") {
|
|
43132
46052
|
return "object";
|
|
43133
46053
|
} // Default to string if we can't figure it out
|
|
43134
46054
|
|
|
@@ -43197,7 +46117,7 @@ function resolveReference(schema, rootSchema, formData) {
|
|
|
43197
46117
|
// Retrieve the referenced schema definition.
|
|
43198
46118
|
var $refSchema = findSchemaDefinition(schema.$ref, rootSchema); // Drop the $ref property of the source schema.
|
|
43199
46119
|
|
|
43200
|
-
var localSchema = _objectWithoutProperties(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
46120
|
+
var localSchema = _objectWithoutProperties$1(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
43201
46121
|
|
|
43202
46122
|
|
|
43203
46123
|
return retrieveSchema(_objectSpread({}, $refSchema, localSchema), rootSchema, formData);
|
|
@@ -43222,7 +46142,7 @@ function retrieveSchema(schema) {
|
|
|
43222
46142
|
console.warn("could not merge subschemas in allOf:\n" + e);
|
|
43223
46143
|
|
|
43224
46144
|
var _resolvedSchema = resolvedSchema,
|
|
43225
|
-
resolvedSchemaWithoutAllOf = _objectWithoutProperties(_resolvedSchema, ["allOf"]);
|
|
46145
|
+
resolvedSchemaWithoutAllOf = _objectWithoutProperties$1(_resolvedSchema, ["allOf"]);
|
|
43226
46146
|
|
|
43227
46147
|
return resolvedSchemaWithoutAllOf;
|
|
43228
46148
|
}
|
|
@@ -43241,7 +46161,7 @@ function resolveDependencies(schema, rootSchema, formData) {
|
|
|
43241
46161
|
// Drop the dependencies from the source schema.
|
|
43242
46162
|
var _schema$dependencies = schema.dependencies,
|
|
43243
46163
|
dependencies = _schema$dependencies === void 0 ? {} : _schema$dependencies,
|
|
43244
|
-
resolvedSchema = _objectWithoutProperties(schema, ["dependencies"]);
|
|
46164
|
+
resolvedSchema = _objectWithoutProperties$1(schema, ["dependencies"]);
|
|
43245
46165
|
|
|
43246
46166
|
if ("oneOf" in resolvedSchema) {
|
|
43247
46167
|
resolvedSchema = resolvedSchema.oneOf[getMatchingOption(formData, resolvedSchema.oneOf)];
|
|
@@ -43266,7 +46186,7 @@ function processDependencies(dependencies, resolvedSchema, rootSchema, formData)
|
|
|
43266
46186
|
}
|
|
43267
46187
|
|
|
43268
46188
|
var dependencyValue = dependencies[dependencyKey],
|
|
43269
|
-
remainingDependencies = _objectWithoutProperties(dependencies, [dependencyKey].map(_toPropertyKey));
|
|
46189
|
+
remainingDependencies = _objectWithoutProperties$1(dependencies, [dependencyKey].map(_toPropertyKey));
|
|
43270
46190
|
|
|
43271
46191
|
if (isArray$2(dependencyValue)) {
|
|
43272
46192
|
resolvedSchema = withDependentProperties(resolvedSchema, dependencyValue);
|
|
@@ -43294,14 +46214,14 @@ function withDependentProperties(schema, additionallyRequired) {
|
|
|
43294
46214
|
function withDependentSchema(schema, rootSchema, formData, dependencyKey, dependencyValue) {
|
|
43295
46215
|
var _retrieveSchema = retrieveSchema(dependencyValue, rootSchema, formData),
|
|
43296
46216
|
oneOf = _retrieveSchema.oneOf,
|
|
43297
|
-
dependentSchema = _objectWithoutProperties(_retrieveSchema, ["oneOf"]);
|
|
46217
|
+
dependentSchema = _objectWithoutProperties$1(_retrieveSchema, ["oneOf"]);
|
|
43298
46218
|
|
|
43299
46219
|
schema = mergeSchemas(schema, dependentSchema); // Since it does not contain oneOf, we return the original schema.
|
|
43300
46220
|
|
|
43301
46221
|
if (oneOf === undefined) {
|
|
43302
46222
|
return schema;
|
|
43303
46223
|
} else if (!isArray$2(oneOf)) {
|
|
43304
|
-
throw new Error("invalid: it is some ".concat(_typeof(oneOf), " instead of an array"));
|
|
46224
|
+
throw new Error("invalid: it is some ".concat(_typeof$1(oneOf), " instead of an array"));
|
|
43305
46225
|
} // Resolve $refs inside oneOf.
|
|
43306
46226
|
|
|
43307
46227
|
|
|
@@ -43322,7 +46242,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43322
46242
|
if (conditionPropertySchema) {
|
|
43323
46243
|
var conditionSchema = {
|
|
43324
46244
|
type: "object",
|
|
43325
|
-
properties: _defineProperty$
|
|
46245
|
+
properties: _defineProperty$2({}, dependencyKey, conditionPropertySchema)
|
|
43326
46246
|
};
|
|
43327
46247
|
|
|
43328
46248
|
var _validateFormData = validateFormData(formData, conditionSchema),
|
|
@@ -43340,7 +46260,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43340
46260
|
var subschema = validSubschemas[0];
|
|
43341
46261
|
|
|
43342
46262
|
var _subschema$properties = subschema.properties,
|
|
43343
|
-
dependentSubschema = _objectWithoutProperties(_subschema$properties, [dependencyKey].map(_toPropertyKey));
|
|
46263
|
+
dependentSubschema = _objectWithoutProperties$1(_subschema$properties, [dependencyKey].map(_toPropertyKey));
|
|
43344
46264
|
|
|
43345
46265
|
var dependentSchema = _objectSpread({}, subschema, {
|
|
43346
46266
|
properties: dependentSubschema
|
|
@@ -43355,7 +46275,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43355
46275
|
|
|
43356
46276
|
|
|
43357
46277
|
function mergeSchemas(obj1, obj2) {
|
|
43358
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
46278
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
43359
46279
|
|
|
43360
46280
|
|
|
43361
46281
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -43393,7 +46313,7 @@ function deepEquals(a, b) {
|
|
|
43393
46313
|
// Assume all functions are equivalent
|
|
43394
46314
|
// see https://github.com/rjsf-team/react-jsonschema-form/issues/255
|
|
43395
46315
|
return true;
|
|
43396
|
-
} else if (_typeof(a) !== "object" || _typeof(b) !== "object") {
|
|
46316
|
+
} else if (_typeof$1(a) !== "object" || _typeof$1(b) !== "object") {
|
|
43397
46317
|
return false;
|
|
43398
46318
|
} else if (a === null || b === null) {
|
|
43399
46319
|
return false;
|
|
@@ -43655,7 +46575,7 @@ function getMatchingOption(formData, options, rootSchema) {
|
|
|
43655
46575
|
|
|
43656
46576
|
if (option.anyOf) {
|
|
43657
46577
|
// Create a shallow clone of the option
|
|
43658
|
-
var shallowClone = _extends({}, option);
|
|
46578
|
+
var shallowClone = _extends$1({}, option);
|
|
43659
46579
|
|
|
43660
46580
|
if (!shallowClone.allOf) {
|
|
43661
46581
|
shallowClone.allOf = [];
|
|
@@ -43667,7 +46587,7 @@ function getMatchingOption(formData, options, rootSchema) {
|
|
|
43667
46587
|
shallowClone.allOf.push(requiresAnyOf);
|
|
43668
46588
|
augmentedSchema = shallowClone;
|
|
43669
46589
|
} else {
|
|
43670
|
-
augmentedSchema = _extends({}, option, requiresAnyOf);
|
|
46590
|
+
augmentedSchema = _extends$1({}, option, requiresAnyOf);
|
|
43671
46591
|
} // Remove the "required" field as it's likely that not all fields have
|
|
43672
46592
|
// been filled in yet, which will mean that the schema is not valid
|
|
43673
46593
|
|
|
@@ -43945,10 +46865,10 @@ function SchemaFieldRender(props) {
|
|
|
43945
46865
|
var displayLabel = getDisplayLabel(schema, uiSchema, rootSchema);
|
|
43946
46866
|
|
|
43947
46867
|
var __errors = errorSchema.__errors,
|
|
43948
|
-
fieldErrorSchema = _objectWithoutProperties(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
46868
|
+
fieldErrorSchema = _objectWithoutProperties$1(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
43949
46869
|
|
|
43950
46870
|
|
|
43951
|
-
var field = react.createElement(FieldComponent, _extends({}, props, {
|
|
46871
|
+
var field = react.createElement(FieldComponent, _extends$1({}, props, {
|
|
43952
46872
|
idSchema: idSchema,
|
|
43953
46873
|
schema: schema,
|
|
43954
46874
|
uiSchema: _objectSpread({}, uiSchema, {
|
|
@@ -44944,13 +47864,13 @@ function isInteger(data) {
|
|
|
44944
47864
|
return Number.isInteger(Number(data));
|
|
44945
47865
|
}
|
|
44946
47866
|
|
|
44947
|
-
const formCss = "@charset \"UTF-8\"
|
|
47867
|
+
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}limel-markdown{display:block;margin-bottom:0.5rem}.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{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}";
|
|
44948
47868
|
|
|
44949
47869
|
const Form = class {
|
|
44950
47870
|
constructor(hostRef) {
|
|
44951
|
-
index$
|
|
44952
|
-
this.change = index$
|
|
44953
|
-
this.validate = index$
|
|
47871
|
+
index$2.registerInstance(this, hostRef);
|
|
47872
|
+
this.change = index$2.createEvent(this, "change", 7);
|
|
47873
|
+
this.validate = index$2.createEvent(this, "validate", 7);
|
|
44954
47874
|
this.isValid = true;
|
|
44955
47875
|
this.schema = {};
|
|
44956
47876
|
this.value = undefined;
|
|
@@ -44990,7 +47910,7 @@ const Form = class {
|
|
|
44990
47910
|
}
|
|
44991
47911
|
}
|
|
44992
47912
|
render() {
|
|
44993
|
-
return index$
|
|
47913
|
+
return index$2.h("div", { class: "root" });
|
|
44994
47914
|
}
|
|
44995
47915
|
reactRender() {
|
|
44996
47916
|
if (!this.root) {
|
|
@@ -45109,7 +48029,7 @@ const Form = class {
|
|
|
45109
48029
|
return Object.assign(Object.assign({}, originalError), { message: transformedError.message });
|
|
45110
48030
|
});
|
|
45111
48031
|
}
|
|
45112
|
-
get host() { return index$
|
|
48032
|
+
get host() { return index$2.getElement(this); }
|
|
45113
48033
|
static get watchers() { return {
|
|
45114
48034
|
"schema": ["setSchema"]
|
|
45115
48035
|
}; }
|