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