@limetech/lime-elements 40.12.3 → 40.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/drag-to-reorder-BP5YkPuu.js +3092 -0
  3. package/dist/cjs/lime-elements.cjs.js +1 -1
  4. package/dist/cjs/{limel-scroller.cjs.entry.js → limel-drag-handle_2.cjs.entry.js} +38 -0
  5. package/dist/cjs/limel-file-viewer.cjs.entry.js +64 -55
  6. package/dist/cjs/limel-form.cjs.entry.js +539 -3171
  7. package/dist/cjs/limel-tab-bar.cjs.entry.js +120 -16
  8. package/dist/cjs/limel-tab-panel.cjs.entry.js +7 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/components/form/form.css +59 -0
  11. package/dist/collection/components/form/form.js +49 -2
  12. package/dist/collection/components/form/show-field.js +116 -0
  13. package/dist/collection/components/form/templates/array-field-collapsible-item.js +1 -0
  14. package/dist/collection/components/form/templates/array-field-item.js +5 -0
  15. package/dist/collection/components/form/templates/array-field.js +20 -158
  16. package/dist/collection/components/form/templates/field.js +17 -0
  17. package/dist/collection/components/tab-bar/tab-bar.css +68 -22
  18. package/dist/collection/components/tab-bar/tab-bar.js +131 -4
  19. package/dist/collection/components/tab-bar/tabs.js +23 -0
  20. package/dist/collection/components/tab-panel/tab-panel.js +54 -1
  21. package/dist/collection/util/drag-to-reorder.js +116 -0
  22. package/dist/esm/{_baseForOwn-D5j7fHlv.js → _baseForOwn-vKFWmmaS.js} +1 -1
  23. package/dist/esm/{_baseIsEqual-CyF4P8uM.js → _baseIsEqual-B_JRErB0.js} +1 -1
  24. package/dist/esm/{_baseIteratee-CpbczHY1.js → _baseIteratee-CVz7aes3.js} +1 -1
  25. package/dist/esm/{_baseSet-Cw2IE6ZF.js → _baseSet-BUAq8NGm.js} +1 -1
  26. package/dist/esm/{cloneDeep-DAbOtbs8.js → cloneDeep-Bcll-3f8.js} +1 -1
  27. package/dist/esm/drag-to-reorder-BXmXIwCa.js +3086 -0
  28. package/dist/esm/{isEqual-CE83yS8T.js → isEqual-C-pK6AAU.js} +1 -1
  29. package/dist/esm/lime-elements.js +1 -1
  30. package/dist/esm/limel-chip-set.entry.js +2 -2
  31. package/dist/esm/limel-dialog.entry.js +2 -2
  32. package/dist/esm/{limel-scroller.entry.js → limel-drag-handle_2.entry.js} +38 -1
  33. package/dist/esm/limel-file-dropzone_2.entry.js +3 -3
  34. package/dist/esm/limel-file-viewer.entry.js +64 -55
  35. package/dist/esm/limel-form.entry.js +536 -3168
  36. package/dist/esm/limel-prosemirror-adapter.entry.js +3 -3
  37. package/dist/esm/limel-tab-bar.entry.js +117 -13
  38. package/dist/esm/limel-tab-panel.entry.js +7 -1
  39. package/dist/esm/limel-table.entry.js +4 -4
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/lime-elements/lime-elements.esm.js +1 -1
  42. package/dist/lime-elements/{p-35bc5ed2.entry.js → p-13f2afc9.entry.js} +1 -1
  43. package/dist/lime-elements/p-3b6d4934.entry.js +1 -0
  44. package/dist/lime-elements/p-67767276.entry.js +1 -0
  45. package/dist/lime-elements/{p-fb15f608.entry.js → p-6d65ee35.entry.js} +1 -1
  46. package/dist/lime-elements/p-714ab66d.entry.js +16 -0
  47. package/dist/lime-elements/{p-ff4a8b89.entry.js → p-7ae71c13.entry.js} +1 -1
  48. package/dist/lime-elements/p-BAqAt5It.js +1 -0
  49. package/dist/lime-elements/p-Cu9Ji1iJ.js +1 -0
  50. package/dist/lime-elements/{p-BY5NjPj8.js → p-D9Ezd43A.js} +1 -1
  51. package/dist/lime-elements/{p-nVemxylR.js → p-DFu1q54T.js} +1 -1
  52. package/dist/lime-elements/p-DdnBHYb-.js +7 -0
  53. package/dist/lime-elements/{p-B6-3WXAv.js → p-DeIIlp6m.js} +1 -1
  54. package/dist/lime-elements/p-Dq0uNStc.js +1 -0
  55. package/dist/lime-elements/p-b5bb124f.entry.js +1 -0
  56. package/dist/lime-elements/{p-9168793f.entry.js → p-bd58c761.entry.js} +1 -1
  57. package/dist/lime-elements/{p-458c131f.entry.js → p-c7e34502.entry.js} +1 -1
  58. package/dist/lime-elements/p-fb526a05.entry.js +1 -0
  59. package/dist/types/components/form/form.d.ts +15 -0
  60. package/dist/types/components/form/show-field.d.ts +9 -0
  61. package/dist/types/components/form/templates/array-context.d.ts +4 -0
  62. package/dist/types/components/form/templates/array-field-collapsible-item.d.ts +5 -0
  63. package/dist/types/components/form/templates/array-field.d.ts +3 -13
  64. package/dist/types/components/form/templates/field.d.ts +1 -0
  65. package/dist/types/components/form/templates/object-field.d.ts +2 -2
  66. package/dist/types/components/tab-bar/tab-bar.d.ts +25 -0
  67. package/dist/types/components/tab-bar/tab.types.d.ts +18 -0
  68. package/dist/types/components/tab-bar/tabs.d.ts +12 -1
  69. package/dist/types/components/tab-panel/tab-panel.d.ts +18 -1
  70. package/dist/types/components.d.ts +80 -2
  71. package/dist/types/util/drag-to-reorder.d.ts +65 -0
  72. package/package.json +4 -4
  73. package/dist/cjs/isArrayLikeObject-U2Ddbw4n.js +0 -326
  74. package/dist/cjs/limel-drag-handle.cjs.entry.js +0 -42
  75. package/dist/esm/isArrayLikeObject-CJB8HbtH.js +0 -321
  76. package/dist/esm/limel-drag-handle.entry.js +0 -40
  77. package/dist/lime-elements/p-49eb2f64.entry.js +0 -13
  78. package/dist/lime-elements/p-646731b6.entry.js +0 -1
  79. package/dist/lime-elements/p-8d567e42.entry.js +0 -1
  80. package/dist/lime-elements/p-BQeIv4aA.js +0 -1
  81. package/dist/lime-elements/p-COdirXg1.js +0 -1
  82. package/dist/lime-elements/p-ORUNaKm-.js +0 -1
  83. package/dist/lime-elements/p-a5246373.entry.js +0 -1
  84. package/dist/lime-elements/p-b609552e.entry.js +0 -1
  85. package/dist/lime-elements/p-bf849dc9.entry.js +0 -1
  86. package/dist/lime-elements/p-pk5KIdKH.js +0 -1
@@ -1,20 +1,21 @@
1
1
  import { r as registerInstance, c as createEvent, h as h$1, a as getElement } from './index-BU9IJqli.js';
2
2
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers-B85MJLTf.js';
3
- import { t as toString$1, b as baseIteratee, g as get } from './_baseIteratee-CpbczHY1.js';
3
+ import { t as toString$1, b as baseIteratee, g as get } from './_baseIteratee-CVz7aes3.js';
4
4
  import { i as isEmpty } from './isEmpty-BGVZ12Ea.js';
5
- import { i as isEqual } from './isEqual-CE83yS8T.js';
6
5
  import { b as baseGetTag } from './isObject-BJQylLSL.js';
7
6
  import { g as getPrototype } from './_getPrototype-B0kMNv1F.js';
8
7
  import { i as isObjectLike } from './isObjectLike-oiMYqRQ0.js';
9
- import { b as baseSet, n as negate } from './_baseSet-Cw2IE6ZF.js';
10
- import { a as arrayIncludes, b as baseRest, c as baseFlatten, i as isArrayLikeObject } from './isArrayLikeObject-CJB8HbtH.js';
11
- import { s as setToArray, S as SetCache, c as cacheHas } from './_baseIsEqual-CyF4P8uM.js';
8
+ import { b as baseSet, n as negate } from './_baseSet-BUAq8NGm.js';
9
+ import { a as arrayIncludes, b as baseRest, c as baseFlatten, i as isArrayLikeObject, D as DragToReorder } from './drag-to-reorder-BXmXIwCa.js';
10
+ import { s as setToArray, S as SetCache, c as cacheHas } from './_baseIsEqual-B_JRErB0.js';
12
11
  import { S as Set$1 } from './_getTag-BiAaLWvH.js';
12
+ import { i as isEqual } from './isEqual-C-pK6AAU.js';
13
13
  import { m as moment } from './moment-_DadZLWp.js';
14
- import { c as cloneDeep } from './cloneDeep-DAbOtbs8.js';
14
+ import { c as cloneDeep } from './cloneDeep-Bcll-3f8.js';
15
15
  import { i as isMultiple } from './multiple-BylwpiM6.js';
16
+ import { g as getFocusTarget } from './get-focus-target-BhoYaGlg.js';
16
17
  import { b as baseAssignValue } from './_assignValue-CEFvyZxO.js';
17
- import { b as baseForOwn } from './_baseForOwn-D5j7fHlv.js';
18
+ import { b as baseForOwn } from './_baseForOwn-vKFWmmaS.js';
18
19
  import './isArray-B8VKuhvH.js';
19
20
  import './isSymbol-ClAke5ga.js';
20
21
  import './_isIndex-B--C3qwe.js';
@@ -36828,15 +36829,15 @@ function requireDataType () {
36828
36829
  return dataType;
36829
36830
  }
36830
36831
 
36831
- var defaults$1 = {};
36832
+ var defaults = {};
36832
36833
 
36833
36834
  var hasRequiredDefaults;
36834
36835
 
