@oliasoft-open-source/react-ui-library 4.14.1-beta-1 → 4.14.1-beta-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11,11 +11,11 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
11
11
  var _docChanged, _ignoreNextExit, _suggesters, _next, _prev, _handlerMatches, _ignored, _removed, _lastChangeFromAppend, _a;
12
12
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
13
13
  import * as React$4 from "react";
14
- import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback as useCallback$1, createElement, forwardRef, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, PureComponent, useImperativeHandle, memo as memo$1, cloneElement as cloneElement$1 } from "react";
14
+ import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback as useCallback$1, createElement, forwardRef, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, Component as Component$1, PureComponent, useImperativeHandle, memo, cloneElement as cloneElement$1 } from "react";
15
15
  import * as PropTypes from "prop-types";
16
16
  import PropTypes__default from "prop-types";
17
- import ReactDOM, { createPortal, unstable_batchedUpdates, flushSync as flushSync$1, render } from "react-dom";
18
- import { noop as noop$3, set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$2, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$3, isObject as isObject$5, isEqual as isEqual$4 } from "lodash";
17
+ import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
18
+ import { noop as noop$3, set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$2, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$2, isObject as isObject$5, isEqual as isEqual$4 } from "lodash";
19
19
  import { toString as toString$1, isScientificStringNum, roundToPrecision, toNum, validateNumber, cleanNumStr, stripLeadingZeros, roundToFixed, roundByMagnitude, unitFromQuantity, getUnit, KNOWN_UNITS, ALT_UNITS, isValueWithUnit, getValue as getValue$1, withUnit, convertSamePrecision, convertAndGetValue, split as split$1, label as label$b, isValidNum, getAltUnitsListByQuantity, altUnitsList, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
20
20
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
21
21
  function getDefaultExportFromCjs(x2) {
@@ -222,32 +222,32 @@ function _setPrototypeOf$3(t, e2) {
222
222
  function _inheritsLoose$3(t, o) {
223
223
  t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$3(t, o);
224
224
  }
225
- var extendStatics = function(d2, b2) {
226
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
225
+ var extendStatics$1 = function(d2, b2) {
226
+ extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
227
227
  d3.__proto__ = b3;
228
228
  } || function(d3, b3) {
229
229
  for (var p in b3) if (Object.prototype.hasOwnProperty.call(b3, p)) d3[p] = b3[p];
230
230
  };
231
- return extendStatics(d2, b2);
231
+ return extendStatics$1(d2, b2);
232
232
  };
233
- function __extends(d2, b2) {
233
+ function __extends$1(d2, b2) {
234
234
  if (typeof b2 !== "function" && b2 !== null)
235
235
  throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
236
- extendStatics(d2, b2);
236
+ extendStatics$1(d2, b2);
237
237
  function __() {
238
238
  this.constructor = d2;
239
239
  }
240
240
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
241
241
  }
242
- var __assign$3 = function() {
243
- __assign$3 = Object.assign || function __assign2(t) {
242
+ var __assign$4 = function() {
243
+ __assign$4 = Object.assign || function __assign2(t) {
244
244
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
245
245
  s = arguments[i];
246
246
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
247
247
  }
248
248
  return t;
249
249
  };
250
- return __assign$3.apply(this, arguments);
250
+ return __assign$4.apply(this, arguments);
251
251
  };
252
252
  function __rest$1(s, e2) {
253
253
  var t = {};
@@ -883,15 +883,15 @@ var DefaultContext = {
883
883
  attr: void 0
884
884
  };
885
885
  var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
886
- var __assign$2 = function() {
887
- __assign$2 = Object.assign || function(t) {
886
+ var __assign$3 = function() {
887
+ __assign$3 = Object.assign || function(t) {
888
888
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
889
889
  s = arguments[i];
890
890
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
891
891
  }
892
892
  return t;
893
893
  };
894
- return __assign$2.apply(this, arguments);
894
+ return __assign$3.apply(this, arguments);
895
895
  };
896
896
  var __rest = function(s, e2) {
897
897
  var t = {};
@@ -903,15 +903,15 @@ var __rest = function(s, e2) {
903
903
  };
904
904
  function Tree2Element(tree2) {
905
905
  return tree2 && tree2.map(function(node2, i) {
906
- return React__default.createElement(node2.tag, __assign$2({
906
+ return React__default.createElement(node2.tag, __assign$3({
907
907
  key: i
908
908
  }, node2.attr), Tree2Element(node2.child));
909
909
  });
910
910
  }
911
911
  function GenIcon(data) {
912
912
  return function(props) {
913
- return React__default.createElement(IconBase, __assign$2({
914
- attr: __assign$2({}, data.attr)
913
+ return React__default.createElement(IconBase, __assign$3({
914
+ attr: __assign$3({}, data.attr)
915
915
  }, props), Tree2Element(data.child));
916
916
  };
917
917
  }
@@ -922,13 +922,13 @@ function IconBase(props) {
922
922
  var className;
923
923
  if (conf.className) className = conf.className;
924
924
  if (props.className) className = (className ? className + " " : "") + props.className;
925
- return React__default.createElement("svg", __assign$2({
925
+ return React__default.createElement("svg", __assign$3({
926
926
  stroke: "currentColor",
927
927
  fill: "currentColor",
928
928
  strokeWidth: "0"
929
929
  }, conf.attr, attr, svgProps, {
930
930
  className,
931
- style: __assign$2(__assign$2({
931
+ style: __assign$3(__assign$3({
932
932
  color: props.color || conf.color
933
933
  }, conf.style), props.style),
934
934
  height: computedSize,
@@ -1808,7 +1808,7 @@ var requestAnimationFrame$1 = function() {
1808
1808
  };
1809
1809
  }();
1810
1810
  var trailingTimeout = 2;
1811
- function throttle$1(callback, delay) {
1811
+ function throttle$2(callback, delay) {
1812
1812
  var leadingCall = false, trailingCall = false, lastCallTime = 0;
1813
1813
  function resolvePending() {
1814
1814
  if (leadingCall) {
@@ -1850,7 +1850,7 @@ var ResizeObserverController$1 = (
1850
1850
  this.mutationsObserver_ = null;
1851
1851
  this.observers_ = [];
1852
1852
  this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
1853
- this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);
1853
+ this.refresh = throttle$2(this.refresh.bind(this), REFRESH_DELAY);
1854
1854
  }
1855
1855
  ResizeObserverController2.prototype.addObserver = function(observer) {
1856
1856
  if (!~this.observers_.indexOf(observer)) {
@@ -2354,7 +2354,7 @@ function useEventSubscriptions() {
2354
2354
  };
2355
2355
  }, []);
2356
2356
  }
2357
- var useIsomorphicLayoutEffect$7 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2357
+ var useIsomorphicLayoutEffect$6 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2358
2358
  function useLastState(currentState, enabled) {
2359
2359
  var lastState = useRef(currentState);
2360
2360
  if (!enabled) {
@@ -2602,7 +2602,7 @@ function useTrackElements(_ref) {
2602
2602
  resetWhenReferenceChangedWhileTracking(previousTrigger, trigger2);
2603
2603
  }, [get4, set2, resetWhenReferenceChangedWhileTracking, getScrollContainers]));
2604
2604
  var triggerOptionParent = triggerOption == null ? void 0 : triggerOption.getParent == null ? void 0 : triggerOption.getParent();
2605
- useIsomorphicLayoutEffect$7(function() {
2605
+ useIsomorphicLayoutEffect$6(function() {
2606
2606
  if (!triggerOptionParent) {
2607
2607
  return;
2608
2608
  }
@@ -2612,7 +2612,7 @@ function useTrackElements(_ref) {
2612
2612
  });
2613
2613
  });
2614
2614
  }, [triggerOptionParent, set2, getScrollContainers]);
2615
- useIsomorphicLayoutEffect$7(function() {
2615
+ useIsomorphicLayoutEffect$6(function() {
2616
2616
  if (enabled) {
2617
2617
  if (!hasEventSubscriptions()) {
2618
2618
  addEventListeners();
@@ -2624,7 +2624,7 @@ function useTrackElements(_ref) {
2624
2624
  }
2625
2625
  };
2626
2626
  }, [enabled, hasEventSubscriptions, addEventListeners, removeAllEventSubscriptions]);
2627
- useIsomorphicLayoutEffect$7(function() {
2627
+ useIsomorphicLayoutEffect$6(function() {
2628
2628
  if (enabled) {
2629
2629
  handleChange();
2630
2630
  }
@@ -5306,15 +5306,15 @@ const Card = ({
5306
5306
  }
5307
5307
  );
5308
5308
  };
5309
- var __assign$1 = function() {
5310
- __assign$1 = Object.assign || function __assign2(t) {
5309
+ var __assign$2 = function() {
5310
+ __assign$2 = Object.assign || function __assign2(t) {
5311
5311
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
5312
5312
  s = arguments[i];
5313
5313
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5314
5314
  }
5315
5315
  return t;
5316
5316
  };
5317
- return __assign$1.apply(this, arguments);
5317
+ return __assign$2.apply(this, arguments);
5318
5318
  };
5319
5319
  function __spreadArray$1(to2, from3, pack) {
5320
5320
  if (pack || arguments.length === 2) for (var i = 0, l = from3.length, ar2; i < l; i++) {
@@ -6147,7 +6147,7 @@ var Ie = function(e2) {
6147
6147
  function e2(e3, n2, o) {
6148
6148
  void 0 === e3 && (e3 = C), void 0 === n2 && (n2 = {});
6149
6149
  var r2 = this;
6150
- this.options = __assign$1(__assign$1({}, Te), e3), this.gs = n2, this.names = new Map(o), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
6150
+ this.options = __assign$2(__assign$2({}, Te), e3), this.gs = n2, this.names = new Map(o), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
6151
6151
  return function(e4) {
6152
6152
  for (var t = e4.getTag(), n3 = t.length, o2 = "", r3 = function(n4) {
6153
6153
  var r4 = function(e5) {
@@ -6170,7 +6170,7 @@ var Ie = function(e2) {
6170
6170
  }, e2.prototype.rehydrate = function() {
6171
6171
  !this.server && S && _e(this);
6172
6172
  }, e2.prototype.reconstructWithOptions = function(n2, o) {
6173
- return void 0 === o && (o = true), new e2(__assign$1(__assign$1({}, this.options), n2), this.gs, o && this.names || void 0);
6173
+ return void 0 === o && (o = true), new e2(__assign$2(__assign$2({}, this.options), n2), this.gs, o && this.names || void 0);
6174
6174
  }, e2.prototype.allocateGSInstance = function(e3) {
6175
6175
  return this.gs[e3] = (this.gs[e3] || 0) + 1;
6176
6176
  }, e2.prototype.getTag = function() {
@@ -6343,9 +6343,9 @@ function it$1(e2, r2, s) {
6343
6343
  var i2 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p2 = e4.foldedComponentIds, d3 = e4.styledComponentId, h2 = e4.target, f3 = React__default.useContext(et$1), m3 = Ge(), y3 = e4.shouldForwardProp || m3.shouldForwardProp;
6344
6344
  "production" !== process.env.NODE_ENV && useDebugValue(d3);
6345
6345
  var v2 = I(r4, f3, c3) || C, g3 = function(e5, n2, o) {
6346
- for (var r5, s3 = __assign$1(__assign$1({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6346
+ for (var r5, s3 = __assign$2(__assign$2({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6347
6347
  var a4 = re(r5 = e5[i3]) ? r5(s3) : r5;
6348
- for (var c4 in a4) s3[c4] = "className" === c4 ? ie$2(s3[c4], a4[c4]) : "style" === c4 ? __assign$1(__assign$1({}, s3[c4]), a4[c4]) : a4[c4];
6348
+ for (var c4 in a4) s3[c4] = "className" === c4 ? ie$2(s3[c4], a4[c4]) : "style" === c4 ? __assign$2(__assign$2({}, s3[c4]), a4[c4]) : a4[c4];
6349
6349
  }
6350
6350
  return n2.className && (s3.className = ie$2(s3.className, n2.className)), s3;
6351
6351
  }(i2, r4, v2), S3 = g3.as || h2, w3 = {};
@@ -6401,9 +6401,9 @@ function ut(n2, o, r2) {
6401
6401
  return n2(o, r2, lt$1.apply(void 0, __spreadArray$1([t], s2, false)));
6402
6402
  };
6403
6403
  return s.attrs = function(e2) {
6404
- return ut(n2, o, __assign$1(__assign$1({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6404
+ return ut(n2, o, __assign$2(__assign$2({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6405
6405
  }, s.withConfig = function(e2) {
6406
- return ut(n2, o, __assign$1(__assign$1({}, r2), e2));
6406
+ return ut(n2, o, __assign$2(__assign$2({}, r2), e2));
6407
6407
  }, s;
6408
6408
  }
6409
6409
  var pt$1 = function(e2) {
@@ -9929,7 +9929,7 @@ function createSubscription(store, parentSub) {
9929
9929
  };
9930
9930
  return subscription;
9931
9931
  }
9932
- var useIsomorphicLayoutEffect$6 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? useLayoutEffect$1 : useEffect;
9932
+ var useIsomorphicLayoutEffect$5 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? useLayoutEffect$1 : useEffect;
9933
9933
  function Provider(_ref) {
9934
9934
  var store = _ref.store, context2 = _ref.context, children = _ref.children;
9935
9935
  var contextValue = useMemo$1(function() {
@@ -9942,7 +9942,7 @@ function Provider(_ref) {
9942
9942
  var previousState = useMemo$1(function() {
9943
9943
  return store.getState();
9944
9944
  }, [store]);
9945
- useIsomorphicLayoutEffect$6(function() {
9945
+ useIsomorphicLayoutEffect$5(function() {
9946
9946
  var subscription = contextValue.subscription;
9947
9947
  subscription.onStateChange = subscription.notifyNestedSubs;
9948
9948
  subscription.trySubscribe();
@@ -10662,7 +10662,7 @@ function storeStateUpdatesReducer(state, action2) {
10662
10662
  return [action2.payload, updateCount2 + 1];
10663
10663
  }
10664
10664
  function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
10665
- useIsomorphicLayoutEffect$6(function() {
10665
+ useIsomorphicLayoutEffect$5(function() {
10666
10666
  return effectFunc.apply(void 0, effectArgs);
10667
10667
  }, dependencies);
10668
10668
  }
@@ -15367,7 +15367,7 @@ var getStyles$1 = function(contextId) {
15367
15367
  userCancel: getStyles(rules2, "userCancel")
15368
15368
  };
15369
15369
  };
15370
- var useIsomorphicLayoutEffect$5 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? useLayoutEffect$1 : useEffect;
15370
+ var useIsomorphicLayoutEffect$4 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? useLayoutEffect$1 : useEffect;
15371
15371
  var getHead = function getHead2() {
15372
15372
  var head = document.querySelector("head");
15373
15373
  !head ? process.env.NODE_ENV !== "production" ? invariant$3(false, "Cannot find the head to append a style to") : invariant$3() : void 0;
@@ -15397,7 +15397,7 @@ function useStyleMarshal(contextId, nonce) {
15397
15397
  !el2 ? process.env.NODE_ENV !== "production" ? invariant$3(false, "Cannot set dynamic style element if it is not set") : invariant$3() : void 0;
15398
15398
  el2.textContent = proposed;
15399
15399
  }, []);
15400
- useIsomorphicLayoutEffect$5(function() {
15400
+ useIsomorphicLayoutEffect$4(function() {
15401
15401
  !(!alwaysRef.current && !dynamicRef.current) ? process.env.NODE_ENV !== "production" ? invariant$3(false, "style elements already mounted") : invariant$3() : void 0;
15402
15402
  var always = createStyleEl(nonce);
15403
15403
  var dynamic = createStyleEl(nonce);
@@ -15527,7 +15527,7 @@ function useFocusMarshal(contextId) {
15527
15527
  }
15528
15528
  recordRef.current = id2;
15529
15529
  }, []);
15530
- useIsomorphicLayoutEffect$5(function() {
15530
+ useIsomorphicLayoutEffect$4(function() {
15531
15531
  isMountedRef.current = true;
15532
15532
  return function clearFrameOnUnmount() {
15533
15533
  isMountedRef.current = false;
@@ -16144,7 +16144,7 @@ function useMouseSensor(api) {
16144
16144
  };
16145
16145
  bindCapturingEvents();
16146
16146
  }, [bindCapturingEvents]);
16147
- useIsomorphicLayoutEffect$5(function mount() {
16147
+ useIsomorphicLayoutEffect$4(function mount() {
16148
16148
  listenForCapture();
16149
16149
  return function unmount() {
16150
16150
  unbindEventsRef.current();
@@ -16275,7 +16275,7 @@ function useKeyboardSensor(api) {
16275
16275
  };
16276
16276
  unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);
16277
16277
  }, [startCaptureBinding]);
16278
- useIsomorphicLayoutEffect$5(function mount() {
16278
+ useIsomorphicLayoutEffect$4(function mount() {
16279
16279
  listenForCapture();
16280
16280
  return function unmount() {
16281
16281
  unbindEventsRef.current();
@@ -16504,7 +16504,7 @@ function useTouchSensor(api) {
16504
16504
  });
16505
16505
  bindCapturingEvents();
16506
16506
  }, [bindCapturingEvents, getPhase, setPhase, startDragging]);
16507
- useIsomorphicLayoutEffect$5(function mount() {
16507
+ useIsomorphicLayoutEffect$4(function mount() {
16508
16508
  listenForCapture();
16509
16509
  return function unmount() {
16510
16510
  unbindEventsRef.current();
@@ -16515,7 +16515,7 @@ function useTouchSensor(api) {
16515
16515
  }
16516
16516
  };
16517
16517
  }, [getPhase, listenForCapture, setPhase]);
16518
- useIsomorphicLayoutEffect$5(function webkitHack() {
16518
+ useIsomorphicLayoutEffect$4(function webkitHack() {
16519
16519
  var unbind = bindEvents(window, [{
16520
16520
  eventName: "touchmove",
16521
16521
  fn: function fn() {
@@ -16862,7 +16862,7 @@ function useSensorMarshal(_ref4) {
16862
16862
  lockAPI.tryAbandon();
16863
16863
  }
16864
16864
  }, [lockAPI]);
16865
- useIsomorphicLayoutEffect$5(function listenToStore() {
16865
+ useIsomorphicLayoutEffect$4(function listenToStore() {
16866
16866
  var previous = store.getState();
16867
16867
  var unsubscribe = store.subscribe(function() {
16868
16868
  var current = store.getState();
@@ -16871,7 +16871,7 @@ function useSensorMarshal(_ref4) {
16871
16871
  });
16872
16872
  return unsubscribe;
16873
16873
  }, [lockAPI, store, tryAbandonLock]);
16874
- useIsomorphicLayoutEffect$5(function() {
16874
+ useIsomorphicLayoutEffect$4(function() {
16875
16875
  return lockAPI.tryAbandon;
16876
16876
  }, [lockAPI.tryAbandon]);
16877
16877
  var canGetLock = useCallback(function(draggableId) {
@@ -17412,7 +17412,7 @@ function useDroppablePublisher(args) {
17412
17412
  callbacks: callbacks2
17413
17413
  };
17414
17414
  }, [callbacks2, descriptor, uniqueId3]);
17415
- useIsomorphicLayoutEffect$5(function() {
17415
+ useIsomorphicLayoutEffect$4(function() {
17416
17416
  publishedDescriptorRef.current = entry.descriptor;
17417
17417
  registry.droppable.register(entry);
17418
17418
  return function() {
@@ -17423,13 +17423,13 @@ function useDroppablePublisher(args) {
17423
17423
  registry.droppable.unregister(entry);
17424
17424
  };
17425
17425
  }, [callbacks2, descriptor, dragStopped, entry, marshal, registry.droppable]);
17426
- useIsomorphicLayoutEffect$5(function() {
17426
+ useIsomorphicLayoutEffect$4(function() {
17427
17427
  if (!whileDraggingRef.current) {
17428
17428
  return;
17429
17429
  }
17430
17430
  marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled);
17431
17431
  }, [args.isDropDisabled, marshal]);
17432
- useIsomorphicLayoutEffect$5(function() {
17432
+ useIsomorphicLayoutEffect$4(function() {
17433
17433
  if (!whileDraggingRef.current) {
17434
17434
  return;
17435
17435
  }
@@ -17757,13 +17757,13 @@ function useDraggablePublisher(args) {
17757
17757
  }, [descriptor, getDimension2, options, uniqueId3]);
17758
17758
  var publishedRef = useRef(entry);
17759
17759
  var isFirstPublishRef = useRef(true);
17760
- useIsomorphicLayoutEffect$5(function() {
17760
+ useIsomorphicLayoutEffect$4(function() {
17761
17761
  registry.draggable.register(publishedRef.current);
17762
17762
  return function() {
17763
17763
  return registry.draggable.unregister(publishedRef.current);
17764
17764
  };
17765
17765
  }, [registry.draggable]);
17766
- useIsomorphicLayoutEffect$5(function() {
17766
+ useIsomorphicLayoutEffect$4(function() {
17767
17767
  if (isFirstPublishRef.current) {
17768
17768
  isFirstPublishRef.current = false;
17769
17769
  return;
@@ -18340,755 +18340,343 @@ var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, nu
18340
18340
  areStatePropsEqual: isStrictEqual
18341
18341
  })(Droppable);
18342
18342
  ConnectedDroppable.defaultProps = defaultProps;
18343
- function memo(getDeps, fn, opts) {
18344
- let deps = opts.initialDeps ?? [];
18345
- let result;
18346
- return () => {
18347
- var _a2, _b, _c, _d;
18348
- let depTime;
18349
- if (opts.key && ((_a2 = opts.debug) == null ? void 0 : _a2.call(opts))) depTime = Date.now();
18350
- const newDeps = getDeps();
18351
- const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index2) => deps[index2] !== dep);
18352
- if (!depsChanged) {
18353
- return result;
18354
- }
18355
- deps = newDeps;
18356
- let resultTime;
18357
- if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
18358
- result = fn(...newDeps);
18359
- if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
18360
- const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
18361
- const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
18362
- const resultFpsPercentage = resultEndTime / 16;
18363
- const pad = (str, num) => {
18364
- str = String(str);
18365
- while (str.length < num) {
18366
- str = " " + str;
18367
- }
18368
- return str;
18369
- };
18370
- console.info(
18371
- `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
18372
- `
18373
- font-size: .6rem;
18374
- font-weight: bold;
18375
- color: hsl(${Math.max(
18376
- 0,
18377
- Math.min(120 - 120 * resultFpsPercentage, 120)
18378
- )}deg 100% 31%);`,
18379
- opts == null ? void 0 : opts.key
18380
- );
18381
- }
18382
- (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
18383
- return result;
18343
+ /*! *****************************************************************************
18344
+ Copyright (c) Microsoft Corporation. All rights reserved.
18345
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
18346
+ this file except in compliance with the License. You may obtain a copy of the
18347
+ License at http://www.apache.org/licenses/LICENSE-2.0
18348
+
18349
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18350
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
18351
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18352
+ MERCHANTABLITY OR NON-INFRINGEMENT.
18353
+
18354
+ See the Apache Version 2.0 License for specific language governing permissions
18355
+ and limitations under the License.
18356
+ ***************************************************************************** */
18357
+ var extendStatics = function(d2, b2) {
18358
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
18359
+ d3.__proto__ = b3;
18360
+ } || function(d3, b3) {
18361
+ for (var p in b3) if (b3.hasOwnProperty(p)) d3[p] = b3[p];
18384
18362
  };
18385
- }
18386
- function notUndefined(value, msg2) {
18387
- if (value === void 0) {
18388
- throw new Error(`Unexpected undefined${""}`);
18389
- } else {
18390
- return value;
18363
+ return extendStatics(d2, b2);
18364
+ };
18365
+ function __extends(d2, b2) {
18366
+ extendStatics(d2, b2);
18367
+ function __() {
18368
+ this.constructor = d2;
18391
18369
  }
18370
+ d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
18392
18371
  }
18393
- const approxEqual = (a2, b2) => Math.abs(a2 - b2) < 1;
18394
- const debounce$2 = (targetWindow, fn, ms2) => {
18395
- let timeoutId;
18396
- return function(...args) {
18397
- targetWindow.clearTimeout(timeoutId);
18398
- timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms2);
18372
+ var __assign$1 = function() {
18373
+ __assign$1 = Object.assign || function __assign2(t) {
18374
+ for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
18375
+ s = arguments[i];
18376
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
18377
+ }
18378
+ return t;
18399
18379
  };
18380
+ return __assign$1.apply(this, arguments);
18400
18381
  };
18401
- const defaultKeyExtractor = (index2) => index2;
18402
- const defaultRangeExtractor = (range2) => {
18403
- const start3 = Math.max(range2.startIndex - range2.overscan, 0);
18404
- const end2 = Math.min(range2.endIndex + range2.overscan, range2.count - 1);
18405
- const arr = [];
18406
- for (let i = start3; i <= end2; i++) {
18407
- arr.push(i);
18408
- }
18409
- return arr;
18410
- };
18411
- const observeElementRect = (instance, cb2) => {
18412
- const element = instance.scrollElement;
18413
- if (!element) {
18414
- return;
18382
+ function throttle$1(delay, noTrailing, callback, debounceMode) {
18383
+ var timeoutID;
18384
+ var cancelled = false;
18385
+ var lastExec = 0;
18386
+ function clearExistingTimeout() {
18387
+ if (timeoutID) {
18388
+ clearTimeout(timeoutID);
18389
+ }
18415
18390
  }
18416
- const targetWindow = instance.targetWindow;
18417
- if (!targetWindow) {
18418
- return;
18391
+ function cancel() {
18392
+ clearExistingTimeout();
18393
+ cancelled = true;
18419
18394
  }
18420
- const handler = (rect) => {
18421
- const { width: width2, height: height2 } = rect;
18422
- cb2({ width: Math.round(width2), height: Math.round(height2) });
18423
- };
18424
- handler(element.getBoundingClientRect());
18425
- if (!targetWindow.ResizeObserver) {
18426
- return () => {
18427
- };
18395
+ if (typeof noTrailing !== "boolean") {
18396
+ debounceMode = callback;
18397
+ callback = noTrailing;
18398
+ noTrailing = void 0;
18428
18399
  }
18429
- const observer = new targetWindow.ResizeObserver((entries2) => {
18430
- const entry = entries2[0];
18431
- if (entry == null ? void 0 : entry.borderBoxSize) {
18432
- const box = entry.borderBoxSize[0];
18433
- if (box) {
18434
- handler({ width: box.inlineSize, height: box.blockSize });
18435
- return;
18436
- }
18400
+ function wrapper2() {
18401
+ var self2 = this;
18402
+ var elapsed = Date.now() - lastExec;
18403
+ var args = arguments;
18404
+ if (cancelled) {
18405
+ return;
18437
18406
  }
18438
- handler(element.getBoundingClientRect());
18439
- });
18440
- observer.observe(element, { box: "border-box" });
18441
- return () => {
18442
- observer.unobserve(element);
18443
- };
18444
- };
18445
- const addEventListenerOptions = {
18446
- passive: true
18447
- };
18448
- const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
18449
- const observeElementOffset = (instance, cb2) => {
18450
- const element = instance.scrollElement;
18451
- if (!element) {
18452
- return;
18453
- }
18454
- const targetWindow = instance.targetWindow;
18455
- if (!targetWindow) {
18456
- return;
18457
- }
18458
- let offset3 = 0;
18459
- const fallback = supportsScrollend ? () => void 0 : debounce$2(
18460
- targetWindow,
18461
- () => {
18462
- cb2(offset3, false);
18463
- },
18464
- instance.options.isScrollingResetDelay
18465
- );
18466
- const createHandler = (isScrolling) => () => {
18467
- const { horizontal: horizontal2, isRtl } = instance.options;
18468
- offset3 = horizontal2 ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"];
18469
- fallback();
18470
- cb2(offset3, isScrolling);
18471
- };
18472
- const handler = createHandler(true);
18473
- const endHandler = createHandler(false);
18474
- endHandler();
18475
- element.addEventListener("scroll", handler, addEventListenerOptions);
18476
- element.addEventListener("scrollend", endHandler, addEventListenerOptions);
18477
- return () => {
18478
- element.removeEventListener("scroll", handler);
18479
- element.removeEventListener("scrollend", endHandler);
18480
- };
18481
- };
18482
- const measureElement = (element, entry, instance) => {
18483
- if (entry == null ? void 0 : entry.borderBoxSize) {
18484
- const box = entry.borderBoxSize[0];
18485
- if (box) {
18486
- const size2 = Math.round(
18487
- box[instance.options.horizontal ? "inlineSize" : "blockSize"]
18488
- );
18489
- return size2;
18407
+ function exec() {
18408
+ lastExec = Date.now();
18409
+ callback.apply(self2, args);
18410
+ }
18411
+ function clear() {
18412
+ timeoutID = void 0;
18413
+ }
18414
+ if (debounceMode && !timeoutID) {
18415
+ exec();
18416
+ }
18417
+ clearExistingTimeout();
18418
+ if (debounceMode === void 0 && elapsed > delay) {
18419
+ exec();
18420
+ } else if (noTrailing !== true) {
18421
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
18490
18422
  }
18491
18423
  }
18492
- return Math.round(
18493
- element.getBoundingClientRect()[instance.options.horizontal ? "width" : "height"]
18494
- );
18424
+ wrapper2.cancel = cancel;
18425
+ return wrapper2;
18426
+ }
18427
+ var ThresholdUnits = {
18428
+ Pixel: "Pixel",
18429
+ Percent: "Percent"
18495
18430
  };
18496
- const elementScroll = (offset3, {
18497
- adjustments = 0,
18498
- behavior
18499
- }, instance) => {
18500
- var _a2, _b;
18501
- const toOffset = offset3 + adjustments;
18502
- (_b = (_a2 = instance.scrollElement) == null ? void 0 : _a2.scrollTo) == null ? void 0 : _b.call(_a2, {
18503
- [instance.options.horizontal ? "left" : "top"]: toOffset,
18504
- behavior
18505
- });
18431
+ var defaultThreshold = {
18432
+ unit: ThresholdUnits.Percent,
18433
+ value: 0.8
18506
18434
  };
18507
- class Virtualizer {
18508
- constructor(opts) {
18509
- this.unsubs = [];
18510
- this.scrollElement = null;
18511
- this.targetWindow = null;
18512
- this.isScrolling = false;
18513
- this.scrollToIndexTimeoutId = null;
18514
- this.measurementsCache = [];
18515
- this.itemSizeCache = /* @__PURE__ */ new Map();
18516
- this.pendingMeasuredCacheIndexes = [];
18517
- this.scrollRect = null;
18518
- this.scrollOffset = null;
18519
- this.scrollDirection = null;
18520
- this.scrollAdjustments = 0;
18521
- this.elementsCache = /* @__PURE__ */ new Map();
18522
- this.observer = /* @__PURE__ */ (() => {
18523
- let _ro = null;
18524
- const get4 = () => {
18525
- if (_ro) {
18526
- return _ro;
18527
- }
18528
- if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
18529
- return null;
18530
- }
18531
- return _ro = new this.targetWindow.ResizeObserver((entries2) => {
18532
- entries2.forEach((entry) => {
18533
- this._measureElement(entry.target, entry);
18534
- });
18535
- });
18536
- };
18435
+ function parseThreshold(scrollThreshold) {
18436
+ if (typeof scrollThreshold === "number") {
18437
+ return {
18438
+ unit: ThresholdUnits.Percent,
18439
+ value: scrollThreshold * 100
18440
+ };
18441
+ }
18442
+ if (typeof scrollThreshold === "string") {
18443
+ if (scrollThreshold.match(/^(\d*(\.\d+)?)px$/)) {
18537
18444
  return {
18538
- disconnect: () => {
18539
- var _a2;
18540
- return (_a2 = get4()) == null ? void 0 : _a2.disconnect();
18541
- },
18542
- observe: (target) => {
18543
- var _a2;
18544
- return (_a2 = get4()) == null ? void 0 : _a2.observe(target, { box: "border-box" });
18545
- },
18546
- unobserve: (target) => {
18547
- var _a2;
18548
- return (_a2 = get4()) == null ? void 0 : _a2.unobserve(target);
18549
- }
18445
+ unit: ThresholdUnits.Pixel,
18446
+ value: parseFloat(scrollThreshold)
18550
18447
  };
18551
- })();
18552
- this.range = null;
18553
- this.setOptions = (opts2) => {
18554
- Object.entries(opts2).forEach(([key2, value]) => {
18555
- if (typeof value === "undefined") delete opts2[key2];
18556
- });
18557
- this.options = {
18558
- debug: false,
18559
- initialOffset: 0,
18560
- overscan: 1,
18561
- paddingStart: 0,
18562
- paddingEnd: 0,
18563
- scrollPaddingStart: 0,
18564
- scrollPaddingEnd: 0,
18565
- horizontal: false,
18566
- getItemKey: defaultKeyExtractor,
18567
- rangeExtractor: defaultRangeExtractor,
18568
- onChange: () => {
18569
- },
18570
- measureElement,
18571
- initialRect: { width: 0, height: 0 },
18572
- scrollMargin: 0,
18573
- gap: 0,
18574
- indexAttribute: "data-index",
18575
- initialMeasurementsCache: [],
18576
- lanes: 1,
18577
- isScrollingResetDelay: 150,
18578
- enabled: true,
18579
- isRtl: false,
18580
- ...opts2
18448
+ }
18449
+ if (scrollThreshold.match(/^(\d*(\.\d+)?)%$/)) {
18450
+ return {
18451
+ unit: ThresholdUnits.Percent,
18452
+ value: parseFloat(scrollThreshold)
18581
18453
  };
18582
- };
18583
- this.notify = (sync2) => {
18584
- var _a2, _b;
18585
- (_b = (_a2 = this.options).onChange) == null ? void 0 : _b.call(_a2, this, sync2);
18586
- };
18587
- this.maybeNotify = memo(
18588
- () => {
18589
- this.calculateRange();
18590
- return [
18591
- this.isScrolling,
18592
- this.range ? this.range.startIndex : null,
18593
- this.range ? this.range.endIndex : null
18594
- ];
18595
- },
18596
- (isScrolling) => {
18597
- this.notify(isScrolling);
18598
- },
18599
- {
18600
- key: process.env.NODE_ENV !== "production" && "maybeNotify",
18601
- debug: () => this.options.debug,
18602
- initialDeps: [
18603
- this.isScrolling,
18604
- this.range ? this.range.startIndex : null,
18605
- this.range ? this.range.endIndex : null
18606
- ]
18607
- }
18608
- );
18609
- this.cleanup = () => {
18610
- this.unsubs.filter(Boolean).forEach((d2) => d2());
18611
- this.unsubs = [];
18612
- this.scrollElement = null;
18613
- this.targetWindow = null;
18614
- this.observer.disconnect();
18615
- this.elementsCache.clear();
18616
- };
18617
- this._didMount = () => {
18618
- return () => {
18619
- this.cleanup();
18454
+ }
18455
+ console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...');
18456
+ return defaultThreshold;
18457
+ }
18458
+ console.warn("scrollThreshold should be string or number");
18459
+ return defaultThreshold;
18460
+ }
18461
+ var InfiniteScroll = (
18462
+ /** @class */
18463
+ function(_super) {
18464
+ __extends(InfiniteScroll2, _super);
18465
+ function InfiniteScroll2(props) {
18466
+ var _this = _super.call(this, props) || this;
18467
+ _this.lastScrollTop = 0;
18468
+ _this.actionTriggered = false;
18469
+ _this.startY = 0;
18470
+ _this.currentY = 0;
18471
+ _this.dragging = false;
18472
+ _this.maxPullDownDistance = 0;
18473
+ _this.getScrollableTarget = function() {
18474
+ if (_this.props.scrollableTarget instanceof HTMLElement)
18475
+ return _this.props.scrollableTarget;
18476
+ if (typeof _this.props.scrollableTarget === "string") {
18477
+ return document.getElementById(_this.props.scrollableTarget);
18478
+ }
18479
+ if (_this.props.scrollableTarget === null) {
18480
+ console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n ");
18481
+ }
18482
+ return null;
18620
18483
  };
18621
- };
18622
- this._willUpdate = () => {
18623
- var _a2;
18624
- const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
18625
- if (this.scrollElement !== scrollElement) {
18626
- this.cleanup();
18627
- if (!scrollElement) {
18628
- this.maybeNotify();
18484
+ _this.onStart = function(evt) {
18485
+ if (_this.lastScrollTop)
18629
18486
  return;
18487
+ _this.dragging = true;
18488
+ if (evt instanceof MouseEvent) {
18489
+ _this.startY = evt.pageY;
18490
+ } else if (evt instanceof TouchEvent) {
18491
+ _this.startY = evt.touches[0].pageY;
18630
18492
  }
18631
- this.scrollElement = scrollElement;
18632
- if (this.scrollElement && "ownerDocument" in this.scrollElement) {
18633
- this.targetWindow = this.scrollElement.ownerDocument.defaultView;
18634
- } else {
18635
- this.targetWindow = ((_a2 = this.scrollElement) == null ? void 0 : _a2.window) ?? null;
18493
+ _this.currentY = _this.startY;
18494
+ if (_this._infScroll) {
18495
+ _this._infScroll.style.willChange = "transform";
18496
+ _this._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
18636
18497
  }
18637
- this._scrollToOffset(this.getScrollOffset(), {
18638
- adjustments: void 0,
18639
- behavior: void 0
18640
- });
18641
- this.unsubs.push(
18642
- this.options.observeElementRect(this, (rect) => {
18643
- this.scrollRect = rect;
18644
- this.maybeNotify();
18645
- })
18646
- );
18647
- this.unsubs.push(
18648
- this.options.observeElementOffset(this, (offset3, isScrolling) => {
18649
- this.scrollAdjustments = 0;
18650
- this.scrollDirection = isScrolling ? this.getScrollOffset() < offset3 ? "forward" : "backward" : null;
18651
- this.scrollOffset = offset3;
18652
- this.isScrolling = isScrolling;
18653
- this.maybeNotify();
18654
- })
18655
- );
18656
- }
18657
- };
18658
- this.getSize = () => {
18659
- if (!this.options.enabled) {
18660
- this.scrollRect = null;
18661
- return 0;
18662
- }
18663
- this.scrollRect = this.scrollRect ?? this.options.initialRect;
18664
- return this.scrollRect[this.options.horizontal ? "width" : "height"];
18665
- };
18666
- this.getScrollOffset = () => {
18667
- if (!this.options.enabled) {
18668
- this.scrollOffset = null;
18669
- return 0;
18670
- }
18671
- this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
18672
- return this.scrollOffset;
18673
- };
18674
- this.getFurthestMeasurement = (measurements, index2) => {
18675
- const furthestMeasurementsFound = /* @__PURE__ */ new Map();
18676
- const furthestMeasurements = /* @__PURE__ */ new Map();
18677
- for (let m2 = index2 - 1; m2 >= 0; m2--) {
18678
- const measurement = measurements[m2];
18679
- if (furthestMeasurementsFound.has(measurement.lane)) {
18680
- continue;
18681
- }
18682
- const previousFurthestMeasurement = furthestMeasurements.get(
18683
- measurement.lane
18684
- );
18685
- if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
18686
- furthestMeasurements.set(measurement.lane, measurement);
18687
- } else if (measurement.end < previousFurthestMeasurement.end) {
18688
- furthestMeasurementsFound.set(measurement.lane, true);
18689
- }
18690
- if (furthestMeasurementsFound.size === this.options.lanes) {
18691
- break;
18692
- }
18693
- }
18694
- return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a2, b2) => {
18695
- if (a2.end === b2.end) {
18696
- return a2.index - b2.index;
18498
+ };
18499
+ _this.onMove = function(evt) {
18500
+ if (!_this.dragging)
18501
+ return;
18502
+ if (evt instanceof MouseEvent) {
18503
+ _this.currentY = evt.pageY;
18504
+ } else if (evt instanceof TouchEvent) {
18505
+ _this.currentY = evt.touches[0].pageY;
18697
18506
  }
18698
- return a2.end - b2.end;
18699
- })[0] : void 0;
18700
- };
18701
- this.getMeasurementOptions = memo(
18702
- () => [
18703
- this.options.count,
18704
- this.options.paddingStart,
18705
- this.options.scrollMargin,
18706
- this.options.getItemKey,
18707
- this.options.enabled
18708
- ],
18709
- (count2, paddingStart, scrollMargin, getItemKey, enabled) => {
18710
- this.pendingMeasuredCacheIndexes = [];
18711
- return {
18712
- count: count2,
18713
- paddingStart,
18714
- scrollMargin,
18715
- getItemKey,
18716
- enabled
18717
- };
18718
- },
18719
- {
18720
- key: false
18721
- }
18722
- );
18723
- this.getMeasurements = memo(
18724
- () => [this.getMeasurementOptions(), this.itemSizeCache],
18725
- ({ count: count2, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
18726
- if (!enabled) {
18727
- this.measurementsCache = [];
18728
- this.itemSizeCache.clear();
18729
- return [];
18730
- }
18731
- if (this.measurementsCache.length === 0) {
18732
- this.measurementsCache = this.options.initialMeasurementsCache;
18733
- this.measurementsCache.forEach((item2) => {
18734
- this.itemSizeCache.set(item2.key, item2.size);
18507
+ if (_this.currentY < _this.startY)
18508
+ return;
18509
+ if (_this.currentY - _this.startY >= Number(_this.props.pullDownToRefreshThreshold)) {
18510
+ _this.setState({
18511
+ pullToRefreshThresholdBreached: true
18735
18512
  });
18736
18513
  }
18737
- const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
18738
- this.pendingMeasuredCacheIndexes = [];
18739
- const measurements = this.measurementsCache.slice(0, min);
18740
- for (let i = min; i < count2; i++) {
18741
- const key2 = getItemKey(i);
18742
- const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
18743
- const start3 = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
18744
- const measuredSize = itemSizeCache.get(key2);
18745
- const size2 = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
18746
- const end2 = start3 + size2;
18747
- const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
18748
- measurements[i] = {
18749
- index: i,
18750
- start: start3,
18751
- size: size2,
18752
- end: end2,
18753
- key: key2,
18754
- lane
18755
- };
18756
- }
18757
- this.measurementsCache = measurements;
18758
- return measurements;
18759
- },
18760
- {
18761
- key: process.env.NODE_ENV !== "production" && "getMeasurements",
18762
- debug: () => this.options.debug
18763
- }
18764
- );
18765
- this.calculateRange = memo(
18766
- () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
18767
- (measurements, outerSize, scrollOffset) => {
18768
- return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
18769
- measurements,
18770
- outerSize,
18771
- scrollOffset
18772
- }) : null;
18773
- },
18774
- {
18775
- key: process.env.NODE_ENV !== "production" && "calculateRange",
18776
- debug: () => this.options.debug
18777
- }
18778
- );
18779
- this.getIndexes = memo(
18780
- () => [
18781
- this.options.rangeExtractor,
18782
- this.calculateRange(),
18783
- this.options.overscan,
18784
- this.options.count
18785
- ],
18786
- (rangeExtractor, range2, overscan, count2) => {
18787
- return range2 === null ? [] : rangeExtractor({
18788
- startIndex: range2.startIndex,
18789
- endIndex: range2.endIndex,
18790
- overscan,
18791
- count: count2
18792
- });
18793
- },
18794
- {
18795
- key: process.env.NODE_ENV !== "production" && "getIndexes",
18796
- debug: () => this.options.debug
18797
- }
18798
- );
18799
- this.indexFromElement = (node2) => {
18800
- const attributeName = this.options.indexAttribute;
18801
- const indexStr = node2.getAttribute(attributeName);
18802
- if (!indexStr) {
18803
- console.warn(
18804
- `Missing attribute name '${attributeName}={index}' on measured element.`
18805
- );
18806
- return -1;
18807
- }
18808
- return parseInt(indexStr, 10);
18809
- };
18810
- this._measureElement = (node2, entry) => {
18811
- const index2 = this.indexFromElement(node2);
18812
- const item2 = this.measurementsCache[index2];
18813
- if (!item2) {
18814
- return;
18815
- }
18816
- const key2 = item2.key;
18817
- const prevNode = this.elementsCache.get(key2);
18818
- if (prevNode !== node2) {
18819
- if (prevNode) {
18820
- this.observer.unobserve(prevNode);
18514
+ if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)
18515
+ return;
18516
+ if (_this._infScroll) {
18517
+ _this._infScroll.style.overflow = "visible";
18518
+ _this._infScroll.style.transform = "translate3d(0px, " + (_this.currentY - _this.startY) + "px, 0px)";
18821
18519
  }
18822
- this.observer.observe(node2);
18823
- this.elementsCache.set(key2, node2);
18824
- }
18825
- if (node2.isConnected) {
18826
- this.resizeItem(index2, this.options.measureElement(node2, entry, this));
18827
- }
18828
- };
18829
- this.resizeItem = (index2, size2) => {
18830
- const item2 = this.measurementsCache[index2];
18831
- if (!item2) {
18832
- return;
18833
- }
18834
- const itemSize = this.itemSizeCache.get(item2.key) ?? item2.size;
18835
- const delta = size2 - itemSize;
18836
- if (delta !== 0) {
18837
- if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item2, delta, this) : item2.start < this.getScrollOffset() + this.scrollAdjustments) {
18838
- if (process.env.NODE_ENV !== "production" && this.options.debug) {
18839
- console.info("correction", delta);
18840
- }
18841
- this._scrollToOffset(this.getScrollOffset(), {
18842
- adjustments: this.scrollAdjustments += delta,
18843
- behavior: void 0
18520
+ };
18521
+ _this.onEnd = function() {
18522
+ _this.startY = 0;
18523
+ _this.currentY = 0;
18524
+ _this.dragging = false;
18525
+ if (_this.state.pullToRefreshThresholdBreached) {
18526
+ _this.props.refreshFunction && _this.props.refreshFunction();
18527
+ _this.setState({
18528
+ pullToRefreshThresholdBreached: false
18844
18529
  });
18845
18530
  }
18846
- this.pendingMeasuredCacheIndexes.push(item2.index);
18847
- this.itemSizeCache = new Map(this.itemSizeCache.set(item2.key, size2));
18848
- this.notify(false);
18849
- }
18850
- };
18851
- this.measureElement = (node2) => {
18852
- if (!node2) {
18853
- this.elementsCache.forEach((cached, key2) => {
18854
- if (!cached.isConnected) {
18855
- this.observer.unobserve(cached);
18856
- this.elementsCache.delete(key2);
18531
+ requestAnimationFrame(function() {
18532
+ if (_this._infScroll) {
18533
+ _this._infScroll.style.overflow = "auto";
18534
+ _this._infScroll.style.transform = "none";
18535
+ _this._infScroll.style.willChange = "unset";
18857
18536
  }
18858
18537
  });
18859
- return;
18860
- }
18861
- this._measureElement(node2, void 0);
18862
- };
18863
- this.getVirtualItems = memo(
18864
- () => [this.getIndexes(), this.getMeasurements()],
18865
- (indexes, measurements) => {
18866
- const virtualItems = [];
18867
- for (let k2 = 0, len = indexes.length; k2 < len; k2++) {
18868
- const i = indexes[k2];
18869
- const measurement = measurements[i];
18870
- virtualItems.push(measurement);
18871
- }
18872
- return virtualItems;
18873
- },
18874
- {
18875
- key: process.env.NODE_ENV !== "production" && "getVirtualItems",
18876
- debug: () => this.options.debug
18877
- }
18878
- );
18879
- this.getVirtualItemForOffset = (offset3) => {
18880
- const measurements = this.getMeasurements();
18881
- if (measurements.length === 0) {
18882
- return void 0;
18883
- }
18884
- return notUndefined(
18885
- measurements[findNearestBinarySearch(
18886
- 0,
18887
- measurements.length - 1,
18888
- (index2) => notUndefined(measurements[index2]).start,
18889
- offset3
18890
- )]
18891
- );
18892
- };
18893
- this.getOffsetForAlignment = (toOffset, align) => {
18894
- const size2 = this.getSize();
18895
- const scrollOffset = this.getScrollOffset();
18896
- if (align === "auto") {
18897
- if (toOffset <= scrollOffset) {
18898
- align = "start";
18899
- } else if (toOffset >= scrollOffset + size2) {
18900
- align = "end";
18901
- } else {
18902
- align = "start";
18538
+ };
18539
+ _this.onScrollListener = function(event) {
18540
+ if (typeof _this.props.onScroll === "function") {
18541
+ setTimeout(function() {
18542
+ return _this.props.onScroll && _this.props.onScroll(event);
18543
+ }, 0);
18544
+ }
18545
+ var target = _this.props.height || _this._scrollableNode ? event.target : document.documentElement.scrollTop ? document.documentElement : document.body;
18546
+ if (_this.actionTriggered)
18547
+ return;
18548
+ var atBottom = _this.props.inverse ? _this.isElementAtTop(target, _this.props.scrollThreshold) : _this.isElementAtBottom(target, _this.props.scrollThreshold);
18549
+ if (atBottom && _this.props.hasMore) {
18550
+ _this.actionTriggered = true;
18551
+ _this.setState({ showLoader: true });
18552
+ _this.props.next && _this.props.next();
18553
+ }
18554
+ _this.lastScrollTop = target.scrollTop;
18555
+ };
18556
+ _this.state = {
18557
+ showLoader: false,
18558
+ pullToRefreshThresholdBreached: false,
18559
+ prevDataLength: props.dataLength
18560
+ };
18561
+ _this.throttledOnScrollListener = throttle$1(150, _this.onScrollListener).bind(_this);
18562
+ _this.onStart = _this.onStart.bind(_this);
18563
+ _this.onMove = _this.onMove.bind(_this);
18564
+ _this.onEnd = _this.onEnd.bind(_this);
18565
+ return _this;
18566
+ }
18567
+ InfiniteScroll2.prototype.componentDidMount = function() {
18568
+ if (typeof this.props.dataLength === "undefined") {
18569
+ throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');
18570
+ }
18571
+ this._scrollableNode = this.getScrollableTarget();
18572
+ this.el = this.props.height ? this._infScroll : this._scrollableNode || window;
18573
+ if (this.el) {
18574
+ this.el.addEventListener("scroll", this.throttledOnScrollListener);
18575
+ }
18576
+ if (typeof this.props.initialScrollY === "number" && this.el && this.el instanceof HTMLElement && this.el.scrollHeight > this.props.initialScrollY) {
18577
+ this.el.scrollTo(0, this.props.initialScrollY);
18578
+ }
18579
+ if (this.props.pullDownToRefresh && this.el) {
18580
+ this.el.addEventListener("touchstart", this.onStart);
18581
+ this.el.addEventListener("touchmove", this.onMove);
18582
+ this.el.addEventListener("touchend", this.onEnd);
18583
+ this.el.addEventListener("mousedown", this.onStart);
18584
+ this.el.addEventListener("mousemove", this.onMove);
18585
+ this.el.addEventListener("mouseup", this.onEnd);
18586
+ this.maxPullDownDistance = this._pullDown && this._pullDown.firstChild && this._pullDown.firstChild.getBoundingClientRect().height || 0;
18587
+ this.forceUpdate();
18588
+ if (typeof this.props.refreshFunction !== "function") {
18589
+ throw new Error(`Mandatory prop "refreshFunction" missing.
18590
+ Pull Down To Refresh functionality will not work
18591
+ as expected. Check README.md for usage'`);
18903
18592
  }
18904
18593
  }
18905
- if (align === "start") {
18906
- toOffset = toOffset;
18907
- } else if (align === "end") {
18908
- toOffset = toOffset - size2;
18909
- } else if (align === "center") {
18910
- toOffset = toOffset - size2 / 2;
18911
- }
18912
- const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
18913
- const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
18914
- const maxOffset = scrollSize - size2;
18915
- return Math.max(Math.min(maxOffset, toOffset), 0);
18916
18594
  };
18917
- this.getOffsetForIndex = (index2, align = "auto") => {
18918
- index2 = Math.max(0, Math.min(index2, this.options.count - 1));
18919
- const item2 = this.measurementsCache[index2];
18920
- if (!item2) {
18921
- return void 0;
18922
- }
18923
- const size2 = this.getSize();
18924
- const scrollOffset = this.getScrollOffset();
18925
- if (align === "auto") {
18926
- if (item2.end >= scrollOffset + size2 - this.options.scrollPaddingEnd) {
18927
- align = "end";
18928
- } else if (item2.start <= scrollOffset + this.options.scrollPaddingStart) {
18929
- align = "start";
18930
- } else {
18931
- return [scrollOffset, align];
18595
+ InfiniteScroll2.prototype.componentWillUnmount = function() {
18596
+ if (this.el) {
18597
+ this.el.removeEventListener("scroll", this.throttledOnScrollListener);
18598
+ if (this.props.pullDownToRefresh) {
18599
+ this.el.removeEventListener("touchstart", this.onStart);
18600
+ this.el.removeEventListener("touchmove", this.onMove);
18601
+ this.el.removeEventListener("touchend", this.onEnd);
18602
+ this.el.removeEventListener("mousedown", this.onStart);
18603
+ this.el.removeEventListener("mousemove", this.onMove);
18604
+ this.el.removeEventListener("mouseup", this.onEnd);
18932
18605
  }
18933
18606
  }
18934
- const toOffset = align === "end" ? item2.end + this.options.scrollPaddingEnd : item2.start - this.options.scrollPaddingStart;
18935
- return [this.getOffsetForAlignment(toOffset, align), align];
18936
18607
  };
18937
- this.isDynamicMode = () => this.elementsCache.size > 0;
18938
- this.cancelScrollToIndex = () => {
18939
- if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
18940
- this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
18941
- this.scrollToIndexTimeoutId = null;
18942
- }
18608
+ InfiniteScroll2.prototype.componentDidUpdate = function(prevProps) {
18609
+ if (this.props.dataLength === prevProps.dataLength)
18610
+ return;
18611
+ this.actionTriggered = false;
18612
+ this.setState({
18613
+ showLoader: false
18614
+ });
18943
18615
  };
18944
- this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
18945
- this.cancelScrollToIndex();
18946
- if (behavior === "smooth" && this.isDynamicMode()) {
18947
- console.warn(
18948
- "The `smooth` scroll behavior is not fully supported with dynamic size."
18949
- );
18616
+ InfiniteScroll2.getDerivedStateFromProps = function(nextProps, prevState) {
18617
+ var dataLengthChanged = nextProps.dataLength !== prevState.prevDataLength;
18618
+ if (dataLengthChanged) {
18619
+ return __assign$1(__assign$1({}, prevState), { prevDataLength: nextProps.dataLength });
18950
18620
  }
18951
- this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
18952
- adjustments: void 0,
18953
- behavior
18954
- });
18621
+ return null;
18955
18622
  };
18956
- this.scrollToIndex = (index2, { align: initialAlign = "auto", behavior } = {}) => {
18957
- index2 = Math.max(0, Math.min(index2, this.options.count - 1));
18958
- this.cancelScrollToIndex();
18959
- if (behavior === "smooth" && this.isDynamicMode()) {
18960
- console.warn(
18961
- "The `smooth` scroll behavior is not fully supported with dynamic size."
18962
- );
18623
+ InfiniteScroll2.prototype.isElementAtTop = function(target, scrollThreshold) {
18624
+ if (scrollThreshold === void 0) {
18625
+ scrollThreshold = 0.8;
18963
18626
  }
18964
- const offsetAndAlign = this.getOffsetForIndex(index2, initialAlign);
18965
- if (!offsetAndAlign) return;
18966
- const [offset3, align] = offsetAndAlign;
18967
- this._scrollToOffset(offset3, { adjustments: void 0, behavior });
18968
- if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
18969
- this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
18970
- this.scrollToIndexTimeoutId = null;
18971
- const elementInDOM = this.elementsCache.has(
18972
- this.options.getItemKey(index2)
18973
- );
18974
- if (elementInDOM) {
18975
- const [latestOffset] = notUndefined(
18976
- this.getOffsetForIndex(index2, align)
18977
- );
18978
- if (!approxEqual(latestOffset, this.getScrollOffset())) {
18979
- this.scrollToIndex(index2, { align, behavior });
18980
- }
18981
- } else {
18982
- this.scrollToIndex(index2, { align, behavior });
18983
- }
18984
- });
18627
+ var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
18628
+ var threshold = parseThreshold(scrollThreshold);
18629
+ if (threshold.unit === ThresholdUnits.Pixel) {
18630
+ return target.scrollTop <= threshold.value + clientHeight - target.scrollHeight + 1;
18985
18631
  }
18632
+ return target.scrollTop <= threshold.value / 100 + clientHeight - target.scrollHeight + 1;
18986
18633
  };
18987
- this.scrollBy = (delta, { behavior } = {}) => {
18988
- this.cancelScrollToIndex();
18989
- if (behavior === "smooth" && this.isDynamicMode()) {
18990
- console.warn(
18991
- "The `smooth` scroll behavior is not fully supported with dynamic size."
18992
- );
18634
+ InfiniteScroll2.prototype.isElementAtBottom = function(target, scrollThreshold) {
18635
+ if (scrollThreshold === void 0) {
18636
+ scrollThreshold = 0.8;
18993
18637
  }
18994
- this._scrollToOffset(this.getScrollOffset() + delta, {
18995
- adjustments: void 0,
18996
- behavior
18997
- });
18998
- };
18999
- this.getTotalSize = () => {
19000
- var _a2;
19001
- const measurements = this.getMeasurements();
19002
- let end2;
19003
- if (measurements.length === 0) {
19004
- end2 = this.options.paddingStart;
19005
- } else {
19006
- end2 = this.options.lanes === 1 ? ((_a2 = measurements[measurements.length - 1]) == null ? void 0 : _a2.end) ?? 0 : Math.max(
19007
- ...measurements.slice(-this.options.lanes).map((m2) => m2.end)
19008
- );
18638
+ var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
18639
+ var threshold = parseThreshold(scrollThreshold);
18640
+ if (threshold.unit === ThresholdUnits.Pixel) {
18641
+ return target.scrollTop + clientHeight >= target.scrollHeight - threshold.value;
19009
18642
  }
19010
- return end2 - this.options.scrollMargin + this.options.paddingEnd;
19011
- };
19012
- this._scrollToOffset = (offset3, {
19013
- adjustments,
19014
- behavior
19015
- }) => {
19016
- this.options.scrollToFn(offset3, { behavior, adjustments }, this);
18643
+ return target.scrollTop + clientHeight >= threshold.value / 100 * target.scrollHeight;
19017
18644
  };
19018
- this.measure = () => {
19019
- this.itemSizeCache = /* @__PURE__ */ new Map();
19020
- this.notify(false);
18645
+ InfiniteScroll2.prototype.render = function() {
18646
+ var _this = this;
18647
+ var style2 = __assign$1({ height: this.props.height || "auto", overflow: "auto", WebkitOverflowScrolling: "touch" }, this.props.style);
18648
+ var hasChildren2 = this.props.hasChildren || !!(this.props.children && this.props.children instanceof Array && this.props.children.length);
18649
+ var outerDivStyle = this.props.pullDownToRefresh && this.props.height ? { overflow: "auto" } : {};
18650
+ return React__default.createElement(
18651
+ "div",
18652
+ { style: outerDivStyle, className: "infinite-scroll-component__outerdiv" },
18653
+ React__default.createElement(
18654
+ "div",
18655
+ { className: "infinite-scroll-component " + (this.props.className || ""), ref: function(infScroll) {
18656
+ return _this._infScroll = infScroll;
18657
+ }, style: style2 },
18658
+ this.props.pullDownToRefresh && React__default.createElement(
18659
+ "div",
18660
+ { style: { position: "relative" }, ref: function(pullDown) {
18661
+ return _this._pullDown = pullDown;
18662
+ } },
18663
+ React__default.createElement("div", { style: {
18664
+ position: "absolute",
18665
+ left: 0,
18666
+ right: 0,
18667
+ top: -1 * this.maxPullDownDistance
18668
+ } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)
18669
+ ),
18670
+ this.props.children,
18671
+ !this.state.showLoader && !hasChildren2 && this.props.hasMore && this.props.loader,
18672
+ this.state.showLoader && this.props.hasMore && this.props.loader,
18673
+ !this.props.hasMore && this.props.endMessage
18674
+ )
18675
+ );
19021
18676
  };
19022
- this.setOptions(opts);
19023
- }
19024
- }
19025
- const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
19026
- while (low <= high) {
19027
- const middle = (low + high) / 2 | 0;
19028
- const currentValue = getCurrentValue(middle);
19029
- if (currentValue < value) {
19030
- low = middle + 1;
19031
- } else if (currentValue > value) {
19032
- high = middle - 1;
19033
- } else {
19034
- return middle;
19035
- }
19036
- }
19037
- if (low > 0) {
19038
- return low - 1;
19039
- } else {
19040
- return 0;
19041
- }
19042
- };
19043
- function calculateRange({
19044
- measurements,
19045
- outerSize,
19046
- scrollOffset
19047
- }) {
19048
- const count2 = measurements.length - 1;
19049
- const getOffset2 = (index2) => measurements[index2].start;
19050
- const startIndex = findNearestBinarySearch(0, count2, getOffset2, scrollOffset);
19051
- let endIndex = startIndex;
19052
- while (endIndex < count2 && measurements[endIndex].end < scrollOffset + outerSize) {
19053
- endIndex++;
19054
- }
19055
- return { startIndex, endIndex };
19056
- }
19057
- const useIsomorphicLayoutEffect$4 = typeof document !== "undefined" ? React$4.useLayoutEffect : React$4.useEffect;
19058
- function useVirtualizerBase(options) {
19059
- const rerender = React$4.useReducer(() => ({}), {})[1];
19060
- const resolvedOptions = {
19061
- ...options,
19062
- onChange: (instance2, sync2) => {
19063
- var _a2;
19064
- if (sync2) {
19065
- flushSync$1(rerender);
19066
- } else {
19067
- rerender();
19068
- }
19069
- (_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync2);
19070
- }
19071
- };
19072
- const [instance] = React$4.useState(
19073
- () => new Virtualizer(resolvedOptions)
19074
- );
19075
- instance.setOptions(resolvedOptions);
19076
- React$4.useEffect(() => {
19077
- return instance._didMount();
19078
- }, []);
19079
- useIsomorphicLayoutEffect$4(() => {
19080
- return instance._willUpdate();
19081
- });
19082
- return instance;
19083
- }
19084
- function useVirtualizer(options) {
19085
- return useVirtualizerBase({
19086
- observeElementRect,
19087
- observeElementOffset,
19088
- scrollToFn: elementScroll,
19089
- ...options
19090
- });
19091
- }
18677
+ return InfiniteScroll2;
18678
+ }(Component$1)
18679
+ );
19092
18680
  const inputInTable$8 = "_inputInTable_1llou_1";
19093
18681
  const inputHover$8 = "_inputHover_1llou_13";
19094
18682
  const inputFocus$8 = "_inputFocus_1llou_18";
@@ -19293,264 +18881,95 @@ const getItemStyle = (draggableProps, item2) => {
19293
18881
  };
19294
18882
  };
19295
18883
  const ListRow = forwardRef(
19296
- ({ item: item2, index: index2, expanding, invokeEditOnRowClick, provided, draggable: draggable2 }, listRowRefs) => {
18884
+ ({ items, expanding, invokeEditOnRowClick, provided, draggable: draggable2 }, listRowRefs) => {
19297
18885
  const disabledContext = useContext(DisabledContext);
19298
- const listElement = (index22, provided2, item22, indent2, hasOnClick2, edit22) => {
19299
- const Component2 = item22.component || "a";
19300
- return /* @__PURE__ */ jsx(
18886
+ const listElement = (index2, provided2, item2, indent, hasOnClick, edit2) => {
18887
+ const Component2 = item2.component || "a";
18888
+ return /* @__PURE__ */ createElement(
19301
18889
  Component2,
19302
18890
  {
19303
- href: item22.url,
19304
- to: item22.url,
19305
- style: getItemStyle(provided2 == null ? void 0 : provided2.draggableProps, item22),
18891
+ href: item2.url,
18892
+ to: item2.url,
18893
+ ref: provided2 == null ? void 0 : provided2.innerRef,
18894
+ ...provided2.draggableProps,
18895
+ style: getItemStyle(provided2.draggableProps, item2),
19306
18896
  className: cx$2(
19307
18897
  listStyles.item,
19308
- item22.active ? listStyles.active : "",
19309
- item22.disabled || disabledContext ? listStyles.disabled : "",
19310
- hasOnClick2 ? listStyles.action : ""
18898
+ item2.active ? listStyles.active : "",
18899
+ item2.disabled || disabledContext ? listStyles.disabled : "",
18900
+ hasOnClick ? listStyles.action : ""
19311
18901
  ),
19312
18902
  onClick: (evt) => {
19313
- if (invokeEditOnRowClick && edit22) {
19314
- if (edit22.onClick) edit22.onClick(evt, item22.id);
18903
+ if (invokeEditOnRowClick && edit2) {
18904
+ if (edit2.onClick) edit2.onClick(evt, item2.id);
19315
18905
  }
19316
- if (item22.onClick) {
19317
- return item22.onClick(evt);
18906
+ if (item2.onClick) {
18907
+ return item2.onClick(evt);
19318
18908
  }
19319
18909
  },
19320
- "data-id": index22,
19321
- title: item22.title,
19322
- "data-testid": item22.testId,
19323
- children: /* @__PURE__ */ jsxs("div", { style: { paddingLeft: indent2 }, children: [
19324
- /* @__PURE__ */ jsxs("div", { className: listStyles.itemHeader, children: [
19325
- draggable2 && /* @__PURE__ */ jsx(
19326
- "div",
19327
- {
19328
- className: listStyles.drag,
19329
- ...provided2.dragHandleProps,
19330
- children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
19331
- }
19332
- ),
19333
- item22.level && item22.level > 0 ? /* @__PURE__ */ jsx("div", { className: listStyles.indentIcon, children: /* @__PURE__ */ jsx(Icon, { icon: IconType.INDENT }) }) : null,
19334
- /* @__PURE__ */ jsx(Label$1, { label: item22.label }),
19335
- /* @__PURE__ */ jsx(MetaContent, { item: item22 }),
19336
- /* @__PURE__ */ jsxs("div", { className: listStyles.right, children: [
19337
- /* @__PURE__ */ jsx(MetaCount, { item: item22 }),
19338
- !(item22.disabled || disabledContext) && item22.actions && /* @__PURE__ */ jsx("div", { className: listStyles.actions, children: /* @__PURE__ */ jsx(Actions, { actions: item22.actions }) })
19339
- ] })
19340
- ] }),
19341
- /* @__PURE__ */ jsx(ItemContent, { item: item22, expanding })
19342
- ] })
18910
+ key: index2,
18911
+ "data-id": index2,
18912
+ title: item2.title,
18913
+ "data-testid": item2.testId
19343
18914
  },
19344
- index22
19345
- );
19346
- };
19347
- const isSubheading = item2.type === "Heading";
19348
- const edit2 = item2.actions && item2.actions.find(
19349
- (a2) => {
19350
- var _a2;
19351
- return a2.label && ((_a2 = String(a2.label)) == null ? void 0 : _a2.toLowerCase()) === "edit";
19352
- }
19353
- );
19354
- const hasOnClick = !!(edit2 || item2.url || item2.onClick);
19355
- const indent = item2.level && item2.level > 1 ? (item2.level - 1) * 20 : 0;
19356
- return isSubheading ? /* @__PURE__ */ jsx(ListSubheading, { item: item2, index: index2 }) : listElement(index2, provided, item2, indent, hasOnClick, edit2);
19357
- }
19358
- );
19359
- const ListDroppableWrapper = ({
19360
- onListReorder,
19361
- children,
19362
- list: list2,
19363
- draggable: draggable2,
19364
- expanding
19365
- }) => {
19366
- if (!draggable2) {
19367
- return children();
19368
- }
19369
- return /* @__PURE__ */ jsx(
19370
- DragDropContext,
19371
- {
19372
- onDragEnd: (result) => {
19373
- var _a2, _b;
19374
- const from3 = (_a2 = result == null ? void 0 : result.source) == null ? void 0 : _a2.index;
19375
- const to2 = (_b = result == null ? void 0 : result.destination) == null ? void 0 : _b.index;
19376
- onListReorder({ from: from3, to: to2 });
19377
- },
19378
- children: /* @__PURE__ */ jsx(
19379
- ConnectedDroppable,
19380
- {
19381
- droppableId: "droppable",
19382
- mode: "virtual",
19383
- renderClone: (provided, snapshot, rubric) => {
19384
- return /* @__PURE__ */ jsx(
19385
- "div",
19386
- {
19387
- ...provided.draggableProps,
19388
- ref: provided.innerRef,
19389
- style: {
19390
- height: 36,
19391
- width: "100%",
19392
- display: "flex",
19393
- alignItems: "center"
19394
- },
19395
- children: /* @__PURE__ */ jsx(
19396
- ListRow,
18915
+ /* @__PURE__ */ jsxs(
18916
+ "div",
18917
+ {
18918
+ ref: (el2) => {
18919
+ if (listRowRefs && "current" in listRowRefs && Array.isArray(listRowRefs.current) && index2 !== void 0) {
18920
+ listRowRefs.current[index2] = el2;
18921
+ }
18922
+ },
18923
+ style: { paddingLeft: indent },
18924
+ children: [
18925
+ /* @__PURE__ */ jsxs("div", { className: listStyles.itemHeader, children: [
18926
+ draggable2 && /* @__PURE__ */ jsx(
18927
+ "div",
19397
18928
  {
19398
- draggable: draggable2,
19399
- item: list2.items[rubric.source.index],
19400
- expanding,
19401
- onListReorder,
19402
- index: rubric.source.index,
19403
- provided
18929
+ className: listStyles.drag,
18930
+ ...provided2.dragHandleProps,
18931
+ children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
19404
18932
  }
19405
- )
19406
- }
19407
- );
19408
- },
19409
- children: (provided) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
19410
- children(provided),
19411
- provided.placeholder
19412
- ] })
19413
- }
19414
- )
19415
- }
19416
- );
19417
- };
19418
- const List = ({
19419
- list: list2,
19420
- bordered: bordered2 = false,
19421
- expanding = false,
19422
- narrow: narrow2 = false,
19423
- toggleNarrow: toggleNarrow2 = false,
19424
- onToggleNarrow = () => {
19425
- },
19426
- invokeEditOnRowClick = true,
19427
- noHeader = false,
19428
- stickyHeader: stickyHeader2,
19429
- draggable: draggable2 = false,
19430
- onListReorder = () => {
19431
- },
19432
- marginBottom = 0,
19433
- height: height2,
19434
- testId,
19435
- scrollDetails = {
19436
- scrollable: false,
19437
- hideScrollbar: false,
19438
- triggerScrollToActiveItem: false,
19439
- infiniteScroll: false,
19440
- limit: 10,
19441
- infiniteScrollTarget: void 0
19442
- }
19443
- }) => {
19444
- const { scrollable, hideScrollbar: hideScrollbar2, triggerScrollToActiveItem } = scrollDetails;
19445
- const listContainerRef = useRef(null);
19446
- const virtualizer = useVirtualizer({
19447
- count: list2.items.length,
19448
- getScrollElement: () => listContainerRef.current,
19449
- estimateSize: () => 36,
19450
- overscan: 5
19451
- });
19452
- useEffect(() => {
19453
- if (triggerScrollToActiveItem) {
19454
- const activeItemIndex = list2.items.findIndex(
19455
- (item2) => item2.active === true
19456
- );
19457
- if (activeItemIndex !== -1) {
19458
- virtualizer.scrollToIndex(activeItemIndex, { align: "center" });
19459
- }
19460
- }
19461
- }, [list2.items, triggerScrollToActiveItem]);
19462
- const renderItem = (virtualRow, dragProvided) => {
19463
- return /* @__PURE__ */ jsx(
19464
- "div",
19465
- {
19466
- ref: dragProvided == null ? void 0 : dragProvided.innerRef,
19467
- ...dragProvided == null ? void 0 : dragProvided.draggableProps,
19468
- "data-index": virtualRow.index,
19469
- style: {
19470
- ...dragProvided == null ? void 0 : dragProvided.draggableProps.style,
19471
- position: "absolute",
19472
- top: 0,
19473
- left: 0,
19474
- width: "100%",
19475
- height: `${virtualRow.size}px`,
19476
- transform: `translateY(${virtualRow.start}px)`
19477
- },
19478
- children: /* @__PURE__ */ jsx("div", { ref: virtualizer.measureElement, "data-index": virtualRow.index, children: /* @__PURE__ */ jsx(
19479
- ListRow,
19480
- {
19481
- index: virtualRow.index,
19482
- draggable: draggable2,
19483
- item: list2.items[virtualRow.index],
19484
- expanding,
19485
- invokeEditOnRowClick,
19486
- onListReorder,
19487
- provided: dragProvided
18933
+ ),
18934
+ item2.level && item2.level > 0 ? /* @__PURE__ */ jsx("div", { className: listStyles.indentIcon, children: /* @__PURE__ */ jsx(Icon, { icon: IconType.INDENT }) }) : null,
18935
+ /* @__PURE__ */ jsx(Label$1, { label: item2.label }),
18936
+ /* @__PURE__ */ jsx(MetaContent, { item: item2 }),
18937
+ /* @__PURE__ */ jsxs("div", { className: listStyles.right, children: [
18938
+ /* @__PURE__ */ jsx(MetaCount, { item: item2 }),
18939
+ !(item2.disabled || disabledContext) && item2.actions && /* @__PURE__ */ jsx("div", { className: listStyles.actions, children: /* @__PURE__ */ jsx(Actions, { actions: item2.actions }) })
18940
+ ] })
18941
+ ] }),
18942
+ /* @__PURE__ */ jsx(ItemContent, { item: item2, expanding })
18943
+ ]
19488
18944
  }
19489
- ) })
19490
- }
19491
- );
19492
- };
19493
- return /* @__PURE__ */ jsx(Card, { bordered: bordered2, padding: false, children: /* @__PURE__ */ jsxs(
19494
- "div",
19495
- {
19496
- className: cx$2(
19497
- listStyles.scrollableList,
19498
- narrow2 ? listStyles.narrow : "",
19499
- hideScrollbar2 ? listStyles.hideScrollbar : ""
19500
- ),
19501
- "data-testid": testId,
19502
- style: { height: height2, marginBottom },
19503
- ref: listContainerRef,
19504
- children: [
19505
- !noHeader && /* @__PURE__ */ jsx(
19506
- ListHeading,
19507
- {
19508
- name: list2.name,
19509
- actions: list2.actions,
19510
- toggleNarrow: toggleNarrow2,
19511
- onToggleNarrow,
19512
- stickyHeader: stickyHeader2
18945
+ )
18946
+ );
18947
+ };
18948
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
18949
+ items.map((item2, index2) => {
18950
+ const isSubheading = item2.type === "Heading";
18951
+ const edit2 = item2.actions && item2.actions.find(
18952
+ (a2) => {
18953
+ var _a2;
18954
+ return a2.label && ((_a2 = String(a2.label)) == null ? void 0 : _a2.toLowerCase()) === "edit";
19513
18955
  }
19514
- ),
19515
- /* @__PURE__ */ jsx(
19516
- ListDroppableWrapper,
18956
+ );
18957
+ const hasOnClick = !!(edit2 || item2.url || item2.onClick);
18958
+ const indent = item2.level && item2.level > 1 ? (item2.level - 1) * 20 : 0;
18959
+ return isSubheading ? /* @__PURE__ */ jsx(
18960
+ ListSubheading,
19517
18961
  {
19518
- onListReorder,
19519
- list: list2,
19520
- draggable: draggable2,
19521
- expanding,
19522
- children: (provided, snapshot) => {
19523
- return /* @__PURE__ */ jsx(
19524
- "div",
19525
- {
19526
- className: cx$2(listStyles.list, bordered2 ? listStyles.bordered : ""),
19527
- style: {
19528
- height: `${virtualizer.getTotalSize()}px`,
19529
- width: "100%",
19530
- position: "relative"
19531
- },
19532
- ref: provided == null ? void 0 : provided.innerRef,
19533
- ...provided == null ? void 0 : provided.droppableProps,
19534
- children: virtualizer.getVirtualItems().map(
19535
- (virtualRow) => draggable2 ? /* @__PURE__ */ jsx(
19536
- PublicDraggable,
19537
- {
19538
- draggableId: virtualRow.index.toString(),
19539
- index: virtualRow.index,
19540
- children: (dragProvided, dragSnapshot) => renderItem(virtualRow, dragProvided)
19541
- },
19542
- virtualRow.index
19543
- ) : /* @__PURE__ */ jsx(Fragment$2, { children: renderItem(virtualRow) }, virtualRow.index)
19544
- )
19545
- }
19546
- );
19547
- }
19548
- }
19549
- )
19550
- ]
19551
- }
19552
- ) });
19553
- };
18962
+ ref: listRowRefs,
18963
+ item: item2,
18964
+ index: index2
18965
+ },
18966
+ index2
18967
+ ) : draggable2 ? /* @__PURE__ */ jsx(PublicDraggable, { draggableId: item2.id + "", index: index2, children: (provided2) => listElement(index2, provided2, item2, indent, hasOnClick, edit2) }, item2.id) : listElement(index2, provided, item2, indent, hasOnClick, edit2);
18968
+ }),
18969
+ provided.placeholder
18970
+ ] });
18971
+ }
18972
+ );
19554
18973
  const loader = "_loader_477i5_1";
19555
18974
  const fullViewPortSize = "_fullViewPortSize_477i5_7";
19556
18975
  const cover = "_cover_477i5_14";
@@ -19617,6 +19036,178 @@ const Loader = ({
19617
19036
  }
19618
19037
  );
19619
19038
  };
19039
+ const List = ({
19040
+ list: list2,
19041
+ bordered: bordered2 = false,
19042
+ expanding = false,
19043
+ narrow: narrow2 = false,
19044
+ toggleNarrow: toggleNarrow2 = false,
19045
+ onToggleNarrow = () => {
19046
+ },
19047
+ invokeEditOnRowClick = true,
19048
+ noHeader = false,
19049
+ stickyHeader: stickyHeader2,
19050
+ draggable: draggable2 = false,
19051
+ onListReorder = () => {
19052
+ },
19053
+ marginBottom = 0,
19054
+ height: height2,
19055
+ testId,
19056
+ scrollDetails = {
19057
+ scrollable: false,
19058
+ hideScrollbar: false,
19059
+ triggerScrollToActiveItem: false,
19060
+ infiniteScroll: false,
19061
+ limit: 10,
19062
+ infiniteScrollTarget: void 0
19063
+ }
19064
+ }) => {
19065
+ const {
19066
+ scrollable,
19067
+ hideScrollbar: hideScrollbar2,
19068
+ triggerScrollToActiveItem,
19069
+ infiniteScroll,
19070
+ infiniteScrollTarget
19071
+ } = scrollDetails;
19072
+ const listHeadingRef = useRef(null);
19073
+ const listRowRefs = useRef([]);
19074
+ const listContainerRef = useRef(null);
19075
+ const MIN_ITEM_HEIGHT = 44;
19076
+ const pageSize = infiniteScroll ? Math.ceil(window.innerHeight / MIN_ITEM_HEIGHT) : list2.items.length;
19077
+ const [numVisibleRows, setNumVisibleRows] = useState(pageSize);
19078
+ const [hasMore, setHasMore] = useState(numVisibleRows < (list2 == null ? void 0 : list2.items.length));
19079
+ useEffect(() => {
19080
+ listRowRefs.current = listRowRefs.current.slice(0, list2.items.length);
19081
+ }, [list2.items.length]);
19082
+ const loadMoreItems = () => {
19083
+ if (numVisibleRows >= list2.items.length) {
19084
+ setHasMore(false);
19085
+ return;
19086
+ }
19087
+ const newVisibleRows = pageSize + numVisibleRows;
19088
+ setNumVisibleRows(newVisibleRows);
19089
+ };
19090
+ const findFirstActiveItemIndex = (items) => items.findIndex((item2) => item2.active === true);
19091
+ const setScrollToActiveItem = (activeItemIndex) => {
19092
+ if (!listContainerRef.current || !listHeadingRef.current) return;
19093
+ const itemBorderLength = 1;
19094
+ if (triggerScrollToActiveItem && activeItemIndex >= 0) {
19095
+ const itemOffsets = listRowRefs.current.reduce((acc, val, index2) => {
19096
+ if (index2 < activeItemIndex) {
19097
+ return acc + val.clientHeight + itemBorderLength;
19098
+ }
19099
+ return acc;
19100
+ }, 0);
19101
+ const centerOffset = listContainerRef.current.clientHeight / 2 - listRowRefs.current[activeItemIndex].clientHeight / 2;
19102
+ const scrollOffset = itemOffsets - centerOffset;
19103
+ if (stickyHeader2) {
19104
+ const headingOffset2 = listHeadingRef.current.clientHeight / 2;
19105
+ listContainerRef.current.scrollTop = scrollOffset + headingOffset2;
19106
+ }
19107
+ const headingOffset = listHeadingRef.current.clientHeight;
19108
+ listContainerRef.current.scrollTop = scrollOffset + headingOffset;
19109
+ }
19110
+ };
19111
+ useEffect(() => {
19112
+ if (triggerScrollToActiveItem) {
19113
+ const activeItemIndex = findFirstActiveItemIndex(list2 == null ? void 0 : list2.items);
19114
+ setScrollToActiveItem(activeItemIndex);
19115
+ }
19116
+ }, [
19117
+ listContainerRef.current,
19118
+ listHeadingRef.current,
19119
+ triggerScrollToActiveItem
19120
+ ]);
19121
+ return /* @__PURE__ */ jsx(
19122
+ DragDropContext,
19123
+ {
19124
+ onDragEnd: (result) => {
19125
+ var _a2, _b;
19126
+ const from3 = (_a2 = result == null ? void 0 : result.source) == null ? void 0 : _a2.index;
19127
+ const to2 = (_b = result == null ? void 0 : result.destination) == null ? void 0 : _b.index;
19128
+ onListReorder({ from: from3, to: to2 });
19129
+ },
19130
+ children: /* @__PURE__ */ jsx(ConnectedDroppable, { droppableId: "droppable", children: (provided, snapshot) => {
19131
+ return /* @__PURE__ */ jsx(
19132
+ "div",
19133
+ {
19134
+ className: cx$2(
19135
+ narrow2 ? listStyles.narrow : "",
19136
+ scrollable ? listStyles.scrollableList : "",
19137
+ hideScrollbar2 ? listStyles.hideScrollbar : ""
19138
+ ),
19139
+ "data-testid": testId,
19140
+ id: "scrollableDiv",
19141
+ style: { height: height2, marginBottom },
19142
+ ref: listContainerRef,
19143
+ children: /* @__PURE__ */ jsx(
19144
+ "div",
19145
+ {
19146
+ ref: provided.innerRef,
19147
+ ...provided.droppableProps,
19148
+ children: /* @__PURE__ */ jsxs(Card, { bordered: bordered2, padding: false, children: [
19149
+ !noHeader && /* @__PURE__ */ jsx(
19150
+ ListHeading,
19151
+ {
19152
+ name: list2.name,
19153
+ actions: list2.actions,
19154
+ toggleNarrow: toggleNarrow2,
19155
+ onToggleNarrow,
19156
+ stickyHeader: stickyHeader2,
19157
+ ref: listHeadingRef
19158
+ }
19159
+ ),
19160
+ /* @__PURE__ */ jsx(
19161
+ "div",
19162
+ {
19163
+ className: cx$2(listStyles.list, bordered2 ? listStyles.bordered : ""),
19164
+ children: infiniteScroll ? /* @__PURE__ */ jsx(
19165
+ InfiniteScroll,
19166
+ {
19167
+ dataLength: numVisibleRows,
19168
+ next: loadMoreItems,
19169
+ hasMore,
19170
+ scrollableTarget: infiniteScrollTarget || "scrollableDiv",
19171
+ loader: /* @__PURE__ */ jsx(Loader, {}),
19172
+ className: listStyles.infiniteScrollContainer,
19173
+ children: /* @__PURE__ */ jsx(
19174
+ ListRow,
19175
+ {
19176
+ draggable: draggable2,
19177
+ items: list2.items.slice(0, numVisibleRows),
19178
+ expanding,
19179
+ invokeEditOnRowClick,
19180
+ onListReorder,
19181
+ provided,
19182
+ snapshot,
19183
+ ref: listRowRefs
19184
+ }
19185
+ )
19186
+ }
19187
+ ) : /* @__PURE__ */ jsx(
19188
+ ListRow,
19189
+ {
19190
+ draggable: draggable2,
19191
+ items: list2.items,
19192
+ expanding,
19193
+ invokeEditOnRowClick,
19194
+ onListReorder,
19195
+ provided,
19196
+ snapshot,
19197
+ ref: listRowRefs
19198
+ }
19199
+ )
19200
+ }
19201
+ )
19202
+ ] })
19203
+ }
19204
+ )
19205
+ }
19206
+ );
19207
+ } })
19208
+ }
19209
+ );
19210
+ };
19620
19211
  const inputInTable$7 = "_inputInTable_1okhq_1";
19621
19212
  const inputHover$7 = "_inputHover_1okhq_13";
19622
19213
  const inputFocus$7 = "_inputFocus_1okhq_18";
@@ -20376,7 +19967,7 @@ const useFontsReady = () => {
20376
19967
  const getWidth = () => window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
20377
19968
  const useWindowWidth = () => {
20378
19969
  const [width2, setWidth] = useState(getWidth());
20379
- const resizeListener = debounce$3(() => setWidth(getWidth()), 150);
19970
+ const resizeListener = debounce$2(() => setWidth(getWidth()), 150);
20380
19971
  useEffect(() => {
20381
19972
  window.addEventListener("resize", resizeListener);
20382
19973
  return () => {
@@ -21605,43 +21196,48 @@ const useCustomSelectLogic = ({
21605
21196
  setTriggerFocus();
21606
21197
  };
21607
21198
  const openLayer = () => dispatch({ type: ActionTypes.OPEN_LAYER });
21608
- const isFirstRun = useRef(true);
21609
- useEffect(() => {
21610
- if (isFirstRun.current) {
21611
- isFirstRun.current = false;
21612
- } else {
21613
- dispatch({ type: ActionTypes.SET_VISIBLE_OPTIONS, options });
21614
- }
21615
- }, [options]);
21616
21199
  const onSelectOption = (evt, option2, close2) => {
21617
21200
  if (!(disabled2 || disabledContext)) {
21201
+ console.log(1);
21618
21202
  if (close2) {
21203
+ console.log(2);
21619
21204
  close2();
21620
21205
  }
21621
21206
  if (option2) {
21207
+ console.log(3);
21622
21208
  if (option2.createAble && onCreate) {
21209
+ console.log(4);
21623
21210
  onCreate(option2.value);
21624
21211
  } else {
21212
+ console.log(5);
21625
21213
  if (!option2.disabled) {
21214
+ console.log(6);
21626
21215
  if (Array.isArray(selectedOptions)) {
21216
+ console.log(7);
21627
21217
  const alreadySelected = selectedOptions.some(
21628
21218
  (selectedOption) => selectedOption.label === option2.label
21629
21219
  );
21630
21220
  if (!alreadySelected) {
21221
+ console.log(8);
21631
21222
  const newSelectedOptions = [...selectedOptions, option2];
21632
21223
  if (onChange) {
21224
+ console.log(9);
21633
21225
  onChange(evt, newSelectedOptions);
21634
21226
  }
21635
21227
  } else {
21228
+ console.log(10);
21636
21229
  const newSelectedOptions = selectedOptions.filter(
21637
21230
  (opt) => opt.label !== option2.label
21638
21231
  );
21639
21232
  if (onChange) {
21233
+ console.log(11);
21640
21234
  onChange(evt, newSelectedOptions);
21641
21235
  }
21642
21236
  }
21643
21237
  } else {
21238
+ console.log(12);
21644
21239
  if (onChange) {
21240
+ console.log(14);
21645
21241
  onChange(evt, option2);
21646
21242
  }
21647
21243
  }
@@ -53064,7 +52660,7 @@ const styles$d = {
53064
52660
  active: active$2,
53065
52661
  icon: icon$1
53066
52662
  };
53067
- const TooltipIcon = memo$1(
52663
+ const TooltipIcon = memo(
53068
52664
  ({ isOpen: isOpen2, label: label2, icon: icon2, invalid }) => {
53069
52665
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
53070
52666
  /* @__PURE__ */ jsx(
@@ -53139,7 +52735,7 @@ const Sections = ({
53139
52735
  )
53140
52736
  ] }, i)) });
53141
52737
  };
53142
- const SideBar = memo$1(
52738
+ const SideBar = memo(
53143
52739
  ({
53144
52740
  options,
53145
52741
  startOpen = false,
@@ -55736,18 +55332,18 @@ const Spacer = ({
55736
55332
  }
55737
55333
  }
55738
55334
  );
55739
- const inputInTable$2 = "_inputInTable_sqhcz_1";
55740
- const inputHover$2 = "_inputHover_sqhcz_13";
55741
- const inputFocus$2 = "_inputFocus_sqhcz_18";
55742
- const inputError$2 = "_inputError_sqhcz_25";
55743
- const inputWarning$2 = "_inputWarning_sqhcz_26";
55744
- const inputDisabled$2 = "_inputDisabled_sqhcz_61";
55745
- const hideScrollbars$2 = "_hideScrollbars_sqhcz_67";
55746
- const wrapper = "_wrapper_sqhcz_85";
55747
- const bordered = "_bordered_sqhcz_93";
55748
- const scroll2 = "_scroll_sqhcz_98";
55749
- const table = "_table_sqhcz_108";
55750
- const striped = "_striped_sqhcz_186";
55335
+ const inputInTable$2 = "_inputInTable_1dg3w_1";
55336
+ const inputHover$2 = "_inputHover_1dg3w_13";
55337
+ const inputFocus$2 = "_inputFocus_1dg3w_18";
55338
+ const inputError$2 = "_inputError_1dg3w_25";
55339
+ const inputWarning$2 = "_inputWarning_1dg3w_26";
55340
+ const inputDisabled$2 = "_inputDisabled_1dg3w_61";
55341
+ const hideScrollbars$2 = "_hideScrollbars_1dg3w_67";
55342
+ const wrapper = "_wrapper_1dg3w_85";
55343
+ const bordered = "_bordered_1dg3w_93";
55344
+ const scroll2 = "_scroll_1dg3w_98";
55345
+ const table = "_table_1dg3w_108";
55346
+ const striped = "_striped_1dg3w_188";
55751
55347
  const styles$b = {
55752
55348
  inputInTable: inputInTable$2,
55753
55349
  inputHover: inputHover$2,
@@ -55846,24 +55442,33 @@ const hasRowActions = (rows, headers) => {
55846
55442
  };
55847
55443
  const TableScrollWrapper = ({
55848
55444
  table: table2,
55849
- children,
55850
- headerRef
55445
+ children
55851
55446
  }) => {
55852
- var _a2;
55853
55447
  const { rows, infiniteScroll } = table2;
55854
- const scrollRef = useRef(null);
55855
- const virtualizer = useVirtualizer({
55856
- count: rows.length,
55857
- getScrollElement: () => scrollRef.current,
55858
- estimateSize: () => 31,
55859
- overscan: 10
55860
- });
55861
- const totalHeight = virtualizer.getTotalSize() + (((_a2 = headerRef == null ? void 0 : headerRef.current) == null ? void 0 : _a2.clientHeight) || 0);
55862
- return /* @__PURE__ */ jsx("div", { ref: scrollRef, className: styles$b.scroll, children: /* @__PURE__ */ jsx("div", { style: { minHeight: totalHeight }, children: children({
55863
- virtualItems: virtualizer.getVirtualItems(),
55864
- isScrolling: virtualizer.isScrolling,
55865
- scrollOffset: virtualizer.scrollOffset
55866
- }) }) });
55448
+ const pageSize = Math.ceil(window.innerHeight / 30);
55449
+ const [visibleRows, setVisibleRows] = infiniteScroll ? useState(pageSize) : [rows.length, null];
55450
+ const [hasMore, setHasMore] = infiniteScroll ? useState(visibleRows < rows.length) : [false, null];
55451
+ const loadMoreItems = () => {
55452
+ if (visibleRows >= rows.length && setHasMore) {
55453
+ setHasMore(false);
55454
+ return;
55455
+ }
55456
+ if (setVisibleRows) {
55457
+ setVisibleRows(visibleRows + pageSize);
55458
+ }
55459
+ };
55460
+ return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, children: infiniteScroll ? /* @__PURE__ */ jsx(
55461
+ InfiniteScroll,
55462
+ {
55463
+ dataLength: Math.min(rows.length, visibleRows + pageSize),
55464
+ next: loadMoreItems,
55465
+ hasMore,
55466
+ scrollableTarget: "scrollWrapper",
55467
+ style: { overflow: "initial" },
55468
+ loader: null,
55469
+ children: children({ visibleRows })
55470
+ }
55471
+ ) : children({ visibleRows }) });
55867
55472
  };
55868
55473
  const clickableRow = "_clickableRow_m64j5_1";
55869
55474
  const hoverableRow = "_hoverableRow_m64j5_4";
@@ -56574,11 +56179,9 @@ const Row = ({
56574
56179
  provided = null,
56575
56180
  width: width2,
56576
56181
  columnWidths,
56577
- style: style2,
56578
56182
  testId
56579
56183
  //TODO: add testId
56580
56184
  }) => {
56581
- var _a2;
56582
56185
  const targetRef = useRef(null);
56583
56186
  const columnHeaderAlignment = getHeaderAlignment(
56584
56187
  columnHeaderAlignments,
@@ -56622,8 +56225,7 @@ const Row = ({
56622
56225
  },
56623
56226
  columnCount
56624
56227
  );
56625
- const getDraggingStyle2 = (isDragging, draggableStyle) => {
56626
- if (!snapshot || !provided) return null;
56228
+ const getItemStyle2 = (isDragging, draggableStyle) => {
56627
56229
  return {
56628
56230
  minWidth: isDragging && `${width2}px`,
56629
56231
  width: isDragging && "100%",
@@ -56639,7 +56241,7 @@ const Row = ({
56639
56241
  if (row2.noDrag) {
56640
56242
  return /* @__PURE__ */ jsx("td", { "aria-labelledby": "unique-label-id" });
56641
56243
  }
56642
- return /* @__PURE__ */ jsx("td", { className: styles$8.dragIconCell, children: /* @__PURE__ */ jsx("div", { ...provided == null ? void 0 : provided.dragHandleProps, className: styles$8.dragIcon, children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG }) }) });
56244
+ return /* @__PURE__ */ jsx("td", { className: styles$8.dragIconCell, children: /* @__PURE__ */ jsx("div", { ...provided.dragHandleProps, className: styles$8.dragIcon, children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG }) }) });
56643
56245
  };
56644
56246
  return isHeader ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
56645
56247
  /* @__PURE__ */ jsxs(
@@ -56691,13 +56293,7 @@ const Row = ({
56691
56293
  "data-warning": warning2 || null,
56692
56294
  ref: (provided == null ? void 0 : provided.innerRef) || null,
56693
56295
  ...(provided == null ? void 0 : provided.draggableProps) || null,
56694
- style: {
56695
- ...style2,
56696
- ...getDraggingStyle2(
56697
- snapshot == null ? void 0 : snapshot.isDragging,
56698
- (_a2 = provided == null ? void 0 : provided.draggableProps) == null ? void 0 : _a2.style
56699
- )
56700
- },
56296
+ style: snapshot && provided ? getItemStyle2(snapshot.isDragging, provided.draggableProps.style) : null,
56701
56297
  children: [
56702
56298
  draggableTable ? getDragItem() : null,
56703
56299
  cells,
@@ -56739,8 +56335,16 @@ const Table = (props) => {
56739
56335
  maxHeight,
56740
56336
  fixedWidth: width2
56741
56337
  } = propTable;
56742
- useRef(null);
56743
- const headerRef = useRef(null);
56338
+ const targetRef = useRef(null);
56339
+ const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
56340
+ useEffect(() => {
56341
+ if (targetRef.current) {
56342
+ setDimensions({
56343
+ width: targetRef.current.offsetWidth,
56344
+ height: targetRef.current.offsetHeight
56345
+ });
56346
+ }
56347
+ }, []);
56744
56348
  const headers = get$2(props, "table.headers", []);
56745
56349
  const columnCount = getColumnCount(propRows, headers);
56746
56350
  const rowActions = hasRowActions(propRows, headers);
@@ -56791,7 +56395,7 @@ const Table = (props) => {
56791
56395
  // Collapse width if width = auto
56792
56396
  display: width2 === "auto" ? "inline-flex" : "flex"
56793
56397
  };
56794
- return /* @__PURE__ */ jsxs("div", { className: wrapperClass, style: wrapperStyles, children: [
56398
+ return draggable2 ? /* @__PURE__ */ jsxs("div", { ref: targetRef, className: wrapperClass, style: wrapperStyles, children: [
56795
56399
  /* @__PURE__ */ jsx(
56796
56400
  Title$1,
56797
56401
  {
@@ -56812,96 +56416,40 @@ const Table = (props) => {
56812
56416
  onListReorder({ from: from3, to: to2 });
56813
56417
  }
56814
56418
  },
56815
- children: /* @__PURE__ */ jsx(
56816
- ConnectedDroppable,
56817
- {
56818
- droppableId: "droppable",
56819
- mode: "virtual",
56820
- renderClone: (provided, snapshot, rubric) => {
56821
- return /* @__PURE__ */ jsx(
56822
- Row,
56823
- {
56824
- rowIndex: rubric.source.index,
56825
- row: rows[rubric.source.index],
56826
- columnCount,
56827
- columnWidths,
56828
- colSpan,
56829
- hasRowActions: rowActions,
56830
- columnAlignment,
56831
- columnHeaderAlignments,
56832
- draggableTable: draggable2,
56833
- ...provided.draggableProps
56834
- }
56835
- );
56836
- },
56837
- children: (provided) => {
56838
- return /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, headerRef, children: ({ virtualItems, isScrolling, scrollOffset }) => /* @__PURE__ */ jsxs(
56839
- "table",
56840
- {
56841
- className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
56842
- "data-testid": testId,
56843
- ref: provided.innerRef,
56844
- children: [
56845
- /* @__PURE__ */ jsx(
56846
- "thead",
56847
- {
56848
- ref: headerRef,
56849
- style: {
56850
- position: "relative",
56851
- transition: "transform 0.2s",
56852
- transform: !isScrolling ? `translateY(${scrollOffset}px)` : "translateY(0px)"
56853
- },
56854
- children: headers.map((row2, rowIndex) => {
56855
- return /* @__PURE__ */ jsx(
56856
- Row,
56857
- {
56858
- rowIndex,
56859
- isHeader: true,
56860
- row: row2,
56861
- columnCount,
56862
- columnWidths,
56863
- colSpan,
56864
- hasRowActions: rowActions,
56865
- columnAlignment,
56866
- columnHeaderAlignments,
56867
- draggableTable: draggable2
56868
- },
56869
- `0_${rowIndex}`
56870
- );
56871
- })
56872
- }
56873
- ),
56874
- /* @__PURE__ */ jsx("tbody", { children: virtualItems.map((virtualRow, rowIndex) => {
56875
- const row2 = rows[virtualRow.index];
56876
- return draggable2 ? /* @__PURE__ */ jsx(
56877
- PublicDraggable,
56878
- {
56879
- draggableId: rowIndex + "",
56880
- index: rowIndex,
56881
- isDragDisabled: row2.noDrag,
56882
- children: (provided2, snapshot) => /* @__PURE__ */ jsx(
56883
- Row,
56884
- {
56885
- rowIndex,
56886
- row: row2,
56887
- columnCount,
56888
- columnWidths,
56889
- colSpan,
56890
- hasRowActions: rowActions,
56891
- columnAlignment,
56892
- style: {
56893
- height: `${virtualRow.size}px`,
56894
- transform: `translateY(${virtualRow.start - rowIndex * virtualRow.size}px)`
56895
- },
56896
- provided: provided2,
56897
- snapshot,
56898
- draggableTable: draggable2
56899
- },
56900
- `1_${rowIndex}`
56901
- )
56902
- },
56903
- `index_${rowIndex}`
56904
- ) : /* @__PURE__ */ jsx(
56419
+ children: /* @__PURE__ */ jsx(ConnectedDroppable, { droppableId: "droppable", children: (provided) => {
56420
+ return /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, children: ({ visibleRows }) => /* @__PURE__ */ jsxs(
56421
+ "table",
56422
+ {
56423
+ className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
56424
+ "data-testid": testId,
56425
+ ref: provided.innerRef,
56426
+ children: [
56427
+ /* @__PURE__ */ jsx("thead", { children: headers.map((row2, rowIndex) => {
56428
+ return /* @__PURE__ */ jsx(
56429
+ Row,
56430
+ {
56431
+ rowIndex,
56432
+ isHeader: true,
56433
+ row: row2,
56434
+ columnCount,
56435
+ columnWidths,
56436
+ colSpan,
56437
+ hasRowActions: rowActions,
56438
+ columnAlignment,
56439
+ columnHeaderAlignments,
56440
+ draggableTable: draggable2
56441
+ },
56442
+ `0_${rowIndex}`
56443
+ );
56444
+ }) }),
56445
+ /* @__PURE__ */ jsxs("tbody", { children: [
56446
+ rows.slice(0, visibleRows).map((row2, rowIndex) => /* @__PURE__ */ jsx(
56447
+ PublicDraggable,
56448
+ {
56449
+ draggableId: rowIndex + "",
56450
+ index: rowIndex,
56451
+ isDragDisabled: row2.noDrag,
56452
+ children: (provided2, snapshot) => /* @__PURE__ */ jsx(
56905
56453
  Row,
56906
56454
  {
56907
56455
  rowIndex,
@@ -56911,22 +56459,81 @@ const Table = (props) => {
56911
56459
  colSpan,
56912
56460
  hasRowActions: rowActions,
56913
56461
  columnAlignment,
56914
- style: {
56915
- height: `${virtualRow.size}px`,
56916
- transform: `translateY(${virtualRow.start - rowIndex * virtualRow.size}px)`
56917
- }
56462
+ provided: provided2,
56463
+ snapshot,
56464
+ draggableTable: draggable2,
56465
+ width: dimensions.width
56918
56466
  },
56919
56467
  `1_${rowIndex}`
56920
- );
56921
- }) })
56922
- ]
56923
- }
56924
- ) });
56468
+ )
56469
+ },
56470
+ `index_${rowIndex}`
56471
+ )),
56472
+ provided.placeholder
56473
+ ] })
56474
+ ]
56925
56475
  }
56926
- }
56927
- )
56476
+ ) });
56477
+ } })
56928
56478
  }
56929
56479
  ),
56480
+ footer2 && /* @__PURE__ */ jsx(
56481
+ Footer,
56482
+ {
56483
+ pagination: footer2.pagination,
56484
+ actions: footer2.actions,
56485
+ content: footer2.content
56486
+ }
56487
+ )
56488
+ ] }) : /* @__PURE__ */ jsxs("div", { className: wrapperClass, style: wrapperStyles, children: [
56489
+ /* @__PURE__ */ jsx(
56490
+ Title$1,
56491
+ {
56492
+ actions: actions2,
56493
+ actionsRight,
56494
+ name: name2,
56495
+ testId: testId && `${testId}-title`
56496
+ }
56497
+ ),
56498
+ /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, children: ({ visibleRows }) => /* @__PURE__ */ jsxs(
56499
+ "table",
56500
+ {
56501
+ className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
56502
+ "data-testid": testId,
56503
+ children: [
56504
+ /* @__PURE__ */ jsx("thead", { children: headers.map((row2, rowIndex) => {
56505
+ return /* @__PURE__ */ jsx(
56506
+ Row,
56507
+ {
56508
+ rowIndex,
56509
+ isHeader: true,
56510
+ row: row2,
56511
+ columnCount,
56512
+ columnWidths,
56513
+ colSpan,
56514
+ hasRowActions: rowActions,
56515
+ columnAlignment,
56516
+ columnHeaderAlignments
56517
+ },
56518
+ `0_${rowIndex}`
56519
+ );
56520
+ }) }),
56521
+ /* @__PURE__ */ jsx("tbody", { children: rows.slice(0, visibleRows).map((row2, rowIndex) => /* @__PURE__ */ jsx(
56522
+ Row,
56523
+ {
56524
+ rowIndex,
56525
+ row: row2,
56526
+ columnCount,
56527
+ columnWidths,
56528
+ colSpan,
56529
+ hasRowActions: rowActions,
56530
+ columnAlignment
56531
+ },
56532
+ `1_${rowIndex}`
56533
+ )) })
56534
+ ]
56535
+ }
56536
+ ) }),
56930
56537
  footer2 && /* @__PURE__ */ jsx(
56931
56538
  Footer,
56932
56539
  {
@@ -59840,7 +59447,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
59840
59447
  }
59841
59448
  let refCount = 0;
59842
59449
  const INSTANCE_SYM = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");
59843
- var DndProvider = /* @__PURE__ */ memo$1(function DndProvider2(_param) {
59450
+ var DndProvider = /* @__PURE__ */ memo(function DndProvider2(_param) {
59844
59451
  var { children } = _param, props = _objectWithoutProperties(_param, [
59845
59452
  "children"
59846
59453
  ]);
@@ -62201,7 +61808,7 @@ function useFeatures(props, visualElement2, preloadedFeatures) {
62201
61808
  var name_1 = featureNames[i];
62202
61809
  var _a2 = featureDefinitions[name_1], isEnabled = _a2.isEnabled, Component2 = _a2.Component;
62203
61810
  if (isEnabled(props) && Component2) {
62204
- features.push(React$4.createElement(Component2, __assign$3({ key: name_1 }, props, { visualElement: visualElement2 })));
61811
+ features.push(React$4.createElement(Component2, __assign$4({ key: name_1 }, props, { visualElement: visualElement2 })));
62205
61812
  }
62206
61813
  }
62207
61814
  return features;
@@ -62442,7 +62049,7 @@ function useProjection(projectionId, _a2, visualElement2, ProjectionNodeConstruc
62442
62049
  var VisualElementHandler = (
62443
62050
  /** @class */
62444
62051
  function(_super) {
62445
- __extends(VisualElementHandler2, _super);
62052
+ __extends$1(VisualElementHandler2, _super);
62446
62053
  function VisualElementHandler2() {
62447
62054
  return _super !== null && _super.apply(this, arguments) || this;
62448
62055
  }
@@ -62468,20 +62075,20 @@ function createMotionComponent(_a2) {
62468
62075
  preloadedFeatures && loadFeatures(preloadedFeatures);
62469
62076
  function MotionComponent(props, externalRef) {
62470
62077
  var layoutId = useLayoutId(props);
62471
- props = __assign$3(__assign$3({}, props), { layoutId });
62078
+ props = __assign$4(__assign$4({}, props), { layoutId });
62472
62079
  var config2 = useContext(MotionConfigContext);
62473
62080
  var features = null;
62474
62081
  var context2 = useCreateMotionContext(props);
62475
62082
  var projectionId = config2.isStatic ? void 0 : useProjectionId();
62476
62083
  var visualState = useVisualState(props, config2.isStatic);
62477
62084
  if (!config2.isStatic && isBrowser) {
62478
- context2.visualElement = useVisualElement(Component2, visualState, __assign$3(__assign$3({}, config2), props), createVisualElement);
62085
+ context2.visualElement = useVisualElement(Component2, visualState, __assign$4(__assign$4({}, config2), props), createVisualElement);
62479
62086
  useProjection(projectionId, props, context2.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor);
62480
62087
  features = useFeatures(props, context2.visualElement, preloadedFeatures);
62481
62088
  }
62482
62089
  return React$4.createElement(
62483
62090
  VisualElementHandler,
62484
- { visualElement: context2.visualElement, props: __assign$3(__assign$3({}, config2), props) },
62091
+ { visualElement: context2.visualElement, props: __assign$4(__assign$4({}, config2), props) },
62485
62092
  features,
62486
62093
  React$4.createElement(MotionContext.Provider, { value: context2 }, useRender(Component2, props, projectionId, useMotionRef(visualState, context2.visualElement, externalRef), visualState, config2.isStatic, context2.visualElement))
62487
62094
  );
@@ -62807,7 +62414,7 @@ const filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v
62807
62414
  const functions = v2.match(functionRegex);
62808
62415
  return functions ? functions.map(applyDefaultFilter).join(" ") : v2;
62809
62416
  } });
62810
- var int = __assign$3(__assign$3({}, number), { transform: Math.round });
62417
+ var int = __assign$4(__assign$4({}, number), { transform: Math.round });
62811
62418
  var numberValueTypes = {
62812
62419
  // Border props
62813
62420
  borderWidth: px,
@@ -62937,7 +62544,7 @@ function useInitialMotionValues(_a2, visualState, isStatic) {
62937
62544
  var state = createHtmlRenderState();
62938
62545
  buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);
62939
62546
  var vars = state.vars, style2 = state.style;
62940
- return __assign$3(__assign$3({}, vars), style2);
62547
+ return __assign$4(__assign$4({}, vars), style2);
62941
62548
  }, [visualState]);
62942
62549
  }
62943
62550
  function useStyle(props, visualState, isStatic) {
@@ -63095,18 +62702,18 @@ function buildSVGAttrs(state, _a2, options, transformTemplate) {
63095
62702
  }
63096
62703
  }
63097
62704
  var createSvgRenderState = function() {
63098
- return __assign$3(__assign$3({}, createHtmlRenderState()), { attrs: {} });
62705
+ return __assign$4(__assign$4({}, createHtmlRenderState()), { attrs: {} });
63099
62706
  };
63100
62707
  function useSVGProps(props, visualState) {
63101
62708
  var visualProps = useMemo$1(function() {
63102
62709
  var state = createSvgRenderState();
63103
62710
  buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate);
63104
- return __assign$3(__assign$3({}, state.attrs), { style: __assign$3({}, state.style) });
62711
+ return __assign$4(__assign$4({}, state.attrs), { style: __assign$4({}, state.style) });
63105
62712
  }, [visualState]);
63106
62713
  if (props.style) {
63107
62714
  var rawStyles = {};
63108
62715
  copyRawValuesOnly(rawStyles, props.style, props);
63109
- visualProps.style = __assign$3(__assign$3({}, rawStyles), visualProps.style);
62716
+ visualProps.style = __assign$4(__assign$4({}, rawStyles), visualProps.style);
63110
62717
  }
63111
62718
  return visualProps;
63112
62719
  }
@@ -63119,7 +62726,7 @@ function createUseRender(forwardMotionProps) {
63119
62726
  var useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
63120
62727
  var visualProps = useVisualProps(props, latestValues, isStatic);
63121
62728
  var filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
63122
- var elementProps = __assign$3(__assign$3(__assign$3({}, filteredProps), visualProps), { ref: ref2 });
62729
+ var elementProps = __assign$4(__assign$4(__assign$4({}, filteredProps), visualProps), { ref: ref2 });
63123
62730
  if (projectionId) {
63124
62731
  elementProps["data-projection-id"] = projectionId;
63125
62732
  }
@@ -63296,7 +62903,7 @@ var htmlMotionConfig = {
63296
62903
  function createDomMotionConfig(Component2, _a2, preloadedFeatures, createVisualElement, projectionNodeConstructor) {
63297
62904
  var _b = _a2.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;
63298
62905
  var baseConfig = isSVGComponent(Component2) ? svgMotionConfig : htmlMotionConfig;
63299
- return __assign$3(__assign$3({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
62906
+ return __assign$4(__assign$4({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
63300
62907
  }
63301
62908
  var AnimationType;
63302
62909
  (function(AnimationType2) {
@@ -64383,7 +63990,7 @@ function initIntersectionObserver(_a2) {
64383
63990
  var rootObservers = observers.get(lookupRoot);
64384
63991
  var key2 = JSON.stringify(options);
64385
63992
  if (!rootObservers[key2]) {
64386
- rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$3({ root: root2 }, options));
63993
+ rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$4({ root: root2 }, options));
64387
63994
  }
64388
63995
  return rootObservers[key2];
64389
63996
  }
@@ -64601,9 +64208,9 @@ var getDefaultTransition = function(valueKey, to2) {
64601
64208
  } else {
64602
64209
  transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default;
64603
64210
  }
64604
- return __assign$3({ to: to2 }, transitionFactory(to2));
64211
+ return __assign$4({ to: to2 }, transitionFactory(to2));
64605
64212
  };
64606
- var defaultValueTypes = __assign$3(__assign$3({}, numberValueTypes), {
64213
+ var defaultValueTypes = __assign$4(__assign$4({}, numberValueTypes), {
64607
64214
  // Color props
64608
64215
  color,
64609
64216
  backgroundColor: color,
@@ -64645,7 +64252,7 @@ function isTransitionDefined(_a2) {
64645
64252
  var legacyRepeatWarning = false;
64646
64253
  function convertTransitionToAnimationOptions(_a2) {
64647
64254
  var ease2 = _a2.ease, times = _a2.times, yoyo = _a2.yoyo, flip = _a2.flip, loop = _a2.loop, transition = __rest$1(_a2, ["ease", "times", "yoyo", "flip", "loop"]);
64648
- var options = __assign$3({}, transition);
64255
+ var options = __assign$4({}, transition);
64649
64256
  if (times)
64650
64257
  options["offset"] = times;
64651
64258
  if (transition.duration)
@@ -64692,9 +64299,9 @@ function getPopmotionAnimationOptions(transition, options, key2) {
64692
64299
  }
64693
64300
  hydrateKeyframes(options);
64694
64301
  if (!isTransitionDefined(transition)) {
64695
- transition = __assign$3(__assign$3({}, transition), getDefaultTransition(key2, options.to));
64302
+ transition = __assign$4(__assign$4({}, transition), getDefaultTransition(key2, options.to));
64696
64303
  }
64697
- return __assign$3(__assign$3({}, options), convertTransitionToAnimationOptions(transition));
64304
+ return __assign$4(__assign$4({}, options), convertTransitionToAnimationOptions(transition));
64698
64305
  }
64699
64306
  function getAnimation(key2, value, target, transition, onComplete) {
64700
64307
  var _a2;
@@ -64720,7 +64327,7 @@ function getAnimation(key2, value, target, transition, onComplete) {
64720
64327
  return value.set(v2);
64721
64328
  }
64722
64329
  };
64723
- return valueTransition.type === "inertia" || valueTransition.type === "decay" ? inertia(__assign$3(__assign$3({}, options), valueTransition)) : animate$1(__assign$3(__assign$3({}, getPopmotionAnimationOptions(valueTransition, options, key2)), { onUpdate: function(v2) {
64330
+ return valueTransition.type === "inertia" || valueTransition.type === "decay" ? inertia(__assign$4(__assign$4({}, options), valueTransition)) : animate$1(__assign$4(__assign$4({}, getPopmotionAnimationOptions(valueTransition, options, key2)), { onUpdate: function(v2) {
64724
64331
  var _a3;
64725
64332
  options.onUpdate(v2);
64726
64333
  (_a3 = valueTransition.onUpdate) === null || _a3 === void 0 ? void 0 : _a3.call(valueTransition, v2);
@@ -64973,7 +64580,7 @@ function setTarget(visualElement2, definition) {
64973
64580
  var _a2 = resolved ? visualElement2.makeTargetAnimatable(resolved, false) : {}, _b = _a2.transitionEnd, transitionEnd = _b === void 0 ? {} : _b;
64974
64581
  _a2.transition;
64975
64582
  var target = __rest$1(_a2, ["transitionEnd", "transition"]);
64976
- target = __assign$3(__assign$3({}, target), transitionEnd);
64583
+ target = __assign$4(__assign$4({}, target), transitionEnd);
64977
64584
  for (var key2 in target) {
64978
64585
  var value = resolveFinalValueInKeyframes(target[key2]);
64979
64586
  setMotionValue(visualElement2, key2, value);
@@ -65091,9 +64698,9 @@ function animateTarget(visualElement2, definition, _a2) {
65091
64698
  if (!value || valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key2)) {
65092
64699
  continue;
65093
64700
  }
65094
- var valueTransition = __assign$3({ delay }, transition);
64701
+ var valueTransition = __assign$4({ delay }, transition);
65095
64702
  if (visualElement2.shouldReduceMotion && isTransformProp(key2)) {
65096
- valueTransition = __assign$3(__assign$3({}, valueTransition), { type: false, delay: 0 });
64703
+ valueTransition = __assign$4(__assign$4({}, valueTransition), { type: false, delay: 0 });
65097
64704
  }
65098
64705
  var animation = startAnimation(key2, value, valueTarget, valueTransition);
65099
64706
  animations2.push(animation);
@@ -65126,7 +64733,7 @@ function animateChildren(visualElement2, variant, delayChildren, staggerChildren
65126
64733
  return maxStaggerDuration - i * staggerChildren;
65127
64734
  };
65128
64735
  Array.from(visualElement2.variantChildren).sort(sortByTreeOrder).forEach(function(child, i) {
65129
- animations2.push(animateVariant(child, variant, __assign$3(__assign$3({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
64736
+ animations2.push(animateVariant(child, variant, __assign$4(__assign$4({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
65130
64737
  return child.notifyAnimationComplete(variant);
65131
64738
  }));
65132
64739
  });
@@ -65170,7 +64777,7 @@ function createAnimationState(visualElement2) {
65170
64777
  if (resolved) {
65171
64778
  resolved.transition;
65172
64779
  var transitionEnd = resolved.transitionEnd, target = __rest$1(resolved, ["transition", "transitionEnd"]);
65173
- acc = __assign$3(__assign$3(__assign$3({}, acc), target), transitionEnd);
64780
+ acc = __assign$4(__assign$4(__assign$4({}, acc), target), transitionEnd);
65174
64781
  }
65175
64782
  return acc;
65176
64783
  };
@@ -65200,7 +64807,7 @@ function createAnimationState(visualElement2) {
65200
64807
  if (isInherited && isInitialRender && visualElement2.manuallyAnimateOnMount) {
65201
64808
  isInherited = false;
65202
64809
  }
65203
- typeState.protectedKeys = __assign$3({}, encounteredKeys);
64810
+ typeState.protectedKeys = __assign$4({}, encounteredKeys);
65204
64811
  if (
65205
64812
  // If it isn't active and hasn't *just* been set as inactive
65206
64813
  !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type
@@ -65218,7 +64825,7 @@ function createAnimationState(visualElement2) {
65218
64825
  if (activeDelta === false)
65219
64826
  resolvedValues = {};
65220
64827
  var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
65221
- var allKeys = __assign$3(__assign$3({}, prevResolvedValues), resolvedValues);
64828
+ var allKeys = __assign$4(__assign$4({}, prevResolvedValues), resolvedValues);
65222
64829
  var markToAnimate = function(key3) {
65223
64830
  shouldAnimateType = true;
65224
64831
  removedKeys.delete(key3);
@@ -65250,7 +64857,7 @@ function createAnimationState(visualElement2) {
65250
64857
  typeState.prevProp = prop;
65251
64858
  typeState.prevResolvedValues = resolvedValues;
65252
64859
  if (typeState.isActive) {
65253
- encounteredKeys = __assign$3(__assign$3({}, encounteredKeys), resolvedValues);
64860
+ encounteredKeys = __assign$4(__assign$4({}, encounteredKeys), resolvedValues);
65254
64861
  }
65255
64862
  if (isInitialRender && visualElement2.blockInitialAnimation) {
65256
64863
  shouldAnimateType = false;
@@ -65259,7 +64866,7 @@ function createAnimationState(visualElement2) {
65259
64866
  animations2.push.apply(animations2, __spreadArray$2([], __read(definitionList.map(function(animation) {
65260
64867
  return {
65261
64868
  animation,
65262
- options: __assign$3({ type }, options)
64869
+ options: __assign$4({ type }, options)
65263
64870
  };
65264
64871
  })), false));
65265
64872
  }
@@ -65267,7 +64874,7 @@ function createAnimationState(visualElement2) {
65267
64874
  for (var i = 0; i < numAnimationTypes; i++) {
65268
64875
  _loop_1(i);
65269
64876
  }
65270
- allAnimatedKeys = __assign$3({}, encounteredKeys);
64877
+ allAnimatedKeys = __assign$4({}, encounteredKeys);
65271
64878
  if (removedKeys.size) {
65272
64879
  var fallbackAnimation_1 = {};
65273
64880
  removedKeys.forEach(function(key2) {
@@ -65375,7 +64982,7 @@ var PanSession = (
65375
64982
  return;
65376
64983
  var point2 = info3.point;
65377
64984
  var timestamp2 = getFrameData().timestamp;
65378
- _this.history.push(__assign$3(__assign$3({}, point2), { timestamp: timestamp2 }));
64985
+ _this.history.push(__assign$4(__assign$4({}, point2), { timestamp: timestamp2 }));
65379
64986
  var _a3 = _this.handlers, onStart = _a3.onStart, onMove = _a3.onMove;
65380
64987
  if (!isPanStarted) {
65381
64988
  onStart && onStart(_this.lastMoveEvent, info3);
@@ -65409,7 +65016,7 @@ var PanSession = (
65409
65016
  var initialInfo = transformPoint(info2, this.transformPagePoint);
65410
65017
  var point = initialInfo.point;
65411
65018
  var timestamp = getFrameData().timestamp;
65412
- this.history = [__assign$3(__assign$3({}, point), { timestamp })];
65019
+ this.history = [__assign$4(__assign$4({}, point), { timestamp })];
65413
65020
  var onSessionStart = handlers2.onSessionStart;
65414
65021
  onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
65415
65022
  this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
@@ -65930,7 +65537,7 @@ var VisualElementDragControls = (
65930
65537
  transition = { min: 0, max: 0 };
65931
65538
  var bounceStiffness = dragElastic ? 200 : 1e6;
65932
65539
  var bounceDamping = dragElastic ? 40 : 1e7;
65933
- var inertia2 = __assign$3(__assign$3({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
65540
+ var inertia2 = __assign$4(__assign$4({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
65934
65541
  return _this.startAxisValueAnimation(axis, inertia2);
65935
65542
  });
65936
65543
  return Promise.all(momentumAnimations).then(onDragTransitionEnd);
@@ -66041,7 +65648,7 @@ var VisualElementDragControls = (
66041
65648
  VisualElementDragControls2.prototype.getProps = function() {
66042
65649
  var props = this.visualElement.getProps();
66043
65650
  var _a2 = props.drag, drag2 = _a2 === void 0 ? false : _a2, _b = props.dragDirectionLock, dragDirectionLock = _b === void 0 ? false : _b, _c = props.dragPropagation, dragPropagation = _c === void 0 ? false : _c, _d = props.dragConstraints, dragConstraints = _d === void 0 ? false : _d, _e2 = props.dragElastic, dragElastic = _e2 === void 0 ? defaultElastic : _e2, _f = props.dragMomentum, dragMomentum = _f === void 0 ? true : _f;
66044
- return __assign$3(__assign$3({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
65651
+ return __assign$4(__assign$4({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
66045
65652
  };
66046
65653
  return VisualElementDragControls2;
66047
65654
  }()
@@ -66198,7 +65805,7 @@ var visualElement = function(_a2) {
66198
65805
  var values2 = /* @__PURE__ */ new Map();
66199
65806
  var valueSubscriptions = /* @__PURE__ */ new Map();
66200
65807
  var prevMotionValues = {};
66201
- var baseTarget = __assign$3({}, latestValues);
65808
+ var baseTarget = __assign$4({}, latestValues);
66202
65809
  var removeFromVariantTree;
66203
65810
  function render2() {
66204
65811
  if (!instance || !isMounted)
@@ -66232,7 +65839,7 @@ var visualElement = function(_a2) {
66232
65839
  }
66233
65840
  var isControllingVariants = checkIfControllingVariants(props);
66234
65841
  var isVariantNode = checkIfVariantNode(props);
66235
- var element = __assign$3(__assign$3({
65842
+ var element = __assign$4(__assign$4({
66236
65843
  treeType,
66237
65844
  /**
66238
65845
  * This is a mirror of the internal instance prop, which keeps
@@ -66597,7 +66204,7 @@ function resolveCSSVariables(visualElement2, _a2, transitionEnd) {
66597
66204
  if (!(element instanceof Element))
66598
66205
  return { target, transitionEnd };
66599
66206
  if (transitionEnd) {
66600
- transitionEnd = __assign$3({}, transitionEnd);
66207
+ transitionEnd = __assign$4({}, transitionEnd);
66601
66208
  }
66602
66209
  visualElement2.forEachValue(function(value) {
66603
66210
  var current2 = value.get();
@@ -66752,8 +66359,8 @@ var checkAndConvertChangedValueTypes = function(visualElement2, target, origin2,
66752
66359
  if (transitionEnd === void 0) {
66753
66360
  transitionEnd = {};
66754
66361
  }
66755
- target = __assign$3({}, target);
66756
- transitionEnd = __assign$3({}, transitionEnd);
66362
+ target = __assign$4({}, target);
66363
+ transitionEnd = __assign$4({}, transitionEnd);
66757
66364
  var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
66758
66365
  var removedTransformValues = [];
66759
66366
  var hasAttemptedToRemoveTransformValues = false;
@@ -66906,7 +66513,7 @@ var htmlConfig = {
66906
66513
  transitionEnd = parsed.transitionEnd;
66907
66514
  target = parsed.target;
66908
66515
  }
66909
- return __assign$3({ transition, transitionEnd }, target);
66516
+ return __assign$4({ transition, transitionEnd }, target);
66910
66517
  },
66911
66518
  scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1,
66912
66519
  build: function(element, renderState, latestValues, options, props) {
@@ -66918,7 +66525,7 @@ var htmlConfig = {
66918
66525
  render: renderHTML
66919
66526
  };
66920
66527
  var htmlVisualElement = visualElement(htmlConfig);
66921
- var svgVisualElement = visualElement(__assign$3(__assign$3({}, htmlConfig), { getBaseTarget: function(props, key2) {
66528
+ var svgVisualElement = visualElement(__assign$4(__assign$4({}, htmlConfig), { getBaseTarget: function(props, key2) {
66922
66529
  return props[key2];
66923
66530
  }, readValueFromInstance: function(domElement, key2) {
66924
66531
  var _a2;
@@ -66996,7 +66603,7 @@ var correctBoxShadow = {
66996
66603
  var MeasureLayoutWithContext = (
66997
66604
  /** @class */
66998
66605
  function(_super) {
66999
- __extends(MeasureLayoutWithContext2, _super);
66606
+ __extends$1(MeasureLayoutWithContext2, _super);
67000
66607
  function MeasureLayoutWithContext2() {
67001
66608
  return _super !== null && _super.apply(this, arguments) || this;
67002
66609
  }
@@ -67015,7 +66622,7 @@ var MeasureLayoutWithContext = (
67015
66622
  projection.addEventListener("animationComplete", function() {
67016
66623
  _this.safeToRemove();
67017
66624
  });
67018
- projection.setOptions(__assign$3(__assign$3({}, projection.options), { onExitComplete: function() {
66625
+ projection.setOptions(__assign$4(__assign$4({}, projection.options), { onExitComplete: function() {
67019
66626
  return _this.safeToRemove();
67020
66627
  } }));
67021
66628
  }
@@ -67080,10 +66687,10 @@ var MeasureLayoutWithContext = (
67080
66687
  function MeasureLayout(props) {
67081
66688
  var _a2 = __read(usePresence(), 2), isPresent = _a2[0], safeToRemove = _a2[1];
67082
66689
  var layoutGroup = useContext(LayoutGroupContext);
67083
- return React__default.createElement(MeasureLayoutWithContext, __assign$3({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
66690
+ return React__default.createElement(MeasureLayoutWithContext, __assign$4({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
67084
66691
  }
67085
66692
  var defaultScaleCorrectors = {
67086
- borderRadius: __assign$3(__assign$3({}, correctBorderRadius), { applyTo: [
66693
+ borderRadius: __assign$4(__assign$4({}, correctBorderRadius), { applyTo: [
67087
66694
  "borderTopLeftRadius",
67088
66695
  "borderTopRightRadius",
67089
66696
  "borderBottomLeftRadius",
@@ -67506,7 +67113,7 @@ function createProjectionNode(_a2) {
67506
67113
  _this.resumingFrom.resumingFrom = void 0;
67507
67114
  }
67508
67115
  _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
67509
- var animationOptions = __assign$3(__assign$3({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
67116
+ var animationOptions = __assign$4(__assign$4({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
67510
67117
  if (visualElement2.shouldReduceMotion) {
67511
67118
  animationOptions.delay = 0;
67512
67119
  animationOptions.type = false;
@@ -67760,7 +67367,7 @@ function createProjectionNode(_a2) {
67760
67367
  };
67761
67368
  ProjectionNode.prototype.setOptions = function(options) {
67762
67369
  var _a3;
67763
- this.options = __assign$3(__assign$3(__assign$3({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
67370
+ this.options = __assign$4(__assign$4(__assign$4({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
67764
67371
  };
67765
67372
  ProjectionNode.prototype.clearMeasurements = function() {
67766
67373
  this.scroll = void 0;
@@ -67878,7 +67485,7 @@ function createProjectionNode(_a2) {
67878
67485
  }
67879
67486
  var snapshot = this.snapshot;
67880
67487
  var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {};
67881
- var mixedValues = __assign$3({}, this.latestValues);
67488
+ var mixedValues = __assign$4({}, this.latestValues);
67882
67489
  var targetDelta = createDelta();
67883
67490
  this.relativeTarget = this.relativeTargetOrigin = void 0;
67884
67491
  this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
@@ -67921,7 +67528,7 @@ function createProjectionNode(_a2) {
67921
67528
  }
67922
67529
  this.pendingAnimation = sync.update(function() {
67923
67530
  globalProjectionState.hasAnimatedSinceResize = true;
67924
- _this.currentAnimation = animate(0, animationTarget, __assign$3(__assign$3({}, options), { onUpdate: function(latest) {
67531
+ _this.currentAnimation = animate(0, animationTarget, __assign$4(__assign$4({}, options), { onUpdate: function(latest) {
67925
67532
  var _a4;
67926
67533
  _this.mixTargetDelta(latest);
67927
67534
  (_a4 = options.onUpdate) === null || _a4 === void 0 ? void 0 : _a4.call(options, latest);
@@ -68289,7 +67896,7 @@ var HTMLProjectionNode = createProjectionNode({
68289
67896
  return Boolean(window.getComputedStyle(instance).position === "fixed");
68290
67897
  }
68291
67898
  });
68292
- var featureBundle = __assign$3(__assign$3(__assign$3(__assign$3({}, animations), gestureAnimations), drag), layoutFeatures);
67899
+ var featureBundle = __assign$4(__assign$4(__assign$4(__assign$4({}, animations), gestureAnimations), drag), layoutFeatures);
68293
67900
  var motion = /* @__PURE__ */ createMotionProxy(function(Component2, config2) {
68294
67901
  return createDomMotionConfig(Component2, config2, featureBundle, createDomVisualElement, HTMLProjectionNode);
68295
67902
  });