@limetech/lime-elements 38.31.0 → 38.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
- package/dist/cjs/limel-collapsible-section.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-drag-handle.cjs.entry.js +34 -0
- package/dist/cjs/limel-drag-handle.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +3220 -305
- package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-list-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-d2be6dd7.js → translations-a42886f2.js} +17 -1
- package/dist/cjs/translations-a42886f2.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +3 -0
- package/dist/collection/components/action-bar/action-bar.css +3 -0
- package/dist/collection/components/badge/badge.css +3 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +3 -0
- package/dist/collection/components/button/button.css +3 -0
- package/dist/collection/components/button-group/button-group.css +3 -0
- package/dist/collection/components/card/card.css +3 -0
- package/dist/collection/components/chart/chart.css +6 -0
- package/dist/collection/components/checkbox/checkbox.css +3 -0
- package/dist/collection/components/chip/chip.css +3 -0
- package/dist/collection/components/chip-set/chip-set.css +6 -0
- package/dist/collection/components/circular-progress/circular-progress.css +3 -0
- package/dist/collection/components/code-editor/code-editor.css +3 -0
- package/dist/collection/components/collapsible-section/collapsible-section.css +17 -8
- package/dist/collection/components/color-picker/color-picker-palette.css +3 -0
- package/dist/collection/components/color-picker/color-picker.css +3 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +3 -0
- package/dist/collection/components/dialog/dialog.css +3 -0
- package/dist/collection/components/dock/dock-button/dock-button.css +3 -0
- package/dist/collection/components/dock/dock.css +3 -0
- package/dist/collection/components/drag-handle/drag-handle.css +174 -0
- package/dist/collection/components/drag-handle/drag-handle.js +125 -0
- package/dist/collection/components/drag-handle/drag-handle.js.map +1 -0
- package/dist/collection/components/file/file.css +3 -0
- package/dist/collection/components/file-viewer/file-viewer.css +3 -0
- package/dist/collection/components/form/form.css +143 -14
- package/dist/collection/components/form/templates/array-field-collapsible-item.js +13 -16
- package/dist/collection/components/form/templates/array-field-collapsible-item.js.map +1 -1
- package/dist/collection/components/form/templates/array-field-simple-item.js +16 -49
- package/dist/collection/components/form/templates/array-field-simple-item.js.map +1 -1
- package/dist/collection/components/form/templates/array-field.js +306 -19
- package/dist/collection/components/form/templates/array-field.js.map +1 -1
- package/dist/collection/components/header/header.css +3 -0
- package/dist/collection/components/help/help.css +3 -0
- package/dist/collection/components/help/limel-help-content.css +3 -0
- package/dist/collection/components/icon-button/icon-button.css +3 -0
- package/dist/collection/components/info-tile/info-tile.css +3 -0
- package/dist/collection/components/input-field/input-field.css +3 -0
- package/dist/collection/components/list/list.css +6 -0
- package/dist/collection/components/list-item/list-item.css +3 -0
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.css +3 -0
- package/dist/collection/components/markdown/markdown.css +3 -0
- package/dist/collection/components/menu-list/menu-list.css +6 -0
- package/dist/collection/components/notched-outline/notched-outline.css +3 -0
- package/dist/collection/components/popover-surface/popover-surface.css +3 -0
- package/dist/collection/components/profile-picture/profile-picture.css +3 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +3 -0
- package/dist/collection/components/radio-button-group/radio-button.css +3 -0
- package/dist/collection/components/select/select.css +6 -0
- package/dist/collection/components/shortcut/shortcut.css +3 -0
- package/dist/collection/components/slider/slider.css +3 -0
- package/dist/collection/components/split-button/split-button.css +3 -0
- package/dist/collection/components/switch/switch.css +3 -0
- package/dist/collection/components/tab-bar/tab-bar.css +3 -0
- package/dist/collection/components/table/table.css +12 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +3 -0
- package/dist/collection/components/text-editor/text-editor.css +3 -0
- package/dist/collection/style/mixins.scss +53 -0
- package/dist/collection/translations/da.js +2 -0
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/de.js +2 -0
- package/dist/collection/translations/de.js.map +1 -1
- package/dist/collection/translations/en.js +2 -0
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +2 -0
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/fr.js +2 -0
- package/dist/collection/translations/fr.js.map +1 -1
- package/dist/collection/translations/nl.js +2 -0
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +2 -0
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +2 -0
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_2.entry.js +1 -1
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +2 -2
- package/dist/esm/limel-collapsible-section.entry.js.map +1 -1
- package/dist/esm/limel-drag-handle.entry.js +30 -0
- package/dist/esm/limel-drag-handle.entry.js.map +1 -0
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +3214 -299
- package/dist/esm/limel-form.entry.js.map +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/esm/limel-linear-progress.entry.js +1 -1
- package/dist/esm/limel-list-item.entry.js +1 -1
- package/dist/esm/limel-profile-picture.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-91c611da.js → translations-9bfde9f4.js} +17 -1
- package/dist/esm/translations-9bfde9f4.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/p-309d0652.entry.js +2 -0
- package/dist/lime-elements/{p-e6245ef7.entry.js.map → p-309d0652.entry.js.map} +1 -1
- package/dist/lime-elements/p-31f1cb08.entry.js +2 -0
- package/dist/lime-elements/p-31f1cb08.entry.js.map +1 -0
- package/dist/lime-elements/{p-cc7f4c81.entry.js → p-3311eaf3.entry.js} +2 -2
- package/dist/lime-elements/{p-aeba4aa4.entry.js → p-40542ccc.entry.js} +2 -2
- package/dist/lime-elements/{p-d349e355.entry.js → p-42e889d8.entry.js} +2 -2
- package/dist/lime-elements/p-5df2361b.js +2 -0
- package/dist/lime-elements/p-5df2361b.js.map +1 -0
- package/dist/lime-elements/{p-b5abf284.entry.js → p-5e976a59.entry.js} +2 -2
- package/dist/lime-elements/{p-6c60172e.entry.js → p-787be044.entry.js} +2 -2
- package/dist/lime-elements/p-8ea3b80a.entry.js +2 -0
- package/dist/lime-elements/p-8ea3b80a.entry.js.map +1 -0
- package/dist/lime-elements/{p-d1aa44e1.entry.js → p-92aa9610.entry.js} +2 -2
- package/dist/lime-elements/{p-8e3c4418.entry.js → p-aa1e7319.entry.js} +2 -2
- package/dist/lime-elements/p-ae267255.entry.js +27 -0
- package/dist/lime-elements/p-ae267255.entry.js.map +1 -0
- package/dist/lime-elements/{p-ed04acfc.entry.js → p-b0acf522.entry.js} +2 -2
- package/dist/lime-elements/{p-f83ebd28.entry.js → p-b7bbb6a5.entry.js} +2 -2
- package/dist/lime-elements/{p-eb396630.entry.js → p-cd2f780a.entry.js} +2 -2
- package/dist/lime-elements/{p-aae161ef.entry.js → p-d79c85e2.entry.js} +2 -2
- package/dist/lime-elements/{p-1b036add.entry.js → p-e00465fa.entry.js} +2 -2
- package/dist/lime-elements/{p-29c2cdc6.entry.js → p-ee5c4112.entry.js} +2 -2
- package/dist/lime-elements/{p-e6bb4d1a.entry.js → p-fbac230b.entry.js} +2 -2
- package/dist/lime-elements/style/mixins.scss +53 -0
- package/dist/scss/mixins.scss +53 -0
- package/dist/types/components/drag-handle/drag-handle.d.ts +46 -0
- package/dist/types/components/form/templates/array-field-collapsible-item.d.ts +3 -1
- package/dist/types/components/form/templates/array-field-simple-item.d.ts +5 -9
- package/dist/types/components/form/templates/array-field.d.ts +35 -4
- package/dist/types/components.d.ts +113 -0
- package/dist/types/translations/da.d.ts +2 -0
- package/dist/types/translations/de.d.ts +2 -0
- package/dist/types/translations/en.d.ts +2 -0
- package/dist/types/translations/fi.d.ts +2 -0
- package/dist/types/translations/fr.d.ts +2 -0
- package/dist/types/translations/nl.d.ts +2 -0
- package/dist/types/translations/no.d.ts +2 -0
- package/dist/types/translations/sv.d.ts +2 -0
- package/package.json +5 -2
- package/dist/cjs/translations-d2be6dd7.js.map +0 -1
- package/dist/esm/translations-91c611da.js.map +0 -1
- package/dist/lime-elements/p-4c88e5d3.js +0 -2
- package/dist/lime-elements/p-4c88e5d3.js.map +0 -1
- package/dist/lime-elements/p-d6d66daa.entry.js +0 -21
- package/dist/lime-elements/p-d6d66daa.entry.js.map +0 -1
- package/dist/lime-elements/p-e6245ef7.entry.js +0 -2
- package/dist/lime-elements/p-ed8aa16c.entry.js +0 -2
- package/dist/lime-elements/p-ed8aa16c.entry.js.map +0 -1
- /package/dist/lime-elements/{p-cc7f4c81.entry.js.map → p-3311eaf3.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-aeba4aa4.entry.js.map → p-40542ccc.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d349e355.entry.js.map → p-42e889d8.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-b5abf284.entry.js.map → p-5e976a59.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-6c60172e.entry.js.map → p-787be044.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d1aa44e1.entry.js.map → p-92aa9610.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8e3c4418.entry.js.map → p-aa1e7319.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ed04acfc.entry.js.map → p-b0acf522.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-f83ebd28.entry.js.map → p-b7bbb6a5.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-eb396630.entry.js.map → p-cd2f780a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-aae161ef.entry.js.map → p-d79c85e2.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-1b036add.entry.js.map → p-e00465fa.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-29c2cdc6.entry.js.map → p-ee5c4112.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e6bb4d1a.entry.js.map → p-fbac230b.entry.js.map} +0 -0
|
@@ -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
|
};
|
|
@@ -39288,31 +39288,28 @@ class CollapsibleItemTemplate extends react.Component {
|
|
|
39288
39288
|
if (this.state.isOpen) {
|
|
39289
39289
|
children = this.props.item.children;
|
|
39290
39290
|
}
|
|
39291
|
+
const dragHandle = this.props.allowItemReorder
|
|
39292
|
+
? react.createElement('limel-drag-handle', {
|
|
39293
|
+
slot: 'header',
|
|
39294
|
+
class: 'drag-handle',
|
|
39295
|
+
})
|
|
39296
|
+
: null;
|
|
39291
39297
|
return react.createElement('limel-collapsible-section', {
|
|
39292
39298
|
header: findTitle(data, schema, formSchema) || 'New item',
|
|
39293
|
-
class: 'limel-form-array-item--object',
|
|
39299
|
+
class: 'array-item limel-form-array-item--object',
|
|
39294
39300
|
ref: (section) => {
|
|
39295
39301
|
this.section = section;
|
|
39296
39302
|
},
|
|
39297
39303
|
'is-open': this.state.isOpen,
|
|
39298
|
-
|
|
39304
|
+
'data-reorder-id': String(this.props.index),
|
|
39305
|
+
'data-reorderable': this.props.allowItemReorder
|
|
39306
|
+
? 'true'
|
|
39307
|
+
: 'false',
|
|
39308
|
+
}, dragHandle, children);
|
|
39299
39309
|
}
|
|
39300
39310
|
setActions(element) {
|
|
39301
|
-
const { item, index, allowItemRemoval
|
|
39311
|
+
const { item, index, allowItemRemoval } = this.props;
|
|
39302
39312
|
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
39313
|
if (allowItemRemoval) {
|
|
39317
39314
|
actions.push({
|
|
39318
39315
|
id: 'remove',
|
|
@@ -39347,14 +39344,6 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39347
39344
|
const { item, index } = this.props;
|
|
39348
39345
|
item.onDropIndexClick(index)(event);
|
|
39349
39346
|
};
|
|
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
39347
|
this.setRemoveButton = (button) => {
|
|
39359
39348
|
if (this.removeButton) {
|
|
39360
39349
|
this.removeButton.removeEventListener('click', this.handleRemove);
|
|
@@ -39364,39 +39353,30 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39364
39353
|
this.removeButton.addEventListener('click', this.handleRemove);
|
|
39365
39354
|
}
|
|
39366
39355
|
};
|
|
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
39356
|
}
|
|
39386
39357
|
componentWillUnmount() {
|
|
39387
39358
|
this.setRemoveButton(undefined);
|
|
39388
|
-
this.setMoveUpButton(undefined);
|
|
39389
|
-
this.setMoveDownButton(undefined);
|
|
39390
39359
|
}
|
|
39391
39360
|
render() {
|
|
39392
|
-
const { item } = this.props;
|
|
39361
|
+
const { item, allowItemReorder } = this.props;
|
|
39393
39362
|
return react.createElement('div', {
|
|
39394
|
-
className: 'limel-form-array-item--simple',
|
|
39395
|
-
|
|
39396
|
-
?
|
|
39397
|
-
|
|
39363
|
+
className: 'array-item limel-form-array-item--simple',
|
|
39364
|
+
'data-reorder-id': String(this.props.dataIndex),
|
|
39365
|
+
'data-reorderable': allowItemReorder ? 'true' : 'false',
|
|
39366
|
+
}, this.props.item.children, this.renderRemoveButton(item), this.renderDragHandle());
|
|
39367
|
+
}
|
|
39368
|
+
renderDragHandle() {
|
|
39369
|
+
if (!this.props.allowItemReorder) {
|
|
39370
|
+
return;
|
|
39371
|
+
}
|
|
39372
|
+
return react.createElement('limel-drag-handle', {
|
|
39373
|
+
class: 'drag-handle',
|
|
39374
|
+
});
|
|
39398
39375
|
}
|
|
39399
39376
|
renderRemoveButton(item) {
|
|
39377
|
+
if (!this.props.allowItemRemoval) {
|
|
39378
|
+
return;
|
|
39379
|
+
}
|
|
39400
39380
|
const props = {
|
|
39401
39381
|
icon: 'trash',
|
|
39402
39382
|
disabled: !item.hasRemove,
|
|
@@ -39404,33 +39384,2794 @@ class SimpleItemTemplate extends react.Component {
|
|
|
39404
39384
|
};
|
|
39405
39385
|
return react.createElement(LIMEL_ICON_BUTTON, props);
|
|
39406
39386
|
}
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39410
|
-
|
|
39411
|
-
|
|
39387
|
+
}
|
|
39388
|
+
|
|
39389
|
+
/**!
|
|
39390
|
+
* Sortable 1.15.6
|
|
39391
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
39392
|
+
* @author owenm <owen23355@gmail.com>
|
|
39393
|
+
* @license MIT
|
|
39394
|
+
*/
|
|
39395
|
+
function ownKeys(object, enumerableOnly) {
|
|
39396
|
+
var keys = Object.keys(object);
|
|
39397
|
+
if (Object.getOwnPropertySymbols) {
|
|
39398
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
39399
|
+
if (enumerableOnly) {
|
|
39400
|
+
symbols = symbols.filter(function (sym) {
|
|
39401
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
39402
|
+
});
|
|
39403
|
+
}
|
|
39404
|
+
keys.push.apply(keys, symbols);
|
|
39405
|
+
}
|
|
39406
|
+
return keys;
|
|
39407
|
+
}
|
|
39408
|
+
function _objectSpread2(target) {
|
|
39409
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39410
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
39411
|
+
if (i % 2) {
|
|
39412
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
39413
|
+
_defineProperty(target, key, source[key]);
|
|
39414
|
+
});
|
|
39415
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
39416
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
39417
|
+
} else {
|
|
39418
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
39419
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
39420
|
+
});
|
|
39421
|
+
}
|
|
39422
|
+
}
|
|
39423
|
+
return target;
|
|
39424
|
+
}
|
|
39425
|
+
function _typeof(obj) {
|
|
39426
|
+
"@babel/helpers - typeof";
|
|
39427
|
+
|
|
39428
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
39429
|
+
_typeof = function (obj) {
|
|
39430
|
+
return typeof obj;
|
|
39431
|
+
};
|
|
39432
|
+
} else {
|
|
39433
|
+
_typeof = function (obj) {
|
|
39434
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
39412
39435
|
};
|
|
39413
|
-
return react.createElement(LIMEL_ICON_BUTTON, props);
|
|
39414
39436
|
}
|
|
39415
|
-
|
|
39416
|
-
|
|
39417
|
-
|
|
39418
|
-
|
|
39419
|
-
|
|
39437
|
+
return _typeof(obj);
|
|
39438
|
+
}
|
|
39439
|
+
function _defineProperty(obj, key, value) {
|
|
39440
|
+
if (key in obj) {
|
|
39441
|
+
Object.defineProperty(obj, key, {
|
|
39442
|
+
value: value,
|
|
39443
|
+
enumerable: true,
|
|
39444
|
+
configurable: true,
|
|
39445
|
+
writable: true
|
|
39446
|
+
});
|
|
39447
|
+
} else {
|
|
39448
|
+
obj[key] = value;
|
|
39449
|
+
}
|
|
39450
|
+
return obj;
|
|
39451
|
+
}
|
|
39452
|
+
function _extends() {
|
|
39453
|
+
_extends = Object.assign || function (target) {
|
|
39454
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39455
|
+
var source = arguments[i];
|
|
39456
|
+
for (var key in source) {
|
|
39457
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
39458
|
+
target[key] = source[key];
|
|
39459
|
+
}
|
|
39460
|
+
}
|
|
39461
|
+
}
|
|
39462
|
+
return target;
|
|
39463
|
+
};
|
|
39464
|
+
return _extends.apply(this, arguments);
|
|
39465
|
+
}
|
|
39466
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
39467
|
+
if (source == null) return {};
|
|
39468
|
+
var target = {};
|
|
39469
|
+
var sourceKeys = Object.keys(source);
|
|
39470
|
+
var key, i;
|
|
39471
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
39472
|
+
key = sourceKeys[i];
|
|
39473
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39474
|
+
target[key] = source[key];
|
|
39475
|
+
}
|
|
39476
|
+
return target;
|
|
39477
|
+
}
|
|
39478
|
+
function _objectWithoutProperties(source, excluded) {
|
|
39479
|
+
if (source == null) return {};
|
|
39480
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
39481
|
+
var key, i;
|
|
39482
|
+
if (Object.getOwnPropertySymbols) {
|
|
39483
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
39484
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
39485
|
+
key = sourceSymbolKeys[i];
|
|
39486
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39487
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39488
|
+
target[key] = source[key];
|
|
39489
|
+
}
|
|
39490
|
+
}
|
|
39491
|
+
return target;
|
|
39492
|
+
}
|
|
39493
|
+
|
|
39494
|
+
var version = "1.15.6";
|
|
39495
|
+
|
|
39496
|
+
function userAgent(pattern) {
|
|
39497
|
+
if (typeof window !== 'undefined' && window.navigator) {
|
|
39498
|
+
return !! /*@__PURE__*/navigator.userAgent.match(pattern);
|
|
39499
|
+
}
|
|
39500
|
+
}
|
|
39501
|
+
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
|
39502
|
+
var Edge = userAgent(/Edge/i);
|
|
39503
|
+
var FireFox = userAgent(/firefox/i);
|
|
39504
|
+
var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
|
|
39505
|
+
var IOS = userAgent(/iP(ad|od|hone)/i);
|
|
39506
|
+
var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
|
|
39507
|
+
|
|
39508
|
+
var captureMode = {
|
|
39509
|
+
capture: false,
|
|
39510
|
+
passive: false
|
|
39511
|
+
};
|
|
39512
|
+
function on(el, event, fn) {
|
|
39513
|
+
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
|
39514
|
+
}
|
|
39515
|
+
function off(el, event, fn) {
|
|
39516
|
+
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
|
39517
|
+
}
|
|
39518
|
+
function matches( /**HTMLElement*/el, /**String*/selector) {
|
|
39519
|
+
if (!selector) return;
|
|
39520
|
+
selector[0] === '>' && (selector = selector.substring(1));
|
|
39521
|
+
if (el) {
|
|
39522
|
+
try {
|
|
39523
|
+
if (el.matches) {
|
|
39524
|
+
return el.matches(selector);
|
|
39525
|
+
} else if (el.msMatchesSelector) {
|
|
39526
|
+
return el.msMatchesSelector(selector);
|
|
39527
|
+
} else if (el.webkitMatchesSelector) {
|
|
39528
|
+
return el.webkitMatchesSelector(selector);
|
|
39529
|
+
}
|
|
39530
|
+
} catch (_) {
|
|
39531
|
+
return false;
|
|
39532
|
+
}
|
|
39533
|
+
}
|
|
39534
|
+
return false;
|
|
39535
|
+
}
|
|
39536
|
+
function getParentOrHost(el) {
|
|
39537
|
+
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
|
39538
|
+
}
|
|
39539
|
+
function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
|
|
39540
|
+
if (el) {
|
|
39541
|
+
ctx = ctx || document;
|
|
39542
|
+
do {
|
|
39543
|
+
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
|
39544
|
+
return el;
|
|
39545
|
+
}
|
|
39546
|
+
if (el === ctx) break;
|
|
39547
|
+
/* jshint boss:true */
|
|
39548
|
+
} while (el = getParentOrHost(el));
|
|
39549
|
+
}
|
|
39550
|
+
return null;
|
|
39551
|
+
}
|
|
39552
|
+
var R_SPACE = /\s+/g;
|
|
39553
|
+
function toggleClass(el, name, state) {
|
|
39554
|
+
if (el && name) {
|
|
39555
|
+
if (el.classList) {
|
|
39556
|
+
el.classList[state ? 'add' : 'remove'](name);
|
|
39557
|
+
} else {
|
|
39558
|
+
var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
|
|
39559
|
+
el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
|
|
39560
|
+
}
|
|
39561
|
+
}
|
|
39562
|
+
}
|
|
39563
|
+
function css(el, prop, val) {
|
|
39564
|
+
var style = el && el.style;
|
|
39565
|
+
if (style) {
|
|
39566
|
+
if (val === void 0) {
|
|
39567
|
+
if (document.defaultView && document.defaultView.getComputedStyle) {
|
|
39568
|
+
val = document.defaultView.getComputedStyle(el, '');
|
|
39569
|
+
} else if (el.currentStyle) {
|
|
39570
|
+
val = el.currentStyle;
|
|
39571
|
+
}
|
|
39572
|
+
return prop === void 0 ? val : val[prop];
|
|
39573
|
+
} else {
|
|
39574
|
+
if (!(prop in style) && prop.indexOf('webkit') === -1) {
|
|
39575
|
+
prop = '-webkit-' + prop;
|
|
39576
|
+
}
|
|
39577
|
+
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
|
39578
|
+
}
|
|
39579
|
+
}
|
|
39580
|
+
}
|
|
39581
|
+
function matrix(el, selfOnly) {
|
|
39582
|
+
var appliedTransforms = '';
|
|
39583
|
+
if (typeof el === 'string') {
|
|
39584
|
+
appliedTransforms = el;
|
|
39585
|
+
} else {
|
|
39586
|
+
do {
|
|
39587
|
+
var transform = css(el, 'transform');
|
|
39588
|
+
if (transform && transform !== 'none') {
|
|
39589
|
+
appliedTransforms = transform + ' ' + appliedTransforms;
|
|
39590
|
+
}
|
|
39591
|
+
/* jshint boss:true */
|
|
39592
|
+
} while (!selfOnly && (el = el.parentNode));
|
|
39593
|
+
}
|
|
39594
|
+
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
39595
|
+
/*jshint -W056 */
|
|
39596
|
+
return matrixFn && new matrixFn(appliedTransforms);
|
|
39597
|
+
}
|
|
39598
|
+
function find(ctx, tagName, iterator) {
|
|
39599
|
+
if (ctx) {
|
|
39600
|
+
var list = ctx.getElementsByTagName(tagName),
|
|
39601
|
+
i = 0,
|
|
39602
|
+
n = list.length;
|
|
39603
|
+
if (iterator) {
|
|
39604
|
+
for (; i < n; i++) {
|
|
39605
|
+
iterator(list[i], i);
|
|
39606
|
+
}
|
|
39607
|
+
}
|
|
39608
|
+
return list;
|
|
39609
|
+
}
|
|
39610
|
+
return [];
|
|
39611
|
+
}
|
|
39612
|
+
function getWindowScrollingElement() {
|
|
39613
|
+
var scrollingElement = document.scrollingElement;
|
|
39614
|
+
if (scrollingElement) {
|
|
39615
|
+
return scrollingElement;
|
|
39616
|
+
} else {
|
|
39617
|
+
return document.documentElement;
|
|
39618
|
+
}
|
|
39619
|
+
}
|
|
39620
|
+
|
|
39621
|
+
/**
|
|
39622
|
+
* Returns the "bounding client rect" of given element
|
|
39623
|
+
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
|
39624
|
+
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
|
39625
|
+
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
|
39626
|
+
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
|
39627
|
+
* @param {[HTMLElement]} container The parent the element will be placed in
|
|
39628
|
+
* @return {Object} The boundingClientRect of el, with specified adjustments
|
|
39629
|
+
*/
|
|
39630
|
+
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
|
39631
|
+
if (!el.getBoundingClientRect && el !== window) return;
|
|
39632
|
+
var elRect, top, left, bottom, right, height, width;
|
|
39633
|
+
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
|
39634
|
+
elRect = el.getBoundingClientRect();
|
|
39635
|
+
top = elRect.top;
|
|
39636
|
+
left = elRect.left;
|
|
39637
|
+
bottom = elRect.bottom;
|
|
39638
|
+
right = elRect.right;
|
|
39639
|
+
height = elRect.height;
|
|
39640
|
+
width = elRect.width;
|
|
39641
|
+
} else {
|
|
39642
|
+
top = 0;
|
|
39643
|
+
left = 0;
|
|
39644
|
+
bottom = window.innerHeight;
|
|
39645
|
+
right = window.innerWidth;
|
|
39646
|
+
height = window.innerHeight;
|
|
39647
|
+
width = window.innerWidth;
|
|
39648
|
+
}
|
|
39649
|
+
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
|
39650
|
+
// Adjust for translate()
|
|
39651
|
+
container = container || el.parentNode;
|
|
39652
|
+
|
|
39653
|
+
// solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
|
39654
|
+
// Not needed on <= IE11
|
|
39655
|
+
if (!IE11OrLess) {
|
|
39656
|
+
do {
|
|
39657
|
+
if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
|
|
39658
|
+
var containerRect = container.getBoundingClientRect();
|
|
39659
|
+
|
|
39660
|
+
// Set relative to edges of padding box of container
|
|
39661
|
+
top -= containerRect.top + parseInt(css(container, 'border-top-width'));
|
|
39662
|
+
left -= containerRect.left + parseInt(css(container, 'border-left-width'));
|
|
39663
|
+
bottom = top + elRect.height;
|
|
39664
|
+
right = left + elRect.width;
|
|
39665
|
+
break;
|
|
39666
|
+
}
|
|
39667
|
+
/* jshint boss:true */
|
|
39668
|
+
} while (container = container.parentNode);
|
|
39669
|
+
}
|
|
39670
|
+
}
|
|
39671
|
+
if (undoScale && el !== window) {
|
|
39672
|
+
// Adjust for scale()
|
|
39673
|
+
var elMatrix = matrix(container || el),
|
|
39674
|
+
scaleX = elMatrix && elMatrix.a,
|
|
39675
|
+
scaleY = elMatrix && elMatrix.d;
|
|
39676
|
+
if (elMatrix) {
|
|
39677
|
+
top /= scaleY;
|
|
39678
|
+
left /= scaleX;
|
|
39679
|
+
width /= scaleX;
|
|
39680
|
+
height /= scaleY;
|
|
39681
|
+
bottom = top + height;
|
|
39682
|
+
right = left + width;
|
|
39683
|
+
}
|
|
39684
|
+
}
|
|
39685
|
+
return {
|
|
39686
|
+
top: top,
|
|
39687
|
+
left: left,
|
|
39688
|
+
bottom: bottom,
|
|
39689
|
+
right: right,
|
|
39690
|
+
width: width,
|
|
39691
|
+
height: height
|
|
39692
|
+
};
|
|
39693
|
+
}
|
|
39694
|
+
|
|
39695
|
+
/**
|
|
39696
|
+
* Checks if a side of an element is scrolled past a side of its parents
|
|
39697
|
+
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
|
39698
|
+
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
|
39699
|
+
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
|
39700
|
+
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
|
39701
|
+
*/
|
|
39702
|
+
function isScrolledPast(el, elSide, parentSide) {
|
|
39703
|
+
var parent = getParentAutoScrollElement(el, true),
|
|
39704
|
+
elSideVal = getRect(el)[elSide];
|
|
39705
|
+
|
|
39706
|
+
/* jshint boss:true */
|
|
39707
|
+
while (parent) {
|
|
39708
|
+
var parentSideVal = getRect(parent)[parentSide],
|
|
39709
|
+
visible = void 0;
|
|
39710
|
+
if (parentSide === 'top' || parentSide === 'left') {
|
|
39711
|
+
visible = elSideVal >= parentSideVal;
|
|
39712
|
+
} else {
|
|
39713
|
+
visible = elSideVal <= parentSideVal;
|
|
39714
|
+
}
|
|
39715
|
+
if (!visible) return parent;
|
|
39716
|
+
if (parent === getWindowScrollingElement()) break;
|
|
39717
|
+
parent = getParentAutoScrollElement(parent, false);
|
|
39718
|
+
}
|
|
39719
|
+
return false;
|
|
39720
|
+
}
|
|
39721
|
+
|
|
39722
|
+
/**
|
|
39723
|
+
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
|
39724
|
+
* and non-draggable elements
|
|
39725
|
+
* @param {HTMLElement} el The parent element
|
|
39726
|
+
* @param {Number} childNum The index of the child
|
|
39727
|
+
* @param {Object} options Parent Sortable's options
|
|
39728
|
+
* @return {HTMLElement} The child at index childNum, or null if not found
|
|
39729
|
+
*/
|
|
39730
|
+
function getChild(el, childNum, options, includeDragEl) {
|
|
39731
|
+
var currentChild = 0,
|
|
39732
|
+
i = 0,
|
|
39733
|
+
children = el.children;
|
|
39734
|
+
while (i < children.length) {
|
|
39735
|
+
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
|
39736
|
+
if (currentChild === childNum) {
|
|
39737
|
+
return children[i];
|
|
39738
|
+
}
|
|
39739
|
+
currentChild++;
|
|
39740
|
+
}
|
|
39741
|
+
i++;
|
|
39742
|
+
}
|
|
39743
|
+
return null;
|
|
39744
|
+
}
|
|
39745
|
+
|
|
39746
|
+
/**
|
|
39747
|
+
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
|
39748
|
+
* @param {HTMLElement} el Parent element
|
|
39749
|
+
* @param {selector} selector Any other elements that should be ignored
|
|
39750
|
+
* @return {HTMLElement} The last child, ignoring ghostEl
|
|
39751
|
+
*/
|
|
39752
|
+
function lastChild(el, selector) {
|
|
39753
|
+
var last = el.lastElementChild;
|
|
39754
|
+
while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
|
|
39755
|
+
last = last.previousElementSibling;
|
|
39756
|
+
}
|
|
39757
|
+
return last || null;
|
|
39758
|
+
}
|
|
39759
|
+
|
|
39760
|
+
/**
|
|
39761
|
+
* Returns the index of an element within its parent for a selected set of
|
|
39762
|
+
* elements
|
|
39763
|
+
* @param {HTMLElement} el
|
|
39764
|
+
* @param {selector} selector
|
|
39765
|
+
* @return {number}
|
|
39766
|
+
*/
|
|
39767
|
+
function index(el, selector) {
|
|
39768
|
+
var index = 0;
|
|
39769
|
+
if (!el || !el.parentNode) {
|
|
39770
|
+
return -1;
|
|
39771
|
+
}
|
|
39772
|
+
|
|
39773
|
+
/* jshint boss:true */
|
|
39774
|
+
while (el = el.previousElementSibling) {
|
|
39775
|
+
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
|
39776
|
+
index++;
|
|
39777
|
+
}
|
|
39778
|
+
}
|
|
39779
|
+
return index;
|
|
39780
|
+
}
|
|
39781
|
+
|
|
39782
|
+
/**
|
|
39783
|
+
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
|
39784
|
+
* The value is returned in real pixels.
|
|
39785
|
+
* @param {HTMLElement} el
|
|
39786
|
+
* @return {Array} Offsets in the format of [left, top]
|
|
39787
|
+
*/
|
|
39788
|
+
function getRelativeScrollOffset(el) {
|
|
39789
|
+
var offsetLeft = 0,
|
|
39790
|
+
offsetTop = 0,
|
|
39791
|
+
winScroller = getWindowScrollingElement();
|
|
39792
|
+
if (el) {
|
|
39793
|
+
do {
|
|
39794
|
+
var elMatrix = matrix(el),
|
|
39795
|
+
scaleX = elMatrix.a,
|
|
39796
|
+
scaleY = elMatrix.d;
|
|
39797
|
+
offsetLeft += el.scrollLeft * scaleX;
|
|
39798
|
+
offsetTop += el.scrollTop * scaleY;
|
|
39799
|
+
} while (el !== winScroller && (el = el.parentNode));
|
|
39800
|
+
}
|
|
39801
|
+
return [offsetLeft, offsetTop];
|
|
39802
|
+
}
|
|
39803
|
+
|
|
39804
|
+
/**
|
|
39805
|
+
* Returns the index of the object within the given array
|
|
39806
|
+
* @param {Array} arr Array that may or may not hold the object
|
|
39807
|
+
* @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
|
|
39808
|
+
* @return {Number} The index of the object in the array, or -1
|
|
39809
|
+
*/
|
|
39810
|
+
function indexOfObject(arr, obj) {
|
|
39811
|
+
for (var i in arr) {
|
|
39812
|
+
if (!arr.hasOwnProperty(i)) continue;
|
|
39813
|
+
for (var key in obj) {
|
|
39814
|
+
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
|
39815
|
+
}
|
|
39816
|
+
}
|
|
39817
|
+
return -1;
|
|
39818
|
+
}
|
|
39819
|
+
function getParentAutoScrollElement(el, includeSelf) {
|
|
39820
|
+
// skip to window
|
|
39821
|
+
if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
|
|
39822
|
+
var elem = el;
|
|
39823
|
+
var gotSelf = false;
|
|
39824
|
+
do {
|
|
39825
|
+
// we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
|
39826
|
+
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
|
39827
|
+
var elemCSS = css(elem);
|
|
39828
|
+
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
|
39829
|
+
if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
|
|
39830
|
+
if (gotSelf || includeSelf) return elem;
|
|
39831
|
+
gotSelf = true;
|
|
39832
|
+
}
|
|
39833
|
+
}
|
|
39834
|
+
/* jshint boss:true */
|
|
39835
|
+
} while (elem = elem.parentNode);
|
|
39836
|
+
return getWindowScrollingElement();
|
|
39837
|
+
}
|
|
39838
|
+
function extend(dst, src) {
|
|
39839
|
+
if (dst && src) {
|
|
39840
|
+
for (var key in src) {
|
|
39841
|
+
if (src.hasOwnProperty(key)) {
|
|
39842
|
+
dst[key] = src[key];
|
|
39843
|
+
}
|
|
39844
|
+
}
|
|
39845
|
+
}
|
|
39846
|
+
return dst;
|
|
39847
|
+
}
|
|
39848
|
+
function isRectEqual(rect1, rect2) {
|
|
39849
|
+
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);
|
|
39850
|
+
}
|
|
39851
|
+
var _throttleTimeout;
|
|
39852
|
+
function throttle(callback, ms) {
|
|
39853
|
+
return function () {
|
|
39854
|
+
if (!_throttleTimeout) {
|
|
39855
|
+
var args = arguments,
|
|
39856
|
+
_this = this;
|
|
39857
|
+
if (args.length === 1) {
|
|
39858
|
+
callback.call(_this, args[0]);
|
|
39859
|
+
} else {
|
|
39860
|
+
callback.apply(_this, args);
|
|
39861
|
+
}
|
|
39862
|
+
_throttleTimeout = setTimeout(function () {
|
|
39863
|
+
_throttleTimeout = void 0;
|
|
39864
|
+
}, ms);
|
|
39865
|
+
}
|
|
39866
|
+
};
|
|
39867
|
+
}
|
|
39868
|
+
function cancelThrottle() {
|
|
39869
|
+
clearTimeout(_throttleTimeout);
|
|
39870
|
+
_throttleTimeout = void 0;
|
|
39871
|
+
}
|
|
39872
|
+
function scrollBy(el, x, y) {
|
|
39873
|
+
el.scrollLeft += x;
|
|
39874
|
+
el.scrollTop += y;
|
|
39875
|
+
}
|
|
39876
|
+
function clone(el) {
|
|
39877
|
+
var Polymer = window.Polymer;
|
|
39878
|
+
var $ = window.jQuery || window.Zepto;
|
|
39879
|
+
if (Polymer && Polymer.dom) {
|
|
39880
|
+
return Polymer.dom(el).cloneNode(true);
|
|
39881
|
+
} else if ($) {
|
|
39882
|
+
return $(el).clone(true)[0];
|
|
39883
|
+
} else {
|
|
39884
|
+
return el.cloneNode(true);
|
|
39885
|
+
}
|
|
39886
|
+
}
|
|
39887
|
+
function getChildContainingRectFromElement(container, options, ghostEl) {
|
|
39888
|
+
var rect = {};
|
|
39889
|
+
Array.from(container.children).forEach(function (child) {
|
|
39890
|
+
var _rect$left, _rect$top, _rect$right, _rect$bottom;
|
|
39891
|
+
if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
|
|
39892
|
+
var childRect = getRect(child);
|
|
39893
|
+
rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
|
|
39894
|
+
rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
|
|
39895
|
+
rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
|
|
39896
|
+
rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
|
|
39897
|
+
});
|
|
39898
|
+
rect.width = rect.right - rect.left;
|
|
39899
|
+
rect.height = rect.bottom - rect.top;
|
|
39900
|
+
rect.x = rect.left;
|
|
39901
|
+
rect.y = rect.top;
|
|
39902
|
+
return rect;
|
|
39903
|
+
}
|
|
39904
|
+
var expando = 'Sortable' + new Date().getTime();
|
|
39905
|
+
|
|
39906
|
+
function AnimationStateManager() {
|
|
39907
|
+
var animationStates = [],
|
|
39908
|
+
animationCallbackId;
|
|
39909
|
+
return {
|
|
39910
|
+
captureAnimationState: function captureAnimationState() {
|
|
39911
|
+
animationStates = [];
|
|
39912
|
+
if (!this.options.animation) return;
|
|
39913
|
+
var children = [].slice.call(this.el.children);
|
|
39914
|
+
children.forEach(function (child) {
|
|
39915
|
+
if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
|
|
39916
|
+
animationStates.push({
|
|
39917
|
+
target: child,
|
|
39918
|
+
rect: getRect(child)
|
|
39919
|
+
});
|
|
39920
|
+
var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
|
|
39921
|
+
|
|
39922
|
+
// If animating: compensate for current animation
|
|
39923
|
+
if (child.thisAnimationDuration) {
|
|
39924
|
+
var childMatrix = matrix(child, true);
|
|
39925
|
+
if (childMatrix) {
|
|
39926
|
+
fromRect.top -= childMatrix.f;
|
|
39927
|
+
fromRect.left -= childMatrix.e;
|
|
39928
|
+
}
|
|
39929
|
+
}
|
|
39930
|
+
child.fromRect = fromRect;
|
|
39931
|
+
});
|
|
39932
|
+
},
|
|
39933
|
+
addAnimationState: function addAnimationState(state) {
|
|
39934
|
+
animationStates.push(state);
|
|
39935
|
+
},
|
|
39936
|
+
removeAnimationState: function removeAnimationState(target) {
|
|
39937
|
+
animationStates.splice(indexOfObject(animationStates, {
|
|
39938
|
+
target: target
|
|
39939
|
+
}), 1);
|
|
39940
|
+
},
|
|
39941
|
+
animateAll: function animateAll(callback) {
|
|
39942
|
+
var _this = this;
|
|
39943
|
+
if (!this.options.animation) {
|
|
39944
|
+
clearTimeout(animationCallbackId);
|
|
39945
|
+
if (typeof callback === 'function') callback();
|
|
39946
|
+
return;
|
|
39947
|
+
}
|
|
39948
|
+
var animating = false,
|
|
39949
|
+
animationTime = 0;
|
|
39950
|
+
animationStates.forEach(function (state) {
|
|
39951
|
+
var time = 0,
|
|
39952
|
+
target = state.target,
|
|
39953
|
+
fromRect = target.fromRect,
|
|
39954
|
+
toRect = getRect(target),
|
|
39955
|
+
prevFromRect = target.prevFromRect,
|
|
39956
|
+
prevToRect = target.prevToRect,
|
|
39957
|
+
animatingRect = state.rect,
|
|
39958
|
+
targetMatrix = matrix(target, true);
|
|
39959
|
+
if (targetMatrix) {
|
|
39960
|
+
// Compensate for current animation
|
|
39961
|
+
toRect.top -= targetMatrix.f;
|
|
39962
|
+
toRect.left -= targetMatrix.e;
|
|
39963
|
+
}
|
|
39964
|
+
target.toRect = toRect;
|
|
39965
|
+
if (target.thisAnimationDuration) {
|
|
39966
|
+
// Could also check if animatingRect is between fromRect and toRect
|
|
39967
|
+
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
|
39968
|
+
// Make sure animatingRect is on line between toRect & fromRect
|
|
39969
|
+
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
|
39970
|
+
// If returning to same place as started from animation and on same axis
|
|
39971
|
+
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
|
39972
|
+
}
|
|
39973
|
+
}
|
|
39974
|
+
|
|
39975
|
+
// if fromRect != toRect: animate
|
|
39976
|
+
if (!isRectEqual(toRect, fromRect)) {
|
|
39977
|
+
target.prevFromRect = fromRect;
|
|
39978
|
+
target.prevToRect = toRect;
|
|
39979
|
+
if (!time) {
|
|
39980
|
+
time = _this.options.animation;
|
|
39981
|
+
}
|
|
39982
|
+
_this.animate(target, animatingRect, toRect, time);
|
|
39983
|
+
}
|
|
39984
|
+
if (time) {
|
|
39985
|
+
animating = true;
|
|
39986
|
+
animationTime = Math.max(animationTime, time);
|
|
39987
|
+
clearTimeout(target.animationResetTimer);
|
|
39988
|
+
target.animationResetTimer = setTimeout(function () {
|
|
39989
|
+
target.animationTime = 0;
|
|
39990
|
+
target.prevFromRect = null;
|
|
39991
|
+
target.fromRect = null;
|
|
39992
|
+
target.prevToRect = null;
|
|
39993
|
+
target.thisAnimationDuration = null;
|
|
39994
|
+
}, time);
|
|
39995
|
+
target.thisAnimationDuration = time;
|
|
39996
|
+
}
|
|
39997
|
+
});
|
|
39998
|
+
clearTimeout(animationCallbackId);
|
|
39999
|
+
if (!animating) {
|
|
40000
|
+
if (typeof callback === 'function') callback();
|
|
40001
|
+
} else {
|
|
40002
|
+
animationCallbackId = setTimeout(function () {
|
|
40003
|
+
if (typeof callback === 'function') callback();
|
|
40004
|
+
}, animationTime);
|
|
40005
|
+
}
|
|
40006
|
+
animationStates = [];
|
|
40007
|
+
},
|
|
40008
|
+
animate: function animate(target, currentRect, toRect, duration) {
|
|
40009
|
+
if (duration) {
|
|
40010
|
+
css(target, 'transition', '');
|
|
40011
|
+
css(target, 'transform', '');
|
|
40012
|
+
var elMatrix = matrix(this.el),
|
|
40013
|
+
scaleX = elMatrix && elMatrix.a,
|
|
40014
|
+
scaleY = elMatrix && elMatrix.d,
|
|
40015
|
+
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
|
40016
|
+
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
|
40017
|
+
target.animatingX = !!translateX;
|
|
40018
|
+
target.animatingY = !!translateY;
|
|
40019
|
+
css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
|
40020
|
+
this.forRepaintDummy = repaint(target); // repaint
|
|
40021
|
+
|
|
40022
|
+
css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
|
|
40023
|
+
css(target, 'transform', 'translate3d(0,0,0)');
|
|
40024
|
+
typeof target.animated === 'number' && clearTimeout(target.animated);
|
|
40025
|
+
target.animated = setTimeout(function () {
|
|
40026
|
+
css(target, 'transition', '');
|
|
40027
|
+
css(target, 'transform', '');
|
|
40028
|
+
target.animated = false;
|
|
40029
|
+
target.animatingX = false;
|
|
40030
|
+
target.animatingY = false;
|
|
40031
|
+
}, duration);
|
|
40032
|
+
}
|
|
40033
|
+
}
|
|
40034
|
+
};
|
|
40035
|
+
}
|
|
40036
|
+
function repaint(target) {
|
|
40037
|
+
return target.offsetWidth;
|
|
40038
|
+
}
|
|
40039
|
+
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
|
40040
|
+
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;
|
|
40041
|
+
}
|
|
40042
|
+
|
|
40043
|
+
var plugins = [];
|
|
40044
|
+
var defaults = {
|
|
40045
|
+
initializeByDefault: true
|
|
40046
|
+
};
|
|
40047
|
+
var PluginManager = {
|
|
40048
|
+
mount: function mount(plugin) {
|
|
40049
|
+
// Set default static properties
|
|
40050
|
+
for (var option in defaults) {
|
|
40051
|
+
if (defaults.hasOwnProperty(option) && !(option in plugin)) {
|
|
40052
|
+
plugin[option] = defaults[option];
|
|
40053
|
+
}
|
|
40054
|
+
}
|
|
40055
|
+
plugins.forEach(function (p) {
|
|
40056
|
+
if (p.pluginName === plugin.pluginName) {
|
|
40057
|
+
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
|
40058
|
+
}
|
|
40059
|
+
});
|
|
40060
|
+
plugins.push(plugin);
|
|
40061
|
+
},
|
|
40062
|
+
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
|
40063
|
+
var _this = this;
|
|
40064
|
+
this.eventCanceled = false;
|
|
40065
|
+
evt.cancel = function () {
|
|
40066
|
+
_this.eventCanceled = true;
|
|
39420
40067
|
};
|
|
39421
|
-
|
|
40068
|
+
var eventNameGlobal = eventName + 'Global';
|
|
40069
|
+
plugins.forEach(function (plugin) {
|
|
40070
|
+
if (!sortable[plugin.pluginName]) return;
|
|
40071
|
+
// Fire global events if it exists in this sortable
|
|
40072
|
+
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
|
40073
|
+
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
|
|
40074
|
+
sortable: sortable
|
|
40075
|
+
}, evt));
|
|
40076
|
+
}
|
|
40077
|
+
|
|
40078
|
+
// Only fire plugin event if plugin is enabled in this sortable,
|
|
40079
|
+
// and plugin has event defined
|
|
40080
|
+
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
|
40081
|
+
sortable[plugin.pluginName][eventName](_objectSpread2({
|
|
40082
|
+
sortable: sortable
|
|
40083
|
+
}, evt));
|
|
40084
|
+
}
|
|
40085
|
+
});
|
|
40086
|
+
},
|
|
40087
|
+
initializePlugins: function initializePlugins(sortable, el, defaults, options) {
|
|
40088
|
+
plugins.forEach(function (plugin) {
|
|
40089
|
+
var pluginName = plugin.pluginName;
|
|
40090
|
+
if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
|
|
40091
|
+
var initialized = new plugin(sortable, el, sortable.options);
|
|
40092
|
+
initialized.sortable = sortable;
|
|
40093
|
+
initialized.options = sortable.options;
|
|
40094
|
+
sortable[pluginName] = initialized;
|
|
40095
|
+
|
|
40096
|
+
// Add default options from plugin
|
|
40097
|
+
_extends(defaults, initialized.defaults);
|
|
40098
|
+
});
|
|
40099
|
+
for (var option in sortable.options) {
|
|
40100
|
+
if (!sortable.options.hasOwnProperty(option)) continue;
|
|
40101
|
+
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
|
40102
|
+
if (typeof modified !== 'undefined') {
|
|
40103
|
+
sortable.options[option] = modified;
|
|
40104
|
+
}
|
|
40105
|
+
}
|
|
40106
|
+
},
|
|
40107
|
+
getEventProperties: function getEventProperties(name, sortable) {
|
|
40108
|
+
var eventProperties = {};
|
|
40109
|
+
plugins.forEach(function (plugin) {
|
|
40110
|
+
if (typeof plugin.eventProperties !== 'function') return;
|
|
40111
|
+
_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
|
40112
|
+
});
|
|
40113
|
+
return eventProperties;
|
|
40114
|
+
},
|
|
40115
|
+
modifyOption: function modifyOption(sortable, name, value) {
|
|
40116
|
+
var modifiedValue;
|
|
40117
|
+
plugins.forEach(function (plugin) {
|
|
40118
|
+
// Plugin must exist on the Sortable
|
|
40119
|
+
if (!sortable[plugin.pluginName]) return;
|
|
40120
|
+
|
|
40121
|
+
// If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
|
40122
|
+
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
|
|
40123
|
+
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
|
40124
|
+
}
|
|
40125
|
+
});
|
|
40126
|
+
return modifiedValue;
|
|
40127
|
+
}
|
|
40128
|
+
};
|
|
40129
|
+
|
|
40130
|
+
function dispatchEvent(_ref) {
|
|
40131
|
+
var sortable = _ref.sortable,
|
|
40132
|
+
rootEl = _ref.rootEl,
|
|
40133
|
+
name = _ref.name,
|
|
40134
|
+
targetEl = _ref.targetEl,
|
|
40135
|
+
cloneEl = _ref.cloneEl,
|
|
40136
|
+
toEl = _ref.toEl,
|
|
40137
|
+
fromEl = _ref.fromEl,
|
|
40138
|
+
oldIndex = _ref.oldIndex,
|
|
40139
|
+
newIndex = _ref.newIndex,
|
|
40140
|
+
oldDraggableIndex = _ref.oldDraggableIndex,
|
|
40141
|
+
newDraggableIndex = _ref.newDraggableIndex,
|
|
40142
|
+
originalEvent = _ref.originalEvent,
|
|
40143
|
+
putSortable = _ref.putSortable,
|
|
40144
|
+
extraEventProperties = _ref.extraEventProperties;
|
|
40145
|
+
sortable = sortable || rootEl && rootEl[expando];
|
|
40146
|
+
if (!sortable) return;
|
|
40147
|
+
var evt,
|
|
40148
|
+
options = sortable.options,
|
|
40149
|
+
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
|
40150
|
+
// Support for new CustomEvent feature
|
|
40151
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
40152
|
+
evt = new CustomEvent(name, {
|
|
40153
|
+
bubbles: true,
|
|
40154
|
+
cancelable: true
|
|
40155
|
+
});
|
|
40156
|
+
} else {
|
|
40157
|
+
evt = document.createEvent('Event');
|
|
40158
|
+
evt.initEvent(name, true, true);
|
|
40159
|
+
}
|
|
40160
|
+
evt.to = toEl || rootEl;
|
|
40161
|
+
evt.from = fromEl || rootEl;
|
|
40162
|
+
evt.item = targetEl || rootEl;
|
|
40163
|
+
evt.clone = cloneEl;
|
|
40164
|
+
evt.oldIndex = oldIndex;
|
|
40165
|
+
evt.newIndex = newIndex;
|
|
40166
|
+
evt.oldDraggableIndex = oldDraggableIndex;
|
|
40167
|
+
evt.newDraggableIndex = newDraggableIndex;
|
|
40168
|
+
evt.originalEvent = originalEvent;
|
|
40169
|
+
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
|
40170
|
+
var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
|
|
40171
|
+
for (var option in allEventProperties) {
|
|
40172
|
+
evt[option] = allEventProperties[option];
|
|
40173
|
+
}
|
|
40174
|
+
if (rootEl) {
|
|
40175
|
+
rootEl.dispatchEvent(evt);
|
|
40176
|
+
}
|
|
40177
|
+
if (options[onName]) {
|
|
40178
|
+
options[onName].call(sortable, evt);
|
|
40179
|
+
}
|
|
40180
|
+
}
|
|
40181
|
+
|
|
40182
|
+
var _excluded = ["evt"];
|
|
40183
|
+
var pluginEvent = function pluginEvent(eventName, sortable) {
|
|
40184
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
40185
|
+
originalEvent = _ref.evt,
|
|
40186
|
+
data = _objectWithoutProperties(_ref, _excluded);
|
|
40187
|
+
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
|
|
40188
|
+
dragEl: dragEl,
|
|
40189
|
+
parentEl: parentEl,
|
|
40190
|
+
ghostEl: ghostEl,
|
|
40191
|
+
rootEl: rootEl,
|
|
40192
|
+
nextEl: nextEl,
|
|
40193
|
+
lastDownEl: lastDownEl,
|
|
40194
|
+
cloneEl: cloneEl,
|
|
40195
|
+
cloneHidden: cloneHidden,
|
|
40196
|
+
dragStarted: moved,
|
|
40197
|
+
putSortable: putSortable,
|
|
40198
|
+
activeSortable: Sortable.active,
|
|
40199
|
+
originalEvent: originalEvent,
|
|
40200
|
+
oldIndex: oldIndex,
|
|
40201
|
+
oldDraggableIndex: oldDraggableIndex,
|
|
40202
|
+
newIndex: newIndex,
|
|
40203
|
+
newDraggableIndex: newDraggableIndex,
|
|
40204
|
+
hideGhostForTarget: _hideGhostForTarget,
|
|
40205
|
+
unhideGhostForTarget: _unhideGhostForTarget,
|
|
40206
|
+
cloneNowHidden: function cloneNowHidden() {
|
|
40207
|
+
cloneHidden = true;
|
|
40208
|
+
},
|
|
40209
|
+
cloneNowShown: function cloneNowShown() {
|
|
40210
|
+
cloneHidden = false;
|
|
40211
|
+
},
|
|
40212
|
+
dispatchSortableEvent: function dispatchSortableEvent(name) {
|
|
40213
|
+
_dispatchEvent({
|
|
40214
|
+
sortable: sortable,
|
|
40215
|
+
name: name,
|
|
40216
|
+
originalEvent: originalEvent
|
|
40217
|
+
});
|
|
40218
|
+
}
|
|
40219
|
+
}, data));
|
|
40220
|
+
};
|
|
40221
|
+
function _dispatchEvent(info) {
|
|
40222
|
+
dispatchEvent(_objectSpread2({
|
|
40223
|
+
putSortable: putSortable,
|
|
40224
|
+
cloneEl: cloneEl,
|
|
40225
|
+
targetEl: dragEl,
|
|
40226
|
+
rootEl: rootEl,
|
|
40227
|
+
oldIndex: oldIndex,
|
|
40228
|
+
oldDraggableIndex: oldDraggableIndex,
|
|
40229
|
+
newIndex: newIndex,
|
|
40230
|
+
newDraggableIndex: newDraggableIndex
|
|
40231
|
+
}, info));
|
|
40232
|
+
}
|
|
40233
|
+
var dragEl,
|
|
40234
|
+
parentEl,
|
|
40235
|
+
ghostEl,
|
|
40236
|
+
rootEl,
|
|
40237
|
+
nextEl,
|
|
40238
|
+
lastDownEl,
|
|
40239
|
+
cloneEl,
|
|
40240
|
+
cloneHidden,
|
|
40241
|
+
oldIndex,
|
|
40242
|
+
newIndex,
|
|
40243
|
+
oldDraggableIndex,
|
|
40244
|
+
newDraggableIndex,
|
|
40245
|
+
activeGroup,
|
|
40246
|
+
putSortable,
|
|
40247
|
+
awaitingDragStarted = false,
|
|
40248
|
+
ignoreNextClick = false,
|
|
40249
|
+
sortables = [],
|
|
40250
|
+
tapEvt,
|
|
40251
|
+
touchEvt,
|
|
40252
|
+
lastDx,
|
|
40253
|
+
lastDy,
|
|
40254
|
+
tapDistanceLeft,
|
|
40255
|
+
tapDistanceTop,
|
|
40256
|
+
moved,
|
|
40257
|
+
lastTarget,
|
|
40258
|
+
lastDirection,
|
|
40259
|
+
pastFirstInvertThresh = false,
|
|
40260
|
+
isCircumstantialInvert = false,
|
|
40261
|
+
targetMoveDistance,
|
|
40262
|
+
// For positioning ghost absolutely
|
|
40263
|
+
ghostRelativeParent,
|
|
40264
|
+
ghostRelativeParentInitialScroll = [],
|
|
40265
|
+
// (left, top)
|
|
40266
|
+
|
|
40267
|
+
_silent = false,
|
|
40268
|
+
savedInputChecked = [];
|
|
40269
|
+
|
|
40270
|
+
/** @const */
|
|
40271
|
+
var documentExists = typeof document !== 'undefined',
|
|
40272
|
+
PositionGhostAbsolutely = IOS,
|
|
40273
|
+
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
|
|
40274
|
+
// This will not pass for IE9, because IE9 DnD only works on anchors
|
|
40275
|
+
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
|
40276
|
+
supportCssPointerEvents = function () {
|
|
40277
|
+
if (!documentExists) return;
|
|
40278
|
+
// false when <= IE11
|
|
40279
|
+
if (IE11OrLess) {
|
|
40280
|
+
return false;
|
|
40281
|
+
}
|
|
40282
|
+
var el = document.createElement('x');
|
|
40283
|
+
el.style.cssText = 'pointer-events:auto';
|
|
40284
|
+
return el.style.pointerEvents === 'auto';
|
|
40285
|
+
}(),
|
|
40286
|
+
_detectDirection = function _detectDirection(el, options) {
|
|
40287
|
+
var elCSS = css(el),
|
|
40288
|
+
elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
|
|
40289
|
+
child1 = getChild(el, 0, options),
|
|
40290
|
+
child2 = getChild(el, 1, options),
|
|
40291
|
+
firstChildCSS = child1 && css(child1),
|
|
40292
|
+
secondChildCSS = child2 && css(child2),
|
|
40293
|
+
firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
|
|
40294
|
+
secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
|
|
40295
|
+
if (elCSS.display === 'flex') {
|
|
40296
|
+
return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
|
40297
|
+
}
|
|
40298
|
+
if (elCSS.display === 'grid') {
|
|
40299
|
+
return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
|
40300
|
+
}
|
|
40301
|
+
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
|
40302
|
+
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
|
40303
|
+
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
|
40304
|
+
}
|
|
40305
|
+
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';
|
|
40306
|
+
},
|
|
40307
|
+
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
|
40308
|
+
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
|
40309
|
+
dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
|
|
40310
|
+
dragElOppLength = vertical ? dragRect.width : dragRect.height,
|
|
40311
|
+
targetS1Opp = vertical ? targetRect.left : targetRect.top,
|
|
40312
|
+
targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
|
|
40313
|
+
targetOppLength = vertical ? targetRect.width : targetRect.height;
|
|
40314
|
+
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
|
40315
|
+
},
|
|
40316
|
+
/**
|
|
40317
|
+
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
|
40318
|
+
* @param {Number} x X position
|
|
40319
|
+
* @param {Number} y Y position
|
|
40320
|
+
* @return {HTMLElement} Element of the first found nearest Sortable
|
|
40321
|
+
*/
|
|
40322
|
+
_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
|
40323
|
+
var ret;
|
|
40324
|
+
sortables.some(function (sortable) {
|
|
40325
|
+
var threshold = sortable[expando].options.emptyInsertThreshold;
|
|
40326
|
+
if (!threshold || lastChild(sortable)) return;
|
|
40327
|
+
var rect = getRect(sortable),
|
|
40328
|
+
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
|
|
40329
|
+
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
|
40330
|
+
if (insideHorizontally && insideVertically) {
|
|
40331
|
+
return ret = sortable;
|
|
40332
|
+
}
|
|
40333
|
+
});
|
|
40334
|
+
return ret;
|
|
40335
|
+
},
|
|
40336
|
+
_prepareGroup = function _prepareGroup(options) {
|
|
40337
|
+
function toFn(value, pull) {
|
|
40338
|
+
return function (to, from, dragEl, evt) {
|
|
40339
|
+
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
|
40340
|
+
if (value == null && (pull || sameGroup)) {
|
|
40341
|
+
// Default pull value
|
|
40342
|
+
// Default pull and put value if same group
|
|
40343
|
+
return true;
|
|
40344
|
+
} else if (value == null || value === false) {
|
|
40345
|
+
return false;
|
|
40346
|
+
} else if (pull && value === 'clone') {
|
|
40347
|
+
return value;
|
|
40348
|
+
} else if (typeof value === 'function') {
|
|
40349
|
+
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
|
40350
|
+
} else {
|
|
40351
|
+
var otherGroup = (pull ? to : from).options.group.name;
|
|
40352
|
+
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
|
40353
|
+
}
|
|
40354
|
+
};
|
|
40355
|
+
}
|
|
40356
|
+
var group = {};
|
|
40357
|
+
var originalGroup = options.group;
|
|
40358
|
+
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
|
40359
|
+
originalGroup = {
|
|
40360
|
+
name: originalGroup
|
|
40361
|
+
};
|
|
40362
|
+
}
|
|
40363
|
+
group.name = originalGroup.name;
|
|
40364
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
|
40365
|
+
group.checkPut = toFn(originalGroup.put);
|
|
40366
|
+
group.revertClone = originalGroup.revertClone;
|
|
40367
|
+
options.group = group;
|
|
40368
|
+
},
|
|
40369
|
+
_hideGhostForTarget = function _hideGhostForTarget() {
|
|
40370
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
40371
|
+
css(ghostEl, 'display', 'none');
|
|
40372
|
+
}
|
|
40373
|
+
},
|
|
40374
|
+
_unhideGhostForTarget = function _unhideGhostForTarget() {
|
|
40375
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
40376
|
+
css(ghostEl, 'display', '');
|
|
40377
|
+
}
|
|
40378
|
+
};
|
|
40379
|
+
|
|
40380
|
+
// #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
|
40381
|
+
if (documentExists && !ChromeForAndroid) {
|
|
40382
|
+
document.addEventListener('click', function (evt) {
|
|
40383
|
+
if (ignoreNextClick) {
|
|
40384
|
+
evt.preventDefault();
|
|
40385
|
+
evt.stopPropagation && evt.stopPropagation();
|
|
40386
|
+
evt.stopImmediatePropagation && evt.stopImmediatePropagation();
|
|
40387
|
+
ignoreNextClick = false;
|
|
40388
|
+
return false;
|
|
40389
|
+
}
|
|
40390
|
+
}, true);
|
|
40391
|
+
}
|
|
40392
|
+
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
|
40393
|
+
if (dragEl) {
|
|
40394
|
+
evt = evt.touches ? evt.touches[0] : evt;
|
|
40395
|
+
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
|
40396
|
+
if (nearest) {
|
|
40397
|
+
// Create imitation event
|
|
40398
|
+
var event = {};
|
|
40399
|
+
for (var i in evt) {
|
|
40400
|
+
if (evt.hasOwnProperty(i)) {
|
|
40401
|
+
event[i] = evt[i];
|
|
40402
|
+
}
|
|
40403
|
+
}
|
|
40404
|
+
event.target = event.rootEl = nearest;
|
|
40405
|
+
event.preventDefault = void 0;
|
|
40406
|
+
event.stopPropagation = void 0;
|
|
40407
|
+
nearest[expando]._onDragOver(event);
|
|
40408
|
+
}
|
|
40409
|
+
}
|
|
40410
|
+
};
|
|
40411
|
+
var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
|
40412
|
+
if (dragEl) {
|
|
40413
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
40414
|
+
}
|
|
40415
|
+
};
|
|
40416
|
+
|
|
40417
|
+
/**
|
|
40418
|
+
* @class Sortable
|
|
40419
|
+
* @param {HTMLElement} el
|
|
40420
|
+
* @param {Object} [options]
|
|
40421
|
+
*/
|
|
40422
|
+
function Sortable(el, options) {
|
|
40423
|
+
if (!(el && el.nodeType && el.nodeType === 1)) {
|
|
40424
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
|
40425
|
+
}
|
|
40426
|
+
this.el = el; // root element
|
|
40427
|
+
this.options = options = _extends({}, options);
|
|
40428
|
+
|
|
40429
|
+
// Export instance
|
|
40430
|
+
el[expando] = this;
|
|
40431
|
+
var defaults = {
|
|
40432
|
+
group: null,
|
|
40433
|
+
sort: true,
|
|
40434
|
+
disabled: false,
|
|
40435
|
+
store: null,
|
|
40436
|
+
handle: null,
|
|
40437
|
+
draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
|
|
40438
|
+
swapThreshold: 1,
|
|
40439
|
+
// percentage; 0 <= x <= 1
|
|
40440
|
+
invertSwap: false,
|
|
40441
|
+
// invert always
|
|
40442
|
+
invertedSwapThreshold: null,
|
|
40443
|
+
// will be set to same as swapThreshold if default
|
|
40444
|
+
removeCloneOnHide: true,
|
|
40445
|
+
direction: function direction() {
|
|
40446
|
+
return _detectDirection(el, this.options);
|
|
40447
|
+
},
|
|
40448
|
+
ghostClass: 'sortable-ghost',
|
|
40449
|
+
chosenClass: 'sortable-chosen',
|
|
40450
|
+
dragClass: 'sortable-drag',
|
|
40451
|
+
ignore: 'a, img',
|
|
40452
|
+
filter: null,
|
|
40453
|
+
preventOnFilter: true,
|
|
40454
|
+
animation: 0,
|
|
40455
|
+
easing: null,
|
|
40456
|
+
setData: function setData(dataTransfer, dragEl) {
|
|
40457
|
+
dataTransfer.setData('Text', dragEl.textContent);
|
|
40458
|
+
},
|
|
40459
|
+
dropBubble: false,
|
|
40460
|
+
dragoverBubble: false,
|
|
40461
|
+
dataIdAttr: 'data-id',
|
|
40462
|
+
delay: 0,
|
|
40463
|
+
delayOnTouchOnly: false,
|
|
40464
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
40465
|
+
forceFallback: false,
|
|
40466
|
+
fallbackClass: 'sortable-fallback',
|
|
40467
|
+
fallbackOnBody: false,
|
|
40468
|
+
fallbackTolerance: 0,
|
|
40469
|
+
fallbackOffset: {
|
|
40470
|
+
x: 0,
|
|
40471
|
+
y: 0
|
|
40472
|
+
},
|
|
40473
|
+
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
40474
|
+
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
|
|
40475
|
+
emptyInsertThreshold: 5
|
|
40476
|
+
};
|
|
40477
|
+
PluginManager.initializePlugins(this, el, defaults);
|
|
40478
|
+
|
|
40479
|
+
// Set default options
|
|
40480
|
+
for (var name in defaults) {
|
|
40481
|
+
!(name in options) && (options[name] = defaults[name]);
|
|
40482
|
+
}
|
|
40483
|
+
_prepareGroup(options);
|
|
40484
|
+
|
|
40485
|
+
// Bind all private methods
|
|
40486
|
+
for (var fn in this) {
|
|
40487
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
40488
|
+
this[fn] = this[fn].bind(this);
|
|
40489
|
+
}
|
|
40490
|
+
}
|
|
40491
|
+
|
|
40492
|
+
// Setup drag mode
|
|
40493
|
+
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
|
40494
|
+
if (this.nativeDraggable) {
|
|
40495
|
+
// Touch start threshold cannot be greater than the native dragstart threshold
|
|
40496
|
+
this.options.touchStartThreshold = 1;
|
|
40497
|
+
}
|
|
40498
|
+
|
|
40499
|
+
// Bind events
|
|
40500
|
+
if (options.supportPointer) {
|
|
40501
|
+
on(el, 'pointerdown', this._onTapStart);
|
|
40502
|
+
} else {
|
|
40503
|
+
on(el, 'mousedown', this._onTapStart);
|
|
40504
|
+
on(el, 'touchstart', this._onTapStart);
|
|
40505
|
+
}
|
|
40506
|
+
if (this.nativeDraggable) {
|
|
40507
|
+
on(el, 'dragover', this);
|
|
40508
|
+
on(el, 'dragenter', this);
|
|
40509
|
+
}
|
|
40510
|
+
sortables.push(this.el);
|
|
40511
|
+
|
|
40512
|
+
// Restore sorting
|
|
40513
|
+
options.store && options.store.get && this.sort(options.store.get(this) || []);
|
|
40514
|
+
|
|
40515
|
+
// Add animation state manager
|
|
40516
|
+
_extends(this, AnimationStateManager());
|
|
40517
|
+
}
|
|
40518
|
+
Sortable.prototype = /** @lends Sortable.prototype */{
|
|
40519
|
+
constructor: Sortable,
|
|
40520
|
+
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
|
40521
|
+
if (!this.el.contains(target) && target !== this.el) {
|
|
40522
|
+
lastTarget = null;
|
|
40523
|
+
}
|
|
40524
|
+
},
|
|
40525
|
+
_getDirection: function _getDirection(evt, target) {
|
|
40526
|
+
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
|
40527
|
+
},
|
|
40528
|
+
_onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
|
|
40529
|
+
if (!evt.cancelable) return;
|
|
40530
|
+
var _this = this,
|
|
40531
|
+
el = this.el,
|
|
40532
|
+
options = this.options,
|
|
40533
|
+
preventOnFilter = options.preventOnFilter,
|
|
40534
|
+
type = evt.type,
|
|
40535
|
+
touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
|
|
40536
|
+
target = (touch || evt).target,
|
|
40537
|
+
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
|
|
40538
|
+
filter = options.filter;
|
|
40539
|
+
_saveInputCheckedState(el);
|
|
40540
|
+
|
|
40541
|
+
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
|
40542
|
+
if (dragEl) {
|
|
40543
|
+
return;
|
|
40544
|
+
}
|
|
40545
|
+
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
|
40546
|
+
return; // only left button and enabled
|
|
40547
|
+
}
|
|
40548
|
+
|
|
40549
|
+
// cancel dnd if original target is content editable
|
|
40550
|
+
if (originalTarget.isContentEditable) {
|
|
40551
|
+
return;
|
|
40552
|
+
}
|
|
40553
|
+
|
|
40554
|
+
// Safari ignores further event handling after mousedown
|
|
40555
|
+
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
|
|
40556
|
+
return;
|
|
40557
|
+
}
|
|
40558
|
+
target = closest(target, options.draggable, el, false);
|
|
40559
|
+
if (target && target.animated) {
|
|
40560
|
+
return;
|
|
40561
|
+
}
|
|
40562
|
+
if (lastDownEl === target) {
|
|
40563
|
+
// Ignoring duplicate `down`
|
|
40564
|
+
return;
|
|
40565
|
+
}
|
|
40566
|
+
|
|
40567
|
+
// Get the index of the dragged element within its parent
|
|
40568
|
+
oldIndex = index(target);
|
|
40569
|
+
oldDraggableIndex = index(target, options.draggable);
|
|
40570
|
+
|
|
40571
|
+
// Check filter
|
|
40572
|
+
if (typeof filter === 'function') {
|
|
40573
|
+
if (filter.call(this, evt, target, this)) {
|
|
40574
|
+
_dispatchEvent({
|
|
40575
|
+
sortable: _this,
|
|
40576
|
+
rootEl: originalTarget,
|
|
40577
|
+
name: 'filter',
|
|
40578
|
+
targetEl: target,
|
|
40579
|
+
toEl: el,
|
|
40580
|
+
fromEl: el
|
|
40581
|
+
});
|
|
40582
|
+
pluginEvent('filter', _this, {
|
|
40583
|
+
evt: evt
|
|
40584
|
+
});
|
|
40585
|
+
preventOnFilter && evt.preventDefault();
|
|
40586
|
+
return; // cancel dnd
|
|
40587
|
+
}
|
|
40588
|
+
} else if (filter) {
|
|
40589
|
+
filter = filter.split(',').some(function (criteria) {
|
|
40590
|
+
criteria = closest(originalTarget, criteria.trim(), el, false);
|
|
40591
|
+
if (criteria) {
|
|
40592
|
+
_dispatchEvent({
|
|
40593
|
+
sortable: _this,
|
|
40594
|
+
rootEl: criteria,
|
|
40595
|
+
name: 'filter',
|
|
40596
|
+
targetEl: target,
|
|
40597
|
+
fromEl: el,
|
|
40598
|
+
toEl: el
|
|
40599
|
+
});
|
|
40600
|
+
pluginEvent('filter', _this, {
|
|
40601
|
+
evt: evt
|
|
40602
|
+
});
|
|
40603
|
+
return true;
|
|
40604
|
+
}
|
|
40605
|
+
});
|
|
40606
|
+
if (filter) {
|
|
40607
|
+
preventOnFilter && evt.preventDefault();
|
|
40608
|
+
return; // cancel dnd
|
|
40609
|
+
}
|
|
40610
|
+
}
|
|
40611
|
+
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
|
40612
|
+
return;
|
|
40613
|
+
}
|
|
40614
|
+
|
|
40615
|
+
// Prepare `dragstart`
|
|
40616
|
+
this._prepareDragStart(evt, touch, target);
|
|
40617
|
+
},
|
|
40618
|
+
_prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
|
|
40619
|
+
var _this = this,
|
|
40620
|
+
el = _this.el,
|
|
40621
|
+
options = _this.options,
|
|
40622
|
+
ownerDocument = el.ownerDocument,
|
|
40623
|
+
dragStartFn;
|
|
40624
|
+
if (target && !dragEl && target.parentNode === el) {
|
|
40625
|
+
var dragRect = getRect(target);
|
|
40626
|
+
rootEl = el;
|
|
40627
|
+
dragEl = target;
|
|
40628
|
+
parentEl = dragEl.parentNode;
|
|
40629
|
+
nextEl = dragEl.nextSibling;
|
|
40630
|
+
lastDownEl = target;
|
|
40631
|
+
activeGroup = options.group;
|
|
40632
|
+
Sortable.dragged = dragEl;
|
|
40633
|
+
tapEvt = {
|
|
40634
|
+
target: dragEl,
|
|
40635
|
+
clientX: (touch || evt).clientX,
|
|
40636
|
+
clientY: (touch || evt).clientY
|
|
40637
|
+
};
|
|
40638
|
+
tapDistanceLeft = tapEvt.clientX - dragRect.left;
|
|
40639
|
+
tapDistanceTop = tapEvt.clientY - dragRect.top;
|
|
40640
|
+
this._lastX = (touch || evt).clientX;
|
|
40641
|
+
this._lastY = (touch || evt).clientY;
|
|
40642
|
+
dragEl.style['will-change'] = 'all';
|
|
40643
|
+
dragStartFn = function dragStartFn() {
|
|
40644
|
+
pluginEvent('delayEnded', _this, {
|
|
40645
|
+
evt: evt
|
|
40646
|
+
});
|
|
40647
|
+
if (Sortable.eventCanceled) {
|
|
40648
|
+
_this._onDrop();
|
|
40649
|
+
return;
|
|
40650
|
+
}
|
|
40651
|
+
// Delayed drag has been triggered
|
|
40652
|
+
// we can re-enable the events: touchmove/mousemove
|
|
40653
|
+
_this._disableDelayedDragEvents();
|
|
40654
|
+
if (!FireFox && _this.nativeDraggable) {
|
|
40655
|
+
dragEl.draggable = true;
|
|
40656
|
+
}
|
|
40657
|
+
|
|
40658
|
+
// Bind the events: dragstart/dragend
|
|
40659
|
+
_this._triggerDragStart(evt, touch);
|
|
40660
|
+
|
|
40661
|
+
// Drag start event
|
|
40662
|
+
_dispatchEvent({
|
|
40663
|
+
sortable: _this,
|
|
40664
|
+
name: 'choose',
|
|
40665
|
+
originalEvent: evt
|
|
40666
|
+
});
|
|
40667
|
+
|
|
40668
|
+
// Chosen item
|
|
40669
|
+
toggleClass(dragEl, options.chosenClass, true);
|
|
40670
|
+
};
|
|
40671
|
+
|
|
40672
|
+
// Disable "draggable"
|
|
40673
|
+
options.ignore.split(',').forEach(function (criteria) {
|
|
40674
|
+
find(dragEl, criteria.trim(), _disableDraggable);
|
|
40675
|
+
});
|
|
40676
|
+
on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
|
|
40677
|
+
on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
|
|
40678
|
+
on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
|
|
40679
|
+
if (options.supportPointer) {
|
|
40680
|
+
on(ownerDocument, 'pointerup', _this._onDrop);
|
|
40681
|
+
// Native D&D triggers pointercancel
|
|
40682
|
+
!this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
|
|
40683
|
+
} else {
|
|
40684
|
+
on(ownerDocument, 'mouseup', _this._onDrop);
|
|
40685
|
+
on(ownerDocument, 'touchend', _this._onDrop);
|
|
40686
|
+
on(ownerDocument, 'touchcancel', _this._onDrop);
|
|
40687
|
+
}
|
|
40688
|
+
|
|
40689
|
+
// Make dragEl draggable (must be before delay for FireFox)
|
|
40690
|
+
if (FireFox && this.nativeDraggable) {
|
|
40691
|
+
this.options.touchStartThreshold = 4;
|
|
40692
|
+
dragEl.draggable = true;
|
|
40693
|
+
}
|
|
40694
|
+
pluginEvent('delayStart', this, {
|
|
40695
|
+
evt: evt
|
|
40696
|
+
});
|
|
40697
|
+
|
|
40698
|
+
// Delay is impossible for native DnD in Edge or IE
|
|
40699
|
+
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
|
40700
|
+
if (Sortable.eventCanceled) {
|
|
40701
|
+
this._onDrop();
|
|
40702
|
+
return;
|
|
40703
|
+
}
|
|
40704
|
+
// If the user moves the pointer or let go the click or touch
|
|
40705
|
+
// before the delay has been reached:
|
|
40706
|
+
// disable the delayed drag
|
|
40707
|
+
if (options.supportPointer) {
|
|
40708
|
+
on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
|
|
40709
|
+
on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
|
|
40710
|
+
} else {
|
|
40711
|
+
on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
|
40712
|
+
on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
|
40713
|
+
on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
|
40714
|
+
}
|
|
40715
|
+
on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
|
|
40716
|
+
on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
|
|
40717
|
+
options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
|
|
40718
|
+
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
|
40719
|
+
} else {
|
|
40720
|
+
dragStartFn();
|
|
40721
|
+
}
|
|
40722
|
+
}
|
|
40723
|
+
},
|
|
40724
|
+
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
|
|
40725
|
+
var touch = e.touches ? e.touches[0] : e;
|
|
40726
|
+
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))) {
|
|
40727
|
+
this._disableDelayedDrag();
|
|
40728
|
+
}
|
|
40729
|
+
},
|
|
40730
|
+
_disableDelayedDrag: function _disableDelayedDrag() {
|
|
40731
|
+
dragEl && _disableDraggable(dragEl);
|
|
40732
|
+
clearTimeout(this._dragStartTimer);
|
|
40733
|
+
this._disableDelayedDragEvents();
|
|
40734
|
+
},
|
|
40735
|
+
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
|
40736
|
+
var ownerDocument = this.el.ownerDocument;
|
|
40737
|
+
off(ownerDocument, 'mouseup', this._disableDelayedDrag);
|
|
40738
|
+
off(ownerDocument, 'touchend', this._disableDelayedDrag);
|
|
40739
|
+
off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
|
|
40740
|
+
off(ownerDocument, 'pointerup', this._disableDelayedDrag);
|
|
40741
|
+
off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
|
|
40742
|
+
off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
|
|
40743
|
+
off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
|
40744
|
+
off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
|
40745
|
+
},
|
|
40746
|
+
_triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
|
|
40747
|
+
touch = touch || evt.pointerType == 'touch' && evt;
|
|
40748
|
+
if (!this.nativeDraggable || touch) {
|
|
40749
|
+
if (this.options.supportPointer) {
|
|
40750
|
+
on(document, 'pointermove', this._onTouchMove);
|
|
40751
|
+
} else if (touch) {
|
|
40752
|
+
on(document, 'touchmove', this._onTouchMove);
|
|
40753
|
+
} else {
|
|
40754
|
+
on(document, 'mousemove', this._onTouchMove);
|
|
40755
|
+
}
|
|
40756
|
+
} else {
|
|
40757
|
+
on(dragEl, 'dragend', this);
|
|
40758
|
+
on(rootEl, 'dragstart', this._onDragStart);
|
|
40759
|
+
}
|
|
40760
|
+
try {
|
|
40761
|
+
if (document.selection) {
|
|
40762
|
+
_nextTick(function () {
|
|
40763
|
+
document.selection.empty();
|
|
40764
|
+
});
|
|
40765
|
+
} else {
|
|
40766
|
+
window.getSelection().removeAllRanges();
|
|
40767
|
+
}
|
|
40768
|
+
} catch (err) {}
|
|
40769
|
+
},
|
|
40770
|
+
_dragStarted: function _dragStarted(fallback, evt) {
|
|
40771
|
+
awaitingDragStarted = false;
|
|
40772
|
+
if (rootEl && dragEl) {
|
|
40773
|
+
pluginEvent('dragStarted', this, {
|
|
40774
|
+
evt: evt
|
|
40775
|
+
});
|
|
40776
|
+
if (this.nativeDraggable) {
|
|
40777
|
+
on(document, 'dragover', _checkOutsideTargetEl);
|
|
40778
|
+
}
|
|
40779
|
+
var options = this.options;
|
|
40780
|
+
|
|
40781
|
+
// Apply effect
|
|
40782
|
+
!fallback && toggleClass(dragEl, options.dragClass, false);
|
|
40783
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
40784
|
+
Sortable.active = this;
|
|
40785
|
+
fallback && this._appendGhost();
|
|
40786
|
+
|
|
40787
|
+
// Drag start event
|
|
40788
|
+
_dispatchEvent({
|
|
40789
|
+
sortable: this,
|
|
40790
|
+
name: 'start',
|
|
40791
|
+
originalEvent: evt
|
|
40792
|
+
});
|
|
40793
|
+
} else {
|
|
40794
|
+
this._nulling();
|
|
40795
|
+
}
|
|
40796
|
+
},
|
|
40797
|
+
_emulateDragOver: function _emulateDragOver() {
|
|
40798
|
+
if (touchEvt) {
|
|
40799
|
+
this._lastX = touchEvt.clientX;
|
|
40800
|
+
this._lastY = touchEvt.clientY;
|
|
40801
|
+
_hideGhostForTarget();
|
|
40802
|
+
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
40803
|
+
var parent = target;
|
|
40804
|
+
while (target && target.shadowRoot) {
|
|
40805
|
+
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
40806
|
+
if (target === parent) break;
|
|
40807
|
+
parent = target;
|
|
40808
|
+
}
|
|
40809
|
+
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
|
40810
|
+
if (parent) {
|
|
40811
|
+
do {
|
|
40812
|
+
if (parent[expando]) {
|
|
40813
|
+
var inserted = void 0;
|
|
40814
|
+
inserted = parent[expando]._onDragOver({
|
|
40815
|
+
clientX: touchEvt.clientX,
|
|
40816
|
+
clientY: touchEvt.clientY,
|
|
40817
|
+
target: target,
|
|
40818
|
+
rootEl: parent
|
|
40819
|
+
});
|
|
40820
|
+
if (inserted && !this.options.dragoverBubble) {
|
|
40821
|
+
break;
|
|
40822
|
+
}
|
|
40823
|
+
}
|
|
40824
|
+
target = parent; // store last element
|
|
40825
|
+
}
|
|
40826
|
+
/* jshint boss:true */ while (parent = getParentOrHost(parent));
|
|
40827
|
+
}
|
|
40828
|
+
_unhideGhostForTarget();
|
|
40829
|
+
}
|
|
40830
|
+
},
|
|
40831
|
+
_onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
|
|
40832
|
+
if (tapEvt) {
|
|
40833
|
+
var options = this.options,
|
|
40834
|
+
fallbackTolerance = options.fallbackTolerance,
|
|
40835
|
+
fallbackOffset = options.fallbackOffset,
|
|
40836
|
+
touch = evt.touches ? evt.touches[0] : evt,
|
|
40837
|
+
ghostMatrix = ghostEl && matrix(ghostEl, true),
|
|
40838
|
+
scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
|
|
40839
|
+
scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
|
|
40840
|
+
relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
|
|
40841
|
+
dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
|
|
40842
|
+
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
|
|
40843
|
+
|
|
40844
|
+
// only set the status to dragging, when we are actually dragging
|
|
40845
|
+
if (!Sortable.active && !awaitingDragStarted) {
|
|
40846
|
+
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
|
40847
|
+
return;
|
|
40848
|
+
}
|
|
40849
|
+
this._onDragStart(evt, true);
|
|
40850
|
+
}
|
|
40851
|
+
if (ghostEl) {
|
|
40852
|
+
if (ghostMatrix) {
|
|
40853
|
+
ghostMatrix.e += dx - (lastDx || 0);
|
|
40854
|
+
ghostMatrix.f += dy - (lastDy || 0);
|
|
40855
|
+
} else {
|
|
40856
|
+
ghostMatrix = {
|
|
40857
|
+
a: 1,
|
|
40858
|
+
b: 0,
|
|
40859
|
+
c: 0,
|
|
40860
|
+
d: 1,
|
|
40861
|
+
e: dx,
|
|
40862
|
+
f: dy
|
|
40863
|
+
};
|
|
40864
|
+
}
|
|
40865
|
+
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
|
40866
|
+
css(ghostEl, 'webkitTransform', cssMatrix);
|
|
40867
|
+
css(ghostEl, 'mozTransform', cssMatrix);
|
|
40868
|
+
css(ghostEl, 'msTransform', cssMatrix);
|
|
40869
|
+
css(ghostEl, 'transform', cssMatrix);
|
|
40870
|
+
lastDx = dx;
|
|
40871
|
+
lastDy = dy;
|
|
40872
|
+
touchEvt = touch;
|
|
40873
|
+
}
|
|
40874
|
+
evt.cancelable && evt.preventDefault();
|
|
40875
|
+
}
|
|
40876
|
+
},
|
|
40877
|
+
_appendGhost: function _appendGhost() {
|
|
40878
|
+
// Bug if using scale(): https://stackoverflow.com/questions/2637058
|
|
40879
|
+
// Not being adjusted for
|
|
40880
|
+
if (!ghostEl) {
|
|
40881
|
+
var container = this.options.fallbackOnBody ? document.body : rootEl,
|
|
40882
|
+
rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
|
|
40883
|
+
options = this.options;
|
|
40884
|
+
|
|
40885
|
+
// Position absolutely
|
|
40886
|
+
if (PositionGhostAbsolutely) {
|
|
40887
|
+
// Get relatively positioned parent
|
|
40888
|
+
ghostRelativeParent = container;
|
|
40889
|
+
while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
|
|
40890
|
+
ghostRelativeParent = ghostRelativeParent.parentNode;
|
|
40891
|
+
}
|
|
40892
|
+
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
|
40893
|
+
if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
|
|
40894
|
+
rect.top += ghostRelativeParent.scrollTop;
|
|
40895
|
+
rect.left += ghostRelativeParent.scrollLeft;
|
|
40896
|
+
} else {
|
|
40897
|
+
ghostRelativeParent = getWindowScrollingElement();
|
|
40898
|
+
}
|
|
40899
|
+
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
|
40900
|
+
}
|
|
40901
|
+
ghostEl = dragEl.cloneNode(true);
|
|
40902
|
+
toggleClass(ghostEl, options.ghostClass, false);
|
|
40903
|
+
toggleClass(ghostEl, options.fallbackClass, true);
|
|
40904
|
+
toggleClass(ghostEl, options.dragClass, true);
|
|
40905
|
+
css(ghostEl, 'transition', '');
|
|
40906
|
+
css(ghostEl, 'transform', '');
|
|
40907
|
+
css(ghostEl, 'box-sizing', 'border-box');
|
|
40908
|
+
css(ghostEl, 'margin', 0);
|
|
40909
|
+
css(ghostEl, 'top', rect.top);
|
|
40910
|
+
css(ghostEl, 'left', rect.left);
|
|
40911
|
+
css(ghostEl, 'width', rect.width);
|
|
40912
|
+
css(ghostEl, 'height', rect.height);
|
|
40913
|
+
css(ghostEl, 'opacity', '0.8');
|
|
40914
|
+
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
|
|
40915
|
+
css(ghostEl, 'zIndex', '100000');
|
|
40916
|
+
css(ghostEl, 'pointerEvents', 'none');
|
|
40917
|
+
Sortable.ghost = ghostEl;
|
|
40918
|
+
container.appendChild(ghostEl);
|
|
40919
|
+
|
|
40920
|
+
// Set transform-origin
|
|
40921
|
+
css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
|
|
40922
|
+
}
|
|
40923
|
+
},
|
|
40924
|
+
_onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
|
|
40925
|
+
var _this = this;
|
|
40926
|
+
var dataTransfer = evt.dataTransfer;
|
|
40927
|
+
var options = _this.options;
|
|
40928
|
+
pluginEvent('dragStart', this, {
|
|
40929
|
+
evt: evt
|
|
40930
|
+
});
|
|
40931
|
+
if (Sortable.eventCanceled) {
|
|
40932
|
+
this._onDrop();
|
|
40933
|
+
return;
|
|
40934
|
+
}
|
|
40935
|
+
pluginEvent('setupClone', this);
|
|
40936
|
+
if (!Sortable.eventCanceled) {
|
|
40937
|
+
cloneEl = clone(dragEl);
|
|
40938
|
+
cloneEl.removeAttribute("id");
|
|
40939
|
+
cloneEl.draggable = false;
|
|
40940
|
+
cloneEl.style['will-change'] = '';
|
|
40941
|
+
this._hideClone();
|
|
40942
|
+
toggleClass(cloneEl, this.options.chosenClass, false);
|
|
40943
|
+
Sortable.clone = cloneEl;
|
|
40944
|
+
}
|
|
40945
|
+
|
|
40946
|
+
// #1143: IFrame support workaround
|
|
40947
|
+
_this.cloneId = _nextTick(function () {
|
|
40948
|
+
pluginEvent('clone', _this);
|
|
40949
|
+
if (Sortable.eventCanceled) return;
|
|
40950
|
+
if (!_this.options.removeCloneOnHide) {
|
|
40951
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
40952
|
+
}
|
|
40953
|
+
_this._hideClone();
|
|
40954
|
+
_dispatchEvent({
|
|
40955
|
+
sortable: _this,
|
|
40956
|
+
name: 'clone'
|
|
40957
|
+
});
|
|
40958
|
+
});
|
|
40959
|
+
!fallback && toggleClass(dragEl, options.dragClass, true);
|
|
40960
|
+
|
|
40961
|
+
// Set proper drop events
|
|
40962
|
+
if (fallback) {
|
|
40963
|
+
ignoreNextClick = true;
|
|
40964
|
+
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
|
40965
|
+
} else {
|
|
40966
|
+
// Undo what was set in _prepareDragStart before drag started
|
|
40967
|
+
off(document, 'mouseup', _this._onDrop);
|
|
40968
|
+
off(document, 'touchend', _this._onDrop);
|
|
40969
|
+
off(document, 'touchcancel', _this._onDrop);
|
|
40970
|
+
if (dataTransfer) {
|
|
40971
|
+
dataTransfer.effectAllowed = 'move';
|
|
40972
|
+
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
|
40973
|
+
}
|
|
40974
|
+
on(document, 'drop', _this);
|
|
40975
|
+
|
|
40976
|
+
// #1276 fix:
|
|
40977
|
+
css(dragEl, 'transform', 'translateZ(0)');
|
|
40978
|
+
}
|
|
40979
|
+
awaitingDragStarted = true;
|
|
40980
|
+
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
|
40981
|
+
on(document, 'selectstart', _this);
|
|
40982
|
+
moved = true;
|
|
40983
|
+
window.getSelection().removeAllRanges();
|
|
40984
|
+
if (Safari) {
|
|
40985
|
+
css(document.body, 'user-select', 'none');
|
|
40986
|
+
}
|
|
40987
|
+
},
|
|
40988
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
40989
|
+
_onDragOver: function _onDragOver( /**Event*/evt) {
|
|
40990
|
+
var el = this.el,
|
|
40991
|
+
target = evt.target,
|
|
40992
|
+
dragRect,
|
|
40993
|
+
targetRect,
|
|
40994
|
+
revert,
|
|
40995
|
+
options = this.options,
|
|
40996
|
+
group = options.group,
|
|
40997
|
+
activeSortable = Sortable.active,
|
|
40998
|
+
isOwner = activeGroup === group,
|
|
40999
|
+
canSort = options.sort,
|
|
41000
|
+
fromSortable = putSortable || activeSortable,
|
|
41001
|
+
vertical,
|
|
41002
|
+
_this = this,
|
|
41003
|
+
completedFired = false;
|
|
41004
|
+
if (_silent) return;
|
|
41005
|
+
function dragOverEvent(name, extra) {
|
|
41006
|
+
pluginEvent(name, _this, _objectSpread2({
|
|
41007
|
+
evt: evt,
|
|
41008
|
+
isOwner: isOwner,
|
|
41009
|
+
axis: vertical ? 'vertical' : 'horizontal',
|
|
41010
|
+
revert: revert,
|
|
41011
|
+
dragRect: dragRect,
|
|
41012
|
+
targetRect: targetRect,
|
|
41013
|
+
canSort: canSort,
|
|
41014
|
+
fromSortable: fromSortable,
|
|
41015
|
+
target: target,
|
|
41016
|
+
completed: completed,
|
|
41017
|
+
onMove: function onMove(target, after) {
|
|
41018
|
+
return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
|
|
41019
|
+
},
|
|
41020
|
+
changed: changed
|
|
41021
|
+
}, extra));
|
|
41022
|
+
}
|
|
41023
|
+
|
|
41024
|
+
// Capture animation state
|
|
41025
|
+
function capture() {
|
|
41026
|
+
dragOverEvent('dragOverAnimationCapture');
|
|
41027
|
+
_this.captureAnimationState();
|
|
41028
|
+
if (_this !== fromSortable) {
|
|
41029
|
+
fromSortable.captureAnimationState();
|
|
41030
|
+
}
|
|
41031
|
+
}
|
|
41032
|
+
|
|
41033
|
+
// Return invocation when dragEl is inserted (or completed)
|
|
41034
|
+
function completed(insertion) {
|
|
41035
|
+
dragOverEvent('dragOverCompleted', {
|
|
41036
|
+
insertion: insertion
|
|
41037
|
+
});
|
|
41038
|
+
if (insertion) {
|
|
41039
|
+
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
|
41040
|
+
if (isOwner) {
|
|
41041
|
+
activeSortable._hideClone();
|
|
41042
|
+
} else {
|
|
41043
|
+
activeSortable._showClone(_this);
|
|
41044
|
+
}
|
|
41045
|
+
if (_this !== fromSortable) {
|
|
41046
|
+
// Set ghost class to new sortable's ghost class
|
|
41047
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
|
41048
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
41049
|
+
}
|
|
41050
|
+
if (putSortable !== _this && _this !== Sortable.active) {
|
|
41051
|
+
putSortable = _this;
|
|
41052
|
+
} else if (_this === Sortable.active && putSortable) {
|
|
41053
|
+
putSortable = null;
|
|
41054
|
+
}
|
|
41055
|
+
|
|
41056
|
+
// Animation
|
|
41057
|
+
if (fromSortable === _this) {
|
|
41058
|
+
_this._ignoreWhileAnimating = target;
|
|
41059
|
+
}
|
|
41060
|
+
_this.animateAll(function () {
|
|
41061
|
+
dragOverEvent('dragOverAnimationComplete');
|
|
41062
|
+
_this._ignoreWhileAnimating = null;
|
|
41063
|
+
});
|
|
41064
|
+
if (_this !== fromSortable) {
|
|
41065
|
+
fromSortable.animateAll();
|
|
41066
|
+
fromSortable._ignoreWhileAnimating = null;
|
|
41067
|
+
}
|
|
41068
|
+
}
|
|
41069
|
+
|
|
41070
|
+
// Null lastTarget if it is not inside a previously swapped element
|
|
41071
|
+
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
|
41072
|
+
lastTarget = null;
|
|
41073
|
+
}
|
|
41074
|
+
|
|
41075
|
+
// no bubbling and not fallback
|
|
41076
|
+
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
|
41077
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
41078
|
+
|
|
41079
|
+
// Do not detect for empty insert if already inserted
|
|
41080
|
+
!insertion && nearestEmptyInsertDetectEvent(evt);
|
|
41081
|
+
}
|
|
41082
|
+
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
|
41083
|
+
return completedFired = true;
|
|
41084
|
+
}
|
|
41085
|
+
|
|
41086
|
+
// Call when dragEl has been inserted
|
|
41087
|
+
function changed() {
|
|
41088
|
+
newIndex = index(dragEl);
|
|
41089
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41090
|
+
_dispatchEvent({
|
|
41091
|
+
sortable: _this,
|
|
41092
|
+
name: 'change',
|
|
41093
|
+
toEl: el,
|
|
41094
|
+
newIndex: newIndex,
|
|
41095
|
+
newDraggableIndex: newDraggableIndex,
|
|
41096
|
+
originalEvent: evt
|
|
41097
|
+
});
|
|
41098
|
+
}
|
|
41099
|
+
if (evt.preventDefault !== void 0) {
|
|
41100
|
+
evt.cancelable && evt.preventDefault();
|
|
41101
|
+
}
|
|
41102
|
+
target = closest(target, options.draggable, el, true);
|
|
41103
|
+
dragOverEvent('dragOver');
|
|
41104
|
+
if (Sortable.eventCanceled) return completedFired;
|
|
41105
|
+
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
|
41106
|
+
return completed(false);
|
|
41107
|
+
}
|
|
41108
|
+
ignoreNextClick = false;
|
|
41109
|
+
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
|
|
41110
|
+
: putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
|
41111
|
+
vertical = this._getDirection(evt, target) === 'vertical';
|
|
41112
|
+
dragRect = getRect(dragEl);
|
|
41113
|
+
dragOverEvent('dragOverValid');
|
|
41114
|
+
if (Sortable.eventCanceled) return completedFired;
|
|
41115
|
+
if (revert) {
|
|
41116
|
+
parentEl = rootEl; // actualization
|
|
41117
|
+
capture();
|
|
41118
|
+
this._hideClone();
|
|
41119
|
+
dragOverEvent('revert');
|
|
41120
|
+
if (!Sortable.eventCanceled) {
|
|
41121
|
+
if (nextEl) {
|
|
41122
|
+
rootEl.insertBefore(dragEl, nextEl);
|
|
41123
|
+
} else {
|
|
41124
|
+
rootEl.appendChild(dragEl);
|
|
41125
|
+
}
|
|
41126
|
+
}
|
|
41127
|
+
return completed(true);
|
|
41128
|
+
}
|
|
41129
|
+
var elLastChild = lastChild(el, options.draggable);
|
|
41130
|
+
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
|
41131
|
+
// Insert to end of list
|
|
41132
|
+
|
|
41133
|
+
// If already at end of list: Do not insert
|
|
41134
|
+
if (elLastChild === dragEl) {
|
|
41135
|
+
return completed(false);
|
|
41136
|
+
}
|
|
41137
|
+
|
|
41138
|
+
// if there is a last element, it is the target
|
|
41139
|
+
if (elLastChild && el === evt.target) {
|
|
41140
|
+
target = elLastChild;
|
|
41141
|
+
}
|
|
41142
|
+
if (target) {
|
|
41143
|
+
targetRect = getRect(target);
|
|
41144
|
+
}
|
|
41145
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
|
41146
|
+
capture();
|
|
41147
|
+
if (elLastChild && elLastChild.nextSibling) {
|
|
41148
|
+
// the last draggable element is not the last node
|
|
41149
|
+
el.insertBefore(dragEl, elLastChild.nextSibling);
|
|
41150
|
+
} else {
|
|
41151
|
+
el.appendChild(dragEl);
|
|
41152
|
+
}
|
|
41153
|
+
parentEl = el; // actualization
|
|
41154
|
+
|
|
41155
|
+
changed();
|
|
41156
|
+
return completed(true);
|
|
41157
|
+
}
|
|
41158
|
+
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
|
41159
|
+
// Insert to start of list
|
|
41160
|
+
var firstChild = getChild(el, 0, options, true);
|
|
41161
|
+
if (firstChild === dragEl) {
|
|
41162
|
+
return completed(false);
|
|
41163
|
+
}
|
|
41164
|
+
target = firstChild;
|
|
41165
|
+
targetRect = getRect(target);
|
|
41166
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
|
41167
|
+
capture();
|
|
41168
|
+
el.insertBefore(dragEl, firstChild);
|
|
41169
|
+
parentEl = el; // actualization
|
|
41170
|
+
|
|
41171
|
+
changed();
|
|
41172
|
+
return completed(true);
|
|
41173
|
+
}
|
|
41174
|
+
} else if (target.parentNode === el) {
|
|
41175
|
+
targetRect = getRect(target);
|
|
41176
|
+
var direction = 0,
|
|
41177
|
+
targetBeforeFirstSwap,
|
|
41178
|
+
differentLevel = dragEl.parentNode !== el,
|
|
41179
|
+
differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
|
|
41180
|
+
side1 = vertical ? 'top' : 'left',
|
|
41181
|
+
scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
|
|
41182
|
+
scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
|
41183
|
+
if (lastTarget !== target) {
|
|
41184
|
+
targetBeforeFirstSwap = targetRect[side1];
|
|
41185
|
+
pastFirstInvertThresh = false;
|
|
41186
|
+
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
|
41187
|
+
}
|
|
41188
|
+
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
|
41189
|
+
var sibling;
|
|
41190
|
+
if (direction !== 0) {
|
|
41191
|
+
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
|
41192
|
+
var dragIndex = index(dragEl);
|
|
41193
|
+
do {
|
|
41194
|
+
dragIndex -= direction;
|
|
41195
|
+
sibling = parentEl.children[dragIndex];
|
|
41196
|
+
} while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
|
|
41197
|
+
}
|
|
41198
|
+
// If dragEl is already beside target: Do not insert
|
|
41199
|
+
if (direction === 0 || sibling === target) {
|
|
41200
|
+
return completed(false);
|
|
41201
|
+
}
|
|
41202
|
+
lastTarget = target;
|
|
41203
|
+
lastDirection = direction;
|
|
41204
|
+
var nextSibling = target.nextElementSibling,
|
|
41205
|
+
after = false;
|
|
41206
|
+
after = direction === 1;
|
|
41207
|
+
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
|
41208
|
+
if (moveVector !== false) {
|
|
41209
|
+
if (moveVector === 1 || moveVector === -1) {
|
|
41210
|
+
after = moveVector === 1;
|
|
41211
|
+
}
|
|
41212
|
+
_silent = true;
|
|
41213
|
+
setTimeout(_unsilent, 30);
|
|
41214
|
+
capture();
|
|
41215
|
+
if (after && !nextSibling) {
|
|
41216
|
+
el.appendChild(dragEl);
|
|
41217
|
+
} else {
|
|
41218
|
+
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
|
41219
|
+
}
|
|
41220
|
+
|
|
41221
|
+
// Undo chrome's scroll adjustment (has no effect on other browsers)
|
|
41222
|
+
if (scrolledPastTop) {
|
|
41223
|
+
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
|
41224
|
+
}
|
|
41225
|
+
parentEl = dragEl.parentNode; // actualization
|
|
41226
|
+
|
|
41227
|
+
// must be done before animation
|
|
41228
|
+
if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
|
|
41229
|
+
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
|
|
41230
|
+
}
|
|
41231
|
+
changed();
|
|
41232
|
+
return completed(true);
|
|
41233
|
+
}
|
|
41234
|
+
}
|
|
41235
|
+
if (el.contains(dragEl)) {
|
|
41236
|
+
return completed(false);
|
|
41237
|
+
}
|
|
41238
|
+
}
|
|
41239
|
+
return false;
|
|
41240
|
+
},
|
|
41241
|
+
_ignoreWhileAnimating: null,
|
|
41242
|
+
_offMoveEvents: function _offMoveEvents() {
|
|
41243
|
+
off(document, 'mousemove', this._onTouchMove);
|
|
41244
|
+
off(document, 'touchmove', this._onTouchMove);
|
|
41245
|
+
off(document, 'pointermove', this._onTouchMove);
|
|
41246
|
+
off(document, 'dragover', nearestEmptyInsertDetectEvent);
|
|
41247
|
+
off(document, 'mousemove', nearestEmptyInsertDetectEvent);
|
|
41248
|
+
off(document, 'touchmove', nearestEmptyInsertDetectEvent);
|
|
41249
|
+
},
|
|
41250
|
+
_offUpEvents: function _offUpEvents() {
|
|
41251
|
+
var ownerDocument = this.el.ownerDocument;
|
|
41252
|
+
off(ownerDocument, 'mouseup', this._onDrop);
|
|
41253
|
+
off(ownerDocument, 'touchend', this._onDrop);
|
|
41254
|
+
off(ownerDocument, 'pointerup', this._onDrop);
|
|
41255
|
+
off(ownerDocument, 'pointercancel', this._onDrop);
|
|
41256
|
+
off(ownerDocument, 'touchcancel', this._onDrop);
|
|
41257
|
+
off(document, 'selectstart', this);
|
|
41258
|
+
},
|
|
41259
|
+
_onDrop: function _onDrop( /**Event*/evt) {
|
|
41260
|
+
var el = this.el,
|
|
41261
|
+
options = this.options;
|
|
41262
|
+
|
|
41263
|
+
// Get the index of the dragged element within its parent
|
|
41264
|
+
newIndex = index(dragEl);
|
|
41265
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41266
|
+
pluginEvent('drop', this, {
|
|
41267
|
+
evt: evt
|
|
41268
|
+
});
|
|
41269
|
+
parentEl = dragEl && dragEl.parentNode;
|
|
41270
|
+
|
|
41271
|
+
// Get again after plugin event
|
|
41272
|
+
newIndex = index(dragEl);
|
|
41273
|
+
newDraggableIndex = index(dragEl, options.draggable);
|
|
41274
|
+
if (Sortable.eventCanceled) {
|
|
41275
|
+
this._nulling();
|
|
41276
|
+
return;
|
|
41277
|
+
}
|
|
41278
|
+
awaitingDragStarted = false;
|
|
41279
|
+
isCircumstantialInvert = false;
|
|
41280
|
+
pastFirstInvertThresh = false;
|
|
41281
|
+
clearInterval(this._loopId);
|
|
41282
|
+
clearTimeout(this._dragStartTimer);
|
|
41283
|
+
_cancelNextTick(this.cloneId);
|
|
41284
|
+
_cancelNextTick(this._dragStartId);
|
|
41285
|
+
|
|
41286
|
+
// Unbind events
|
|
41287
|
+
if (this.nativeDraggable) {
|
|
41288
|
+
off(document, 'drop', this);
|
|
41289
|
+
off(el, 'dragstart', this._onDragStart);
|
|
41290
|
+
}
|
|
41291
|
+
this._offMoveEvents();
|
|
41292
|
+
this._offUpEvents();
|
|
41293
|
+
if (Safari) {
|
|
41294
|
+
css(document.body, 'user-select', '');
|
|
41295
|
+
}
|
|
41296
|
+
css(dragEl, 'transform', '');
|
|
41297
|
+
if (evt) {
|
|
41298
|
+
if (moved) {
|
|
41299
|
+
evt.cancelable && evt.preventDefault();
|
|
41300
|
+
!options.dropBubble && evt.stopPropagation();
|
|
41301
|
+
}
|
|
41302
|
+
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
|
41303
|
+
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
|
|
41304
|
+
// Remove clone(s)
|
|
41305
|
+
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
|
41306
|
+
}
|
|
41307
|
+
if (dragEl) {
|
|
41308
|
+
if (this.nativeDraggable) {
|
|
41309
|
+
off(dragEl, 'dragend', this);
|
|
41310
|
+
}
|
|
41311
|
+
_disableDraggable(dragEl);
|
|
41312
|
+
dragEl.style['will-change'] = '';
|
|
41313
|
+
|
|
41314
|
+
// Remove classes
|
|
41315
|
+
// ghostClass is added in dragStarted
|
|
41316
|
+
if (moved && !awaitingDragStarted) {
|
|
41317
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
|
41318
|
+
}
|
|
41319
|
+
toggleClass(dragEl, this.options.chosenClass, false);
|
|
41320
|
+
|
|
41321
|
+
// Drag stop event
|
|
41322
|
+
_dispatchEvent({
|
|
41323
|
+
sortable: this,
|
|
41324
|
+
name: 'unchoose',
|
|
41325
|
+
toEl: parentEl,
|
|
41326
|
+
newIndex: null,
|
|
41327
|
+
newDraggableIndex: null,
|
|
41328
|
+
originalEvent: evt
|
|
41329
|
+
});
|
|
41330
|
+
if (rootEl !== parentEl) {
|
|
41331
|
+
if (newIndex >= 0) {
|
|
41332
|
+
// Add event
|
|
41333
|
+
_dispatchEvent({
|
|
41334
|
+
rootEl: parentEl,
|
|
41335
|
+
name: 'add',
|
|
41336
|
+
toEl: parentEl,
|
|
41337
|
+
fromEl: rootEl,
|
|
41338
|
+
originalEvent: evt
|
|
41339
|
+
});
|
|
41340
|
+
|
|
41341
|
+
// Remove event
|
|
41342
|
+
_dispatchEvent({
|
|
41343
|
+
sortable: this,
|
|
41344
|
+
name: 'remove',
|
|
41345
|
+
toEl: parentEl,
|
|
41346
|
+
originalEvent: evt
|
|
41347
|
+
});
|
|
41348
|
+
|
|
41349
|
+
// drag from one list and drop into another
|
|
41350
|
+
_dispatchEvent({
|
|
41351
|
+
rootEl: parentEl,
|
|
41352
|
+
name: 'sort',
|
|
41353
|
+
toEl: parentEl,
|
|
41354
|
+
fromEl: rootEl,
|
|
41355
|
+
originalEvent: evt
|
|
41356
|
+
});
|
|
41357
|
+
_dispatchEvent({
|
|
41358
|
+
sortable: this,
|
|
41359
|
+
name: 'sort',
|
|
41360
|
+
toEl: parentEl,
|
|
41361
|
+
originalEvent: evt
|
|
41362
|
+
});
|
|
41363
|
+
}
|
|
41364
|
+
putSortable && putSortable.save();
|
|
41365
|
+
} else {
|
|
41366
|
+
if (newIndex !== oldIndex) {
|
|
41367
|
+
if (newIndex >= 0) {
|
|
41368
|
+
// drag & drop within the same list
|
|
41369
|
+
_dispatchEvent({
|
|
41370
|
+
sortable: this,
|
|
41371
|
+
name: 'update',
|
|
41372
|
+
toEl: parentEl,
|
|
41373
|
+
originalEvent: evt
|
|
41374
|
+
});
|
|
41375
|
+
_dispatchEvent({
|
|
41376
|
+
sortable: this,
|
|
41377
|
+
name: 'sort',
|
|
41378
|
+
toEl: parentEl,
|
|
41379
|
+
originalEvent: evt
|
|
41380
|
+
});
|
|
41381
|
+
}
|
|
41382
|
+
}
|
|
41383
|
+
}
|
|
41384
|
+
if (Sortable.active) {
|
|
41385
|
+
/* jshint eqnull:true */
|
|
41386
|
+
if (newIndex == null || newIndex === -1) {
|
|
41387
|
+
newIndex = oldIndex;
|
|
41388
|
+
newDraggableIndex = oldDraggableIndex;
|
|
41389
|
+
}
|
|
41390
|
+
_dispatchEvent({
|
|
41391
|
+
sortable: this,
|
|
41392
|
+
name: 'end',
|
|
41393
|
+
toEl: parentEl,
|
|
41394
|
+
originalEvent: evt
|
|
41395
|
+
});
|
|
41396
|
+
|
|
41397
|
+
// Save sorting
|
|
41398
|
+
this.save();
|
|
41399
|
+
}
|
|
41400
|
+
}
|
|
41401
|
+
}
|
|
41402
|
+
this._nulling();
|
|
41403
|
+
},
|
|
41404
|
+
_nulling: function _nulling() {
|
|
41405
|
+
pluginEvent('nulling', this);
|
|
41406
|
+
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;
|
|
41407
|
+
savedInputChecked.forEach(function (el) {
|
|
41408
|
+
el.checked = true;
|
|
41409
|
+
});
|
|
41410
|
+
savedInputChecked.length = lastDx = lastDy = 0;
|
|
41411
|
+
},
|
|
41412
|
+
handleEvent: function handleEvent( /**Event*/evt) {
|
|
41413
|
+
switch (evt.type) {
|
|
41414
|
+
case 'drop':
|
|
41415
|
+
case 'dragend':
|
|
41416
|
+
this._onDrop(evt);
|
|
41417
|
+
break;
|
|
41418
|
+
case 'dragenter':
|
|
41419
|
+
case 'dragover':
|
|
41420
|
+
if (dragEl) {
|
|
41421
|
+
this._onDragOver(evt);
|
|
41422
|
+
_globalDragOver(evt);
|
|
41423
|
+
}
|
|
41424
|
+
break;
|
|
41425
|
+
case 'selectstart':
|
|
41426
|
+
evt.preventDefault();
|
|
41427
|
+
break;
|
|
41428
|
+
}
|
|
41429
|
+
},
|
|
41430
|
+
/**
|
|
41431
|
+
* Serializes the item into an array of string.
|
|
41432
|
+
* @returns {String[]}
|
|
41433
|
+
*/
|
|
41434
|
+
toArray: function toArray() {
|
|
41435
|
+
var order = [],
|
|
41436
|
+
el,
|
|
41437
|
+
children = this.el.children,
|
|
41438
|
+
i = 0,
|
|
41439
|
+
n = children.length,
|
|
41440
|
+
options = this.options;
|
|
41441
|
+
for (; i < n; i++) {
|
|
41442
|
+
el = children[i];
|
|
41443
|
+
if (closest(el, options.draggable, this.el, false)) {
|
|
41444
|
+
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
|
41445
|
+
}
|
|
41446
|
+
}
|
|
41447
|
+
return order;
|
|
41448
|
+
},
|
|
41449
|
+
/**
|
|
41450
|
+
* Sorts the elements according to the array.
|
|
41451
|
+
* @param {String[]} order order of the items
|
|
41452
|
+
*/
|
|
41453
|
+
sort: function sort(order, useAnimation) {
|
|
41454
|
+
var items = {},
|
|
41455
|
+
rootEl = this.el;
|
|
41456
|
+
this.toArray().forEach(function (id, i) {
|
|
41457
|
+
var el = rootEl.children[i];
|
|
41458
|
+
if (closest(el, this.options.draggable, rootEl, false)) {
|
|
41459
|
+
items[id] = el;
|
|
41460
|
+
}
|
|
41461
|
+
}, this);
|
|
41462
|
+
useAnimation && this.captureAnimationState();
|
|
41463
|
+
order.forEach(function (id) {
|
|
41464
|
+
if (items[id]) {
|
|
41465
|
+
rootEl.removeChild(items[id]);
|
|
41466
|
+
rootEl.appendChild(items[id]);
|
|
41467
|
+
}
|
|
41468
|
+
});
|
|
41469
|
+
useAnimation && this.animateAll();
|
|
41470
|
+
},
|
|
41471
|
+
/**
|
|
41472
|
+
* Save the current sorting
|
|
41473
|
+
*/
|
|
41474
|
+
save: function save() {
|
|
41475
|
+
var store = this.options.store;
|
|
41476
|
+
store && store.set && store.set(this);
|
|
41477
|
+
},
|
|
41478
|
+
/**
|
|
41479
|
+
* 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.
|
|
41480
|
+
* @param {HTMLElement} el
|
|
41481
|
+
* @param {String} [selector] default: `options.draggable`
|
|
41482
|
+
* @returns {HTMLElement|null}
|
|
41483
|
+
*/
|
|
41484
|
+
closest: function closest$1(el, selector) {
|
|
41485
|
+
return closest(el, selector || this.options.draggable, this.el, false);
|
|
41486
|
+
},
|
|
41487
|
+
/**
|
|
41488
|
+
* Set/get option
|
|
41489
|
+
* @param {string} name
|
|
41490
|
+
* @param {*} [value]
|
|
41491
|
+
* @returns {*}
|
|
41492
|
+
*/
|
|
41493
|
+
option: function option(name, value) {
|
|
41494
|
+
var options = this.options;
|
|
41495
|
+
if (value === void 0) {
|
|
41496
|
+
return options[name];
|
|
41497
|
+
} else {
|
|
41498
|
+
var modifiedValue = PluginManager.modifyOption(this, name, value);
|
|
41499
|
+
if (typeof modifiedValue !== 'undefined') {
|
|
41500
|
+
options[name] = modifiedValue;
|
|
41501
|
+
} else {
|
|
41502
|
+
options[name] = value;
|
|
41503
|
+
}
|
|
41504
|
+
if (name === 'group') {
|
|
41505
|
+
_prepareGroup(options);
|
|
41506
|
+
}
|
|
41507
|
+
}
|
|
41508
|
+
},
|
|
41509
|
+
/**
|
|
41510
|
+
* Destroy
|
|
41511
|
+
*/
|
|
41512
|
+
destroy: function destroy() {
|
|
41513
|
+
pluginEvent('destroy', this);
|
|
41514
|
+
var el = this.el;
|
|
41515
|
+
el[expando] = null;
|
|
41516
|
+
off(el, 'mousedown', this._onTapStart);
|
|
41517
|
+
off(el, 'touchstart', this._onTapStart);
|
|
41518
|
+
off(el, 'pointerdown', this._onTapStart);
|
|
41519
|
+
if (this.nativeDraggable) {
|
|
41520
|
+
off(el, 'dragover', this);
|
|
41521
|
+
off(el, 'dragenter', this);
|
|
41522
|
+
}
|
|
41523
|
+
// Remove draggable attributes
|
|
41524
|
+
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
|
41525
|
+
el.removeAttribute('draggable');
|
|
41526
|
+
});
|
|
41527
|
+
this._onDrop();
|
|
41528
|
+
this._disableDelayedDragEvents();
|
|
41529
|
+
sortables.splice(sortables.indexOf(this.el), 1);
|
|
41530
|
+
this.el = el = null;
|
|
41531
|
+
},
|
|
41532
|
+
_hideClone: function _hideClone() {
|
|
41533
|
+
if (!cloneHidden) {
|
|
41534
|
+
pluginEvent('hideClone', this);
|
|
41535
|
+
if (Sortable.eventCanceled) return;
|
|
41536
|
+
css(cloneEl, 'display', 'none');
|
|
41537
|
+
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
|
41538
|
+
cloneEl.parentNode.removeChild(cloneEl);
|
|
41539
|
+
}
|
|
41540
|
+
cloneHidden = true;
|
|
41541
|
+
}
|
|
41542
|
+
},
|
|
41543
|
+
_showClone: function _showClone(putSortable) {
|
|
41544
|
+
if (putSortable.lastPutMode !== 'clone') {
|
|
41545
|
+
this._hideClone();
|
|
41546
|
+
return;
|
|
41547
|
+
}
|
|
41548
|
+
if (cloneHidden) {
|
|
41549
|
+
pluginEvent('showClone', this);
|
|
41550
|
+
if (Sortable.eventCanceled) return;
|
|
41551
|
+
|
|
41552
|
+
// show clone at dragEl or original position
|
|
41553
|
+
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
|
41554
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
41555
|
+
} else if (nextEl) {
|
|
41556
|
+
rootEl.insertBefore(cloneEl, nextEl);
|
|
41557
|
+
} else {
|
|
41558
|
+
rootEl.appendChild(cloneEl);
|
|
41559
|
+
}
|
|
41560
|
+
if (this.options.group.revertClone) {
|
|
41561
|
+
this.animate(dragEl, cloneEl);
|
|
41562
|
+
}
|
|
41563
|
+
css(cloneEl, 'display', '');
|
|
41564
|
+
cloneHidden = false;
|
|
41565
|
+
}
|
|
41566
|
+
}
|
|
41567
|
+
};
|
|
41568
|
+
function _globalDragOver( /**Event*/evt) {
|
|
41569
|
+
if (evt.dataTransfer) {
|
|
41570
|
+
evt.dataTransfer.dropEffect = 'move';
|
|
41571
|
+
}
|
|
41572
|
+
evt.cancelable && evt.preventDefault();
|
|
41573
|
+
}
|
|
41574
|
+
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
|
41575
|
+
var evt,
|
|
41576
|
+
sortable = fromEl[expando],
|
|
41577
|
+
onMoveFn = sortable.options.onMove,
|
|
41578
|
+
retVal;
|
|
41579
|
+
// Support for new CustomEvent feature
|
|
41580
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
41581
|
+
evt = new CustomEvent('move', {
|
|
41582
|
+
bubbles: true,
|
|
41583
|
+
cancelable: true
|
|
41584
|
+
});
|
|
41585
|
+
} else {
|
|
41586
|
+
evt = document.createEvent('Event');
|
|
41587
|
+
evt.initEvent('move', true, true);
|
|
41588
|
+
}
|
|
41589
|
+
evt.to = toEl;
|
|
41590
|
+
evt.from = fromEl;
|
|
41591
|
+
evt.dragged = dragEl;
|
|
41592
|
+
evt.draggedRect = dragRect;
|
|
41593
|
+
evt.related = targetEl || toEl;
|
|
41594
|
+
evt.relatedRect = targetRect || getRect(toEl);
|
|
41595
|
+
evt.willInsertAfter = willInsertAfter;
|
|
41596
|
+
evt.originalEvent = originalEvent;
|
|
41597
|
+
fromEl.dispatchEvent(evt);
|
|
41598
|
+
if (onMoveFn) {
|
|
41599
|
+
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
|
41600
|
+
}
|
|
41601
|
+
return retVal;
|
|
41602
|
+
}
|
|
41603
|
+
function _disableDraggable(el) {
|
|
41604
|
+
el.draggable = false;
|
|
41605
|
+
}
|
|
41606
|
+
function _unsilent() {
|
|
41607
|
+
_silent = false;
|
|
41608
|
+
}
|
|
41609
|
+
function _ghostIsFirst(evt, vertical, sortable) {
|
|
41610
|
+
var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
|
|
41611
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
41612
|
+
var spacer = 10;
|
|
41613
|
+
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;
|
|
41614
|
+
}
|
|
41615
|
+
function _ghostIsLast(evt, vertical, sortable) {
|
|
41616
|
+
var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
|
|
41617
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
41618
|
+
var spacer = 10;
|
|
41619
|
+
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;
|
|
41620
|
+
}
|
|
41621
|
+
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
|
41622
|
+
var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
|
|
41623
|
+
targetLength = vertical ? targetRect.height : targetRect.width,
|
|
41624
|
+
targetS1 = vertical ? targetRect.top : targetRect.left,
|
|
41625
|
+
targetS2 = vertical ? targetRect.bottom : targetRect.right,
|
|
41626
|
+
invert = false;
|
|
41627
|
+
if (!invertSwap) {
|
|
41628
|
+
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
|
41629
|
+
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
|
41630
|
+
// multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
|
|
41631
|
+
// check if past first invert threshold on side opposite of lastDirection
|
|
41632
|
+
if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
|
|
41633
|
+
// past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
|
41634
|
+
pastFirstInvertThresh = true;
|
|
41635
|
+
}
|
|
41636
|
+
if (!pastFirstInvertThresh) {
|
|
41637
|
+
// dragEl shadow (target move distance shadow)
|
|
41638
|
+
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
|
|
41639
|
+
: mouseOnAxis > targetS2 - targetMoveDistance) {
|
|
41640
|
+
return -lastDirection;
|
|
41641
|
+
}
|
|
41642
|
+
} else {
|
|
41643
|
+
invert = true;
|
|
41644
|
+
}
|
|
41645
|
+
} else {
|
|
41646
|
+
// Regular
|
|
41647
|
+
if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
|
|
41648
|
+
return _getInsertDirection(target);
|
|
41649
|
+
}
|
|
41650
|
+
}
|
|
41651
|
+
}
|
|
41652
|
+
invert = invert || invertSwap;
|
|
41653
|
+
if (invert) {
|
|
41654
|
+
// Invert of regular
|
|
41655
|
+
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
|
41656
|
+
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
|
41657
|
+
}
|
|
41658
|
+
}
|
|
41659
|
+
return 0;
|
|
41660
|
+
}
|
|
41661
|
+
|
|
41662
|
+
/**
|
|
41663
|
+
* Gets the direction dragEl must be swapped relative to target in order to make it
|
|
41664
|
+
* seem that dragEl has been "inserted" into that element's position
|
|
41665
|
+
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
|
41666
|
+
* @return {Number} Direction dragEl must be swapped
|
|
41667
|
+
*/
|
|
41668
|
+
function _getInsertDirection(target) {
|
|
41669
|
+
if (index(dragEl) < index(target)) {
|
|
41670
|
+
return 1;
|
|
41671
|
+
} else {
|
|
41672
|
+
return -1;
|
|
41673
|
+
}
|
|
41674
|
+
}
|
|
41675
|
+
|
|
41676
|
+
/**
|
|
41677
|
+
* Generate id
|
|
41678
|
+
* @param {HTMLElement} el
|
|
41679
|
+
* @returns {String}
|
|
41680
|
+
* @private
|
|
41681
|
+
*/
|
|
41682
|
+
function _generateId(el) {
|
|
41683
|
+
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
|
41684
|
+
i = str.length,
|
|
41685
|
+
sum = 0;
|
|
41686
|
+
while (i--) {
|
|
41687
|
+
sum += str.charCodeAt(i);
|
|
41688
|
+
}
|
|
41689
|
+
return sum.toString(36);
|
|
41690
|
+
}
|
|
41691
|
+
function _saveInputCheckedState(root) {
|
|
41692
|
+
savedInputChecked.length = 0;
|
|
41693
|
+
var inputs = root.getElementsByTagName('input');
|
|
41694
|
+
var idx = inputs.length;
|
|
41695
|
+
while (idx--) {
|
|
41696
|
+
var el = inputs[idx];
|
|
41697
|
+
el.checked && savedInputChecked.push(el);
|
|
41698
|
+
}
|
|
41699
|
+
}
|
|
41700
|
+
function _nextTick(fn) {
|
|
41701
|
+
return setTimeout(fn, 0);
|
|
41702
|
+
}
|
|
41703
|
+
function _cancelNextTick(id) {
|
|
41704
|
+
return clearTimeout(id);
|
|
41705
|
+
}
|
|
41706
|
+
|
|
41707
|
+
// Fixed #973:
|
|
41708
|
+
if (documentExists) {
|
|
41709
|
+
on(document, 'touchmove', function (evt) {
|
|
41710
|
+
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
|
41711
|
+
evt.preventDefault();
|
|
41712
|
+
}
|
|
41713
|
+
});
|
|
41714
|
+
}
|
|
41715
|
+
|
|
41716
|
+
// Export utils
|
|
41717
|
+
Sortable.utils = {
|
|
41718
|
+
on: on,
|
|
41719
|
+
off: off,
|
|
41720
|
+
css: css,
|
|
41721
|
+
find: find,
|
|
41722
|
+
is: function is(el, selector) {
|
|
41723
|
+
return !!closest(el, selector, el, false);
|
|
41724
|
+
},
|
|
41725
|
+
extend: extend,
|
|
41726
|
+
throttle: throttle,
|
|
41727
|
+
closest: closest,
|
|
41728
|
+
toggleClass: toggleClass,
|
|
41729
|
+
clone: clone,
|
|
41730
|
+
index: index,
|
|
41731
|
+
nextTick: _nextTick,
|
|
41732
|
+
cancelNextTick: _cancelNextTick,
|
|
41733
|
+
detectDirection: _detectDirection,
|
|
41734
|
+
getChild: getChild,
|
|
41735
|
+
expando: expando
|
|
41736
|
+
};
|
|
41737
|
+
|
|
41738
|
+
/**
|
|
41739
|
+
* Get the Sortable instance of an element
|
|
41740
|
+
* @param {HTMLElement} element The element
|
|
41741
|
+
* @return {Sortable|undefined} The instance of Sortable
|
|
41742
|
+
*/
|
|
41743
|
+
Sortable.get = function (element) {
|
|
41744
|
+
return element[expando];
|
|
41745
|
+
};
|
|
41746
|
+
|
|
41747
|
+
/**
|
|
41748
|
+
* Mount a plugin to Sortable
|
|
41749
|
+
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
|
41750
|
+
*/
|
|
41751
|
+
Sortable.mount = function () {
|
|
41752
|
+
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41753
|
+
plugins[_key] = arguments[_key];
|
|
41754
|
+
}
|
|
41755
|
+
if (plugins[0].constructor === Array) plugins = plugins[0];
|
|
41756
|
+
plugins.forEach(function (plugin) {
|
|
41757
|
+
if (!plugin.prototype || !plugin.prototype.constructor) {
|
|
41758
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
|
41759
|
+
}
|
|
41760
|
+
if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
|
|
41761
|
+
PluginManager.mount(plugin);
|
|
41762
|
+
});
|
|
41763
|
+
};
|
|
41764
|
+
|
|
41765
|
+
/**
|
|
41766
|
+
* Create sortable instance
|
|
41767
|
+
* @param {HTMLElement} el
|
|
41768
|
+
* @param {Object} [options]
|
|
41769
|
+
*/
|
|
41770
|
+
Sortable.create = function (el, options) {
|
|
41771
|
+
return new Sortable(el, options);
|
|
41772
|
+
};
|
|
41773
|
+
|
|
41774
|
+
// Export
|
|
41775
|
+
Sortable.version = version;
|
|
41776
|
+
|
|
41777
|
+
var autoScrolls = [],
|
|
41778
|
+
scrollEl,
|
|
41779
|
+
scrollRootEl,
|
|
41780
|
+
scrolling = false,
|
|
41781
|
+
lastAutoScrollX,
|
|
41782
|
+
lastAutoScrollY,
|
|
41783
|
+
touchEvt$1,
|
|
41784
|
+
pointerElemChangedInterval;
|
|
41785
|
+
function AutoScrollPlugin() {
|
|
41786
|
+
function AutoScroll() {
|
|
41787
|
+
this.defaults = {
|
|
41788
|
+
scroll: true,
|
|
41789
|
+
forceAutoScrollFallback: false,
|
|
41790
|
+
scrollSensitivity: 30,
|
|
41791
|
+
scrollSpeed: 10,
|
|
41792
|
+
bubbleScroll: true
|
|
41793
|
+
};
|
|
41794
|
+
|
|
41795
|
+
// Bind all private methods
|
|
41796
|
+
for (var fn in this) {
|
|
41797
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
41798
|
+
this[fn] = this[fn].bind(this);
|
|
41799
|
+
}
|
|
41800
|
+
}
|
|
39422
41801
|
}
|
|
41802
|
+
AutoScroll.prototype = {
|
|
41803
|
+
dragStarted: function dragStarted(_ref) {
|
|
41804
|
+
var originalEvent = _ref.originalEvent;
|
|
41805
|
+
if (this.sortable.nativeDraggable) {
|
|
41806
|
+
on(document, 'dragover', this._handleAutoScroll);
|
|
41807
|
+
} else {
|
|
41808
|
+
if (this.options.supportPointer) {
|
|
41809
|
+
on(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
41810
|
+
} else if (originalEvent.touches) {
|
|
41811
|
+
on(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
41812
|
+
} else {
|
|
41813
|
+
on(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
41814
|
+
}
|
|
41815
|
+
}
|
|
41816
|
+
},
|
|
41817
|
+
dragOverCompleted: function dragOverCompleted(_ref2) {
|
|
41818
|
+
var originalEvent = _ref2.originalEvent;
|
|
41819
|
+
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
|
41820
|
+
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
|
41821
|
+
this._handleAutoScroll(originalEvent);
|
|
41822
|
+
}
|
|
41823
|
+
},
|
|
41824
|
+
drop: function drop() {
|
|
41825
|
+
if (this.sortable.nativeDraggable) {
|
|
41826
|
+
off(document, 'dragover', this._handleAutoScroll);
|
|
41827
|
+
} else {
|
|
41828
|
+
off(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
41829
|
+
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
41830
|
+
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
41831
|
+
}
|
|
41832
|
+
clearPointerElemChangedInterval();
|
|
41833
|
+
clearAutoScrolls();
|
|
41834
|
+
cancelThrottle();
|
|
41835
|
+
},
|
|
41836
|
+
nulling: function nulling() {
|
|
41837
|
+
touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
|
|
41838
|
+
autoScrolls.length = 0;
|
|
41839
|
+
},
|
|
41840
|
+
_handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
|
|
41841
|
+
this._handleAutoScroll(evt, true);
|
|
41842
|
+
},
|
|
41843
|
+
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
|
41844
|
+
var _this = this;
|
|
41845
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
41846
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
41847
|
+
elem = document.elementFromPoint(x, y);
|
|
41848
|
+
touchEvt$1 = evt;
|
|
41849
|
+
|
|
41850
|
+
// IE does not seem to have native autoscroll,
|
|
41851
|
+
// Edge's autoscroll seems too conditional,
|
|
41852
|
+
// MACOS Safari does not have autoscroll,
|
|
41853
|
+
// Firefox and Chrome are good
|
|
41854
|
+
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
|
41855
|
+
autoScroll(evt, this.options, elem, fallback);
|
|
41856
|
+
|
|
41857
|
+
// Listener for pointer element change
|
|
41858
|
+
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
|
41859
|
+
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
|
41860
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
|
41861
|
+
// Detect for pointer elem change, emulating native DnD behaviour
|
|
41862
|
+
pointerElemChangedInterval = setInterval(function () {
|
|
41863
|
+
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
|
41864
|
+
if (newElem !== ogElemScroller) {
|
|
41865
|
+
ogElemScroller = newElem;
|
|
41866
|
+
clearAutoScrolls();
|
|
41867
|
+
}
|
|
41868
|
+
autoScroll(evt, _this.options, newElem, fallback);
|
|
41869
|
+
}, 10);
|
|
41870
|
+
lastAutoScrollX = x;
|
|
41871
|
+
lastAutoScrollY = y;
|
|
41872
|
+
}
|
|
41873
|
+
} else {
|
|
41874
|
+
// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
|
|
41875
|
+
if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
|
|
41876
|
+
clearAutoScrolls();
|
|
41877
|
+
return;
|
|
41878
|
+
}
|
|
41879
|
+
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
|
41880
|
+
}
|
|
41881
|
+
}
|
|
41882
|
+
};
|
|
41883
|
+
return _extends(AutoScroll, {
|
|
41884
|
+
pluginName: 'scroll',
|
|
41885
|
+
initializeByDefault: true
|
|
41886
|
+
});
|
|
39423
41887
|
}
|
|
41888
|
+
function clearAutoScrolls() {
|
|
41889
|
+
autoScrolls.forEach(function (autoScroll) {
|
|
41890
|
+
clearInterval(autoScroll.pid);
|
|
41891
|
+
});
|
|
41892
|
+
autoScrolls = [];
|
|
41893
|
+
}
|
|
41894
|
+
function clearPointerElemChangedInterval() {
|
|
41895
|
+
clearInterval(pointerElemChangedInterval);
|
|
41896
|
+
}
|
|
41897
|
+
var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
|
41898
|
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
|
41899
|
+
if (!options.scroll) return;
|
|
41900
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
41901
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
41902
|
+
sens = options.scrollSensitivity,
|
|
41903
|
+
speed = options.scrollSpeed,
|
|
41904
|
+
winScroller = getWindowScrollingElement();
|
|
41905
|
+
var scrollThisInstance = false,
|
|
41906
|
+
scrollCustomFn;
|
|
41907
|
+
|
|
41908
|
+
// New scroll root, set scrollEl
|
|
41909
|
+
if (scrollRootEl !== rootEl) {
|
|
41910
|
+
scrollRootEl = rootEl;
|
|
41911
|
+
clearAutoScrolls();
|
|
41912
|
+
scrollEl = options.scroll;
|
|
41913
|
+
scrollCustomFn = options.scrollFn;
|
|
41914
|
+
if (scrollEl === true) {
|
|
41915
|
+
scrollEl = getParentAutoScrollElement(rootEl, true);
|
|
41916
|
+
}
|
|
41917
|
+
}
|
|
41918
|
+
var layersOut = 0;
|
|
41919
|
+
var currentParent = scrollEl;
|
|
41920
|
+
do {
|
|
41921
|
+
var el = currentParent,
|
|
41922
|
+
rect = getRect(el),
|
|
41923
|
+
top = rect.top,
|
|
41924
|
+
bottom = rect.bottom,
|
|
41925
|
+
left = rect.left,
|
|
41926
|
+
right = rect.right,
|
|
41927
|
+
width = rect.width,
|
|
41928
|
+
height = rect.height,
|
|
41929
|
+
canScrollX = void 0,
|
|
41930
|
+
canScrollY = void 0,
|
|
41931
|
+
scrollWidth = el.scrollWidth,
|
|
41932
|
+
scrollHeight = el.scrollHeight,
|
|
41933
|
+
elCSS = css(el),
|
|
41934
|
+
scrollPosX = el.scrollLeft,
|
|
41935
|
+
scrollPosY = el.scrollTop;
|
|
41936
|
+
if (el === winScroller) {
|
|
41937
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
|
41938
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
|
41939
|
+
} else {
|
|
41940
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
|
41941
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
|
41942
|
+
}
|
|
41943
|
+
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
|
41944
|
+
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
|
41945
|
+
if (!autoScrolls[layersOut]) {
|
|
41946
|
+
for (var i = 0; i <= layersOut; i++) {
|
|
41947
|
+
if (!autoScrolls[i]) {
|
|
41948
|
+
autoScrolls[i] = {};
|
|
41949
|
+
}
|
|
41950
|
+
}
|
|
41951
|
+
}
|
|
41952
|
+
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
|
41953
|
+
autoScrolls[layersOut].el = el;
|
|
41954
|
+
autoScrolls[layersOut].vx = vx;
|
|
41955
|
+
autoScrolls[layersOut].vy = vy;
|
|
41956
|
+
clearInterval(autoScrolls[layersOut].pid);
|
|
41957
|
+
if (vx != 0 || vy != 0) {
|
|
41958
|
+
scrollThisInstance = true;
|
|
41959
|
+
/* jshint loopfunc:true */
|
|
41960
|
+
autoScrolls[layersOut].pid = setInterval(function () {
|
|
41961
|
+
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
|
41962
|
+
if (isFallback && this.layer === 0) {
|
|
41963
|
+
Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
|
|
41964
|
+
}
|
|
41965
|
+
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
|
41966
|
+
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
|
41967
|
+
if (typeof scrollCustomFn === 'function') {
|
|
41968
|
+
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
|
|
41969
|
+
return;
|
|
41970
|
+
}
|
|
41971
|
+
}
|
|
41972
|
+
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
41973
|
+
}.bind({
|
|
41974
|
+
layer: layersOut
|
|
41975
|
+
}), 24);
|
|
41976
|
+
}
|
|
41977
|
+
}
|
|
41978
|
+
layersOut++;
|
|
41979
|
+
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
|
41980
|
+
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
|
41981
|
+
}, 30);
|
|
41982
|
+
|
|
41983
|
+
var drop = function drop(_ref) {
|
|
41984
|
+
var originalEvent = _ref.originalEvent,
|
|
41985
|
+
putSortable = _ref.putSortable,
|
|
41986
|
+
dragEl = _ref.dragEl,
|
|
41987
|
+
activeSortable = _ref.activeSortable,
|
|
41988
|
+
dispatchSortableEvent = _ref.dispatchSortableEvent,
|
|
41989
|
+
hideGhostForTarget = _ref.hideGhostForTarget,
|
|
41990
|
+
unhideGhostForTarget = _ref.unhideGhostForTarget;
|
|
41991
|
+
if (!originalEvent) return;
|
|
41992
|
+
var toSortable = putSortable || activeSortable;
|
|
41993
|
+
hideGhostForTarget();
|
|
41994
|
+
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
|
41995
|
+
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
41996
|
+
unhideGhostForTarget();
|
|
41997
|
+
if (toSortable && !toSortable.el.contains(target)) {
|
|
41998
|
+
dispatchSortableEvent('spill');
|
|
41999
|
+
this.onSpill({
|
|
42000
|
+
dragEl: dragEl,
|
|
42001
|
+
putSortable: putSortable
|
|
42002
|
+
});
|
|
42003
|
+
}
|
|
42004
|
+
};
|
|
42005
|
+
function Revert() {}
|
|
42006
|
+
Revert.prototype = {
|
|
42007
|
+
startIndex: null,
|
|
42008
|
+
dragStart: function dragStart(_ref2) {
|
|
42009
|
+
var oldDraggableIndex = _ref2.oldDraggableIndex;
|
|
42010
|
+
this.startIndex = oldDraggableIndex;
|
|
42011
|
+
},
|
|
42012
|
+
onSpill: function onSpill(_ref3) {
|
|
42013
|
+
var dragEl = _ref3.dragEl,
|
|
42014
|
+
putSortable = _ref3.putSortable;
|
|
42015
|
+
this.sortable.captureAnimationState();
|
|
42016
|
+
if (putSortable) {
|
|
42017
|
+
putSortable.captureAnimationState();
|
|
42018
|
+
}
|
|
42019
|
+
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
|
42020
|
+
if (nextSibling) {
|
|
42021
|
+
this.sortable.el.insertBefore(dragEl, nextSibling);
|
|
42022
|
+
} else {
|
|
42023
|
+
this.sortable.el.appendChild(dragEl);
|
|
42024
|
+
}
|
|
42025
|
+
this.sortable.animateAll();
|
|
42026
|
+
if (putSortable) {
|
|
42027
|
+
putSortable.animateAll();
|
|
42028
|
+
}
|
|
42029
|
+
},
|
|
42030
|
+
drop: drop
|
|
42031
|
+
};
|
|
42032
|
+
_extends(Revert, {
|
|
42033
|
+
pluginName: 'revertOnSpill'
|
|
42034
|
+
});
|
|
42035
|
+
function Remove() {}
|
|
42036
|
+
Remove.prototype = {
|
|
42037
|
+
onSpill: function onSpill(_ref4) {
|
|
42038
|
+
var dragEl = _ref4.dragEl,
|
|
42039
|
+
putSortable = _ref4.putSortable;
|
|
42040
|
+
var parentSortable = putSortable || this.sortable;
|
|
42041
|
+
parentSortable.captureAnimationState();
|
|
42042
|
+
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
|
42043
|
+
parentSortable.animateAll();
|
|
42044
|
+
},
|
|
42045
|
+
drop: drop
|
|
42046
|
+
};
|
|
42047
|
+
_extends(Remove, {
|
|
42048
|
+
pluginName: 'removeOnSpill'
|
|
42049
|
+
});
|
|
39424
42050
|
|
|
42051
|
+
Sortable.mount(new AutoScrollPlugin());
|
|
42052
|
+
Sortable.mount(Remove, Revert);
|
|
42053
|
+
|
|
42054
|
+
const DRAG_HANDLE_SELECTOR = '[data-drag-handle]';
|
|
42055
|
+
const DRAGGABLE_ITEM_SELECTOR = '.array-item[data-reorderable="true"]';
|
|
42056
|
+
const DEFAULT_CONTAINER_CLASS = 'has-an-item-which-is-being-dragged';
|
|
42057
|
+
const DEFAULT_DROP_ELEVATION_CLASS = 'is-elevated';
|
|
42058
|
+
const DROP_ELEVATION_DURATION = 1000;
|
|
42059
|
+
const TOUCH_DRAG_DELAY_MS = 200; // Adds a short hold on touch (long-press) so scroll gestures do not reorder items.
|
|
39425
42060
|
class ArrayFieldTemplate extends react.Component {
|
|
39426
42061
|
constructor(props) {
|
|
39427
42062
|
super(props);
|
|
39428
|
-
this.
|
|
39429
|
-
this.
|
|
39430
|
-
|
|
42063
|
+
this.itemByIndex = new Map();
|
|
42064
|
+
this.handleAddClick = (event) => {
|
|
42065
|
+
event.stopPropagation();
|
|
42066
|
+
this.props.onAddClick(event);
|
|
42067
|
+
};
|
|
42068
|
+
this.setContainer = (element) => {
|
|
42069
|
+
if (this.container === element) {
|
|
42070
|
+
return;
|
|
42071
|
+
}
|
|
42072
|
+
this.teardownDragController();
|
|
42073
|
+
this.container = element !== null && element !== void 0 ? element : undefined;
|
|
42074
|
+
this.setupDragController();
|
|
42075
|
+
};
|
|
42076
|
+
this.handleSortStart = (event) => {
|
|
42077
|
+
if (!this.canReorderItems()) {
|
|
42078
|
+
return;
|
|
42079
|
+
}
|
|
42080
|
+
this.dragSnapshot = [...this.state.order];
|
|
42081
|
+
this.draggedItemIndex = this.getReorderId(event.item);
|
|
42082
|
+
if (this.container) {
|
|
42083
|
+
this.container.classList.add(DEFAULT_CONTAINER_CLASS);
|
|
42084
|
+
}
|
|
42085
|
+
if (event.item instanceof HTMLElement) {
|
|
42086
|
+
this.applyDropElevation(event.item);
|
|
42087
|
+
}
|
|
42088
|
+
};
|
|
42089
|
+
this.handleSortEnd = (event) => {
|
|
42090
|
+
var _a;
|
|
42091
|
+
if (!this.canReorderItems()) {
|
|
42092
|
+
return;
|
|
42093
|
+
}
|
|
42094
|
+
if (this.container) {
|
|
42095
|
+
this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
|
|
42096
|
+
}
|
|
42097
|
+
const snapshot = this.dragSnapshot;
|
|
42098
|
+
const draggedItemIndex = this.draggedItemIndex;
|
|
42099
|
+
this.dragSnapshot = undefined;
|
|
42100
|
+
this.draggedItemIndex = undefined;
|
|
42101
|
+
if (event.item instanceof HTMLElement) {
|
|
42102
|
+
this.dropElevationTarget = event.item;
|
|
42103
|
+
}
|
|
42104
|
+
const finalOrder = this.readOrderFromDom();
|
|
42105
|
+
if (!this.arraysEqual(this.state.order, finalOrder)) {
|
|
42106
|
+
this.setState({ order: finalOrder });
|
|
42107
|
+
}
|
|
42108
|
+
if (snapshot === undefined ||
|
|
42109
|
+
draggedItemIndex === undefined ||
|
|
42110
|
+
!(event.item instanceof HTMLElement)) {
|
|
42111
|
+
this.scheduleDropElevationRemoval();
|
|
42112
|
+
return;
|
|
42113
|
+
}
|
|
42114
|
+
const fromPosition = snapshot.indexOf(draggedItemIndex);
|
|
42115
|
+
const toPosition = finalOrder.indexOf(draggedItemIndex);
|
|
42116
|
+
if (fromPosition === -1 ||
|
|
42117
|
+
toPosition === -1 ||
|
|
42118
|
+
fromPosition === toPosition) {
|
|
42119
|
+
this.scheduleDropElevationRemoval();
|
|
42120
|
+
return;
|
|
42121
|
+
}
|
|
42122
|
+
const targetItem = ((_a = this.props.items) !== null && _a !== void 0 ? _a : []).find((entry) => {
|
|
42123
|
+
var _a;
|
|
42124
|
+
return ((_a = entry.index) !== null && _a !== void 0 ? _a : -1) === draggedItemIndex;
|
|
42125
|
+
});
|
|
42126
|
+
if (!targetItem || typeof targetItem.onReorderClick !== 'function') {
|
|
42127
|
+
this.scheduleDropElevationRemoval();
|
|
42128
|
+
return;
|
|
42129
|
+
}
|
|
42130
|
+
requestAnimationFrame(() => {
|
|
42131
|
+
const reorder = targetItem.onReorderClick(draggedItemIndex, toPosition);
|
|
42132
|
+
if (typeof reorder === 'function') {
|
|
42133
|
+
reorder();
|
|
42134
|
+
}
|
|
42135
|
+
});
|
|
42136
|
+
this.scheduleDropElevationRemoval();
|
|
42137
|
+
};
|
|
42138
|
+
this.state = {
|
|
42139
|
+
order: this.extractIndices(props.items),
|
|
42140
|
+
};
|
|
42141
|
+
}
|
|
42142
|
+
componentWillUnmount() {
|
|
42143
|
+
this.teardownDragController();
|
|
42144
|
+
}
|
|
42145
|
+
componentDidMount() {
|
|
42146
|
+
this.setupDragController();
|
|
42147
|
+
}
|
|
42148
|
+
componentDidUpdate(previousProps) {
|
|
42149
|
+
if (previousProps.items !== this.props.items) {
|
|
42150
|
+
const nextOrder = this.extractIndices(this.props.items);
|
|
42151
|
+
if (!this.arraysEqual(this.state.order, nextOrder)) {
|
|
42152
|
+
this.setState({
|
|
42153
|
+
order: nextOrder,
|
|
42154
|
+
}, () => {
|
|
42155
|
+
this.setupDragController();
|
|
42156
|
+
});
|
|
42157
|
+
return;
|
|
42158
|
+
}
|
|
42159
|
+
}
|
|
42160
|
+
if (previousProps.items !== this.props.items ||
|
|
42161
|
+
previousProps.schema !== this.props.schema ||
|
|
42162
|
+
previousProps.disabled !== this.props.disabled ||
|
|
42163
|
+
previousProps.readonly !== this.props.readonly) {
|
|
42164
|
+
this.setupDragController();
|
|
42165
|
+
}
|
|
39431
42166
|
}
|
|
39432
42167
|
render() {
|
|
39433
|
-
|
|
42168
|
+
const controls = this.getItemControls();
|
|
42169
|
+
const { ordered: orderedItems, byIndex } = this.getOrderedItems();
|
|
42170
|
+
this.itemByIndex = byIndex;
|
|
42171
|
+
return react.createElement('div', {}, renderTitle(this.props.title), renderDescription(this.props.schema.description), react.createElement('div', {
|
|
42172
|
+
className: 'array-items',
|
|
42173
|
+
ref: this.setContainer,
|
|
42174
|
+
}, orderedItems.map((item, index) => this.renderItem(item, index, controls))), this.renderAddButton());
|
|
39434
42175
|
}
|
|
39435
42176
|
renderAddButton() {
|
|
39436
42177
|
if (!this.props.canAdd) {
|
|
@@ -39443,40 +42184,214 @@ class ArrayFieldTemplate extends react.Component {
|
|
|
39443
42184
|
class: 'button-add-new',
|
|
39444
42185
|
});
|
|
39445
42186
|
}
|
|
39446
|
-
|
|
42187
|
+
getItemControls() {
|
|
42188
|
+
return {
|
|
42189
|
+
allowItemRemoval: this.canRemoveItems(),
|
|
42190
|
+
};
|
|
42191
|
+
}
|
|
42192
|
+
renderItem(item, index, controls) {
|
|
42193
|
+
var _a;
|
|
39447
42194
|
const { schema, formData, formContext } = this.props;
|
|
39448
|
-
const
|
|
42195
|
+
const itemIndex = (_a = item.index) !== null && _a !== void 0 ? _a : index;
|
|
42196
|
+
const allowItemReorder = this.isItemReorderable(item);
|
|
39449
42197
|
if (isObjectType(schema.items)) {
|
|
39450
42198
|
return react.createElement(CollapsibleItemTemplate, {
|
|
39451
42199
|
key: item.key,
|
|
39452
42200
|
item: item,
|
|
39453
|
-
data: formData[
|
|
42201
|
+
data: Array.isArray(formData) ? formData[itemIndex] : undefined,
|
|
39454
42202
|
schema: schema,
|
|
39455
42203
|
formSchema: formContext.schema,
|
|
39456
|
-
index:
|
|
42204
|
+
index: itemIndex,
|
|
39457
42205
|
allowItemRemoval: controls.allowItemRemoval,
|
|
39458
|
-
allowItemReorder:
|
|
42206
|
+
allowItemReorder: allowItemReorder,
|
|
39459
42207
|
});
|
|
39460
42208
|
}
|
|
39461
42209
|
return react.createElement(SimpleItemTemplate, {
|
|
39462
42210
|
key: item.key,
|
|
39463
42211
|
item: item,
|
|
39464
|
-
index:
|
|
42212
|
+
index: itemIndex,
|
|
42213
|
+
dataIndex: itemIndex,
|
|
39465
42214
|
allowItemRemoval: controls.allowItemRemoval,
|
|
39466
|
-
allowItemReorder:
|
|
42215
|
+
allowItemReorder: allowItemReorder,
|
|
39467
42216
|
});
|
|
39468
42217
|
}
|
|
39469
|
-
|
|
39470
|
-
var _a;
|
|
39471
|
-
const
|
|
42218
|
+
getOrderedItems() {
|
|
42219
|
+
var _a, _b;
|
|
42220
|
+
const items = (_a = this.props.items) !== null && _a !== void 0 ? _a : [];
|
|
42221
|
+
const byIndex = new Map();
|
|
42222
|
+
let entryIndex = 0;
|
|
42223
|
+
for (const entry of items) {
|
|
42224
|
+
byIndex.set((_b = entry.index) !== null && _b !== void 0 ? _b : entryIndex, entry);
|
|
42225
|
+
entryIndex += 1;
|
|
42226
|
+
}
|
|
42227
|
+
const ordered = [];
|
|
42228
|
+
const used = new Set();
|
|
42229
|
+
for (const index of this.state.order) {
|
|
42230
|
+
const entry = byIndex.get(index);
|
|
42231
|
+
if (!entry) {
|
|
42232
|
+
continue;
|
|
42233
|
+
}
|
|
42234
|
+
ordered.push(entry);
|
|
42235
|
+
used.add(index);
|
|
42236
|
+
}
|
|
42237
|
+
for (const [index, entry] of byIndex.entries()) {
|
|
42238
|
+
if (!used.has(index)) {
|
|
42239
|
+
ordered.push(entry);
|
|
42240
|
+
}
|
|
42241
|
+
}
|
|
39472
42242
|
return {
|
|
39473
|
-
|
|
39474
|
-
|
|
42243
|
+
ordered,
|
|
42244
|
+
byIndex,
|
|
39475
42245
|
};
|
|
39476
42246
|
}
|
|
39477
|
-
|
|
39478
|
-
|
|
39479
|
-
|
|
42247
|
+
setupDragController() {
|
|
42248
|
+
if (!this.container || !this.canReorderItems()) {
|
|
42249
|
+
this.teardownDragController();
|
|
42250
|
+
return;
|
|
42251
|
+
}
|
|
42252
|
+
const reorderableCount = this.getReorderableOrder().length;
|
|
42253
|
+
if (reorderableCount < 2) {
|
|
42254
|
+
this.teardownDragController();
|
|
42255
|
+
return;
|
|
42256
|
+
}
|
|
42257
|
+
if (this.sortable) {
|
|
42258
|
+
this.sortable.option('handle', DRAG_HANDLE_SELECTOR);
|
|
42259
|
+
this.sortable.option('draggable', DRAGGABLE_ITEM_SELECTOR);
|
|
42260
|
+
this.sortable.option('disabled', false);
|
|
42261
|
+
this.sortable.option('delay', TOUCH_DRAG_DELAY_MS);
|
|
42262
|
+
this.sortable.option('delayOnTouchOnly', true);
|
|
42263
|
+
return;
|
|
42264
|
+
}
|
|
42265
|
+
this.sortable = Sortable.create(this.container, {
|
|
42266
|
+
animation: 150,
|
|
42267
|
+
handle: DRAG_HANDLE_SELECTOR,
|
|
42268
|
+
draggable: DRAGGABLE_ITEM_SELECTOR,
|
|
42269
|
+
delay: TOUCH_DRAG_DELAY_MS,
|
|
42270
|
+
delayOnTouchOnly: true,
|
|
42271
|
+
onStart: this.handleSortStart,
|
|
42272
|
+
onEnd: this.handleSortEnd,
|
|
42273
|
+
});
|
|
42274
|
+
}
|
|
42275
|
+
teardownDragController() {
|
|
42276
|
+
if (this.sortable) {
|
|
42277
|
+
this.sortable.destroy();
|
|
42278
|
+
this.sortable = undefined;
|
|
42279
|
+
}
|
|
42280
|
+
this.clearDropElevationTimer();
|
|
42281
|
+
if (this.dropElevationTarget) {
|
|
42282
|
+
this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42283
|
+
this.dropElevationTarget = undefined;
|
|
42284
|
+
}
|
|
42285
|
+
if (this.container) {
|
|
42286
|
+
this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
|
|
42287
|
+
}
|
|
42288
|
+
this.dragSnapshot = undefined;
|
|
42289
|
+
this.draggedItemIndex = undefined;
|
|
42290
|
+
}
|
|
42291
|
+
canReorderItems() {
|
|
42292
|
+
if (this.props.disabled || this.props.readonly) {
|
|
42293
|
+
return false;
|
|
42294
|
+
}
|
|
42295
|
+
const schema = this.props.schema;
|
|
42296
|
+
const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
|
|
42297
|
+
return limeOptions.allowItemReorder !== false;
|
|
42298
|
+
}
|
|
42299
|
+
canRemoveItems() {
|
|
42300
|
+
const schema = this.props.schema;
|
|
42301
|
+
const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
|
|
42302
|
+
return limeOptions.allowItemRemoval !== false;
|
|
42303
|
+
}
|
|
42304
|
+
isItemReorderable(item) {
|
|
42305
|
+
return (this.canReorderItems() &&
|
|
42306
|
+
Boolean((item === null || item === void 0 ? void 0 : item.hasMoveDown) || (item === null || item === void 0 ? void 0 : item.hasMoveUp)));
|
|
42307
|
+
}
|
|
42308
|
+
isIndexReorderable(index) {
|
|
42309
|
+
const item = this.itemByIndex.get(index);
|
|
42310
|
+
if (!item) {
|
|
42311
|
+
return false;
|
|
42312
|
+
}
|
|
42313
|
+
return this.isItemReorderable(item);
|
|
42314
|
+
}
|
|
42315
|
+
getReorderableOrder(order = this.state.order) {
|
|
42316
|
+
const result = [];
|
|
42317
|
+
for (const index of order) {
|
|
42318
|
+
if (this.isIndexReorderable(index)) {
|
|
42319
|
+
result.push(index);
|
|
42320
|
+
}
|
|
42321
|
+
}
|
|
42322
|
+
return result;
|
|
42323
|
+
}
|
|
42324
|
+
readOrderFromDom() {
|
|
42325
|
+
if (!this.container) {
|
|
42326
|
+
return [];
|
|
42327
|
+
}
|
|
42328
|
+
const items = [...this.container.querySelectorAll('.array-item')];
|
|
42329
|
+
const order = [];
|
|
42330
|
+
for (const element of items) {
|
|
42331
|
+
const index = this.getReorderId(element);
|
|
42332
|
+
if (index !== undefined) {
|
|
42333
|
+
order.push(index);
|
|
42334
|
+
}
|
|
42335
|
+
}
|
|
42336
|
+
return order;
|
|
42337
|
+
}
|
|
42338
|
+
getReorderId(element) {
|
|
42339
|
+
if (!element) {
|
|
42340
|
+
return undefined;
|
|
42341
|
+
}
|
|
42342
|
+
if (!(element instanceof HTMLElement)) {
|
|
42343
|
+
return undefined;
|
|
42344
|
+
}
|
|
42345
|
+
const value = element.dataset.reorderId;
|
|
42346
|
+
if (value === undefined) {
|
|
42347
|
+
return undefined;
|
|
42348
|
+
}
|
|
42349
|
+
const parsed = Number.parseInt(value, 10);
|
|
42350
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
42351
|
+
}
|
|
42352
|
+
applyDropElevation(item) {
|
|
42353
|
+
if (this.dropElevationTarget && this.dropElevationTarget !== item) {
|
|
42354
|
+
this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42355
|
+
}
|
|
42356
|
+
this.clearDropElevationTimer();
|
|
42357
|
+
item.classList.add(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42358
|
+
this.dropElevationTarget = item;
|
|
42359
|
+
}
|
|
42360
|
+
scheduleDropElevationRemoval() {
|
|
42361
|
+
if (!this.dropElevationTarget) {
|
|
42362
|
+
return;
|
|
42363
|
+
}
|
|
42364
|
+
const target = this.dropElevationTarget;
|
|
42365
|
+
this.clearDropElevationTimer();
|
|
42366
|
+
this.dropElevationTimeout = globalThis.setTimeout(() => {
|
|
42367
|
+
target.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
|
|
42368
|
+
if (this.dropElevationTarget === target) {
|
|
42369
|
+
this.dropElevationTarget = undefined;
|
|
42370
|
+
}
|
|
42371
|
+
this.dropElevationTimeout = undefined;
|
|
42372
|
+
}, DROP_ELEVATION_DURATION);
|
|
42373
|
+
}
|
|
42374
|
+
clearDropElevationTimer() {
|
|
42375
|
+
if (this.dropElevationTimeout !== undefined) {
|
|
42376
|
+
clearTimeout(this.dropElevationTimeout);
|
|
42377
|
+
this.dropElevationTimeout = undefined;
|
|
42378
|
+
}
|
|
42379
|
+
}
|
|
42380
|
+
arraysEqual(a, b) {
|
|
42381
|
+
if (a.length !== b.length) {
|
|
42382
|
+
return false;
|
|
42383
|
+
}
|
|
42384
|
+
let index = 0;
|
|
42385
|
+
for (const value of a) {
|
|
42386
|
+
if (value !== b[index]) {
|
|
42387
|
+
return false;
|
|
42388
|
+
}
|
|
42389
|
+
index += 1;
|
|
42390
|
+
}
|
|
42391
|
+
return true;
|
|
42392
|
+
}
|
|
42393
|
+
extractIndices(items = []) {
|
|
42394
|
+
return (items !== null && items !== void 0 ? items : []).map((item, index) => { var _a; return (_a = item.index) !== null && _a !== void 0 ? _a : index; });
|
|
39480
42395
|
}
|
|
39481
42396
|
}
|
|
39482
42397
|
|
|
@@ -39684,9 +42599,9 @@ function IconButton(props) {
|
|
|
39684
42599
|
type = _props$type === void 0 ? "default" : _props$type,
|
|
39685
42600
|
icon = props.icon,
|
|
39686
42601
|
className = props.className,
|
|
39687
|
-
otherProps = _objectWithoutProperties(props, ["type", "icon", "className"]);
|
|
42602
|
+
otherProps = _objectWithoutProperties$1(props, ["type", "icon", "className"]);
|
|
39688
42603
|
|
|
39689
|
-
return react.createElement("button", _extends({
|
|
42604
|
+
return react.createElement("button", _extends$1({
|
|
39690
42605
|
type: "button",
|
|
39691
42606
|
className: "btn btn-".concat(type, " ").concat(className)
|
|
39692
42607
|
}, otherProps), react.createElement("i", {
|
|
@@ -39910,7 +42825,7 @@ function (_Component) {
|
|
|
39910
42825
|
|
|
39911
42826
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayField).call(this, props));
|
|
39912
42827
|
|
|
39913
|
-
_defineProperty$
|
|
42828
|
+
_defineProperty$2(_assertThisInitialized(_this), "_getNewFormDataRow", function () {
|
|
39914
42829
|
var _this$props = _this.props,
|
|
39915
42830
|
schema = _this$props.schema,
|
|
39916
42831
|
_this$props$registry = _this$props.registry,
|
|
@@ -39925,7 +42840,7 @@ function (_Component) {
|
|
|
39925
42840
|
return getDefaultFormState(itemSchema, undefined, rootSchema);
|
|
39926
42841
|
});
|
|
39927
42842
|
|
|
39928
|
-
_defineProperty$
|
|
42843
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddClick", function (event) {
|
|
39929
42844
|
if (event) {
|
|
39930
42845
|
event.preventDefault();
|
|
39931
42846
|
}
|
|
@@ -39945,7 +42860,7 @@ function (_Component) {
|
|
|
39945
42860
|
});
|
|
39946
42861
|
});
|
|
39947
42862
|
|
|
39948
|
-
_defineProperty$
|
|
42863
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAddIndexClick", function (index) {
|
|
39949
42864
|
return function (event) {
|
|
39950
42865
|
if (event) {
|
|
39951
42866
|
event.preventDefault();
|
|
@@ -39970,7 +42885,7 @@ function (_Component) {
|
|
|
39970
42885
|
};
|
|
39971
42886
|
});
|
|
39972
42887
|
|
|
39973
|
-
_defineProperty$
|
|
42888
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropIndexClick", function (index) {
|
|
39974
42889
|
return function (event) {
|
|
39975
42890
|
if (event) {
|
|
39976
42891
|
event.preventDefault();
|
|
@@ -40009,7 +42924,7 @@ function (_Component) {
|
|
|
40009
42924
|
};
|
|
40010
42925
|
});
|
|
40011
42926
|
|
|
40012
|
-
_defineProperty$
|
|
42927
|
+
_defineProperty$2(_assertThisInitialized(_this), "onReorderClick", function (index, newIndex) {
|
|
40013
42928
|
return function (event) {
|
|
40014
42929
|
if (event) {
|
|
40015
42930
|
event.preventDefault();
|
|
@@ -40058,7 +42973,7 @@ function (_Component) {
|
|
|
40058
42973
|
};
|
|
40059
42974
|
});
|
|
40060
42975
|
|
|
40061
|
-
_defineProperty$
|
|
42976
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChangeForIndex", function (index) {
|
|
40062
42977
|
return function (value, errorSchema) {
|
|
40063
42978
|
var _this$props2 = _this.props,
|
|
40064
42979
|
formData = _this$props2.formData,
|
|
@@ -40069,11 +42984,11 @@ function (_Component) {
|
|
|
40069
42984
|
var jsonValue = typeof value === "undefined" ? null : value;
|
|
40070
42985
|
return index === i ? jsonValue : item;
|
|
40071
42986
|
});
|
|
40072
|
-
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
42987
|
+
onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, index, errorSchema)));
|
|
40073
42988
|
};
|
|
40074
42989
|
});
|
|
40075
42990
|
|
|
40076
|
-
_defineProperty$
|
|
42991
|
+
_defineProperty$2(_assertThisInitialized(_this), "onSelectChange", function (value) {
|
|
40077
42992
|
_this.props.onChange(value);
|
|
40078
42993
|
});
|
|
40079
42994
|
|
|
@@ -40262,7 +43177,7 @@ function (_Component) {
|
|
|
40262
43177
|
}),
|
|
40263
43178
|
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
40264
43179
|
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
40265
|
-
options = _objectWithoutProperties(_getUiOptions$enumOpt, ["widget"]);
|
|
43180
|
+
options = _objectWithoutProperties$1(_getUiOptions$enumOpt, ["widget"]);
|
|
40266
43181
|
|
|
40267
43182
|
var Widget = getWidget(schema, widget, widgets);
|
|
40268
43183
|
return react.createElement(Widget, {
|
|
@@ -40309,7 +43224,7 @@ function (_Component) {
|
|
|
40309
43224
|
var _getUiOptions2 = getUiOptions(uiSchema),
|
|
40310
43225
|
_getUiOptions2$widget = _getUiOptions2.widget,
|
|
40311
43226
|
widget = _getUiOptions2$widget === void 0 ? "files" : _getUiOptions2$widget,
|
|
40312
|
-
options = _objectWithoutProperties(_getUiOptions2, ["widget"]);
|
|
43227
|
+
options = _objectWithoutProperties$1(_getUiOptions2, ["widget"]);
|
|
40313
43228
|
|
|
40314
43229
|
var Widget = getWidget(schema, widget, widgets);
|
|
40315
43230
|
return react.createElement(Widget, {
|
|
@@ -40523,7 +43438,7 @@ function (_Component) {
|
|
|
40523
43438
|
return ArrayField;
|
|
40524
43439
|
}(react.Component);
|
|
40525
43440
|
|
|
40526
|
-
_defineProperty$
|
|
43441
|
+
_defineProperty$2(ArrayField$1, "defaultProps", {
|
|
40527
43442
|
uiSchema: {},
|
|
40528
43443
|
formData: [],
|
|
40529
43444
|
idSchema: {},
|
|
@@ -40557,7 +43472,7 @@ function BooleanField(props) {
|
|
|
40557
43472
|
var _getUiOptions = getUiOptions(uiSchema),
|
|
40558
43473
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
40559
43474
|
widget = _getUiOptions$widget === void 0 ? "checkbox" : _getUiOptions$widget,
|
|
40560
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
43475
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
40561
43476
|
|
|
40562
43477
|
var Widget = getWidget(schema, widget, widgets);
|
|
40563
43478
|
var enumOptions;
|
|
@@ -40639,7 +43554,7 @@ function (_Component) {
|
|
|
40639
43554
|
|
|
40640
43555
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AnyOfField).call(this, props));
|
|
40641
43556
|
|
|
40642
|
-
_defineProperty$
|
|
43557
|
+
_defineProperty$2(_assertThisInitialized(_this), "onOptionChange", function (option) {
|
|
40643
43558
|
var selectedOption = _parseInt(option, 10);
|
|
40644
43559
|
|
|
40645
43560
|
var _this$props = _this.props,
|
|
@@ -40654,7 +43569,7 @@ function (_Component) {
|
|
|
40654
43569
|
var newFormData = undefined;
|
|
40655
43570
|
|
|
40656
43571
|
if (guessType(formData) === "object" && (newOption.type === "object" || newOption.properties)) {
|
|
40657
|
-
newFormData = _extends({}, formData);
|
|
43572
|
+
newFormData = _extends$1({}, formData);
|
|
40658
43573
|
var optionsToDiscard = options.slice();
|
|
40659
43574
|
optionsToDiscard.splice(selectedOption, 1); // Discard any data added using other options
|
|
40660
43575
|
|
|
@@ -40760,7 +43675,7 @@ function (_Component) {
|
|
|
40760
43675
|
var _getUiOptions = getUiOptions(uiSchema),
|
|
40761
43676
|
_getUiOptions$widget = _getUiOptions.widget,
|
|
40762
43677
|
widget = _getUiOptions$widget === void 0 ? "select" : _getUiOptions$widget,
|
|
40763
|
-
uiOptions = _objectWithoutProperties(_getUiOptions, ["widget"]);
|
|
43678
|
+
uiOptions = _objectWithoutProperties$1(_getUiOptions, ["widget"]);
|
|
40764
43679
|
|
|
40765
43680
|
var Widget = getWidget({
|
|
40766
43681
|
type: "number"
|
|
@@ -40771,7 +43686,7 @@ function (_Component) {
|
|
|
40771
43686
|
if (option) {
|
|
40772
43687
|
// If the subschema doesn't declare a type, infer the type from the
|
|
40773
43688
|
// parent schema
|
|
40774
|
-
optionSchema = option.type ? option : _extends({}, option, {
|
|
43689
|
+
optionSchema = option.type ? option : _extends$1({}, option, {
|
|
40775
43690
|
type: baseType
|
|
40776
43691
|
});
|
|
40777
43692
|
}
|
|
@@ -40786,7 +43701,7 @@ function (_Component) {
|
|
|
40786
43701
|
className: "panel panel-default panel-body"
|
|
40787
43702
|
}, react.createElement("div", {
|
|
40788
43703
|
className: "form-group"
|
|
40789
|
-
}, react.createElement(Widget, _extends({
|
|
43704
|
+
}, react.createElement(Widget, _extends$1({
|
|
40790
43705
|
id: "".concat(idSchema.$id).concat(schema.oneOf ? "__oneof_select" : "__anyof_select"),
|
|
40791
43706
|
schema: {
|
|
40792
43707
|
type: "number",
|
|
@@ -40865,7 +43780,7 @@ function (_React$Component) {
|
|
|
40865
43780
|
|
|
40866
43781
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(NumberField).call(this, props));
|
|
40867
43782
|
|
|
40868
|
-
_defineProperty$
|
|
43783
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleChange", function (value) {
|
|
40869
43784
|
// Cache the original value in component state
|
|
40870
43785
|
_this.setState({
|
|
40871
43786
|
lastValue: value
|
|
@@ -40898,7 +43813,7 @@ function (_React$Component) {
|
|
|
40898
43813
|
|
|
40899
43814
|
var _this$props = this.props,
|
|
40900
43815
|
formData = _this$props.formData,
|
|
40901
|
-
props = _objectWithoutProperties(_this$props, ["formData"]);
|
|
43816
|
+
props = _objectWithoutProperties$1(_this$props, ["formData"]);
|
|
40902
43817
|
|
|
40903
43818
|
var lastValue = this.state.lastValue;
|
|
40904
43819
|
var value = formData;
|
|
@@ -40915,7 +43830,7 @@ function (_React$Component) {
|
|
|
40915
43830
|
}
|
|
40916
43831
|
}
|
|
40917
43832
|
|
|
40918
|
-
return react.createElement(StringField, _extends({}, props, {
|
|
43833
|
+
return react.createElement(StringField, _extends$1({}, props, {
|
|
40919
43834
|
formData: value,
|
|
40920
43835
|
onChange: this.handleChange
|
|
40921
43836
|
}));
|
|
@@ -40970,12 +43885,12 @@ function (_Component) {
|
|
|
40970
43885
|
|
|
40971
43886
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ObjectField)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
40972
43887
|
|
|
40973
|
-
_defineProperty$
|
|
43888
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", {
|
|
40974
43889
|
wasPropertyKeyModified: false,
|
|
40975
43890
|
additionalProperties: {}
|
|
40976
43891
|
});
|
|
40977
43892
|
|
|
40978
|
-
_defineProperty$
|
|
43893
|
+
_defineProperty$2(_assertThisInitialized(_this), "onPropertyChange", function (name) {
|
|
40979
43894
|
var addedByAdditionalProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40980
43895
|
return function (value, errorSchema) {
|
|
40981
43896
|
if (!value && addedByAdditionalProperties) {
|
|
@@ -40989,13 +43904,13 @@ function (_Component) {
|
|
|
40989
43904
|
value = "";
|
|
40990
43905
|
}
|
|
40991
43906
|
|
|
40992
|
-
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$
|
|
43907
|
+
var newFormData = _objectSpread({}, _this.props.formData, _defineProperty$2({}, name, value));
|
|
40993
43908
|
|
|
40994
|
-
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
43909
|
+
_this.props.onChange(newFormData, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, name, errorSchema)));
|
|
40995
43910
|
};
|
|
40996
43911
|
});
|
|
40997
43912
|
|
|
40998
|
-
_defineProperty$
|
|
43913
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDropPropertyClick", function (key) {
|
|
40999
43914
|
return function (event) {
|
|
41000
43915
|
event.preventDefault();
|
|
41001
43916
|
var _this$props = _this.props,
|
|
@@ -41009,7 +43924,7 @@ function (_Component) {
|
|
|
41009
43924
|
};
|
|
41010
43925
|
});
|
|
41011
43926
|
|
|
41012
|
-
_defineProperty$
|
|
43927
|
+
_defineProperty$2(_assertThisInitialized(_this), "getAvailableKey", function (preferredKey, formData) {
|
|
41013
43928
|
var index = 0;
|
|
41014
43929
|
var newKey = preferredKey;
|
|
41015
43930
|
|
|
@@ -41020,7 +43935,7 @@ function (_Component) {
|
|
|
41020
43935
|
return newKey;
|
|
41021
43936
|
});
|
|
41022
43937
|
|
|
41023
|
-
_defineProperty$
|
|
43938
|
+
_defineProperty$2(_assertThisInitialized(_this), "onKeyChange", function (oldValue) {
|
|
41024
43939
|
return function (value, errorSchema) {
|
|
41025
43940
|
if (oldValue === value) {
|
|
41026
43941
|
return;
|
|
@@ -41030,24 +43945,24 @@ function (_Component) {
|
|
|
41030
43945
|
|
|
41031
43946
|
var newFormData = _objectSpread({}, _this.props.formData);
|
|
41032
43947
|
|
|
41033
|
-
var newKeys = _defineProperty$
|
|
43948
|
+
var newKeys = _defineProperty$2({}, oldValue, value);
|
|
41034
43949
|
|
|
41035
43950
|
var keyValues = keys$3(newFormData).map(function (key) {
|
|
41036
43951
|
var newKey = newKeys[key] || key;
|
|
41037
|
-
return _defineProperty$
|
|
43952
|
+
return _defineProperty$2({}, newKey, newFormData[key]);
|
|
41038
43953
|
});
|
|
41039
43954
|
|
|
41040
|
-
var renamedObj = _extends.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
43955
|
+
var renamedObj = _extends$1.apply(void 0, [{}].concat(_toConsumableArray(keyValues)));
|
|
41041
43956
|
|
|
41042
43957
|
_this.setState({
|
|
41043
43958
|
wasPropertyKeyModified: true
|
|
41044
43959
|
});
|
|
41045
43960
|
|
|
41046
|
-
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$
|
|
43961
|
+
_this.props.onChange(renamedObj, errorSchema && _this.props.errorSchema && _objectSpread({}, _this.props.errorSchema, _defineProperty$2({}, value, errorSchema)));
|
|
41047
43962
|
};
|
|
41048
43963
|
});
|
|
41049
43964
|
|
|
41050
|
-
_defineProperty$
|
|
43965
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleAddClick", function (schema) {
|
|
41051
43966
|
return function () {
|
|
41052
43967
|
var type = schema.additionalProperties.type;
|
|
41053
43968
|
|
|
@@ -41191,7 +44106,7 @@ function (_Component) {
|
|
|
41191
44106
|
formData: formData,
|
|
41192
44107
|
formContext: formContext
|
|
41193
44108
|
};
|
|
41194
|
-
return react.createElement(Template, _extends({}, templateProps, {
|
|
44109
|
+
return react.createElement(Template, _extends$1({}, templateProps, {
|
|
41195
44110
|
onAddClick: this.handleAddClick
|
|
41196
44111
|
}));
|
|
41197
44112
|
}
|
|
@@ -41200,7 +44115,7 @@ function (_Component) {
|
|
|
41200
44115
|
return ObjectField;
|
|
41201
44116
|
}(react.Component);
|
|
41202
44117
|
|
|
41203
|
-
_defineProperty$
|
|
44118
|
+
_defineProperty$2(ObjectField$1, "defaultProps", {
|
|
41204
44119
|
uiSchema: {},
|
|
41205
44120
|
formData: {},
|
|
41206
44121
|
errorSchema: {},
|
|
@@ -41242,7 +44157,7 @@ function StringField(props) {
|
|
|
41242
44157
|
widget = _getUiOptions$widget === void 0 ? defaultWidget : _getUiOptions$widget,
|
|
41243
44158
|
_getUiOptions$placeho = _getUiOptions.placeholder,
|
|
41244
44159
|
placeholder = _getUiOptions$placeho === void 0 ? "" : _getUiOptions$placeho,
|
|
41245
|
-
options = _objectWithoutProperties(_getUiOptions, ["widget", "placeholder"]);
|
|
44160
|
+
options = _objectWithoutProperties$1(_getUiOptions, ["widget", "placeholder"]);
|
|
41246
44161
|
|
|
41247
44162
|
var Widget = getWidget(schema, widget, widgets);
|
|
41248
44163
|
return react.createElement(Widget, {
|
|
@@ -41405,8 +44320,8 @@ function (_Component) {
|
|
|
41405
44320
|
|
|
41406
44321
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AltDateWidget).call(this, props));
|
|
41407
44322
|
|
|
41408
|
-
_defineProperty$
|
|
41409
|
-
_this.setState(_defineProperty$
|
|
44323
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (property, value) {
|
|
44324
|
+
_this.setState(_defineProperty$2({}, property, typeof value === "undefined" ? -1 : value), function () {
|
|
41410
44325
|
// Only propagate to parent state if we have a complete date{time}
|
|
41411
44326
|
if (readyForChange(_this.state)) {
|
|
41412
44327
|
_this.props.onChange(toDateString(_this.state, _this.props.time));
|
|
@@ -41414,7 +44329,7 @@ function (_Component) {
|
|
|
41414
44329
|
});
|
|
41415
44330
|
});
|
|
41416
44331
|
|
|
41417
|
-
_defineProperty$
|
|
44332
|
+
_defineProperty$2(_assertThisInitialized(_this), "setNow", function (event) {
|
|
41418
44333
|
event.preventDefault();
|
|
41419
44334
|
var _this$props = _this.props,
|
|
41420
44335
|
time = _this$props.time,
|
|
@@ -41433,7 +44348,7 @@ function (_Component) {
|
|
|
41433
44348
|
});
|
|
41434
44349
|
});
|
|
41435
44350
|
|
|
41436
|
-
_defineProperty$
|
|
44351
|
+
_defineProperty$2(_assertThisInitialized(_this), "clear", function (event) {
|
|
41437
44352
|
event.preventDefault();
|
|
41438
44353
|
var _this$props2 = _this.props,
|
|
41439
44354
|
time = _this$props2.time,
|
|
@@ -41482,7 +44397,7 @@ function (_Component) {
|
|
|
41482
44397
|
}, this.dateElementProps.map(function (elemProps, i) {
|
|
41483
44398
|
return react.createElement("li", {
|
|
41484
44399
|
key: i
|
|
41485
|
-
}, react.createElement(DateElement, _extends({
|
|
44400
|
+
}, react.createElement(DateElement, _extends$1({
|
|
41486
44401
|
rootId: id,
|
|
41487
44402
|
select: _this2.onChange
|
|
41488
44403
|
}, elemProps, {
|
|
@@ -41552,7 +44467,7 @@ function (_Component) {
|
|
|
41552
44467
|
return AltDateWidget;
|
|
41553
44468
|
}(react.Component);
|
|
41554
44469
|
|
|
41555
|
-
_defineProperty$
|
|
44470
|
+
_defineProperty$2(AltDateWidget, "defaultProps", {
|
|
41556
44471
|
time: false,
|
|
41557
44472
|
disabled: false,
|
|
41558
44473
|
readonly: false,
|
|
@@ -41564,7 +44479,7 @@ _defineProperty$1(AltDateWidget, "defaultProps", {
|
|
|
41564
44479
|
|
|
41565
44480
|
function AltDateTimeWidget(props) {
|
|
41566
44481
|
var AltDateWidget = props.registry.widgets.AltDateWidget;
|
|
41567
|
-
return react.createElement(AltDateWidget, _extends({
|
|
44482
|
+
return react.createElement(AltDateWidget, _extends$1({
|
|
41568
44483
|
time: true
|
|
41569
44484
|
}, props));
|
|
41570
44485
|
}
|
|
@@ -41589,7 +44504,7 @@ function BaseInput(props) {
|
|
|
41589
44504
|
onFocus = props.onFocus,
|
|
41590
44505
|
options = props.options,
|
|
41591
44506
|
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
|
|
44507
|
+
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
44508
|
|
|
41594
44509
|
|
|
41595
44510
|
if (options.inputType) {
|
|
@@ -41634,7 +44549,7 @@ function BaseInput(props) {
|
|
|
41634
44549
|
return props.onChange(value === "" ? options.emptyValue : value);
|
|
41635
44550
|
};
|
|
41636
44551
|
|
|
41637
|
-
return [react.createElement("input", _extends({
|
|
44552
|
+
return [react.createElement("input", _extends$1({
|
|
41638
44553
|
key: inputProps.id,
|
|
41639
44554
|
className: "form-control",
|
|
41640
44555
|
readOnly: readonly,
|
|
@@ -41784,7 +44699,7 @@ function ColorWidget(props) {
|
|
|
41784
44699
|
var disabled = props.disabled,
|
|
41785
44700
|
readonly = props.readonly,
|
|
41786
44701
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41787
|
-
return react.createElement(BaseInput, _extends({
|
|
44702
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41788
44703
|
type: "color"
|
|
41789
44704
|
}, props, {
|
|
41790
44705
|
disabled: disabled || readonly
|
|
@@ -41794,7 +44709,7 @@ function ColorWidget(props) {
|
|
|
41794
44709
|
function DateWidget(props) {
|
|
41795
44710
|
var _onChange = props.onChange,
|
|
41796
44711
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41797
|
-
return react.createElement(BaseInput, _extends({
|
|
44712
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41798
44713
|
type: "date"
|
|
41799
44714
|
}, props, {
|
|
41800
44715
|
onChange: function onChange(value) {
|
|
@@ -41807,7 +44722,7 @@ function DateTimeWidget(props) {
|
|
|
41807
44722
|
var value = props.value,
|
|
41808
44723
|
_onChange = props.onChange,
|
|
41809
44724
|
BaseInput = props.registry.widgets.BaseInput;
|
|
41810
|
-
return react.createElement(BaseInput, _extends({
|
|
44725
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41811
44726
|
type: "datetime-local"
|
|
41812
44727
|
}, props, {
|
|
41813
44728
|
value: utcToLocal(value),
|
|
@@ -41819,7 +44734,7 @@ function DateTimeWidget(props) {
|
|
|
41819
44734
|
|
|
41820
44735
|
function EmailWidget(props) {
|
|
41821
44736
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
41822
|
-
return react.createElement(BaseInput, _extends({
|
|
44737
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41823
44738
|
type: "email"
|
|
41824
44739
|
}, props));
|
|
41825
44740
|
}
|
|
@@ -41900,7 +44815,7 @@ function (_Component) {
|
|
|
41900
44815
|
|
|
41901
44816
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(FileWidget).call(this, props));
|
|
41902
44817
|
|
|
41903
|
-
_defineProperty$
|
|
44818
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (event) {
|
|
41904
44819
|
var _this$props = _this.props,
|
|
41905
44820
|
multiple = _this$props.multiple,
|
|
41906
44821
|
onChange = _this$props.onChange;
|
|
@@ -41986,7 +44901,7 @@ function HiddenWidget(_ref) {
|
|
|
41986
44901
|
|
|
41987
44902
|
function PasswordWidget(props) {
|
|
41988
44903
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
41989
|
-
return react.createElement(BaseInput, _extends({
|
|
44904
|
+
return react.createElement(BaseInput, _extends$1({
|
|
41990
44905
|
type: "password"
|
|
41991
44906
|
}, props));
|
|
41992
44907
|
}
|
|
@@ -42054,7 +44969,7 @@ function RangeWidget(props) {
|
|
|
42054
44969
|
BaseInput = props.registry.widgets.BaseInput;
|
|
42055
44970
|
return react.createElement("div", {
|
|
42056
44971
|
className: "field-range-wrapper"
|
|
42057
|
-
}, react.createElement(BaseInput, _extends({
|
|
44972
|
+
}, react.createElement(BaseInput, _extends$1({
|
|
42058
44973
|
type: "range"
|
|
42059
44974
|
}, props, rangeSpec(schema))), react.createElement("span", {
|
|
42060
44975
|
className: "range-view"
|
|
@@ -42217,14 +45132,14 @@ function TextWidget(props) {
|
|
|
42217
45132
|
|
|
42218
45133
|
function URLWidget(props) {
|
|
42219
45134
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
42220
|
-
return react.createElement(BaseInput, _extends({
|
|
45135
|
+
return react.createElement(BaseInput, _extends$1({
|
|
42221
45136
|
type: "url"
|
|
42222
45137
|
}, props));
|
|
42223
45138
|
}
|
|
42224
45139
|
|
|
42225
45140
|
function UpDownWidget(props) {
|
|
42226
45141
|
var BaseInput = props.registry.widgets.BaseInput;
|
|
42227
|
-
return react.createElement(BaseInput, _extends({
|
|
45142
|
+
return react.createElement(BaseInput, _extends$1({
|
|
42228
45143
|
type: "number"
|
|
42229
45144
|
}, props, rangeSpec(props.schema)));
|
|
42230
45145
|
}
|
|
@@ -42379,13 +45294,13 @@ function createErrorHandler(formData) {
|
|
|
42379
45294
|
|
|
42380
45295
|
if (isObject(formData)) {
|
|
42381
45296
|
return keys$3(formData).reduce(function (acc, key) {
|
|
42382
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45297
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler(formData[key])));
|
|
42383
45298
|
}, handler);
|
|
42384
45299
|
}
|
|
42385
45300
|
|
|
42386
45301
|
if (isArray$2(formData)) {
|
|
42387
45302
|
return formData.reduce(function (acc, value, key) {
|
|
42388
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45303
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, createErrorHandler(value)));
|
|
42389
45304
|
}, handler);
|
|
42390
45305
|
}
|
|
42391
45306
|
|
|
@@ -42397,10 +45312,10 @@ function unwrapErrorHandler(errorHandler) {
|
|
|
42397
45312
|
if (key === "addError") {
|
|
42398
45313
|
return acc;
|
|
42399
45314
|
} else if (key === "__errors") {
|
|
42400
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45315
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, errorHandler[key]));
|
|
42401
45316
|
}
|
|
42402
45317
|
|
|
42403
|
-
return _objectSpread({}, acc, _defineProperty$
|
|
45318
|
+
return _objectSpread({}, acc, _defineProperty$2({}, key, unwrapErrorHandler(errorHandler[key])));
|
|
42404
45319
|
}, {});
|
|
42405
45320
|
}
|
|
42406
45321
|
/**
|
|
@@ -42536,9 +45451,9 @@ function isValid(schema, data) {
|
|
|
42536
45451
|
}
|
|
42537
45452
|
}
|
|
42538
45453
|
|
|
42539
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
45454
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
42540
45455
|
|
|
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); }
|
|
45456
|
+
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
45457
|
var ADDITIONAL_PROPERTY_FLAG = "__additional_property";
|
|
42543
45458
|
var widgetMap = {
|
|
42544
45459
|
"boolean": {
|
|
@@ -42657,9 +45572,9 @@ function getWidget(schema, widget) {
|
|
|
42657
45572
|
Widget.MergedWidget = function (_ref) {
|
|
42658
45573
|
var _ref$options = _ref.options,
|
|
42659
45574
|
options = _ref$options === void 0 ? {} : _ref$options,
|
|
42660
|
-
props = _objectWithoutProperties(_ref, ["options"]);
|
|
45575
|
+
props = _objectWithoutProperties$1(_ref, ["options"]);
|
|
42661
45576
|
|
|
42662
|
-
return react.createElement(Widget, _extends({
|
|
45577
|
+
return react.createElement(Widget, _extends$1({
|
|
42663
45578
|
options: _objectSpread({}, defaultOptions, options)
|
|
42664
45579
|
}, props));
|
|
42665
45580
|
};
|
|
@@ -42673,7 +45588,7 @@ function getWidget(schema, widget) {
|
|
|
42673
45588
|
}
|
|
42674
45589
|
|
|
42675
45590
|
if (typeof widget !== "string") {
|
|
42676
|
-
throw new Error("Unsupported widget definition: ".concat(_typeof(widget)));
|
|
45591
|
+
throw new Error("Unsupported widget definition: ".concat(_typeof$1(widget)));
|
|
42677
45592
|
}
|
|
42678
45593
|
|
|
42679
45594
|
if (registeredWidgets.hasOwnProperty(widget)) {
|
|
@@ -42846,7 +45761,7 @@ function mergeDefaultsWithFormData(defaults, formData) {
|
|
|
42846
45761
|
return value;
|
|
42847
45762
|
});
|
|
42848
45763
|
} else if (isObject(formData)) {
|
|
42849
|
-
var acc = _extends({}, defaults); // Prevent mutation of source object.
|
|
45764
|
+
var acc = _extends$1({}, defaults); // Prevent mutation of source object.
|
|
42850
45765
|
|
|
42851
45766
|
|
|
42852
45767
|
return keys$3(formData).reduce(function (acc, key) {
|
|
@@ -42875,7 +45790,7 @@ function getUiOptions(uiSchema) {
|
|
|
42875
45790
|
return _objectSpread({}, options, value);
|
|
42876
45791
|
}
|
|
42877
45792
|
|
|
42878
|
-
return _objectSpread({}, options, _defineProperty$
|
|
45793
|
+
return _objectSpread({}, options, _defineProperty$2({}, key.substring(3), value));
|
|
42879
45794
|
}, {});
|
|
42880
45795
|
}
|
|
42881
45796
|
function getDisplayLabel(schema, uiSchema, rootSchema) {
|
|
@@ -42906,13 +45821,13 @@ function isObject(thing) {
|
|
|
42906
45821
|
return false;
|
|
42907
45822
|
}
|
|
42908
45823
|
|
|
42909
|
-
return _typeof(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
45824
|
+
return _typeof$1(thing) === "object" && thing !== null && !isArray$2(thing);
|
|
42910
45825
|
}
|
|
42911
45826
|
function mergeObjects(obj1, obj2) {
|
|
42912
45827
|
var concatArrays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
42913
45828
|
|
|
42914
45829
|
// Recursively merge deeply nested objects.
|
|
42915
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
45830
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
42916
45831
|
|
|
42917
45832
|
|
|
42918
45833
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -43128,7 +46043,7 @@ var guessType = function guessType(value) {
|
|
|
43128
46043
|
return "boolean";
|
|
43129
46044
|
} else if (!isNaN(value)) {
|
|
43130
46045
|
return "number";
|
|
43131
|
-
} else if (_typeof(value) === "object") {
|
|
46046
|
+
} else if (_typeof$1(value) === "object") {
|
|
43132
46047
|
return "object";
|
|
43133
46048
|
} // Default to string if we can't figure it out
|
|
43134
46049
|
|
|
@@ -43197,7 +46112,7 @@ function resolveReference(schema, rootSchema, formData) {
|
|
|
43197
46112
|
// Retrieve the referenced schema definition.
|
|
43198
46113
|
var $refSchema = findSchemaDefinition(schema.$ref, rootSchema); // Drop the $ref property of the source schema.
|
|
43199
46114
|
|
|
43200
|
-
var localSchema = _objectWithoutProperties(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
46115
|
+
var localSchema = _objectWithoutProperties$1(schema, ["$ref"]); // Update referenced schema definition with local schema properties.
|
|
43201
46116
|
|
|
43202
46117
|
|
|
43203
46118
|
return retrieveSchema(_objectSpread({}, $refSchema, localSchema), rootSchema, formData);
|
|
@@ -43222,7 +46137,7 @@ function retrieveSchema(schema) {
|
|
|
43222
46137
|
console.warn("could not merge subschemas in allOf:\n" + e);
|
|
43223
46138
|
|
|
43224
46139
|
var _resolvedSchema = resolvedSchema,
|
|
43225
|
-
resolvedSchemaWithoutAllOf = _objectWithoutProperties(_resolvedSchema, ["allOf"]);
|
|
46140
|
+
resolvedSchemaWithoutAllOf = _objectWithoutProperties$1(_resolvedSchema, ["allOf"]);
|
|
43226
46141
|
|
|
43227
46142
|
return resolvedSchemaWithoutAllOf;
|
|
43228
46143
|
}
|
|
@@ -43241,7 +46156,7 @@ function resolveDependencies(schema, rootSchema, formData) {
|
|
|
43241
46156
|
// Drop the dependencies from the source schema.
|
|
43242
46157
|
var _schema$dependencies = schema.dependencies,
|
|
43243
46158
|
dependencies = _schema$dependencies === void 0 ? {} : _schema$dependencies,
|
|
43244
|
-
resolvedSchema = _objectWithoutProperties(schema, ["dependencies"]);
|
|
46159
|
+
resolvedSchema = _objectWithoutProperties$1(schema, ["dependencies"]);
|
|
43245
46160
|
|
|
43246
46161
|
if ("oneOf" in resolvedSchema) {
|
|
43247
46162
|
resolvedSchema = resolvedSchema.oneOf[getMatchingOption(formData, resolvedSchema.oneOf)];
|
|
@@ -43266,7 +46181,7 @@ function processDependencies(dependencies, resolvedSchema, rootSchema, formData)
|
|
|
43266
46181
|
}
|
|
43267
46182
|
|
|
43268
46183
|
var dependencyValue = dependencies[dependencyKey],
|
|
43269
|
-
remainingDependencies = _objectWithoutProperties(dependencies, [dependencyKey].map(_toPropertyKey));
|
|
46184
|
+
remainingDependencies = _objectWithoutProperties$1(dependencies, [dependencyKey].map(_toPropertyKey));
|
|
43270
46185
|
|
|
43271
46186
|
if (isArray$2(dependencyValue)) {
|
|
43272
46187
|
resolvedSchema = withDependentProperties(resolvedSchema, dependencyValue);
|
|
@@ -43294,14 +46209,14 @@ function withDependentProperties(schema, additionallyRequired) {
|
|
|
43294
46209
|
function withDependentSchema(schema, rootSchema, formData, dependencyKey, dependencyValue) {
|
|
43295
46210
|
var _retrieveSchema = retrieveSchema(dependencyValue, rootSchema, formData),
|
|
43296
46211
|
oneOf = _retrieveSchema.oneOf,
|
|
43297
|
-
dependentSchema = _objectWithoutProperties(_retrieveSchema, ["oneOf"]);
|
|
46212
|
+
dependentSchema = _objectWithoutProperties$1(_retrieveSchema, ["oneOf"]);
|
|
43298
46213
|
|
|
43299
46214
|
schema = mergeSchemas(schema, dependentSchema); // Since it does not contain oneOf, we return the original schema.
|
|
43300
46215
|
|
|
43301
46216
|
if (oneOf === undefined) {
|
|
43302
46217
|
return schema;
|
|
43303
46218
|
} else if (!isArray$2(oneOf)) {
|
|
43304
|
-
throw new Error("invalid: it is some ".concat(_typeof(oneOf), " instead of an array"));
|
|
46219
|
+
throw new Error("invalid: it is some ".concat(_typeof$1(oneOf), " instead of an array"));
|
|
43305
46220
|
} // Resolve $refs inside oneOf.
|
|
43306
46221
|
|
|
43307
46222
|
|
|
@@ -43322,7 +46237,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43322
46237
|
if (conditionPropertySchema) {
|
|
43323
46238
|
var conditionSchema = {
|
|
43324
46239
|
type: "object",
|
|
43325
|
-
properties: _defineProperty$
|
|
46240
|
+
properties: _defineProperty$2({}, dependencyKey, conditionPropertySchema)
|
|
43326
46241
|
};
|
|
43327
46242
|
|
|
43328
46243
|
var _validateFormData = validateFormData(formData, conditionSchema),
|
|
@@ -43340,7 +46255,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43340
46255
|
var subschema = validSubschemas[0];
|
|
43341
46256
|
|
|
43342
46257
|
var _subschema$properties = subschema.properties,
|
|
43343
|
-
dependentSubschema = _objectWithoutProperties(_subschema$properties, [dependencyKey].map(_toPropertyKey));
|
|
46258
|
+
dependentSubschema = _objectWithoutProperties$1(_subschema$properties, [dependencyKey].map(_toPropertyKey));
|
|
43344
46259
|
|
|
43345
46260
|
var dependentSchema = _objectSpread({}, subschema, {
|
|
43346
46261
|
properties: dependentSubschema
|
|
@@ -43355,7 +46270,7 @@ function withExactlyOneSubschema(schema, rootSchema, formData, dependencyKey, on
|
|
|
43355
46270
|
|
|
43356
46271
|
|
|
43357
46272
|
function mergeSchemas(obj1, obj2) {
|
|
43358
|
-
var acc = _extends({}, obj1); // Prevent mutation of source object.
|
|
46273
|
+
var acc = _extends$1({}, obj1); // Prevent mutation of source object.
|
|
43359
46274
|
|
|
43360
46275
|
|
|
43361
46276
|
return keys$3(obj2).reduce(function (acc, key) {
|
|
@@ -43393,7 +46308,7 @@ function deepEquals(a, b) {
|
|
|
43393
46308
|
// Assume all functions are equivalent
|
|
43394
46309
|
// see https://github.com/rjsf-team/react-jsonschema-form/issues/255
|
|
43395
46310
|
return true;
|
|
43396
|
-
} else if (_typeof(a) !== "object" || _typeof(b) !== "object") {
|
|
46311
|
+
} else if (_typeof$1(a) !== "object" || _typeof$1(b) !== "object") {
|
|
43397
46312
|
return false;
|
|
43398
46313
|
} else if (a === null || b === null) {
|
|
43399
46314
|
return false;
|
|
@@ -43655,7 +46570,7 @@ function getMatchingOption(formData, options, rootSchema) {
|
|
|
43655
46570
|
|
|
43656
46571
|
if (option.anyOf) {
|
|
43657
46572
|
// Create a shallow clone of the option
|
|
43658
|
-
var shallowClone = _extends({}, option);
|
|
46573
|
+
var shallowClone = _extends$1({}, option);
|
|
43659
46574
|
|
|
43660
46575
|
if (!shallowClone.allOf) {
|
|
43661
46576
|
shallowClone.allOf = [];
|
|
@@ -43667,7 +46582,7 @@ function getMatchingOption(formData, options, rootSchema) {
|
|
|
43667
46582
|
shallowClone.allOf.push(requiresAnyOf);
|
|
43668
46583
|
augmentedSchema = shallowClone;
|
|
43669
46584
|
} else {
|
|
43670
|
-
augmentedSchema = _extends({}, option, requiresAnyOf);
|
|
46585
|
+
augmentedSchema = _extends$1({}, option, requiresAnyOf);
|
|
43671
46586
|
} // Remove the "required" field as it's likely that not all fields have
|
|
43672
46587
|
// been filled in yet, which will mean that the schema is not valid
|
|
43673
46588
|
|
|
@@ -43945,10 +46860,10 @@ function SchemaFieldRender(props) {
|
|
|
43945
46860
|
var displayLabel = getDisplayLabel(schema, uiSchema, rootSchema);
|
|
43946
46861
|
|
|
43947
46862
|
var __errors = errorSchema.__errors,
|
|
43948
|
-
fieldErrorSchema = _objectWithoutProperties(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
46863
|
+
fieldErrorSchema = _objectWithoutProperties$1(errorSchema, ["__errors"]); // See #439: uiSchema: Don't pass consumed class names to child components
|
|
43949
46864
|
|
|
43950
46865
|
|
|
43951
|
-
var field = react.createElement(FieldComponent, _extends({}, props, {
|
|
46866
|
+
var field = react.createElement(FieldComponent, _extends$1({}, props, {
|
|
43952
46867
|
idSchema: idSchema,
|
|
43953
46868
|
schema: schema,
|
|
43954
46869
|
uiSchema: _objectSpread({}, uiSchema, {
|
|
@@ -44944,13 +47859,13 @@ function isInteger(data) {
|
|
|
44944
47859
|
return Number.isInteger(Number(data));
|
|
44945
47860
|
}
|
|
44946
47861
|
|
|
44947
|
-
const formCss = "@charset \"UTF-8\"
|
|
47862
|
+
const formCss = "@charset \"UTF-8\";*,*::after,*::before{box-sizing:border-box}.form-group{min-width:0}.limel-form-array-item--simple{display:flex;align-items:center;padding:0.25rem}.limel-form-array-item--simple>*:first-child{flex:1;min-width:0}.array-items{isolation:isolate;display:flex;flex-direction:column;row-gap:var(--form-row-gap, 0.5rem);margin-top:1rem}.array-items.has-an-item-which-is-being-dragged limel-collapsible-section{--limel-cs-grid-template-rows:0fr;--limel-cs-opacity-transition-speed:0.2s;--limel-cs-grid-template-rows-transition-speed:0.2s;--limel-cs-open-header-bottom-border-radius:0.75rem}.array-item:has(limel-drag-handle:hover),.array-item:has(limel-drag-handle:focus-within),.array-item.is-elevated,.array-item.sortable-chosen{will-change:transform, box-shadow, border-radius, background-color}.array-item.sortable-ghost{border-radius:0.5rem;box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}.array-item.sortable-chosen{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color)}.array-item.is-elevated[draggable=false]{animation:sit-here 0.8s forwards}@keyframes sit-here{0%{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}100%{box-shadow:none}}limel-drag-handle{order:10}limel-collapsible-section.is-being-dragged{border-radius:0.75rem !important}.limel-form-layout--default{display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem)}.limel-form-layout--grid{--min-height-of-one-row:2.5rem;display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem);grid-template-columns:repeat(var(--number-of-columns), minmax(0, 1fr))}.limel-form-layout--grid.auto-reorder-to-avoid-empty-cells{grid-auto-flow:dense}.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5{grid-column:span 5}.limel-form-layout--grid .limel-form-layout-colspan--all{grid-column:1/-1}.limel-form-layout--grid limel-checkbox,.limel-form-layout--grid limel-switch{min-height:var(--min-height-of-one-row)}.limel-form-layout--grid limel-checkbox{display:block}.limel-form-layout--grid limel-switch{margin-left:0.5rem}.form-error{color:var(--limel-theme-error-color);font-size:0.6875rem;line-height:1.5;visibility:inherit;padding-right:1rem;padding-left:1rem;padding-top:0.25rem}.button-add-new{margin-top:0.5rem;width:100%}h1{position:relative;margin-top:0;margin-bottom:0;word-break:break-word;hyphens:auto;-webkit-hyphens:auto;text-wrap:balance;font-size:var(--limel-form-h1-font-size);line-height:calc(var(--limel-form-h1-font-size) * 1.42857);letter-spacing:-0.01rem;font-weight:500}p{margin-top:0;margin-bottom:0.75rem;font-size:var(--limel-theme-default-font-size)}.form-group{position:relative}.form-group limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5)}.form-group h1,.form-group p{color:rgb(var(--contrast-1400), 0.8)}.form-group h1{--limel-form-h1-font-size:1.476rem;font-weight:800}.form-group .form-group h1{--limel-form-h1-font-size:1.383rem;font-weight:700}.form-group .form-group h1:before{content:\"\";display:block;position:absolute;top:0;bottom:0;margin:auto;left:-0.75rem;background-color:var(--lime-primary-color, var(--limel-theme-primary-color));width:0.125rem;height:1.5rem;border-radius:0.125rem;opacity:0.6}.form-group .form-group .form-group h1{--limel-form-h1-font-size:1.296rem;font-weight:600}.form-group .form-group .form-group h1:before{display:none}.form-group .form-group .form-group .form-group h1{--limel-form-h1-font-size:1.215rem}.form-group .form-group .form-group .form-group h1:before{display:none}.form-group .form-group .form-group .form-group .form-group h1{--limel-form-h1-font-size:1.138rem}.form-group .form-group .form-group .form-group .form-group h1:before{display:none}.form-group .form-group .form-group .form-group .form-group .form-group h1{--limel-form-h1-font-size:1.067rem}.form-group .form-group .form-group .form-group .form-group .form-group h1:before{display:none}.limel-form-row--layout{--limel-form-row-border-radius:0.375rem;--limel-form-row-icon-size:1.75rem;--limel-form-row-main-information-gap:0.5rem;display:flex;flex-direction:column}.limel-form-row--layout .row{display:flex;gap:0.5rem;flex-direction:column;padding:0.5rem 1rem}.limel-form-row--layout .row:nth-child(odd){background-color:var(--form-background-color-of-odd-rows, rgb(var(--contrast-200)))}.limel-form-row--layout .row:nth-child(even){background-color:var(--form-background-color-of-even-rows, transparent)}.limel-form-row--layout .row:first-child{border-radius:var(--limel-form-row-border-radius) var(--limel-form-row-border-radius) 0 0}.limel-form-row--layout .row:last-child{border-radius:0 0 var(--limel-form-row-border-radius) var(--limel-form-row-border-radius)}.limel-form-row--layout .main-information{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--limel-form-row-main-information-gap);min-width:0}.limel-form-row--layout .main-information{position:relative}.limel-form-row--layout .main-information>.form-group.field{position:unset}.limel-form-row--layout .main-information>.form-group.field limel-help{top:0}.limel-form-row--layout limel-icon{color:rgb(var(--contrast-1200));width:var(--limel-form-row-icon-size);flex-shrink:0;min-width:0}.limel-form-row--layout .title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;font-weight:normal;flex-grow:1;color:var(--limel-theme-on-surface-color);font-size:0.875rem}.limel-form-row--layout .description{margin:0;color:var(--limel-theme-text-secondary-on-background-color);font-size:var(--limel-theme-default-small-font-size);line-height:1.5}.limel-form-row--layout .has-icon .description{padding-left:calc(var(--limel-form-row-icon-size) + var(--limel-form-row-main-information-gap))}.limel-form-row--layout .form-group.field{flex-shrink:0;display:flex;align-content:center}.limel-form-row--layout .form-group.field limel-slider{min-width:8rem;display:block}";
|
|
44948
47863
|
|
|
44949
47864
|
const Form = class {
|
|
44950
47865
|
constructor(hostRef) {
|
|
44951
|
-
index$
|
|
44952
|
-
this.change = index$
|
|
44953
|
-
this.validate = index$
|
|
47866
|
+
index$2.registerInstance(this, hostRef);
|
|
47867
|
+
this.change = index$2.createEvent(this, "change", 7);
|
|
47868
|
+
this.validate = index$2.createEvent(this, "validate", 7);
|
|
44954
47869
|
this.isValid = true;
|
|
44955
47870
|
this.schema = {};
|
|
44956
47871
|
this.value = undefined;
|
|
@@ -44990,7 +47905,7 @@ const Form = class {
|
|
|
44990
47905
|
}
|
|
44991
47906
|
}
|
|
44992
47907
|
render() {
|
|
44993
|
-
return index$
|
|
47908
|
+
return index$2.h("div", { class: "root" });
|
|
44994
47909
|
}
|
|
44995
47910
|
reactRender() {
|
|
44996
47911
|
if (!this.root) {
|
|
@@ -45109,7 +48024,7 @@ const Form = class {
|
|
|
45109
48024
|
return Object.assign(Object.assign({}, originalError), { message: transformedError.message });
|
|
45110
48025
|
});
|
|
45111
48026
|
}
|
|
45112
|
-
get host() { return index$
|
|
48027
|
+
get host() { return index$2.getElement(this); }
|
|
45113
48028
|
static get watchers() { return {
|
|
45114
48029
|
"schema": ["setSchema"]
|
|
45115
48030
|
}; }
|