36835
36836
  function requireDefaults () {
36836
- if (hasRequiredDefaults) return defaults$1;
36837
+ if (hasRequiredDefaults) return defaults;
36837
36838
  hasRequiredDefaults = 1;
36838
- Object.defineProperty(defaults$1, "__esModule", { value: true });
36839
- defaults$1.assignDefaults = void 0;
36839
+ Object.defineProperty(defaults, "__esModule", { value: true });
36840
+ defaults.assignDefaults = void 0;
36840
36841
  const codegen_1 = /*@__PURE__*/ requireCodegen();
36841
36842
  const util_1 = /*@__PURE__*/ requireUtil();
36842
36843
  function assignDefaults(it, ty) {
@@ -36850,7 +36851,7 @@ function requireDefaults () {
36850
36851
  items.forEach((sch, i) => assignDefault(it, i, sch.default));
36851
36852
  }
36852
36853
  }
36853
- defaults$1.assignDefaults = assignDefaults;
36854
+ defaults.assignDefaults = assignDefaults;
36854
36855
  function assignDefault(it, prop, defaultValue) {
36855
36856
  const { gen, compositeRule, data, opts } = it;
36856
36857
  if (defaultValue === undefined)
@@ -36869,7 +36870,7 @@ function requireDefaults () {
36869
36870
  gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
36870
36871
  }
36871
36872
 
36872
- return defaults$1;
36873
+ return defaults;
36873
36874
  }
36874
36875
 
36875
36876
  var keyword = {};
@@ -43696,40 +43697,6 @@ function isType(input, type) {
43696
43697
  return input === type;
43697
43698
  }
43698
43699
 
43699
- const FieldTemplate = (props) => {
43700
- let classNames = props.classNames;
43701
- const colSpan = getColSpan(props.schema);
43702
- const rowSpan = getRowSpan(props.schema);
43703
- let style;
43704
- if (colSpan) {
43705
- classNames += ` limel-form-layout-colspan--${colSpan}`;
43706
- }
43707
- if (rowSpan) {
43708
- style = {
43709
- gridRow: `span ${rowSpan}`,
43710
- minHeight: `calc(var(--min-height-of-one-row) * ${rowSpan})`,
43711
- };
43712
- }
43713
- return React.createElement('div', {
43714
- className: classNames,
43715
- style: style,
43716
- }, props.children);
43717
- };
43718
- function getColSpan(schema) {
43719
- var _a;
43720
- const layout = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.layout;
43721
- const colSpan = layout === null || layout === void 0 ? void 0 : layout.colSpan;
43722
- if (!colSpan && isObjectType(schema)) {
43723
- return 'all';
43724
- }
43725
- return colSpan;
43726
- }
43727
- function getRowSpan(schema) {
43728
- var _a;
43729
- const layout = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.layout;
43730
- return layout === null || layout === void 0 ? void 0 : layout.rowSpan;
43731
- }
43732
-
43733
43700
  /**
43734
43701
  *
43735
43702
  * @param title
@@ -43865,2675 +43832,426 @@ function hasNestedErrors(errorSchema) {
43865
43832
  });
43866
43833
  }
43867
43834
 
43868
- /**!
43869
- * Sortable 1.15.7
43870
- * @author RubaXa <trash@rubaxa.org>
43871
- * @author owenm <owen23355@gmail.com>
43872
- * @license MIT
43873
- */
43874
- function _defineProperty(e, r, t) {
43875
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
43876
- value: t,
43877
- enumerable: true,
43878
- configurable: true,
43879
- writable: true
43880
- }) : e[r] = t, e;
43881
- }
43882
- function _extends() {
43883
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
43884
- for (var e = 1; e < arguments.length; e++) {
43885
- var t = arguments[e];
43886
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
43887
- }
43888
- return n;
43889
- }, _extends.apply(null, arguments);
43890
- }
43891
- function ownKeys(e, r) {
43892
- var t = Object.keys(e);
43893
- if (Object.getOwnPropertySymbols) {
43894
- var o = Object.getOwnPropertySymbols(e);
43895
- r && (o = o.filter(function (r) {
43896
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
43897
- })), t.push.apply(t, o);
43898
- }
43899
- return t;
43900
- }
43901
- function _objectSpread2(e) {
43902
- for (var r = 1; r < arguments.length; r++) {
43903
- var t = null != arguments[r] ? arguments[r] : {};
43904
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
43905
- _defineProperty(e, r, t[r]);
43906
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
43907
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
43908
- });
43909
- }
43910
- return e;
43911
- }
43912
- function _objectWithoutProperties(e, t) {
43913
- if (null == e) return {};
43914
- var o,
43915
- r,
43916
- i = _objectWithoutPropertiesLoose(e, t);
43917
- if (Object.getOwnPropertySymbols) {
43918
- var n = Object.getOwnPropertySymbols(e);
43919
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
43920
- }
43921
- return i;
43922
- }
43923
- function _objectWithoutPropertiesLoose(r, e) {
43924
- if (null == r) return {};
43925
- var t = {};
43926
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
43927
- if (-1 !== e.indexOf(n)) continue;
43928
- t[n] = r[n];
43929
- }
43930
- return t;
43931
- }
43932
- function _toPrimitive(t, r) {
43933
- if ("object" != typeof t || !t) return t;
43934
- var e = t[Symbol.toPrimitive];
43935
- if (void 0 !== e) {
43936
- var i = e.call(t, r);
43937
- if ("object" != typeof i) return i;
43938
- throw new TypeError("@@toPrimitive must return a primitive value.");
43939
- }
43940
- return ("string" === r ? String : Number)(t);
43941
- }
43942
- function _toPropertyKey(t) {
43943
- var i = _toPrimitive(t, "string");
43944
- return "symbol" == typeof i ? i : i + "";
43945
- }
43946
- function _typeof(o) {
43947
- "@babel/helpers - typeof";
43948
-
43949
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
43950
- return typeof o;
43951
- } : function (o) {
43952
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
43953
- }, _typeof(o);
43954
- }
43955
-
43956
- var version = "1.15.7";
43957
-
43958
- function userAgent(pattern) {
43959
- if (typeof window !== 'undefined' && window.navigator) {
43960
- return !! /*@__PURE__*/navigator.userAgent.match(pattern);
43961
- }
43962
- }
43963
- var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
43964
- var Edge = userAgent(/Edge/i);
43965
- var FireFox = userAgent(/firefox/i);
43966
- var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
43967
- var IOS = userAgent(/iP(ad|od|hone)/i);
43968
- var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
43969
-
43970
- var captureMode = {
43971
- capture: false,
43972
- passive: false
43973
- };
43974
- function on(el, event, fn) {
43975
- el.addEventListener(event, fn, !IE11OrLess && captureMode);
43976
- }
43977
- function off(el, event, fn) {
43978
- el.removeEventListener(event, fn, !IE11OrLess && captureMode);
43979
- }
43980
- function matches( /**HTMLElement*/el, /**String*/selector) {
43981
- if (!selector) return;
43982
- selector[0] === '>' && (selector = selector.substring(1));
43983
- if (el) {
43984
- try {
43985
- if (el.matches) {
43986
- return el.matches(selector);
43987
- } else if (el.msMatchesSelector) {
43988
- return el.msMatchesSelector(selector);
43989
- } else if (el.webkitMatchesSelector) {
43990
- return el.webkitMatchesSelector(selector);
43991
- }
43992
- } catch (_) {
43993
- return false;
43994
- }
43995
- }
43996
- return false;
43997
- }
43998
- function getParentOrHost(el) {
43999
- return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
44000
- }
44001
- function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
44002
- if (el) {
44003
- ctx = ctx || document;
44004
- do {
44005
- if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
44006
- return el;
44007
- }
44008
- if (el === ctx) break;
44009
- /* jshint boss:true */
44010
- } while (el = getParentOrHost(el));
44011
- }
44012
- return null;
44013
- }
44014
- var R_SPACE = /\s+/g;
44015
- function toggleClass(el, name, state) {
44016
- if (el && name) {
44017
- if (el.classList) {
44018
- el.classList[state ? 'add' : 'remove'](name);
44019
- } else {
44020
- var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
44021
- el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
43835
+ const MAX_COLUMNS = 5;
43836
+ const MAX_COLUMN_WIDTH = 15;
43837
+ const PX_PER_REM = 16;
43838
+ const COLUMN_COUNT = '--number-of-columns';
43839
+ class GridLayout extends React.Component {
43840
+ constructor(props) {
43841
+ super(props);
43842
+ this.props = props;
43843
+ this.handleResize = this.handleResize.bind(this);
43844
+ this.state = {
43845
+ maxColumns: MAX_COLUMNS,
43846
+ };
43847
+ this.elementRef = React.createRef();
44022
43848
  }
44023
- }
44024
- }
44025
- function css(el, prop, val) {
44026
- var style = el && el.style;
44027
- if (style) {
44028
- if (val === void 0) {
44029
- if (document.defaultView && document.defaultView.getComputedStyle) {
44030
- val = document.defaultView.getComputedStyle(el, '');
44031
- } else if (el.currentStyle) {
44032
- val = el.currentStyle;
44033
- }
44034
- return prop === void 0 ? val : val[prop];
44035
- } else {
44036
- if (!(prop in style) && prop.indexOf('webkit') === -1) {
44037
- prop = '-webkit-' + prop;
44038
- }
44039
- style[prop] = val + (typeof val === 'string' ? '' : 'px');
43849
+ componentDidMount() {
43850
+ this.observer = new ResizeObserver(this.handleResize);
43851
+ this.observer.observe(this.elementRef.current);
43852
+ window.addEventListener('resize', this.handleResize, {
43853
+ capture: true,
43854
+ passive: true,
43855
+ });
44040
43856
  }
44041
- }
44042
- }
44043
- function matrix(el, selfOnly) {
44044
- var appliedTransforms = '';
44045
- if (typeof el === 'string') {
44046
- appliedTransforms = el;
44047
- } else {
44048
- do {
44049
- var transform = css(el, 'transform');
44050
- if (transform && transform !== 'none') {
44051
- appliedTransforms = transform + ' ' + appliedTransforms;
44052
- }
44053
- /* jshint boss:true */
44054
- } while (!selfOnly && (el = el.parentNode));
44055
- }
44056
- var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
44057
- /*jshint -W056 */
44058
- return matrixFn && new matrixFn(appliedTransforms);
44059
- }
44060
- function find(ctx, tagName, iterator) {
44061
- if (ctx) {
44062
- var list = ctx.getElementsByTagName(tagName),
44063
- i = 0,
44064
- n = list.length;
44065
- if (iterator) {
44066
- for (; i < n; i++) {
44067
- iterator(list[i], i);
44068
- }
43857
+ componentWillUnmount() {
43858
+ this.observer.unobserve(this.elementRef.current);
43859
+ window.removeEventListener('resize', this.handleResize, {
43860
+ capture: true,
43861
+ });
44069
43862
  }
44070
- return list;
44071
- }
44072
- return [];
44073
- }
44074
- function getWindowScrollingElement() {
44075
- var scrollingElement = document.scrollingElement;
44076
- if (scrollingElement) {
44077
- return scrollingElement;
44078
- } else {
44079
- return document.documentElement;
44080
- }
44081
- }
44082
-
44083
- /**
44084
- * Returns the "bounding client rect" of given element
44085
- * @param {HTMLElement} el The element whose boundingClientRect is wanted
44086
- * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
44087
- * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
44088
- * @param {[Boolean]} undoScale Whether the container's scale() should be undone
44089
- * @param {[HTMLElement]} container The parent the element will be placed in
44090
- * @return {Object} The boundingClientRect of el, with specified adjustments
44091
- */
44092
- function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
44093
- if (!el.getBoundingClientRect && el !== window) return;
44094
- var elRect, top, left, bottom, right, height, width;
44095
- if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
44096
- elRect = el.getBoundingClientRect();
44097
- top = elRect.top;
44098
- left = elRect.left;
44099
- bottom = elRect.bottom;
44100
- right = elRect.right;
44101
- height = elRect.height;
44102
- width = elRect.width;
44103
- } else {
44104
- top = 0;
44105
- left = 0;
44106
- bottom = window.innerHeight;
44107
- right = window.innerWidth;
44108
- height = window.innerHeight;
44109
- width = window.innerWidth;
44110
- }
44111
- if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
44112
- // Adjust for translate()
44113
- container = container || el.parentNode;
44114
-
44115
- // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
44116
- // Not needed on <= IE11
44117
- if (!IE11OrLess) {
44118
- do {
44119
- if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
44120
- var containerRect = container.getBoundingClientRect();
44121
-
44122
- // Set relative to edges of padding box of container
44123
- top -= containerRect.top + parseInt(css(container, 'border-top-width'));
44124
- left -= containerRect.left + parseInt(css(container, 'border-left-width'));
44125
- bottom = top + elRect.height;
44126
- right = left + elRect.width;
44127
- break;
44128
- }
44129
- /* jshint boss:true */
44130
- } while (container = container.parentNode);
43863
+ handleResize() {
43864
+ requestAnimationFrame(() => {
43865
+ const element = this.elementRef.current;
43866
+ if (!element) {
43867
+ return;
43868
+ }
43869
+ const width = element.getBoundingClientRect().width;
43870
+ const maxColumns = Math.min(MAX_COLUMNS, Math.max(1, Math.floor(width / (MAX_COLUMN_WIDTH * PX_PER_REM))));
43871
+ const columns = this.getColumnCount(maxColumns);
43872
+ if (element.style.getPropertyValue(COLUMN_COUNT) !== `${columns}`) {
43873
+ element.style.setProperty(COLUMN_COUNT, `${columns}`);
43874
+ }
43875
+ if (maxColumns !== this.state.maxColumns) {
43876
+ this.setState({
43877
+ maxColumns: maxColumns,
43878
+ });
43879
+ }
43880
+ });
44131
43881
  }
44132
- }
44133
- if (undoScale && el !== window) {
44134
- // Adjust for scale()
44135
- var elMatrix = matrix(container || el),
44136
- scaleX = elMatrix && elMatrix.a,
44137
- scaleY = elMatrix && elMatrix.d;
44138
- if (elMatrix) {
44139
- top /= scaleY;
44140
- left /= scaleX;
44141
- width /= scaleX;
44142
- height /= scaleY;
44143
- bottom = top + height;
44144
- right = left + width;
43882
+ render() {
43883
+ var _a;
43884
+ const classes = ['limel-form-layout--grid'];
43885
+ const columns = this.getColumnCount(this.state.maxColumns);
43886
+ classes.push(`layout-${columns}-columns`);
43887
+ if (this.hasAutoFlowDense()) {
43888
+ classes.push('auto-reorder-to-avoid-empty-cells');
43889
+ }
43890
+ return React.createElement('div', {
43891
+ className: classes.join(' '),
43892
+ 'data-schema-path': toSchemaPath((_a = this.props.schemaPath) !== null && _a !== void 0 ? _a : []),
43893
+ ref: this.elementRef,
43894
+ }, this.props.children);
44145
43895
  }
44146
- }
44147
- return {
44148
- top: top,
44149
- left: left,
44150
- bottom: bottom,
44151
- right: right,
44152
- width: width,
44153
- height: height
44154
- };
44155
- }
44156
-
44157
- /**
44158
- * Checks if a side of an element is scrolled past a side of its parents
44159
- * @param {HTMLElement} el The element who's side being scrolled out of view is in question
44160
- * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
44161
- * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
44162
- * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
44163
- */
44164
- function isScrolledPast(el, elSide, parentSide) {
44165
- var parent = getParentAutoScrollElement(el, true),
44166
- elSideVal = getRect(el)[elSide];
44167
-
44168
- /* jshint boss:true */
44169
- while (parent) {
44170
- var parentSideVal = getRect(parent)[parentSide],
44171
- visible = void 0;
44172
- {
44173
- visible = elSideVal >= parentSideVal;
43896
+ getColumnCount(maxColumns) {
43897
+ const layout = this.props.options;
43898
+ return Math.min(layout.columns || MAX_COLUMNS, maxColumns);
44174
43899
  }
44175
- if (!visible) return parent;
44176
- if (parent === getWindowScrollingElement()) break;
44177
- parent = getParentAutoScrollElement(parent, false);
44178
- }
44179
- return false;
44180
- }
44181
-
44182
- /**
44183
- * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
44184
- * and non-draggable elements
44185
- * @param {HTMLElement} el The parent element
44186
- * @param {Number} childNum The index of the child
44187
- * @param {Object} options Parent Sortable's options
44188
- * @return {HTMLElement} The child at index childNum, or null if not found
44189
- */
44190
- function getChild(el, childNum, options, includeDragEl) {
44191
- var currentChild = 0,
44192
- i = 0,
44193
- children = el.children;
44194
- while (i < children.length) {
44195
- if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
44196
- if (currentChild === childNum) {
44197
- return children[i];
44198
- }
44199
- currentChild++;
43900
+ hasAutoFlowDense() {
43901
+ const layout = this.props.options;
43902
+ return layout.dense !== false;
44200
43903
  }
44201
- i++;
44202
- }
44203
- return null;
44204
- }
44205
-
44206
- /**
44207
- * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
44208
- * @param {HTMLElement} el Parent element
44209
- * @param {selector} selector Any other elements that should be ignored
44210
- * @return {HTMLElement} The last child, ignoring ghostEl
44211
- */
44212
- function lastChild(el, selector) {
44213
- var last = el.lastElementChild;
44214
- while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
44215
- last = last.previousElementSibling;
44216
- }
44217
- return last || null;
44218
43904
  }
44219
43905
 
44220
- /**
44221
- * Returns the index of an element within its parent for a selected set of
44222
- * elements
44223
- * @param {HTMLElement} el
44224
- * @param {selector} selector
44225
- * @return {number}
44226
- */
44227
- function index(el, selector) {
44228
- var index = 0;
44229
- if (!el || !el.parentNode) {
44230
- return -1;
44231
- }
43906
+ const RowLayoutContext = reactExports.createContext(false);
44232
43907
 
44233
- /* jshint boss:true */
44234
- while (el = el.previousElementSibling) {
44235
- if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
44236
- index++;
43908
+ class Row extends React.Component {
43909
+ constructor(props) {
43910
+ super(props);
43911
+ this.props = props;
44237
43912
  }
44238
- }
44239
- return index;
44240
- }
44241
-
44242
- /**
44243
- * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
44244
- * The value is returned in real pixels.
44245
- * @param {HTMLElement} el
44246
- * @return {Array} Offsets in the format of [left, top]
44247
- */
44248
- function getRelativeScrollOffset(el) {
44249
- var offsetLeft = 0,
44250
- offsetTop = 0,
44251
- winScroller = getWindowScrollingElement();
44252
- if (el) {
44253
- do {
44254
- var elMatrix = matrix(el),
44255
- scaleX = elMatrix.a,
44256
- scaleY = elMatrix.d;
44257
- offsetLeft += el.scrollLeft * scaleX;
44258
- offsetTop += el.scrollTop * scaleY;
44259
- } while (el !== winScroller && (el = el.parentNode));
44260
- }
44261
- return [offsetLeft, offsetTop];
44262
- }
44263
-
44264
- /**
44265
- * Returns the index of the object within the given array
44266
- * @param {Array} arr Array that may or may not hold the object
44267
- * @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
44268
- * @return {Number} The index of the object in the array, or -1
44269
- */
44270
- function indexOfObject(arr, obj) {
44271
- for (var i in arr) {
44272
- if (!arr.hasOwnProperty(i)) continue;
44273
- for (var key in obj) {
44274
- if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
43913
+ render() {
43914
+ const classes = ['row'];
43915
+ if (this.icon) {
43916
+ classes.push('has-icon');
43917
+ }
43918
+ return React.createElement('div', {
43919
+ className: classes.join(' '),
43920
+ }, this.renderMainInformation(), this.renderDescription());
44275
43921
  }
44276
- }
44277
- return -1;
44278
- }
44279
- function getParentAutoScrollElement(el, includeSelf) {
44280
- // skip to window
44281
- if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
44282
- var elem = el;
44283
- var gotSelf = false;
44284
- do {
44285
- // we don't need to get elem css if it isn't even overflowing in the first place (performance)
44286
- if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
44287
- var elemCSS = css(elem);
44288
- if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
44289
- if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
44290
- if (gotSelf || includeSelf) return elem;
44291
- gotSelf = true;
44292
- }
43922
+ renderIcon() {
43923
+ if (this.icon) {
43924
+ return React.createElement('limel-icon', {
43925
+ name: this.icon,
43926
+ });
43927
+ }
44293
43928
  }
44294
- /* jshint boss:true */
44295
- } while (elem = elem.parentNode);
44296
- return getWindowScrollingElement();
44297
- }
44298
- function extend(dst, src) {
44299
- if (dst && src) {
44300
- for (var key in src) {
44301
- if (src.hasOwnProperty(key)) {
44302
- dst[key] = src[key];
44303
- }
43929
+ renderMainInformation() {
43930
+ return React.createElement('div', { className: 'main-information' }, this.renderIcon(), this.renderTitle(), this.renderChildren());
44304
43931
  }
44305
- }
44306
- return dst;
44307
- }
44308
- function isRectEqual(rect1, rect2) {
44309
- 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);
44310
- }
44311
- var _throttleTimeout;
44312
- function throttle(callback, ms) {
44313
- return function () {
44314
- if (!_throttleTimeout) {
44315
- var args = arguments,
44316
- _this = this;
44317
- if (args.length === 1) {
44318
- callback.call(_this, args[0]);
44319
- } else {
44320
- callback.apply(_this, args);
44321
- }
44322
- _throttleTimeout = setTimeout(function () {
44323
- _throttleTimeout = void 0;
44324
- }, ms);
43932
+ renderTitle() {
43933
+ var _a;
43934
+ return React.createElement('h1', { className: 'title' }, (_a = this.schema) === null || _a === void 0 ? void 0 : _a.title);
44325
43935
  }
44326
- };
44327
- }
44328
- function cancelThrottle() {
44329
- clearTimeout(_throttleTimeout);
44330
- _throttleTimeout = void 0;
44331
- }
44332
- function scrollBy(el, x, y) {
44333
- el.scrollLeft += x;
44334
- el.scrollTop += y;
44335
- }
44336
- function clone(el) {
44337
- var Polymer = window.Polymer;
44338
- var $ = window.jQuery || window.Zepto;
44339
- if (Polymer && Polymer.dom) {
44340
- return Polymer.dom(el).cloneNode(true);
44341
- } else if ($) {
44342
- return $(el).clone(true)[0];
44343
- } else {
44344
- return el.cloneNode(true);
44345
- }
44346
- }
44347
- function getChildContainingRectFromElement(container, options, ghostEl) {
44348
- var rect = {};
44349
- Array.from(container.children).forEach(function (child) {
44350
- var _rect$left, _rect$top, _rect$right, _rect$bottom;
44351
- if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
44352
- var childRect = getRect(child);
44353
- rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
44354
- rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
44355
- rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
44356
- rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
44357
- });
44358
- rect.width = rect.right - rect.left;
44359
- rect.height = rect.bottom - rect.top;
44360
- rect.x = rect.left;
44361
- rect.y = rect.top;
44362
- return rect;
44363
- }
44364
- var expando = 'Sortable' + new Date().getTime();
44365
-
44366
- function AnimationStateManager() {
44367
- var animationStates = [],
44368
- animationCallbackId;
44369
- return {
44370
- captureAnimationState: function captureAnimationState() {
44371
- animationStates = [];
44372
- if (!this.options.animation) return;
44373
- var children = [].slice.call(this.el.children);
44374
- children.forEach(function (child) {
44375
- if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
44376
- animationStates.push({
44377
- target: child,
44378
- rect: getRect(child)
44379
- });
44380
- var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
44381
-
44382
- // If animating: compensate for current animation
44383
- if (child.thisAnimationDuration) {
44384
- var childMatrix = matrix(child, true);
44385
- if (childMatrix) {
44386
- fromRect.top -= childMatrix.f;
44387
- fromRect.left -= childMatrix.e;
44388
- }
44389
- }
44390
- child.fromRect = fromRect;
44391
- });
44392
- },
44393
- addAnimationState: function addAnimationState(state) {
44394
- animationStates.push(state);
44395
- },
44396
- removeAnimationState: function removeAnimationState(target) {
44397
- animationStates.splice(indexOfObject(animationStates, {
44398
- target: target
44399
- }), 1);
44400
- },
44401
- animateAll: function animateAll(callback) {
44402
- var _this = this;
44403
- if (!this.options.animation) {
44404
- clearTimeout(animationCallbackId);
44405
- if (typeof callback === 'function') callback();
44406
- return;
44407
- }
44408
- var animating = false,
44409
- animationTime = 0;
44410
- animationStates.forEach(function (state) {
44411
- var time = 0,
44412
- target = state.target,
44413
- fromRect = target.fromRect,
44414
- toRect = getRect(target),
44415
- prevFromRect = target.prevFromRect,
44416
- prevToRect = target.prevToRect,
44417
- animatingRect = state.rect,
44418
- targetMatrix = matrix(target, true);
44419
- if (targetMatrix) {
44420
- // Compensate for current animation
44421
- toRect.top -= targetMatrix.f;
44422
- toRect.left -= targetMatrix.e;
44423
- }
44424
- target.toRect = toRect;
44425
- if (target.thisAnimationDuration) {
44426
- // Could also check if animatingRect is between fromRect and toRect
44427
- if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
44428
- // Make sure animatingRect is on line between toRect & fromRect
44429
- (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
44430
- // If returning to same place as started from animation and on same axis
44431
- time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
44432
- }
44433
- }
44434
-
44435
- // if fromRect != toRect: animate
44436
- if (!isRectEqual(toRect, fromRect)) {
44437
- target.prevFromRect = fromRect;
44438
- target.prevToRect = toRect;
44439
- if (!time) {
44440
- time = _this.options.animation;
44441
- }
44442
- _this.animate(target, animatingRect, toRect, time);
44443
- }
44444
- if (time) {
44445
- animating = true;
44446
- animationTime = Math.max(animationTime, time);
44447
- clearTimeout(target.animationResetTimer);
44448
- target.animationResetTimer = setTimeout(function () {
44449
- target.animationTime = 0;
44450
- target.prevFromRect = null;
44451
- target.fromRect = null;
44452
- target.prevToRect = null;
44453
- target.thisAnimationDuration = null;
44454
- }, time);
44455
- target.thisAnimationDuration = time;
44456
- }
44457
- });
44458
- clearTimeout(animationCallbackId);
44459
- if (!animating) {
44460
- if (typeof callback === 'function') callback();
44461
- } else {
44462
- animationCallbackId = setTimeout(function () {
44463
- if (typeof callback === 'function') callback();
44464
- }, animationTime);
44465
- }
44466
- animationStates = [];
44467
- },
44468
- animate: function animate(target, currentRect, toRect, duration) {
44469
- if (duration) {
44470
- css(target, 'transition', '');
44471
- css(target, 'transform', '');
44472
- var elMatrix = matrix(this.el),
44473
- scaleX = elMatrix && elMatrix.a,
44474
- scaleY = elMatrix && elMatrix.d,
44475
- translateX = (currentRect.left - toRect.left) / (scaleX || 1),
44476
- translateY = (currentRect.top - toRect.top) / (scaleY || 1);
44477
- target.animatingX = !!translateX;
44478
- target.animatingY = !!translateY;
44479
- css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
44480
- this.forRepaintDummy = repaint(target); // repaint
44481
-
44482
- css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
44483
- css(target, 'transform', 'translate3d(0,0,0)');
44484
- typeof target.animated === 'number' && clearTimeout(target.animated);
44485
- target.animated = setTimeout(function () {
44486
- css(target, 'transition', '');
44487
- css(target, 'transform', '');
44488
- target.animated = false;
44489
- target.animatingX = false;
44490
- target.animatingY = false;
44491
- }, duration);
44492
- }
43936
+ renderDescription() {
43937
+ var _a;
43938
+ if ((_a = this.schema) === null || _a === void 0 ? void 0 : _a.description) {
43939
+ return React.createElement('limel-markdown', {
43940
+ class: 'description',
43941
+ value: this.schema.description,
43942
+ });
43943
+ }
44493
43944
  }
44494
- };
44495
- }
44496
- function repaint(target) {
44497
- return target.offsetWidth;
44498
- }
44499
- function calculateRealTime(animatingRect, fromRect, toRect, options) {
44500
- 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;
44501
- }
44502
-
44503
- var plugins = [];
44504
- var defaults = {
44505
- initializeByDefault: true
44506
- };
44507
- var PluginManager = {
44508
- mount: function mount(plugin) {
44509
- // Set default static properties
44510
- for (var option in defaults) {
44511
- if (defaults.hasOwnProperty(option) && !(option in plugin)) {
44512
- plugin[option] = defaults[option];
44513
- }
43945
+ renderChildren() {
43946
+ return React.createElement(RowLayoutContext.Provider, { value: true }, this.props.children);
44514
43947
  }
44515
- plugins.forEach(function (p) {
44516
- if (p.pluginName === plugin.pluginName) {
44517
- throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
44518
- }
44519
- });
44520
- plugins.push(plugin);
44521
- },
44522
- pluginEvent: function pluginEvent(eventName, sortable, evt) {
44523
- var _this = this;
44524
- this.eventCanceled = false;
44525
- evt.cancel = function () {
44526
- _this.eventCanceled = true;
44527
- };
44528
- var eventNameGlobal = eventName + 'Global';
44529
- plugins.forEach(function (plugin) {
44530
- if (!sortable[plugin.pluginName]) return;
44531
- // Fire global events if it exists in this sortable
44532
- if (sortable[plugin.pluginName][eventNameGlobal]) {
44533
- sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
44534
- sortable: sortable
44535
- }, evt));
44536
- }
44537
-
44538
- // Only fire plugin event if plugin is enabled in this sortable,
44539
- // and plugin has event defined
44540
- if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
44541
- sortable[plugin.pluginName][eventName](_objectSpread2({
44542
- sortable: sortable
44543
- }, evt));
44544
- }
44545
- });
44546
- },
44547
- initializePlugins: function initializePlugins(sortable, el, defaults, options) {
44548
- plugins.forEach(function (plugin) {
44549
- var pluginName = plugin.pluginName;
44550
- if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
44551
- var initialized = new plugin(sortable, el, sortable.options);
44552
- initialized.sortable = sortable;
44553
- initialized.options = sortable.options;
44554
- sortable[pluginName] = initialized;
44555
-
44556
- // Add default options from plugin
44557
- _extends(defaults, initialized.defaults);
44558
- });
44559
- for (var option in sortable.options) {
44560
- if (!sortable.options.hasOwnProperty(option)) continue;
44561
- var modified = this.modifyOption(sortable, option, sortable.options[option]);
44562
- if (typeof modified !== 'undefined') {
44563
- sortable.options[option] = modified;
44564
- }
43948
+ get schema() {
43949
+ return this.props.children.props.schema;
43950
+ }
43951
+ get icon() {
43952
+ var _a, _b, _c;
43953
+ return (_c = (_b = (_a = this.schema) === null || _a === void 0 ? void 0 : _a.lime) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.icon;
44565
43954
  }
44566
- },
44567
- getEventProperties: function getEventProperties(name, sortable) {
44568
- var eventProperties = {};
44569
- plugins.forEach(function (plugin) {
44570
- if (typeof plugin.eventProperties !== 'function') return;
44571
- _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
44572
- });
44573
- return eventProperties;
44574
- },
44575
- modifyOption: function modifyOption(sortable, name, value) {
44576
- var modifiedValue;
44577
- plugins.forEach(function (plugin) {
44578
- // Plugin must exist on the Sortable
44579
- if (!sortable[plugin.pluginName]) return;
44580
-
44581
- // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
44582
- if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
44583
- modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
44584
- }
44585
- });
44586
- return modifiedValue;
44587
- }
44588
- };
44589
-
44590
- function dispatchEvent(_ref) {
44591
- var sortable = _ref.sortable,
44592
- rootEl = _ref.rootEl,
44593
- name = _ref.name,
44594
- targetEl = _ref.targetEl,
44595
- cloneEl = _ref.cloneEl,
44596
- toEl = _ref.toEl,
44597
- fromEl = _ref.fromEl,
44598
- oldIndex = _ref.oldIndex,
44599
- newIndex = _ref.newIndex,
44600
- oldDraggableIndex = _ref.oldDraggableIndex,
44601
- newDraggableIndex = _ref.newDraggableIndex,
44602
- originalEvent = _ref.originalEvent,
44603
- putSortable = _ref.putSortable,
44604
- extraEventProperties = _ref.extraEventProperties;
44605
- sortable = sortable || rootEl && rootEl[expando];
44606
- if (!sortable) return;
44607
- var evt,
44608
- options = sortable.options,
44609
- onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
44610
- // Support for new CustomEvent feature
44611
- if (window.CustomEvent && !IE11OrLess && !Edge) {
44612
- evt = new CustomEvent(name, {
44613
- bubbles: true,
44614
- cancelable: true
44615
- });
44616
- } else {
44617
- evt = document.createEvent('Event');
44618
- evt.initEvent(name, true, true);
44619
- }
44620
- evt.to = toEl || rootEl;
44621
- evt.from = fromEl || rootEl;
44622
- evt.item = targetEl || rootEl;
44623
- evt.clone = cloneEl;
44624
- evt.oldIndex = oldIndex;
44625
- evt.newIndex = newIndex;
44626
- evt.oldDraggableIndex = oldDraggableIndex;
44627
- evt.newDraggableIndex = newDraggableIndex;
44628
- evt.originalEvent = originalEvent;
44629
- evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
44630
- var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
44631
- for (var option in allEventProperties) {
44632
- evt[option] = allEventProperties[option];
44633
- }
44634
- if (rootEl) {
44635
- rootEl.dispatchEvent(evt);
44636
- }
44637
- if (options[onName]) {
44638
- options[onName].call(sortable, evt);
44639
- }
44640
43955
  }
44641
43956
 
44642
- var _excluded = ["evt"];
44643
- var pluginEvent = function pluginEvent(eventName, sortable) {
44644
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
44645
- originalEvent = _ref.evt,
44646
- data = _objectWithoutProperties(_ref, _excluded);
44647
- PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
44648
- dragEl: dragEl,
44649
- parentEl: parentEl,
44650
- ghostEl: ghostEl,
44651
- rootEl: rootEl,
44652
- nextEl: nextEl,
44653
- lastDownEl: lastDownEl,
44654
- cloneEl: cloneEl,
44655
- cloneHidden: cloneHidden,
44656
- dragStarted: moved,
44657
- putSortable: putSortable,
44658
- activeSortable: Sortable.active,
44659
- originalEvent: originalEvent,
44660
- oldIndex: oldIndex,
44661
- oldDraggableIndex: oldDraggableIndex,
44662
- newIndex: newIndex,
44663
- newDraggableIndex: newDraggableIndex,
44664
- hideGhostForTarget: _hideGhostForTarget,
44665
- unhideGhostForTarget: _unhideGhostForTarget,
44666
- cloneNowHidden: function cloneNowHidden() {
44667
- cloneHidden = true;
44668
- },
44669
- cloneNowShown: function cloneNowShown() {
44670
- cloneHidden = false;
44671
- },
44672
- dispatchSortableEvent: function dispatchSortableEvent(name) {
44673
- _dispatchEvent({
44674
- sortable: sortable,
44675
- name: name,
44676
- originalEvent: originalEvent
44677
- });
44678
- }
44679
- }, data));
44680
- };
44681
- function _dispatchEvent(info) {
44682
- dispatchEvent(_objectSpread2({
44683
- putSortable: putSortable,
44684
- cloneEl: cloneEl,
44685
- targetEl: dragEl,
44686
- rootEl: rootEl,
44687
- oldIndex: oldIndex,
44688
- oldDraggableIndex: oldDraggableIndex,
44689
- newIndex: newIndex,
44690
- newDraggableIndex: newDraggableIndex
44691
- }, info));
44692
- }
44693
- var dragEl,
44694
- parentEl,
44695
- ghostEl,
44696
- rootEl,
44697
- nextEl,
44698
- lastDownEl,
44699
- cloneEl,
44700
- cloneHidden,
44701
- oldIndex,
44702
- newIndex,
44703
- oldDraggableIndex,
44704
- newDraggableIndex,
44705
- activeGroup,
44706
- putSortable,
44707
- awaitingDragStarted = false,
44708
- ignoreNextClick = false,
44709
- sortables = [],
44710
- tapEvt,
44711
- touchEvt,
44712
- lastDx,
44713
- lastDy,
44714
- tapDistanceLeft,
44715
- tapDistanceTop,
44716
- moved,
44717
- lastTarget,
44718
- lastDirection,
44719
- pastFirstInvertThresh = false,
44720
- isCircumstantialInvert = false,
44721
- targetMoveDistance,
44722
- // For positioning ghost absolutely
44723
- ghostRelativeParent,
44724
- ghostRelativeParentInitialScroll = [],
44725
- // (left, top)
44726
-
44727
- _silent = false,
44728
- savedInputChecked = [];
44729
-
44730
- /** @const */
44731
- var documentExists = typeof document !== 'undefined',
44732
- PositionGhostAbsolutely = IOS,
44733
- CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
44734
- // This will not pass for IE9, because IE9 DnD only works on anchors
44735
- supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
44736
- supportCssPointerEvents = function () {
44737
- if (!documentExists) return;
44738
- // false when <= IE11
44739
- if (IE11OrLess) {
44740
- return false;
44741
- }
44742
- var el = document.createElement('x');
44743
- el.style.cssText = 'pointer-events:auto';
44744
- return el.style.pointerEvents === 'auto';
44745
- }(),
44746
- _detectDirection = function _detectDirection(el, options) {
44747
- var elCSS = css(el),
44748
- elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
44749
- child1 = getChild(el, 0, options),
44750
- child2 = getChild(el, 1, options),
44751
- firstChildCSS = child1 && css(child1),
44752
- secondChildCSS = child2 && css(child2),
44753
- firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
44754
- secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
44755
- if (elCSS.display === 'flex') {
44756
- return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
44757
- }
44758
- if (elCSS.display === 'grid') {
44759
- return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
44760
- }
44761
- if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
44762
- var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
44763
- return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
44764
- }
44765
- 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';
44766
- },
44767
- _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
44768
- var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
44769
- dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
44770
- dragElOppLength = vertical ? dragRect.width : dragRect.height,
44771
- targetS1Opp = vertical ? targetRect.left : targetRect.top,
44772
- targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
44773
- targetOppLength = vertical ? targetRect.width : targetRect.height;
44774
- return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
44775
- },
44776
- /**
44777
- * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
44778
- * @param {Number} x X position
44779
- * @param {Number} y Y position
44780
- * @return {HTMLElement} Element of the first found nearest Sortable
44781
- */
44782
- _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
44783
- var ret;
44784
- sortables.some(function (sortable) {
44785
- var threshold = sortable[expando].options.emptyInsertThreshold;
44786
- if (!threshold || lastChild(sortable)) return;
44787
- var rect = getRect(sortable),
44788
- insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
44789
- insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
44790
- if (insideHorizontally && insideVertically) {
44791
- return ret = sortable;
44792
- }
44793
- });
44794
- return ret;
44795
- },
44796
- _prepareGroup = function _prepareGroup(options) {
44797
- function toFn(value, pull) {
44798
- return function (to, from, dragEl, evt) {
44799
- var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
44800
- if (value == null && (pull || sameGroup)) {
44801
- // Default pull value
44802
- // Default pull and put value if same group
44803
- return true;
44804
- } else if (value == null || value === false) {
44805
- return false;
44806
- } else if (pull && value === 'clone') {
44807
- return value;
44808
- } else if (typeof value === 'function') {
44809
- return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
44810
- } else {
44811
- var otherGroup = (pull ? to : from).options.group.name;
44812
- return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
44813
- }
44814
- };
44815
- }
44816
- var group = {};
44817
- var originalGroup = options.group;
44818
- if (!originalGroup || _typeof(originalGroup) != 'object') {
44819
- originalGroup = {
44820
- name: originalGroup
44821
- };
44822
- }
44823
- group.name = originalGroup.name;
44824
- group.checkPull = toFn(originalGroup.pull, true);
44825
- group.checkPut = toFn(originalGroup.put);
44826
- group.revertClone = originalGroup.revertClone;
44827
- options.group = group;
44828
- },
44829
- _hideGhostForTarget = function _hideGhostForTarget() {
44830
- if (!supportCssPointerEvents && ghostEl) {
44831
- css(ghostEl, 'display', 'none');
44832
- }
44833
- },
44834
- _unhideGhostForTarget = function _unhideGhostForTarget() {
44835
- if (!supportCssPointerEvents && ghostEl) {
44836
- css(ghostEl, 'display', '');
43957
+ class RowLayout extends React.Component {
43958
+ constructor(props) {
43959
+ super(props);
43960
+ this.props = props;
43961
+ this.elementRef = React.createRef();
44837
43962
  }
44838
- };
44839
-
44840
- // #1184 fix - Prevent click event on fallback if dragged but item not changed position
44841
- if (documentExists && !ChromeForAndroid) {
44842
- document.addEventListener('click', function (evt) {
44843
- if (ignoreNextClick) {
44844
- evt.preventDefault();
44845
- evt.stopPropagation && evt.stopPropagation();
44846
- evt.stopImmediatePropagation && evt.stopImmediatePropagation();
44847
- ignoreNextClick = false;
44848
- return false;
44849
- }
44850
- }, true);
44851
- }
44852
- var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
44853
- if (dragEl) {
44854
- evt = evt.touches ? evt.touches[0] : evt;
44855
- var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
44856
- if (nearest) {
44857
- // Create imitation event
44858
- var event = {};
44859
- for (var i in evt) {
44860
- if (evt.hasOwnProperty(i)) {
44861
- event[i] = evt[i];
44862
- }
44863
- }
44864
- event.target = event.rootEl = nearest;
44865
- event.preventDefault = void 0;
44866
- event.stopPropagation = void 0;
44867
- nearest[expando]._onDragOver(event);
43963
+ render() {
43964
+ var _a;
43965
+ return React.createElement('div', {
43966
+ className: 'limel-form-row--layout',
43967
+ 'data-schema-path': toSchemaPath((_a = this.props.schemaPath) !== null && _a !== void 0 ? _a : []),
43968
+ ref: this.elementRef,
43969
+ }, this.props.children.map((child, index) => {
43970
+ return React.createElement(Row, {
43971
+ key: index.toString(),
43972
+ }, child);
43973
+ }));
44868
43974
  }
44869
- }
44870
- };
44871
- var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
44872
- if (dragEl) {
44873
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
44874
- }
44875
- };
43975
+ }
44876
43976
 
