@gobolt/genesis 0.4.11 → 0.4.13
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 -0
- package/dist/components/Table/InfiniteScrollTable/ResizableTitle.d.ts +10 -0
- package/dist/components/Table/Table.d.ts +32 -12
- package/dist/index.cjs +2307 -377
- package/dist/index.js +2307 -377
- package/package.json +6 -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 hasOwn2 = {}.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 (hasOwn2.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$5() {
|
|
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$5;
|
|
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$5;
|
|
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$4() {
|
|
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$4;
|
|
4937
4937
|
if (enableStatistic && typeof Proxy !== "undefined") {
|
|
4938
4938
|
tokenKeys2 = /* @__PURE__ */ new Set();
|
|
4939
4939
|
proxy = new Proxy(token2, {
|
|
@@ -5294,7 +5294,7 @@ function getAlphaColor(frontColor, backgroundColor) {
|
|
|
5294
5294
|
a: 1
|
|
5295
5295
|
}).toRgbString();
|
|
5296
5296
|
}
|
|
5297
|
-
var __rest$
|
|
5297
|
+
var __rest$_ = function(s, e3) {
|
|
5298
5298
|
var t2 = {};
|
|
5299
5299
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e3.indexOf(p) < 0) t2[p] = s[p];
|
|
5300
5300
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -5305,7 +5305,7 @@ var __rest$Z = function(s, e3) {
|
|
|
5305
5305
|
function formatToken(derivativeToken) {
|
|
5306
5306
|
const {
|
|
5307
5307
|
override
|
|
5308
|
-
} = derivativeToken, restToken = __rest$
|
|
5308
|
+
} = derivativeToken, restToken = __rest$_(derivativeToken, ["override"]);
|
|
5309
5309
|
const overrideTokens = Object.assign({}, override);
|
|
5310
5310
|
Object.keys(seedToken).forEach((token2) => {
|
|
5311
5311
|
delete overrideTokens[token2];
|
|
@@ -5459,7 +5459,7 @@ function formatToken(derivativeToken) {
|
|
|
5459
5459
|
}), overrideTokens);
|
|
5460
5460
|
return aliasToken;
|
|
5461
5461
|
}
|
|
5462
|
-
var __rest$
|
|
5462
|
+
var __rest$Z = function(s, e3) {
|
|
5463
5463
|
var t2 = {};
|
|
5464
5464
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e3.indexOf(p) < 0) t2[p] = s[p];
|
|
5465
5465
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -5509,7 +5509,7 @@ const getComputedToken2 = (originToken, overrideToken, theme) => {
|
|
|
5509
5509
|
const derivativeToken = theme.getDerivativeToken(originToken);
|
|
5510
5510
|
const {
|
|
5511
5511
|
override
|
|
5512
|
-
} = overrideToken, components2 = __rest$
|
|
5512
|
+
} = overrideToken, components2 = __rest$Z(overrideToken, ["override"]);
|
|
5513
5513
|
let mergedDerivativeToken = Object.assign(Object.assign({}, derivativeToken), {
|
|
5514
5514
|
override
|
|
5515
5515
|
});
|
|
@@ -5518,7 +5518,7 @@ const getComputedToken2 = (originToken, overrideToken, theme) => {
|
|
|
5518
5518
|
Object.entries(components2).forEach(([key, value2]) => {
|
|
5519
5519
|
const {
|
|
5520
5520
|
theme: componentTheme
|
|
5521
|
-
} = value2, componentTokens = __rest$
|
|
5521
|
+
} = value2, componentTokens = __rest$Z(value2, ["theme"]);
|
|
5522
5522
|
let mergedComponentToken = componentTokens;
|
|
5523
5523
|
if (componentTheme) {
|
|
5524
5524
|
mergedComponentToken = getComputedToken2(Object.assign(Object.assign({}, mergedDerivativeToken), componentTokens), {
|
|
@@ -6473,7 +6473,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
6473
6473
|
PropWarning.displayName = "PropWarning";
|
|
6474
6474
|
}
|
|
6475
6475
|
const PropWarning$1 = process.env.NODE_ENV !== "production" ? PropWarning : () => null;
|
|
6476
|
-
var __rest$
|
|
6476
|
+
var __rest$Y = function(s, e3) {
|
|
6477
6477
|
var t2 = {};
|
|
6478
6478
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e3.indexOf(p) < 0) t2[p] = s[p];
|
|
6479
6479
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -6760,7 +6760,7 @@ const ProviderChildren = (props) => {
|
|
|
6760
6760
|
token: token2,
|
|
6761
6761
|
components: components2,
|
|
6762
6762
|
cssVar
|
|
6763
|
-
} = _a, rest = __rest$
|
|
6763
|
+
} = _a, rest = __rest$Y(_a, ["algorithm", "token", "components", "cssVar"]);
|
|
6764
6764
|
const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : defaultTheme;
|
|
6765
6765
|
const parsedComponents = {};
|
|
6766
6766
|
Object.entries(components2 || {}).forEach(([componentName, componentToken]) => {
|
|
@@ -7012,9 +7012,9 @@ var CheckCircleFilled = function CheckCircleFilled2(props, ref) {
|
|
|
7012
7012
|
icon: CheckCircleFilled$1
|
|
7013
7013
|
}));
|
|
7014
7014
|
};
|
|
7015
|
-
var RefIcon$
|
|
7015
|
+
var RefIcon$E = /* @__PURE__ */ React__namespace.forwardRef(CheckCircleFilled);
|
|
7016
7016
|
if (process.env.NODE_ENV !== "production") {
|
|
7017
|
-
RefIcon$
|
|
7017
|
+
RefIcon$E.displayName = "CheckCircleFilled";
|
|
7018
7018
|
}
|
|
7019
7019
|
var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
|
|
7020
7020
|
var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
|
|
@@ -7023,9 +7023,9 @@ var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
|
|
|
7023
7023
|
icon: CloseCircleFilled$1
|
|
7024
7024
|
}));
|
|
7025
7025
|
};
|
|
7026
|
-
var RefIcon$
|
|
7026
|
+
var RefIcon$D = /* @__PURE__ */ React__namespace.forwardRef(CloseCircleFilled);
|
|
7027
7027
|
if (process.env.NODE_ENV !== "production") {
|
|
7028
|
-
RefIcon$
|
|
7028
|
+
RefIcon$D.displayName = "CloseCircleFilled";
|
|
7029
7029
|
}
|
|
7030
7030
|
var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
|
|
7031
7031
|
var CloseOutlined = function CloseOutlined2(props, ref) {
|
|
@@ -7034,9 +7034,9 @@ var CloseOutlined = function CloseOutlined2(props, ref) {
|
|
|
7034
7034
|
icon: CloseOutlined$1
|
|
7035
7035
|
}));
|
|
7036
7036
|
};
|
|
7037
|
-
var RefIcon$
|
|
7037
|
+
var RefIcon$C = /* @__PURE__ */ React__namespace.forwardRef(CloseOutlined);
|
|
7038
7038
|
if (process.env.NODE_ENV !== "production") {
|
|
7039
|
-
RefIcon$
|
|
7039
|
+
RefIcon$C.displayName = "CloseOutlined";
|
|
7040
7040
|
}
|
|
7041
7041
|
var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
|
|
7042
7042
|
var ExclamationCircleFilled = function ExclamationCircleFilled2(props, ref) {
|
|
@@ -7045,9 +7045,20 @@ var ExclamationCircleFilled = function ExclamationCircleFilled2(props, ref) {
|
|
|
7045
7045
|
icon: ExclamationCircleFilled$1
|
|
7046
7046
|
}));
|
|
7047
7047
|
};
|
|
7048
|
-
var RefIcon$
|
|
7048
|
+
var RefIcon$B = /* @__PURE__ */ React__namespace.forwardRef(ExclamationCircleFilled);
|
|
7049
|
+
if (process.env.NODE_ENV !== "production") {
|
|
7050
|
+
RefIcon$B.displayName = "ExclamationCircleFilled";
|
|
7051
|
+
}
|
|
7052
|
+
var InfoCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
|
|
7053
|
+
var InfoCircleFilled = function InfoCircleFilled2(props, ref) {
|
|
7054
|
+
return /* @__PURE__ */ React__namespace.createElement(Icon$3, _extends$1({}, props, {
|
|
7055
|
+
ref,
|
|
7056
|
+
icon: InfoCircleFilled$1
|
|
7057
|
+
}));
|
|
7058
|
+
};
|
|
7059
|
+
var RefIcon$A = /* @__PURE__ */ React__namespace.forwardRef(InfoCircleFilled);
|
|
7049
7060
|
if (process.env.NODE_ENV !== "production") {
|
|
7050
|
-
RefIcon$A.displayName = "
|
|
7061
|
+
RefIcon$A.displayName = "InfoCircleFilled";
|
|
7051
7062
|
}
|
|
7052
7063
|
var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
|
|
7053
7064
|
var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
|
|
@@ -7098,6 +7109,433 @@ const replaceElement = (element2, replacement, props) => {
|
|
|
7098
7109
|
function cloneElement(element2, props) {
|
|
7099
7110
|
return replaceElement(element2, element2, props);
|
|
7100
7111
|
}
|
|
7112
|
+
const genAlertTypeStyle = (bgColor, borderColor, iconColor, token2, alertCls) => ({
|
|
7113
|
+
background: bgColor,
|
|
7114
|
+
border: `${unit$2(token2.lineWidth)} ${token2.lineType} ${borderColor}`,
|
|
7115
|
+
[`${alertCls}-icon`]: {
|
|
7116
|
+
color: iconColor
|
|
7117
|
+
}
|
|
7118
|
+
});
|
|
7119
|
+
const genBaseStyle$9 = (token2) => {
|
|
7120
|
+
const {
|
|
7121
|
+
componentCls,
|
|
7122
|
+
motionDurationSlow: duration,
|
|
7123
|
+
marginXS,
|
|
7124
|
+
marginSM,
|
|
7125
|
+
fontSize,
|
|
7126
|
+
fontSizeLG,
|
|
7127
|
+
lineHeight,
|
|
7128
|
+
borderRadiusLG: borderRadius2,
|
|
7129
|
+
motionEaseInOutCirc,
|
|
7130
|
+
withDescriptionIconSize,
|
|
7131
|
+
colorText,
|
|
7132
|
+
colorTextHeading,
|
|
7133
|
+
withDescriptionPadding,
|
|
7134
|
+
defaultPadding
|
|
7135
|
+
} = token2;
|
|
7136
|
+
return {
|
|
7137
|
+
[componentCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
|
|
7138
|
+
position: "relative",
|
|
7139
|
+
display: "flex",
|
|
7140
|
+
alignItems: "center",
|
|
7141
|
+
padding: defaultPadding,
|
|
7142
|
+
wordWrap: "break-word",
|
|
7143
|
+
borderRadius: borderRadius2,
|
|
7144
|
+
[`&${componentCls}-rtl`]: {
|
|
7145
|
+
direction: "rtl"
|
|
7146
|
+
},
|
|
7147
|
+
[`${componentCls}-content`]: {
|
|
7148
|
+
flex: 1,
|
|
7149
|
+
minWidth: 0
|
|
7150
|
+
},
|
|
7151
|
+
[`${componentCls}-icon`]: {
|
|
7152
|
+
marginInlineEnd: marginXS,
|
|
7153
|
+
lineHeight: 0
|
|
7154
|
+
},
|
|
7155
|
+
"&-description": {
|
|
7156
|
+
display: "none",
|
|
7157
|
+
fontSize,
|
|
7158
|
+
lineHeight
|
|
7159
|
+
},
|
|
7160
|
+
"&-message": {
|
|
7161
|
+
color: colorTextHeading
|
|
7162
|
+
},
|
|
7163
|
+
[`&${componentCls}-motion-leave`]: {
|
|
7164
|
+
overflow: "hidden",
|
|
7165
|
+
opacity: 1,
|
|
7166
|
+
transition: `max-height ${duration} ${motionEaseInOutCirc}, opacity ${duration} ${motionEaseInOutCirc},
|
|
7167
|
+
padding-top ${duration} ${motionEaseInOutCirc}, padding-bottom ${duration} ${motionEaseInOutCirc},
|
|
7168
|
+
margin-bottom ${duration} ${motionEaseInOutCirc}`
|
|
7169
|
+
},
|
|
7170
|
+
[`&${componentCls}-motion-leave-active`]: {
|
|
7171
|
+
maxHeight: 0,
|
|
7172
|
+
marginBottom: "0 !important",
|
|
7173
|
+
paddingTop: 0,
|
|
7174
|
+
paddingBottom: 0,
|
|
7175
|
+
opacity: 0
|
|
7176
|
+
}
|
|
7177
|
+
}),
|
|
7178
|
+
[`${componentCls}-with-description`]: {
|
|
7179
|
+
alignItems: "flex-start",
|
|
7180
|
+
padding: withDescriptionPadding,
|
|
7181
|
+
[`${componentCls}-icon`]: {
|
|
7182
|
+
marginInlineEnd: marginSM,
|
|
7183
|
+
fontSize: withDescriptionIconSize,
|
|
7184
|
+
lineHeight: 0
|
|
7185
|
+
},
|
|
7186
|
+
[`${componentCls}-message`]: {
|
|
7187
|
+
display: "block",
|
|
7188
|
+
marginBottom: marginXS,
|
|
7189
|
+
color: colorTextHeading,
|
|
7190
|
+
fontSize: fontSizeLG
|
|
7191
|
+
},
|
|
7192
|
+
[`${componentCls}-description`]: {
|
|
7193
|
+
display: "block",
|
|
7194
|
+
color: colorText
|
|
7195
|
+
}
|
|
7196
|
+
},
|
|
7197
|
+
[`${componentCls}-banner`]: {
|
|
7198
|
+
marginBottom: 0,
|
|
7199
|
+
border: "0 !important",
|
|
7200
|
+
borderRadius: 0
|
|
7201
|
+
}
|
|
7202
|
+
};
|
|
7203
|
+
};
|
|
7204
|
+
const genTypeStyle = (token2) => {
|
|
7205
|
+
const {
|
|
7206
|
+
componentCls,
|
|
7207
|
+
colorSuccess,
|
|
7208
|
+
colorSuccessBorder,
|
|
7209
|
+
colorSuccessBg,
|
|
7210
|
+
colorWarning,
|
|
7211
|
+
colorWarningBorder,
|
|
7212
|
+
colorWarningBg,
|
|
7213
|
+
colorError,
|
|
7214
|
+
colorErrorBorder,
|
|
7215
|
+
colorErrorBg,
|
|
7216
|
+
colorInfo,
|
|
7217
|
+
colorInfoBorder,
|
|
7218
|
+
colorInfoBg
|
|
7219
|
+
} = token2;
|
|
7220
|
+
return {
|
|
7221
|
+
[componentCls]: {
|
|
7222
|
+
"&-success": genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token2, componentCls),
|
|
7223
|
+
"&-info": genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token2, componentCls),
|
|
7224
|
+
"&-warning": genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token2, componentCls),
|
|
7225
|
+
"&-error": Object.assign(Object.assign({}, genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token2, componentCls)), {
|
|
7226
|
+
[`${componentCls}-description > pre`]: {
|
|
7227
|
+
margin: 0,
|
|
7228
|
+
padding: 0
|
|
7229
|
+
}
|
|
7230
|
+
})
|
|
7231
|
+
}
|
|
7232
|
+
};
|
|
7233
|
+
};
|
|
7234
|
+
const genActionStyle = (token2) => {
|
|
7235
|
+
const {
|
|
7236
|
+
componentCls,
|
|
7237
|
+
iconCls,
|
|
7238
|
+
motionDurationMid,
|
|
7239
|
+
marginXS,
|
|
7240
|
+
fontSizeIcon,
|
|
7241
|
+
colorIcon,
|
|
7242
|
+
colorIconHover
|
|
7243
|
+
} = token2;
|
|
7244
|
+
return {
|
|
7245
|
+
[componentCls]: {
|
|
7246
|
+
"&-action": {
|
|
7247
|
+
marginInlineStart: marginXS
|
|
7248
|
+
},
|
|
7249
|
+
[`${componentCls}-close-icon`]: {
|
|
7250
|
+
marginInlineStart: marginXS,
|
|
7251
|
+
padding: 0,
|
|
7252
|
+
overflow: "hidden",
|
|
7253
|
+
fontSize: fontSizeIcon,
|
|
7254
|
+
lineHeight: unit$2(fontSizeIcon),
|
|
7255
|
+
backgroundColor: "transparent",
|
|
7256
|
+
border: "none",
|
|
7257
|
+
outline: "none",
|
|
7258
|
+
cursor: "pointer",
|
|
7259
|
+
[`${iconCls}-close`]: {
|
|
7260
|
+
color: colorIcon,
|
|
7261
|
+
transition: `color ${motionDurationMid}`,
|
|
7262
|
+
"&:hover": {
|
|
7263
|
+
color: colorIconHover
|
|
7264
|
+
}
|
|
7265
|
+
}
|
|
7266
|
+
},
|
|
7267
|
+
"&-close-text": {
|
|
7268
|
+
color: colorIcon,
|
|
7269
|
+
transition: `color ${motionDurationMid}`,
|
|
7270
|
+
"&:hover": {
|
|
7271
|
+
color: colorIconHover
|
|
7272
|
+
}
|
|
7273
|
+
}
|
|
7274
|
+
}
|
|
7275
|
+
};
|
|
7276
|
+
};
|
|
7277
|
+
const prepareComponentToken$p = (token2) => {
|
|
7278
|
+
const paddingHorizontal = 12;
|
|
7279
|
+
return {
|
|
7280
|
+
withDescriptionIconSize: token2.fontSizeHeading3,
|
|
7281
|
+
defaultPadding: `${token2.paddingContentVerticalSM}px ${paddingHorizontal}px`,
|
|
7282
|
+
withDescriptionPadding: `${token2.paddingMD}px ${token2.paddingContentHorizontalLG}px`
|
|
7283
|
+
};
|
|
7284
|
+
};
|
|
7285
|
+
const useStyle$v = genStyleHooks("Alert", (token2) => [genBaseStyle$9(token2), genTypeStyle(token2), genActionStyle(token2)], prepareComponentToken$p);
|
|
7286
|
+
var __rest$X = function(s, e3) {
|
|
7287
|
+
var t2 = {};
|
|
7288
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e3.indexOf(p) < 0) t2[p] = s[p];
|
|
7289
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7290
|
+
if (e3.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t2[p[i]] = s[p[i]];
|
|
7291
|
+
}
|
|
7292
|
+
return t2;
|
|
7293
|
+
};
|
|
7294
|
+
const iconMapFilled = {
|
|
7295
|
+
success: RefIcon$E,
|
|
7296
|
+
info: RefIcon$A,
|
|
7297
|
+
error: RefIcon$D,
|
|
7298
|
+
warning: RefIcon$B
|
|
7299
|
+
};
|
|
7300
|
+
const IconNode = (props) => {
|
|
7301
|
+
const {
|
|
7302
|
+
icon,
|
|
7303
|
+
prefixCls,
|
|
7304
|
+
type: type4
|
|
7305
|
+
} = props;
|
|
7306
|
+
const iconType = iconMapFilled[type4] || null;
|
|
7307
|
+
if (icon) {
|
|
7308
|
+
return replaceElement(icon, /* @__PURE__ */ React__namespace.createElement("span", {
|
|
7309
|
+
className: `${prefixCls}-icon`
|
|
7310
|
+
}, icon), () => ({
|
|
7311
|
+
className: classNames(`${prefixCls}-icon`, icon.props.className)
|
|
7312
|
+
}));
|
|
7313
|
+
}
|
|
7314
|
+
return /* @__PURE__ */ React__namespace.createElement(iconType, {
|
|
7315
|
+
className: `${prefixCls}-icon`
|
|
7316
|
+
});
|
|
7317
|
+
};
|
|
7318
|
+
const CloseIconNode = (props) => {
|
|
7319
|
+
const {
|
|
7320
|
+
isClosable,
|
|
7321
|
+
prefixCls,
|
|
7322
|
+
closeIcon,
|
|
7323
|
+
handleClose,
|
|
7324
|
+
ariaProps
|
|
7325
|
+
} = props;
|
|
7326
|
+
const mergedCloseIcon = closeIcon === true || closeIcon === void 0 ? /* @__PURE__ */ React__namespace.createElement(RefIcon$C, null) : closeIcon;
|
|
7327
|
+
return isClosable ? /* @__PURE__ */ React__namespace.createElement("button", Object.assign({
|
|
7328
|
+
type: "button",
|
|
7329
|
+
onClick: handleClose,
|
|
7330
|
+
className: `${prefixCls}-close-icon`,
|
|
7331
|
+
tabIndex: 0
|
|
7332
|
+
}, ariaProps), mergedCloseIcon) : null;
|
|
7333
|
+
};
|
|
7334
|
+
const Alert$1 = /* @__PURE__ */ React__namespace.forwardRef((props, ref) => {
|
|
7335
|
+
const {
|
|
7336
|
+
description,
|
|
7337
|
+
prefixCls: customizePrefixCls,
|
|
7338
|
+
message: message2,
|
|
7339
|
+
banner,
|
|
7340
|
+
className,
|
|
7341
|
+
rootClassName,
|
|
7342
|
+
style: style2,
|
|
7343
|
+
onMouseEnter,
|
|
7344
|
+
onMouseLeave,
|
|
7345
|
+
onClick,
|
|
7346
|
+
afterClose,
|
|
7347
|
+
showIcon,
|
|
7348
|
+
closable,
|
|
7349
|
+
closeText,
|
|
7350
|
+
closeIcon,
|
|
7351
|
+
action,
|
|
7352
|
+
id: id2
|
|
7353
|
+
} = props, otherProps = __rest$X(props, ["description", "prefixCls", "message", "banner", "className", "rootClassName", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "id"]);
|
|
7354
|
+
const [closed, setClosed] = React__namespace.useState(false);
|
|
7355
|
+
if (process.env.NODE_ENV !== "production") {
|
|
7356
|
+
const warning3 = devUseWarning("Alert");
|
|
7357
|
+
warning3.deprecated(!closeText, "closeText", "closable.closeIcon");
|
|
7358
|
+
}
|
|
7359
|
+
const internalRef = React__namespace.useRef(null);
|
|
7360
|
+
React__namespace.useImperativeHandle(ref, () => ({
|
|
7361
|
+
nativeElement: internalRef.current
|
|
7362
|
+
}));
|
|
7363
|
+
const {
|
|
7364
|
+
getPrefixCls,
|
|
7365
|
+
direction,
|
|
7366
|
+
closable: contextClosable,
|
|
7367
|
+
closeIcon: contextCloseIcon,
|
|
7368
|
+
className: contextClassName,
|
|
7369
|
+
style: contextStyle
|
|
7370
|
+
} = useComponentConfig("alert");
|
|
7371
|
+
const prefixCls = getPrefixCls("alert", customizePrefixCls);
|
|
7372
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$v(prefixCls);
|
|
7373
|
+
const handleClose = (e3) => {
|
|
7374
|
+
var _a;
|
|
7375
|
+
setClosed(true);
|
|
7376
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e3);
|
|
7377
|
+
};
|
|
7378
|
+
const type4 = React__namespace.useMemo(() => {
|
|
7379
|
+
if (props.type !== void 0) {
|
|
7380
|
+
return props.type;
|
|
7381
|
+
}
|
|
7382
|
+
return banner ? "warning" : "info";
|
|
7383
|
+
}, [props.type, banner]);
|
|
7384
|
+
const isClosable = React__namespace.useMemo(() => {
|
|
7385
|
+
if (typeof closable === "object" && closable.closeIcon) return true;
|
|
7386
|
+
if (closeText) {
|
|
7387
|
+
return true;
|
|
7388
|
+
}
|
|
7389
|
+
if (typeof closable === "boolean") {
|
|
7390
|
+
return closable;
|
|
7391
|
+
}
|
|
7392
|
+
if (closeIcon !== false && closeIcon !== null && closeIcon !== void 0) {
|
|
7393
|
+
return true;
|
|
7394
|
+
}
|
|
7395
|
+
return !!contextClosable;
|
|
7396
|
+
}, [closeText, closeIcon, closable, contextClosable]);
|
|
7397
|
+
const isShowIcon = banner && showIcon === void 0 ? true : showIcon;
|
|
7398
|
+
const alertCls = classNames(prefixCls, `${prefixCls}-${type4}`, {
|
|
7399
|
+
[`${prefixCls}-with-description`]: !!description,
|
|
7400
|
+
[`${prefixCls}-no-icon`]: !isShowIcon,
|
|
7401
|
+
[`${prefixCls}-banner`]: !!banner,
|
|
7402
|
+
[`${prefixCls}-rtl`]: direction === "rtl"
|
|
7403
|
+
}, contextClassName, className, rootClassName, cssVarCls, hashId);
|
|
7404
|
+
const restProps = pickAttrs(otherProps, {
|
|
7405
|
+
aria: true,
|
|
7406
|
+
data: true
|
|
7407
|
+
});
|
|
7408
|
+
const mergedCloseIcon = React__namespace.useMemo(() => {
|
|
7409
|
+
if (typeof closable === "object" && closable.closeIcon) {
|
|
7410
|
+
return closable.closeIcon;
|
|
7411
|
+
}
|
|
7412
|
+
if (closeText) {
|
|
7413
|
+
return closeText;
|
|
7414
|
+
}
|
|
7415
|
+
if (closeIcon !== void 0) {
|
|
7416
|
+
return closeIcon;
|
|
7417
|
+
}
|
|
7418
|
+
if (typeof contextClosable === "object" && contextClosable.closeIcon) {
|
|
7419
|
+
return contextClosable.closeIcon;
|
|
7420
|
+
}
|
|
7421
|
+
return contextCloseIcon;
|
|
7422
|
+
}, [closeIcon, closable, closeText, contextCloseIcon]);
|
|
7423
|
+
const mergedAriaProps = React__namespace.useMemo(() => {
|
|
7424
|
+
const merged = closable !== null && closable !== void 0 ? closable : contextClosable;
|
|
7425
|
+
if (typeof merged === "object") {
|
|
7426
|
+
const {
|
|
7427
|
+
closeIcon: _
|
|
7428
|
+
} = merged, ariaProps = __rest$X(merged, ["closeIcon"]);
|
|
7429
|
+
return ariaProps;
|
|
7430
|
+
}
|
|
7431
|
+
return {};
|
|
7432
|
+
}, [closable, contextClosable]);
|
|
7433
|
+
return wrapCSSVar(/* @__PURE__ */ React__namespace.createElement(CSSMotion, {
|
|
7434
|
+
visible: !closed,
|
|
7435
|
+
motionName: `${prefixCls}-motion`,
|
|
7436
|
+
motionAppear: false,
|
|
7437
|
+
motionEnter: false,
|
|
7438
|
+
onLeaveStart: (node2) => ({
|
|
7439
|
+
maxHeight: node2.offsetHeight
|
|
7440
|
+
}),
|
|
7441
|
+
onLeaveEnd: afterClose
|
|
7442
|
+
}, ({
|
|
7443
|
+
className: motionClassName,
|
|
7444
|
+
style: motionStyle
|
|
7445
|
+
}, setRef) => /* @__PURE__ */ React__namespace.createElement("div", Object.assign({
|
|
7446
|
+
id: id2,
|
|
7447
|
+
ref: composeRef(internalRef, setRef),
|
|
7448
|
+
"data-show": !closed,
|
|
7449
|
+
className: classNames(alertCls, motionClassName),
|
|
7450
|
+
style: Object.assign(Object.assign(Object.assign({}, contextStyle), style2), motionStyle),
|
|
7451
|
+
onMouseEnter,
|
|
7452
|
+
onMouseLeave,
|
|
7453
|
+
onClick,
|
|
7454
|
+
role: "alert"
|
|
7455
|
+
}, restProps), isShowIcon ? /* @__PURE__ */ React__namespace.createElement(IconNode, {
|
|
7456
|
+
description,
|
|
7457
|
+
icon: props.icon,
|
|
7458
|
+
prefixCls,
|
|
7459
|
+
type: type4
|
|
7460
|
+
}) : null, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
7461
|
+
className: `${prefixCls}-content`
|
|
7462
|
+
}, message2 ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
7463
|
+
className: `${prefixCls}-message`
|
|
7464
|
+
}, message2) : null, description ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
7465
|
+
className: `${prefixCls}-description`
|
|
7466
|
+
}, description) : null), action ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
7467
|
+
className: `${prefixCls}-action`
|
|
7468
|
+
}, action) : null, /* @__PURE__ */ React__namespace.createElement(CloseIconNode, {
|
|
7469
|
+
isClosable,
|
|
7470
|
+
prefixCls,
|
|
7471
|
+
closeIcon: mergedCloseIcon,
|
|
7472
|
+
handleClose,
|
|
7473
|
+
ariaProps: mergedAriaProps
|
|
7474
|
+
}))));
|
|
7475
|
+
});
|
|
7476
|
+
if (process.env.NODE_ENV !== "production") {
|
|
7477
|
+
Alert$1.displayName = "Alert";
|
|
7478
|
+
}
|
|
7479
|
+
function _callSuper(t2, o2, e3) {
|
|
7480
|
+
return o2 = _getPrototypeOf(o2), _possibleConstructorReturn(t2, _isNativeReflectConstruct() ? Reflect.construct(o2, e3 || [], _getPrototypeOf(t2).constructor) : o2.apply(t2, e3));
|
|
7481
|
+
}
|
|
7482
|
+
let ErrorBoundary$1 = /* @__PURE__ */ (function(_React$Component) {
|
|
7483
|
+
function ErrorBoundary2() {
|
|
7484
|
+
var _this;
|
|
7485
|
+
_classCallCheck(this, ErrorBoundary2);
|
|
7486
|
+
_this = _callSuper(this, ErrorBoundary2, arguments);
|
|
7487
|
+
_this.state = {
|
|
7488
|
+
error: void 0,
|
|
7489
|
+
info: {
|
|
7490
|
+
componentStack: ""
|
|
7491
|
+
}
|
|
7492
|
+
};
|
|
7493
|
+
return _this;
|
|
7494
|
+
}
|
|
7495
|
+
_inherits(ErrorBoundary2, _React$Component);
|
|
7496
|
+
return _createClass(ErrorBoundary2, [{
|
|
7497
|
+
key: "componentDidCatch",
|
|
7498
|
+
value: function componentDidCatch(error2, info) {
|
|
7499
|
+
this.setState({
|
|
7500
|
+
error: error2,
|
|
7501
|
+
info
|
|
7502
|
+
});
|
|
7503
|
+
}
|
|
7504
|
+
}, {
|
|
7505
|
+
key: "render",
|
|
7506
|
+
value: function render2() {
|
|
7507
|
+
const {
|
|
7508
|
+
message: message2,
|
|
7509
|
+
description,
|
|
7510
|
+
id: id2,
|
|
7511
|
+
children: children2
|
|
7512
|
+
} = this.props;
|
|
7513
|
+
const {
|
|
7514
|
+
error: error2,
|
|
7515
|
+
info
|
|
7516
|
+
} = this.state;
|
|
7517
|
+
const componentStack = (info === null || info === void 0 ? void 0 : info.componentStack) || null;
|
|
7518
|
+
const errorMessage = typeof message2 === "undefined" ? (error2 || "").toString() : message2;
|
|
7519
|
+
const errorDescription = typeof description === "undefined" ? componentStack : description;
|
|
7520
|
+
if (error2) {
|
|
7521
|
+
return /* @__PURE__ */ React__namespace.createElement(Alert$1, {
|
|
7522
|
+
id: id2,
|
|
7523
|
+
type: "error",
|
|
7524
|
+
message: errorMessage,
|
|
7525
|
+
description: /* @__PURE__ */ React__namespace.createElement("pre", {
|
|
7526
|
+
style: {
|
|
7527
|
+
fontSize: "0.9em",
|
|
7528
|
+
overflowX: "auto"
|
|
7529
|
+
}
|
|
7530
|
+
}, errorDescription)
|
|
7531
|
+
});
|
|
7532
|
+
}
|
|
7533
|
+
return children2;
|
|
7534
|
+
}
|
|
7535
|
+
}]);
|
|
7536
|
+
})(React__namespace.Component);
|
|
7537
|
+
const Alert = Alert$1;
|
|
7538
|
+
Alert.ErrorBoundary = ErrorBoundary$1;
|
|
7101
7539
|
const t = (t2) => "object" == typeof t2 && null != t2 && 1 === t2.nodeType, e$1 = (t2, e3) => (!e3 || "hidden" !== t2) && ("visible" !== t2 && "clip" !== t2), n = (t2, n2) => {
|
|
7102
7540
|
if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
|
|
7103
7541
|
const o2 = getComputedStyle(t2, null);
|
|
@@ -21260,7 +21698,7 @@ function useIcons$1({
|
|
|
21260
21698
|
const warning3 = devUseWarning(componentName);
|
|
21261
21699
|
warning3.deprecated(!clearIcon, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
|
|
21262
21700
|
}
|
|
21263
|
-
const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
21701
|
+
const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React__namespace.createElement(RefIcon$D, null);
|
|
21264
21702
|
const getSuffixIconNode = (arrowIcon) => {
|
|
21265
21703
|
if (suffixIcon === null && !hasFeedback && !showArrow) {
|
|
21266
21704
|
return null;
|
|
@@ -21302,7 +21740,7 @@ function useIcons$1({
|
|
|
21302
21740
|
if (removeIcon !== void 0) {
|
|
21303
21741
|
mergedRemoveIcon = removeIcon;
|
|
21304
21742
|
} else {
|
|
21305
|
-
mergedRemoveIcon = /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
21743
|
+
mergedRemoveIcon = /* @__PURE__ */ React__namespace.createElement(RefIcon$C, null);
|
|
21306
21744
|
}
|
|
21307
21745
|
return {
|
|
21308
21746
|
clearIcon: mergedClearIcon,
|
|
@@ -37888,7 +38326,7 @@ const InternalTabs = /* @__PURE__ */ React__namespace.forwardRef((props, ref) =>
|
|
|
37888
38326
|
}) => {
|
|
37889
38327
|
onEdit === null || onEdit === void 0 ? void 0 : onEdit(editType === "add" ? event : key, editType);
|
|
37890
38328
|
},
|
|
37891
|
-
removeIcon: (_a = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a !== void 0 ? _a : /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
38329
|
+
removeIcon: (_a = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a !== void 0 ? _a : /* @__PURE__ */ React__namespace.createElement(RefIcon$C, null),
|
|
37892
38330
|
addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /* @__PURE__ */ React__namespace.createElement(RefIcon$r, null),
|
|
37893
38331
|
showAdd: hideAdd !== true
|
|
37894
38332
|
};
|
|
@@ -38570,7 +39008,7 @@ function throttle(delay, callback, options) {
|
|
|
38570
39008
|
wrapper.cancel = cancel;
|
|
38571
39009
|
return wrapper;
|
|
38572
39010
|
}
|
|
38573
|
-
function debounce
|
|
39011
|
+
function debounce(delay, callback, options) {
|
|
38574
39012
|
var _ref = {}, _ref$atBegin = _ref.atBegin, atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
|
|
38575
39013
|
return throttle(delay, callback, {
|
|
38576
39014
|
debounceMode: atBegin !== false
|
|
@@ -40585,7 +41023,7 @@ const getAllowClear = (allowClear) => {
|
|
|
40585
41023
|
mergedAllowClear = allowClear;
|
|
40586
41024
|
} else if (allowClear) {
|
|
40587
41025
|
mergedAllowClear = {
|
|
40588
|
-
clearIcon: /* @__PURE__ */ React.createElement(RefIcon$
|
|
41026
|
+
clearIcon: /* @__PURE__ */ React.createElement(RefIcon$D, null)
|
|
40589
41027
|
};
|
|
40590
41028
|
}
|
|
40591
41029
|
return mergedAllowClear;
|
|
@@ -42598,9 +43036,9 @@ const FormItemLabel = ({
|
|
|
42598
43036
|
}, labelChildren));
|
|
42599
43037
|
};
|
|
42600
43038
|
const iconMap = {
|
|
42601
|
-
success: RefIcon$
|
|
42602
|
-
warning: RefIcon$
|
|
42603
|
-
error: RefIcon$
|
|
43039
|
+
success: RefIcon$E,
|
|
43040
|
+
warning: RefIcon$B,
|
|
43041
|
+
error: RefIcon$D,
|
|
42604
43042
|
validating: RefIcon$z
|
|
42605
43043
|
};
|
|
42606
43044
|
function StatusProvider({
|
|
@@ -42636,10 +43074,10 @@ function StatusProvider({
|
|
|
42636
43074
|
errors,
|
|
42637
43075
|
warnings
|
|
42638
43076
|
})) === null || _a === void 0 ? void 0 : _a[mergedValidateStatus]);
|
|
42639
|
-
const
|
|
42640
|
-
feedbackIcon = customIconNode !== false &&
|
|
43077
|
+
const IconNode2 = mergedValidateStatus && iconMap[mergedValidateStatus];
|
|
43078
|
+
feedbackIcon = customIconNode !== false && IconNode2 ? /* @__PURE__ */ React__namespace.createElement("span", {
|
|
42641
43079
|
className: classNames(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)
|
|
42642
|
-
}, customIconNode || /* @__PURE__ */ React__namespace.createElement(
|
|
43080
|
+
}, customIconNode || /* @__PURE__ */ React__namespace.createElement(IconNode2, null)) : null;
|
|
42643
43081
|
}
|
|
42644
43082
|
const context = {
|
|
42645
43083
|
status: mergedValidateStatus || "",
|
|
@@ -44463,7 +44901,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
44463
44901
|
var defaultItemRender = function defaultItemRender2(page, type4, element2) {
|
|
44464
44902
|
return element2;
|
|
44465
44903
|
};
|
|
44466
|
-
function noop$
|
|
44904
|
+
function noop$3() {
|
|
44467
44905
|
}
|
|
44468
44906
|
function isInteger(v) {
|
|
44469
44907
|
var value2 = Number(v);
|
|
@@ -44474,7 +44912,7 @@ function calculatePage(p, pageSize, total) {
|
|
|
44474
44912
|
return Math.floor((total - 1) / _pageSize) + 1;
|
|
44475
44913
|
}
|
|
44476
44914
|
var Pagination$1 = function Pagination(props) {
|
|
44477
|
-
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$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;
|
|
44478
44916
|
var paginationRef = React.useRef(null);
|
|
44479
44917
|
var _useMergedState = useMergedState(10, {
|
|
44480
44918
|
value: pageSizeProp,
|
|
@@ -44491,7 +44929,7 @@ var Pagination$1 = function Pagination(props) {
|
|
|
44491
44929
|
React.useEffect(function() {
|
|
44492
44930
|
setInternalInputVal(current);
|
|
44493
44931
|
}, [current]);
|
|
44494
|
-
var hasOnChange = onChange !== noop$
|
|
44932
|
+
var hasOnChange = onChange !== noop$3;
|
|
44495
44933
|
var hasCurrent = "current" in props;
|
|
44496
44934
|
if (process.env.NODE_ENV !== "production") {
|
|
44497
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.");
|
|
@@ -46051,7 +46489,7 @@ const Spin = (props) => {
|
|
|
46051
46489
|
const mergedPercent = usePercent(spinning, percent);
|
|
46052
46490
|
React__namespace.useEffect(() => {
|
|
46053
46491
|
if (customSpinning) {
|
|
46054
|
-
const showSpinning = debounce
|
|
46492
|
+
const showSpinning = debounce(delay, () => {
|
|
46055
46493
|
setSpinning(true);
|
|
46056
46494
|
});
|
|
46057
46495
|
showSpinning();
|
|
@@ -46204,7 +46642,7 @@ const Overlay = (props) => {
|
|
|
46204
46642
|
cancelText,
|
|
46205
46643
|
okText,
|
|
46206
46644
|
okType = "primary",
|
|
46207
|
-
icon = /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
46645
|
+
icon = /* @__PURE__ */ React__namespace.createElement(RefIcon$B, null),
|
|
46208
46646
|
showCancel = true,
|
|
46209
46647
|
close,
|
|
46210
46648
|
onConfirm,
|
|
@@ -46282,7 +46720,7 @@ const InternalPopconfirm = /* @__PURE__ */ React__namespace.forwardRef((props, r
|
|
|
46282
46720
|
placement = "top",
|
|
46283
46721
|
trigger = "click",
|
|
46284
46722
|
okType = "primary",
|
|
46285
|
-
icon = /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
46723
|
+
icon = /* @__PURE__ */ React__namespace.createElement(RefIcon$B, null),
|
|
46286
46724
|
children: children2,
|
|
46287
46725
|
overlayClassName,
|
|
46288
46726
|
onOpenChange,
|
|
@@ -47273,9 +47711,9 @@ const Progress$2 = /* @__PURE__ */ React__namespace.forwardRef((props, ref) => {
|
|
|
47273
47711
|
if (infoPosition === "inner" || format3 || progressStatus !== "exception" && progressStatus !== "success") {
|
|
47274
47712
|
text2 = textFormatter(validProgress(percent), validProgress(successPercent));
|
|
47275
47713
|
} else if (progressStatus === "exception") {
|
|
47276
|
-
text2 = isLineType ? /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
47714
|
+
text2 = isLineType ? /* @__PURE__ */ React__namespace.createElement(RefIcon$D, null) : /* @__PURE__ */ React__namespace.createElement(RefIcon$C, null);
|
|
47277
47715
|
} else if (progressStatus === "success") {
|
|
47278
|
-
text2 = isLineType ? /* @__PURE__ */ React__namespace.createElement(RefIcon$
|
|
47716
|
+
text2 = isLineType ? /* @__PURE__ */ React__namespace.createElement(RefIcon$E, null) : /* @__PURE__ */ React__namespace.createElement(RefIcon$x, null);
|
|
47279
47717
|
}
|
|
47280
47718
|
return /* @__PURE__ */ React__namespace.createElement("span", {
|
|
47281
47719
|
className: classNames(`${prefixCls}-text`, {
|
|
@@ -48336,9 +48774,9 @@ const Unauthorized = () => /* @__PURE__ */ React__namespace.createElement("svg",
|
|
|
48336
48774
|
strokeWidth: "1.1"
|
|
48337
48775
|
})));
|
|
48338
48776
|
const IconMap = {
|
|
48339
|
-
success: RefIcon$
|
|
48340
|
-
error: RefIcon$
|
|
48341
|
-
info: RefIcon$
|
|
48777
|
+
success: RefIcon$E,
|
|
48778
|
+
error: RefIcon$D,
|
|
48779
|
+
info: RefIcon$B,
|
|
48342
48780
|
warning: RefIcon
|
|
48343
48781
|
};
|
|
48344
48782
|
const ExceptionMap = {
|
|
@@ -49300,8 +49738,8 @@ function Column$2(_) {
|
|
|
49300
49738
|
function ColumnGroup$1(_) {
|
|
49301
49739
|
return null;
|
|
49302
49740
|
}
|
|
49303
|
-
function fillRecords(list2, record, indent, childrenColumnName, expandedKeys,
|
|
49304
|
-
var key =
|
|
49741
|
+
function fillRecords(list2, record, indent, childrenColumnName, expandedKeys, getRowKey2, index2) {
|
|
49742
|
+
var key = getRowKey2(record, index2);
|
|
49305
49743
|
list2.push({
|
|
49306
49744
|
record,
|
|
49307
49745
|
indent,
|
|
@@ -49311,17 +49749,17 @@ function fillRecords(list2, record, indent, childrenColumnName, expandedKeys, ge
|
|
|
49311
49749
|
var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key);
|
|
49312
49750
|
if (record && Array.isArray(record[childrenColumnName]) && expanded) {
|
|
49313
49751
|
for (var i = 0; i < record[childrenColumnName].length; i += 1) {
|
|
49314
|
-
fillRecords(list2, record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys,
|
|
49752
|
+
fillRecords(list2, record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey2, i);
|
|
49315
49753
|
}
|
|
49316
49754
|
}
|
|
49317
49755
|
}
|
|
49318
|
-
function useFlattenRecords(data, childrenColumnName, expandedKeys,
|
|
49756
|
+
function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey2) {
|
|
49319
49757
|
var arr = React__namespace.useMemo(function() {
|
|
49320
49758
|
if (expandedKeys !== null && expandedKeys !== void 0 && expandedKeys.size) {
|
|
49321
49759
|
var list2 = [];
|
|
49322
49760
|
for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {
|
|
49323
49761
|
var record = data[i];
|
|
49324
|
-
fillRecords(list2, record, 0, childrenColumnName, expandedKeys,
|
|
49762
|
+
fillRecords(list2, record, 0, childrenColumnName, expandedKeys, getRowKey2, i);
|
|
49325
49763
|
}
|
|
49326
49764
|
return list2;
|
|
49327
49765
|
}
|
|
@@ -49330,10 +49768,10 @@ function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
|
|
|
49330
49768
|
record: item,
|
|
49331
49769
|
indent: 0,
|
|
49332
49770
|
index: index2,
|
|
49333
|
-
rowKey:
|
|
49771
|
+
rowKey: getRowKey2(item, index2)
|
|
49334
49772
|
};
|
|
49335
49773
|
});
|
|
49336
|
-
}, [data, childrenColumnName, expandedKeys,
|
|
49774
|
+
}, [data, childrenColumnName, expandedKeys, getRowKey2]);
|
|
49337
49775
|
return arr;
|
|
49338
49776
|
}
|
|
49339
49777
|
function useRowInfo(record, rowKey, recordIndex, indent) {
|
|
@@ -49424,11 +49862,11 @@ function renderExpandIcon$1(_ref) {
|
|
|
49424
49862
|
onClick
|
|
49425
49863
|
});
|
|
49426
49864
|
}
|
|
49427
|
-
function findAllChildrenKeys(data,
|
|
49865
|
+
function findAllChildrenKeys(data, getRowKey2, childrenColumnName) {
|
|
49428
49866
|
var keys2 = [];
|
|
49429
49867
|
function dig(list2) {
|
|
49430
49868
|
(list2 || []).forEach(function(item, index2) {
|
|
49431
|
-
keys2.push(
|
|
49869
|
+
keys2.push(getRowKey2(item, index2));
|
|
49432
49870
|
dig(item[childrenColumnName]);
|
|
49433
49871
|
});
|
|
49434
49872
|
}
|
|
@@ -49603,8 +50041,8 @@ function Body(props) {
|
|
|
49603
50041
|
devRenderTimes(props);
|
|
49604
50042
|
}
|
|
49605
50043
|
var data = props.data, measureColumnWidth = props.measureColumnWidth;
|
|
49606
|
-
var _useContext = useContext(TableContext, ["prefixCls", "getComponent", "onColumnResize", "flattenColumns", "getRowKey", "expandedKeys", "childrenColumnName", "emptyNode", "expandedRowOffset", "fixedInfoList", "colWidths"]), prefixCls = _useContext.prefixCls, getComponent = _useContext.getComponent, onColumnResize = _useContext.onColumnResize, flattenColumns = _useContext.flattenColumns,
|
|
49607
|
-
var flattenData2 = useFlattenRecords(data, childrenColumnName, expandedKeys,
|
|
50044
|
+
var _useContext = useContext(TableContext, ["prefixCls", "getComponent", "onColumnResize", "flattenColumns", "getRowKey", "expandedKeys", "childrenColumnName", "emptyNode", "expandedRowOffset", "fixedInfoList", "colWidths"]), prefixCls = _useContext.prefixCls, getComponent = _useContext.getComponent, onColumnResize = _useContext.onColumnResize, flattenColumns = _useContext.flattenColumns, getRowKey2 = _useContext.getRowKey, expandedKeys = _useContext.expandedKeys, childrenColumnName = _useContext.childrenColumnName, emptyNode = _useContext.emptyNode, _useContext$expandedR = _useContext.expandedRowOffset, expandedRowOffset = _useContext$expandedR === void 0 ? 0 : _useContext$expandedR, colWidths = _useContext.colWidths;
|
|
50045
|
+
var flattenData2 = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey2);
|
|
49608
50046
|
var rowKeys = React__namespace.useMemo(function() {
|
|
49609
50047
|
return flattenData2.map(function(item) {
|
|
49610
50048
|
return item.rowKey;
|
|
@@ -50073,7 +50511,7 @@ function revertForRtl(columns) {
|
|
|
50073
50511
|
});
|
|
50074
50512
|
}
|
|
50075
50513
|
function useColumns(_ref2, transformColumns) {
|
|
50076
|
-
var prefixCls = _ref2.prefixCls, columns = _ref2.columns, children2 = _ref2.children, expandable = _ref2.expandable, expandedKeys = _ref2.expandedKeys, columnTitle = _ref2.columnTitle,
|
|
50514
|
+
var prefixCls = _ref2.prefixCls, columns = _ref2.columns, children2 = _ref2.children, expandable = _ref2.expandable, expandedKeys = _ref2.expandedKeys, columnTitle = _ref2.columnTitle, getRowKey2 = _ref2.getRowKey, onTriggerExpand = _ref2.onTriggerExpand, expandIcon = _ref2.expandIcon, rowExpandable = _ref2.rowExpandable, expandIconColumnIndex = _ref2.expandIconColumnIndex, _ref2$expandedRowOffs = _ref2.expandedRowOffset, expandedRowOffset = _ref2$expandedRowOffs === void 0 ? 0 : _ref2$expandedRowOffs, direction = _ref2.direction, expandRowByClick = _ref2.expandRowByClick, columnWidth = _ref2.columnWidth, fixed = _ref2.fixed, scrollWidth = _ref2.scrollWidth, clientWidth = _ref2.clientWidth;
|
|
50077
50515
|
var baseColumns = React__namespace.useMemo(function() {
|
|
50078
50516
|
var newColumns = columns || convertChildrenToColumns(children2) || [];
|
|
50079
50517
|
return filterHiddenColumns(newColumns.slice());
|
|
@@ -50113,7 +50551,7 @@ function useColumns(_ref2, transformColumns) {
|
|
|
50113
50551
|
className: "".concat(prefixCls, "-expand-icon-col"),
|
|
50114
50552
|
columnType: "EXPAND_COLUMN"
|
|
50115
50553
|
}), "title", columnTitle), "fixed", fixedColumn), "className", "".concat(prefixCls, "-row-expand-icon-cell")), "width", columnWidth), "render", function render2(_, record, index2) {
|
|
50116
|
-
var rowKey =
|
|
50554
|
+
var rowKey = getRowKey2(record, index2);
|
|
50117
50555
|
var expanded = expandedKeys.has(rowKey);
|
|
50118
50556
|
var recordExpandable = rowExpandable ? rowExpandable(record) : true;
|
|
50119
50557
|
var icon = expandIcon({
|
|
@@ -50148,7 +50586,7 @@ function useColumns(_ref2, transformColumns) {
|
|
|
50148
50586
|
return baseColumns.filter(function(col) {
|
|
50149
50587
|
return col !== EXPAND_COLUMN;
|
|
50150
50588
|
});
|
|
50151
|
-
}, [expandable, baseColumns,
|
|
50589
|
+
}, [expandable, baseColumns, getRowKey2, expandedKeys, expandIcon, direction, expandedRowOffset]);
|
|
50152
50590
|
var mergedColumns = React__namespace.useMemo(function() {
|
|
50153
50591
|
var finalColumns = withExpandColumns;
|
|
50154
50592
|
if (transformColumns) {
|
|
@@ -50203,7 +50641,7 @@ function useColumns(_ref2, transformColumns) {
|
|
|
50203
50641
|
var _useWidthColumns = useWidthColumns(flattenColumns, scrollWidth, clientWidth), _useWidthColumns2 = _slicedToArray(_useWidthColumns, 2), filledColumns = _useWidthColumns2[0], realScrollWidth = _useWidthColumns2[1];
|
|
50204
50642
|
return [mergedColumns, filledColumns, realScrollWidth, hasGapFixed];
|
|
50205
50643
|
}
|
|
50206
|
-
function useExpand(props, mergedData,
|
|
50644
|
+
function useExpand(props, mergedData, getRowKey2) {
|
|
50207
50645
|
var expandableConfig = getExpandableProps(props);
|
|
50208
50646
|
var expandIcon = expandableConfig.expandIcon, expandedRowKeys = expandableConfig.expandedRowKeys, defaultExpandedRowKeys = expandableConfig.defaultExpandedRowKeys, defaultExpandAllRows = expandableConfig.defaultExpandAllRows, expandedRowRender = expandableConfig.expandedRowRender, onExpand = expandableConfig.onExpand, onExpandedRowsChange = expandableConfig.onExpandedRowsChange, childrenColumnName = expandableConfig.childrenColumnName;
|
|
50209
50647
|
var mergedExpandIcon = expandIcon || renderExpandIcon$1;
|
|
@@ -50224,7 +50662,7 @@ function useExpand(props, mergedData, getRowKey) {
|
|
|
50224
50662
|
return defaultExpandedRowKeys;
|
|
50225
50663
|
}
|
|
50226
50664
|
if (defaultExpandAllRows) {
|
|
50227
|
-
return findAllChildrenKeys(mergedData,
|
|
50665
|
+
return findAllChildrenKeys(mergedData, getRowKey2, mergedChildrenColumnName);
|
|
50228
50666
|
}
|
|
50229
50667
|
return [];
|
|
50230
50668
|
}), _React$useState2 = _slicedToArray(_React$useState, 2), innerExpandedKeys = _React$useState2[0], setInnerExpandedKeys = _React$useState2[1];
|
|
@@ -50232,7 +50670,7 @@ function useExpand(props, mergedData, getRowKey) {
|
|
|
50232
50670
|
return new Set(expandedRowKeys || innerExpandedKeys || []);
|
|
50233
50671
|
}, [expandedRowKeys, innerExpandedKeys]);
|
|
50234
50672
|
var onTriggerExpand = React__namespace.useCallback(function(record) {
|
|
50235
|
-
var key =
|
|
50673
|
+
var key = getRowKey2(record, mergedData.indexOf(record));
|
|
50236
50674
|
var newExpandedKeys;
|
|
50237
50675
|
var hasKey = mergedExpandedKeys.has(key);
|
|
50238
50676
|
if (hasKey) {
|
|
@@ -50248,7 +50686,7 @@ function useExpand(props, mergedData, getRowKey) {
|
|
|
50248
50686
|
if (onExpandedRowsChange) {
|
|
50249
50687
|
onExpandedRowsChange(newExpandedKeys);
|
|
50250
50688
|
}
|
|
50251
|
-
}, [
|
|
50689
|
+
}, [getRowKey2, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange]);
|
|
50252
50690
|
if (process.env.NODE_ENV !== "production" && expandedRowRender && mergedData.some(function(record) {
|
|
50253
50691
|
return Array.isArray(record === null || record === void 0 ? void 0 : record[mergedChildrenColumnName]);
|
|
50254
50692
|
})) {
|
|
@@ -50568,7 +51006,7 @@ function Table$3(tableProps, ref) {
|
|
|
50568
51006
|
var getComponent = React__namespace.useCallback(function(path2, defaultComponent) {
|
|
50569
51007
|
return get$2(components2, path2) || defaultComponent;
|
|
50570
51008
|
}, [components2]);
|
|
50571
|
-
var
|
|
51009
|
+
var getRowKey2 = React__namespace.useMemo(function() {
|
|
50572
51010
|
if (typeof rowKey === "function") {
|
|
50573
51011
|
return rowKey;
|
|
50574
51012
|
}
|
|
@@ -50582,14 +51020,14 @@ function Table$3(tableProps, ref) {
|
|
|
50582
51020
|
}, [rowKey]);
|
|
50583
51021
|
var customizeScrollBody = getComponent(["body"]);
|
|
50584
51022
|
var _useHover = useHover(), _useHover2 = _slicedToArray(_useHover, 3), startRow = _useHover2[0], endRow = _useHover2[1], onHover = _useHover2[2];
|
|
50585
|
-
var _useExpand = useExpand(props, mergedData,
|
|
51023
|
+
var _useExpand = useExpand(props, mergedData, getRowKey2), _useExpand2 = _slicedToArray(_useExpand, 6), expandableConfig = _useExpand2[0], expandableType = _useExpand2[1], mergedExpandedKeys = _useExpand2[2], mergedExpandIcon = _useExpand2[3], mergedChildrenColumnName = _useExpand2[4], onTriggerExpand = _useExpand2[5];
|
|
50586
51024
|
var scrollX = scroll === null || scroll === void 0 ? void 0 : scroll.x;
|
|
50587
51025
|
var _React$useState = React__namespace.useState(0), _React$useState2 = _slicedToArray(_React$useState, 2), componentWidth = _React$useState2[0], setComponentWidth = _React$useState2[1];
|
|
50588
51026
|
var _useColumns = useColumns(_objectSpread2(_objectSpread2(_objectSpread2({}, props), expandableConfig), {}, {
|
|
50589
51027
|
expandable: !!expandableConfig.expandedRowRender,
|
|
50590
51028
|
columnTitle: expandableConfig.columnTitle,
|
|
50591
51029
|
expandedKeys: mergedExpandedKeys,
|
|
50592
|
-
getRowKey,
|
|
51030
|
+
getRowKey: getRowKey2,
|
|
50593
51031
|
// https://github.com/ant-design/ant-design/issues/23894
|
|
50594
51032
|
onTriggerExpand,
|
|
50595
51033
|
expandIcon: mergedExpandIcon,
|
|
@@ -50623,7 +51061,7 @@ function Table$3(tableProps, ref) {
|
|
|
50623
51061
|
});
|
|
50624
51062
|
} else {
|
|
50625
51063
|
var _scrollBodyRef$curren2;
|
|
50626
|
-
var mergedKey = key !== null && key !== void 0 ? key :
|
|
51064
|
+
var mergedKey = key !== null && key !== void 0 ? key : getRowKey2(mergedData[index2]);
|
|
50627
51065
|
(_scrollBodyRef$curren2 = scrollBodyRef.current.querySelector('[data-row-key="'.concat(mergedKey, '"]'))) === null || _scrollBodyRef$curren2 === void 0 || _scrollBodyRef$curren2.scrollIntoView();
|
|
50628
51066
|
}
|
|
50629
51067
|
} else if ((_scrollBodyRef$curren3 = scrollBodyRef.current) !== null && _scrollBodyRef$curren3 !== void 0 && _scrollBodyRef$curren3.scrollTo) {
|
|
@@ -50989,7 +51427,7 @@ function Table$3(tableProps, ref) {
|
|
|
50989
51427
|
onHover,
|
|
50990
51428
|
rowExpandable: expandableConfig.rowExpandable,
|
|
50991
51429
|
onRow,
|
|
50992
|
-
getRowKey,
|
|
51430
|
+
getRowKey: getRowKey2,
|
|
50993
51431
|
expandedKeys: mergedExpandedKeys,
|
|
50994
51432
|
childrenColumnName: mergedChildrenColumnName,
|
|
50995
51433
|
rowHoverable
|
|
@@ -51033,7 +51471,7 @@ function Table$3(tableProps, ref) {
|
|
|
51033
51471
|
onHover,
|
|
51034
51472
|
expandableConfig.rowExpandable,
|
|
51035
51473
|
onRow,
|
|
51036
|
-
|
|
51474
|
+
getRowKey2,
|
|
51037
51475
|
mergedExpandedKeys,
|
|
51038
51476
|
mergedChildrenColumnName,
|
|
51039
51477
|
rowHoverable
|
|
@@ -51187,10 +51625,10 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
51187
51625
|
}
|
|
51188
51626
|
var Grid = /* @__PURE__ */ React__namespace.forwardRef(function(props, ref) {
|
|
51189
51627
|
var data = props.data, onScroll = props.onScroll;
|
|
51190
|
-
var _useContext = useContext(TableContext, ["flattenColumns", "onColumnResize", "getRowKey", "prefixCls", "expandedKeys", "childrenColumnName", "scrollX", "direction"]), flattenColumns = _useContext.flattenColumns, onColumnResize = _useContext.onColumnResize,
|
|
51628
|
+
var _useContext = useContext(TableContext, ["flattenColumns", "onColumnResize", "getRowKey", "prefixCls", "expandedKeys", "childrenColumnName", "scrollX", "direction"]), flattenColumns = _useContext.flattenColumns, onColumnResize = _useContext.onColumnResize, getRowKey2 = _useContext.getRowKey, expandedKeys = _useContext.expandedKeys, prefixCls = _useContext.prefixCls, childrenColumnName = _useContext.childrenColumnName, scrollX = _useContext.scrollX, direction = _useContext.direction;
|
|
51191
51629
|
var _useContext2 = useContext(StaticContext), sticky = _useContext2.sticky, scrollY = _useContext2.scrollY, listItemHeight = _useContext2.listItemHeight, getComponent = _useContext2.getComponent, onTablePropScroll = _useContext2.onScroll;
|
|
51192
51630
|
var listRef = React__namespace.useRef();
|
|
51193
|
-
var flattenData2 = useFlattenRecords(data, childrenColumnName, expandedKeys,
|
|
51631
|
+
var flattenData2 = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey2);
|
|
51194
51632
|
var columnsWidth = React__namespace.useMemo(function() {
|
|
51195
51633
|
var total = 0;
|
|
51196
51634
|
return flattenColumns.map(function(_ref) {
|
|
@@ -51304,10 +51742,10 @@ var Grid = /* @__PURE__ */ React__namespace.forwardRef(function(props, ref) {
|
|
|
51304
51742
|
}
|
|
51305
51743
|
var nodes = spanLines.map(function(index2) {
|
|
51306
51744
|
var item = flattenData2[index2];
|
|
51307
|
-
var rowKey =
|
|
51745
|
+
var rowKey = getRowKey2(item.record, index2);
|
|
51308
51746
|
var getHeight2 = function getHeight3(rowSpan) {
|
|
51309
51747
|
var endItemIndex = index2 + rowSpan - 1;
|
|
51310
|
-
var endItemKey =
|
|
51748
|
+
var endItemKey = getRowKey2(flattenData2[endItemIndex].record, endItemIndex);
|
|
51311
51749
|
var sizeInfo2 = getSize3(rowKey, endItemKey);
|
|
51312
51750
|
return sizeInfo2.bottom - sizeInfo2.top;
|
|
51313
51751
|
};
|
|
@@ -51355,7 +51793,7 @@ var Grid = /* @__PURE__ */ React__namespace.forwardRef(function(props, ref) {
|
|
|
51355
51793
|
itemHeight: listItemHeight || 24,
|
|
51356
51794
|
data: flattenData2,
|
|
51357
51795
|
itemKey: function itemKey2(item) {
|
|
51358
|
-
return
|
|
51796
|
+
return getRowKey2(item.record);
|
|
51359
51797
|
},
|
|
51360
51798
|
component: wrapperComponent,
|
|
51361
51799
|
scrollWidth: scrollX,
|
|
@@ -51371,7 +51809,7 @@ var Grid = /* @__PURE__ */ React__namespace.forwardRef(function(props, ref) {
|
|
|
51371
51809
|
onScroll: onTablePropScroll,
|
|
51372
51810
|
extraRender
|
|
51373
51811
|
}, function(item, index2, itemProps) {
|
|
51374
|
-
var rowKey =
|
|
51812
|
+
var rowKey = getRowKey2(item.record, index2);
|
|
51375
51813
|
return /* @__PURE__ */ React__namespace.createElement(ResponseBodyLine, {
|
|
51376
51814
|
data: item,
|
|
51377
51815
|
rowKey,
|
|
@@ -51988,7 +52426,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
51988
52426
|
data,
|
|
51989
52427
|
pageData,
|
|
51990
52428
|
getRecordByKey,
|
|
51991
|
-
getRowKey,
|
|
52429
|
+
getRowKey: getRowKey2,
|
|
51992
52430
|
expandType,
|
|
51993
52431
|
childrenColumnName,
|
|
51994
52432
|
locale: tableLocale,
|
|
@@ -52027,35 +52465,35 @@ const useSelection = (config, rowSelection) => {
|
|
|
52027
52465
|
}
|
|
52028
52466
|
let convertData = data;
|
|
52029
52467
|
if (preserveSelectedRowKeys) {
|
|
52030
|
-
const keysSet = new Set(flattedData.map((record, index2) =>
|
|
52468
|
+
const keysSet = new Set(flattedData.map((record, index2) => getRowKey2(record, index2)));
|
|
52031
52469
|
const preserveRecords = Array.from(preserveRecordsRef.current).reduce((total, [key, value2]) => keysSet.has(key) ? total : total.concat(value2), []);
|
|
52032
52470
|
convertData = [].concat(_toConsumableArray(convertData), _toConsumableArray(preserveRecords));
|
|
52033
52471
|
}
|
|
52034
52472
|
return convertDataToEntities(convertData, {
|
|
52035
|
-
externalGetKey:
|
|
52473
|
+
externalGetKey: getRowKey2,
|
|
52036
52474
|
childrenPropName: childrenColumnName
|
|
52037
52475
|
});
|
|
52038
|
-
}, [data,
|
|
52476
|
+
}, [data, getRowKey2, checkStrictly, childrenColumnName, preserveSelectedRowKeys, flattedData]);
|
|
52039
52477
|
const checkboxPropsMap = React.useMemo(() => {
|
|
52040
52478
|
const map2 = /* @__PURE__ */ new Map();
|
|
52041
52479
|
flattedData.forEach((record, index2) => {
|
|
52042
|
-
const key =
|
|
52480
|
+
const key = getRowKey2(record, index2);
|
|
52043
52481
|
const checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};
|
|
52044
52482
|
map2.set(key, checkboxProps);
|
|
52045
52483
|
process.env.NODE_ENV !== "production" ? warning3(!("checked" in checkboxProps || "defaultChecked" in checkboxProps), "usage", "Do not set `checked` or `defaultChecked` in `getCheckboxProps`. Please use `selectedRowKeys` instead.") : void 0;
|
|
52046
52484
|
});
|
|
52047
52485
|
return map2;
|
|
52048
|
-
}, [flattedData,
|
|
52486
|
+
}, [flattedData, getRowKey2, getCheckboxProps]);
|
|
52049
52487
|
const isCheckboxDisabled = React.useCallback((r2) => {
|
|
52050
|
-
const rowKey =
|
|
52488
|
+
const rowKey = getRowKey2(r2);
|
|
52051
52489
|
let checkboxProps;
|
|
52052
52490
|
if (checkboxPropsMap.has(rowKey)) {
|
|
52053
|
-
checkboxProps = checkboxPropsMap.get(
|
|
52491
|
+
checkboxProps = checkboxPropsMap.get(getRowKey2(r2));
|
|
52054
52492
|
} else {
|
|
52055
52493
|
checkboxProps = getCheckboxProps ? getCheckboxProps(r2) : void 0;
|
|
52056
52494
|
}
|
|
52057
52495
|
return !!(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.disabled);
|
|
52058
|
-
}, [checkboxPropsMap,
|
|
52496
|
+
}, [checkboxPropsMap, getRowKey2]);
|
|
52059
52497
|
const [derivedSelectedKeys, derivedHalfSelectedKeys] = React.useMemo(() => {
|
|
52060
52498
|
if (checkStrictly) {
|
|
52061
52499
|
return [mergedSelectedKeys || [], []];
|
|
@@ -52117,7 +52555,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52117
52555
|
key: "all",
|
|
52118
52556
|
text: tableLocale.selectionAll,
|
|
52119
52557
|
onSelect() {
|
|
52120
|
-
setSelectedKeys(data.map((record, index2) =>
|
|
52558
|
+
setSelectedKeys(data.map((record, index2) => getRowKey2(record, index2)).filter((key) => {
|
|
52121
52559
|
const checkProps = checkboxPropsMap.get(key);
|
|
52122
52560
|
return !(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled) || derivedSelectedKeySet.has(key);
|
|
52123
52561
|
}), "all");
|
|
@@ -52131,7 +52569,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52131
52569
|
onSelect() {
|
|
52132
52570
|
const keySet = new Set(derivedSelectedKeySet);
|
|
52133
52571
|
pageData.forEach((record, index2) => {
|
|
52134
|
-
const key =
|
|
52572
|
+
const key = getRowKey2(record, index2);
|
|
52135
52573
|
const checkProps = checkboxPropsMap.get(key);
|
|
52136
52574
|
if (!(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled)) {
|
|
52137
52575
|
if (keySet.has(key)) {
|
|
@@ -52172,7 +52610,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52172
52610
|
updatePrevSelectedIndex(null);
|
|
52173
52611
|
}
|
|
52174
52612
|
}));
|
|
52175
|
-
}, [selections, derivedSelectedKeySet, pageData,
|
|
52613
|
+
}, [selections, derivedSelectedKeySet, pageData, getRowKey2, onSelectInvert, setSelectedKeys]);
|
|
52176
52614
|
const transformColumns = React.useCallback((columns) => {
|
|
52177
52615
|
var _a;
|
|
52178
52616
|
if (!rowSelection) {
|
|
@@ -52181,7 +52619,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52181
52619
|
}
|
|
52182
52620
|
let cloneColumns = _toConsumableArray(columns);
|
|
52183
52621
|
const keySet = new Set(derivedSelectedKeySet);
|
|
52184
|
-
const recordKeys = flattedData.map(
|
|
52622
|
+
const recordKeys = flattedData.map(getRowKey2).filter((key) => !checkboxPropsMap.get(key).disabled);
|
|
52185
52623
|
const checkedCurrentAll = recordKeys.every((key) => keySet.has(key));
|
|
52186
52624
|
const checkedCurrentSome = recordKeys.some((key) => keySet.has(key));
|
|
52187
52625
|
const onSelectAllChange = () => {
|
|
@@ -52234,7 +52672,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52234
52672
|
}, /* @__PURE__ */ React__namespace.createElement("span", null, /* @__PURE__ */ React__namespace.createElement(RefIcon$w, null))));
|
|
52235
52673
|
}
|
|
52236
52674
|
const allDisabledData = flattedData.map((record, index2) => {
|
|
52237
|
-
const key =
|
|
52675
|
+
const key = getRowKey2(record, index2);
|
|
52238
52676
|
const checkboxProps = checkboxPropsMap.get(key) || {};
|
|
52239
52677
|
return Object.assign({
|
|
52240
52678
|
checked: keySet.has(key)
|
|
@@ -52273,7 +52711,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52273
52711
|
let renderCell;
|
|
52274
52712
|
if (selectionType === "radio") {
|
|
52275
52713
|
renderCell = (_, record, index2) => {
|
|
52276
|
-
const key =
|
|
52714
|
+
const key = getRowKey2(record, index2);
|
|
52277
52715
|
const checked = keySet.has(key);
|
|
52278
52716
|
const checkboxProps = checkboxPropsMap.get(key);
|
|
52279
52717
|
return {
|
|
@@ -52298,7 +52736,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52298
52736
|
} else {
|
|
52299
52737
|
renderCell = (_, record, index2) => {
|
|
52300
52738
|
var _a2;
|
|
52301
|
-
const key =
|
|
52739
|
+
const key = getRowKey2(record, index2);
|
|
52302
52740
|
const checked = keySet.has(key);
|
|
52303
52741
|
const indeterminate = derivedHalfSelectedKeySet.has(key);
|
|
52304
52742
|
const checkboxProps = checkboxPropsMap.get(key);
|
|
@@ -52430,7 +52868,7 @@ const useSelection = (config, rowSelection) => {
|
|
|
52430
52868
|
}
|
|
52431
52869
|
};
|
|
52432
52870
|
return cloneColumns.map((col) => col === SELECTION_COLUMN ? selectionColumn : col);
|
|
52433
|
-
}, [
|
|
52871
|
+
}, [getRowKey2, flattedData, rowSelection, derivedSelectedKeys, derivedSelectedKeySet, derivedHalfSelectedKeySet, selectionColWidth, mergedSelections, expandType, checkboxPropsMap, onSelectMultiple, triggerSingleSelection, isCheckboxDisabled]);
|
|
52434
52872
|
return [transformColumns, derivedSelectedKeySet];
|
|
52435
52873
|
};
|
|
52436
52874
|
function fillProxy(element2, handler) {
|
|
@@ -52715,7 +53153,7 @@ var HIDDEN_STYLE = {
|
|
|
52715
53153
|
padding: 0,
|
|
52716
53154
|
margin: 0
|
|
52717
53155
|
};
|
|
52718
|
-
var noop$
|
|
53156
|
+
var noop$2 = function noop() {
|
|
52719
53157
|
};
|
|
52720
53158
|
var MOTION_KEY = "RC_TREE_MOTION_".concat(Math.random());
|
|
52721
53159
|
var MotionNode = {
|
|
@@ -52851,7 +53289,7 @@ var NodeList = /* @__PURE__ */ React__namespace.forwardRef(function(props, ref)
|
|
|
52851
53289
|
onFocus,
|
|
52852
53290
|
onBlur,
|
|
52853
53291
|
value: "",
|
|
52854
|
-
onChange: noop$
|
|
53292
|
+
onChange: noop$2,
|
|
52855
53293
|
"aria-label": "for screen reader"
|
|
52856
53294
|
})), /* @__PURE__ */ React__namespace.createElement("div", {
|
|
52857
53295
|
className: "".concat(prefixCls, "-treenode"),
|
|
@@ -55310,14 +55748,14 @@ const useFilter = (props) => {
|
|
|
55310
55748
|
const transformColumns = (innerColumns) => injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, tableLocale, triggerFilter, getPopupContainer, void 0, rootClassName);
|
|
55311
55749
|
return [transformColumns, mergedFilterStates, filters];
|
|
55312
55750
|
};
|
|
55313
|
-
const useLazyKVMap = (data, childrenColumnName,
|
|
55751
|
+
const useLazyKVMap = (data, childrenColumnName, getRowKey2) => {
|
|
55314
55752
|
const mapCacheRef = React__namespace.useRef({});
|
|
55315
55753
|
function getRecordByKey(key) {
|
|
55316
55754
|
var _a;
|
|
55317
|
-
if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !==
|
|
55755
|
+
if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey2) {
|
|
55318
55756
|
let dig = function(records) {
|
|
55319
55757
|
records.forEach((record, index2) => {
|
|
55320
|
-
const rowKey =
|
|
55758
|
+
const rowKey = getRowKey2(record, index2);
|
|
55321
55759
|
kvMap.set(rowKey, record);
|
|
55322
55760
|
if (record && typeof record === "object" && childrenColumnName in record) {
|
|
55323
55761
|
dig(record[childrenColumnName] || []);
|
|
@@ -55330,7 +55768,7 @@ const useLazyKVMap = (data, childrenColumnName, getRowKey) => {
|
|
|
55330
55768
|
data,
|
|
55331
55769
|
childrenColumnName,
|
|
55332
55770
|
kvMap,
|
|
55333
|
-
getRowKey
|
|
55771
|
+
getRowKey: getRowKey2
|
|
55334
55772
|
};
|
|
55335
55773
|
}
|
|
55336
55774
|
return (_a = mapCacheRef.current.kvMap) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
@@ -57238,13 +57676,13 @@ const InternalTable = (props, ref) => {
|
|
|
57238
57676
|
useProxyImperativeHandle(ref, () => Object.assign(Object.assign({}, tblRef.current), {
|
|
57239
57677
|
nativeElement: rootRef.current
|
|
57240
57678
|
}));
|
|
57241
|
-
const
|
|
57679
|
+
const getRowKey2 = React__namespace.useMemo(() => {
|
|
57242
57680
|
if (typeof rowKey === "function") {
|
|
57243
57681
|
return rowKey;
|
|
57244
57682
|
}
|
|
57245
57683
|
return (record) => record === null || record === void 0 ? void 0 : record[rowKey];
|
|
57246
57684
|
}, [rowKey]);
|
|
57247
|
-
const [getRecordByKey] = useLazyKVMap(rawData, childrenColumnName,
|
|
57685
|
+
const [getRecordByKey] = useLazyKVMap(rawData, childrenColumnName, getRowKey2);
|
|
57248
57686
|
const changeEventInfo = {};
|
|
57249
57687
|
const triggerOnChange = (info, action, reset = false) => {
|
|
57250
57688
|
var _a2, _b2, _c, _d;
|
|
@@ -57349,7 +57787,7 @@ const InternalTable = (props, ref) => {
|
|
|
57349
57787
|
prefixCls,
|
|
57350
57788
|
data: mergedData,
|
|
57351
57789
|
pageData,
|
|
57352
|
-
getRowKey,
|
|
57790
|
+
getRowKey: getRowKey2,
|
|
57353
57791
|
getRecordByKey,
|
|
57354
57792
|
expandType,
|
|
57355
57793
|
childrenColumnName,
|
|
@@ -57364,7 +57802,7 @@ const InternalTable = (props, ref) => {
|
|
|
57364
57802
|
mergedRowClassName = classNames(rowClassName);
|
|
57365
57803
|
}
|
|
57366
57804
|
return classNames({
|
|
57367
|
-
[`${prefixCls}-row-selected`]: selectedKeySet.has(
|
|
57805
|
+
[`${prefixCls}-row-selected`]: selectedKeySet.has(getRowKey2(record, index2))
|
|
57368
57806
|
}, mergedRowClassName);
|
|
57369
57807
|
};
|
|
57370
57808
|
mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
|
|
@@ -57472,7 +57910,7 @@ const InternalTable = (props, ref) => {
|
|
|
57472
57910
|
[`${prefixCls}-empty`]: rawData.length === 0
|
|
57473
57911
|
}, cssVarCls, rootCls, hashId),
|
|
57474
57912
|
data: pageData,
|
|
57475
|
-
rowKey:
|
|
57913
|
+
rowKey: getRowKey2,
|
|
57476
57914
|
rowClassName: internalRowClassName,
|
|
57477
57915
|
emptyText,
|
|
57478
57916
|
// Internal
|
|
@@ -59839,7 +60277,7 @@ const Toast = ({
|
|
|
59839
60277
|
)
|
|
59840
60278
|
}
|
|
59841
60279
|
) : null,
|
|
59842
|
-
close ? /* @__PURE__ */ jsxRuntime.jsx(ToastCloseButton, { onClick: close, children: /* @__PURE__ */ jsxRuntime.jsx(RefIcon$
|
|
60280
|
+
close ? /* @__PURE__ */ jsxRuntime.jsx(ToastCloseButton, { onClick: close, children: /* @__PURE__ */ jsxRuntime.jsx(RefIcon$C, { style: { fontSize: 18 } }) }) : null
|
|
59843
60281
|
] });
|
|
59844
60282
|
};
|
|
59845
60283
|
const ToastContext = React.createContext(
|
|
@@ -71868,7 +72306,7 @@ var hasRequiredExtend;
|
|
|
71868
72306
|
function requireExtend() {
|
|
71869
72307
|
if (hasRequiredExtend) return extend$2;
|
|
71870
72308
|
hasRequiredExtend = 1;
|
|
71871
|
-
var
|
|
72309
|
+
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
71872
72310
|
var toStr = Object.prototype.toString;
|
|
71873
72311
|
var defineProperty = Object.defineProperty;
|
|
71874
72312
|
var gOPD = Object.getOwnPropertyDescriptor;
|
|
@@ -71882,15 +72320,15 @@ function requireExtend() {
|
|
|
71882
72320
|
if (!obj || toStr.call(obj) !== "[object Object]") {
|
|
71883
72321
|
return false;
|
|
71884
72322
|
}
|
|
71885
|
-
var hasOwnConstructor =
|
|
71886
|
-
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype &&
|
|
72323
|
+
var hasOwnConstructor = hasOwn2.call(obj, "constructor");
|
|
72324
|
+
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn2.call(obj.constructor.prototype, "isPrototypeOf");
|
|
71887
72325
|
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
|
|
71888
72326
|
return false;
|
|
71889
72327
|
}
|
|
71890
72328
|
var key;
|
|
71891
72329
|
for (key in obj) {
|
|
71892
72330
|
}
|
|
71893
|
-
return typeof key === "undefined" ||
|
|
72331
|
+
return typeof key === "undefined" || hasOwn2.call(obj, key);
|
|
71894
72332
|
};
|
|
71895
72333
|
var setProperty = function setProperty2(target, options) {
|
|
71896
72334
|
if (defineProperty && options.name === "__proto__") {
|
|
@@ -71906,7 +72344,7 @@ function requireExtend() {
|
|
|
71906
72344
|
};
|
|
71907
72345
|
var getProperty = function getProperty2(obj, name2) {
|
|
71908
72346
|
if (name2 === "__proto__") {
|
|
71909
|
-
if (!
|
|
72347
|
+
if (!hasOwn2.call(obj, name2)) {
|
|
71910
72348
|
return void 0;
|
|
71911
72349
|
} else if (gOPD) {
|
|
71912
72350
|
return gOPD(obj, name2).value;
|
|
@@ -71956,7 +72394,7 @@ function requireExtend() {
|
|
|
71956
72394
|
}
|
|
71957
72395
|
var extendExports = requireExtend();
|
|
71958
72396
|
const extend$1 = /* @__PURE__ */ getDefaultExportFromCjs(extendExports);
|
|
71959
|
-
function isPlainObject(value2) {
|
|
72397
|
+
function isPlainObject$1(value2) {
|
|
71960
72398
|
if (typeof value2 !== "object" || value2 === null) {
|
|
71961
72399
|
return false;
|
|
71962
72400
|
}
|
|
@@ -73360,7 +73798,7 @@ class Processor extends CallableInstance {
|
|
|
73360
73798
|
} else if (parameters2.length > 0) {
|
|
73361
73799
|
let [primary, ...rest] = parameters2;
|
|
73362
73800
|
const currentPrimary = attachers[entryIndex][1];
|
|
73363
|
-
if (isPlainObject(currentPrimary) && isPlainObject(primary)) {
|
|
73801
|
+
if (isPlainObject$1(currentPrimary) && isPlainObject$1(primary)) {
|
|
73364
73802
|
primary = extend$1(true, currentPrimary, primary);
|
|
73365
73803
|
}
|
|
73366
73804
|
attachers[entryIndex] = [plugin, primary, ...rest];
|
|
@@ -73387,7 +73825,7 @@ function assertUnfrozen(name2, frozen) {
|
|
|
73387
73825
|
}
|
|
73388
73826
|
}
|
|
73389
73827
|
function assertNode(node2) {
|
|
73390
|
-
if (!isPlainObject(node2) || typeof node2.type !== "string") {
|
|
73828
|
+
if (!isPlainObject$1(node2) || typeof node2.type !== "string") {
|
|
73391
73829
|
throw new TypeError("Expected node, got `" + node2 + "`");
|
|
73392
73830
|
}
|
|
73393
73831
|
}
|
|
@@ -74284,7 +74722,7 @@ function range2(start2, stop, step) {
|
|
|
74284
74722
|
}
|
|
74285
74723
|
return range3;
|
|
74286
74724
|
}
|
|
74287
|
-
var
|
|
74725
|
+
var noop$1 = { value: () => {
|
|
74288
74726
|
} };
|
|
74289
74727
|
function dispatch() {
|
|
74290
74728
|
for (var i = 0, n2 = arguments.length, _ = {}, t2; i < n2; ++i) {
|
|
@@ -74344,7 +74782,7 @@ function get$1(type4, name2) {
|
|
|
74344
74782
|
function set$1(type4, name2, callback) {
|
|
74345
74783
|
for (var i = 0, n2 = type4.length; i < n2; ++i) {
|
|
74346
74784
|
if (type4[i].name === name2) {
|
|
74347
|
-
type4[i] =
|
|
74785
|
+
type4[i] = noop$1, type4 = type4.slice(0, i).concat(type4.slice(i + 1));
|
|
74348
74786
|
break;
|
|
74349
74787
|
}
|
|
74350
74788
|
}
|
|
@@ -83893,89 +84331,1501 @@ const CustomPagination = ({
|
|
|
83893
84331
|
}
|
|
83894
84332
|
return null;
|
|
83895
84333
|
};
|
|
83896
|
-
var
|
|
83897
|
-
|
|
83898
|
-
|
|
83899
|
-
|
|
83900
|
-
|
|
83901
|
-
|
|
83902
|
-
|
|
83903
|
-
|
|
83904
|
-
|
|
83905
|
-
|
|
83906
|
-
|
|
83907
|
-
}
|
|
83908
|
-
|
|
83909
|
-
|
|
83910
|
-
|
|
83911
|
-
|
|
83912
|
-
|
|
83913
|
-
|
|
83914
|
-
|
|
83915
|
-
|
|
83916
|
-
|
|
83917
|
-
|
|
83918
|
-
|
|
83919
|
-
|
|
83920
|
-
|
|
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
|
+
}
|
|
83921
84388
|
}
|
|
83922
|
-
|
|
83923
|
-
|
|
83924
|
-
|
|
83925
|
-
|
|
83926
|
-
|
|
83927
|
-
|
|
83928
|
-
|
|
83929
|
-
|
|
83930
|
-
|
|
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;
|
|
83931
84513
|
}
|
|
83932
84514
|
}
|
|
83933
|
-
|
|
83934
|
-
|
|
83935
|
-
|
|
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
|
+
};
|
|
83936
84563
|
}
|
|
83937
|
-
|
|
83938
|
-
|
|
83939
|
-
|
|
83940
|
-
|
|
83941
|
-
|
|
83942
|
-
|
|
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();
|
|
83943
84586
|
}
|
|
83944
|
-
|
|
83945
|
-
|
|
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++;
|
|
84678
|
+
try {
|
|
84679
|
+
result = callback();
|
|
84680
|
+
} finally {
|
|
84681
|
+
transactions--;
|
|
84682
|
+
if (!transactions) {
|
|
84683
|
+
flush();
|
|
84684
|
+
}
|
|
83946
84685
|
}
|
|
83947
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;
|
|
83948
84737
|
};
|
|
83949
|
-
|
|
83950
|
-
|
|
83951
|
-
|
|
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
|
+
)
|
|
84908
|
+
);
|
|
84909
|
+
}
|
|
84910
|
+
return Reflect.get(target, key);
|
|
83952
84911
|
}
|
|
83953
84912
|
});
|
|
83954
|
-
|
|
83955
|
-
|
|
83956
|
-
|
|
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();
|
|
83957
84964
|
}
|
|
83958
|
-
|
|
83959
|
-
|
|
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
|
|
83960
85101
|
};
|
|
83961
|
-
|
|
83962
|
-
|
|
83963
|
-
|
|
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);
|
|
85109
|
+
}
|
|
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;
|
|
83964
85156
|
}
|
|
83965
|
-
|
|
85157
|
+
const includedProps = new Set(
|
|
85158
|
+
notifyOnChangePropsValue ?? this.#trackedProps
|
|
85159
|
+
);
|
|
85160
|
+
if (this.options.throwOnError) {
|
|
85161
|
+
includedProps.add("error");
|
|
85162
|
+
}
|
|
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
|
+
});
|
|
83966
85168
|
};
|
|
83967
|
-
|
|
83968
|
-
|
|
83969
|
-
|
|
85169
|
+
this.#notify({ listeners: shouldNotifyListeners() });
|
|
85170
|
+
}
|
|
85171
|
+
#updateQuery() {
|
|
85172
|
+
const query = this.#client.getQueryCache().build(this.#client, this.options);
|
|
85173
|
+
if (query === this.#currentQuery) {
|
|
85174
|
+
return;
|
|
85175
|
+
}
|
|
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
|
+
}
|
|
85321
|
+
}
|
|
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" }
|
|
85376
|
+
}
|
|
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
|
|
83970
85400
|
};
|
|
83971
|
-
return
|
|
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;
|
|
85419
|
+
return {
|
|
85420
|
+
clearReset: () => {
|
|
85421
|
+
isReset = false;
|
|
85422
|
+
},
|
|
85423
|
+
reset: () => {
|
|
85424
|
+
isReset = true;
|
|
85425
|
+
},
|
|
85426
|
+
isReset: () => {
|
|
85427
|
+
return isReset;
|
|
85428
|
+
}
|
|
85429
|
+
};
|
|
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
|
+
};
|
|
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
|
+
});
|
|
83972
85550
|
}
|
|
83973
|
-
|
|
83974
|
-
debounce$1.exports = debounce2;
|
|
83975
|
-
return debounce$1.exports;
|
|
85551
|
+
return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
|
|
83976
85552
|
}
|
|
83977
|
-
|
|
83978
|
-
|
|
85553
|
+
function useInfiniteQuery(options, queryClient) {
|
|
85554
|
+
return useBaseQuery(
|
|
85555
|
+
options,
|
|
85556
|
+
InfiniteQueryObserver
|
|
85557
|
+
);
|
|
85558
|
+
}
|
|
85559
|
+
const ResizableTitle = (props) => {
|
|
85560
|
+
const { onResize: onResize2, width, ...restProps } = props;
|
|
85561
|
+
if (!width || !onResize2) {
|
|
85562
|
+
return /* @__PURE__ */ jsxRuntime.jsx("th", { ...restProps });
|
|
85563
|
+
}
|
|
85564
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("th", { ...restProps, style: { ...restProps.style, position: "relative" }, children: [
|
|
85565
|
+
restProps.children,
|
|
85566
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
85567
|
+
"div",
|
|
85568
|
+
{
|
|
85569
|
+
style: {
|
|
85570
|
+
position: "absolute",
|
|
85571
|
+
right: "-5px",
|
|
85572
|
+
top: 0,
|
|
85573
|
+
height: "100%",
|
|
85574
|
+
width: "10px",
|
|
85575
|
+
cursor: "col-resize",
|
|
85576
|
+
zIndex: 1
|
|
85577
|
+
},
|
|
85578
|
+
onClick: (e3) => e3.stopPropagation(),
|
|
85579
|
+
onMouseDown: (e3) => {
|
|
85580
|
+
e3.stopPropagation();
|
|
85581
|
+
e3.preventDefault();
|
|
85582
|
+
const startX = e3.clientX;
|
|
85583
|
+
const startWidth = e3.target.parentElement?.offsetWidth || 150;
|
|
85584
|
+
const doDrag = (dragEvent) => {
|
|
85585
|
+
const newWidth = startWidth + (dragEvent.clientX - startX);
|
|
85586
|
+
if (newWidth > 50) {
|
|
85587
|
+
onResize2(newWidth);
|
|
85588
|
+
}
|
|
85589
|
+
};
|
|
85590
|
+
const stopDrag = () => {
|
|
85591
|
+
document.removeEventListener("mousemove", doDrag);
|
|
85592
|
+
document.removeEventListener("mouseup", stopDrag);
|
|
85593
|
+
};
|
|
85594
|
+
document.addEventListener("mousemove", doDrag);
|
|
85595
|
+
document.addEventListener("mouseup", stopDrag);
|
|
85596
|
+
}
|
|
85597
|
+
}
|
|
85598
|
+
)
|
|
85599
|
+
] });
|
|
85600
|
+
};
|
|
85601
|
+
const InfiniteScrollTable = ({
|
|
85602
|
+
instanceId,
|
|
85603
|
+
columns: initialColumns,
|
|
85604
|
+
fetchService,
|
|
85605
|
+
title,
|
|
85606
|
+
scrollHeight = 600,
|
|
85607
|
+
scrollWidth = 1300
|
|
85608
|
+
}) => {
|
|
85609
|
+
const observer = React.useRef();
|
|
85610
|
+
const [scrollableNode, setScrollableNode] = React.useState(
|
|
85611
|
+
null
|
|
85612
|
+
);
|
|
85613
|
+
const tableContainerRef = React.useCallback((node2) => {
|
|
85614
|
+
if (node2 !== null) {
|
|
85615
|
+
const scrollNode = node2.querySelector(".ant-table-body");
|
|
85616
|
+
setScrollableNode(scrollNode);
|
|
85617
|
+
}
|
|
85618
|
+
}, []);
|
|
85619
|
+
const {
|
|
85620
|
+
data,
|
|
85621
|
+
error: error2,
|
|
85622
|
+
fetchNextPage,
|
|
85623
|
+
hasNextPage: hasNextPage2,
|
|
85624
|
+
isFetchingNextPage,
|
|
85625
|
+
status
|
|
85626
|
+
} = useInfiniteQuery({
|
|
85627
|
+
queryKey: fetchService.queryKey,
|
|
85628
|
+
queryFn: fetchService.fetchData,
|
|
85629
|
+
initialPageParam: 1,
|
|
85630
|
+
getNextPageParam: (lastPage) => lastPage.hasNextPage ? lastPage.nextPage : void 0
|
|
85631
|
+
});
|
|
85632
|
+
const [columns, setColumns] = React.useState(initialColumns);
|
|
85633
|
+
const handleResize = (index2) => (newWidth) => {
|
|
85634
|
+
setColumns((prevColumns) => {
|
|
85635
|
+
const nextColumns = [...prevColumns];
|
|
85636
|
+
nextColumns[index2] = { ...nextColumns[index2], width: newWidth };
|
|
85637
|
+
return nextColumns;
|
|
85638
|
+
});
|
|
85639
|
+
};
|
|
85640
|
+
const resizableColumns = columns.map((col, index2) => ({
|
|
85641
|
+
...col,
|
|
85642
|
+
onHeaderCell: (column2) => ({
|
|
85643
|
+
width: column2.width,
|
|
85644
|
+
onResize: handleResize(index2)
|
|
85645
|
+
})
|
|
85646
|
+
}));
|
|
85647
|
+
const lastRowRef = React.useCallback(
|
|
85648
|
+
(node2) => {
|
|
85649
|
+
if (isFetchingNextPage || !scrollableNode) return;
|
|
85650
|
+
if (observer.current) observer.current.disconnect();
|
|
85651
|
+
observer.current = new IntersectionObserver(
|
|
85652
|
+
(entries) => {
|
|
85653
|
+
if (entries[0].isIntersecting && hasNextPage2) {
|
|
85654
|
+
fetchNextPage();
|
|
85655
|
+
}
|
|
85656
|
+
},
|
|
85657
|
+
{ root: scrollableNode, threshold: 0.5 }
|
|
85658
|
+
);
|
|
85659
|
+
if (node2) observer.current.observe(node2);
|
|
85660
|
+
},
|
|
85661
|
+
[isFetchingNextPage, hasNextPage2, fetchNextPage, scrollableNode]
|
|
85662
|
+
);
|
|
85663
|
+
const dataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
85664
|
+
const totalDocs = data?.pages?.[0]?.totalDocs ?? 0;
|
|
85665
|
+
if (status === "pending") {
|
|
85666
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85667
|
+
"div",
|
|
85668
|
+
{
|
|
85669
|
+
style: { display: "flex", justifyContent: "center", padding: "50px" },
|
|
85670
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Spin, { size: "large" })
|
|
85671
|
+
}
|
|
85672
|
+
);
|
|
85673
|
+
}
|
|
85674
|
+
if (status === "error") {
|
|
85675
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85676
|
+
Alert,
|
|
85677
|
+
{
|
|
85678
|
+
message: "Error",
|
|
85679
|
+
description: error2?.message,
|
|
85680
|
+
type: "error",
|
|
85681
|
+
showIcon: true
|
|
85682
|
+
}
|
|
85683
|
+
);
|
|
85684
|
+
}
|
|
85685
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
85686
|
+
"div",
|
|
85687
|
+
{
|
|
85688
|
+
style: {
|
|
85689
|
+
backgroundColor: "white",
|
|
85690
|
+
padding: "24px",
|
|
85691
|
+
borderRadius: "8px",
|
|
85692
|
+
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
85693
|
+
marginBottom: "24px"
|
|
85694
|
+
},
|
|
85695
|
+
ref: tableContainerRef,
|
|
85696
|
+
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
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative" }, children: [
|
|
85726
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
85727
|
+
.infinite-scroll-table .ant-pagination {
|
|
85728
|
+
display: none !important;
|
|
85729
|
+
}
|
|
85730
|
+
` }),
|
|
85731
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "infinite-scroll-table", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
85732
|
+
ForwardTable,
|
|
85733
|
+
{
|
|
85734
|
+
dataSource,
|
|
85735
|
+
columns: resizableColumns,
|
|
85736
|
+
components: { header: { cell: ResizableTitle } },
|
|
85737
|
+
rowKey: "id",
|
|
85738
|
+
pagination: false,
|
|
85739
|
+
showSorterTooltip: false,
|
|
85740
|
+
size: "small",
|
|
85741
|
+
scroll: { y: scrollHeight, x: scrollWidth },
|
|
85742
|
+
onChange: () => {
|
|
85743
|
+
},
|
|
85744
|
+
onRow: (record, index2) => {
|
|
85745
|
+
if (index2 === dataSource.length - 1) {
|
|
85746
|
+
return { ref: lastRowRef };
|
|
85747
|
+
}
|
|
85748
|
+
return {};
|
|
85749
|
+
}
|
|
85750
|
+
}
|
|
85751
|
+
) }),
|
|
85752
|
+
isFetchingNextPage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
85753
|
+
"div",
|
|
85754
|
+
{
|
|
85755
|
+
style: {
|
|
85756
|
+
position: "absolute",
|
|
85757
|
+
bottom: 0,
|
|
85758
|
+
left: 0,
|
|
85759
|
+
width: "100%",
|
|
85760
|
+
padding: "16px",
|
|
85761
|
+
display: "flex",
|
|
85762
|
+
justifyContent: "center",
|
|
85763
|
+
alignItems: "center",
|
|
85764
|
+
backgroundColor: "rgba(255, 255, 255, 0.7)",
|
|
85765
|
+
backdropFilter: "blur(2px)",
|
|
85766
|
+
zIndex: 10
|
|
85767
|
+
},
|
|
85768
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Spin, {})
|
|
85769
|
+
}
|
|
85770
|
+
)
|
|
85771
|
+
] }),
|
|
85772
|
+
!hasNextPage2 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
85773
|
+
"div",
|
|
85774
|
+
{
|
|
85775
|
+
style: {
|
|
85776
|
+
textAlign: "center",
|
|
85777
|
+
padding: "20px",
|
|
85778
|
+
borderTop: "1px solid #f0f0f0"
|
|
85779
|
+
},
|
|
85780
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Typography$1.Text, { type: "secondary", children: "You've reached the end of the launch history." })
|
|
85781
|
+
}
|
|
85782
|
+
)
|
|
85783
|
+
]
|
|
85784
|
+
}
|
|
85785
|
+
);
|
|
85786
|
+
};
|
|
85787
|
+
const getRowKey = (record, rowKey, index2, enableValidation = true) => {
|
|
85788
|
+
try {
|
|
85789
|
+
const key = typeof rowKey === "function" ? rowKey(record) : record[rowKey];
|
|
85790
|
+
if (enableValidation) {
|
|
85791
|
+
if (key === void 0 || key === null) {
|
|
85792
|
+
console.error(
|
|
85793
|
+
`Genesis Table: rowKey "${String(rowKey)}" returned undefined/null for record at index ${index2}.`,
|
|
85794
|
+
{
|
|
85795
|
+
record,
|
|
85796
|
+
rowKey,
|
|
85797
|
+
availableKeys: Object.keys(record)
|
|
85798
|
+
}
|
|
85799
|
+
);
|
|
85800
|
+
return `fallback-${index2}`;
|
|
85801
|
+
}
|
|
85802
|
+
if (typeof key === "string" && String(key).trim() === "") {
|
|
85803
|
+
console.warn(
|
|
85804
|
+
`Genesis Table: rowKey "${String(rowKey)}" returned empty string for record at index ${index2}.`,
|
|
85805
|
+
{
|
|
85806
|
+
record,
|
|
85807
|
+
rowKey
|
|
85808
|
+
}
|
|
85809
|
+
);
|
|
85810
|
+
return `fallback-${index2}`;
|
|
85811
|
+
}
|
|
85812
|
+
}
|
|
85813
|
+
return key;
|
|
85814
|
+
} catch (error2) {
|
|
85815
|
+
if (enableValidation) {
|
|
85816
|
+
console.error(
|
|
85817
|
+
`Genesis Table: Error accessing rowKey "${String(rowKey)}" for record at index ${index2}.`,
|
|
85818
|
+
{
|
|
85819
|
+
error: error2,
|
|
85820
|
+
record,
|
|
85821
|
+
rowKey,
|
|
85822
|
+
availableKeys: Object.keys(record)
|
|
85823
|
+
}
|
|
85824
|
+
);
|
|
85825
|
+
}
|
|
85826
|
+
return `fallback-${index2}`;
|
|
85827
|
+
}
|
|
85828
|
+
};
|
|
83979
85829
|
function Table({
|
|
83980
85830
|
columns,
|
|
83981
85831
|
dataSource,
|
|
@@ -83986,157 +85836,101 @@ function Table({
|
|
|
83986
85836
|
onRowClick,
|
|
83987
85837
|
pagination,
|
|
83988
85838
|
isMainContentCell = false,
|
|
83989
|
-
|
|
83990
|
-
|
|
85839
|
+
isInfiniteScroll = false,
|
|
85840
|
+
infiniteScrollConfig,
|
|
85841
|
+
enableRowKeyValidation = process.env.NODE_ENV === "development",
|
|
85842
|
+
onRowKeyError,
|
|
83991
85843
|
...rest
|
|
83992
85844
|
}) {
|
|
83993
|
-
const [materializedData, setMaterializedData] = React__namespace.useState([]);
|
|
83994
|
-
const [isLoadingMore, setIsLoadingMore] = React__namespace.useState(false);
|
|
83995
|
-
const [hasMoreData, setHasMoreData] = React__namespace.useState(true);
|
|
83996
|
-
const [dynamicHeight, setDynamicHeight] = React__namespace.useState(
|
|
83997
|
-
400
|
|
83998
|
-
);
|
|
83999
85845
|
const [selectedRowKeys, setSelectedRowKeys] = React__namespace.useState([]);
|
|
84000
85846
|
const [pressedRowKey, setPressedRowKey] = React__namespace.useState(
|
|
84001
85847
|
null
|
|
84002
85848
|
);
|
|
84003
85849
|
const tableRef = React__namespace.useRef(null);
|
|
84004
85850
|
const containerRef = React__namespace.useRef(null);
|
|
84005
|
-
React__namespace.useEffect(() => {
|
|
84006
|
-
if (isMaterializedView && materializedViewConfig?.height === "dynamic") {
|
|
84007
|
-
const calculateHeight = () => {
|
|
84008
|
-
if (!containerRef.current) return;
|
|
84009
|
-
const container = containerRef.current;
|
|
84010
|
-
const rect = container.getBoundingClientRect();
|
|
84011
|
-
const viewportHeight = window.innerHeight;
|
|
84012
|
-
const availableHeight = viewportHeight - rect.top - 100;
|
|
84013
|
-
const minHeight = typeof materializedViewConfig.minHeight === "number" ? materializedViewConfig.minHeight : 200;
|
|
84014
|
-
const maxHeight = typeof materializedViewConfig.maxHeight === "number" ? materializedViewConfig.maxHeight : availableHeight;
|
|
84015
|
-
const calculatedHeight = Math.max(
|
|
84016
|
-
minHeight,
|
|
84017
|
-
Math.min(maxHeight, availableHeight)
|
|
84018
|
-
);
|
|
84019
|
-
setDynamicHeight(calculatedHeight);
|
|
84020
|
-
};
|
|
84021
|
-
calculateHeight();
|
|
84022
|
-
window.addEventListener("resize", calculateHeight);
|
|
84023
|
-
return () => window.removeEventListener("resize", calculateHeight);
|
|
84024
|
-
}
|
|
84025
|
-
}, [isMaterializedView, materializedViewConfig]);
|
|
84026
|
-
React__namespace.useEffect(() => {
|
|
84027
|
-
if (isMaterializedView) {
|
|
84028
|
-
const initialSize = materializedViewConfig?.initialLoadSize || 50;
|
|
84029
|
-
const initialData = dataSource.slice(0, initialSize);
|
|
84030
|
-
setMaterializedData(initialData);
|
|
84031
|
-
setHasMoreData(dataSource.length > initialSize);
|
|
84032
|
-
}
|
|
84033
|
-
}, [dataSource, isMaterializedView, materializedViewConfig]);
|
|
84034
|
-
const handleScroll = React__namespace.useCallback(
|
|
84035
|
-
debounce((e3) => {
|
|
84036
|
-
if (!isMaterializedView || !materializedViewConfig?.onLoadMore || isLoadingMore || !hasMoreData) {
|
|
84037
|
-
return;
|
|
84038
|
-
}
|
|
84039
|
-
const { target } = e3;
|
|
84040
|
-
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
84041
|
-
const threshold = materializedViewConfig?.loadMoreThreshold || 100;
|
|
84042
|
-
if (scrollTop + clientHeight >= scrollHeight - threshold) {
|
|
84043
|
-
setIsLoadingMore(true);
|
|
84044
|
-
const currentLength = materializedData.length;
|
|
84045
|
-
const loadSize = materializedViewConfig?.initialLoadSize || 50;
|
|
84046
|
-
if (materializedViewConfig?.onLoadMore) {
|
|
84047
|
-
Promise.resolve(
|
|
84048
|
-
materializedViewConfig.onLoadMore(currentLength, loadSize)
|
|
84049
|
-
).then((newData) => {
|
|
84050
|
-
setMaterializedData((prev2) => [...prev2, ...newData]);
|
|
84051
|
-
setHasMoreData(newData.length === loadSize);
|
|
84052
|
-
}).catch((error2) => {
|
|
84053
|
-
console.error("Error loading more data:", error2);
|
|
84054
|
-
}).finally(() => {
|
|
84055
|
-
setIsLoadingMore(false);
|
|
84056
|
-
});
|
|
84057
|
-
} else {
|
|
84058
|
-
const newData = dataSource.slice(
|
|
84059
|
-
currentLength,
|
|
84060
|
-
currentLength + loadSize
|
|
84061
|
-
);
|
|
84062
|
-
setMaterializedData((prev2) => [...prev2, ...newData]);
|
|
84063
|
-
setHasMoreData(newData.length === loadSize);
|
|
84064
|
-
setIsLoadingMore(false);
|
|
84065
|
-
}
|
|
84066
|
-
}
|
|
84067
|
-
}, 200),
|
|
84068
|
-
[
|
|
84069
|
-
isMaterializedView,
|
|
84070
|
-
materializedViewConfig,
|
|
84071
|
-
materializedData,
|
|
84072
|
-
isLoadingMore,
|
|
84073
|
-
hasMoreData,
|
|
84074
|
-
dataSource
|
|
84075
|
-
]
|
|
84076
|
-
);
|
|
84077
85851
|
const paginationConfig = React__namespace.useMemo(() => {
|
|
84078
|
-
if (
|
|
84079
|
-
|
|
84080
|
-
}
|
|
84081
|
-
return pagination === false ? false : {
|
|
85852
|
+
if (!pagination) return false;
|
|
85853
|
+
return {
|
|
84082
85854
|
...pagination,
|
|
85855
|
+
showSizeChanger: false,
|
|
85856
|
+
// Disable Ant Design's size changer
|
|
85857
|
+
showQuickJumper: false,
|
|
85858
|
+
// Disable Ant Design's quick jumper
|
|
85859
|
+
showTotal: void 0,
|
|
85860
|
+
// Disable Ant Design's total display
|
|
84083
85861
|
itemRender: void 0,
|
|
84084
85862
|
// Clear any existing itemRender to avoid conflicts
|
|
84085
85863
|
render: (properties) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
84086
85864
|
CustomPagination,
|
|
84087
85865
|
{
|
|
84088
85866
|
...properties,
|
|
84089
|
-
paginationStyle: pagination
|
|
85867
|
+
paginationStyle: pagination && typeof pagination === "object" && "paginationStyle" in pagination ? pagination.paginationStyle : PaginationStyle.SIMPLE
|
|
84090
85868
|
}
|
|
84091
85869
|
)
|
|
84092
85870
|
};
|
|
84093
|
-
}, [
|
|
85871
|
+
}, [pagination]);
|
|
84094
85872
|
const scrollConfig = React__namespace.useMemo(() => {
|
|
84095
|
-
if (isMaterializedView) {
|
|
84096
|
-
const height = materializedViewConfig?.height === "dynamic" ? dynamicHeight : materializedViewConfig?.height || 400;
|
|
84097
|
-
return {
|
|
84098
|
-
...rest.scroll,
|
|
84099
|
-
y: height
|
|
84100
|
-
};
|
|
84101
|
-
}
|
|
84102
85873
|
return rest.scroll;
|
|
84103
|
-
}, [
|
|
84104
|
-
|
|
85874
|
+
}, [rest.scroll]);
|
|
85875
|
+
if (isInfiniteScroll && infiniteScrollConfig) {
|
|
85876
|
+
const resizableColumns = columns.map((col) => ({
|
|
85877
|
+
title: col.title,
|
|
85878
|
+
key: col.key,
|
|
85879
|
+
dataIndex: Array.isArray(col.dataIndex) ? col.dataIndex.join(".") : typeof col.dataIndex === "string" ? col.dataIndex : col.key,
|
|
85880
|
+
width: col.width || 150,
|
|
85881
|
+
render: col.render ? (value2, record, index2) => col.render(value2, record, index2 ?? 0) : void 0
|
|
85882
|
+
}));
|
|
85883
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85884
|
+
InfiniteScrollTable,
|
|
85885
|
+
{
|
|
85886
|
+
instanceId: infiniteScrollConfig.instanceId,
|
|
85887
|
+
columns: resizableColumns,
|
|
85888
|
+
fetchService: infiniteScrollConfig.fetchService,
|
|
85889
|
+
title: infiniteScrollConfig.title,
|
|
85890
|
+
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
85891
|
+
scrollWidth: infiniteScrollConfig.scrollWidth
|
|
85892
|
+
}
|
|
85893
|
+
);
|
|
85894
|
+
}
|
|
84105
85895
|
React__namespace.useEffect(() => {
|
|
84106
|
-
if (
|
|
84107
|
-
|
|
84108
|
-
|
|
84109
|
-
|
|
84110
|
-
|
|
84111
|
-
console.log("Genesis Table - rowKey type:", typeof rowKey);
|
|
84112
|
-
tableDataSource.slice(0, 3).map((record, index2) => {
|
|
84113
|
-
const key = typeof rowKey === "function" ? rowKey(record) : record[rowKey];
|
|
84114
|
-
console.log(
|
|
84115
|
-
`Genesis Table - Record ${index2} key:`,
|
|
84116
|
-
key,
|
|
84117
|
-
"Record:",
|
|
84118
|
-
record
|
|
85896
|
+
if (enableRowKeyValidation && dataSource.length > 0) {
|
|
85897
|
+
const sampleRecord = dataSource[0];
|
|
85898
|
+
if (typeof rowKey === "string" && !(rowKey in sampleRecord)) {
|
|
85899
|
+
const error2 = new Error(
|
|
85900
|
+
`rowKey "${rowKey}" does not exist in data records`
|
|
84119
85901
|
);
|
|
84120
|
-
|
|
84121
|
-
|
|
84122
|
-
|
|
84123
|
-
(record) => typeof rowKey === "function" ? rowKey(record) : record[rowKey]
|
|
84124
|
-
);
|
|
84125
|
-
const uniqueKeys = [...new Set(allKeys)];
|
|
84126
|
-
console.log(
|
|
84127
|
-
`Genesis Table - Total keys: ${allKeys.length}, Unique keys: ${uniqueKeys.length}`
|
|
84128
|
-
);
|
|
84129
|
-
if (allKeys.length !== uniqueKeys.length) {
|
|
84130
|
-
console.error("Genesis Table - DUPLICATE KEYS FOUND:", allKeys);
|
|
84131
|
-
const duplicates = allKeys.filter(
|
|
84132
|
-
(key, index2) => allKeys.indexOf(key) !== index2
|
|
85902
|
+
console.error(
|
|
85903
|
+
`Genesis Table: ${error2.message}. Available keys:`,
|
|
85904
|
+
Object.keys(sampleRecord)
|
|
84133
85905
|
);
|
|
84134
|
-
|
|
84135
|
-
|
|
84136
|
-
|
|
85906
|
+
onRowKeyError?.({
|
|
85907
|
+
record: sampleRecord,
|
|
85908
|
+
rowKey,
|
|
85909
|
+
index: 0,
|
|
85910
|
+
error: error2
|
|
85911
|
+
});
|
|
85912
|
+
}
|
|
85913
|
+
const keys2 = dataSource.map(
|
|
85914
|
+
(record, index2) => getRowKey(record, rowKey, index2, false)
|
|
85915
|
+
// Don't log individual errors here
|
|
85916
|
+
);
|
|
85917
|
+
const uniqueKeys = [...new Set(keys2)];
|
|
85918
|
+
if (keys2.length !== uniqueKeys.length) {
|
|
85919
|
+
const error2 = new Error(`Duplicate row keys detected`);
|
|
85920
|
+
console.error(`Genesis Table: ${error2.message}!`, {
|
|
85921
|
+
totalKeys: keys2.length,
|
|
85922
|
+
uniqueKeys: uniqueKeys.length,
|
|
85923
|
+
duplicates: keys2.filter((key, index2) => keys2.indexOf(key) !== index2)
|
|
85924
|
+
});
|
|
85925
|
+
onRowKeyError?.({
|
|
85926
|
+
record: dataSource[0],
|
|
85927
|
+
rowKey,
|
|
85928
|
+
index: 0,
|
|
85929
|
+
error: error2
|
|
85930
|
+
});
|
|
84137
85931
|
}
|
|
84138
85932
|
}
|
|
84139
|
-
}, [
|
|
85933
|
+
}, [dataSource, rowKey, enableRowKeyValidation, onRowKeyError]);
|
|
84140
85934
|
const handleRowMouseDown = React__namespace.useCallback(
|
|
84141
85935
|
(record, index2, event) => {
|
|
84142
85936
|
const target = event.target;
|
|
@@ -84146,10 +85940,15 @@ function Table({
|
|
|
84146
85940
|
if (isInteractiveElement) {
|
|
84147
85941
|
return;
|
|
84148
85942
|
}
|
|
84149
|
-
const recordKey =
|
|
85943
|
+
const recordKey = getRowKey(
|
|
85944
|
+
record,
|
|
85945
|
+
rowKey,
|
|
85946
|
+
index2,
|
|
85947
|
+
enableRowKeyValidation
|
|
85948
|
+
);
|
|
84150
85949
|
setPressedRowKey(recordKey);
|
|
84151
85950
|
},
|
|
84152
|
-
[rowKey]
|
|
85951
|
+
[rowKey, enableRowKeyValidation]
|
|
84153
85952
|
);
|
|
84154
85953
|
const handleRowMouseUp = React__namespace.useCallback(
|
|
84155
85954
|
(record, index2, event) => {
|
|
@@ -84159,25 +85958,15 @@ function Table({
|
|
|
84159
85958
|
);
|
|
84160
85959
|
const handleRowClick = React__namespace.useCallback(
|
|
84161
85960
|
(record, index2, event) => {
|
|
84162
|
-
console.log("Genesis Table - Row clicked:", record, "index:", index2);
|
|
84163
|
-
console.log("Genesis Table - onRowClick function:", onRowClick);
|
|
84164
85961
|
const target = event.target;
|
|
84165
85962
|
const isInteractiveElement = target.closest(
|
|
84166
85963
|
'button, a, input, select, textarea, [role="button"], [onclick], .ant-checkbox-wrapper, .ant-checkbox'
|
|
84167
85964
|
);
|
|
84168
|
-
console.log("Genesis Table - Target element:", target);
|
|
84169
|
-
console.log("Genesis Table - Target tagName:", target.tagName);
|
|
84170
|
-
console.log("Genesis Table - Target className:", target.className);
|
|
84171
|
-
console.log("Genesis Table - Is interactive element:", isInteractiveElement);
|
|
84172
85965
|
if (isInteractiveElement) {
|
|
84173
|
-
console.log("Genesis Table - Skipping row click due to interactive element");
|
|
84174
85966
|
return;
|
|
84175
85967
|
}
|
|
84176
85968
|
if (onRowClick) {
|
|
84177
|
-
console.log("Genesis Table - Calling onRowClick function");
|
|
84178
85969
|
onRowClick(record, index2, event);
|
|
84179
|
-
} else {
|
|
84180
|
-
console.log("Genesis Table - onRowClick not provided");
|
|
84181
85970
|
}
|
|
84182
85971
|
},
|
|
84183
85972
|
[onRowClick]
|
|
@@ -84190,7 +85979,6 @@ function Table({
|
|
|
84190
85979
|
// Use internal state
|
|
84191
85980
|
// Override the onChange to ensure we get the latest data
|
|
84192
85981
|
onChange: (selectedRowKeys2, selectedRows) => {
|
|
84193
|
-
console.log("Row selection changed:", selectedRowKeys2, selectedRows);
|
|
84194
85982
|
setSelectedRowKeys(selectedRowKeys2);
|
|
84195
85983
|
if (rowSelection.onChange) {
|
|
84196
85984
|
rowSelection.onChange(selectedRowKeys2, selectedRows);
|
|
@@ -84198,42 +85986,62 @@ function Table({
|
|
|
84198
85986
|
}
|
|
84199
85987
|
};
|
|
84200
85988
|
}, [rowSelection, selectedRowKeys]);
|
|
84201
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
84202
|
-
|
|
84203
|
-
|
|
84204
|
-
|
|
84205
|
-
|
|
84206
|
-
|
|
84207
|
-
|
|
84208
|
-
|
|
84209
|
-
|
|
84210
|
-
|
|
84211
|
-
|
|
84212
|
-
|
|
84213
|
-
|
|
84214
|
-
|
|
84215
|
-
|
|
84216
|
-
|
|
84217
|
-
|
|
84218
|
-
|
|
84219
|
-
|
|
84220
|
-
|
|
84221
|
-
|
|
84222
|
-
|
|
84223
|
-
|
|
84224
|
-
|
|
84225
|
-
|
|
84226
|
-
|
|
84227
|
-
|
|
84228
|
-
|
|
84229
|
-
|
|
84230
|
-
|
|
84231
|
-
|
|
84232
|
-
|
|
84233
|
-
|
|
84234
|
-
|
|
84235
|
-
|
|
84236
|
-
|
|
85989
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, children: [
|
|
85990
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
85991
|
+
.genesis-table .ant-pagination {
|
|
85992
|
+
display: none !important;
|
|
85993
|
+
}
|
|
85994
|
+
.genesis-table .ant-pagination-item {
|
|
85995
|
+
display: none !important;
|
|
85996
|
+
}
|
|
85997
|
+
.genesis-table .ant-pagination-prev {
|
|
85998
|
+
display: none !important;
|
|
85999
|
+
}
|
|
86000
|
+
.genesis-table .ant-pagination-next {
|
|
86001
|
+
display: none !important;
|
|
86002
|
+
}
|
|
86003
|
+
` }),
|
|
86004
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "genesis-table", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
86005
|
+
Table$1,
|
|
86006
|
+
{
|
|
86007
|
+
ref: tableRef,
|
|
86008
|
+
"data-testid": "Table",
|
|
86009
|
+
dataSource,
|
|
86010
|
+
columns,
|
|
86011
|
+
rowKey,
|
|
86012
|
+
locale: { emptyText: "No Data" },
|
|
86013
|
+
size,
|
|
86014
|
+
onChange,
|
|
86015
|
+
rowSelection: enhancedRowSelection,
|
|
86016
|
+
onRow: (record, index2) => {
|
|
86017
|
+
const isDisabled = rowSelection?.getCheckboxProps?.(record)?.disabled ?? false;
|
|
86018
|
+
const recordKey = getRowKey(
|
|
86019
|
+
record,
|
|
86020
|
+
rowKey,
|
|
86021
|
+
index2 ?? 0,
|
|
86022
|
+
enableRowKeyValidation
|
|
86023
|
+
);
|
|
86024
|
+
const isPressed = pressedRowKey === recordKey;
|
|
86025
|
+
return {
|
|
86026
|
+
onClick: (event) => handleRowClick(record, index2 ?? 0, event),
|
|
86027
|
+
onMouseDown: (event) => handleRowMouseDown(record, index2 ?? 0, event),
|
|
86028
|
+
onMouseUp: (event) => handleRowMouseUp(record, index2 ?? 0, event),
|
|
86029
|
+
onMouseLeave: () => setPressedRowKey(null),
|
|
86030
|
+
// Clear pressed state when mouse leaves
|
|
86031
|
+
style: {
|
|
86032
|
+
cursor: onRowClick ? "pointer" : "default",
|
|
86033
|
+
opacity: isDisabled ? 0.6 : 1
|
|
86034
|
+
},
|
|
86035
|
+
className: isPressed ? "ant-table-row-pressed" : ""
|
|
86036
|
+
};
|
|
86037
|
+
},
|
|
86038
|
+
pagination: paginationConfig,
|
|
86039
|
+
scroll: scrollConfig,
|
|
86040
|
+
$isMainContentCell: isMainContentCell,
|
|
86041
|
+
...rest
|
|
86042
|
+
}
|
|
86043
|
+
) })
|
|
86044
|
+
] });
|
|
84237
86045
|
}
|
|
84238
86046
|
const TablePagination = ({
|
|
84239
86047
|
columns,
|
|
@@ -84700,15 +86508,7 @@ const TableWithControls = ({
|
|
|
84700
86508
|
onRowClick
|
|
84701
86509
|
}) => {
|
|
84702
86510
|
const { primaryTableRowData, secondaryTableRowData } = tableControlsData2;
|
|
84703
|
-
const {
|
|
84704
|
-
dataSource,
|
|
84705
|
-
columns,
|
|
84706
|
-
rowSelection,
|
|
84707
|
-
hasSettings,
|
|
84708
|
-
hasFilter,
|
|
84709
|
-
isMaterializedView,
|
|
84710
|
-
materializedViewConfig
|
|
84711
|
-
} = tableData;
|
|
86511
|
+
const { dataSource, columns, rowSelection, hasSettings, hasFilter } = tableData;
|
|
84712
86512
|
const onTableControlsChange = (event) => {
|
|
84713
86513
|
onChange(event);
|
|
84714
86514
|
};
|
|
@@ -84734,9 +86534,7 @@ const TableWithControls = ({
|
|
|
84734
86534
|
columns,
|
|
84735
86535
|
rowSelection,
|
|
84736
86536
|
onChange: onTableChange,
|
|
84737
|
-
onRowClick
|
|
84738
|
-
isMaterializedView,
|
|
84739
|
-
materializedViewConfig
|
|
86537
|
+
onRowClick
|
|
84740
86538
|
}
|
|
84741
86539
|
)
|
|
84742
86540
|
] });
|
|
@@ -85088,7 +86886,19 @@ const mockDataSource = {
|
|
|
85088
86886
|
nickname: "Beach",
|
|
85089
86887
|
address: "333 Shore Dr"
|
|
85090
86888
|
},
|
|
85091
|
-
job_subtype: "delivery"
|
|
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
|
+
}
|
|
85092
86902
|
},
|
|
85093
86903
|
{
|
|
85094
86904
|
id: "12",
|
|
@@ -85099,7 +86909,19 @@ const mockDataSource = {
|
|
|
85099
86909
|
nickname: "Hotel",
|
|
85100
86910
|
address: "444 Stay Blvd"
|
|
85101
86911
|
},
|
|
85102
|
-
job_subtype: "pickup"
|
|
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
|
+
}
|
|
85103
86925
|
},
|
|
85104
86926
|
{
|
|
85105
86927
|
id: "13",
|
|
@@ -85110,7 +86932,19 @@ const mockDataSource = {
|
|
|
85110
86932
|
nickname: "Airport",
|
|
85111
86933
|
address: "666 Flight Way"
|
|
85112
86934
|
},
|
|
85113
|
-
job_subtype: "delivery"
|
|
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
|
+
}
|
|
85114
86948
|
},
|
|
85115
86949
|
{
|
|
85116
86950
|
id: "14",
|
|
@@ -85121,7 +86955,19 @@ const mockDataSource = {
|
|
|
85121
86955
|
nickname: "Stadium",
|
|
85122
86956
|
address: "777 Sports Complex"
|
|
85123
86957
|
},
|
|
85124
|
-
job_subtype: "pickup"
|
|
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
|
+
}
|
|
85125
86971
|
},
|
|
85126
86972
|
{
|
|
85127
86973
|
id: "15",
|
|
@@ -85132,7 +86978,19 @@ const mockDataSource = {
|
|
|
85132
86978
|
nickname: "Theater",
|
|
85133
86979
|
address: "888 Show Ave"
|
|
85134
86980
|
},
|
|
85135
|
-
job_subtype: "delivery"
|
|
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
|
+
}
|
|
85136
86994
|
},
|
|
85137
86995
|
{
|
|
85138
86996
|
id: "16",
|
|
@@ -85143,7 +87001,19 @@ const mockDataSource = {
|
|
|
85143
87001
|
nickname: "Museum",
|
|
85144
87002
|
address: "999 History Lane"
|
|
85145
87003
|
},
|
|
85146
|
-
job_subtype: "pickup"
|
|
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
|
+
}
|
|
85147
87017
|
},
|
|
85148
87018
|
{
|
|
85149
87019
|
id: "17",
|
|
@@ -85154,7 +87024,19 @@ const mockDataSource = {
|
|
|
85154
87024
|
nickname: "Zoo",
|
|
85155
87025
|
address: "123 Animal Park"
|
|
85156
87026
|
},
|
|
85157
|
-
job_subtype: "delivery"
|
|
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
|
+
}
|
|
85158
87040
|
},
|
|
85159
87041
|
{
|
|
85160
87042
|
id: "18",
|
|
@@ -85165,7 +87047,19 @@ const mockDataSource = {
|
|
|
85165
87047
|
nickname: "Bank",
|
|
85166
87048
|
address: "456 Money St"
|
|
85167
87049
|
},
|
|
85168
|
-
job_subtype: "pickup"
|
|
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
|
+
}
|
|
85169
87063
|
},
|
|
85170
87064
|
{
|
|
85171
87065
|
id: "19",
|
|
@@ -85176,7 +87070,19 @@ const mockDataSource = {
|
|
|
85176
87070
|
nickname: "Post Office",
|
|
85177
87071
|
address: "789 Mail Road"
|
|
85178
87072
|
},
|
|
85179
|
-
job_subtype: "delivery"
|
|
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
|
+
}
|
|
85180
87086
|
},
|
|
85181
87087
|
{
|
|
85182
87088
|
id: "20",
|
|
@@ -85187,7 +87093,19 @@ const mockDataSource = {
|
|
|
85187
87093
|
nickname: "Church",
|
|
85188
87094
|
address: "321 Faith Street"
|
|
85189
87095
|
},
|
|
85190
|
-
job_subtype: "pickup"
|
|
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
|
+
}
|
|
85191
87109
|
},
|
|
85192
87110
|
{
|
|
85193
87111
|
id: "21",
|
|
@@ -85198,7 +87116,19 @@ const mockDataSource = {
|
|
|
85198
87116
|
nickname: "Pharmacy",
|
|
85199
87117
|
address: "654 Health Ave"
|
|
85200
87118
|
},
|
|
85201
|
-
job_subtype: "delivery"
|
|
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
|
+
}
|
|
85202
87132
|
}
|
|
85203
87133
|
]
|
|
85204
87134
|
};
|
|
@@ -85246,7 +87176,7 @@ const startingUseTableConfig = {
|
|
|
85246
87176
|
},
|
|
85247
87177
|
hasSettings: true,
|
|
85248
87178
|
hasFilter: true,
|
|
85249
|
-
//
|
|
87179
|
+
// Allow disableAutoFetch to be overridden by the config
|
|
85250
87180
|
disableAutoFetch: true,
|
|
85251
87181
|
dataSource: []
|
|
85252
87182
|
};
|