@gobolt/genesis 0.4.13 → 0.4.17

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.cjs CHANGED
@@ -37,7 +37,7 @@ function requireClassnames() {
37
37
  hasRequiredClassnames = 1;
38
38
  (function(module2) {
39
39
  (function() {
40
- var hasOwn2 = {}.hasOwnProperty;
40
+ var hasOwn = {}.hasOwnProperty;
41
41
  function classNames2() {
42
42
  var classes = "";
43
43
  for (var i = 0; i < arguments.length; i++) {
@@ -63,7 +63,7 @@ function requireClassnames() {
63
63
  }
64
64
  var classes = "";
65
65
  for (var key in arg) {
66
- if (hasOwn2.call(arg, key) && arg[key]) {
66
+ if (hasOwn.call(arg, key) && arg[key]) {
67
67
  classes = appendClass(classes, key);
68
68
  }
69
69
  }
@@ -3172,14 +3172,14 @@ function merge$2() {
3172
3172
  });
3173
3173
  return clone;
3174
3174
  }
3175
- function noop$5() {
3175
+ function noop$4() {
3176
3176
  }
3177
3177
  let deprecatedWarnList = null;
3178
3178
  function resetWarned() {
3179
3179
  deprecatedWarnList = null;
3180
3180
  resetWarned$1();
3181
3181
  }
3182
- let _warning = noop$5;
3182
+ let _warning = noop$4;
3183
3183
  if (process.env.NODE_ENV !== "production") {
3184
3184
  _warning = (valid2, component, message2) => {
3185
3185
  warningOnce(valid2, `[antd: ${component}] ${message2}`);
@@ -3220,7 +3220,7 @@ const devUseWarning = process.env.NODE_ENV !== "production" ? (component) => {
3220
3220
  } : () => {
3221
3221
  const noopWarning = () => {
3222
3222
  };
3223
- noopWarning.deprecated = noop$5;
3223
+ noopWarning.deprecated = noop$4;
3224
3224
  return noopWarning;
3225
3225
  };
3226
3226
  const ValidateMessagesContext = /* @__PURE__ */ React.createContext(void 0);
@@ -4928,12 +4928,12 @@ function merge$1() {
4928
4928
  return ret;
4929
4929
  }
4930
4930
  var statistic = {};
4931
- function noop$4() {
4931
+ function noop$3() {
4932
4932
  }
4933
4933
  var statisticToken = function statisticToken2(token2) {
4934
4934
  var tokenKeys2;
4935
4935
  var proxy = token2;
4936
- var flush = noop$4;
4936
+ var flush = noop$3;
4937
4937
  if (enableStatistic && typeof Proxy !== "undefined") {
4938
4938
  tokenKeys2 = /* @__PURE__ */ new Set();
4939
4939
  proxy = new Proxy(token2, {
@@ -44901,7 +44901,7 @@ if (process.env.NODE_ENV !== "production") {
44901
44901
  var defaultItemRender = function defaultItemRender2(page, type4, element2) {
44902
44902
  return element2;
44903
44903
  };
44904
- function noop$3() {
44904
+ function noop$2() {
44905
44905
  }
44906
44906
  function isInteger(v) {
44907
44907
  var value2 = Number(v);
@@ -44912,7 +44912,7 @@ function calculatePage(p, pageSize, total) {
44912
44912
  return Math.floor((total - 1) / _pageSize) + 1;
44913
44913
  }
44914
44914
  var Pagination$1 = function Pagination(props) {
44915
- var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-pagination" : _props$prefixCls, _props$selectPrefixCl = props.selectPrefixCls, selectPrefixCls = _props$selectPrefixCl === void 0 ? "rc-select" : _props$selectPrefixCl, className = props.className, currentProp = props.current, _props$defaultCurrent = props.defaultCurrent, defaultCurrent = _props$defaultCurrent === void 0 ? 1 : _props$defaultCurrent, _props$total = props.total, total = _props$total === void 0 ? 0 : _props$total, pageSizeProp = props.pageSize, _props$defaultPageSiz = props.defaultPageSize, defaultPageSize = _props$defaultPageSiz === void 0 ? 10 : _props$defaultPageSiz, _props$onChange = props.onChange, onChange = _props$onChange === void 0 ? noop$3 : _props$onChange, hideOnSinglePage = props.hideOnSinglePage, align = props.align, _props$showPrevNextJu = props.showPrevNextJumpers, showPrevNextJumpers = _props$showPrevNextJu === void 0 ? true : _props$showPrevNextJu, showQuickJumper = props.showQuickJumper, showLessItems = props.showLessItems, _props$showTitle = props.showTitle, showTitle = _props$showTitle === void 0 ? true : _props$showTitle, _props$onShowSizeChan = props.onShowSizeChange, onShowSizeChange = _props$onShowSizeChan === void 0 ? noop$3 : _props$onShowSizeChan, _props$locale = props.locale, locale2 = _props$locale === void 0 ? locale$1 : _props$locale, style2 = props.style, _props$totalBoundaryS = props.totalBoundaryShowSizeChanger, totalBoundaryShowSizeChanger = _props$totalBoundaryS === void 0 ? 50 : _props$totalBoundaryS, disabled2 = props.disabled, simple = props.simple, showTotal = props.showTotal, _props$showSizeChange = props.showSizeChanger, showSizeChanger = _props$showSizeChange === void 0 ? total > totalBoundaryShowSizeChanger : _props$showSizeChange, sizeChangerRender = props.sizeChangerRender, pageSizeOptions = props.pageSizeOptions, _props$itemRender = props.itemRender, itemRender = _props$itemRender === void 0 ? defaultItemRender : _props$itemRender, jumpPrevIcon = props.jumpPrevIcon, jumpNextIcon = props.jumpNextIcon, prevIcon = props.prevIcon, nextIcon = props.nextIcon;
44915
+ var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-pagination" : _props$prefixCls, _props$selectPrefixCl = props.selectPrefixCls, selectPrefixCls = _props$selectPrefixCl === void 0 ? "rc-select" : _props$selectPrefixCl, className = props.className, currentProp = props.current, _props$defaultCurrent = props.defaultCurrent, defaultCurrent = _props$defaultCurrent === void 0 ? 1 : _props$defaultCurrent, _props$total = props.total, total = _props$total === void 0 ? 0 : _props$total, pageSizeProp = props.pageSize, _props$defaultPageSiz = props.defaultPageSize, defaultPageSize = _props$defaultPageSiz === void 0 ? 10 : _props$defaultPageSiz, _props$onChange = props.onChange, onChange = _props$onChange === void 0 ? noop$2 : _props$onChange, hideOnSinglePage = props.hideOnSinglePage, align = props.align, _props$showPrevNextJu = props.showPrevNextJumpers, showPrevNextJumpers = _props$showPrevNextJu === void 0 ? true : _props$showPrevNextJu, showQuickJumper = props.showQuickJumper, showLessItems = props.showLessItems, _props$showTitle = props.showTitle, showTitle = _props$showTitle === void 0 ? true : _props$showTitle, _props$onShowSizeChan = props.onShowSizeChange, onShowSizeChange = _props$onShowSizeChan === void 0 ? noop$2 : _props$onShowSizeChan, _props$locale = props.locale, locale2 = _props$locale === void 0 ? locale$1 : _props$locale, style2 = props.style, _props$totalBoundaryS = props.totalBoundaryShowSizeChanger, totalBoundaryShowSizeChanger = _props$totalBoundaryS === void 0 ? 50 : _props$totalBoundaryS, disabled2 = props.disabled, simple = props.simple, showTotal = props.showTotal, _props$showSizeChange = props.showSizeChanger, showSizeChanger = _props$showSizeChange === void 0 ? total > totalBoundaryShowSizeChanger : _props$showSizeChange, sizeChangerRender = props.sizeChangerRender, pageSizeOptions = props.pageSizeOptions, _props$itemRender = props.itemRender, itemRender = _props$itemRender === void 0 ? defaultItemRender : _props$itemRender, jumpPrevIcon = props.jumpPrevIcon, jumpNextIcon = props.jumpNextIcon, prevIcon = props.prevIcon, nextIcon = props.nextIcon;
44916
44916
  var paginationRef = React.useRef(null);
44917
44917
  var _useMergedState = useMergedState(10, {
44918
44918
  value: pageSizeProp,
@@ -44929,7 +44929,7 @@ var Pagination$1 = function Pagination(props) {
44929
44929
  React.useEffect(function() {
44930
44930
  setInternalInputVal(current);
44931
44931
  }, [current]);
44932
- var hasOnChange = onChange !== noop$3;
44932
+ var hasOnChange = onChange !== noop$2;
44933
44933
  var hasCurrent = "current" in props;
44934
44934
  if (process.env.NODE_ENV !== "production") {
44935
44935
  warningOnce(hasCurrent ? hasOnChange : true, "You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");
@@ -53153,7 +53153,7 @@ var HIDDEN_STYLE = {
53153
53153
  padding: 0,
53154
53154
  margin: 0
53155
53155
  };
53156
- var noop$2 = function noop() {
53156
+ var noop$1 = function noop() {
53157
53157
  };
53158
53158
  var MOTION_KEY = "RC_TREE_MOTION_".concat(Math.random());
53159
53159
  var MotionNode = {
@@ -53289,7 +53289,7 @@ var NodeList = /* @__PURE__ */ React__namespace.forwardRef(function(props, ref)
53289
53289
  onFocus,
53290
53290
  onBlur,
53291
53291
  value: "",
53292
- onChange: noop$2,
53292
+ onChange: noop$1,
53293
53293
  "aria-label": "for screen reader"
53294
53294
  })), /* @__PURE__ */ React__namespace.createElement("div", {
53295
53295
  className: "".concat(prefixCls, "-treenode"),
@@ -72306,7 +72306,7 @@ var hasRequiredExtend;
72306
72306
  function requireExtend() {
72307
72307
  if (hasRequiredExtend) return extend$2;
72308
72308
  hasRequiredExtend = 1;
72309
- var hasOwn2 = Object.prototype.hasOwnProperty;
72309
+ var hasOwn = Object.prototype.hasOwnProperty;
72310
72310
  var toStr = Object.prototype.toString;
72311
72311
  var defineProperty = Object.defineProperty;
72312
72312
  var gOPD = Object.getOwnPropertyDescriptor;
@@ -72320,15 +72320,15 @@ function requireExtend() {
72320
72320
  if (!obj || toStr.call(obj) !== "[object Object]") {
72321
72321
  return false;
72322
72322
  }
72323
- var hasOwnConstructor = hasOwn2.call(obj, "constructor");
72324
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn2.call(obj.constructor.prototype, "isPrototypeOf");
72323
+ var hasOwnConstructor = hasOwn.call(obj, "constructor");
72324
+ var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
72325
72325
  if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
72326
72326
  return false;
72327
72327
  }
72328
72328
  var key;
72329
72329
  for (key in obj) {
72330
72330
  }
72331
- return typeof key === "undefined" || hasOwn2.call(obj, key);
72331
+ return typeof key === "undefined" || hasOwn.call(obj, key);
72332
72332
  };
72333
72333
  var setProperty = function setProperty2(target, options) {
72334
72334
  if (defineProperty && options.name === "__proto__") {
@@ -72344,7 +72344,7 @@ function requireExtend() {
72344
72344
  };
72345
72345
  var getProperty = function getProperty2(obj, name2) {
72346
72346
  if (name2 === "__proto__") {
72347
- if (!hasOwn2.call(obj, name2)) {
72347
+ if (!hasOwn.call(obj, name2)) {
72348
72348
  return void 0;
72349
72349
  } else if (gOPD) {
72350
72350
  return gOPD(obj, name2).value;
@@ -72394,7 +72394,7 @@ function requireExtend() {
72394
72394
  }
72395
72395
  var extendExports = requireExtend();
72396
72396
  const extend$1 = /* @__PURE__ */ getDefaultExportFromCjs(extendExports);
72397
- function isPlainObject$1(value2) {
72397
+ function isPlainObject(value2) {
72398
72398
  if (typeof value2 !== "object" || value2 === null) {
72399
72399
  return false;
72400
72400
  }
@@ -73798,7 +73798,7 @@ class Processor extends CallableInstance {
73798
73798
  } else if (parameters2.length > 0) {
73799
73799
  let [primary, ...rest] = parameters2;
73800
73800
  const currentPrimary = attachers[entryIndex][1];
73801
- if (isPlainObject$1(currentPrimary) && isPlainObject$1(primary)) {
73801
+ if (isPlainObject(currentPrimary) && isPlainObject(primary)) {
73802
73802
  primary = extend$1(true, currentPrimary, primary);
73803
73803
  }
73804
73804
  attachers[entryIndex] = [plugin, primary, ...rest];
@@ -73825,7 +73825,7 @@ function assertUnfrozen(name2, frozen) {
73825
73825
  }
73826
73826
  }
73827
73827
  function assertNode(node2) {
73828
- if (!isPlainObject$1(node2) || typeof node2.type !== "string") {
73828
+ if (!isPlainObject(node2) || typeof node2.type !== "string") {
73829
73829
  throw new TypeError("Expected node, got `" + node2 + "`");
73830
73830
  }
73831
73831
  }
@@ -74722,7 +74722,7 @@ function range2(start2, stop, step) {
74722
74722
  }
74723
74723
  return range3;
74724
74724
  }
74725
- var noop$1 = { value: () => {
74725
+ var noop2 = { value: () => {
74726
74726
  } };
74727
74727
  function dispatch() {
74728
74728
  for (var i = 0, n2 = arguments.length, _ = {}, t2; i < n2; ++i) {
@@ -74782,7 +74782,7 @@ function get$1(type4, name2) {
74782
74782
  function set$1(type4, name2, callback) {
74783
74783
  for (var i = 0, n2 = type4.length; i < n2; ++i) {
74784
74784
  if (type4[i].name === name2) {
74785
- type4[i] = noop$1, type4 = type4.slice(0, i).concat(type4.slice(i + 1));
74785
+ type4[i] = noop2, type4 = type4.slice(0, i).concat(type4.slice(i + 1));
74786
74786
  break;
74787
74787
  }
74788
74788
  }
@@ -80914,16 +80914,21 @@ const OverflowMenuContainer = styled.div`
80914
80914
  animation: ${({ $placement, $isAnimating }) => {
80915
80915
  if (!$isAnimating) return "none";
80916
80916
  switch ($placement) {
80917
- case "bottom":
80917
+ case "bottom": {
80918
80918
  return slideDown;
80919
- case "top":
80919
+ }
80920
+ case "top": {
80920
80921
  return slideUp;
80921
- case "left":
80922
+ }
80923
+ case "left": {
80922
80924
  return slideLeft;
80923
- case "right":
80925
+ }
80926
+ case "right": {
80924
80927
  return slideRight;
80925
- default:
80928
+ }
80929
+ default: {
80926
80930
  return slideDown;
80931
+ }
80927
80932
  }
80928
80933
  }}
80929
80934
  0.15s cubic-bezier(0.4, 0, 0.2, 1);
@@ -84331,1231 +84336,105 @@ const CustomPagination = ({
84331
84336
  }
84332
84337
  return null;
84333
84338
  };
84334
- var Subscribable = class {
84335
- constructor() {
84336
- this.listeners = /* @__PURE__ */ new Set();
84337
- this.subscribe = this.subscribe.bind(this);
84338
- }
84339
- subscribe(listener) {
84340
- this.listeners.add(listener);
84341
- this.onSubscribe();
84342
- return () => {
84343
- this.listeners.delete(listener);
84344
- this.onUnsubscribe();
84345
- };
84346
- }
84347
- hasListeners() {
84348
- return this.listeners.size > 0;
84349
- }
84350
- onSubscribe() {
84351
- }
84352
- onUnsubscribe() {
84353
- }
84354
- };
84355
- var defaultTimeoutProvider = {
84356
- // We need the wrapper function syntax below instead of direct references to
84357
- // global setTimeout etc.
84358
- //
84359
- // BAD: `setTimeout: setTimeout`
84360
- // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
84361
- //
84362
- // If we use direct references here, then anything that wants to spy on or
84363
- // replace the global setTimeout (like tests) won't work since we'll already
84364
- // have a hard reference to the original implementation at the time when this
84365
- // file was imported.
84366
- setTimeout: (callback, delay) => setTimeout(callback, delay),
84367
- clearTimeout: (timeoutId) => clearTimeout(timeoutId),
84368
- setInterval: (callback, delay) => setInterval(callback, delay),
84369
- clearInterval: (intervalId) => clearInterval(intervalId)
84370
- };
84371
- var TimeoutManager = class {
84372
- // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
84373
- // type at app boot; and if we leave that type, then any new timer provider
84374
- // would need to support ReturnType<typeof setTimeout>, which is infeasible.
84375
- //
84376
- // We settle for type safety for the TimeoutProvider type, and accept that
84377
- // this class is unsafe internally to allow for extension.
84378
- #provider = defaultTimeoutProvider;
84379
- #providerCalled = false;
84380
- setTimeoutProvider(provider) {
84381
- if (process.env.NODE_ENV !== "production") {
84382
- if (this.#providerCalled && provider !== this.#provider) {
84383
- console.error(
84384
- `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,
84385
- { previous: this.#provider, provider }
84386
- );
84387
- }
84388
- }
84389
- this.#provider = provider;
84390
- if (process.env.NODE_ENV !== "production") {
84391
- this.#providerCalled = false;
84392
- }
84393
- }
84394
- setTimeout(callback, delay) {
84395
- if (process.env.NODE_ENV !== "production") {
84396
- this.#providerCalled = true;
84397
- }
84398
- return this.#provider.setTimeout(callback, delay);
84399
- }
84400
- clearTimeout(timeoutId) {
84401
- this.#provider.clearTimeout(timeoutId);
84402
- }
84403
- setInterval(callback, delay) {
84404
- if (process.env.NODE_ENV !== "production") {
84405
- this.#providerCalled = true;
84406
- }
84407
- return this.#provider.setInterval(callback, delay);
84408
- }
84409
- clearInterval(intervalId) {
84410
- this.#provider.clearInterval(intervalId);
84411
- }
84412
- };
84413
- var timeoutManager = new TimeoutManager();
84414
- function systemSetTimeoutZero(callback) {
84415
- setTimeout(callback, 0);
84416
- }
84417
- var isServer = typeof window === "undefined" || "Deno" in globalThis;
84418
- function noop2() {
84419
- }
84420
- function isValidTimeout(value2) {
84421
- return typeof value2 === "number" && value2 >= 0 && value2 !== Infinity;
84422
- }
84423
- function timeUntilStale(updatedAt, staleTime) {
84424
- return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
84425
- }
84426
- function resolveStaleTime(staleTime, query) {
84427
- return typeof staleTime === "function" ? staleTime(query) : staleTime;
84428
- }
84429
- function resolveEnabled(enabled, query) {
84430
- return typeof enabled === "function" ? enabled(query) : enabled;
84431
- }
84432
- var hasOwn = Object.prototype.hasOwnProperty;
84433
- function replaceEqualDeep(a, b) {
84434
- if (a === b) {
84435
- return a;
84436
- }
84437
- const array4 = isPlainArray(a) && isPlainArray(b);
84438
- if (!array4 && !(isPlainObject(a) && isPlainObject(b))) return b;
84439
- const aItems = array4 ? a : Object.keys(a);
84440
- const aSize = aItems.length;
84441
- const bItems = array4 ? b : Object.keys(b);
84442
- const bSize = bItems.length;
84443
- const copy2 = array4 ? new Array(bSize) : {};
84444
- let equalItems = 0;
84445
- for (let i = 0; i < bSize; i++) {
84446
- const key = array4 ? i : bItems[i];
84447
- const aItem = a[key];
84448
- const bItem = b[key];
84449
- if (aItem === bItem) {
84450
- copy2[key] = aItem;
84451
- if (array4 ? i < aSize : hasOwn.call(a, key)) equalItems++;
84452
- continue;
84453
- }
84454
- if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
84455
- copy2[key] = bItem;
84456
- continue;
84457
- }
84458
- const v = replaceEqualDeep(aItem, bItem);
84459
- copy2[key] = v;
84460
- if (v === aItem) equalItems++;
84461
- }
84462
- return aSize === bSize && equalItems === aSize ? a : copy2;
84463
- }
84464
- function shallowEqualObjects(a, b) {
84465
- if (!b || Object.keys(a).length !== Object.keys(b).length) {
84466
- return false;
84467
- }
84468
- for (const key in a) {
84469
- if (a[key] !== b[key]) {
84470
- return false;
84471
- }
84472
- }
84473
- return true;
84474
- }
84475
- function isPlainArray(value2) {
84476
- return Array.isArray(value2) && value2.length === Object.keys(value2).length;
84477
- }
84478
- function isPlainObject(o2) {
84479
- if (!hasObjectPrototype(o2)) {
84480
- return false;
84481
- }
84482
- const ctor = o2.constructor;
84483
- if (ctor === void 0) {
84484
- return true;
84485
- }
84486
- const prot = ctor.prototype;
84487
- if (!hasObjectPrototype(prot)) {
84488
- return false;
84489
- }
84490
- if (!prot.hasOwnProperty("isPrototypeOf")) {
84491
- return false;
84492
- }
84493
- if (Object.getPrototypeOf(o2) !== Object.prototype) {
84494
- return false;
84495
- }
84496
- return true;
84497
- }
84498
- function hasObjectPrototype(o2) {
84499
- return Object.prototype.toString.call(o2) === "[object Object]";
84500
- }
84501
- function replaceData(prevData, data, options) {
84502
- if (typeof options.structuralSharing === "function") {
84503
- return options.structuralSharing(prevData, data);
84504
- } else if (options.structuralSharing !== false) {
84505
- if (process.env.NODE_ENV !== "production") {
84506
- try {
84507
- return replaceEqualDeep(prevData, data);
84508
- } catch (error2) {
84509
- console.error(
84510
- `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error2}`
84511
- );
84512
- throw error2;
84513
- }
84514
- }
84515
- return replaceEqualDeep(prevData, data);
84516
- }
84517
- return data;
84518
- }
84519
- function addToEnd(items, item, max2 = 0) {
84520
- const newItems = [...items, item];
84521
- return max2 && newItems.length > max2 ? newItems.slice(1) : newItems;
84522
- }
84523
- function addToStart(items, item, max2 = 0) {
84524
- const newItems = [item, ...items];
84525
- return max2 && newItems.length > max2 ? newItems.slice(0, -1) : newItems;
84526
- }
84527
- var skipToken = Symbol();
84528
- function ensureQueryFn(options, fetchOptions) {
84529
- if (process.env.NODE_ENV !== "production") {
84530
- if (options.queryFn === skipToken) {
84531
- console.error(
84532
- `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`
84533
- );
84534
- }
84535
- }
84536
- if (!options.queryFn && fetchOptions?.initialPromise) {
84537
- return () => fetchOptions.initialPromise;
84538
- }
84539
- if (!options.queryFn || options.queryFn === skipToken) {
84540
- return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));
84541
- }
84542
- return options.queryFn;
84543
- }
84544
- function shouldThrowError(throwOnError, params) {
84545
- if (typeof throwOnError === "function") {
84546
- return throwOnError(...params);
84547
- }
84548
- return !!throwOnError;
84549
- }
84550
- var FocusManager = class extends Subscribable {
84551
- #focused;
84552
- #cleanup;
84553
- #setup;
84554
- constructor() {
84555
- super();
84556
- this.#setup = (onFocus) => {
84557
- if (!isServer && window.addEventListener) {
84558
- const listener = () => onFocus();
84559
- window.addEventListener("visibilitychange", listener, false);
84560
- return () => {
84561
- window.removeEventListener("visibilitychange", listener);
84562
- };
84563
- }
84564
- return;
84565
- };
84566
- }
84567
- onSubscribe() {
84568
- if (!this.#cleanup) {
84569
- this.setEventListener(this.#setup);
84570
- }
84571
- }
84572
- onUnsubscribe() {
84573
- if (!this.hasListeners()) {
84574
- this.#cleanup?.();
84575
- this.#cleanup = void 0;
84576
- }
84577
- }
84578
- setEventListener(setup) {
84579
- this.#setup = setup;
84580
- this.#cleanup?.();
84581
- this.#cleanup = setup((focused) => {
84582
- if (typeof focused === "boolean") {
84583
- this.setFocused(focused);
84584
- } else {
84585
- this.onFocus();
84586
- }
84587
- });
84588
- }
84589
- setFocused(focused) {
84590
- const changed = this.#focused !== focused;
84591
- if (changed) {
84592
- this.#focused = focused;
84593
- this.onFocus();
84594
- }
84595
- }
84596
- onFocus() {
84597
- const isFocused = this.isFocused();
84598
- this.listeners.forEach((listener) => {
84599
- listener(isFocused);
84600
- });
84601
- }
84602
- isFocused() {
84603
- if (typeof this.#focused === "boolean") {
84604
- return this.#focused;
84605
- }
84606
- return globalThis.document?.visibilityState !== "hidden";
84607
- }
84608
- };
84609
- var focusManager = new FocusManager();
84610
- function pendingThenable() {
84611
- let resolve;
84612
- let reject;
84613
- const thenable = new Promise((_resolve, _reject) => {
84614
- resolve = _resolve;
84615
- reject = _reject;
84616
- });
84617
- thenable.status = "pending";
84618
- thenable.catch(() => {
84619
- });
84620
- function finalize(data) {
84621
- Object.assign(thenable, data);
84622
- delete thenable.resolve;
84623
- delete thenable.reject;
84624
- }
84625
- thenable.resolve = (value2) => {
84626
- finalize({
84627
- status: "fulfilled",
84628
- value: value2
84629
- });
84630
- resolve(value2);
84631
- };
84632
- thenable.reject = (reason) => {
84633
- finalize({
84634
- status: "rejected",
84635
- reason
84636
- });
84637
- reject(reason);
84638
- };
84639
- return thenable;
84640
- }
84641
- var defaultScheduler = systemSetTimeoutZero;
84642
- function createNotifyManager() {
84643
- let queue = [];
84644
- let transactions = 0;
84645
- let notifyFn = (callback) => {
84646
- callback();
84647
- };
84648
- let batchNotifyFn = (callback) => {
84649
- callback();
84650
- };
84651
- let scheduleFn = defaultScheduler;
84652
- const schedule2 = (callback) => {
84653
- if (transactions) {
84654
- queue.push(callback);
84655
- } else {
84656
- scheduleFn(() => {
84657
- notifyFn(callback);
84658
- });
84659
- }
84660
- };
84661
- const flush = () => {
84662
- const originalQueue = queue;
84663
- queue = [];
84664
- if (originalQueue.length) {
84665
- scheduleFn(() => {
84666
- batchNotifyFn(() => {
84667
- originalQueue.forEach((callback) => {
84668
- notifyFn(callback);
84669
- });
84670
- });
84671
- });
84672
- }
84673
- };
84674
- return {
84675
- batch: (callback) => {
84676
- let result;
84677
- transactions++;
84339
+ const useInfiniteQuery = ({
84340
+ queryKey: queryKey2,
84341
+ queryFn,
84342
+ initialPageParam,
84343
+ getNextPageParam
84344
+ }) => {
84345
+ const [pages, setPages] = React.useState([]);
84346
+ const [error2, setError] = React.useState(null);
84347
+ const [isFetchingNextPage, setIsFetchingNextPage] = React.useState(false);
84348
+ const [status, setStatus] = React.useState(
84349
+ "pending"
84350
+ );
84351
+ const [hasNextPage, setHasNextPage] = React.useState(true);
84352
+ const [isInitialLoad, setIsInitialLoad] = React.useState(true);
84353
+ const abortControllerRef = React.useRef(null);
84354
+ const isFetchingRef = React.useRef(false);
84355
+ React.useEffect(() => {
84356
+ setPages([]);
84357
+ setError(null);
84358
+ setStatus("pending");
84359
+ setHasNextPage(true);
84360
+ setIsInitialLoad(true);
84361
+ isFetchingRef.current = false;
84362
+ }, [queryKey2]);
84363
+ const fetchPage = React.useCallback(
84364
+ async (pageParam) => {
84365
+ if (isFetchingRef.current) return;
84366
+ isFetchingRef.current = true;
84367
+ setError(null);
84368
+ if (abortControllerRef.current) {
84369
+ abortControllerRef.current.abort();
84370
+ }
84371
+ abortControllerRef.current = new AbortController();
84678
84372
  try {
84679
- result = callback();
84680
- } finally {
84681
- transactions--;
84682
- if (!transactions) {
84683
- flush();
84373
+ const result = await queryFn({ pageParam });
84374
+ if (abortControllerRef.current?.signal.aborted) {
84375
+ return;
84684
84376
  }
84685
- }
84686
- return result;
84687
- },
84688
- /**
84689
- * All calls to the wrapped function will be batched.
84690
- */
84691
- batchCalls: (callback) => {
84692
- return (...args) => {
84693
- schedule2(() => {
84694
- callback(...args);
84695
- });
84696
- };
84697
- },
84698
- schedule: schedule2,
84699
- /**
84700
- * Use this method to set a custom notify function.
84701
- * This can be used to for example wrap notifications with `React.act` while running tests.
84702
- */
84703
- setNotifyFunction: (fn) => {
84704
- notifyFn = fn;
84705
- },
84706
- /**
84707
- * Use this method to set a custom function to batch notifications together into a single tick.
84708
- * By default React Query will use the batch function provided by ReactDOM or React Native.
84709
- */
84710
- setBatchNotifyFunction: (fn) => {
84711
- batchNotifyFn = fn;
84712
- },
84713
- setScheduler: (fn) => {
84714
- scheduleFn = fn;
84715
- }
84716
- };
84717
- }
84718
- var notifyManager = createNotifyManager();
84719
- var OnlineManager = class extends Subscribable {
84720
- #online = true;
84721
- #cleanup;
84722
- #setup;
84723
- constructor() {
84724
- super();
84725
- this.#setup = (onOnline) => {
84726
- if (!isServer && window.addEventListener) {
84727
- const onlineListener = () => onOnline(true);
84728
- const offlineListener = () => onOnline(false);
84729
- window.addEventListener("online", onlineListener, false);
84730
- window.addEventListener("offline", offlineListener, false);
84731
- return () => {
84732
- window.removeEventListener("online", onlineListener);
84733
- window.removeEventListener("offline", offlineListener);
84734
- };
84735
- }
84736
- return;
84737
- };
84738
- }
84739
- onSubscribe() {
84740
- if (!this.#cleanup) {
84741
- this.setEventListener(this.#setup);
84742
- }
84743
- }
84744
- onUnsubscribe() {
84745
- if (!this.hasListeners()) {
84746
- this.#cleanup?.();
84747
- this.#cleanup = void 0;
84748
- }
84749
- }
84750
- setEventListener(setup) {
84751
- this.#setup = setup;
84752
- this.#cleanup?.();
84753
- this.#cleanup = setup(this.setOnline.bind(this));
84754
- }
84755
- setOnline(online) {
84756
- const changed = this.#online !== online;
84757
- if (changed) {
84758
- this.#online = online;
84759
- this.listeners.forEach((listener) => {
84760
- listener(online);
84761
- });
84762
- }
84763
- }
84764
- isOnline() {
84765
- return this.#online;
84766
- }
84767
- };
84768
- var onlineManager = new OnlineManager();
84769
- function canFetch(networkMode) {
84770
- return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
84771
- }
84772
- function fetchState(data, options) {
84773
- return {
84774
- fetchFailureCount: 0,
84775
- fetchFailureReason: null,
84776
- fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
84777
- ...data === void 0 && {
84778
- error: null,
84779
- status: "pending"
84780
- }
84781
- };
84782
- }
84783
- var QueryObserver = class extends Subscribable {
84784
- constructor(client, options) {
84785
- super();
84786
- this.options = options;
84787
- this.#client = client;
84788
- this.#selectError = null;
84789
- this.#currentThenable = pendingThenable();
84790
- this.bindMethods();
84791
- this.setOptions(options);
84792
- }
84793
- #client;
84794
- #currentQuery = void 0;
84795
- #currentQueryInitialState = void 0;
84796
- #currentResult = void 0;
84797
- #currentResultState;
84798
- #currentResultOptions;
84799
- #currentThenable;
84800
- #selectError;
84801
- #selectFn;
84802
- #selectResult;
84803
- // This property keeps track of the last query with defined data.
84804
- // It will be used to pass the previous data and query to the placeholder function between renders.
84805
- #lastQueryWithDefinedData;
84806
- #staleTimeoutId;
84807
- #refetchIntervalId;
84808
- #currentRefetchInterval;
84809
- #trackedProps = /* @__PURE__ */ new Set();
84810
- bindMethods() {
84811
- this.refetch = this.refetch.bind(this);
84812
- }
84813
- onSubscribe() {
84814
- if (this.listeners.size === 1) {
84815
- this.#currentQuery.addObserver(this);
84816
- if (shouldFetchOnMount(this.#currentQuery, this.options)) {
84817
- this.#executeFetch();
84818
- } else {
84819
- this.updateResult();
84820
- }
84821
- this.#updateTimers();
84822
- }
84823
- }
84824
- onUnsubscribe() {
84825
- if (!this.hasListeners()) {
84826
- this.destroy();
84827
- }
84828
- }
84829
- shouldFetchOnReconnect() {
84830
- return shouldFetchOn(
84831
- this.#currentQuery,
84832
- this.options,
84833
- this.options.refetchOnReconnect
84834
- );
84835
- }
84836
- shouldFetchOnWindowFocus() {
84837
- return shouldFetchOn(
84838
- this.#currentQuery,
84839
- this.options,
84840
- this.options.refetchOnWindowFocus
84841
- );
84842
- }
84843
- destroy() {
84844
- this.listeners = /* @__PURE__ */ new Set();
84845
- this.#clearStaleTimeout();
84846
- this.#clearRefetchInterval();
84847
- this.#currentQuery.removeObserver(this);
84848
- }
84849
- setOptions(options) {
84850
- const prevOptions = this.options;
84851
- const prevQuery = this.#currentQuery;
84852
- this.options = this.#client.defaultQueryOptions(options);
84853
- if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") {
84854
- throw new Error(
84855
- "Expected enabled to be a boolean or a callback that returns a boolean"
84856
- );
84857
- }
84858
- this.#updateQuery();
84859
- this.#currentQuery.setOptions(this.options);
84860
- if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {
84861
- this.#client.getQueryCache().notify({
84862
- type: "observerOptionsUpdated",
84863
- query: this.#currentQuery,
84864
- observer: this
84865
- });
84866
- }
84867
- const mounted = this.hasListeners();
84868
- if (mounted && shouldFetchOptionally(
84869
- this.#currentQuery,
84870
- prevQuery,
84871
- this.options,
84872
- prevOptions
84873
- )) {
84874
- this.#executeFetch();
84875
- }
84876
- this.updateResult();
84877
- if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) {
84878
- this.#updateStaleTimeout();
84879
- }
84880
- const nextRefetchInterval = this.#computeRefetchInterval();
84881
- if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) {
84882
- this.#updateRefetchInterval(nextRefetchInterval);
84883
- }
84884
- }
84885
- getOptimisticResult(options) {
84886
- const query = this.#client.getQueryCache().build(this.#client, options);
84887
- const result = this.createResult(query, options);
84888
- if (shouldAssignObserverCurrentProperties(this, result)) {
84889
- this.#currentResult = result;
84890
- this.#currentResultOptions = this.options;
84891
- this.#currentResultState = this.#currentQuery.state;
84892
- }
84893
- return result;
84894
- }
84895
- getCurrentResult() {
84896
- return this.#currentResult;
84897
- }
84898
- trackResult(result, onPropTracked) {
84899
- return new Proxy(result, {
84900
- get: (target, key) => {
84901
- this.trackProp(key);
84902
- onPropTracked?.(key);
84903
- if (key === "promise" && !this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") {
84904
- this.#currentThenable.reject(
84905
- new Error(
84906
- "experimental_prefetchInRender feature flag is not enabled"
84907
- )
84377
+ setPages((prevPages) => {
84378
+ const pageExists = prevPages.some(
84379
+ (page) => page.page === result.page
84908
84380
  );
84381
+ if (pageExists) {
84382
+ return prevPages;
84383
+ }
84384
+ return [...prevPages, result];
84385
+ });
84386
+ setStatus("success");
84387
+ setHasNextPage(result.hasNextPage);
84388
+ if (isInitialLoad) {
84389
+ setIsInitialLoad(false);
84909
84390
  }
84910
- return Reflect.get(target, key);
84911
- }
84912
- });
84913
- }
84914
- trackProp(key) {
84915
- this.#trackedProps.add(key);
84916
- }
84917
- getCurrentQuery() {
84918
- return this.#currentQuery;
84919
- }
84920
- refetch({ ...options } = {}) {
84921
- return this.fetch({
84922
- ...options
84923
- });
84924
- }
84925
- fetchOptimistic(options) {
84926
- const defaultedOptions = this.#client.defaultQueryOptions(options);
84927
- const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);
84928
- return query.fetch().then(() => this.createResult(query, defaultedOptions));
84929
- }
84930
- fetch(fetchOptions) {
84931
- return this.#executeFetch({
84932
- ...fetchOptions,
84933
- cancelRefetch: fetchOptions.cancelRefetch ?? true
84934
- }).then(() => {
84935
- this.updateResult();
84936
- return this.#currentResult;
84937
- });
84938
- }
84939
- #executeFetch(fetchOptions) {
84940
- this.#updateQuery();
84941
- let promise = this.#currentQuery.fetch(
84942
- this.options,
84943
- fetchOptions
84944
- );
84945
- if (!fetchOptions?.throwOnError) {
84946
- promise = promise.catch(noop2);
84947
- }
84948
- return promise;
84949
- }
84950
- #updateStaleTimeout() {
84951
- this.#clearStaleTimeout();
84952
- const staleTime = resolveStaleTime(
84953
- this.options.staleTime,
84954
- this.#currentQuery
84955
- );
84956
- if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {
84957
- return;
84958
- }
84959
- const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);
84960
- const timeout2 = time + 1;
84961
- this.#staleTimeoutId = timeoutManager.setTimeout(() => {
84962
- if (!this.#currentResult.isStale) {
84963
- this.updateResult();
84964
- }
84965
- }, timeout2);
84966
- }
84967
- #computeRefetchInterval() {
84968
- return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;
84969
- }
84970
- #updateRefetchInterval(nextInterval) {
84971
- this.#clearRefetchInterval();
84972
- this.#currentRefetchInterval = nextInterval;
84973
- if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {
84974
- return;
84975
- }
84976
- this.#refetchIntervalId = timeoutManager.setInterval(() => {
84977
- if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {
84978
- this.#executeFetch();
84979
- }
84980
- }, this.#currentRefetchInterval);
84981
- }
84982
- #updateTimers() {
84983
- this.#updateStaleTimeout();
84984
- this.#updateRefetchInterval(this.#computeRefetchInterval());
84985
- }
84986
- #clearStaleTimeout() {
84987
- if (this.#staleTimeoutId) {
84988
- timeoutManager.clearTimeout(this.#staleTimeoutId);
84989
- this.#staleTimeoutId = void 0;
84990
- }
84991
- }
84992
- #clearRefetchInterval() {
84993
- if (this.#refetchIntervalId) {
84994
- timeoutManager.clearInterval(this.#refetchIntervalId);
84995
- this.#refetchIntervalId = void 0;
84996
- }
84997
- }
84998
- createResult(query, options) {
84999
- const prevQuery = this.#currentQuery;
85000
- const prevOptions = this.options;
85001
- const prevResult = this.#currentResult;
85002
- const prevResultState = this.#currentResultState;
85003
- const prevResultOptions = this.#currentResultOptions;
85004
- const queryChange = query !== prevQuery;
85005
- const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;
85006
- const { state } = query;
85007
- let newState = { ...state };
85008
- let isPlaceholderData = false;
85009
- let data;
85010
- if (options._optimisticResults) {
85011
- const mounted = this.hasListeners();
85012
- const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
85013
- const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
85014
- if (fetchOnMount || fetchOptionally) {
85015
- newState = {
85016
- ...newState,
85017
- ...fetchState(state.data, query.options)
85018
- };
85019
- }
85020
- if (options._optimisticResults === "isRestoring") {
85021
- newState.fetchStatus = "idle";
85022
- }
85023
- }
85024
- let { error: error2, errorUpdatedAt, status } = newState;
85025
- data = newState.data;
85026
- let skipSelect = false;
85027
- if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
85028
- let placeholderData;
85029
- if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
85030
- placeholderData = prevResult.data;
85031
- skipSelect = true;
85032
- } else {
85033
- placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(
85034
- this.#lastQueryWithDefinedData?.state.data,
85035
- this.#lastQueryWithDefinedData
85036
- ) : options.placeholderData;
85037
- }
85038
- if (placeholderData !== void 0) {
85039
- status = "success";
85040
- data = replaceData(
85041
- prevResult?.data,
85042
- placeholderData,
85043
- options
85044
- );
85045
- isPlaceholderData = true;
85046
- }
85047
- }
85048
- if (options.select && data !== void 0 && !skipSelect) {
85049
- if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) {
85050
- data = this.#selectResult;
85051
- } else {
85052
- try {
85053
- this.#selectFn = options.select;
85054
- data = options.select(data);
85055
- data = replaceData(prevResult?.data, data, options);
85056
- this.#selectResult = data;
85057
- this.#selectError = null;
85058
- } catch (selectError) {
85059
- this.#selectError = selectError;
85060
- }
85061
- }
85062
- }
85063
- if (this.#selectError) {
85064
- error2 = this.#selectError;
85065
- data = this.#selectResult;
85066
- errorUpdatedAt = Date.now();
85067
- status = "error";
85068
- }
85069
- const isFetching = newState.fetchStatus === "fetching";
85070
- const isPending = status === "pending";
85071
- const isError = status === "error";
85072
- const isLoading = isPending && isFetching;
85073
- const hasData = data !== void 0;
85074
- const result = {
85075
- status,
85076
- fetchStatus: newState.fetchStatus,
85077
- isPending,
85078
- isSuccess: status === "success",
85079
- isError,
85080
- isInitialLoading: isLoading,
85081
- isLoading,
85082
- data,
85083
- dataUpdatedAt: newState.dataUpdatedAt,
85084
- error: error2,
85085
- errorUpdatedAt,
85086
- failureCount: newState.fetchFailureCount,
85087
- failureReason: newState.fetchFailureReason,
85088
- errorUpdateCount: newState.errorUpdateCount,
85089
- isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
85090
- isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
85091
- isFetching,
85092
- isRefetching: isFetching && !isPending,
85093
- isLoadingError: isError && !hasData,
85094
- isPaused: newState.fetchStatus === "paused",
85095
- isPlaceholderData,
85096
- isRefetchError: isError && hasData,
85097
- isStale: isStale(query, options),
85098
- refetch: this.refetch,
85099
- promise: this.#currentThenable,
85100
- isEnabled: resolveEnabled(options.enabled, query) !== false
85101
- };
85102
- const nextResult = result;
85103
- if (this.options.experimental_prefetchInRender) {
85104
- const finalizeThenableIfPossible = (thenable) => {
85105
- if (nextResult.status === "error") {
85106
- thenable.reject(nextResult.error);
85107
- } else if (nextResult.data !== void 0) {
85108
- thenable.resolve(nextResult.data);
84391
+ } catch (error_) {
84392
+ if (abortControllerRef.current?.signal.aborted) {
84393
+ return;
85109
84394
  }
85110
- };
85111
- const recreateThenable = () => {
85112
- const pending = this.#currentThenable = nextResult.promise = pendingThenable();
85113
- finalizeThenableIfPossible(pending);
85114
- };
85115
- const prevThenable = this.#currentThenable;
85116
- switch (prevThenable.status) {
85117
- case "pending":
85118
- if (query.queryHash === prevQuery.queryHash) {
85119
- finalizeThenableIfPossible(prevThenable);
85120
- }
85121
- break;
85122
- case "fulfilled":
85123
- if (nextResult.status === "error" || nextResult.data !== prevThenable.value) {
85124
- recreateThenable();
85125
- }
85126
- break;
85127
- case "rejected":
85128
- if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) {
85129
- recreateThenable();
85130
- }
85131
- break;
85132
- }
85133
- }
85134
- return nextResult;
85135
- }
85136
- updateResult() {
85137
- const prevResult = this.#currentResult;
85138
- const nextResult = this.createResult(this.#currentQuery, this.options);
85139
- this.#currentResultState = this.#currentQuery.state;
85140
- this.#currentResultOptions = this.options;
85141
- if (this.#currentResultState.data !== void 0) {
85142
- this.#lastQueryWithDefinedData = this.#currentQuery;
85143
- }
85144
- if (shallowEqualObjects(nextResult, prevResult)) {
85145
- return;
85146
- }
85147
- this.#currentResult = nextResult;
85148
- const shouldNotifyListeners = () => {
85149
- if (!prevResult) {
85150
- return true;
85151
- }
85152
- const { notifyOnChangeProps } = this.options;
85153
- const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
85154
- if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) {
85155
- return true;
85156
- }
85157
- const includedProps = new Set(
85158
- notifyOnChangePropsValue ?? this.#trackedProps
85159
- );
85160
- if (this.options.throwOnError) {
85161
- includedProps.add("error");
84395
+ const error22 = error_ instanceof Error ? error_ : new Error("Unknown error occurred");
84396
+ setError(error22);
84397
+ setStatus("error");
84398
+ } finally {
84399
+ isFetchingRef.current = false;
84400
+ setIsFetchingNextPage(false);
85162
84401
  }
85163
- return Object.keys(this.#currentResult).some((key) => {
85164
- const typedKey = key;
85165
- const changed = this.#currentResult[typedKey] !== prevResult[typedKey];
85166
- return changed && includedProps.has(typedKey);
85167
- });
85168
- };
85169
- this.#notify({ listeners: shouldNotifyListeners() });
85170
- }
85171
- #updateQuery() {
85172
- const query = this.#client.getQueryCache().build(this.#client, this.options);
85173
- if (query === this.#currentQuery) {
84402
+ },
84403
+ [queryFn, isInitialLoad]
84404
+ );
84405
+ const fetchNextPage = React.useCallback(() => {
84406
+ if (isFetchingRef.current || !hasNextPage) return;
84407
+ const lastPage = pages.at(-1);
84408
+ if (!lastPage) return;
84409
+ const nextPageParam = getNextPageParam(lastPage);
84410
+ if (nextPageParam === void 0) {
84411
+ setHasNextPage(false);
85174
84412
  return;
85175
84413
  }
85176
- const prevQuery = this.#currentQuery;
85177
- this.#currentQuery = query;
85178
- this.#currentQueryInitialState = query.state;
85179
- if (this.hasListeners()) {
85180
- prevQuery?.removeObserver(this);
85181
- query.addObserver(this);
85182
- }
85183
- }
85184
- onQueryUpdate() {
85185
- this.updateResult();
85186
- if (this.hasListeners()) {
85187
- this.#updateTimers();
85188
- }
85189
- }
85190
- #notify(notifyOptions) {
85191
- notifyManager.batch(() => {
85192
- if (notifyOptions.listeners) {
85193
- this.listeners.forEach((listener) => {
85194
- listener(this.#currentResult);
85195
- });
85196
- }
85197
- this.#client.getQueryCache().notify({
85198
- query: this.#currentQuery,
85199
- type: "observerResultsUpdated"
85200
- });
85201
- });
85202
- }
85203
- };
85204
- function shouldLoadOnMount(query, options) {
85205
- return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
85206
- }
85207
- function shouldFetchOnMount(query, options) {
85208
- return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
85209
- }
85210
- function shouldFetchOn(query, options, field) {
85211
- if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
85212
- const value2 = typeof field === "function" ? field(query) : field;
85213
- return value2 === "always" || value2 !== false && isStale(query, options);
85214
- }
85215
- return false;
85216
- }
85217
- function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
85218
- return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
85219
- }
85220
- function isStale(query, options) {
85221
- return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
85222
- }
85223
- function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
85224
- if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {
85225
- return true;
85226
- }
85227
- return false;
85228
- }
85229
- function infiniteQueryBehavior(pages) {
85230
- return {
85231
- onFetch: (context, query) => {
85232
- const options = context.options;
85233
- const direction = context.fetchOptions?.meta?.fetchMore?.direction;
85234
- const oldPages = context.state.data?.pages || [];
85235
- const oldPageParams = context.state.data?.pageParams || [];
85236
- let result = { pages: [], pageParams: [] };
85237
- let currentPage = 0;
85238
- const fetchFn = async () => {
85239
- let cancelled = false;
85240
- const addSignalProperty = (object4) => {
85241
- Object.defineProperty(object4, "signal", {
85242
- enumerable: true,
85243
- get: () => {
85244
- if (context.signal.aborted) {
85245
- cancelled = true;
85246
- } else {
85247
- context.signal.addEventListener("abort", () => {
85248
- cancelled = true;
85249
- });
85250
- }
85251
- return context.signal;
85252
- }
85253
- });
85254
- };
85255
- const queryFn = ensureQueryFn(context.options, context.fetchOptions);
85256
- const fetchPage = async (data, param, previous2) => {
85257
- if (cancelled) {
85258
- return Promise.reject();
85259
- }
85260
- if (param == null && data.pages.length) {
85261
- return Promise.resolve(data);
85262
- }
85263
- const createQueryFnContext = () => {
85264
- const queryFnContext2 = {
85265
- client: context.client,
85266
- queryKey: context.queryKey,
85267
- pageParam: param,
85268
- direction: previous2 ? "backward" : "forward",
85269
- meta: context.options.meta
85270
- };
85271
- addSignalProperty(queryFnContext2);
85272
- return queryFnContext2;
85273
- };
85274
- const queryFnContext = createQueryFnContext();
85275
- const page = await queryFn(queryFnContext);
85276
- const { maxPages } = context.options;
85277
- const addTo = previous2 ? addToStart : addToEnd;
85278
- return {
85279
- pages: addTo(data.pages, page, maxPages),
85280
- pageParams: addTo(data.pageParams, param, maxPages)
85281
- };
85282
- };
85283
- if (direction && oldPages.length) {
85284
- const previous2 = direction === "backward";
85285
- const pageParamFn = previous2 ? getPreviousPageParam : getNextPageParam;
85286
- const oldData = {
85287
- pages: oldPages,
85288
- pageParams: oldPageParams
85289
- };
85290
- const param = pageParamFn(options, oldData);
85291
- result = await fetchPage(oldData, param, previous2);
85292
- } else {
85293
- const remainingPages = oldPages.length;
85294
- do {
85295
- const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
85296
- if (currentPage > 0 && param == null) {
85297
- break;
85298
- }
85299
- result = await fetchPage(result, param);
85300
- currentPage++;
85301
- } while (currentPage < remainingPages);
85302
- }
85303
- return result;
85304
- };
85305
- if (context.options.persister) {
85306
- context.fetchFn = () => {
85307
- return context.options.persister?.(
85308
- fetchFn,
85309
- {
85310
- client: context.client,
85311
- queryKey: context.queryKey,
85312
- meta: context.options.meta,
85313
- signal: context.signal
85314
- },
85315
- query
85316
- );
85317
- };
85318
- } else {
85319
- context.fetchFn = fetchFn;
85320
- }
84414
+ setIsFetchingNextPage(true);
84415
+ fetchPage(nextPageParam);
84416
+ }, [pages, hasNextPage, getNextPageParam, fetchPage]);
84417
+ React.useEffect(() => {
84418
+ if (isInitialLoad && pages.length === 0) {
84419
+ fetchPage(initialPageParam);
85321
84420
  }
85322
- };
85323
- }
85324
- function getNextPageParam(options, { pages, pageParams }) {
85325
- const lastIndex = pages.length - 1;
85326
- return pages.length > 0 ? options.getNextPageParam(
85327
- pages[lastIndex],
85328
- pages,
85329
- pageParams[lastIndex],
85330
- pageParams
85331
- ) : void 0;
85332
- }
85333
- function getPreviousPageParam(options, { pages, pageParams }) {
85334
- return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
85335
- }
85336
- function hasNextPage(options, data) {
85337
- if (!data) return false;
85338
- return getNextPageParam(options, data) != null;
85339
- }
85340
- function hasPreviousPage(options, data) {
85341
- if (!data || !options.getPreviousPageParam) return false;
85342
- return getPreviousPageParam(options, data) != null;
85343
- }
85344
- var InfiniteQueryObserver = class extends QueryObserver {
85345
- constructor(client, options) {
85346
- super(client, options);
85347
- }
85348
- bindMethods() {
85349
- super.bindMethods();
85350
- this.fetchNextPage = this.fetchNextPage.bind(this);
85351
- this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
85352
- }
85353
- setOptions(options) {
85354
- super.setOptions({
85355
- ...options,
85356
- behavior: infiniteQueryBehavior()
85357
- });
85358
- }
85359
- getOptimisticResult(options) {
85360
- options.behavior = infiniteQueryBehavior();
85361
- return super.getOptimisticResult(options);
85362
- }
85363
- fetchNextPage(options) {
85364
- return this.fetch({
85365
- ...options,
85366
- meta: {
85367
- fetchMore: { direction: "forward" }
85368
- }
85369
- });
85370
- }
85371
- fetchPreviousPage(options) {
85372
- return this.fetch({
85373
- ...options,
85374
- meta: {
85375
- fetchMore: { direction: "backward" }
84421
+ }, [isInitialLoad, pages.length, fetchPage, initialPageParam]);
84422
+ React.useEffect(() => {
84423
+ return () => {
84424
+ if (abortControllerRef.current) {
84425
+ abortControllerRef.current.abort();
85376
84426
  }
85377
- });
85378
- }
85379
- createResult(query, options) {
85380
- const { state } = query;
85381
- const parentResult = super.createResult(query, options);
85382
- const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
85383
- const fetchDirection = state.fetchMeta?.fetchMore?.direction;
85384
- const isFetchNextPageError = isError && fetchDirection === "forward";
85385
- const isFetchingNextPage = isFetching && fetchDirection === "forward";
85386
- const isFetchPreviousPageError = isError && fetchDirection === "backward";
85387
- const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
85388
- const result = {
85389
- ...parentResult,
85390
- fetchNextPage: this.fetchNextPage,
85391
- fetchPreviousPage: this.fetchPreviousPage,
85392
- hasNextPage: hasNextPage(options, state.data),
85393
- hasPreviousPage: hasPreviousPage(options, state.data),
85394
- isFetchNextPageError,
85395
- isFetchingNextPage,
85396
- isFetchPreviousPageError,
85397
- isFetchingPreviousPage,
85398
- isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
85399
- isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
85400
84427
  };
85401
- return result;
85402
- }
85403
- };
85404
- var QueryClientContext = React__namespace.createContext(
85405
- void 0
85406
- );
85407
- var useQueryClient = (queryClient) => {
85408
- const client = React__namespace.useContext(QueryClientContext);
85409
- if (!client) {
85410
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
85411
- }
85412
- return client;
85413
- };
85414
- var IsRestoringContext = React__namespace.createContext(false);
85415
- var useIsRestoring = () => React__namespace.useContext(IsRestoringContext);
85416
- IsRestoringContext.Provider;
85417
- function createValue() {
85418
- let isReset = false;
84428
+ }, []);
85419
84429
  return {
85420
- clearReset: () => {
85421
- isReset = false;
85422
- },
85423
- reset: () => {
85424
- isReset = true;
85425
- },
85426
- isReset: () => {
85427
- return isReset;
85428
- }
84430
+ data: pages.length > 0 ? { pages } : void 0,
84431
+ error: error2,
84432
+ fetchNextPage,
84433
+ hasNextPage,
84434
+ isFetchingNextPage,
84435
+ status
85429
84436
  };
85430
- }
85431
- var QueryErrorResetBoundaryContext = React__namespace.createContext(createValue());
85432
- var useQueryErrorResetBoundary = () => React__namespace.useContext(QueryErrorResetBoundaryContext);
85433
- var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
85434
- if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {
85435
- if (!errorResetBoundary.isReset()) {
85436
- options.retryOnMount = false;
85437
- }
85438
- }
85439
- };
85440
- var useClearResetErrorBoundary = (errorResetBoundary) => {
85441
- React__namespace.useEffect(() => {
85442
- errorResetBoundary.clearReset();
85443
- }, [errorResetBoundary]);
85444
- };
85445
- var getHasError = ({
85446
- result,
85447
- errorResetBoundary,
85448
- throwOnError,
85449
- query,
85450
- suspense
85451
- }) => {
85452
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
85453
- };
85454
- var ensureSuspenseTimers = (defaultedOptions) => {
85455
- if (defaultedOptions.suspense) {
85456
- const MIN_SUSPENSE_TIME_MS = 1e3;
85457
- const clamp = (value2) => value2 === "static" ? value2 : Math.max(value2 ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
85458
- const originalStaleTime = defaultedOptions.staleTime;
85459
- defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
85460
- if (typeof defaultedOptions.gcTime === "number") {
85461
- defaultedOptions.gcTime = Math.max(
85462
- defaultedOptions.gcTime,
85463
- MIN_SUSPENSE_TIME_MS
85464
- );
85465
- }
85466
- }
85467
84437
  };
85468
- var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
85469
- var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
85470
- var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
85471
- errorResetBoundary.clearReset();
85472
- });
85473
- function useBaseQuery(options, Observer, queryClient) {
85474
- if (process.env.NODE_ENV !== "production") {
85475
- if (typeof options !== "object" || Array.isArray(options)) {
85476
- throw new Error(
85477
- 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
85478
- );
85479
- }
85480
- }
85481
- const isRestoring = useIsRestoring();
85482
- const errorResetBoundary = useQueryErrorResetBoundary();
85483
- const client = useQueryClient();
85484
- const defaultedOptions = client.defaultQueryOptions(options);
85485
- client.getDefaultOptions().queries?._experimental_beforeQuery?.(
85486
- defaultedOptions
85487
- );
85488
- if (process.env.NODE_ENV !== "production") {
85489
- if (!defaultedOptions.queryFn) {
85490
- console.error(
85491
- `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
85492
- );
85493
- }
85494
- }
85495
- defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
85496
- ensureSuspenseTimers(defaultedOptions);
85497
- ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
85498
- useClearResetErrorBoundary(errorResetBoundary);
85499
- const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
85500
- const [observer] = React__namespace.useState(
85501
- () => new Observer(
85502
- client,
85503
- defaultedOptions
85504
- )
85505
- );
85506
- const result = observer.getOptimisticResult(defaultedOptions);
85507
- const shouldSubscribe = !isRestoring && options.subscribed !== false;
85508
- React__namespace.useSyncExternalStore(
85509
- React__namespace.useCallback(
85510
- (onStoreChange) => {
85511
- const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop2;
85512
- observer.updateResult();
85513
- return unsubscribe;
85514
- },
85515
- [observer, shouldSubscribe]
85516
- ),
85517
- () => observer.getCurrentResult(),
85518
- () => observer.getCurrentResult()
85519
- );
85520
- React__namespace.useEffect(() => {
85521
- observer.setOptions(defaultedOptions);
85522
- }, [defaultedOptions, observer]);
85523
- if (shouldSuspend(defaultedOptions, result)) {
85524
- throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
85525
- }
85526
- if (getHasError({
85527
- result,
85528
- errorResetBoundary,
85529
- throwOnError: defaultedOptions.throwOnError,
85530
- query: client.getQueryCache().get(defaultedOptions.queryHash),
85531
- suspense: defaultedOptions.suspense
85532
- })) {
85533
- throw result.error;
85534
- }
85535
- client.getDefaultOptions().queries?._experimental_afterQuery?.(
85536
- defaultedOptions,
85537
- result
85538
- );
85539
- if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) {
85540
- const promise = isNewCacheEntry ? (
85541
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
85542
- fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
85543
- ) : (
85544
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
85545
- client.getQueryCache().get(defaultedOptions.queryHash)?.promise
85546
- );
85547
- promise?.catch(noop2).finally(() => {
85548
- observer.updateResult();
85549
- });
85550
- }
85551
- return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
85552
- }
85553
- function useInfiniteQuery(options, queryClient) {
85554
- return useBaseQuery(
85555
- options,
85556
- InfiniteQueryObserver
85557
- );
85558
- }
85559
84438
  const ResizableTitle = (props) => {
85560
84439
  const { onResize: onResize2, width, ...restProps } = props;
85561
84440
  if (!width || !onResize2) {
@@ -85599,12 +84478,11 @@ const ResizableTitle = (props) => {
85599
84478
  ] });
85600
84479
  };
85601
84480
  const InfiniteScrollTable = ({
85602
- instanceId,
85603
84481
  columns: initialColumns,
85604
84482
  fetchService,
85605
- title,
85606
84483
  scrollHeight = 600,
85607
- scrollWidth = 1300
84484
+ scrollWidth = 1300,
84485
+ onChange
85608
84486
  }) => {
85609
84487
  const observer = React.useRef();
85610
84488
  const [scrollableNode, setScrollableNode] = React.useState(
@@ -85620,7 +84498,7 @@ const InfiniteScrollTable = ({
85620
84498
  data,
85621
84499
  error: error2,
85622
84500
  fetchNextPage,
85623
- hasNextPage: hasNextPage2,
84501
+ hasNextPage,
85624
84502
  isFetchingNextPage,
85625
84503
  status
85626
84504
  } = useInfiniteQuery({
@@ -85650,7 +84528,7 @@ const InfiniteScrollTable = ({
85650
84528
  if (observer.current) observer.current.disconnect();
85651
84529
  observer.current = new IntersectionObserver(
85652
84530
  (entries) => {
85653
- if (entries[0].isIntersecting && hasNextPage2) {
84531
+ if (entries[0].isIntersecting && hasNextPage) {
85654
84532
  fetchNextPage();
85655
84533
  }
85656
84534
  },
@@ -85658,10 +84536,21 @@ const InfiniteScrollTable = ({
85658
84536
  );
85659
84537
  if (node2) observer.current.observe(node2);
85660
84538
  },
85661
- [isFetchingNextPage, hasNextPage2, fetchNextPage, scrollableNode]
84539
+ [isFetchingNextPage, hasNextPage, fetchNextPage, scrollableNode]
85662
84540
  );
85663
84541
  const dataSource = data?.pages.flatMap((page) => page.docs) ?? [];
85664
84542
  const totalDocs = data?.pages?.[0]?.totalDocs ?? 0;
84543
+ React.useEffect(() => {
84544
+ if (onChange) {
84545
+ const dataChangeEvent = {
84546
+ totalPages: data?.pages?.length ?? 0,
84547
+ currentPage: data?.pages?.[0]?.page ?? 0,
84548
+ resultsShown: dataSource.length,
84549
+ totalResults: totalDocs
84550
+ };
84551
+ onChange(dataChangeEvent);
84552
+ }
84553
+ }, [data]);
85665
84554
  if (status === "pending") {
85666
84555
  return /* @__PURE__ */ jsxRuntime.jsx(
85667
84556
  "div",
@@ -85694,34 +84583,6 @@ const InfiniteScrollTable = ({
85694
84583
  },
85695
84584
  ref: tableContainerRef,
85696
84585
  children: [
85697
- /* @__PURE__ */ jsxRuntime.jsxs(
85698
- Typography$1.Title,
85699
- {
85700
- level: 2,
85701
- style: { marginBottom: "24px", textAlign: "center" },
85702
- children: [
85703
- title,
85704
- " (Table ",
85705
- instanceId,
85706
- ")"
85707
- ]
85708
- }
85709
- ),
85710
- /* @__PURE__ */ jsxRuntime.jsx(
85711
- Alert,
85712
- {
85713
- message: /* @__PURE__ */ jsxRuntime.jsxs(Typography$1.Text, { children: [
85714
- "Showing ",
85715
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: dataSource.length }),
85716
- " of",
85717
- " ",
85718
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: totalDocs }),
85719
- " total launches"
85720
- ] }),
85721
- type: "info",
85722
- style: { marginBottom: "16px", textAlign: "center" }
85723
- }
85724
- ),
85725
84586
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative" }, children: [
85726
84587
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
85727
84588
  .infinite-scroll-table .ant-pagination {
@@ -85769,7 +84630,7 @@ const InfiniteScrollTable = ({
85769
84630
  }
85770
84631
  )
85771
84632
  ] }),
85772
- !hasNextPage2 && /* @__PURE__ */ jsxRuntime.jsx(
84633
+ !hasNextPage && /* @__PURE__ */ jsxRuntime.jsx(
85773
84634
  "div",
85774
84635
  {
85775
84636
  style: {
@@ -85777,7 +84638,7 @@ const InfiniteScrollTable = ({
85777
84638
  padding: "20px",
85778
84639
  borderTop: "1px solid #f0f0f0"
85779
84640
  },
85780
- children: /* @__PURE__ */ jsxRuntime.jsx(Typography$1.Text, { type: "secondary", children: "You've reached the end of the launch history." })
84641
+ children: /* @__PURE__ */ jsxRuntime.jsx(Typography$1.Text, { type: "secondary", children: "No more rows to load." })
85781
84642
  }
85782
84643
  )
85783
84644
  ]
@@ -86441,7 +85302,8 @@ const GroupsRow = ({ groups, onGroupItemClick }) => {
86441
85302
  const SecondaryTableControlsRow = ({
86442
85303
  groups,
86443
85304
  totalRecords,
86444
- onChange
85305
+ onChange,
85306
+ infiniteScrollData
86445
85307
  }) => {
86446
85308
  const onGroupItemClick = (title, item) => {
86447
85309
  const groupItemClickEvent = {
@@ -86461,7 +85323,8 @@ const SecondaryTableControlsRow = ({
86461
85323
  },
86462
85324
  children: [
86463
85325
  /* @__PURE__ */ jsxRuntime.jsx(GroupsRow, { groups, onGroupItemClick }),
86464
- (totalRecords ?? 0) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `${totalRecords} results` }) : null
85326
+ (totalRecords ?? 0) > 0 && !infiniteScrollData ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `${totalRecords} results` }) : null,
85327
+ infiniteScrollData ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `Loaded ${infiniteScrollData.resultsShown} of ${infiniteScrollData.totalResults} Results` }) : null
86465
85328
  ]
86466
85329
  }
86467
85330
  );
@@ -86496,7 +85359,8 @@ const TableControls = ({
86496
85359
  {
86497
85360
  groups: secondaryTableRowData.groups,
86498
85361
  totalRecords: secondaryTableRowData.totalRecords,
86499
- onChange: onSecondaryChange
85362
+ onChange: onSecondaryChange,
85363
+ infiniteScrollData: secondaryTableRowData.infiniteScrollData
86500
85364
  }
86501
85365
  ) : null
86502
85366
  ] });
@@ -86505,10 +85369,22 @@ const TableWithControls = ({
86505
85369
  tableData,
86506
85370
  tableControlsData: tableControlsData2,
86507
85371
  onChange,
86508
- onRowClick
85372
+ onRowClick,
85373
+ tableType = "table",
85374
+ isInfiniteScroll,
85375
+ // Deprecated: use tableType instead
85376
+ infiniteScrollConfig,
85377
+ paginationStyle
86509
85378
  }) => {
85379
+ const [infiniteScrollData, setInfiniteScrollData] = React.useState({
85380
+ totalPages: 0,
85381
+ currentPage: 0,
85382
+ resultsShown: 0,
85383
+ totalResults: 0
85384
+ });
86510
85385
  const { primaryTableRowData, secondaryTableRowData } = tableControlsData2;
86511
85386
  const { dataSource, columns, rowSelection, hasSettings, hasFilter } = tableData;
85387
+ const actualTableType = isInfiniteScroll ? "infiniteScroll" : tableType;
86512
85388
  const onTableControlsChange = (event) => {
86513
85389
  onChange(event);
86514
85390
  };
@@ -86518,6 +85394,67 @@ const TableWithControls = ({
86518
85394
  payload: { value: "tableChange", pagination, filters, sorter }
86519
85395
  });
86520
85396
  };
85397
+ const onInfiniteScrollTableChange = (event) => {
85398
+ onChange({
85399
+ event: "infiniteScrollTableChange",
85400
+ payload: { value: "infiniteScrollTableChange", event }
85401
+ });
85402
+ };
85403
+ const renderTable = () => {
85404
+ switch (actualTableType) {
85405
+ case "infiniteScroll": {
85406
+ if (!infiniteScrollConfig) {
85407
+ console.warn("InfiniteScrollTable requires infiniteScrollConfig");
85408
+ return null;
85409
+ }
85410
+ const resizableColumns = columns.map((col) => ({
85411
+ title: col.title,
85412
+ key: col.key,
85413
+ dataIndex: Array.isArray(col.dataIndex) ? col.dataIndex.join(".") : typeof col.dataIndex === "string" ? col.dataIndex : col.key,
85414
+ width: col.width || 150,
85415
+ render: col.render ? (value2, record, index2) => col.render(value2, record, index2 ?? 0) : void 0
85416
+ }));
85417
+ return /* @__PURE__ */ jsxRuntime.jsx(
85418
+ InfiniteScrollTable,
85419
+ {
85420
+ instanceId: infiniteScrollConfig.instanceId,
85421
+ columns: resizableColumns,
85422
+ fetchService: infiniteScrollConfig.fetchService,
85423
+ title: infiniteScrollConfig.title,
85424
+ scrollHeight: infiniteScrollConfig.scrollHeight,
85425
+ scrollWidth: infiniteScrollConfig.scrollWidth,
85426
+ onChange: onInfiniteScrollTableChange
85427
+ }
85428
+ );
85429
+ }
85430
+ case "pagination": {
85431
+ return /* @__PURE__ */ jsxRuntime.jsx(
85432
+ TablePagination,
85433
+ {
85434
+ dataSource,
85435
+ columns,
85436
+ rowSelection,
85437
+ onChange: onTableChange,
85438
+ onRowClick,
85439
+ paginationStyle
85440
+ }
85441
+ );
85442
+ }
85443
+ case "table":
85444
+ default: {
85445
+ return /* @__PURE__ */ jsxRuntime.jsx(
85446
+ Table,
85447
+ {
85448
+ dataSource,
85449
+ columns,
85450
+ rowSelection,
85451
+ onChange: onTableChange,
85452
+ onRowClick
85453
+ }
85454
+ );
85455
+ }
85456
+ }
85457
+ };
86521
85458
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
86522
85459
  /* @__PURE__ */ jsxRuntime.jsx(
86523
85460
  TableControls,
@@ -86527,18 +85464,854 @@ const TableWithControls = ({
86527
85464
  onChange: onTableControlsChange
86528
85465
  }
86529
85466
  ),
86530
- /* @__PURE__ */ jsxRuntime.jsx(
86531
- Table,
86532
- {
86533
- dataSource,
86534
- columns,
86535
- rowSelection,
86536
- onChange: onTableChange,
86537
- onRowClick
86538
- }
86539
- )
85467
+ renderTable()
86540
85468
  ] });
86541
85469
  };
85470
+ const staticTableData = [
85471
+ {
85472
+ id: "1",
85473
+ number: "1",
85474
+ timerange: "9:00 AM - 10:00 AM",
85475
+ status: "in_progress",
85476
+ address: {
85477
+ nickname: "Home",
85478
+ address: "123 Main St"
85479
+ },
85480
+ job_subtype: "delivery",
85481
+ progress: {
85482
+ firstBarData: {
85483
+ text: "Loading",
85484
+ status: "info",
85485
+ value: 100
85486
+ },
85487
+ secondBarData: {
85488
+ text: "Processing",
85489
+ status: "success",
85490
+ value: 25
85491
+ }
85492
+ }
85493
+ },
85494
+ {
85495
+ id: "2",
85496
+ number: "2",
85497
+ timerange: "10:00 AM - 11:00 AM",
85498
+ status: "scheduled",
85499
+ address: {
85500
+ nickname: "Work",
85501
+ address: "456 Elm St"
85502
+ },
85503
+ job_subtype: "pickup",
85504
+ progress: {
85505
+ firstBarData: {
85506
+ text: "Preparing",
85507
+ status: "info",
85508
+ value: 100
85509
+ },
85510
+ secondBarData: {
85511
+ text: "Final Check",
85512
+ status: "success",
85513
+ value: 0
85514
+ }
85515
+ }
85516
+ },
85517
+ {
85518
+ id: "3",
85519
+ number: "3",
85520
+ timerange: "11:00 AM - 12:00 PM",
85521
+ status: "scheduled",
85522
+ address: {
85523
+ nickname: "Store",
85524
+ address: "789 Oak St"
85525
+ },
85526
+ job_subtype: "delivery",
85527
+ progress: {
85528
+ firstBarData: {
85529
+ text: "Pending",
85530
+ status: "info",
85531
+ value: 0
85532
+ },
85533
+ secondBarData: {
85534
+ text: "Awaiting",
85535
+ status: "success",
85536
+ value: 0
85537
+ }
85538
+ }
85539
+ },
85540
+ {
85541
+ id: "4",
85542
+ number: "4",
85543
+ timerange: "1:00 PM - 2:00 PM",
85544
+ status: "scheduled",
85545
+ address: {
85546
+ nickname: "Office",
85547
+ address: "321 Pine St"
85548
+ },
85549
+ job_subtype: "pickup",
85550
+ progress: {
85551
+ firstBarData: {
85552
+ text: "In Progress",
85553
+ status: "info",
85554
+ value: 100
85555
+ },
85556
+ secondBarData: {
85557
+ text: "Validation",
85558
+ status: "success",
85559
+ value: 30
85560
+ }
85561
+ }
85562
+ },
85563
+ {
85564
+ id: "5",
85565
+ number: "5",
85566
+ timerange: "2:00 PM - 3:00 PM",
85567
+ status: "scheduled",
85568
+ address: {
85569
+ nickname: "Library",
85570
+ address: "555 Book Lane"
85571
+ },
85572
+ job_subtype: "delivery",
85573
+ progress: {
85574
+ firstBarData: {
85575
+ text: "Completed",
85576
+ status: "info",
85577
+ value: 100
85578
+ },
85579
+ secondBarData: {
85580
+ text: "Verified",
85581
+ status: "success",
85582
+ value: 100
85583
+ }
85584
+ }
85585
+ },
85586
+ {
85587
+ id: "6",
85588
+ number: "6",
85589
+ timerange: "3:00 PM - 4:00 PM",
85590
+ status: "scheduled",
85591
+ address: {
85592
+ nickname: "Gym",
85593
+ address: "777 Fitness Ave"
85594
+ },
85595
+ job_subtype: "pickup",
85596
+ progress: {
85597
+ firstBarData: {
85598
+ text: "Phase 1",
85599
+ status: "info",
85600
+ value: 75
85601
+ },
85602
+ secondBarData: {
85603
+ text: "Phase 2",
85604
+ status: "success",
85605
+ value: 50
85606
+ }
85607
+ }
85608
+ },
85609
+ {
85610
+ id: "7",
85611
+ number: "7",
85612
+ timerange: "4:00 PM - 5:00 PM",
85613
+ status: "scheduled",
85614
+ address: {
85615
+ nickname: "Mall",
85616
+ address: "888 Shopping Center"
85617
+ },
85618
+ job_subtype: "delivery",
85619
+ progress: {
85620
+ firstBarData: {
85621
+ text: "Queued",
85622
+ status: "info",
85623
+ value: 0
85624
+ },
85625
+ secondBarData: {
85626
+ text: "Waiting",
85627
+ status: "success",
85628
+ value: 0
85629
+ }
85630
+ }
85631
+ },
85632
+ {
85633
+ id: "8",
85634
+ number: "8",
85635
+ timerange: "9:00 AM - 10:00 AM",
85636
+ status: "completed",
85637
+ address: {
85638
+ nickname: "School",
85639
+ address: "999 Education Rd"
85640
+ },
85641
+ job_subtype: "pickup",
85642
+ progress: {
85643
+ firstBarData: {
85644
+ text: "Delivered",
85645
+ status: "info",
85646
+ value: 100
85647
+ },
85648
+ secondBarData: {
85649
+ text: "Confirmed",
85650
+ status: "success",
85651
+ value: 100
85652
+ }
85653
+ }
85654
+ },
85655
+ {
85656
+ id: "9",
85657
+ number: "9",
85658
+ timerange: "10:00 AM - 11:00 AM",
85659
+ status: "scheduled",
85660
+ address: {
85661
+ nickname: "Restaurant",
85662
+ address: "111 Food Court"
85663
+ },
85664
+ job_subtype: "delivery",
85665
+ progress: {
85666
+ firstBarData: {
85667
+ text: "Preparing",
85668
+ status: "info",
85669
+ value: 100
85670
+ },
85671
+ secondBarData: {
85672
+ text: "Quality Check",
85673
+ status: "success",
85674
+ value: 15
85675
+ }
85676
+ }
85677
+ },
85678
+ {
85679
+ id: "10",
85680
+ number: "10",
85681
+ timerange: "11:00 AM - 12:00 PM",
85682
+ status: "scheduled",
85683
+ address: {
85684
+ nickname: "Park",
85685
+ address: "222 Green Ave"
85686
+ },
85687
+ job_subtype: "pickup",
85688
+ progress: {
85689
+ firstBarData: {
85690
+ text: "Processing",
85691
+ status: "info",
85692
+ value: 80
85693
+ },
85694
+ secondBarData: {
85695
+ text: "Review",
85696
+ status: "success",
85697
+ value: 0
85698
+ }
85699
+ }
85700
+ },
85701
+ {
85702
+ id: "11",
85703
+ number: "11",
85704
+ timerange: "1:00 PM - 2:00 PM",
85705
+ status: "scheduled",
85706
+ address: {
85707
+ nickname: "Beach",
85708
+ address: "333 Shore Dr"
85709
+ },
85710
+ job_subtype: "delivery",
85711
+ progress: {
85712
+ firstBarData: {
85713
+ text: "Planning",
85714
+ status: "info",
85715
+ value: 40
85716
+ },
85717
+ secondBarData: {
85718
+ text: "Route Check",
85719
+ status: "success",
85720
+ value: 20
85721
+ }
85722
+ }
85723
+ },
85724
+ {
85725
+ id: "12",
85726
+ number: "12",
85727
+ timerange: "2:00 PM - 3:00 PM",
85728
+ status: "scheduled",
85729
+ address: {
85730
+ nickname: "Hotel",
85731
+ address: "444 Stay Blvd"
85732
+ },
85733
+ job_subtype: "pickup",
85734
+ progress: {
85735
+ firstBarData: {
85736
+ text: "Scheduled",
85737
+ status: "info",
85738
+ value: 0
85739
+ },
85740
+ secondBarData: {
85741
+ text: "Awaiting",
85742
+ status: "success",
85743
+ value: 0
85744
+ }
85745
+ }
85746
+ },
85747
+ {
85748
+ id: "13",
85749
+ number: "13",
85750
+ timerange: "3:00 PM - 4:00 PM",
85751
+ status: "scheduled",
85752
+ address: {
85753
+ nickname: "Airport",
85754
+ address: "666 Flight Way"
85755
+ },
85756
+ job_subtype: "delivery",
85757
+ progress: {
85758
+ firstBarData: {
85759
+ text: "Pre-flight",
85760
+ status: "info",
85761
+ value: 60
85762
+ },
85763
+ secondBarData: {
85764
+ text: "Security",
85765
+ status: "success",
85766
+ value: 30
85767
+ }
85768
+ }
85769
+ },
85770
+ {
85771
+ id: "14",
85772
+ number: "14",
85773
+ timerange: "4:00 PM - 5:00 PM",
85774
+ status: "cancelled",
85775
+ address: {
85776
+ nickname: "Stadium",
85777
+ address: "777 Sports Complex"
85778
+ },
85779
+ job_subtype: "pickup",
85780
+ progress: {
85781
+ firstBarData: {
85782
+ text: "Cancelled",
85783
+ status: "info",
85784
+ value: 0
85785
+ },
85786
+ secondBarData: {
85787
+ text: "Refund",
85788
+ status: "success",
85789
+ value: 100
85790
+ }
85791
+ }
85792
+ },
85793
+ {
85794
+ id: "15",
85795
+ number: "15",
85796
+ timerange: "9:00 AM - 10:00 AM",
85797
+ status: "scheduled",
85798
+ address: {
85799
+ nickname: "Theater",
85800
+ address: "888 Show Ave"
85801
+ },
85802
+ job_subtype: "delivery",
85803
+ progress: {
85804
+ firstBarData: {
85805
+ text: "Setup",
85806
+ status: "info",
85807
+ value: 25
85808
+ },
85809
+ secondBarData: {
85810
+ text: "Sound Check",
85811
+ status: "success",
85812
+ value: 0
85813
+ }
85814
+ }
85815
+ },
85816
+ {
85817
+ id: "16",
85818
+ number: "16",
85819
+ timerange: "10:00 AM - 11:00 AM",
85820
+ status: "scheduled",
85821
+ address: {
85822
+ nickname: "Museum",
85823
+ address: "999 History Lane"
85824
+ },
85825
+ job_subtype: "pickup",
85826
+ progress: {
85827
+ firstBarData: {
85828
+ text: "Exhibit Prep",
85829
+ status: "info",
85830
+ value: 70
85831
+ },
85832
+ secondBarData: {
85833
+ text: "Documentation",
85834
+ status: "success",
85835
+ value: 45
85836
+ }
85837
+ }
85838
+ },
85839
+ {
85840
+ id: "17",
85841
+ number: "17",
85842
+ timerange: "11:00 AM - 12:00 PM",
85843
+ status: "scheduled",
85844
+ address: {
85845
+ nickname: "Zoo",
85846
+ address: "123 Animal Park"
85847
+ },
85848
+ job_subtype: "delivery",
85849
+ progress: {
85850
+ firstBarData: {
85851
+ text: "Animal Care",
85852
+ status: "info",
85853
+ value: 85
85854
+ },
85855
+ secondBarData: {
85856
+ text: "Feeding",
85857
+ status: "success",
85858
+ value: 90
85859
+ }
85860
+ }
85861
+ },
85862
+ {
85863
+ id: "18",
85864
+ number: "18",
85865
+ timerange: "1:00 PM - 2:00 PM",
85866
+ status: "scheduled",
85867
+ address: {
85868
+ nickname: "Bank",
85869
+ address: "456 Money St"
85870
+ },
85871
+ job_subtype: "pickup",
85872
+ progress: {
85873
+ firstBarData: {
85874
+ text: "Transaction",
85875
+ status: "info",
85876
+ value: 50
85877
+ },
85878
+ secondBarData: {
85879
+ text: "Verification",
85880
+ status: "success",
85881
+ value: 25
85882
+ }
85883
+ }
85884
+ },
85885
+ {
85886
+ id: "19",
85887
+ number: "19",
85888
+ timerange: "2:00 PM - 3:00 PM",
85889
+ status: "scheduled",
85890
+ address: {
85891
+ nickname: "Post Office",
85892
+ address: "789 Mail Road"
85893
+ },
85894
+ job_subtype: "delivery",
85895
+ progress: {
85896
+ firstBarData: {
85897
+ text: "Sorting",
85898
+ status: "info",
85899
+ value: 100
85900
+ },
85901
+ secondBarData: {
85902
+ text: "Dispatch",
85903
+ status: "success",
85904
+ value: 75
85905
+ }
85906
+ }
85907
+ },
85908
+ {
85909
+ id: "20",
85910
+ number: "20",
85911
+ timerange: "3:00 PM - 4:00 PM",
85912
+ status: "scheduled",
85913
+ address: {
85914
+ nickname: "Church",
85915
+ address: "321 Faith Street"
85916
+ },
85917
+ job_subtype: "pickup",
85918
+ progress: {
85919
+ firstBarData: {
85920
+ text: "Service Prep",
85921
+ status: "info",
85922
+ value: 30
85923
+ },
85924
+ secondBarData: {
85925
+ text: "Community",
85926
+ status: "success",
85927
+ value: 10
85928
+ }
85929
+ }
85930
+ },
85931
+ {
85932
+ id: "21",
85933
+ number: "21",
85934
+ timerange: "4:00 PM - 5:00 PM",
85935
+ status: "scheduled",
85936
+ address: {
85937
+ nickname: "Pharmacy",
85938
+ address: "654 Health Ave"
85939
+ },
85940
+ job_subtype: "delivery",
85941
+ progress: {
85942
+ firstBarData: {
85943
+ text: "Prescription",
85944
+ status: "info",
85945
+ value: 90
85946
+ },
85947
+ secondBarData: {
85948
+ text: "Quality Check",
85949
+ status: "success",
85950
+ value: 60
85951
+ }
85952
+ }
85953
+ },
85954
+ {
85955
+ id: "22",
85956
+ number: "22",
85957
+ timerange: "2:00 PM - 3:00 PM",
85958
+ status: "scheduled",
85959
+ address: {
85960
+ nickname: "Office Complex",
85961
+ street: "789 Business Ave",
85962
+ city: "Commerce City",
85963
+ state: "CA",
85964
+ zip: "90210"
85965
+ },
85966
+ job_subtype: "delivery",
85967
+ progress: {
85968
+ currentStep: 1,
85969
+ totalSteps: 4,
85970
+ steps: {
85971
+ pickup: {
85972
+ text: "Pickup Scheduled",
85973
+ status: "pending",
85974
+ value: 25
85975
+ },
85976
+ transit: {
85977
+ text: "In Transit",
85978
+ status: "pending",
85979
+ value: 0
85980
+ },
85981
+ delivery: {
85982
+ text: "Delivery",
85983
+ status: "pending",
85984
+ value: 0
85985
+ },
85986
+ quality: {
85987
+ text: "Quality Check",
85988
+ status: "pending",
85989
+ value: 0
85990
+ }
85991
+ }
85992
+ }
85993
+ },
85994
+ {
85995
+ id: "23",
85996
+ number: "23",
85997
+ timerange: "3:00 PM - 4:00 PM",
85998
+ status: "completed",
85999
+ address: {
86000
+ nickname: "Retail Store",
86001
+ street: "456 Shopping St",
86002
+ city: "Retail Town",
86003
+ state: "CA",
86004
+ zip: "90211"
86005
+ },
86006
+ job_subtype: "delivery",
86007
+ progress: {
86008
+ currentStep: 4,
86009
+ totalSteps: 4,
86010
+ steps: {
86011
+ pickup: {
86012
+ text: "Pickup Complete",
86013
+ status: "success",
86014
+ value: 100
86015
+ },
86016
+ transit: {
86017
+ text: "Transit Complete",
86018
+ status: "success",
86019
+ value: 100
86020
+ },
86021
+ delivery: {
86022
+ text: "Delivery Complete",
86023
+ status: "success",
86024
+ value: 100
86025
+ },
86026
+ quality: {
86027
+ text: "Quality Check Complete",
86028
+ status: "success",
86029
+ value: 100
86030
+ }
86031
+ }
86032
+ }
86033
+ },
86034
+ {
86035
+ id: "24",
86036
+ number: "24",
86037
+ timerange: "4:00 PM - 5:00 PM",
86038
+ status: "in_progress",
86039
+ address: {
86040
+ nickname: "Warehouse",
86041
+ street: "321 Storage Blvd",
86042
+ city: "Storage City",
86043
+ state: "CA",
86044
+ zip: "90212"
86045
+ },
86046
+ job_subtype: "delivery",
86047
+ progress: {
86048
+ currentStep: 2,
86049
+ totalSteps: 4,
86050
+ steps: {
86051
+ pickup: {
86052
+ text: "Pickup Complete",
86053
+ status: "success",
86054
+ value: 100
86055
+ },
86056
+ transit: {
86057
+ text: "In Transit",
86058
+ status: "active",
86059
+ value: 50
86060
+ },
86061
+ delivery: {
86062
+ text: "Delivery",
86063
+ status: "pending",
86064
+ value: 0
86065
+ },
86066
+ quality: {
86067
+ text: "Quality Check",
86068
+ status: "pending",
86069
+ value: 0
86070
+ }
86071
+ }
86072
+ }
86073
+ },
86074
+ {
86075
+ id: "25",
86076
+ number: "25",
86077
+ timerange: "5:00 PM - 6:00 PM",
86078
+ status: "cancelled",
86079
+ address: {
86080
+ nickname: "Canceled Location",
86081
+ street: "999 Cancel St",
86082
+ city: "Cancel City",
86083
+ state: "CA",
86084
+ zip: "90213"
86085
+ },
86086
+ job_subtype: "pickup",
86087
+ progress: {
86088
+ currentStep: 1,
86089
+ totalSteps: 4,
86090
+ steps: {
86091
+ pickup: {
86092
+ text: "Pickup Cancelled",
86093
+ status: "error",
86094
+ value: 0
86095
+ },
86096
+ transit: {
86097
+ text: "In Transit",
86098
+ status: "pending",
86099
+ value: 0
86100
+ },
86101
+ delivery: {
86102
+ text: "Delivery",
86103
+ status: "pending",
86104
+ value: 0
86105
+ },
86106
+ quality: {
86107
+ text: "Quality Check",
86108
+ status: "pending",
86109
+ value: 0
86110
+ }
86111
+ }
86112
+ }
86113
+ },
86114
+ {
86115
+ id: "26",
86116
+ number: "26",
86117
+ timerange: "6:00 PM - 7:00 PM",
86118
+ status: "scheduled",
86119
+ address: {
86120
+ nickname: "Evening Delivery",
86121
+ street: "555 Evening Ave",
86122
+ city: "Evening City",
86123
+ state: "CA",
86124
+ zip: "90214"
86125
+ },
86126
+ job_subtype: "delivery",
86127
+ progress: {
86128
+ currentStep: 1,
86129
+ totalSteps: 4,
86130
+ steps: {
86131
+ pickup: {
86132
+ text: "Pickup Scheduled",
86133
+ status: "pending",
86134
+ value: 25
86135
+ },
86136
+ transit: {
86137
+ text: "In Transit",
86138
+ status: "pending",
86139
+ value: 0
86140
+ },
86141
+ delivery: {
86142
+ text: "Delivery",
86143
+ status: "pending",
86144
+ value: 0
86145
+ },
86146
+ quality: {
86147
+ text: "Quality Check",
86148
+ status: "pending",
86149
+ value: 0
86150
+ }
86151
+ }
86152
+ }
86153
+ },
86154
+ {
86155
+ id: "27",
86156
+ number: "27",
86157
+ timerange: "7:00 PM - 8:00 PM",
86158
+ status: "in_progress",
86159
+ address: {
86160
+ nickname: "Night Shift",
86161
+ street: "777 Night St",
86162
+ city: "Night City",
86163
+ state: "CA",
86164
+ zip: "90215"
86165
+ },
86166
+ job_subtype: "delivery",
86167
+ progress: {
86168
+ currentStep: 3,
86169
+ totalSteps: 4,
86170
+ steps: {
86171
+ pickup: {
86172
+ text: "Pickup Complete",
86173
+ status: "success",
86174
+ value: 100
86175
+ },
86176
+ transit: {
86177
+ text: "Transit Complete",
86178
+ status: "success",
86179
+ value: 100
86180
+ },
86181
+ delivery: {
86182
+ text: "Delivery in Progress",
86183
+ status: "active",
86184
+ value: 75
86185
+ },
86186
+ quality: {
86187
+ text: "Quality Check",
86188
+ status: "pending",
86189
+ value: 0
86190
+ }
86191
+ }
86192
+ }
86193
+ },
86194
+ {
86195
+ id: "28",
86196
+ number: "28",
86197
+ timerange: "8:00 PM - 9:00 PM",
86198
+ status: "completed",
86199
+ address: {
86200
+ nickname: "Final Delivery",
86201
+ street: "888 Final Blvd",
86202
+ city: "Final City",
86203
+ state: "CA",
86204
+ zip: "90216"
86205
+ },
86206
+ job_subtype: "delivery",
86207
+ progress: {
86208
+ currentStep: 4,
86209
+ totalSteps: 4,
86210
+ steps: {
86211
+ pickup: {
86212
+ text: "Pickup Complete",
86213
+ status: "success",
86214
+ value: 100
86215
+ },
86216
+ transit: {
86217
+ text: "Transit Complete",
86218
+ status: "success",
86219
+ value: 100
86220
+ },
86221
+ delivery: {
86222
+ text: "Delivery Complete",
86223
+ status: "success",
86224
+ value: 100
86225
+ },
86226
+ quality: {
86227
+ text: "Quality Check Complete",
86228
+ status: "success",
86229
+ value: 100
86230
+ }
86231
+ }
86232
+ }
86233
+ },
86234
+ {
86235
+ id: "29",
86236
+ number: "29",
86237
+ timerange: "9:00 PM - 10:00 PM",
86238
+ status: "scheduled",
86239
+ address: {
86240
+ nickname: "Late Night",
86241
+ street: "999 Late St",
86242
+ city: "Late City",
86243
+ state: "CA",
86244
+ zip: "90217"
86245
+ },
86246
+ job_subtype: "delivery",
86247
+ progress: {
86248
+ currentStep: 1,
86249
+ totalSteps: 4,
86250
+ steps: {
86251
+ pickup: {
86252
+ text: "Pickup Scheduled",
86253
+ status: "pending",
86254
+ value: 25
86255
+ },
86256
+ transit: {
86257
+ text: "In Transit",
86258
+ status: "pending",
86259
+ value: 0
86260
+ },
86261
+ delivery: {
86262
+ text: "Delivery",
86263
+ status: "pending",
86264
+ value: 0
86265
+ },
86266
+ quality: {
86267
+ text: "Quality Check",
86268
+ status: "pending",
86269
+ value: 0
86270
+ }
86271
+ }
86272
+ }
86273
+ },
86274
+ {
86275
+ id: "30",
86276
+ number: "30",
86277
+ timerange: "10:00 PM - 11:00 PM",
86278
+ status: "in_progress",
86279
+ address: {
86280
+ nickname: "Last Stop",
86281
+ street: "000 Last Ave",
86282
+ city: "Last City",
86283
+ state: "CA",
86284
+ zip: "90218"
86285
+ },
86286
+ job_subtype: "delivery",
86287
+ progress: {
86288
+ currentStep: 2,
86289
+ totalSteps: 4,
86290
+ steps: {
86291
+ pickup: {
86292
+ text: "Pickup Complete",
86293
+ status: "success",
86294
+ value: 100
86295
+ },
86296
+ transit: {
86297
+ text: "In Transit",
86298
+ status: "active",
86299
+ value: 60
86300
+ },
86301
+ delivery: {
86302
+ text: "Delivery",
86303
+ status: "pending",
86304
+ value: 0
86305
+ },
86306
+ quality: {
86307
+ text: "Quality Check",
86308
+ status: "pending",
86309
+ value: 0
86310
+ }
86311
+ }
86312
+ }
86313
+ }
86314
+ ];
86542
86315
  const startCase = (string_) => {
86543
86316
  if (string_) {
86544
86317
  return string_.replaceAll(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
@@ -86602,9 +86375,25 @@ const mockColumns = [
86602
86375
  dataIndex: "progress",
86603
86376
  render: (progress) => {
86604
86377
  if (!progress) return null;
86378
+ let firstBarData, secondBarData;
86379
+ if ("firstBarData" in progress) {
86380
+ firstBarData = progress.firstBarData;
86381
+ secondBarData = progress.secondBarData;
86382
+ } else {
86383
+ firstBarData = {
86384
+ text: progress.steps.pickup.text,
86385
+ status: progress.steps.pickup.status,
86386
+ value: progress.steps.pickup.value
86387
+ };
86388
+ secondBarData = {
86389
+ text: progress.steps.transit.text,
86390
+ status: progress.steps.transit.status,
86391
+ value: progress.steps.transit.value
86392
+ };
86393
+ }
86605
86394
  return React.createElement(Progress, {
86606
- firstBarData: progress.firstBarData,
86607
- secondBarData: progress.secondBarData,
86395
+ firstBarData,
86396
+ secondBarData,
86608
86397
  width: 150,
86609
86398
  height: 20,
86610
86399
  isProgressCombined: true
@@ -86646,491 +86435,7 @@ mockColumns.map((column2) => ({
86646
86435
  ...column2
86647
86436
  }));
86648
86437
  const mockDataSource = {
86649
- appointments: [
86650
- {
86651
- id: "1",
86652
- number: "1",
86653
- timerange: "9:00 AM - 10:00 AM",
86654
- status: "in_progress",
86655
- address: {
86656
- nickname: "Home",
86657
- address: "123 Main St"
86658
- },
86659
- job_subtype: "delivery",
86660
- progress: {
86661
- firstBarData: {
86662
- text: "Loading",
86663
- status: "info",
86664
- value: 100
86665
- },
86666
- secondBarData: {
86667
- text: "Processing",
86668
- status: "success",
86669
- value: 25
86670
- }
86671
- }
86672
- },
86673
- {
86674
- id: "2",
86675
- number: "2",
86676
- timerange: "10:00 AM - 11:00 AM",
86677
- status: "scheduled",
86678
- address: {
86679
- nickname: "Work",
86680
- address: "456 Elm St"
86681
- },
86682
- job_subtype: "pickup",
86683
- progress: {
86684
- firstBarData: {
86685
- text: "Preparing",
86686
- status: "info",
86687
- value: 100
86688
- },
86689
- secondBarData: {
86690
- text: "Final Check",
86691
- status: "success",
86692
- value: 0
86693
- }
86694
- }
86695
- },
86696
- {
86697
- id: "3",
86698
- number: "3",
86699
- timerange: "11:00 AM - 12:00 PM",
86700
- status: "scheduled",
86701
- address: {
86702
- nickname: "Store",
86703
- address: "789 Oak St"
86704
- },
86705
- job_subtype: "delivery",
86706
- progress: {
86707
- firstBarData: {
86708
- text: "Pending",
86709
- status: "info",
86710
- value: 0
86711
- },
86712
- secondBarData: {
86713
- text: "Awaiting",
86714
- status: "success",
86715
- value: 0
86716
- }
86717
- }
86718
- },
86719
- {
86720
- id: "4",
86721
- number: "4",
86722
- timerange: "1:00 PM - 2:00 PM",
86723
- status: "scheduled",
86724
- address: {
86725
- nickname: "Office",
86726
- address: "321 Pine St"
86727
- },
86728
- job_subtype: "pickup",
86729
- progress: {
86730
- firstBarData: {
86731
- text: "In Progress",
86732
- status: "info",
86733
- value: 100
86734
- },
86735
- secondBarData: {
86736
- text: "Validation",
86737
- status: "success",
86738
- value: 30
86739
- }
86740
- }
86741
- },
86742
- {
86743
- id: "5",
86744
- number: "5",
86745
- timerange: "2:00 PM - 3:00 PM",
86746
- status: "scheduled",
86747
- address: {
86748
- nickname: "Library",
86749
- address: "555 Book Lane"
86750
- },
86751
- job_subtype: "delivery",
86752
- progress: {
86753
- firstBarData: {
86754
- text: "Completed",
86755
- status: "info",
86756
- value: 100
86757
- },
86758
- secondBarData: {
86759
- text: "Verified",
86760
- status: "success",
86761
- value: 100
86762
- }
86763
- }
86764
- },
86765
- {
86766
- id: "6",
86767
- number: "6",
86768
- timerange: "3:00 PM - 4:00 PM",
86769
- status: "scheduled",
86770
- address: {
86771
- nickname: "Gym",
86772
- address: "777 Fitness Ave"
86773
- },
86774
- job_subtype: "pickup",
86775
- progress: {
86776
- firstBarData: {
86777
- text: "Phase 1",
86778
- status: "info",
86779
- value: 75
86780
- },
86781
- secondBarData: {
86782
- text: "Phase 2",
86783
- status: "success",
86784
- value: 50
86785
- }
86786
- }
86787
- },
86788
- {
86789
- id: "7",
86790
- number: "7",
86791
- timerange: "4:00 PM - 5:00 PM",
86792
- status: "scheduled",
86793
- address: {
86794
- nickname: "Mall",
86795
- address: "888 Shopping Center"
86796
- },
86797
- job_subtype: "delivery",
86798
- progress: {
86799
- firstBarData: {
86800
- text: "Queued",
86801
- status: "info",
86802
- value: 0
86803
- },
86804
- secondBarData: {
86805
- text: "Waiting",
86806
- status: "success",
86807
- value: 0
86808
- }
86809
- }
86810
- },
86811
- {
86812
- id: "8",
86813
- number: "8",
86814
- timerange: "9:00 AM - 10:00 AM",
86815
- status: "completed",
86816
- address: {
86817
- nickname: "School",
86818
- address: "999 Education Rd"
86819
- },
86820
- job_subtype: "pickup",
86821
- progress: {
86822
- firstBarData: {
86823
- text: "Delivered",
86824
- status: "info",
86825
- value: 100
86826
- },
86827
- secondBarData: {
86828
- text: "Confirmed",
86829
- status: "success",
86830
- value: 100
86831
- }
86832
- }
86833
- },
86834
- {
86835
- id: "9",
86836
- number: "9",
86837
- timerange: "10:00 AM - 11:00 AM",
86838
- status: "scheduled",
86839
- address: {
86840
- nickname: "Restaurant",
86841
- address: "111 Food Court"
86842
- },
86843
- job_subtype: "delivery",
86844
- progress: {
86845
- firstBarData: {
86846
- text: "Preparing",
86847
- status: "info",
86848
- value: 100
86849
- },
86850
- secondBarData: {
86851
- text: "Quality Check",
86852
- status: "success",
86853
- value: 15
86854
- }
86855
- }
86856
- },
86857
- {
86858
- id: "10",
86859
- number: "10",
86860
- timerange: "11:00 AM - 12:00 PM",
86861
- status: "scheduled",
86862
- address: {
86863
- nickname: "Park",
86864
- address: "222 Green Ave"
86865
- },
86866
- job_subtype: "pickup",
86867
- progress: {
86868
- firstBarData: {
86869
- text: "Processing",
86870
- status: "info",
86871
- value: 80
86872
- },
86873
- secondBarData: {
86874
- text: "Review",
86875
- status: "success",
86876
- value: 0
86877
- }
86878
- }
86879
- },
86880
- {
86881
- id: "11",
86882
- number: "11",
86883
- timerange: "1:00 PM - 2:00 PM",
86884
- status: "scheduled",
86885
- address: {
86886
- nickname: "Beach",
86887
- address: "333 Shore Dr"
86888
- },
86889
- job_subtype: "delivery",
86890
- progress: {
86891
- firstBarData: {
86892
- text: "Planning",
86893
- status: "info",
86894
- value: 40
86895
- },
86896
- secondBarData: {
86897
- text: "Route Check",
86898
- status: "success",
86899
- value: 20
86900
- }
86901
- }
86902
- },
86903
- {
86904
- id: "12",
86905
- number: "12",
86906
- timerange: "2:00 PM - 3:00 PM",
86907
- status: "scheduled",
86908
- address: {
86909
- nickname: "Hotel",
86910
- address: "444 Stay Blvd"
86911
- },
86912
- job_subtype: "pickup",
86913
- progress: {
86914
- firstBarData: {
86915
- text: "Scheduled",
86916
- status: "info",
86917
- value: 0
86918
- },
86919
- secondBarData: {
86920
- text: "Awaiting",
86921
- status: "success",
86922
- value: 0
86923
- }
86924
- }
86925
- },
86926
- {
86927
- id: "13",
86928
- number: "13",
86929
- timerange: "3:00 PM - 4:00 PM",
86930
- status: "scheduled",
86931
- address: {
86932
- nickname: "Airport",
86933
- address: "666 Flight Way"
86934
- },
86935
- job_subtype: "delivery",
86936
- progress: {
86937
- firstBarData: {
86938
- text: "Pre-flight",
86939
- status: "info",
86940
- value: 60
86941
- },
86942
- secondBarData: {
86943
- text: "Security",
86944
- status: "success",
86945
- value: 30
86946
- }
86947
- }
86948
- },
86949
- {
86950
- id: "14",
86951
- number: "14",
86952
- timerange: "4:00 PM - 5:00 PM",
86953
- status: "cancelled",
86954
- address: {
86955
- nickname: "Stadium",
86956
- address: "777 Sports Complex"
86957
- },
86958
- job_subtype: "pickup",
86959
- progress: {
86960
- firstBarData: {
86961
- text: "Cancelled",
86962
- status: "info",
86963
- value: 0
86964
- },
86965
- secondBarData: {
86966
- text: "Refund",
86967
- status: "success",
86968
- value: 100
86969
- }
86970
- }
86971
- },
86972
- {
86973
- id: "15",
86974
- number: "15",
86975
- timerange: "9:00 AM - 10:00 AM",
86976
- status: "scheduled",
86977
- address: {
86978
- nickname: "Theater",
86979
- address: "888 Show Ave"
86980
- },
86981
- job_subtype: "delivery",
86982
- progress: {
86983
- firstBarData: {
86984
- text: "Setup",
86985
- status: "info",
86986
- value: 25
86987
- },
86988
- secondBarData: {
86989
- text: "Sound Check",
86990
- status: "success",
86991
- value: 0
86992
- }
86993
- }
86994
- },
86995
- {
86996
- id: "16",
86997
- number: "16",
86998
- timerange: "10:00 AM - 11:00 AM",
86999
- status: "scheduled",
87000
- address: {
87001
- nickname: "Museum",
87002
- address: "999 History Lane"
87003
- },
87004
- job_subtype: "pickup",
87005
- progress: {
87006
- firstBarData: {
87007
- text: "Exhibit Prep",
87008
- status: "info",
87009
- value: 70
87010
- },
87011
- secondBarData: {
87012
- text: "Documentation",
87013
- status: "success",
87014
- value: 45
87015
- }
87016
- }
87017
- },
87018
- {
87019
- id: "17",
87020
- number: "17",
87021
- timerange: "11:00 AM - 12:00 PM",
87022
- status: "scheduled",
87023
- address: {
87024
- nickname: "Zoo",
87025
- address: "123 Animal Park"
87026
- },
87027
- job_subtype: "delivery",
87028
- progress: {
87029
- firstBarData: {
87030
- text: "Animal Care",
87031
- status: "info",
87032
- value: 85
87033
- },
87034
- secondBarData: {
87035
- text: "Feeding",
87036
- status: "success",
87037
- value: 90
87038
- }
87039
- }
87040
- },
87041
- {
87042
- id: "18",
87043
- number: "18",
87044
- timerange: "1:00 PM - 2:00 PM",
87045
- status: "scheduled",
87046
- address: {
87047
- nickname: "Bank",
87048
- address: "456 Money St"
87049
- },
87050
- job_subtype: "pickup",
87051
- progress: {
87052
- firstBarData: {
87053
- text: "Transaction",
87054
- status: "info",
87055
- value: 50
87056
- },
87057
- secondBarData: {
87058
- text: "Verification",
87059
- status: "success",
87060
- value: 25
87061
- }
87062
- }
87063
- },
87064
- {
87065
- id: "19",
87066
- number: "19",
87067
- timerange: "2:00 PM - 3:00 PM",
87068
- status: "scheduled",
87069
- address: {
87070
- nickname: "Post Office",
87071
- address: "789 Mail Road"
87072
- },
87073
- job_subtype: "delivery",
87074
- progress: {
87075
- firstBarData: {
87076
- text: "Sorting",
87077
- status: "info",
87078
- value: 100
87079
- },
87080
- secondBarData: {
87081
- text: "Dispatch",
87082
- status: "success",
87083
- value: 75
87084
- }
87085
- }
87086
- },
87087
- {
87088
- id: "20",
87089
- number: "20",
87090
- timerange: "3:00 PM - 4:00 PM",
87091
- status: "scheduled",
87092
- address: {
87093
- nickname: "Church",
87094
- address: "321 Faith Street"
87095
- },
87096
- job_subtype: "pickup",
87097
- progress: {
87098
- firstBarData: {
87099
- text: "Service Prep",
87100
- status: "info",
87101
- value: 30
87102
- },
87103
- secondBarData: {
87104
- text: "Community",
87105
- status: "success",
87106
- value: 10
87107
- }
87108
- }
87109
- },
87110
- {
87111
- id: "21",
87112
- number: "21",
87113
- timerange: "4:00 PM - 5:00 PM",
87114
- status: "scheduled",
87115
- address: {
87116
- nickname: "Pharmacy",
87117
- address: "654 Health Ave"
87118
- },
87119
- job_subtype: "delivery",
87120
- progress: {
87121
- firstBarData: {
87122
- text: "Prescription",
87123
- status: "info",
87124
- value: 90
87125
- },
87126
- secondBarData: {
87127
- text: "Quality Check",
87128
- status: "success",
87129
- value: 60
87130
- }
87131
- }
87132
- }
87133
- ]
86438
+ appointments: staticTableData
87134
86439
  };
87135
86440
  const tableControlsData = {
87136
86441
  primaryTableRowData: {