44877
- /**
44878
- * @class Sortable
44879
- * @param {HTMLElement} el
44880
- * @param {Object} [options]
43977
+ /**
43978
+ *
43979
+ * @param schema
43980
+ * @param extraProps - additional props to pass to the limel-help element
44881
43981
  */
44882
- function Sortable(el, options) {
44883
- if (!(el && el.nodeType && el.nodeType === 1)) {
44884
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
44885
- }
44886
- this.el = el; // root element
44887
- this.options = options = _extends({}, options);
44888
-
44889
- // Export instance
44890
- el[expando] = this;
44891
- var defaults = {
44892
- group: null,
44893
- sort: true,
44894
- disabled: false,
44895
- store: null,
44896
- handle: null,
44897
- draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
44898
- swapThreshold: 1,
44899
- // percentage; 0 <= x <= 1
44900
- invertSwap: false,
44901
- // invert always
44902
- invertedSwapThreshold: null,
44903
- // will be set to same as swapThreshold if default
44904
- removeCloneOnHide: true,
44905
- direction: function direction() {
44906
- return _detectDirection(el, this.options);
44907
- },
44908
- ghostClass: 'sortable-ghost',
44909
- chosenClass: 'sortable-chosen',
44910
- dragClass: 'sortable-drag',
44911
- ignore: 'a, img',
44912
- filter: null,
44913
- preventOnFilter: true,
44914
- animation: 0,
44915
- easing: null,
44916
- setData: function setData(dataTransfer, dragEl) {
44917
- dataTransfer.setData('Text', dragEl.textContent);
44918
- },
44919
- dropBubble: false,
44920
- dragoverBubble: false,
44921
- dataIdAttr: 'data-id',
44922
- delay: 0,
44923
- delayOnTouchOnly: false,
44924
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
44925
- forceFallback: false,
44926
- fallbackClass: 'sortable-fallback',
44927
- fallbackOnBody: false,
44928
- fallbackTolerance: 0,
44929
- fallbackOffset: {
44930
- x: 0,
44931
- y: 0
44932
- },
44933
- // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
44934
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
44935
- emptyInsertThreshold: 5
44936
- };
44937
- PluginManager.initializePlugins(this, el, defaults);
44938
-
44939
- // Set default options
44940
- for (var name in defaults) {
44941
- !(name in options) && (options[name] = defaults[name]);
44942
- }
44943
- _prepareGroup(options);
44944
-
44945
- // Bind all private methods
44946
- for (var fn in this) {
44947
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
44948
- this[fn] = this[fn].bind(this);
44949
- }
44950
- }
44951
-
44952
- // Setup drag mode
44953
- this.nativeDraggable = options.forceFallback ? false : supportDraggable;
44954
- if (this.nativeDraggable) {
44955
- // Touch start threshold cannot be greater than the native dragstart threshold
44956
- this.options.touchStartThreshold = 1;
44957
- }
44958
-
44959
- // Bind events
44960
- if (options.supportPointer) {
44961
- on(el, 'pointerdown', this._onTapStart);
44962
- } else {
44963
- on(el, 'mousedown', this._onTapStart);
44964
- on(el, 'touchstart', this._onTapStart);
44965
- }
44966
- if (this.nativeDraggable) {
44967
- on(el, 'dragover', this);
44968
- on(el, 'dragenter', this);
44969
- }
44970
- sortables.push(this.el);
44971
-
44972
- // Restore sorting
44973
- options.store && options.store.get && this.sort(options.store.get(this) || []);
44974
-
44975
- // Add animation state manager
44976
- _extends(this, AnimationStateManager());
44977
- }
44978
- Sortable.prototype = /** @lends Sortable.prototype */{
44979
- constructor: Sortable,
44980
- _isOutsideThisEl: function _isOutsideThisEl(target) {
44981
- if (!this.el.contains(target) && target !== this.el) {
44982
- lastTarget = null;
44983
- }
44984
- },
44985
- _getDirection: function _getDirection(evt, target) {
44986
- return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
44987
- },
44988
- _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
44989
- if (!evt.cancelable) return;
44990
- var _this = this,
44991
- el = this.el,
44992
- options = this.options,
44993
- preventOnFilter = options.preventOnFilter,
44994
- type = evt.type,
44995
- touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
44996
- target = (touch || evt).target,
44997
- originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
44998
- filter = options.filter;
44999
- _saveInputCheckedState(el);
45000
-
45001
- // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
45002
- if (dragEl) {
45003
- return;
45004
- }
45005
- if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
45006
- return; // only left button and enabled
45007
- }
45008
-
45009
- // cancel dnd if original target is content editable
45010
- if (originalTarget.isContentEditable) {
45011
- return;
45012
- }
45013
-
45014
- // Safari ignores further event handling after mousedown
45015
- if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
45016
- return;
45017
- }
45018
- target = closest(target, options.draggable, el, false);
45019
- if (target && target.animated) {
45020
- return;
45021
- }
45022
- if (lastDownEl === target) {
45023
- // Ignoring duplicate `down`
45024
- return;
45025
- }
45026
-
45027
- // Get the index of the dragged element within its parent
45028
- oldIndex = index(target);
45029
- oldDraggableIndex = index(target, options.draggable);
45030
-
45031
- // Check filter
45032
- if (typeof filter === 'function') {
45033
- if (filter.call(this, evt, target, this)) {
45034
- _dispatchEvent({
45035
- sortable: _this,
45036
- rootEl: originalTarget,
45037
- name: 'filter',
45038
- targetEl: target,
45039
- toEl: el,
45040
- fromEl: el
45041
- });
45042
- pluginEvent('filter', _this, {
45043
- evt: evt
45044
- });
45045
- preventOnFilter && evt.preventDefault();
45046
- return; // cancel dnd
45047
- }
45048
- } else if (filter) {
45049
- filter = filter.split(',').some(function (criteria) {
45050
- criteria = closest(originalTarget, criteria.trim(), el, false);
45051
- if (criteria) {
45052
- _dispatchEvent({
45053
- sortable: _this,
45054
- rootEl: criteria,
45055
- name: 'filter',
45056
- targetEl: target,
45057
- fromEl: el,
45058
- toEl: el
45059
- });
45060
- pluginEvent('filter', _this, {
45061
- evt: evt
45062
- });
45063
- return true;
45064
- }
45065
- });
45066
- if (filter) {
45067
- preventOnFilter && evt.preventDefault();
45068
- return; // cancel dnd
45069
- }
45070
- }
45071
- if (options.handle && !closest(originalTarget, options.handle, el, false)) {
45072
- return;
45073
- }
45074
-
45075
- // Prepare `dragstart`
45076
- this._prepareDragStart(evt, touch, target);
45077
- },
45078
- _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
45079
- var _this = this,
45080
- el = _this.el,
45081
- options = _this.options,
45082
- ownerDocument = el.ownerDocument,
45083
- dragStartFn;
45084
- if (target && !dragEl && target.parentNode === el) {
45085
- var dragRect = getRect(target);
45086
- rootEl = el;
45087
- dragEl = target;
45088
- parentEl = dragEl.parentNode;
45089
- nextEl = dragEl.nextSibling;
45090
- lastDownEl = target;
45091
- activeGroup = options.group;
45092
- Sortable.dragged = dragEl;
45093
- tapEvt = {
45094
- target: dragEl,
45095
- clientX: (touch || evt).clientX,
45096
- clientY: (touch || evt).clientY
45097
- };
45098
- tapDistanceLeft = tapEvt.clientX - dragRect.left;
45099
- tapDistanceTop = tapEvt.clientY - dragRect.top;
45100
- this._lastX = (touch || evt).clientX;
45101
- this._lastY = (touch || evt).clientY;
45102
- dragEl.style['will-change'] = 'all';
45103
- dragStartFn = function dragStartFn() {
45104
- pluginEvent('delayEnded', _this, {
45105
- evt: evt
45106
- });
45107
- if (Sortable.eventCanceled) {
45108
- _this._onDrop();
45109
- return;
45110
- }
45111
- // Delayed drag has been triggered
45112
- // we can re-enable the events: touchmove/mousemove
45113
- _this._disableDelayedDragEvents();
45114
- if (!FireFox && _this.nativeDraggable) {
45115
- dragEl.draggable = true;
45116
- }
45117
-
45118
- // Bind the events: dragstart/dragend
45119
- _this._triggerDragStart(evt, touch);
45120
-
45121
- // Drag start event
45122
- _dispatchEvent({
45123
- sortable: _this,
45124
- name: 'choose',
45125
- originalEvent: evt
45126
- });
45127
-
45128
- // Chosen item
45129
- toggleClass(dragEl, options.chosenClass, true);
45130
- };
45131
-
45132
- // Disable "draggable"
45133
- options.ignore.split(',').forEach(function (criteria) {
45134
- find(dragEl, criteria.trim(), _disableDraggable);
45135
- });
45136
- on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
45137
- on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
45138
- on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
45139
- if (options.supportPointer) {
45140
- on(ownerDocument, 'pointerup', _this._onDrop);
45141
- // Native D&D triggers pointercancel
45142
- !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
45143
- } else {
45144
- on(ownerDocument, 'mouseup', _this._onDrop);
45145
- on(ownerDocument, 'touchend', _this._onDrop);
45146
- on(ownerDocument, 'touchcancel', _this._onDrop);
45147
- }
45148
-
45149
- // Make dragEl draggable (must be before delay for FireFox)
45150
- if (FireFox && this.nativeDraggable) {
45151
- this.options.touchStartThreshold = 4;
45152
- dragEl.draggable = true;
45153
- }
45154
- pluginEvent('delayStart', this, {
45155
- evt: evt
45156
- });
45157
-
45158
- // Delay is impossible for native DnD in Edge or IE
45159
- if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
45160
- if (Sortable.eventCanceled) {
45161
- this._onDrop();
45162
- return;
45163
- }
45164
- // If the user moves the pointer or let go the click or touch
45165
- // before the delay has been reached:
45166
- // disable the delayed drag
45167
- if (options.supportPointer) {
45168
- on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
45169
- on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
45170
- } else {
45171
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
45172
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
45173
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
45174
- }
45175
- on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
45176
- on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
45177
- options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
45178
- _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
45179
- } else {
45180
- dragStartFn();
45181
- }
45182
- }
45183
- },
45184
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
45185
- var touch = e.touches ? e.touches[0] : e;
45186
- 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))) {
45187
- this._disableDelayedDrag();
45188
- }
45189
- },
45190
- _disableDelayedDrag: function _disableDelayedDrag() {
45191
- dragEl && _disableDraggable(dragEl);
45192
- clearTimeout(this._dragStartTimer);
45193
- this._disableDelayedDragEvents();
45194
- },
45195
- _disableDelayedDragEvents: function _disableDelayedDragEvents() {
45196
- var ownerDocument = this.el.ownerDocument;
45197
- off(ownerDocument, 'mouseup', this._disableDelayedDrag);
45198
- off(ownerDocument, 'touchend', this._disableDelayedDrag);
45199
- off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
45200
- off(ownerDocument, 'pointerup', this._disableDelayedDrag);
45201
- off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
45202
- off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
45203
- off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
45204
- off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
45205
- },
45206
- _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
45207
- touch = touch || evt.pointerType == 'touch' && evt;
45208
- if (!this.nativeDraggable || touch) {
45209
- if (this.options.supportPointer) {
45210
- on(document, 'pointermove', this._onTouchMove);
45211
- } else if (touch) {
45212
- on(document, 'touchmove', this._onTouchMove);
45213
- } else {
45214
- on(document, 'mousemove', this._onTouchMove);
45215
- }
45216
- } else {
45217
- on(dragEl, 'dragend', this);
45218
- on(rootEl, 'dragstart', this._onDragStart);
45219
- }
45220
- try {
45221
- if (document.selection) {
45222
- _nextTick(function () {
45223
- document.selection.empty();
45224
- });
45225
- } else {
45226
- window.getSelection().removeAllRanges();
45227
- }
45228
- } catch (err) {}
45229
- },
45230
- _dragStarted: function _dragStarted(fallback, evt) {
45231
- awaitingDragStarted = false;
45232
- if (rootEl && dragEl) {
45233
- pluginEvent('dragStarted', this, {
45234
- evt: evt
45235
- });
45236
- if (this.nativeDraggable) {
45237
- on(document, 'dragover', _checkOutsideTargetEl);
45238
- }
45239
- var options = this.options;
45240
-
45241
- // Apply effect
45242
- !fallback && toggleClass(dragEl, options.dragClass, false);
45243
- toggleClass(dragEl, options.ghostClass, true);
45244
- Sortable.active = this;
45245
- fallback && this._appendGhost();
45246
-
45247
- // Drag start event
45248
- _dispatchEvent({
45249
- sortable: this,
45250
- name: 'start',
45251
- originalEvent: evt
45252
- });
45253
- } else {
45254
- this._nulling();
45255
- }
45256
- },
45257
- _emulateDragOver: function _emulateDragOver() {
45258
- if (touchEvt) {
45259
- this._lastX = touchEvt.clientX;
45260
- this._lastY = touchEvt.clientY;
45261
- _hideGhostForTarget();
45262
- var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
45263
- var parent = target;
45264
- while (target && target.shadowRoot) {
45265
- target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
45266
- if (target === parent) break;
45267
- parent = target;
45268
- }
45269
- dragEl.parentNode[expando]._isOutsideThisEl(target);
45270
- if (parent) {
45271
- do {
45272
- if (parent[expando]) {
45273
- var inserted = void 0;
45274
- inserted = parent[expando]._onDragOver({
45275
- clientX: touchEvt.clientX,
45276
- clientY: touchEvt.clientY,
45277
- target: target,
45278
- rootEl: parent
45279
- });
45280
- if (inserted && !this.options.dragoverBubble) {
45281
- break;
45282
- }
45283
- }
45284
- target = parent; // store last element
45285
- }
45286
- /* jshint boss:true */ while (parent = getParentOrHost(parent));
45287
- }
45288
- _unhideGhostForTarget();
45289
- }
45290
- },
45291
- _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
45292
- if (tapEvt) {
45293
- var options = this.options,
45294
- fallbackTolerance = options.fallbackTolerance,
45295
- fallbackOffset = options.fallbackOffset,
45296
- touch = evt.touches ? evt.touches[0] : evt,
45297
- ghostMatrix = ghostEl && matrix(ghostEl, true),
45298
- scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
45299
- scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
45300
- relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
45301
- dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
45302
- dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
45303
-
45304
- // only set the status to dragging, when we are actually dragging
45305
- if (!Sortable.active && !awaitingDragStarted) {
45306
- if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
45307
- return;
45308
- }
45309
- this._onDragStart(evt, true);
45310
- }
45311
- if (ghostEl) {
45312
- if (ghostMatrix) {
45313
- ghostMatrix.e += dx - (lastDx || 0);
45314
- ghostMatrix.f += dy - (lastDy || 0);
45315
- } else {
45316
- ghostMatrix = {
45317
- a: 1,
45318
- b: 0,
45319
- c: 0,
45320
- d: 1,
45321
- e: dx,
45322
- f: dy
45323
- };
45324
- }
45325
- var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
45326
- css(ghostEl, 'webkitTransform', cssMatrix);
45327
- css(ghostEl, 'mozTransform', cssMatrix);
45328
- css(ghostEl, 'msTransform', cssMatrix);
45329
- css(ghostEl, 'transform', cssMatrix);
45330
- lastDx = dx;
45331
- lastDy = dy;
45332
- touchEvt = touch;
45333
- }
45334
- evt.cancelable && evt.preventDefault();
45335
- }
45336
- },
45337
- _appendGhost: function _appendGhost() {
45338
- // Bug if using scale(): https://stackoverflow.com/questions/2637058
45339
- // Not being adjusted for
45340
- if (!ghostEl) {
45341
- var container = this.options.fallbackOnBody ? document.body : rootEl,
45342
- rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
45343
- options = this.options;
45344
-
45345
- // Position absolutely
45346
- if (PositionGhostAbsolutely) {
45347
- // Get relatively positioned parent
45348
- ghostRelativeParent = container;
45349
- while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
45350
- ghostRelativeParent = ghostRelativeParent.parentNode;
45351
- }
45352
- if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
45353
- if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
45354
- rect.top += ghostRelativeParent.scrollTop;
45355
- rect.left += ghostRelativeParent.scrollLeft;
45356
- } else {
45357
- ghostRelativeParent = getWindowScrollingElement();
45358
- }
45359
- ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
45360
- }
45361
- ghostEl = dragEl.cloneNode(true);
45362
- toggleClass(ghostEl, options.ghostClass, false);
45363
- toggleClass(ghostEl, options.fallbackClass, true);
45364
- toggleClass(ghostEl, options.dragClass, true);
45365
- css(ghostEl, 'transition', '');
45366
- css(ghostEl, 'transform', '');
45367
- css(ghostEl, 'box-sizing', 'border-box');
45368
- css(ghostEl, 'margin', 0);
45369
- css(ghostEl, 'top', rect.top);
45370
- css(ghostEl, 'left', rect.left);
45371
- css(ghostEl, 'width', rect.width);
45372
- css(ghostEl, 'height', rect.height);
45373
- css(ghostEl, 'opacity', '0.8');
45374
- css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
45375
- css(ghostEl, 'zIndex', '100000');
45376
- css(ghostEl, 'pointerEvents', 'none');
45377
- Sortable.ghost = ghostEl;
45378
- container.appendChild(ghostEl);
45379
-
45380
- // Set transform-origin
45381
- css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
45382
- }
45383
- },
45384
- _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
45385
- var _this = this;
45386
- var dataTransfer = evt.dataTransfer;
45387
- var options = _this.options;
45388
- pluginEvent('dragStart', this, {
45389
- evt: evt
45390
- });
45391
- if (Sortable.eventCanceled) {
45392
- this._onDrop();
45393
- return;
45394
- }
45395
- pluginEvent('setupClone', this);
45396
- if (!Sortable.eventCanceled) {
45397
- cloneEl = clone(dragEl);
45398
- cloneEl.removeAttribute("id");
45399
- cloneEl.draggable = false;
45400
- cloneEl.style['will-change'] = '';
45401
- this._hideClone();
45402
- toggleClass(cloneEl, this.options.chosenClass, false);
45403
- Sortable.clone = cloneEl;
45404
- }
45405
-
45406
- // #1143: IFrame support workaround
45407
- _this.cloneId = _nextTick(function () {
45408
- pluginEvent('clone', _this);
45409
- if (Sortable.eventCanceled) return;
45410
- if (!_this.options.removeCloneOnHide) {
45411
- rootEl.insertBefore(cloneEl, dragEl);
45412
- }
45413
- _this._hideClone();
45414
- _dispatchEvent({
45415
- sortable: _this,
45416
- name: 'clone'
45417
- });
45418
- });
45419
- !fallback && toggleClass(dragEl, options.dragClass, true);
45420
-
45421
- // Set proper drop events
45422
- if (fallback) {
45423
- ignoreNextClick = true;
45424
- _this._loopId = setInterval(_this._emulateDragOver, 50);
45425
- } else {
45426
- // Undo what was set in _prepareDragStart before drag started
45427
- off(document, 'mouseup', _this._onDrop);
45428
- off(document, 'touchend', _this._onDrop);
45429
- off(document, 'touchcancel', _this._onDrop);
45430
- if (dataTransfer) {
45431
- dataTransfer.effectAllowed = 'move';
45432
- options.setData && options.setData.call(_this, dataTransfer, dragEl);
45433
- }
45434
- on(document, 'drop', _this);
45435
-
45436
- // #1276 fix:
45437
- css(dragEl, 'transform', 'translateZ(0)');
45438
- }
45439
- awaitingDragStarted = true;
45440
- _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
45441
- on(document, 'selectstart', _this);
45442
- moved = true;
45443
- window.getSelection().removeAllRanges();
45444
- if (Safari) {
45445
- css(document.body, 'user-select', 'none');
45446
- }
45447
- },
45448
- // Returns true - if no further action is needed (either inserted or another condition)
45449
- _onDragOver: function _onDragOver( /**Event*/evt) {
45450
- var el = this.el,
45451
- target = evt.target,
45452
- dragRect,
45453
- targetRect,
45454
- revert,
45455
- options = this.options,
45456
- group = options.group,
45457
- activeSortable = Sortable.active,
45458
- isOwner = activeGroup === group,
45459
- canSort = options.sort,
45460
- fromSortable = putSortable || activeSortable,
45461
- vertical,
45462
- _this = this,
45463
- completedFired = false;
45464
- if (_silent) return;
45465
- function dragOverEvent(name, extra) {
45466
- pluginEvent(name, _this, _objectSpread2({
45467
- evt: evt,
45468
- isOwner: isOwner,
45469
- axis: vertical ? 'vertical' : 'horizontal',
45470
- revert: revert,
45471
- dragRect: dragRect,
45472
- targetRect: targetRect,
45473
- canSort: canSort,
45474
- fromSortable: fromSortable,
45475
- target: target,
45476
- completed: completed,
45477
- onMove: function onMove(target, after) {
45478
- return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
45479
- },
45480
- changed: changed
45481
- }, extra));
45482
- }
45483
-
45484
- // Capture animation state
45485
- function capture() {
45486
- dragOverEvent('dragOverAnimationCapture');
45487
- _this.captureAnimationState();
45488
- if (_this !== fromSortable) {
45489
- fromSortable.captureAnimationState();
45490
- }
43982
+ function getHelpComponent(schema, extraProps) {
43983
+ var _a;
43984
+ const help = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.help;
43985
+ if (!help) {
43986
+ return;
45491
43987
  }
45492
-
45493
- // Return invocation when dragEl is inserted (or completed)
45494
- function completed(insertion) {
45495
- dragOverEvent('dragOverCompleted', {
45496
- insertion: insertion
45497
- });
45498
- if (insertion) {
45499
- // Clones must be hidden before folding animation to capture dragRectAbsolute properly
45500
- if (isOwner) {
45501
- activeSortable._hideClone();
45502
- } else {
45503
- activeSortable._showClone(_this);
45504
- }
45505
- if (_this !== fromSortable) {
45506
- // Set ghost class to new sortable's ghost class
45507
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
45508
- toggleClass(dragEl, options.ghostClass, true);
45509
- }
45510
- if (putSortable !== _this && _this !== Sortable.active) {
45511
- putSortable = _this;
45512
- } else if (_this === Sortable.active && putSortable) {
45513
- putSortable = null;
45514
- }
45515
-
45516
- // Animation
45517
- if (fromSortable === _this) {
45518
- _this._ignoreWhileAnimating = target;
45519
- }
45520
- _this.animateAll(function () {
45521
- dragOverEvent('dragOverAnimationComplete');
45522
- _this._ignoreWhileAnimating = null;
45523
- });
45524
- if (_this !== fromSortable) {
45525
- fromSortable.animateAll();
45526
- fromSortable._ignoreWhileAnimating = null;
45527
- }
45528
- }
45529
-
45530
- // Null lastTarget if it is not inside a previously swapped element
45531
- if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
45532
- lastTarget = null;
45533
- }
45534
-
45535
- // no bubbling and not fallback
45536
- if (!options.dragoverBubble && !evt.rootEl && target !== document) {
45537
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
45538
-
45539
- // Do not detect for empty insert if already inserted
45540
- !insertion && nearestEmptyInsertDetectEvent(evt);
45541
- }
45542
- !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
45543
- return completedFired = true;
45544
- }
45545
-
45546
- // Call when dragEl has been inserted
45547
- function changed() {
45548
- newIndex = index(dragEl);
45549
- newDraggableIndex = index(dragEl, options.draggable);
45550
- _dispatchEvent({
45551
- sortable: _this,
45552
- name: 'change',
45553
- toEl: el,
45554
- newIndex: newIndex,
45555
- newDraggableIndex: newDraggableIndex,
45556
- originalEvent: evt
45557
- });
45558
- }
45559
- if (evt.preventDefault !== void 0) {
45560
- evt.cancelable && evt.preventDefault();
45561
- }
45562
- target = closest(target, options.draggable, el, true);
45563
- dragOverEvent('dragOver');
45564
- if (Sortable.eventCanceled) return completedFired;
45565
- if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
45566
- return completed(false);
45567
- }
45568
- ignoreNextClick = false;
45569
- if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
45570
- : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
45571
- vertical = this._getDirection(evt, target) === 'vertical';
45572
- dragRect = getRect(dragEl);
45573
- dragOverEvent('dragOverValid');
45574
- if (Sortable.eventCanceled) return completedFired;
45575
- if (revert) {
45576
- parentEl = rootEl; // actualization
45577
- capture();
45578
- this._hideClone();
45579
- dragOverEvent('revert');
45580
- if (!Sortable.eventCanceled) {
45581
- if (nextEl) {
45582
- rootEl.insertBefore(dragEl, nextEl);
45583
- } else {
45584
- rootEl.appendChild(dragEl);
45585
- }
45586
- }
45587
- return completed(true);
45588
- }
45589
- var elLastChild = lastChild(el, options.draggable);
45590
- if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
45591
- // Insert to end of list
45592
-
45593
- // If already at end of list: Do not insert
45594
- if (elLastChild === dragEl) {
45595
- return completed(false);
45596
- }
45597
-
45598
- // if there is a last element, it is the target
45599
- if (elLastChild && el === evt.target) {
45600
- target = elLastChild;
45601
- }
45602
- if (target) {
45603
- targetRect = getRect(target);
45604
- }
45605
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
45606
- capture();
45607
- if (elLastChild && elLastChild.nextSibling) {
45608
- // the last draggable element is not the last node
45609
- el.insertBefore(dragEl, elLastChild.nextSibling);
45610
- } else {
45611
- el.appendChild(dragEl);
45612
- }
45613
- parentEl = el; // actualization
45614
-
45615
- changed();
45616
- return completed(true);
45617
- }
45618
- } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
45619
- // Insert to start of list
45620
- var firstChild = getChild(el, 0, options, true);
45621
- if (firstChild === dragEl) {
45622
- return completed(false);
45623
- }
45624
- target = firstChild;
45625
- targetRect = getRect(target);
45626
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
45627
- capture();
45628
- el.insertBefore(dragEl, firstChild);
45629
- parentEl = el; // actualization
45630
-
45631
- changed();
45632
- return completed(true);
45633
- }
45634
- } else if (target.parentNode === el) {
45635
- targetRect = getRect(target);
45636
- var direction = 0,
45637
- targetBeforeFirstSwap,
45638
- differentLevel = dragEl.parentNode !== el,
45639
- differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
45640
- side1 = vertical ? 'top' : 'left',
45641
- scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
45642
- scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
45643
- if (lastTarget !== target) {
45644
- targetBeforeFirstSwap = targetRect[side1];
45645
- pastFirstInvertThresh = false;
45646
- isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
45647
- }
45648
- direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
45649
- var sibling;
45650
- if (direction !== 0) {
45651
- // Check if target is beside dragEl in respective direction (ignoring hidden elements)
45652
- var dragIndex = index(dragEl);
45653
- do {
45654
- dragIndex -= direction;
45655
- sibling = parentEl.children[dragIndex];
45656
- } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
45657
- }
45658
- // If dragEl is already beside target: Do not insert
45659
- if (direction === 0 || sibling === target) {
45660
- return completed(false);
45661
- }
45662
- lastTarget = target;
45663
- lastDirection = direction;
45664
- var nextSibling = target.nextElementSibling,
45665
- after = false;
45666
- after = direction === 1;
45667
- var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
45668
- if (moveVector !== false) {
45669
- if (moveVector === 1 || moveVector === -1) {
45670
- after = moveVector === 1;
45671
- }
45672
- _silent = true;
45673
- setTimeout(_unsilent, 30);
45674
- capture();
45675
- if (after && !nextSibling) {
45676
- el.appendChild(dragEl);
45677
- } else {
45678
- target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
45679
- }
45680
-
45681
- // Undo chrome's scroll adjustment (has no effect on other browsers)
45682
- if (scrolledPastTop) {
45683
- scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
45684
- }
45685
- parentEl = dragEl.parentNode; // actualization
45686
-
45687
- // must be done before animation
45688
- if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
45689
- targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
45690
- }
45691
- changed();
45692
- return completed(true);
45693
- }
45694
- }
45695
- if (el.contains(dragEl)) {
45696
- return completed(false);
45697
- }
43988
+ if (typeof help === 'string') {
43989
+ return React.createElement('limel-help', Object.assign({ value: help }, extraProps));
45698
43990
  }
