@gobolt/genesis 0.4.14 → 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/components/Table/InfiniteScrollTable/InfiniteScrollTable.d.ts +2 -1
- package/dist/components/Table/InfiniteScrollTable/index.d.ts +2 -0
- package/dist/components/Table/InfiniteScrollTable/useInfiniteQuery.d.ts +21 -0
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.d.ts +3 -1
- package/dist/components/Table/__mocks__/table-mocks.d.ts +31 -0
- package/dist/index.cjs +182 -1252
- package/dist/index.js +182 -1252
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,7 @@ function requireClassnames() {
|
|
|
37
37
|
hasRequiredClassnames = 1;
|
|
38
38
|
(function(module2) {
|
|
39
39
|
(function() {
|
|
40
|
-
var
|
|
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 (
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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 =
|
|
72324
|
-
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype &&
|
|
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" ||
|
|
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 (!
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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] =
|
|
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
|
-
|
|
80919
|
+
}
|
|
80920
|
+
case "top": {
|
|
80920
80921
|
return slideUp;
|
|
80921
|
-
|
|
80922
|
+
}
|
|
80923
|
+
case "left": {
|
|
80922
80924
|
return slideLeft;
|
|
80923
|
-
|
|
80925
|
+
}
|
|
80926
|
+
case "right": {
|
|
80924
80927
|
return slideRight;
|
|
80925
|
-
|
|
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
|
-
|
|
84335
|
-
|
|
84336
|
-
|
|
84337
|
-
|
|
84338
|
-
|
|
84339
|
-
|
|
84340
|
-
|
|
84341
|
-
|
|
84342
|
-
|
|
84343
|
-
|
|
84344
|
-
|
|
84345
|
-
|
|
84346
|
-
|
|
84347
|
-
|
|
84348
|
-
|
|
84349
|
-
|
|
84350
|
-
|
|
84351
|
-
|
|
84352
|
-
|
|
84353
|
-
|
|
84354
|
-
|
|
84355
|
-
|
|
84356
|
-
|
|
84357
|
-
|
|
84358
|
-
|
|
84359
|
-
|
|
84360
|
-
|
|
84361
|
-
|
|
84362
|
-
|
|
84363
|
-
|
|
84364
|
-
|
|
84365
|
-
|
|
84366
|
-
|
|
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 =
|
|
84680
|
-
|
|
84681
|
-
|
|
84682
|
-
if (!transactions) {
|
|
84683
|
-
flush();
|
|
84373
|
+
const result = await queryFn({ pageParam });
|
|
84374
|
+
if (abortControllerRef.current?.signal.aborted) {
|
|
84375
|
+
return;
|
|
84684
84376
|
}
|
|
84685
|
-
|
|
84686
|
-
|
|
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
|
-
|
|
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
|
-
|
|
85112
|
-
|
|
85113
|
-
|
|
85114
|
-
|
|
85115
|
-
|
|
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
|
-
|
|
85164
|
-
|
|
85165
|
-
|
|
85166
|
-
|
|
85167
|
-
|
|
85168
|
-
|
|
85169
|
-
|
|
85170
|
-
|
|
85171
|
-
|
|
85172
|
-
|
|
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
|
-
|
|
85177
|
-
|
|
85178
|
-
|
|
85179
|
-
|
|
85180
|
-
|
|
85181
|
-
|
|
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
|
-
|
|
85325
|
-
|
|
85326
|
-
|
|
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
|
-
|
|
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
|
-
|
|
85421
|
-
|
|
85422
|
-
|
|
85423
|
-
|
|
85424
|
-
|
|
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
84437
|
};
|
|
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
|
-
};
|
|
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
|
|
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 &&
|
|
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,
|
|
84539
|
+
[isFetchingNextPage, hasNextPage, fetchNextPage, scrollableNode]
|
|
85662
84540
|
);
|
|
85663
84541
|
const dataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
85664
|
-
data?.pages?.[0]?.totalDocs ?? 0;
|
|
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",
|
|
@@ -85741,7 +84630,7 @@ const InfiniteScrollTable = ({
|
|
|
85741
84630
|
}
|
|
85742
84631
|
)
|
|
85743
84632
|
] }),
|
|
85744
|
-
!
|
|
84633
|
+
!hasNextPage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
85745
84634
|
"div",
|
|
85746
84635
|
{
|
|
85747
84636
|
style: {
|
|
@@ -86413,7 +85302,8 @@ const GroupsRow = ({ groups, onGroupItemClick }) => {
|
|
|
86413
85302
|
const SecondaryTableControlsRow = ({
|
|
86414
85303
|
groups,
|
|
86415
85304
|
totalRecords,
|
|
86416
|
-
onChange
|
|
85305
|
+
onChange,
|
|
85306
|
+
infiniteScrollData
|
|
86417
85307
|
}) => {
|
|
86418
85308
|
const onGroupItemClick = (title, item) => {
|
|
86419
85309
|
const groupItemClickEvent = {
|
|
@@ -86433,7 +85323,8 @@ const SecondaryTableControlsRow = ({
|
|
|
86433
85323
|
},
|
|
86434
85324
|
children: [
|
|
86435
85325
|
/* @__PURE__ */ jsxRuntime.jsx(GroupsRow, { groups, onGroupItemClick }),
|
|
86436
|
-
(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
|
|
86437
85328
|
]
|
|
86438
85329
|
}
|
|
86439
85330
|
);
|
|
@@ -86468,7 +85359,8 @@ const TableControls = ({
|
|
|
86468
85359
|
{
|
|
86469
85360
|
groups: secondaryTableRowData.groups,
|
|
86470
85361
|
totalRecords: secondaryTableRowData.totalRecords,
|
|
86471
|
-
onChange: onSecondaryChange
|
|
85362
|
+
onChange: onSecondaryChange,
|
|
85363
|
+
infiniteScrollData: secondaryTableRowData.infiniteScrollData
|
|
86472
85364
|
}
|
|
86473
85365
|
) : null
|
|
86474
85366
|
] });
|
|
@@ -86484,6 +85376,12 @@ const TableWithControls = ({
|
|
|
86484
85376
|
infiniteScrollConfig,
|
|
86485
85377
|
paginationStyle
|
|
86486
85378
|
}) => {
|
|
85379
|
+
const [infiniteScrollData, setInfiniteScrollData] = React.useState({
|
|
85380
|
+
totalPages: 0,
|
|
85381
|
+
currentPage: 0,
|
|
85382
|
+
resultsShown: 0,
|
|
85383
|
+
totalResults: 0
|
|
85384
|
+
});
|
|
86487
85385
|
const { primaryTableRowData, secondaryTableRowData } = tableControlsData2;
|
|
86488
85386
|
const { dataSource, columns, rowSelection, hasSettings, hasFilter } = tableData;
|
|
86489
85387
|
const actualTableType = isInfiniteScroll ? "infiniteScroll" : tableType;
|
|
@@ -86496,6 +85394,12 @@ const TableWithControls = ({
|
|
|
86496
85394
|
payload: { value: "tableChange", pagination, filters, sorter }
|
|
86497
85395
|
});
|
|
86498
85396
|
};
|
|
85397
|
+
const onInfiniteScrollTableChange = (event) => {
|
|
85398
|
+
onChange({
|
|
85399
|
+
event: "infiniteScrollTableChange",
|
|
85400
|
+
payload: { value: "infiniteScrollTableChange", event }
|
|
85401
|
+
});
|
|
85402
|
+
};
|
|
86499
85403
|
const renderTable = () => {
|
|
86500
85404
|
switch (actualTableType) {
|
|
86501
85405
|
case "infiniteScroll": {
|
|
@@ -86518,7 +85422,8 @@ const TableWithControls = ({
|
|
|
86518
85422
|
fetchService: infiniteScrollConfig.fetchService,
|
|
86519
85423
|
title: infiniteScrollConfig.title,
|
|
86520
85424
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
86521
|
-
scrollWidth: infiniteScrollConfig.scrollWidth
|
|
85425
|
+
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
85426
|
+
onChange: onInfiniteScrollTableChange
|
|
86522
85427
|
}
|
|
86523
85428
|
);
|
|
86524
85429
|
}
|
|
@@ -87058,6 +85963,7 @@ const staticTableData = [
|
|
|
87058
85963
|
state: "CA",
|
|
87059
85964
|
zip: "90210"
|
|
87060
85965
|
},
|
|
85966
|
+
job_subtype: "delivery",
|
|
87061
85967
|
progress: {
|
|
87062
85968
|
currentStep: 1,
|
|
87063
85969
|
totalSteps: 4,
|
|
@@ -87097,6 +86003,7 @@ const staticTableData = [
|
|
|
87097
86003
|
state: "CA",
|
|
87098
86004
|
zip: "90211"
|
|
87099
86005
|
},
|
|
86006
|
+
job_subtype: "delivery",
|
|
87100
86007
|
progress: {
|
|
87101
86008
|
currentStep: 4,
|
|
87102
86009
|
totalSteps: 4,
|
|
@@ -87136,6 +86043,7 @@ const staticTableData = [
|
|
|
87136
86043
|
state: "CA",
|
|
87137
86044
|
zip: "90212"
|
|
87138
86045
|
},
|
|
86046
|
+
job_subtype: "delivery",
|
|
87139
86047
|
progress: {
|
|
87140
86048
|
currentStep: 2,
|
|
87141
86049
|
totalSteps: 4,
|
|
@@ -87175,6 +86083,7 @@ const staticTableData = [
|
|
|
87175
86083
|
state: "CA",
|
|
87176
86084
|
zip: "90213"
|
|
87177
86085
|
},
|
|
86086
|
+
job_subtype: "pickup",
|
|
87178
86087
|
progress: {
|
|
87179
86088
|
currentStep: 1,
|
|
87180
86089
|
totalSteps: 4,
|
|
@@ -87214,6 +86123,7 @@ const staticTableData = [
|
|
|
87214
86123
|
state: "CA",
|
|
87215
86124
|
zip: "90214"
|
|
87216
86125
|
},
|
|
86126
|
+
job_subtype: "delivery",
|
|
87217
86127
|
progress: {
|
|
87218
86128
|
currentStep: 1,
|
|
87219
86129
|
totalSteps: 4,
|
|
@@ -87253,6 +86163,7 @@ const staticTableData = [
|
|
|
87253
86163
|
state: "CA",
|
|
87254
86164
|
zip: "90215"
|
|
87255
86165
|
},
|
|
86166
|
+
job_subtype: "delivery",
|
|
87256
86167
|
progress: {
|
|
87257
86168
|
currentStep: 3,
|
|
87258
86169
|
totalSteps: 4,
|
|
@@ -87292,6 +86203,7 @@ const staticTableData = [
|
|
|
87292
86203
|
state: "CA",
|
|
87293
86204
|
zip: "90216"
|
|
87294
86205
|
},
|
|
86206
|
+
job_subtype: "delivery",
|
|
87295
86207
|
progress: {
|
|
87296
86208
|
currentStep: 4,
|
|
87297
86209
|
totalSteps: 4,
|
|
@@ -87331,6 +86243,7 @@ const staticTableData = [
|
|
|
87331
86243
|
state: "CA",
|
|
87332
86244
|
zip: "90217"
|
|
87333
86245
|
},
|
|
86246
|
+
job_subtype: "delivery",
|
|
87334
86247
|
progress: {
|
|
87335
86248
|
currentStep: 1,
|
|
87336
86249
|
totalSteps: 4,
|
|
@@ -87370,6 +86283,7 @@ const staticTableData = [
|
|
|
87370
86283
|
state: "CA",
|
|
87371
86284
|
zip: "90218"
|
|
87372
86285
|
},
|
|
86286
|
+
job_subtype: "delivery",
|
|
87373
86287
|
progress: {
|
|
87374
86288
|
currentStep: 2,
|
|
87375
86289
|
totalSteps: 4,
|
|
@@ -87461,9 +86375,25 @@ const mockColumns = [
|
|
|
87461
86375
|
dataIndex: "progress",
|
|
87462
86376
|
render: (progress) => {
|
|
87463
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
|
+
}
|
|
87464
86394
|
return React.createElement(Progress, {
|
|
87465
|
-
firstBarData
|
|
87466
|
-
secondBarData
|
|
86395
|
+
firstBarData,
|
|
86396
|
+
secondBarData,
|
|
87467
86397
|
width: 150,
|
|
87468
86398
|
height: 20,
|
|
87469
86399
|
isProgressCombined: true
|