45699
- return false;
45700
- },
45701
- _ignoreWhileAnimating: null,
45702
- _offMoveEvents: function _offMoveEvents() {
45703
- off(document, 'mousemove', this._onTouchMove);
45704
- off(document, 'touchmove', this._onTouchMove);
45705
- off(document, 'pointermove', this._onTouchMove);
45706
- off(document, 'dragover', nearestEmptyInsertDetectEvent);
45707
- off(document, 'mousemove', nearestEmptyInsertDetectEvent);
45708
- off(document, 'touchmove', nearestEmptyInsertDetectEvent);
45709
- },
45710
- _offUpEvents: function _offUpEvents() {
45711
- var ownerDocument = this.el.ownerDocument;
45712
- off(ownerDocument, 'mouseup', this._onDrop);
45713
- off(ownerDocument, 'touchend', this._onDrop);
45714
- off(ownerDocument, 'pointerup', this._onDrop);
45715
- off(ownerDocument, 'pointercancel', this._onDrop);
45716
- off(ownerDocument, 'touchcancel', this._onDrop);
45717
- off(document, 'selectstart', this);
45718
- },
45719
- _onDrop: function _onDrop( /**Event*/evt) {
45720
- var el = this.el,
45721
- options = this.options;
45722
-
45723
- // Get the index of the dragged element within its parent
45724
- newIndex = index(dragEl);
45725
- newDraggableIndex = index(dragEl, options.draggable);
45726
- pluginEvent('drop', this, {
45727
- evt: evt
45728
- });
45729
- parentEl = dragEl && dragEl.parentNode;
45730
-
45731
- // Get again after plugin event
45732
- newIndex = index(dragEl);
45733
- newDraggableIndex = index(dragEl, options.draggable);
45734
- if (Sortable.eventCanceled) {
45735
- this._nulling();
45736
- return;
45737
- }
45738
- awaitingDragStarted = false;
45739
- isCircumstantialInvert = false;
45740
- pastFirstInvertThresh = false;
45741
- clearInterval(this._loopId);
45742
- clearTimeout(this._dragStartTimer);
45743
- _cancelNextTick(this.cloneId);
45744
- _cancelNextTick(this._dragStartId);
45745
-
45746
- // Unbind events
45747
- if (this.nativeDraggable) {
45748
- off(document, 'drop', this);
45749
- off(el, 'dragstart', this._onDragStart);
45750
- }
45751
- this._offMoveEvents();
45752
- this._offUpEvents();
45753
- if (Safari) {
45754
- css(document.body, 'user-select', '');
45755
- }
45756
- css(dragEl, 'transform', '');
45757
- if (evt) {
45758
- if (moved) {
45759
- evt.cancelable && evt.preventDefault();
45760
- !options.dropBubble && evt.stopPropagation();
45761
- }
45762
- ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
45763
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
45764
- // Remove clone(s)
45765
- cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
45766
- }
45767
- if (dragEl) {
45768
- if (this.nativeDraggable) {
45769
- off(dragEl, 'dragend', this);
45770
- }
45771
- _disableDraggable(dragEl);
45772
- dragEl.style['will-change'] = '';
45773
-
45774
- // Remove classes
45775
- // ghostClass is added in dragStarted
45776
- if (moved && !awaitingDragStarted) {
45777
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
45778
- }
45779
- toggleClass(dragEl, this.options.chosenClass, false);
45780
-
45781
- // Drag stop event
45782
- _dispatchEvent({
45783
- sortable: this,
45784
- name: 'unchoose',
45785
- toEl: parentEl,
45786
- newIndex: null,
45787
- newDraggableIndex: null,
45788
- originalEvent: evt
45789
- });
45790
- if (rootEl !== parentEl) {
45791
- if (newIndex >= 0) {
45792
- // Add event
45793
- _dispatchEvent({
45794
- rootEl: parentEl,
45795
- name: 'add',
45796
- toEl: parentEl,
45797
- fromEl: rootEl,
45798
- originalEvent: evt
45799
- });
43991
+ const helpProps = help;
43992
+ return React.createElement('limel-help', Object.assign(Object.assign({}, helpProps), extraProps));
43993
+ }
45800
43994
 
45801
- // Remove event
45802
- _dispatchEvent({
45803
- sortable: this,
45804
- name: 'remove',
45805
- toEl: parentEl,
45806
- originalEvent: evt
45807
- });
43995
+ const ArrayFieldContext = reactExports.createContext(null);
43996
+ /**
43997
+ * The array's validation errors as an RJSF `errorSchema`, keyed by item
43998
+ * index (e.g. `{ 1: { phone: { __errors: [...] } } }`).
43999
+ *
44000
+ * RJSF passes `errorSchema` to the array *field* (`FieldProps`) but, for
44001
+ * non-fixed arrays, does not forward it to `ArrayFieldItemTemplate` — so
44002
+ * the custom `ArrayField` shares it here for each item to read its own
44003
+ * slice (`errorSchema[index]`). This lets a collapsed item flag itself as
44004
+ * invalid without rendering (and DOM-walking) its hidden children.
44005
+ */
44006
+ const ArrayItemErrorsContext = reactExports.createContext(null);
45808
44007
 
45809
- // drag from one list and drop into another
45810
- _dispatchEvent({
45811
- rootEl: parentEl,
45812
- name: 'sort',
45813
- toEl: parentEl,
45814
- fromEl: rootEl,
45815
- originalEvent: evt
45816
- });
45817
- _dispatchEvent({
45818
- sortable: this,
45819
- name: 'sort',
45820
- toEl: parentEl,
45821
- originalEvent: evt
45822
- });
45823
- }
45824
- putSortable && putSortable.save();
45825
- } else {
45826
- if (newIndex !== oldIndex) {
45827
- if (newIndex >= 0) {
45828
- // drag & drop within the same list
45829
- _dispatchEvent({
45830
- sortable: this,
45831
- name: 'update',
45832
- toEl: parentEl,
45833
- originalEvent: evt
45834
- });
45835
- _dispatchEvent({
45836
- sortable: this,
45837
- name: 'sort',
45838
- toEl: parentEl,
45839
- originalEvent: evt
45840
- });
45841
- }
45842
- }
45843
- }
45844
- if (Sortable.active) {
45845
- /* jshint eqnull:true */
45846
- if (newIndex == null || newIndex === -1) {
45847
- newIndex = oldIndex;
45848
- newDraggableIndex = oldDraggableIndex;
45849
- }
45850
- _dispatchEvent({
45851
- sortable: this,
45852
- name: 'end',
45853
- toEl: parentEl,
45854
- originalEvent: evt
45855
- });
45856
-
45857
- // Save sorting
45858
- this.save();
45859
- }
45860
- }
45861
- }
45862
- this._nulling();
45863
- },
45864
- _nulling: function _nulling() {
45865
- pluginEvent('nulling', this);
45866
- 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;
45867
- var el = this.el;
45868
- savedInputChecked.forEach(function (checkEl) {
45869
- if (el.contains(checkEl)) {
45870
- checkEl.checked = true;
45871
- }
45872
- });
45873
- savedInputChecked.length = lastDx = lastDy = 0;
45874
- },
45875
- handleEvent: function handleEvent( /**Event*/evt) {
45876
- switch (evt.type) {
45877
- case 'drop':
45878
- case 'dragend':
45879
- this._onDrop(evt);
45880
- break;
45881
- case 'dragenter':
45882
- case 'dragover':
45883
- if (dragEl) {
45884
- this._onDragOver(evt);
45885
- _globalDragOver(evt);
45886
- }
45887
- break;
45888
- case 'selectstart':
45889
- evt.preventDefault();
45890
- break;
45891
- }
45892
- },
45893
- /**
45894
- * Serializes the item into an array of string.
45895
- * @returns {String[]}
45896
- */
45897
- toArray: function toArray() {
45898
- var order = [],
45899
- el,
45900
- children = this.el.children,
45901
- i = 0,
45902
- n = children.length,
45903
- options = this.options;
45904
- for (; i < n; i++) {
45905
- el = children[i];
45906
- if (closest(el, options.draggable, this.el, false)) {
45907
- order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
45908
- }
45909
- }
45910
- return order;
45911
- },
45912
- /**
45913
- * Sorts the elements according to the array.
45914
- * @param {String[]} order order of the items
45915
- */
45916
- sort: function sort(order, useAnimation) {
45917
- var items = {},
45918
- rootEl = this.el;
45919
- this.toArray().forEach(function (id, i) {
45920
- var el = rootEl.children[i];
45921
- if (closest(el, this.options.draggable, rootEl, false)) {
45922
- items[id] = el;
45923
- }
45924
- }, this);
45925
- useAnimation && this.captureAnimationState();
45926
- order.forEach(function (id) {
45927
- if (items[id]) {
45928
- rootEl.removeChild(items[id]);
45929
- rootEl.appendChild(items[id]);
45930
- }
45931
- });
45932
- useAnimation && this.animateAll();
45933
- },
45934
- /**
45935
- * Save the current sorting
45936
- */
45937
- save: function save() {
45938
- var store = this.options.store;
45939
- store && store.set && store.set(this);
45940
- },
45941
- /**
45942
- * 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.
45943
- * @param {HTMLElement} el
45944
- * @param {String} [selector] default: `options.draggable`
45945
- * @returns {HTMLElement|null}
45946
- */
45947
- closest: function closest$1(el, selector) {
45948
- return closest(el, selector || this.options.draggable, this.el, false);
45949
- },
45950
- /**
45951
- * Set/get option
45952
- * @param {string} name
45953
- * @param {*} [value]
45954
- * @returns {*}
45955
- */
45956
- option: function option(name, value) {
45957
- var options = this.options;
45958
- if (value === void 0) {
45959
- return options[name];
45960
- } else {
45961
- var modifiedValue = PluginManager.modifyOption(this, name, value);
45962
- if (typeof modifiedValue !== 'undefined') {
45963
- options[name] = modifiedValue;
45964
- } else {
45965
- options[name] = value;
45966
- }
45967
- if (name === 'group') {
45968
- _prepareGroup(options);
45969
- }
44008
+ const ObjectFieldTemplate = (props) => {
44009
+ const arrayContext = reactExports.useContext(ArrayFieldContext);
44010
+ const id = props.fieldPathId.$id;
44011
+ if (arrayContext && id !== 'root') {
44012
+ return React.createElement(ArrayFieldContext.Provider, { value: null }, renderProperties(props.properties, props.schema, props.fieldPathId.path.map(String)));
45970
44013
  }
45971
- },
45972
- /**
45973
- * Destroy
45974
- */
45975
- destroy: function destroy() {
45976
- pluginEvent('destroy', this);
45977
- var el = this.el;
45978
- el[expando] = null;
45979
- off(el, 'mousedown', this._onTapStart);
45980
- off(el, 'touchstart', this._onTapStart);
45981
- off(el, 'pointerdown', this._onTapStart);
45982
- if (this.nativeDraggable) {
45983
- off(el, 'dragover', this);
45984
- off(el, 'dragenter', this);
45985
- }
45986
- // Remove draggable attributes
45987
- Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
45988
- el.removeAttribute('draggable');
45989
- });
45990
- this._onDrop();
45991
- this._disableDelayedDragEvents();
45992
- sortables.splice(sortables.indexOf(this.el), 1);
45993
- this.el = el = null;
45994
- },
45995
- _hideClone: function _hideClone() {
45996
- if (!cloneHidden) {
45997
- pluginEvent('hideClone', this);
45998
- if (Sortable.eventCanceled) return;
45999
- css(cloneEl, 'display', 'none');
46000
- if (this.options.removeCloneOnHide && cloneEl.parentNode) {
46001
- cloneEl.parentNode.removeChild(cloneEl);
46002
- }
46003
- cloneHidden = true;
46004
- }
46005
- },
46006
- _showClone: function _showClone(putSortable) {
46007
- if (putSortable.lastPutMode !== 'clone') {
46008
- this._hideClone();
46009
- return;
46010
- }
46011
- if (cloneHidden) {
46012
- pluginEvent('showClone', this);
46013
- if (Sortable.eventCanceled) return;
46014
-
46015
- // show clone at dragEl or original position
46016
- if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
46017
- rootEl.insertBefore(cloneEl, dragEl);
46018
- } else if (nextEl) {
46019
- rootEl.insertBefore(cloneEl, nextEl);
46020
- } else {
46021
- rootEl.appendChild(cloneEl);
46022
- }
46023
- if (this.options.group.revertClone) {
46024
- this.animate(dragEl, cloneEl);
46025
- }
46026
- css(cloneEl, 'display', '');
46027
- cloneHidden = false;
44014
+ if (id === 'root' || !isCollapsible(props.schema)) {
44015
+ return renderFieldWithTitle(props);
46028
44016
  }
46029
- }
44017
+ return renderCollapsibleField(props);
46030
44018
  };
46031
- function _globalDragOver( /**Event*/evt) {
46032
- if (evt.dataTransfer) {
46033
- evt.dataTransfer.dropEffect = 'move';
46034
- }
46035
- evt.cancelable && evt.preventDefault();
46036
- }
46037
- function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
46038
- var evt,
46039
- sortable = fromEl[expando],
46040
- onMoveFn = sortable.options.onMove,
46041
- retVal;
46042
- // Support for new CustomEvent feature
46043
- if (window.CustomEvent && !IE11OrLess && !Edge) {
46044
- evt = new CustomEvent('move', {
46045
- bubbles: true,
46046
- cancelable: true
46047
- });
46048
- } else {
46049
- evt = document.createEvent('Event');
46050
- evt.initEvent('move', true, true);
46051
- }
46052
- evt.to = toEl;
46053
- evt.from = fromEl;
46054
- evt.dragged = dragEl;
46055
- evt.draggedRect = dragRect;
46056
- evt.related = targetEl || toEl;
46057
- evt.relatedRect = targetRect || getRect(toEl);
46058
- evt.willInsertAfter = willInsertAfter;
46059
- evt.originalEvent = originalEvent;
46060
- fromEl.dispatchEvent(evt);
46061
- if (onMoveFn) {
46062
- retVal = onMoveFn.call(sortable, evt, originalEvent);
46063
- }
46064
- return retVal;
46065
- }
46066
- function _disableDraggable(el) {
46067
- el.draggable = false;
46068
- }
46069
- function _unsilent() {
46070
- _silent = false;
46071
- }
46072
- function _ghostIsFirst(evt, vertical, sortable) {
46073
- var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
46074
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
46075
- var spacer = 10;
46076
- 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;
46077
- }
46078
- function _ghostIsLast(evt, vertical, sortable) {
46079
- var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
46080
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
46081
- var spacer = 10;
46082
- 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;
46083
- }
46084
- function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
46085
- var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
46086
- targetLength = vertical ? targetRect.height : targetRect.width,
46087
- targetS1 = vertical ? targetRect.top : targetRect.left,
46088
- targetS2 = vertical ? targetRect.bottom : targetRect.right,
46089
- invert = false;
46090
- if (!invertSwap) {
46091
- // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
46092
- if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
46093
- // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
46094
- // check if past first invert threshold on side opposite of lastDirection
46095
- if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
46096
- // past first invert threshold, do not restrict inverted threshold to dragEl shadow
46097
- pastFirstInvertThresh = true;
46098
- }
46099
- if (!pastFirstInvertThresh) {
46100
- // dragEl shadow (target move distance shadow)
46101
- if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
46102
- : mouseOnAxis > targetS2 - targetMoveDistance) {
46103
- return -lastDirection;
46104
- }
46105
- } else {
46106
- invert = true;
46107
- }
46108
- } else {
46109
- // Regular
46110
- if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
46111
- return _getInsertDirection(target);
46112
- }
46113
- }
46114
- }
46115
- invert = invert || invertSwap;
46116
- if (invert) {
46117
- // Invert of regular
46118
- if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
46119
- return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
44019
+ function renderFieldWithTitle(props) {
44020
+ return React.createElement(React.Fragment, {}, renderSectionHeader(props), renderDescription(props.description), renderProperties(props.properties, props.schema, props.fieldPathId.path.map(String)));
44021
+ }
44022
+ function renderSectionHeader(props) {
44023
+ const help = getHelpComponent(props.schema);
44024
+ if (!help) {
44025
+ return renderTitle(props.title);
46120
44026
  }
46121
- }
46122
- return 0;
44027
+ return React.createElement(React.Fragment, {}, renderTitle(props.title), help);
46123
44028
  }
46124
-
46125
- /**
46126
- * Gets the direction dragEl must be swapped relative to target in order to make it
46127
- * seem that dragEl has been "inserted" into that element's position
46128
- * @param {HTMLElement} target The target whose position dragEl is being inserted at
46129
- * @return {Number} Direction dragEl must be swapped
46130
- */
46131
- function _getInsertDirection(target) {
46132
- if (index(dragEl) < index(target)) {
46133
- return 1;
46134
- } else {
46135
- return -1;
46136
- }
44029
+ function renderCollapsibleField(props) {
44030
+ var _a;
44031
+ const defaultOpen = !isCollapsed(props.schema);
44032
+ const helpElement = getHelpComponent(props.schema, {
44033
+ slot: 'header',
44034
+ });
44035
+ const revealErrors = ((_a = props.registry.formContext) === null || _a === void 0 ? void 0 : _a.revealErrors) === true;
44036
+ const invalid = revealErrors && hasNestedErrors(props.errorSchema);
44037
+ return React.createElement('limel-collapsible-section', {
44038
+ header: props.title,
44039
+ id: getSchemaObjectPropertyPath(props.registry.formContext.schema, props.fieldPathId),
44040
+ 'is-open': defaultOpen,
44041
+ invalid: invalid,
44042
+ }, helpElement, renderDescription(props.description), renderProperties(props.properties, props.schema, props.fieldPathId.path.map(String)));
46137
44043
  }
46138
-
46139
- /**
46140
- * Generate id
46141
- * @param {HTMLElement} el
46142
- * @returns {String}
46143
- * @private
44044
+ function getSchemaObjectPropertyPath(schema, fieldPathId) {
44045
+ var _a, _b;
44046
+ const refPrefixLength = 2;
44047
+ const matchAllForwardSlashes = /\//g;
44048
+ const rootPath = (_b = (_a = schema.$ref) === null || _a === void 0 ? void 0 : _a.replaceAll(matchAllForwardSlashes, '.').slice(refPrefixLength)) !== null && _b !== void 0 ? _b : '';
44049
+ const subSchemaPath = fieldPathId.path
44050
+ .map((segment) => `.properties.${segment}`)
44051
+ .join('');
44052
+ return `${rootPath}${subSchemaPath}`;
44053
+ }
44054
+ function renderProperties(properties, schema, schemaPath) {
44055
+ var _a;
44056
+ const layout = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.layout;
44057
+ return renderLayout(properties, layout, schemaPath);
44058
+ }
44059
+ function renderLayout(properties, layout, schemaPath) {
44060
+ const type = (layout === null || layout === void 0 ? void 0 : layout.type) || 'default';
44061
+ const layouts = {
44062
+ default: renderDefaultLayout,
44063
+ grid: renderGridLayout,
44064
+ row: renderRowLayout,
44065
+ };
44066
+ return layouts[type](properties, layout, schemaPath);
44067
+ }
44068
+ function renderDefaultLayout(properties, _layout, schemaPath) {
44069
+ return React.createElement('div', {
44070
+ className: 'limel-form-layout--default',
44071
+ 'data-schema-path': toSchemaPath(schemaPath),
44072
+ }, properties.map((element) => element.content));
44073
+ }
44074
+ /**
44075
+ * Render a schema path as a leading-slash string. Root → `/`,
44076
+ * `['rules']` → `/rules`, `['rules', 'details']` → `/rules/details`.
44077
+ *
44078
+ * @param path the schema-path segments (typically `fieldPathId.path`).
46144
44079
  */
46145
- function _generateId(el) {
46146
- var str = el.tagName + el.className + el.src + el.href + el.textContent,
46147
- i = str.length,
46148
- sum = 0;
46149
- while (i--) {
46150
- sum += str.charCodeAt(i);
46151
- }
46152
- return sum.toString(36);
46153
- }
46154
- function _saveInputCheckedState(root) {
46155
- savedInputChecked.length = 0;
46156
- var inputs = root.getElementsByTagName('input');
46157
- var idx = inputs.length;
46158
- while (idx--) {
46159
- var el = inputs[idx];
46160
- el.checked && savedInputChecked.push(el);
46161
- }
44080
+ function toSchemaPath(path) {
44081
+ return path.length === 0 ? '/' : `/${path.join('/')}`;
46162
44082
  }
46163
- function _nextTick(fn) {
46164
- return setTimeout(fn, 0);
44083
+ function renderGridLayout(properties, layout, schemaPath) {
44084
+ return React.createElement(GridLayout, {
44085
+ options: layout,
44086
+ schemaPath: schemaPath,
44087
+ }, properties.map((element) => element.content));
46165
44088
  }
46166
- function _cancelNextTick(id) {
46167
- return clearTimeout(id);
44089
+ function renderRowLayout(properties, _layout, schemaPath) {
44090
+ return React.createElement(RowLayout, {
44091
+ schemaPath: schemaPath,
44092
+ }, properties.map((element) => element.content));
44093
+ }
44094
+ function isCollapsible(schema) {
44095
+ var _a;
44096
+ return !!((_a = schema.lime) === null || _a === void 0 ? void 0 : _a.collapsible);
44097
+ }
44098
+ function isCollapsed(schema) {
44099
+ return schema.lime.collapsed !== false;
46168
44100
  }
46169
44101
 
46170
- // Fixed #973:
46171
- if (documentExists) {
46172
- on(document, 'touchmove', function (evt) {
46173
- if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
46174
- evt.preventDefault();
46175
- }
46176
- });
44102
+ /**
44103
+ *
44104
+ * @param data
44105
+ */
44106
+ function isInteger(data) {
44107
+ // eslint-disable-next-line unicorn/prefer-number-is-safe-integer -- integers beyond the safe range must still validate
44108
+ return Number.isInteger(Number(data));
46177
44109
  }
46178
44110
 
46179
- // Export utils
46180
- Sortable.utils = {
46181
- on: on,
46182
- off: off,
46183
- css: css,
46184
- find: find,
46185
- is: function is(el, selector) {
46186
- return !!closest(el, selector, el, false);
46187
- },
46188
- extend: extend,
46189
- throttle: throttle,
46190
- closest: closest,
46191
- toggleClass: toggleClass,
46192
- clone: clone,
46193
- index: index,
46194
- nextTick: _nextTick,
46195
- cancelNextTick: _cancelNextTick,
46196
- detectDirection: _detectDirection,
46197
- getChild: getChild,
46198
- expando: expando
46199
- };
44111
+ /**
44112
+ * Shared RJSF validator configured with custom formats and ajv options.
44113
+ * Use this single instance wherever the RJSF v6 API requires a validator.
44114
+ */
44115
+ const rjsfValidator = customizeValidator({
44116
+ customFormats: { integer: isInteger },
44117
+ ajvOptionsOverrides: { allErrors: true, multipleOfPrecision: 2 },
44118
+ });
46200
44119
 
46201
- /**
46202
- * Get the Sortable instance of an element
46203
- * @param {HTMLElement} element The element
46204
- * @return {Sortable|undefined} The instance of Sortable
44120
+ /**
44121
+ * Given two objects, get a list of keys for each value that is different between
44122
+ * the two objects. Compares using deep comparison
44123
+ *
44124
+ * @param a - first object
44125
+ * @param b - second object
44126
+ * @returns the array of keys
46205
44127
  */
46206
- Sortable.get = function (element) {
46207
- return element[expando];
44128
+ const getDifferentKeys = (a = {}, b = {}) => {
44129
+ const keys = union$1(Object.keys(a), Object.keys(b));
44130
+ return keys.filter((key) => {
44131
+ return !isEqual(b[key], a[key]);
44132
+ });
46208
44133
  };
46209
-
46210
- /**
46211
- * Mount a plugin to Sortable
46212
- * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
44134
+ /**
44135
+ * Given the data for the current SchemaField, detect if the changed data
44136
+ * has any other fields that are dependent on it, and if so reset those dependent fields
44137
+ * (by deleting them from the data so that their defaults are populated on the next rerender).
44138
+ * Call onChange with the updated data
44139
+ *
44140
+ * @param oldData - The previous data before a data change event
44141
+ * @param newData - The form data from a change event
44142
+ * @param schema - The schema associated with the data
44143
+ * @param rootSchema - The root schema
46213
44144
  */
46214
- Sortable.mount = function () {
46215
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
46216
- plugins[_key] = arguments[_key];
46217
- }
46218
- if (plugins[0].constructor === Array) plugins = plugins[0];
46219
- plugins.forEach(function (plugin) {
46220
- if (!plugin.prototype || !plugin.prototype.constructor) {
46221
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
44145
+ // eslint-disable-next-line sonarjs/no-invariant-returns
44146
+ const resetDependentFields = (oldData, newData, schema, rootSchema) => {
44147
+ // Dependencies only exist on object types
44148
+ if (!isPlainObject$1(newData)) {
44149
+ return newData;
46222
44150
  }
46223
- if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
46224
- PluginManager.mount(plugin);
46225
- });
44151
+ if (isCustomObjectSchema(schema)) {
44152
+ return newData;
44153
+ }
44154
+ // Get the schema generated by the current data
44155
+ const currentSchema = retrieveSchema(rjsfValidator, schema, rootSchema, oldData);
44156
+ const newSchema = retrieveSchema(rjsfValidator, schema, rootSchema, newData);
44157
+ // Get property keys whose schema changed due to the new data.
44158
+ // These properties that have changed are the properties that are dependent on
44159
+ // data that has changed in the current onChange event
44160
+ const dependentPropertyKeys = getDifferentKeys(newSchema.properties, currentSchema.properties);
44161
+ // Reset keys that are dependent on the changed value.
44162
+ // The values for these dependent fields will be repopulated
44163
+ // with defaults during the next render
44164
+ for (const dependentPropertyKey of dependentPropertyKeys) {
44165
+ delete newData[dependentPropertyKey];
44166
+ }
44167
+ return newData;
46226
44168
  };
46227
-
46228
- /**
46229
- * Create sortable instance
46230
- * @param {HTMLElement} el
46231
- * @param {Object} [options]
44169
+ /**
44170
+ * Check if the schema is of type object and have no declared properties
44171
+ *
44172
+ * @param schema - the schema
44173
+ * @returns true if the schema is for a custom object
46232
44174
  */
46233
- Sortable.create = function (el, options) {
46234
- return new Sortable(el, options);
46235
- };
46236
-
46237
- // Export
46238
- Sortable.version = version;
46239
-
46240
- var autoScrolls = [],
46241
- scrollEl,
46242
- scrollRootEl,
46243
- scrolling = false,
46244
- lastAutoScrollX,
46245
- lastAutoScrollY,
46246
- touchEvt$1,
46247
- pointerElemChangedInterval;
46248
- function AutoScrollPlugin() {
46249
- function AutoScroll() {
46250
- this.defaults = {
46251
- scroll: true,
46252
- forceAutoScrollFallback: false,
46253
- scrollSensitivity: 30,
46254
- scrollSpeed: 10,
46255
- bubbleScroll: true
46256
- };
46257
-
46258
- // Bind all private methods
46259
- for (var fn in this) {
46260
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
46261
- this[fn] = this[fn].bind(this);
46262
- }
44175
+ function isCustomObjectSchema(schema) {
44176
+ if (!schema.additionalProperties) {
44177
+ return false;
46263
44178
  }
46264
- }
46265
- AutoScroll.prototype = {
46266
- dragStarted: function dragStarted(_ref) {
46267
- var originalEvent = _ref.originalEvent;
46268
- if (this.sortable.nativeDraggable) {
46269
- on(document, 'dragover', this._handleAutoScroll);
46270
- } else {
46271
- if (this.options.supportPointer) {
46272
- on(document, 'pointermove', this._handleFallbackAutoScroll);
46273
- } else if (originalEvent.touches) {
46274
- on(document, 'touchmove', this._handleFallbackAutoScroll);
46275
- } else {
46276
- on(document, 'mousemove', this._handleFallbackAutoScroll);
46277
- }
46278
- }
46279
- },
46280
- dragOverCompleted: function dragOverCompleted(_ref2) {
46281
- var originalEvent = _ref2.originalEvent;
46282
- // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
46283
- if (!this.options.dragOverBubble && !originalEvent.rootEl) {
46284
- this._handleAutoScroll(originalEvent);
46285
- }
46286
- },
46287
- drop: function drop() {
46288
- if (this.sortable.nativeDraggable) {
46289
- off(document, 'dragover', this._handleAutoScroll);
46290
- } else {
46291
- off(document, 'pointermove', this._handleFallbackAutoScroll);
46292
- off(document, 'touchmove', this._handleFallbackAutoScroll);
46293
- off(document, 'mousemove', this._handleFallbackAutoScroll);
46294
- }
46295
- clearPointerElemChangedInterval();
46296
- clearAutoScrolls();
46297
- cancelThrottle();
46298
- },
46299
- nulling: function nulling() {
46300
- touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
46301
- autoScrolls.length = 0;
46302
- },
46303
- _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
46304
- this._handleAutoScroll(evt, true);
46305
- },
46306
- _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
46307
- var _this = this;
46308
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
46309
- y = (evt.touches ? evt.touches[0] : evt).clientY,
46310
- elem = document.elementFromPoint(x, y);
46311
- touchEvt$1 = evt;
46312
-
46313
- // IE does not seem to have native autoscroll,
46314
- // Edge's autoscroll seems too conditional,
46315
- // MACOS Safari does not have autoscroll,
46316
- // Firefox and Chrome are good
46317
- if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
46318
- autoScroll(evt, this.options, elem, fallback);
46319
-
46320
- // Listener for pointer element change
46321
- var ogElemScroller = getParentAutoScrollElement(elem, true);
46322
- if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
46323
- pointerElemChangedInterval && clearPointerElemChangedInterval();
46324
- // Detect for pointer elem change, emulating native DnD behaviour
46325
- pointerElemChangedInterval = setInterval(function () {
46326
- var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
46327
- if (newElem !== ogElemScroller) {
46328
- ogElemScroller = newElem;
46329
- clearAutoScrolls();
46330
- }
46331
- autoScroll(evt, _this.options, newElem, fallback);
46332
- }, 10);
46333
- lastAutoScrollX = x;
46334
- lastAutoScrollY = y;
46335
- }
46336
- } else {
46337
- // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
46338
- if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
46339
- clearAutoScrolls();
46340
- return;
46341
- }
46342
- autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
46343
- }
44179
+ if (!('properties' in schema)) {
44180
+ return true;
46344
44181
  }
46345
- };
46346
- return _extends(AutoScroll, {
46347
- pluginName: 'scroll',
46348
- initializeByDefault: true
46349
- });
44182
+ const properties = Object.values(schema.properties);
44183
+ return properties.filter(negate(isAdditionalProperty)).length === 0;
46350
44184
  }
46351
- function clearAutoScrolls() {
46352
- autoScrolls.forEach(function (autoScroll) {
46353
- clearInterval(autoScroll.pid);
46354
- });
46355
- autoScrolls = [];
46356
- }
46357
- function clearPointerElemChangedInterval() {
46358
- clearInterval(pointerElemChangedInterval);
46359
- }
46360
- var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
46361
- // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
46362
- if (!options.scroll) return;
46363
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
46364
- y = (evt.touches ? evt.touches[0] : evt).clientY,
46365
- sens = options.scrollSensitivity,
46366
- speed = options.scrollSpeed,
46367
- winScroller = getWindowScrollingElement();
46368
- var scrollThisInstance = false,
46369
- scrollCustomFn;
46370
-
46371
- // New scroll root, set scrollEl
46372
- if (scrollRootEl !== rootEl) {
46373
- scrollRootEl = rootEl;
46374
- clearAutoScrolls();
46375
- scrollEl = options.scroll;
46376
- scrollCustomFn = options.scrollFn;
46377
- if (scrollEl === true) {
46378
- scrollEl = getParentAutoScrollElement(rootEl, true);
44185
+ function isAdditionalProperty(schema) {
44186
+ return schema[ADDITIONAL_PROPERTY_FLAG] === true;
44187
+ }
44188
+ /**
44189
+ * Check whether a schema permits `null` as a valid value. Used to decide
44190
+ * whether a cleared field value should be preserved as `null` or converted
44191
+ * to `undefined` so the property can be removed from the form data.
44192
+ *
44193
+ * @param schema - the schema to check
44194
+ * @returns true if the schema's type is `'null'` or includes `'null'`
44195
+ */
44196
+ const schemaAllowsNull = (schema) => {
44197
+ const type = schema === null || schema === void 0 ? void 0 : schema.type;
44198
+ if (!type) {
44199
+ return false;
46379
44200
  }
46380
- }
46381
- var layersOut = 0;
46382
- var currentParent = scrollEl;
46383
- do {
46384
- var el = currentParent,
46385
- rect = getRect(el),
46386
- top = rect.top,
46387
- bottom = rect.bottom,
46388
- left = rect.left,
46389
- right = rect.right,
46390
- width = rect.width,
46391
- height = rect.height,
46392
- canScrollX = void 0,
46393
- canScrollY = void 0,
46394
- scrollWidth = el.scrollWidth,
46395
- scrollHeight = el.scrollHeight,
46396
- elCSS = css(el),
46397
- scrollPosX = el.scrollLeft,
46398
- scrollPosY = el.scrollTop;
46399
- if (el === winScroller) {
46400
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
46401
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
46402
- } else {
46403
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
46404
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
46405
- }
46406
- var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
46407
- var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
46408
- if (!autoScrolls[layersOut]) {
46409
- for (var i = 0; i <= layersOut; i++) {
46410
- if (!autoScrolls[i]) {
46411
- autoScrolls[i] = {};
46412
- }
46413
- }
44201
+ return Array.isArray(type) ? type.includes('null') : type === 'null';
44202
+ };
44203
+
44204
+ const FieldTemplate = (props) => {
44205
+ let classNames = props.classNames;
44206
+ const colSpan = getColSpan(props.schema);
44207
+ const rowSpan = getRowSpan(props.schema);
44208
+ let style;
44209
+ if (colSpan) {
44210
+ classNames += ` limel-form-layout-colspan--${colSpan}`;
46414
44211
  }
46415
- if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
46416
- autoScrolls[layersOut].el = el;
46417
- autoScrolls[layersOut].vx = vx;
46418
- autoScrolls[layersOut].vy = vy;
46419
- clearInterval(autoScrolls[layersOut].pid);
46420
- if (vx != 0 || vy != 0) {
46421
- scrollThisInstance = true;
46422
- /* jshint loopfunc:true */
46423
- autoScrolls[layersOut].pid = setInterval(function () {
46424
- // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
46425
- if (isFallback && this.layer === 0) {
46426
- Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
46427
- }
46428
- var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
46429
- var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
46430
- if (typeof scrollCustomFn === 'function') {
46431
- if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
46432
- return;
46433
- }
46434
- }
46435
- scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
46436
- }.bind({
46437
- layer: layersOut
46438
- }), 24);
46439
- }
44212
+ if (rowSpan) {
44213
+ style = {
44214
+ gridRow: `span ${rowSpan}`,
44215
+ minHeight: `calc(var(--min-height-of-one-row) * ${rowSpan})`,
44216
+ };
46440
44217
  }
46441
- layersOut++;
46442
- } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
46443
- scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
46444
- }, 30);
46445
-
46446
- var drop = function drop(_ref) {
46447
- var originalEvent = _ref.originalEvent,
46448
- putSortable = _ref.putSortable,
46449
- dragEl = _ref.dragEl,
46450
- activeSortable = _ref.activeSortable,
46451
- dispatchSortableEvent = _ref.dispatchSortableEvent,
46452
- hideGhostForTarget = _ref.hideGhostForTarget,
46453
- unhideGhostForTarget = _ref.unhideGhostForTarget;
46454
- if (!originalEvent) return;
46455
- var toSortable = putSortable || activeSortable;
46456
- hideGhostForTarget();
46457
- var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
46458
- var target = document.elementFromPoint(touch.clientX, touch.clientY);
46459
- unhideGhostForTarget();
46460
- if (toSortable && !toSortable.el.contains(target)) {
46461
- dispatchSortableEvent('spill');
46462
- this.onSpill({
46463
- dragEl: dragEl,
46464
- putSortable: putSortable
46465
- });
46466
- }
46467
- };
46468
- function Revert() {}
46469
- Revert.prototype = {
46470
- startIndex: null,
46471
- dragStart: function dragStart(_ref2) {
46472
- var oldDraggableIndex = _ref2.oldDraggableIndex;
46473
- this.startIndex = oldDraggableIndex;
46474
- },
46475
- onSpill: function onSpill(_ref3) {
46476
- var dragEl = _ref3.dragEl,
46477
- putSortable = _ref3.putSortable;
46478
- this.sortable.captureAnimationState();
46479
- if (putSortable) {
46480
- putSortable.captureAnimationState();
46481
- }
46482
- var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
46483
- if (nextSibling) {
46484
- this.sortable.el.insertBefore(dragEl, nextSibling);
46485
- } else {
46486
- this.sortable.el.appendChild(dragEl);
46487
- }
46488
- this.sortable.animateAll();
46489
- if (putSortable) {
46490
- putSortable.animateAll();
46491
- }
46492
- },
46493
- drop: drop
46494
- };
46495
- _extends(Revert, {
46496
- pluginName: 'revertOnSpill'
46497
- });
46498
- function Remove() {}
46499
- Remove.prototype = {
46500
- onSpill: function onSpill(_ref4) {
46501
- var dragEl = _ref4.dragEl,
46502
- putSortable = _ref4.putSortable;
46503
- var parentSortable = putSortable || this.sortable;
46504
- parentSortable.captureAnimationState();
46505
- dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
46506
- parentSortable.animateAll();
46507
- },
46508
- drop: drop
44218
+ return React.createElement('div', {
44219
+ className: classNames,
44220
+ style: style,
44221
+ 'data-schema-path': getFieldSchemaPath(props),
44222
+ }, props.children);
46509
44223
  };
46510
- _extends(Remove, {
46511
- pluginName: 'removeOnSpill'
46512
- });
46513
-
46514
- Sortable.mount(new AutoScrollPlugin());
46515
- Sortable.mount(Remove, Revert);
46516
-
46517
- const ArrayFieldContext = reactExports.createContext(null);
46518
- /**
46519
- * The array's validation errors as an RJSF `errorSchema`, keyed by item
46520
- * index (e.g. `{ 1: { phone: { __errors: [...] } } }`).
46521
- *
46522
- * RJSF passes `errorSchema` to the array *field* (`FieldProps`) but, for
46523
- * non-fixed arrays, does not forward it to `ArrayFieldItemTemplate` — so
46524
- * the custom `ArrayField` shares it here for each item to read its own
46525
- * slice (`errorSchema[index]`). This lets a collapsed item flag itself as
46526
- * invalid without rendering (and DOM-walking) its hidden children.
46527
- */
46528
- const ArrayItemErrorsContext = reactExports.createContext(null);
44224
+ // An object marks its own layout wrapper, unless a component or the code
44225
+ // editor draws it instead. It lets a host find the element of one field by its path.
44226
+ function getFieldSchemaPath(props) {
44227
+ var _a;
44228
+ if (isObjectType(props.schema) && hasOwnLayout(props.schema)) {
44229
+ return undefined;
44230
+ }
44231
+ const path = (_a = props.fieldPathId) === null || _a === void 0 ? void 0 : _a.path;
44232
+ return path ? toSchemaPath(path.map(String)) : undefined;
44233
+ }
44234
+ function hasOwnLayout(schema) {
44235
+ var _a, _b;
44236
+ return !((_b = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.name) && !isCustomObjectSchema(schema);
44237
+ }
44238
+ function getColSpan(schema) {
44239
+ var _a;
44240
+ const layout = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.layout;
44241
+ const colSpan = layout === null || layout === void 0 ? void 0 : layout.colSpan;
44242
+ if (!colSpan && isObjectType(schema)) {
44243
+ return 'all';
44244
+ }
44245
+ return colSpan;
44246
+ }
44247
+ function getRowSpan(schema) {
44248
+ var _a;
44249
+ const layout = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.layout;
44250
+ return layout === null || layout === void 0 ? void 0 : layout.rowSpan;
44251
+ }
46529
44252
 
46530
44253
  const ARRAY_REORDER_EVENT = 'arrayReorder';
46531
- const DRAG_HANDLE_SELECTOR = '[data-drag-handle]';
46532
44254
  const DRAGGABLE_ITEM_SELECTOR = '.array-item[data-reorderable="true"]';
46533
- const DEFAULT_CONTAINER_CLASS = 'has-an-item-which-is-being-dragged';
46534
- const DEFAULT_DROP_ELEVATION_CLASS = 'is-elevated';
46535
- const DROP_ELEVATION_DURATION = 1000;
46536
- const TOUCH_DRAG_DELAY_MS = 200; // Adds a short hold on touch (long-press) so scroll gestures do not reorder items.
46537
44255
  class ArrayFieldTemplate extends React.Component {
46538
44256
  constructor(props) {
46539
44257
  super(props);
@@ -46546,68 +44264,28 @@ class ArrayFieldTemplate extends React.Component {
46546
44264
  if (this.container === element) {
46547
44265
  return;
46548
44266
  }
46549
- this.teardownDragController();
44267
+ this.dragToReorder.teardown();
46550
44268
  this.container = element !== null && element !== void 0 ? element : undefined;
46551
44269
  this.setupDragController();
46552
44270
  };
46553
- this.handleSortStart = (event) => {
46554
- if (!this.canReorderItems()) {
46555
- return;
46556
- }
46557
- this.dragSnapshot = [...this.state.order];
46558
- this.draggedItemIndex = this.getReorderId(event.item);
46559
- if (this.container) {
46560
- this.container.classList.add(DEFAULT_CONTAINER_CLASS);
46561
- }
46562
- if (event.item instanceof HTMLElement) {
46563
- this.applyDropElevation(event.item);
46564
- }
46565
- };
46566
- this.handleSortEnd = (event) => {
44271
+ this.handleReorder = ({ order, fromIndex, toIndex, }) => {
46567
44272
  var _a;
46568
- if (!this.canReorderItems()) {
46569
- return;
46570
- }
46571
- if (this.container) {
46572
- this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
46573
- }
46574
- const snapshot = this.dragSnapshot;
46575
- const draggedItemIndex = this.draggedItemIndex;
46576
- this.dragSnapshot = undefined;
46577
- this.draggedItemIndex = undefined;
46578
- if (event.item instanceof HTMLElement) {
46579
- this.dropElevationTarget = event.item;
46580
- }
46581
- const finalOrder = this.readOrderFromDom();
46582
- if (!this.arraysEqual(this.state.order, finalOrder)) {
46583
- this.setState({ order: finalOrder });
46584
- }
46585
- if (snapshot === undefined ||
46586
- draggedItemIndex === undefined ||
46587
- !(event.item instanceof HTMLElement)) {
46588
- this.scheduleDropElevationRemoval();
46589
- return;
46590
- }
46591
- const fromPosition = snapshot.indexOf(draggedItemIndex);
46592
- const toPosition = finalOrder.indexOf(draggedItemIndex);
46593
- if (fromPosition === -1 ||
46594
- toPosition === -1 ||
46595
- fromPosition === toPosition) {
46596
- this.scheduleDropElevationRemoval();
46597
- return;
46598
- }
44273
+ this.setState({ order: order.map(Number) });
46599
44274
  (_a = this.container) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new CustomEvent(ARRAY_REORDER_EVENT, {
46600
44275
  bubbles: true,
46601
- detail: { fromIndex: fromPosition, toIndex: toPosition },
44276
+ detail: { fromIndex, toIndex },
46602
44277
  }));
46603
- this.scheduleDropElevationRemoval();
46604
44278
  };
46605
44279
  this.state = {
46606
44280
  order: this.extractIndices(props.items),
46607
44281
  };
44282
+ this.dragToReorder = new DragToReorder({
44283
+ draggable: DRAGGABLE_ITEM_SELECTOR,
44284
+ onReorder: this.handleReorder,
44285
+ });
46608
44286
  }
46609
44287
  componentWillUnmount() {
46610
- this.teardownDragController();
44288
+ this.dragToReorder.teardown();
46611
44289
  }
46612
44290
  componentDidMount() {
46613
44291
  this.setupDragController();
@@ -46676,47 +44354,10 @@ class ArrayFieldTemplate extends React.Component {
46676
44354
  }
46677
44355
  setupDragController() {
46678
44356
  if (!this.container || !this.canReorderItems()) {
46679
- this.teardownDragController();
46680
- return;
46681
- }
46682
- const reorderableItems = this.container.querySelectorAll(`:scope > ${DRAGGABLE_ITEM_SELECTOR}`);
46683
- if (reorderableItems.length < 2) {
46684
- this.teardownDragController();
44357
+ this.dragToReorder.teardown();
46685
44358
  return;
46686
44359
  }
46687
- if (this.sortable) {
46688
- this.sortable.option('handle', DRAG_HANDLE_SELECTOR);
46689
- this.sortable.option('draggable', DRAGGABLE_ITEM_SELECTOR);
46690
- this.sortable.option('disabled', false);
46691
- this.sortable.option('delay', TOUCH_DRAG_DELAY_MS);
46692
- this.sortable.option('delayOnTouchOnly', true);
46693
- return;
46694
- }
46695
- this.sortable = Sortable.create(this.container, {
46696
- animation: 150,
46697
- handle: DRAG_HANDLE_SELECTOR,
46698
- draggable: DRAGGABLE_ITEM_SELECTOR,
46699
- delay: TOUCH_DRAG_DELAY_MS,
46700
- delayOnTouchOnly: true,
46701
- onStart: this.handleSortStart,
46702
- onEnd: this.handleSortEnd,
46703
- });
46704
- }
46705
- teardownDragController() {
46706
- if (this.sortable) {
46707
- this.sortable.destroy();
46708
- this.sortable = undefined;
46709
- }
46710
- this.clearDropElevationTimer();
46711
- if (this.dropElevationTarget) {
46712
- this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
46713
- this.dropElevationTarget = undefined;
46714
- }
46715
- if (this.container) {
46716
- this.container.classList.remove(DEFAULT_CONTAINER_CLASS);
46717
- }
46718
- this.dragSnapshot = undefined;
46719
- this.draggedItemIndex = undefined;
44360
+ this.dragToReorder.setup(this.container);
46720
44361
  }
46721
44362
  canReorderItems() {
46722
44363
  if (this.props.disabled || this.props.readonly) {
@@ -46726,67 +44367,6 @@ class ArrayFieldTemplate extends React.Component {
46726
44367
  const limeOptions = (schema === null || schema === void 0 ? void 0 : schema.lime) || {};
46727
44368
  return limeOptions.allowItemReorder !== false;
46728
44369
  }
46729
- readOrderFromDom() {
46730
- if (!this.container) {
46731
- return [];
46732
- }
46733
- // Only read the order of the direct children of this array field.
46734
- // Nested array fields may render `.array-item` elements inside items,
46735
- // and those must not affect the parent order.
46736
- const items = [...this.container.children].filter((element) => {
46737
- var _a, _b;
46738
- return Boolean((_b = (_a = element === null || element === void 0 ? void 0 : element.classList) === null || _a === void 0 ? void 0 : _a.contains) === null || _b === void 0 ? void 0 : _b.call(_a, 'array-item'));
46739
- });
46740
- const order = [];
46741
- for (const element of items) {
46742
- const index = this.getReorderId(element);
46743
- if (index !== undefined) {
46744
- order.push(index);
46745
- }
46746
- }
46747
- return order;
46748
- }
46749
- getReorderId(element) {
46750
- var _a;
46751
- if (!element) {
46752
- return undefined;
46753
- }
46754
- const value = (_a = element === null || element === void 0 ? void 0 : element.dataset) === null || _a === void 0 ? void 0 : _a.reorderId;
46755
- if (value === undefined) {
46756
- return undefined;
46757
- }
46758
- const parsed = Number.parseInt(value, 10);
46759
- return Number.isNaN(parsed) ? undefined : parsed;
46760
- }
46761
- applyDropElevation(item) {
46762
- if (this.dropElevationTarget && this.dropElevationTarget !== item) {
46763
- this.dropElevationTarget.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
46764
- }
46765
- this.clearDropElevationTimer();
46766
- item.classList.add(DEFAULT_DROP_ELEVATION_CLASS);
46767
- this.dropElevationTarget = item;
46768
- }
46769
- scheduleDropElevationRemoval() {
46770
- if (!this.dropElevationTarget) {
46771
- return;
46772
- }
46773
- const target = this.dropElevationTarget;
46774
- this.clearDropElevationTimer();
46775
- this.dropElevationTimeout = setTimeout(() => {
46776
- target.classList.remove(DEFAULT_DROP_ELEVATION_CLASS);
46777
- if (this.dropElevationTarget === target) {
46778
- this.dropElevationTarget = undefined;
46779
- }
46780
- this.dropElevationTimeout = undefined;
46781
- }, DROP_ELEVATION_DURATION);
46782
- }
46783
- clearDropElevationTimer() {
46784
- if (this.dropElevationTimeout === undefined) {
46785
- return;
46786
- }
46787
- clearTimeout(this.dropElevationTimeout);
46788
- this.dropElevationTimeout = undefined;
46789
- }
46790
44370
  arraysEqual(a, b) {
46791
44371
  if (a.length !== b.length) {
46792
44372
  return false;
@@ -46804,39 +44384,25 @@ class ArrayFieldTemplate extends React.Component {
46804
44384
  return (items !== null && items !== void 0 ? items : []).map((_, index) => index);
46805
44385
  }
46806
44386
  getContextValue() {
46807
- var _a;
44387
+ var _a, _b, _c;
46808
44388
  const schema = this.props.schema;
46809
44389
  const formData = ((_a = this.props.formData) !== null && _a !== void 0 ? _a : []);
44390
+ const schemaPath = ((_c = (_b = this.props.fieldPathId) === null || _b === void 0 ? void 0 : _b.path) !== null && _c !== void 0 ? _c : []).map(String);
44391
+ const path = toSchemaPath(schemaPath);
46810
44392
  if (this.cachedContextValue &&
46811
44393
  this.cachedSchema === schema &&
46812
- this.cachedFormData === formData) {
44394
+ this.cachedFormData === formData &&
44395
+ this.cachedPath === path) {
46813
44396
  return this.cachedContextValue;
46814
44397
  }
46815
44398
  this.cachedSchema = schema;
46816
44399
  this.cachedFormData = formData;
46817
- this.cachedContextValue = { arraySchema: schema, formData };
44400
+ this.cachedPath = path;
44401
+ this.cachedContextValue = { arraySchema: schema, formData, schemaPath };
46818
44402
  return this.cachedContextValue;
46819
44403
  }
46820
44404
  }
46821
44405
 
46822
- /**
46823
- *
46824
- * @param data
46825
- */
46826
- function isInteger(data) {
46827
- // eslint-disable-next-line unicorn/prefer-number-is-safe-integer -- integers beyond the safe range must still validate
46828
- return Number.isInteger(Number(data));
46829
- }
46830
-
46831
- /**
46832
- * Shared RJSF validator configured with custom formats and ajv options.
46833
- * Use this single instance wherever the RJSF v6 API requires a validator.
46834
- */
46835
- const rjsfValidator = customizeValidator({
46836
- customFormats: { integer: isInteger },
46837
- ajvOptionsOverrides: { allErrors: true, multipleOfPrecision: 2 },
46838
- });
46839
-
46840
44406
  class CollapsibleItemTemplate extends React.Component {
46841
44407
  constructor(props) {
46842
44408
  super(props);
@@ -46888,6 +44454,7 @@ class CollapsibleItemTemplate extends React.Component {
46888
44454
  this.section = section;
46889
44455
  },
46890
44456
  'is-open': this.state.isOpen,
44457
+ 'data-schema-path': this.props.schemaPath,
46891
44458
  'data-reorder-id': String(this.props.index),
46892
44459
  'data-reorderable': this.props.allowItemReorder
46893
44460
  ? 'true'
@@ -47022,6 +44589,10 @@ const ArrayFieldItemTemplate = (props) => {
47022
44589
  allowItemReorder: allowItemReorder,
47023
44590
  errorSchema: itemErrors === null || itemErrors === void 0 ? void 0 : itemErrors[props.index],
47024
44591
  revealErrors: (formContext === null || formContext === void 0 ? void 0 : formContext.revealErrors) === true,
44592
+ schemaPath: toSchemaPath([
44593
+ ...arrayContext.schemaPath,
44594
+ String(props.index),
44595
+ ]),
47025
44596
  }, props.children);
47026
44597
  }
47027
44598
  return React.createElement(SimpleItemTemplate, {
@@ -47045,260 +44616,6 @@ function canItemReorder(props, schema) {
47045
44616
  return Boolean((buttonsProps === null || buttonsProps === void 0 ? void 0 : buttonsProps.hasMoveDown) || (buttonsProps === null || buttonsProps === void 0 ? void 0 : buttonsProps.hasMoveUp));
47046
44617
  }
47047
44618
 
47048
- const MAX_COLUMNS = 5;
47049
- const MAX_COLUMN_WIDTH = 15;
47050
- const PX_PER_REM = 16;
47051
- const COLUMN_COUNT = '--number-of-columns';
47052
- class GridLayout extends React.Component {
47053
- constructor(props) {
47054
- super(props);
47055
- this.props = props;
47056
- this.handleResize = this.handleResize.bind(this);
47057
- this.state = {
47058
- maxColumns: MAX_COLUMNS,
47059
- };
47060
- this.elementRef = React.createRef();
47061
- }
47062
- componentDidMount() {
47063
- this.observer = new ResizeObserver(this.handleResize);
47064
- this.observer.observe(this.elementRef.current);
47065
- window.addEventListener('resize', this.handleResize, {
47066
- capture: true,
47067
- passive: true,
47068
- });
47069
- }
47070
- componentWillUnmount() {
47071
- this.observer.unobserve(this.elementRef.current);
47072
- window.removeEventListener('resize', this.handleResize, {
47073
- capture: true,
47074
- });
47075
- }
47076
- handleResize() {
47077
- requestAnimationFrame(() => {
47078
- const element = this.elementRef.current;
47079
- if (!element) {
47080
- return;
47081
- }
47082
- const width = element.getBoundingClientRect().width;
47083
- const maxColumns = Math.min(MAX_COLUMNS, Math.max(1, Math.floor(width / (MAX_COLUMN_WIDTH * PX_PER_REM))));
47084
- const columns = this.getColumnCount(maxColumns);
47085
- if (element.style.getPropertyValue(COLUMN_COUNT) !== `${columns}`) {
47086
- element.style.setProperty(COLUMN_COUNT, `${columns}`);
47087
- }
47088
- if (maxColumns !== this.state.maxColumns) {
47089
- this.setState({
47090
- maxColumns: maxColumns,
47091
- });
47092
- }
47093
- });
47094
- }
47095
- render() {
47096
- var _a;
47097
- const classes = ['limel-form-layout--grid'];
47098
- const columns = this.getColumnCount(this.state.maxColumns);
47099
- classes.push(`layout-${columns}-columns`);
47100
- if (this.hasAutoFlowDense()) {
47101
- classes.push('auto-reorder-to-avoid-empty-cells');
47102
- }
47103
- return React.createElement('div', {
47104
- className: classes.join(' '),
47105
- 'data-schema-path': toSchemaPath((_a = this.props.schemaPath) !== null && _a !== void 0 ? _a : []),
47106
- ref: this.elementRef,
47107
- }, this.props.children);
47108
- }
47109
- getColumnCount(maxColumns) {
47110
- const layout = this.props.options;
47111
- return Math.min(layout.columns || MAX_COLUMNS, maxColumns);
47112
- }
47113
- hasAutoFlowDense() {
47114
- const layout = this.props.options;
47115
- return layout.dense !== false;
47116
- }
47117
- }
47118
-
47119
- const RowLayoutContext = reactExports.createContext(false);
47120
-
47121
- class Row extends React.Component {
47122
- constructor(props) {
47123
- super(props);
47124
- this.props = props;
47125
- }
47126
- render() {
47127
- const classes = ['row'];
47128
- if (this.icon) {
47129
- classes.push('has-icon');
47130
- }
47131
- return React.createElement('div', {
47132
- className: classes.join(' '),
47133
- }, this.renderMainInformation(), this.renderDescription());
47134
- }
47135
- renderIcon() {
47136
- if (this.icon) {
47137
- return React.createElement('limel-icon', {
47138
- name: this.icon,
47139
- });
47140
- }
47141
- }
47142
- renderMainInformation() {
47143
- return React.createElement('div', { className: 'main-information' }, this.renderIcon(), this.renderTitle(), this.renderChildren());
47144
- }
47145
- renderTitle() {
47146
- var _a;
47147
- return React.createElement('h1', { className: 'title' }, (_a = this.schema) === null || _a === void 0 ? void 0 : _a.title);
47148
- }
47149
- renderDescription() {
47150
- var _a;
47151
- if ((_a = this.schema) === null || _a === void 0 ? void 0 : _a.description) {
47152
- return React.createElement('limel-markdown', {
47153
- class: 'description',
47154
- value: this.schema.description,
47155
- });
47156
- }
47157
- }
47158
- renderChildren() {
47159
- return React.createElement(RowLayoutContext.Provider, { value: true }, this.props.children);
47160
- }
47161
- get schema() {
47162
- return this.props.children.props.schema;
47163
- }
47164
- get icon() {
47165
- var _a, _b, _c;
47166
- return (_c = (_b = (_a = this.schema) === null || _a === void 0 ? void 0 : _a.lime) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.icon;
47167
- }
47168
- }
47169
-
47170
- class RowLayout extends React.Component {
47171
- constructor(props) {
47172
- super(props);
47173
- this.props = props;
47174
- this.elementRef = React.createRef();
47175
- }
47176
- render() {
47177
- var _a;
47178
- return React.createElement('div', {
47179
- className: 'limel-form-row--layout',
47180
- 'data-schema-path': toSchemaPath((_a = this.props.schemaPath) !== null && _a !== void 0 ? _a : []),
47181
- ref: this.elementRef,
47182
- }, this.props.children.map((child, index) => {
47183
- return React.createElement(Row, {
47184
- key: index.toString(),
47185
- }, child);
47186
- }));
47187
- }
47188
- }
47189
-
47190
- /**
47191
- *
47192
- * @param schema
47193
- * @param extraProps - additional props to pass to the limel-help element
47194
- */
47195
- function getHelpComponent(schema, extraProps) {
47196
- var _a;
47197
- const help = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.help;
47198
- if (!help) {
47199
- return;
47200
- }
47201
- if (typeof help === 'string') {
47202
- return React.createElement('limel-help', Object.assign({ value: help }, extraProps));
47203
- }
47204
- const helpProps = help;
47205
- return React.createElement('limel-help', Object.assign(Object.assign({}, helpProps), extraProps));
47206
- }
47207
-
47208
- const ObjectFieldTemplate = (props) => {
47209
- const arrayContext = reactExports.useContext(ArrayFieldContext);
47210
- const id = props.fieldPathId.$id;
47211
- if (arrayContext && id !== 'root') {
47212
- return React.createElement(ArrayFieldContext.Provider, { value: null }, renderProperties(props.properties, props.schema, props.fieldPathId.path.map(String)));
47213
- }
47214
- if (id === 'root' || !isCollapsible(props.schema)) {
47215
- return renderFieldWithTitle(props);
47216
- }
47217
- return renderCollapsibleField(props);
47218
- };
47219
- function renderFieldWithTitle(props) {
47220
- return React.createElement(React.Fragment, {}, renderSectionHeader(props), renderDescription(props.description), renderProperties(props.properties, props.schema, props.fieldPathId.path.map(String)));
47221
- }
47222
- function renderSectionHeader(props) {
47223
- const help = getHelpComponent(props.schema);
47224
- if (!help) {
47225
- return renderTitle(props.title);
47226
- }
47227
- return React.createElement(React.Fragment, {}, renderTitle(props.title), help);
47228
- }
47229
- function renderCollapsibleField(props) {
47230
- var _a;
47231
- const defaultOpen = !isCollapsed(props.schema);
47232
- const helpElement = getHelpComponent(props.schema, {
47233
- slot: 'header',
47234
- });
47235
- const revealErrors = ((_a = props.registry.formContext) === null || _a === void 0 ? void 0 : _a.revealErrors) === true;
47236
- const invalid = revealErrors && hasNestedErrors(props.errorSchema);
47237
- return React.createElement('limel-collapsible-section', {
47238
- header: props.title,
47239
- id: getSchemaObjectPropertyPath(props.registry.formContext.schema, props.fieldPathId),
47240
- 'is-open': defaultOpen,
47241
- invalid: invalid,
47242
- }, helpElement, renderDescription(props.description), renderProperties(props.properties, props.schema, props.fieldPathId.path.map(String)));
47243
- }
47244
- function getSchemaObjectPropertyPath(schema, fieldPathId) {
47245
- var _a, _b;
47246
- const refPrefixLength = 2;
47247
- const matchAllForwardSlashes = /\//g;
47248
- const rootPath = (_b = (_a = schema.$ref) === null || _a === void 0 ? void 0 : _a.replaceAll(matchAllForwardSlashes, '.').slice(refPrefixLength)) !== null && _b !== void 0 ? _b : '';
47249
- const subSchemaPath = fieldPathId.path
47250
- .map((segment) => `.properties.${segment}`)
47251
- .join('');
47252
- return `${rootPath}${subSchemaPath}`;
47253
- }
47254
- function renderProperties(properties, schema, schemaPath) {
47255
- var _a;
47256
- const layout = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.layout;
47257
- return renderLayout(properties, layout, schemaPath);
47258
- }
47259
- function renderLayout(properties, layout, schemaPath) {
47260
- const type = (layout === null || layout === void 0 ? void 0 : layout.type) || 'default';
47261
- const layouts = {
47262
- default: renderDefaultLayout,
47263
- grid: renderGridLayout,
47264
- row: renderRowLayout,
47265
- };
47266
- return layouts[type](properties, layout, schemaPath);
47267
- }
47268
- function renderDefaultLayout(properties, _layout, schemaPath) {
47269
- return React.createElement('div', {
47270
- className: 'limel-form-layout--default',
47271
- 'data-schema-path': toSchemaPath(schemaPath),
47272
- }, properties.map((element) => element.content));
47273
- }
47274
- /**
47275
- * Render a schema path as a leading-slash string. Root → `/`,
47276
- * `['rules']` → `/rules`, `['rules', 'details']` → `/rules/details`.
47277
- *
47278
- * @param path the schema-path segments (typically `fieldPathId.path`).
47279
- */
47280
- function toSchemaPath(path) {
47281
- return path.length === 0 ? '/' : `/${path.join('/')}`;
47282
- }
47283
- function renderGridLayout(properties, layout, schemaPath) {
47284
- return React.createElement(GridLayout, {
47285
- options: layout,
47286
- schemaPath: schemaPath,
47287
- }, properties.map((element) => element.content));
47288
- }
47289
- function renderRowLayout(properties, _layout, schemaPath) {
47290
- return React.createElement(RowLayout, {
47291
- schemaPath: schemaPath,
47292
- }, properties.map((element) => element.content));
47293
- }
47294
- function isCollapsible(schema) {
47295
- var _a;
47296
- return !!((_a = schema.lime) === null || _a === void 0 ? void 0 : _a.collapsible);
47297
- }
47298
- function isCollapsed(schema) {
47299
- return schema.lime.collapsed !== false;
47300
- }
47301
-
47302
44619
  /**
47303
44620
  * Check whether a form field value is non-empty.
47304
44621
  * Treats `null`, `undefined`, `''`, empty arrays,
@@ -47375,90 +44692,6 @@ function getErrorText(errors, description, fallbackText) {
47375
44692
  return fallbackText || description;
47376
44693
  }
47377
44694
 
47378
- /**
47379
- * Given two objects, get a list of keys for each value that is different between
47380
- * the two objects. Compares using deep comparison
47381
- *
47382
- * @param a - first object
47383
- * @param b - second object
47384
- * @returns the array of keys
47385
- */
47386
- const getDifferentKeys = (a = {}, b = {}) => {
47387
- const keys = union$1(Object.keys(a), Object.keys(b));
47388
- return keys.filter((key) => {
47389
- return !isEqual(b[key], a[key]);
47390
- });
47391
- };
47392
- /**
47393
- * Given the data for the current SchemaField, detect if the changed data
47394
- * has any other fields that are dependent on it, and if so reset those dependent fields
47395
- * (by deleting them from the data so that their defaults are populated on the next rerender).
47396
- * Call onChange with the updated data
47397
- *
47398
- * @param oldData - The previous data before a data change event
47399
- * @param newData - The form data from a change event
47400
- * @param schema - The schema associated with the data
47401
- * @param rootSchema - The root schema
47402
- */
47403
- // eslint-disable-next-line sonarjs/no-invariant-returns
47404
- const resetDependentFields = (oldData, newData, schema, rootSchema) => {
47405
- // Dependencies only exist on object types
47406
- if (!isPlainObject$1(newData)) {
47407
- return newData;
47408
- }
47409
- if (isCustomObjectSchema(schema)) {
47410
- return newData;
47411
- }
47412
- // Get the schema generated by the current data
47413
- const currentSchema = retrieveSchema(rjsfValidator, schema, rootSchema, oldData);
47414
- const newSchema = retrieveSchema(rjsfValidator, schema, rootSchema, newData);
47415
- // Get property keys whose schema changed due to the new data.
47416
- // These properties that have changed are the properties that are dependent on
47417
- // data that has changed in the current onChange event
47418
- const dependentPropertyKeys = getDifferentKeys(newSchema.properties, currentSchema.properties);
47419
- // Reset keys that are dependent on the changed value.
47420
- // The values for these dependent fields will be repopulated
47421
- // with defaults during the next render
47422
- for (const dependentPropertyKey of dependentPropertyKeys) {
47423
- delete newData[dependentPropertyKey];
47424
- }
47425
- return newData;
47426
- };
47427
- /**
47428
- * Check if the schema is of type object and have no declared properties
47429
- *
47430
- * @param schema - the schema
47431
- * @returns true if the schema is for a custom object
47432
- */
47433
- function isCustomObjectSchema(schema) {
47434
- if (!schema.additionalProperties) {
47435
- return false;
47436
- }
47437
- if (!('properties' in schema)) {
47438
- return true;
47439
- }
47440
- const properties = Object.values(schema.properties);
47441
- return properties.filter(negate(isAdditionalProperty)).length === 0;
47442
- }
47443
- function isAdditionalProperty(schema) {
47444
- return schema[ADDITIONAL_PROPERTY_FLAG] === true;
47445
- }
47446
- /**
47447
- * Check whether a schema permits `null` as a valid value. Used to decide
47448
- * whether a cleared field value should be preserved as `null` or converted
47449
- * to `undefined` so the property can be removed from the form data.
47450
- *
47451
- * @param schema - the schema to check
47452
- * @returns true if the schema's type is `'null'` or includes `'null'`
47453
- */
47454
- const schemaAllowsNull = (schema) => {
47455
- const type = schema === null || schema === void 0 ? void 0 : schema.type;
47456
- if (!type) {
47457
- return false;
47458
- }
47459
- return Array.isArray(type) ? type.includes('null') : type === 'null';
47460
- };
47461
-
47462
44695
  /**
47463
44696
  * A widget is a concept in react-jsonschema-form (rjsf).
47464
44697
  * It represents a HTML tag for the user to enter data, eg. input, select, etc.
@@ -48393,7 +45626,123 @@ const widgets = {
48393
45626
  RangeWidget: Slider,
48394
45627
  };
48395
45628
 
48396
- const formCss = () => `@charset "UTF-8";.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>.rjsf-field{position:unset}.limel-form-row--layout .main-information>.rjsf-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 .rjsf-field{flex-shrink:0;display:flex;align-content:center}.limel-form-row--layout .rjsf-field limel-slider{min-width:8rem;display:block}*,*::after,*::before{box-sizing:border-box}.rjsf-field{min-width:0}.limel-form-array-item--simple{display:flex;align-items:center;padding:0.25rem}.limel-form-array-item--simple>*:first-child{flex:1;min-width:0}.array-items{isolation:isolate;display:flex;flex-direction:column;row-gap:var(--form-row-gap, 0.5rem);margin-top:1rem}.array-items.has-an-item-which-is-being-dragged limel-collapsible-section{--limel-cs-grid-template-rows:0fr;--limel-cs-opacity-transition-speed:0.2s;--limel-cs-grid-template-rows-transition-speed:0.2s;--limel-cs-open-header-bottom-border-radius:0.75rem}.array-item:has(limel-drag-handle:hover),.array-item:has(limel-drag-handle:focus-within),.array-item.is-elevated,.array-item.sortable-chosen{will-change:transform, box-shadow, border-radius, background-color}.array-item.sortable-ghost{border-radius:0.5rem;box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}.array-item.sortable-chosen{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color)}.array-item.is-elevated[draggable=false]{animation:sit-here 0.8s forwards}@keyframes sit-here{0%{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}100%{box-shadow:none}}limel-drag-handle{order:10}limel-collapsible-section.is-being-dragged{border-radius:0.75rem !important}.limel-form-layout--default{display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem)}.limel-form-layout--grid{--min-height-of-one-row:2.5rem;display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem);grid-template-columns:repeat(var(--number-of-columns), minmax(0, 1fr))}.limel-form-layout--grid.auto-reorder-to-avoid-empty-cells{grid-auto-flow:dense}.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5{grid-column:span 5}.limel-form-layout--grid .limel-form-layout-colspan--all{grid-column:1/-1}.limel-form-layout--grid limel-checkbox,.limel-form-layout--grid limel-switch{min-height:var(--min-height-of-one-row)}.limel-form-layout--grid limel-checkbox{display:block}.limel-form-layout--grid limel-switch{margin-left:0.5rem}.form-error{color:var(--limel-theme-error-color);font-size:0.6875rem;line-height:1.5;visibility:inherit;padding-right:1rem;padding-left:1rem;padding-top:0.25rem}.button-add-new{margin-top:0.5rem;width:100%}h1{position:relative;margin-top:0;margin-bottom:0;word-break:break-word;hyphens:auto;-webkit-hyphens:auto;text-wrap:balance;font-size:var(--limel-form-h1-font-size);line-height:calc(var(--limel-form-h1-font-size) * 1.42857);letter-spacing:-0.01rem;font-weight:500}limel-markdown{display:block;margin-bottom:0.5rem}.rjsf-field{position:relative}.rjsf-field limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5)}.rjsf-field h1{color:rgb(var(--contrast-1400), 0.8)}.rjsf-field h1{--limel-form-h1-font-size:1.476rem;font-weight:800}.rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.383rem;font-weight:700}.rjsf-field .rjsf-field 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}.rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.296rem;font-weight:600}.rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.215rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.138rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.067rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}`;
45629
+ var reactDomExports = requireReactDom();
45630
+
45631
+ const HIGHLIGHT_CLASS = 'limel-form-field--highlighted';
45632
+ const STABLE_FRAMES = 3;
45633
+ const MAX_SETTLE_MS = 2000;
45634
+ const MAX_RENDER_FRAMES = 30;
45635
+ /**
45636
+ * Open what is closed above a field, scroll it into view, focus it and
45637
+ * highlight it.
45638
+ *
45639
+ * @param root - the element the form is rendered in
45640
+ * @param path - the path of the field in the value of the form
45641
+ */
45642
+ async function showField(root, path) {
45643
+ if (!(await waitUntilRendered(root, path))) {
45644
+ return;
45645
+ }
45646
+ let target;
45647
+ for (let depth = 1; depth <= path.length; depth++) {
45648
+ const element = findByPath(root, path.slice(0, depth));
45649
+ if (!element) {
45650
+ break;
45651
+ }
45652
+ target = element;
45653
+ openSectionsAround(root, element);
45654
+ }
45655
+ if (!target) {
45656
+ return;
45657
+ }
45658
+ // The components inside the field have to be drawn, and the sections
45659
+ // around it opened, before the field is where it will stay.
45660
+ const focusTarget = await getFocusTarget(target);
45661
+ await waitForLayoutToSettle(target);
45662
+ target.scrollIntoView({
45663
+ block: 'center',
45664
+ behavior: prefersReducedMotion() ? 'instant' : 'smooth',
45665
+ });
45666
+ focusTarget === null || focusTarget === void 0 ? void 0 : focusTarget.focus({ preventScroll: true });
45667
+ await waitForLayoutToSettle(target);
45668
+ highlight(target);
45669
+ }
45670
+ function findByPath(root, path) {
45671
+ const schemaPath = toSchemaPath(path.map(String));
45672
+ return root.querySelector(`[data-schema-path="${CSS.escape(schemaPath)}"]`);
45673
+ }
45674
+ // The form is drawn a moment after its value or schema is set, so give it a few
45675
+ // frames to show the start of the path.
45676
+ async function waitUntilRendered(root, path) {
45677
+ for (let frame = 0; frame < MAX_RENDER_FRAMES; frame++) {
45678
+ if (findByPath(root, path.slice(0, 1))) {
45679
+ return true;
45680
+ }
45681
+ await nextFrame();
45682
+ }
45683
+ return false;
45684
+ }
45685
+ function openSectionsAround(root, element) {
45686
+ for (let node = element; node && node !== root; node = node.parentElement) {
45687
+ if (isClosedSection(node)) {
45688
+ open(node);
45689
+ }
45690
+ }
45691
+ }
45692
+ function isClosedSection(element) {
45693
+ return (element.tagName === 'LIMEL-COLLAPSIBLE-SECTION' &&
45694
+ !element.isOpen);
45695
+ }
45696
+ // A collapsed list item renders its fields only once its section says it has
45697
+ // been opened, and they have to be in place before the next step is looked up.
45698
+ function open(section) {
45699
+ section.isOpen = true;
45700
+ reactDomExports.flushSync(() => {
45701
+ section.dispatchEvent(new CustomEvent('open'));
45702
+ });
45703
+ }
45704
+ // Wait until the field has a size and has stayed in place for a few frames, so
45705
+ // it is not scrolled to while the form still grows, nor flashed while scrolling.
45706
+ async function waitForLayoutToSettle(element) {
45707
+ let previous = '';
45708
+ let stableFrames = 0;
45709
+ const deadline = performance.now() + MAX_SETTLE_MS;
45710
+ while (performance.now() < deadline) {
45711
+ await nextFrame();
45712
+ const { top, height } = element.getBoundingClientRect();
45713
+ const current = `${top}:${height}`;
45714
+ const isStill = height > 0 && current === previous;
45715
+ stableFrames = isStill ? stableFrames + 1 : 0;
45716
+ if (stableFrames === STABLE_FRAMES) {
45717
+ return;
45718
+ }
45719
+ previous = current;
45720
+ }
45721
+ }
45722
+ function highlight(element) {
45723
+ // Removed for a frame first, so showing the same field again restarts it.
45724
+ element.classList.remove(HIGHLIGHT_CLASS);
45725
+ const removeHighlight = (event) => {
45726
+ // Animations of what the field holds end here too.
45727
+ if (event.animationName !== 'highlight-field-shadow') {
45728
+ return;
45729
+ }
45730
+ element.classList.remove(HIGHLIGHT_CLASS);
45731
+ element.removeEventListener('animationend', removeHighlight);
45732
+ };
45733
+ requestAnimationFrame(() => {
45734
+ element.classList.add(HIGHLIGHT_CLASS);
45735
+ element.addEventListener('animationend', removeHighlight);
45736
+ });
45737
+ }
45738
+ function prefersReducedMotion() {
45739
+ return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
45740
+ }
45741
+ function nextFrame() {
45742
+ return new Promise((resolve) => requestAnimationFrame(() => resolve()));
45743
+ }
45744
+
45745
+ const formCss = () => `@charset "UTF-8";.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>.rjsf-field{position:unset}.limel-form-row--layout .main-information>.rjsf-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 .rjsf-field{flex-shrink:0;display:flex;align-content:center}.limel-form-row--layout .rjsf-field limel-slider{min-width:8rem;display:block}*,*::after,*::before{box-sizing:border-box}.rjsf-field{min-width:0}.limel-form-array-item--simple{display:flex;align-items:center;padding:0.25rem}.limel-form-array-item--simple>*:first-child{flex:1;min-width:0}.array-items{isolation:isolate;display:flex;flex-direction:column;row-gap:var(--form-row-gap, 0.5rem);margin-top:1rem}.array-items.has-an-item-which-is-being-dragged limel-collapsible-section{--limel-cs-grid-template-rows:0fr;--limel-cs-opacity-transition-speed:0.2s;--limel-cs-grid-template-rows-transition-speed:0.2s;--limel-cs-open-header-bottom-border-radius:0.75rem}.array-item:has(limel-drag-handle:hover),.array-item:has(limel-drag-handle:focus-within),.array-item.is-elevated,.array-item.sortable-chosen{will-change:transform, box-shadow, border-radius, background-color}.array-item.sortable-ghost{border-radius:0.5rem;box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}.array-item.sortable-chosen{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color)}.array-item.is-elevated[draggable=false]{animation:sit-here 0.8s forwards}@keyframes sit-here{0%{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}100%{box-shadow:none}}limel-drag-handle{order:10}limel-collapsible-section.is-being-dragged{border-radius:0.75rem !important}.limel-form-layout--default{display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem)}.limel-form-layout--grid{--min-height-of-one-row:2.5rem;display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem);grid-template-columns:repeat(var(--number-of-columns), minmax(0, 1fr))}.limel-form-layout--grid.auto-reorder-to-avoid-empty-cells{grid-auto-flow:dense}.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5{grid-column:span 5}.limel-form-layout--grid .limel-form-layout-colspan--all{grid-column:1/-1}.limel-form-layout--grid limel-checkbox,.limel-form-layout--grid limel-switch{min-height:var(--min-height-of-one-row)}.limel-form-layout--grid limel-checkbox{display:block}.limel-form-layout--grid limel-switch{margin-left:0.5rem}.form-error{color:var(--limel-theme-error-color);font-size:0.6875rem;line-height:1.5;visibility:inherit;padding-right:1rem;padding-left:1rem;padding-top:0.25rem}.button-add-new{margin-top:0.5rem;width:100%}h1{position:relative;margin-top:0;margin-bottom:0;word-break:break-word;hyphens:auto;-webkit-hyphens:auto;text-wrap:balance;font-size:var(--limel-form-h1-font-size);line-height:calc(var(--limel-form-h1-font-size) * 1.42857);letter-spacing:-0.01rem;font-weight:500}limel-markdown{display:block;margin-bottom:0.5rem}.rjsf-field{position:relative}.rjsf-field limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5)}.rjsf-field h1{color:rgb(var(--contrast-1400), 0.8)}.rjsf-field h1{--limel-form-h1-font-size:1.476rem;font-weight:800}.rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.383rem;font-weight:700}.rjsf-field .rjsf-field 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}.rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.296rem;font-weight:600}.rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.215rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.138rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.067rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.limel-form-field--highlighted{position:relative}.limel-form-field--highlighted::after{content:"";position:absolute;inset:-0.25rem;border-radius:0.5rem;pointer-events:none;animation-name:highlight-field-background, highlight-field-shadow;animation-duration:6s;animation-delay:0.1s, 0.3s;animation-timing-function:ease-in-out}@media (prefers-reduced-motion){.limel-form-field--highlighted::after{animation-duration:4s;animation-delay:0s}}@keyframes highlight-field-background{0%{background-color:transparent}12.5%{background-color:color-mix(in srgb, var(--lime-primary-color, var(--limel-theme-primary-color)), transparent 65%)}45%,100%{background-color:transparent}}@keyframes highlight-field-shadow{0%,25%,50%{box-shadow:none}12.5%,37.5%{box-shadow:var(--shadow-depth-8-focused)}62.5%,72.5%{box-shadow:var(--shadow-depth-8-focused);animation-timing-function:ease-out}100%{box-shadow:none}}@media (prefers-reduced-motion){@keyframes highlight-field-shadow{0%,25%{box-shadow:var(--shadow-depth-8-focused);animation-timing-function:ease-out}100%{box-shadow:none}}}`;
48397
45746
 
48398
45747
  var __rest = (undefined && undefined.__rest) || function (s, e) {
48399
45748
  var t = {};
@@ -48437,6 +45786,13 @@ const Form = class {
48437
45786
  }
48438
45787
  componentDidLoad() {
48439
45788
  this.initialize();
45789
+ this.showHighlightedField();
45790
+ }
45791
+ handleHighlightedFieldChange(newPath, oldPath) {
45792
+ // A host that renders again passes an equal path in a new array.
45793
+ if (!isEqual(newPath, oldPath)) {
45794
+ this.showHighlightedField();
45795
+ }
48440
45796
  }
48441
45797
  initialize() {
48442
45798
  if (this.initialized || !this.host.shadowRoot.querySelector('.root')) {
@@ -48458,7 +45814,7 @@ const Form = class {
48458
45814
  this.initialized = false;
48459
45815
  }
48460
45816
  render() {
48461
- return h$1("div", { key: '9c5db05ffcc594473a3ca7b2e3962f1659d3601d', class: "root" });
45817
+ return h$1("div", { key: 'ffbfb1d5d0377c01a29740b7a08fdfb3532e470f', class: "root" });
48462
45818
  }
48463
45819
  reactRender() {
48464
45820
  if (!this.root) {
@@ -48505,6 +45861,13 @@ const Form = class {
48505
45861
  },
48506
45862
  }, []));
48507
45863
  }
45864
+ showHighlightedField() {
45865
+ if (!this.highlightedField) {
45866
+ return;
45867
+ }
45868
+ const root = this.host.shadowRoot.querySelector('.root');
45869
+ void showField(root, this.highlightedField);
45870
+ }
48508
45871
  handleChange(event) {
48509
45872
  this.change.emit(event.formData);
48510
45873
  }
@@ -48587,6 +45950,11 @@ const Form = class {
48587
45950
  });
48588
45951
  }
48589
45952
  get host() { return getElement(this); }
45953
+ static get watchers() { return {
45954
+ "highlightedField": [{
45955
+ "handleHighlightedFieldChange": 0
45956
+ }]
45957
+ }; }
48590
45958
  };
48591
45959
  Form.style = formCss();
48592
45960