@canvas-components/react-list-table 0.3.77 → 0.3.78
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/README.md +77 -0
- package/dist/index.cjs +1037 -245
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +1037 -245
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -62,6 +62,694 @@ function useStorageKeyState(storageKey, createInitial) {
|
|
|
62
62
|
);
|
|
63
63
|
return [state.storageKey === storageKey ? state.value : initial, setValue];
|
|
64
64
|
}
|
|
65
|
+
var modes = [
|
|
66
|
+
{ value: "cell", label: "\u5355\u5143\u683C" },
|
|
67
|
+
{ value: "row", label: "\u884C" },
|
|
68
|
+
{ value: "column", label: "\u5217" },
|
|
69
|
+
{ value: "cross", label: "\u884C\uFF0B\u5217" }
|
|
70
|
+
];
|
|
71
|
+
function HighlightConfigDialog({
|
|
72
|
+
capability,
|
|
73
|
+
onClose
|
|
74
|
+
}) {
|
|
75
|
+
const [initial] = react.useState(() => ({ ...capability.config }));
|
|
76
|
+
const [draft, setDraft] = react.useState(initial);
|
|
77
|
+
const [error, setError] = react.useState("");
|
|
78
|
+
const patch = (value) => {
|
|
79
|
+
setDraft((current) => ({ ...current, ...value }));
|
|
80
|
+
setError("");
|
|
81
|
+
};
|
|
82
|
+
const confirm = () => {
|
|
83
|
+
if (capability.getVersion() !== capability.version) {
|
|
84
|
+
setError("\u9AD8\u4EAE\u914D\u7F6E\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u914D\u7F6E\u3002");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (JSON.stringify(draft) === JSON.stringify(initial)) {
|
|
88
|
+
onClose();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const result = capability.apply(draft);
|
|
92
|
+
if (!result.ok) {
|
|
93
|
+
setError(result.error);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (result.warning) reactComponents.reactMessage.warning(result.warning);
|
|
97
|
+
onClose();
|
|
98
|
+
};
|
|
99
|
+
const previewRows = [
|
|
100
|
+
["\u5F20\u4E09", "\u9500\u552E", "\u6B63\u5E38"],
|
|
101
|
+
["\u674E\u56DB", "\u6280\u672F", "\u6B63\u5E38"],
|
|
102
|
+
["\u738B\u4E94", "\u8FD0\u7EF4", "\u5F85\u590D\u6838"]
|
|
103
|
+
];
|
|
104
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
reactComponents.ReactModal,
|
|
106
|
+
{
|
|
107
|
+
open: true,
|
|
108
|
+
title: "\u9AD8\u4EAE\u914D\u7F6E",
|
|
109
|
+
width: 560,
|
|
110
|
+
onCancel: onClose,
|
|
111
|
+
onOk: confirm,
|
|
112
|
+
okText: "\u786E\u5B9A",
|
|
113
|
+
cancelText: "\u53D6\u6D88",
|
|
114
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 18, fontSize: 14 }, children: [
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
style: {
|
|
120
|
+
display: "flex",
|
|
121
|
+
gap: 16,
|
|
122
|
+
alignItems: "center",
|
|
123
|
+
justifyContent: "space-between",
|
|
124
|
+
flexWrap: "wrap"
|
|
125
|
+
},
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
128
|
+
"label",
|
|
129
|
+
{
|
|
130
|
+
style: {
|
|
131
|
+
display: "flex",
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
gap: 6,
|
|
134
|
+
flexShrink: 0,
|
|
135
|
+
whiteSpace: "nowrap"
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
+
"input",
|
|
140
|
+
{
|
|
141
|
+
type: "checkbox",
|
|
142
|
+
checked: draft.cacheToLocal === true,
|
|
143
|
+
onChange: (event) => patch({ cacheToLocal: event.target.checked })
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
"\u7F13\u5B58\u5230\u672C\u5730"
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: "0 1 180px", minWidth: 120 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
151
|
+
reactComponents.ReactSelect,
|
|
152
|
+
{
|
|
153
|
+
"aria-label": "\u9AD8\u4EAE\u914D\u7F6E\u7F13\u5B58\u8303\u56F4",
|
|
154
|
+
value: draft.cacheScope ?? (capability.currentTableAvailable ? "table" : "all"),
|
|
155
|
+
disabled: !draft.cacheToLocal,
|
|
156
|
+
options: [
|
|
157
|
+
{
|
|
158
|
+
value: "table",
|
|
159
|
+
label: "\u5F53\u524D\u8868\u683C",
|
|
160
|
+
disabled: !capability.currentTableAvailable
|
|
161
|
+
},
|
|
162
|
+
{ value: "all", label: "\u6240\u6709\u8868\u683C" }
|
|
163
|
+
],
|
|
164
|
+
onChange: (value) => patch({ cacheScope: value })
|
|
165
|
+
}
|
|
166
|
+
) })
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "#64748b" }, children: "\u4F18\u5148\u4F7F\u7528\u5F53\u524D\u8868\u683C\u81EA\u5DF1\u7684\u914D\u7F6E\uFF0C\u5176\u6B21\u4F7F\u7528\u6240\u6709\u8868\u683C\u7684\u5171\u4EAB\u914D\u7F6E\u3002\u5F53\u524D\u8868\u683C\u7F13\u5B58\u9700\u8981 storageKey\u3002" })
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
173
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "\u9AD8\u4EAE\u6A21\u5F0F" }),
|
|
174
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 18, flexWrap: "wrap" }, children: modes.map((mode) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
175
|
+
"label",
|
|
176
|
+
{
|
|
177
|
+
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
180
|
+
"input",
|
|
181
|
+
{
|
|
182
|
+
type: "radio",
|
|
183
|
+
name: "list-table-highlight-mode",
|
|
184
|
+
value: mode.value,
|
|
185
|
+
checked: (draft.mode ?? "row") === mode.value,
|
|
186
|
+
onChange: () => patch({ mode: mode.value })
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
mode.label
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
mode.value
|
|
193
|
+
)) })
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
style: {
|
|
199
|
+
display: "grid",
|
|
200
|
+
gridTemplateColumns: "repeat(auto-fit,minmax(min(100%,180px),1fr))",
|
|
201
|
+
gap: 16
|
|
202
|
+
},
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
205
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u9AD8\u4EAE\u80CC\u666F\u8272" }),
|
|
206
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
207
|
+
reactComponents.ReactColorPicker,
|
|
208
|
+
{
|
|
209
|
+
"aria-label": "\u9AD8\u4EAE\u80CC\u666F\u8272",
|
|
210
|
+
value: draft.backgroundColor ?? "#dbeafe",
|
|
211
|
+
onChange: (backgroundColor) => patch({ backgroundColor })
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u6587\u5B57\u9AD8\u4EAE\u989C\u8272" }),
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
218
|
+
reactComponents.ReactColorPicker,
|
|
219
|
+
{
|
|
220
|
+
"aria-label": "\u6587\u5B57\u9AD8\u4EAE\u989C\u8272",
|
|
221
|
+
value: draft.textColor ?? "#1f2329",
|
|
222
|
+
onChange: (textColor) => patch({ textColor })
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] })
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
230
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "\u6548\u679C\u9884\u89C8" }),
|
|
231
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
232
|
+
"table",
|
|
233
|
+
{
|
|
234
|
+
"aria-label": "\u9AD8\u4EAE\u6548\u679C\u9884\u89C8",
|
|
235
|
+
style: {
|
|
236
|
+
width: "100%",
|
|
237
|
+
borderCollapse: "collapse",
|
|
238
|
+
fontSize: 13,
|
|
239
|
+
textAlign: "left"
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: ["\u59D3\u540D", "\u90E8\u95E8", "\u72B6\u6001"].map((title) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
243
|
+
"th",
|
|
244
|
+
{
|
|
245
|
+
style: { padding: 9, borderBottom: "1px solid #e5e7eb" },
|
|
246
|
+
children: title
|
|
247
|
+
},
|
|
248
|
+
title
|
|
249
|
+
)) }) }),
|
|
250
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: previewRows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: row.map((value, columnIndex) => {
|
|
251
|
+
const active = draft.mode === "cell" ? rowIndex === 1 && columnIndex === 1 : draft.mode === "column" ? columnIndex === 1 : draft.mode === "cross" ? rowIndex === 1 || columnIndex === 1 : rowIndex === 1;
|
|
252
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
253
|
+
"td",
|
|
254
|
+
{
|
|
255
|
+
style: {
|
|
256
|
+
padding: 9,
|
|
257
|
+
backgroundColor: active ? draft.backgroundColor ?? "#dbeafe" : void 0,
|
|
258
|
+
color: active ? draft.textColor ?? "#1f2329" : void 0,
|
|
259
|
+
borderBottom: "1px solid #e5e7eb"
|
|
260
|
+
},
|
|
261
|
+
children: value
|
|
262
|
+
},
|
|
263
|
+
columnIndex
|
|
264
|
+
);
|
|
265
|
+
}) }, rowIndex)) })
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
) }),
|
|
269
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12, color: "#64748b" }, children: "\u4EE5\u201C\u674E\u56DB / \u6280\u672F\u201D\u6240\u5728\u5355\u5143\u683C\u4E3A\u5F53\u524D\u9009\u4E2D\u4F4D\u7F6E\u3002\u786E\u8BA4\u524D\u4EC5\u6539\u53D8\u9884\u89C8\u3002" })
|
|
270
|
+
] }),
|
|
271
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", style: { color: "#cf1322" }, children: error })
|
|
272
|
+
] })
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
function DuplicateHighlightDialog({
|
|
277
|
+
capability,
|
|
278
|
+
initialColumnKey,
|
|
279
|
+
onClose
|
|
280
|
+
}) {
|
|
281
|
+
const [draft, setDraft] = react.useState(
|
|
282
|
+
() => capability.config ? { ...capability.config, columnKeys: [...capability.config.columnKeys] } : {
|
|
283
|
+
enabled: true,
|
|
284
|
+
columnKeys: initialColumnKey ? [initialColumnKey] : [],
|
|
285
|
+
scope: "cell",
|
|
286
|
+
trimText: true,
|
|
287
|
+
ignoreCase: false,
|
|
288
|
+
ignoreEmpty: true
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
const [search, setSearch] = react.useState("");
|
|
292
|
+
const [preview, setPreview] = react.useState(null);
|
|
293
|
+
const [dirty, setDirty] = react.useState(true), [loading, setLoading] = react.useState(false), [error, setError] = react.useState("");
|
|
294
|
+
const task = react.useRef(null), generation = react.useRef(0);
|
|
295
|
+
const closeRef = react.useRef(onClose);
|
|
296
|
+
closeRef.current = onClose;
|
|
297
|
+
const invalidVersion = () => capability.getVersion() !== capability.version;
|
|
298
|
+
react.useEffect(() => {
|
|
299
|
+
const timer = window.setInterval(() => {
|
|
300
|
+
if (invalidVersion()) {
|
|
301
|
+
task.current?.abort();
|
|
302
|
+
reactComponents.reactMessage.info("\u91CD\u590D\u9879\u914D\u7F6E\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u914D\u7F6E\u3002");
|
|
303
|
+
closeRef.current();
|
|
304
|
+
} else if (preview && preview.dataVersion !== capability.getDataVersion())
|
|
305
|
+
setDirty(true);
|
|
306
|
+
}, 250);
|
|
307
|
+
return () => {
|
|
308
|
+
window.clearInterval(timer);
|
|
309
|
+
task.current?.abort();
|
|
310
|
+
generation.current++;
|
|
311
|
+
};
|
|
312
|
+
}, [capability, preview]);
|
|
313
|
+
const patch = (value) => {
|
|
314
|
+
task.current?.abort();
|
|
315
|
+
generation.current++;
|
|
316
|
+
setLoading(false);
|
|
317
|
+
setDraft((current) => ({ ...current, ...value }));
|
|
318
|
+
setDirty(true);
|
|
319
|
+
setError("");
|
|
320
|
+
};
|
|
321
|
+
const updatePreview = async () => {
|
|
322
|
+
if (!draft.columnKeys.length) {
|
|
323
|
+
setError("\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6BD4\u8F83\u5B57\u6BB5\u3002");
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const id = ++generation.current;
|
|
327
|
+
task.current?.abort();
|
|
328
|
+
const abort = new AbortController();
|
|
329
|
+
task.current = abort;
|
|
330
|
+
setLoading(true);
|
|
331
|
+
setError("");
|
|
332
|
+
try {
|
|
333
|
+
const next = await capability.preview(draft, abort.signal);
|
|
334
|
+
if (abort.signal.aborted || id !== generation.current) return;
|
|
335
|
+
if (invalidVersion())
|
|
336
|
+
throw new Error("\u91CD\u590D\u9879\u914D\u7F6E\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u914D\u7F6E\u3002");
|
|
337
|
+
setPreview(next);
|
|
338
|
+
setDirty(next.dataVersion !== capability.getDataVersion());
|
|
339
|
+
} catch (cause) {
|
|
340
|
+
if (!abort.signal.aborted && id === generation.current)
|
|
341
|
+
setError(cause instanceof Error ? cause.message : "\u9884\u89C8\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
|
|
342
|
+
} finally {
|
|
343
|
+
if (id === generation.current) setLoading(false);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
const apply = () => {
|
|
347
|
+
if (invalidVersion()) {
|
|
348
|
+
setError("\u91CD\u590D\u9879\u914D\u7F6E\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u914D\u7F6E\u3002");
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
const result = capability.apply(draft);
|
|
352
|
+
if (!result.ok) {
|
|
353
|
+
setError(result.error);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
if (result.warning) reactComponents.reactMessage.warning(result.warning);
|
|
357
|
+
onClose();
|
|
358
|
+
};
|
|
359
|
+
const clear = () => {
|
|
360
|
+
const result = capability.clear();
|
|
361
|
+
if (!result.ok) {
|
|
362
|
+
setError(result.error);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
onClose();
|
|
366
|
+
};
|
|
367
|
+
const options = [
|
|
368
|
+
{ key: "trimText", label: "\u5FFD\u7565\u9996\u5C3E\u7A7A\u767D" },
|
|
369
|
+
{ key: "ignoreCase", label: "\u5FFD\u7565\u5927\u5C0F\u5199" },
|
|
370
|
+
{ key: "ignoreEmpty", label: "\u5FFD\u7565\u5305\u542B\u7A7A\u503C\u7684\u8BB0\u5F55" }
|
|
371
|
+
];
|
|
372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
373
|
+
reactComponents.ReactModal,
|
|
374
|
+
{
|
|
375
|
+
open: true,
|
|
376
|
+
title: "\u91CD\u590D\u9879\u9AD8\u4EAE",
|
|
377
|
+
width: 640,
|
|
378
|
+
onCancel: onClose,
|
|
379
|
+
onOk: apply,
|
|
380
|
+
okText: "\u786E\u5B9A",
|
|
381
|
+
cancelText: "\u53D6\u6D88",
|
|
382
|
+
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
383
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
384
|
+
reactComponents.ReactButton,
|
|
385
|
+
{
|
|
386
|
+
type: "text",
|
|
387
|
+
disabled: !capability.config,
|
|
388
|
+
onClick: clear,
|
|
389
|
+
children: "\u6E05\u9664\u91CD\u590D\u9879\u9AD8\u4EAE"
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.ReactButton, { onClick: onClose, children: "\u53D6\u6D88" }),
|
|
393
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
394
|
+
reactComponents.ReactButton,
|
|
395
|
+
{
|
|
396
|
+
type: "primary",
|
|
397
|
+
disabled: !draft.columnKeys.length,
|
|
398
|
+
onClick: apply,
|
|
399
|
+
children: "\u786E\u5B9A"
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
] }),
|
|
403
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 18, fontSize: 14, minWidth: 0 }, children: [
|
|
404
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#64748b", fontSize: 12 }, children: "\u914D\u7F6E\u4F5C\u7528\u4E8E\u6574\u5F20\u8868\u683C" }),
|
|
405
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
406
|
+
"div",
|
|
407
|
+
{
|
|
408
|
+
style: {
|
|
409
|
+
display: "flex",
|
|
410
|
+
gap: 18,
|
|
411
|
+
flexWrap: "wrap",
|
|
412
|
+
alignItems: "center"
|
|
413
|
+
},
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
416
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
417
|
+
"input",
|
|
418
|
+
{
|
|
419
|
+
type: "checkbox",
|
|
420
|
+
checked: draft.enabled !== false,
|
|
421
|
+
onChange: (e) => patch({ enabled: e.target.checked })
|
|
422
|
+
}
|
|
423
|
+
),
|
|
424
|
+
"\u542F\u7528\u91CD\u590D\u9879\u9AD8\u4EAE"
|
|
425
|
+
] }),
|
|
426
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
427
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
428
|
+
"input",
|
|
429
|
+
{
|
|
430
|
+
type: "checkbox",
|
|
431
|
+
"aria-label": "\u7F13\u5B58\u914D\u7F6E\u5230\u672C\u5730",
|
|
432
|
+
disabled: !capability.cacheAvailable,
|
|
433
|
+
checked: draft.cacheToLocal === true,
|
|
434
|
+
onChange: (e) => patch({ cacheToLocal: e.target.checked })
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
"\u7F13\u5B58\u914D\u7F6E\u5230\u672C\u5730"
|
|
438
|
+
] }),
|
|
439
|
+
!capability.cacheAvailable && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12, color: "#64748b" }, children: "\u914D\u7F6E storageKey \u540E\u53EF\u7F13\u5B58" })
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
444
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
|
|
445
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "\u6BD4\u8F83\u5B57\u6BB5" }),
|
|
446
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 12, color: "#64748b" }, children: [
|
|
447
|
+
"\u5DF2\u9009 ",
|
|
448
|
+
draft.columnKeys.length,
|
|
449
|
+
" \u9879"
|
|
450
|
+
] })
|
|
451
|
+
] }),
|
|
452
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
453
|
+
reactComponents.ReactInput,
|
|
454
|
+
{
|
|
455
|
+
"aria-label": "\u641C\u7D22\u6BD4\u8F83\u5B57\u6BB5",
|
|
456
|
+
placeholder: "\u641C\u7D22\u5B57\u6BB5\u540D\u79F0",
|
|
457
|
+
value: search,
|
|
458
|
+
onChange: (e) => setSearch(e.target.value)
|
|
459
|
+
}
|
|
460
|
+
),
|
|
461
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
style: {
|
|
465
|
+
display: "grid",
|
|
466
|
+
gridTemplateColumns: "repeat(auto-fit,minmax(min(100%, 180px),1fr))",
|
|
467
|
+
gap: 6,
|
|
468
|
+
maxHeight: 180,
|
|
469
|
+
overflowY: "auto",
|
|
470
|
+
border: "1px solid #e5e7eb",
|
|
471
|
+
borderRadius: 6,
|
|
472
|
+
padding: 8
|
|
473
|
+
},
|
|
474
|
+
children: [
|
|
475
|
+
draft.columnKeys.filter(
|
|
476
|
+
(key) => !capability.fields.some((field) => field.key === key)
|
|
477
|
+
).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
478
|
+
"label",
|
|
479
|
+
{
|
|
480
|
+
style: {
|
|
481
|
+
display: "flex",
|
|
482
|
+
gap: 8,
|
|
483
|
+
padding: 6,
|
|
484
|
+
color: "#cf1322"
|
|
485
|
+
},
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
488
|
+
"input",
|
|
489
|
+
{
|
|
490
|
+
type: "checkbox",
|
|
491
|
+
"data-field-key": key,
|
|
492
|
+
checked: true,
|
|
493
|
+
onChange: () => patch({
|
|
494
|
+
columnKeys: draft.columnKeys.filter(
|
|
495
|
+
(value) => value !== key
|
|
496
|
+
)
|
|
497
|
+
})
|
|
498
|
+
}
|
|
499
|
+
),
|
|
500
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
501
|
+
"\u5B57\u6BB5\u5DF2\u5931\u6548\uFF1A",
|
|
502
|
+
key
|
|
503
|
+
] })
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
key
|
|
507
|
+
)),
|
|
508
|
+
capability.fields.filter(
|
|
509
|
+
(field) => `${field.title} ${String(field.dataIndex)}`.toLowerCase().includes(search.trim().toLowerCase())
|
|
510
|
+
).map((field) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
511
|
+
"label",
|
|
512
|
+
{
|
|
513
|
+
style: {
|
|
514
|
+
display: "flex",
|
|
515
|
+
alignItems: "center",
|
|
516
|
+
gap: 8,
|
|
517
|
+
padding: 6,
|
|
518
|
+
background: draft.columnKeys.includes(field.key) ? "#edf5ff" : void 0,
|
|
519
|
+
borderRadius: 4
|
|
520
|
+
},
|
|
521
|
+
children: [
|
|
522
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
523
|
+
"input",
|
|
524
|
+
{
|
|
525
|
+
type: "checkbox",
|
|
526
|
+
"data-field-key": field.key,
|
|
527
|
+
checked: draft.columnKeys.includes(field.key),
|
|
528
|
+
onChange: (e) => patch({
|
|
529
|
+
columnKeys: e.target.checked ? [...draft.columnKeys, field.key] : draft.columnKeys.filter((key) => key !== field.key)
|
|
530
|
+
})
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { overflowWrap: "anywhere" }, children: [
|
|
534
|
+
field.title,
|
|
535
|
+
field.hidden ? "\uFF08\u5DF2\u9690\u85CF\uFF09" : "",
|
|
536
|
+
/* @__PURE__ */ jsxRuntime.jsx("small", { style: { display: "block", color: "#64748b" }, children: Array.isArray(field.dataIndex) ? field.dataIndex.join(".") : String(field.dataIndex) })
|
|
537
|
+
] })
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
field.key
|
|
541
|
+
))
|
|
542
|
+
]
|
|
543
|
+
}
|
|
544
|
+
),
|
|
545
|
+
draft.columnKeys.some(
|
|
546
|
+
(key) => !capability.fields.some((field) => field.key === key)
|
|
547
|
+
) && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", style: { fontSize: 12, color: "#cf1322" }, children: "\u89C4\u5219\u5DF2\u6682\u505C\u3002\u8BF7\u79FB\u9664\u5931\u6548\u5B57\u6BB5\u5E76\u9009\u62E9\u66FF\u4EE3\u5B57\u6BB5\u540E\u4FDD\u5B58\u3002" }),
|
|
548
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12, color: "#64748b" }, children: "\u6240\u9009\u5B57\u6BB5\u7684\u7EC4\u5408\u503C\u5168\u90E8\u76F8\u540C\uFF0C\u5373\u5224\u5B9A\u4E3A\u540C\u4E00\u7EC4\u91CD\u590D\u9879\u3002" })
|
|
549
|
+
] }),
|
|
550
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
551
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "\u9AD8\u4EAE\u65B9\u5F0F" }),
|
|
552
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 20, flexWrap: "wrap" }, children: [
|
|
553
|
+
["cell", "row"].map((scope) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
554
|
+
"label",
|
|
555
|
+
{
|
|
556
|
+
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
559
|
+
"input",
|
|
560
|
+
{
|
|
561
|
+
type: "radio",
|
|
562
|
+
name: "duplicate-highlight-scope",
|
|
563
|
+
checked: (draft.scope ?? "cell") === scope,
|
|
564
|
+
onChange: () => patch({ scope })
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
scope === "cell" ? "\u5355\u5143\u683C" : "\u6574\u884C"
|
|
568
|
+
]
|
|
569
|
+
},
|
|
570
|
+
scope
|
|
571
|
+
)),
|
|
572
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#64748b", fontSize: 12 }, children: draft.scope === "row" ? "\u9AD8\u4EAE\u6574\u884C\u4E1A\u52A1\u5355\u5143\u683C" : "\u4EC5\u9AD8\u4EAE\u53C2\u4E0E\u6BD4\u8F83\u7684\u5B57\u6BB5" })
|
|
573
|
+
] })
|
|
574
|
+
] }),
|
|
575
|
+
/* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
576
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
577
|
+
"summary",
|
|
578
|
+
{
|
|
579
|
+
style: { cursor: "pointer", color: "#64748b", fontSize: 12 },
|
|
580
|
+
children: "\u6BD4\u8F83\u9009\u9879"
|
|
581
|
+
}
|
|
582
|
+
),
|
|
583
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
584
|
+
"div",
|
|
585
|
+
{
|
|
586
|
+
style: {
|
|
587
|
+
display: "flex",
|
|
588
|
+
gap: 12,
|
|
589
|
+
flexWrap: "wrap",
|
|
590
|
+
paddingTop: 10
|
|
591
|
+
},
|
|
592
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
593
|
+
"label",
|
|
594
|
+
{
|
|
595
|
+
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
598
|
+
"input",
|
|
599
|
+
{
|
|
600
|
+
type: "checkbox",
|
|
601
|
+
checked: draft[option.key] === true,
|
|
602
|
+
onChange: (e) => patch({ [option.key]: e.target.checked })
|
|
603
|
+
}
|
|
604
|
+
),
|
|
605
|
+
option.label
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
option.key
|
|
609
|
+
))
|
|
610
|
+
}
|
|
611
|
+
)
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
614
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
615
|
+
"div",
|
|
616
|
+
{
|
|
617
|
+
style: {
|
|
618
|
+
display: "flex",
|
|
619
|
+
justifyContent: "space-between",
|
|
620
|
+
gap: 10,
|
|
621
|
+
alignItems: "center"
|
|
622
|
+
},
|
|
623
|
+
children: [
|
|
624
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
625
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "\u6548\u679C\u9884\u89C8" }),
|
|
626
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
"aria-live": "polite",
|
|
630
|
+
style: { fontSize: 12, color: "#64748b" },
|
|
631
|
+
children: dirty ? preview ? "\u914D\u7F6E\u6216\u6570\u636E\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u66F4\u65B0\u9884\u89C8" : "\u9009\u62E9\u5B57\u6BB5\u540E\u66F4\u65B0\u9884\u89C8" : preview ? `${preview.groupCount} \u7EC4\u91CD\u590D\u9879 \xB7 ${preview.duplicateRecordCount} \u6761\u8BB0\u5F55` : ""
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
] }),
|
|
635
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
636
|
+
reactComponents.ReactButton,
|
|
637
|
+
{
|
|
638
|
+
disabled: loading || !draft.columnKeys.length,
|
|
639
|
+
onClick: () => void updatePreview(),
|
|
640
|
+
children: loading ? "\u6B63\u5728\u7EDF\u8BA1\u2026" : "\u66F4\u65B0\u9884\u89C8"
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
),
|
|
646
|
+
preview && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { overflowX: "auto", opacity: dirty ? 0.55 : 1 }, children: [
|
|
647
|
+
preview.records && preview.sampleFields ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
648
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
649
|
+
"table",
|
|
650
|
+
{
|
|
651
|
+
"aria-label": "\u91CD\u590D\u9879\u6837\u4F8B\u9884\u89C8",
|
|
652
|
+
style: {
|
|
653
|
+
width: "100%",
|
|
654
|
+
borderCollapse: "collapse",
|
|
655
|
+
fontSize: 12
|
|
656
|
+
},
|
|
657
|
+
children: [
|
|
658
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: preview.sampleFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
659
|
+
"th",
|
|
660
|
+
{
|
|
661
|
+
style: {
|
|
662
|
+
padding: 8,
|
|
663
|
+
textAlign: "left",
|
|
664
|
+
whiteSpace: "nowrap"
|
|
665
|
+
},
|
|
666
|
+
children: field.title
|
|
667
|
+
},
|
|
668
|
+
field.key
|
|
669
|
+
)) }) }),
|
|
670
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: preview.records.map((record, index) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: preview.sampleFields.map((field) => {
|
|
671
|
+
const background = preview.scope === "row" || preview.columnKeys?.includes(field.key) ? record.color : void 0;
|
|
672
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
673
|
+
"td",
|
|
674
|
+
{
|
|
675
|
+
style: {
|
|
676
|
+
padding: 8,
|
|
677
|
+
background,
|
|
678
|
+
color: background ? "#1f2937" : void 0,
|
|
679
|
+
whiteSpace: "nowrap"
|
|
680
|
+
},
|
|
681
|
+
children: record.values[field.key]
|
|
682
|
+
},
|
|
683
|
+
field.key
|
|
684
|
+
);
|
|
685
|
+
}) }, index)) })
|
|
686
|
+
]
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
690
|
+
"div",
|
|
691
|
+
{
|
|
692
|
+
style: { fontSize: 12, color: "#64748b", paddingTop: 8 },
|
|
693
|
+
children: [
|
|
694
|
+
"\u5C55\u793A\u524D ",
|
|
695
|
+
preview.records.length,
|
|
696
|
+
" \u6761\u6837\u4F8B\uFF0C\u7EDF\u8BA1\u8303\u56F4\u4E0D\u9650\u4E8E\u9884\u89C8\u3002"
|
|
697
|
+
]
|
|
698
|
+
}
|
|
699
|
+
)
|
|
700
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
701
|
+
"table",
|
|
702
|
+
{
|
|
703
|
+
style: {
|
|
704
|
+
width: "100%",
|
|
705
|
+
borderCollapse: "collapse",
|
|
706
|
+
fontSize: 12
|
|
707
|
+
},
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
710
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: { padding: 8, textAlign: "left" }, children: "\u5206\u7EC4" }),
|
|
711
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: { padding: 8, textAlign: "left" }, children: "\u7EC4\u5408\u503C" }),
|
|
712
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: { padding: 8, textAlign: "right" }, children: "\u8BB0\u5F55\u6570" })
|
|
713
|
+
] }) }),
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: preview.groups.map((group, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
715
|
+
"tr",
|
|
716
|
+
{
|
|
717
|
+
style: { background: group.color, color: "#1f2937" },
|
|
718
|
+
children: [
|
|
719
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { style: { padding: 8 }, children: [
|
|
720
|
+
"\u7B2C ",
|
|
721
|
+
index + 1,
|
|
722
|
+
" \u7EC4"
|
|
723
|
+
] }),
|
|
724
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: 8 }, children: group.values.join(" / ") }),
|
|
725
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: 8, textAlign: "right" }, children: group.count })
|
|
726
|
+
]
|
|
727
|
+
},
|
|
728
|
+
group.key
|
|
729
|
+
)) })
|
|
730
|
+
]
|
|
731
|
+
}
|
|
732
|
+
),
|
|
733
|
+
preview.excludedRecordCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 12, color: "#64748b", paddingTop: 8 }, children: [
|
|
734
|
+
"\u5DF2\u6392\u9664 ",
|
|
735
|
+
preview.excludedRecordCount,
|
|
736
|
+
" ",
|
|
737
|
+
"\u6761\u542B\u7A7A\u503C\u6216\u4E0D\u652F\u6301\u7C7B\u578B\u7684\u8BB0\u5F55\u3002"
|
|
738
|
+
] }),
|
|
739
|
+
preview.groupCount > preview.groups.length && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 12 }, children: [
|
|
740
|
+
"\u4EC5\u5C55\u793A\u524D ",
|
|
741
|
+
preview.groups.length,
|
|
742
|
+
" \u7EC4\uFF0C\u5B9E\u9645\u9AD8\u4EAE\u8986\u76D6\u6240\u6709\u91CD\u590D\u7EC4\u3002"
|
|
743
|
+
] })
|
|
744
|
+
] }),
|
|
745
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "#64748b" }, children: "\u4E0D\u540C\u7EC4\u81EA\u52A8\u4F7F\u7528\u4E0D\u540C\u989C\u8272\uFF0C\u540C\u7EC4\u989C\u8272\u4E00\u81F4\uFF1B\u66F4\u9AD8\u4F18\u5148\u7EA7\u6837\u5F0F\u53EF\u80FD\u8986\u76D6\u7EC4\u8272\u3002" }),
|
|
746
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "#64748b" }, children: "\u6309\u5F53\u524D\u7B5B\u9009\u7ED3\u679C\u7EDF\u8BA1\uFF0C\u5305\u542B\u672C\u5730\u6240\u6709\u5206\u9875\uFF1B\u8FDC\u7A0B\u6570\u636E\u53EA\u7EDF\u8BA1\u5F53\u524D\u5DF2\u52A0\u8F7D\u8BB0\u5F55\u3002\u4EC5\u7EDF\u8BA1\u4E3B\u8868\u8BB0\u5F55\u3002" })
|
|
747
|
+
] }),
|
|
748
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", style: { color: "#cf1322" }, children: error })
|
|
749
|
+
] })
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
}
|
|
65
753
|
var conditionalOperators = {
|
|
66
754
|
eq: "\u7B49\u4E8E",
|
|
67
755
|
neq: "\u4E0D\u7B49\u4E8E",
|
|
@@ -863,6 +1551,29 @@ function ReactTableContextMenuView(props) {
|
|
|
863
1551
|
const setMenuOpen = (open) => {
|
|
864
1552
|
setClosedRequest(open ? null : request);
|
|
865
1553
|
};
|
|
1554
|
+
const [highlightRequest, setHighlightRequest] = react.useState(null);
|
|
1555
|
+
const highlightDialog = highlightRequest?.highlightConfig ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1556
|
+
HighlightConfigDialog,
|
|
1557
|
+
{
|
|
1558
|
+
capability: highlightRequest.highlightConfig,
|
|
1559
|
+
onClose: () => {
|
|
1560
|
+
setHighlightRequest(null);
|
|
1561
|
+
highlightRequest.onClose();
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
) : null;
|
|
1565
|
+
const [duplicateRequest, setDuplicateRequest] = react.useState(null);
|
|
1566
|
+
const duplicateDialog = duplicateRequest?.duplicateHighlight ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1567
|
+
DuplicateHighlightDialog,
|
|
1568
|
+
{
|
|
1569
|
+
capability: duplicateRequest.duplicateHighlight,
|
|
1570
|
+
initialColumnKey: duplicateRequest.duplicateHighlightColumnKey,
|
|
1571
|
+
onClose: () => {
|
|
1572
|
+
setDuplicateRequest(null);
|
|
1573
|
+
duplicateRequest.onClose();
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
) : null;
|
|
866
1577
|
const [conditionalEditor, setConditionalEditor] = react.useState(null);
|
|
867
1578
|
const conditionalDialog = conditionalEditor ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
868
1579
|
ConditionalFormatDialog,
|
|
@@ -921,6 +1632,8 @@ function ReactTableContextMenuView(props) {
|
|
|
921
1632
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
922
1633
|
scrollbarDialog,
|
|
923
1634
|
scrollbarPositionDialog,
|
|
1635
|
+
highlightDialog,
|
|
1636
|
+
duplicateDialog,
|
|
924
1637
|
conditionalDialog,
|
|
925
1638
|
columnDialogs,
|
|
926
1639
|
moreFormatRequest ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -939,25 +1652,213 @@ function ReactTableContextMenuView(props) {
|
|
|
939
1652
|
customSelectionRequest.onClose();
|
|
940
1653
|
}
|
|
941
1654
|
}
|
|
942
|
-
) : null,
|
|
943
|
-
chartRequest ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
944
|
-
ChartDialog,
|
|
945
|
-
{
|
|
946
|
-
data: chartRequest.data,
|
|
947
|
-
getData: chartRequest.request.onCreateChart,
|
|
948
|
-
onClose: () => {
|
|
949
|
-
chartRequest.request.onClose();
|
|
950
|
-
setMenuOpen(false);
|
|
951
|
-
setChartRequest(null);
|
|
1655
|
+
) : null,
|
|
1656
|
+
chartRequest ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1657
|
+
ChartDialog,
|
|
1658
|
+
{
|
|
1659
|
+
data: chartRequest.data,
|
|
1660
|
+
getData: chartRequest.request.onCreateChart,
|
|
1661
|
+
onClose: () => {
|
|
1662
|
+
chartRequest.request.onClose();
|
|
1663
|
+
setMenuOpen(false);
|
|
1664
|
+
setChartRequest(null);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
) : null
|
|
1668
|
+
] });
|
|
1669
|
+
}
|
|
1670
|
+
const openScrollbarSettings = () => {
|
|
1671
|
+
setScrollbarSettingsRequest(request);
|
|
1672
|
+
request.onClose();
|
|
1673
|
+
};
|
|
1674
|
+
const hasConfigurationActions = Boolean(
|
|
1675
|
+
request.onChangeAlignment || request.onChangeDataFormat || request.onAutoFitCurrentColumn || request.onAutoFitAllColumns || request.onAutoFitFillContainer || request.onFixLeft || request.onFixRight || request.onUnfix || request.onToggleColumn || request.onToggleCurrentColumn || request.onToggleGroupingBar || request.onToggleSummary || request.onChangeSummaryType || request.highlightConfig || request.onChangeDensity || request.onChangeZoom || request.onChangeScrollbar || request.onToggleStickToBottom || request.onOpenPaginationConfig || request.onToggleDebug || request.columnSettingsCacheAvailable
|
|
1676
|
+
);
|
|
1677
|
+
const scrollbarSettings = Boolean(
|
|
1678
|
+
request.onChangeScrollbar || request.onToggleStickToBottom || request.columnSettingsCacheAvailable
|
|
1679
|
+
);
|
|
1680
|
+
const configurationActions = request.scrollbarArea ? scrollbarSettings ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1681
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1682
|
+
ScrollbarModeMenu,
|
|
1683
|
+
{
|
|
1684
|
+
request,
|
|
1685
|
+
onOpenSettings: openScrollbarSettings
|
|
1686
|
+
}
|
|
1687
|
+
),
|
|
1688
|
+
/* @__PURE__ */ jsxRuntime.jsx(StickToBottomMenu, { request }),
|
|
1689
|
+
request.columnSettingsCacheAvailable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1690
|
+
MenuSubmenu,
|
|
1691
|
+
{
|
|
1692
|
+
label: "\u7F13\u5B58\u5230\u672C\u5730",
|
|
1693
|
+
items: buildCacheMenuItems(request)
|
|
1694
|
+
}
|
|
1695
|
+
)
|
|
1696
|
+
] }) : null : hasConfigurationActions ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1697
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1698
|
+
MenuAction,
|
|
1699
|
+
{
|
|
1700
|
+
label: request.toggleColumnLabel ?? "",
|
|
1701
|
+
onClick: request.onToggleCurrentColumn
|
|
1702
|
+
}
|
|
1703
|
+
),
|
|
1704
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1705
|
+
MenuSubmenu,
|
|
1706
|
+
{
|
|
1707
|
+
label: "\u81EA\u52A8\u8C03\u6574\u5217\u5BBD",
|
|
1708
|
+
items: [
|
|
1709
|
+
{
|
|
1710
|
+
key: "auto-fit-current",
|
|
1711
|
+
label: "\u5F53\u524D\u5217",
|
|
1712
|
+
onClick: request.onAutoFitCurrentColumn
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
key: "auto-fit-all",
|
|
1716
|
+
label: "\u5168\u90E8\u5217",
|
|
1717
|
+
onClick: request.onAutoFitAllColumns
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
key: "auto-fit-fill-container",
|
|
1721
|
+
label: "\u81EA\u52A8\u94FA\u6EE1\u5BB9\u5668",
|
|
1722
|
+
onClick: request.onAutoFitFillContainer
|
|
1723
|
+
}
|
|
1724
|
+
]
|
|
1725
|
+
}
|
|
1726
|
+
),
|
|
1727
|
+
/* @__PURE__ */ jsxRuntime.jsx(StickToBottomMenu, { request }),
|
|
1728
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1729
|
+
MenuAction,
|
|
1730
|
+
{
|
|
1731
|
+
label: request.groupingBarVisible ? "\u9690\u85CF\u5206\u7EC4\u680F" : "\u663E\u793A\u5206\u7EC4\u680F",
|
|
1732
|
+
onClick: request.onToggleGroupingBar
|
|
1733
|
+
}
|
|
1734
|
+
),
|
|
1735
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1736
|
+
MenuAction,
|
|
1737
|
+
{
|
|
1738
|
+
label: request.summaryVisible ? "\u9690\u85CF\u6C47\u603B\u680F" : "\u663E\u793A\u6C47\u603B\u680F",
|
|
1739
|
+
onClick: request.onToggleSummary
|
|
1740
|
+
}
|
|
1741
|
+
),
|
|
1742
|
+
/* @__PURE__ */ jsxRuntime.jsx(SummaryMenu, { request }),
|
|
1743
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlignmentMenu, { request }),
|
|
1744
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1745
|
+
DataFormatMenu,
|
|
1746
|
+
{
|
|
1747
|
+
request,
|
|
1748
|
+
onOpenMoreFormat: () => {
|
|
1749
|
+
setMoreFormatRequest(request);
|
|
1750
|
+
setMenuOpen(false);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
),
|
|
1754
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1755
|
+
MenuSubmenu,
|
|
1756
|
+
{
|
|
1757
|
+
label: "\u56FA\u5B9A",
|
|
1758
|
+
items: [
|
|
1759
|
+
{
|
|
1760
|
+
key: "fix-left",
|
|
1761
|
+
label: "\u5DE6\u4FA7",
|
|
1762
|
+
onClick: request.onFixLeft
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
key: "fix-right",
|
|
1766
|
+
label: "\u53F3\u4FA7",
|
|
1767
|
+
onClick: request.onFixRight
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
key: "unfix",
|
|
1771
|
+
label: "\u53D6\u6D88\u56FA\u5B9A",
|
|
1772
|
+
onClick: request.onUnfix
|
|
1773
|
+
}
|
|
1774
|
+
]
|
|
1775
|
+
}
|
|
1776
|
+
),
|
|
1777
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1778
|
+
ScrollbarModeMenu,
|
|
1779
|
+
{
|
|
1780
|
+
request,
|
|
1781
|
+
onOpenSettings: openScrollbarSettings
|
|
1782
|
+
}
|
|
1783
|
+
),
|
|
1784
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1785
|
+
MenuAction,
|
|
1786
|
+
{
|
|
1787
|
+
label: "\u9AD8\u4EAE\u914D\u7F6E",
|
|
1788
|
+
onClick: request.highlightConfig ? () => {
|
|
1789
|
+
setHighlightRequest(request);
|
|
1790
|
+
setMenuOpen(false);
|
|
1791
|
+
request.onClose();
|
|
1792
|
+
} : void 0
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1796
|
+
DensityMenu,
|
|
1797
|
+
{
|
|
1798
|
+
value: request.density ?? "middle",
|
|
1799
|
+
onChange: request.onChangeDensity
|
|
1800
|
+
}
|
|
1801
|
+
),
|
|
1802
|
+
request.onOpenPaginationConfig ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1803
|
+
MenuAction,
|
|
1804
|
+
{
|
|
1805
|
+
label: "\u5206\u9875\u914D\u7F6E",
|
|
1806
|
+
onClick: () => {
|
|
1807
|
+
request.onClose();
|
|
1808
|
+
request.onOpenPaginationConfig?.();
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
) : null,
|
|
1812
|
+
/* @__PURE__ */ jsxRuntime.jsx(ZoomMenu, { value: request.zoom ?? 1, onChange: request.onChangeZoom }),
|
|
1813
|
+
request.onToggleDebug ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1814
|
+
MenuAction,
|
|
1815
|
+
{
|
|
1816
|
+
label: request.debugEnabled ? "\u5173\u95ED\u8C03\u8BD5" : "\u5F00\u542F\u8C03\u8BD5",
|
|
1817
|
+
onClick: () => {
|
|
1818
|
+
request.onClose();
|
|
1819
|
+
request.onToggleDebug?.();
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
) : null,
|
|
1823
|
+
request.columnSettingsCacheAvailable === true ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1824
|
+
MenuSubmenu,
|
|
1825
|
+
{
|
|
1826
|
+
label: "\u7F13\u5B58\u5230\u672C\u5730",
|
|
1827
|
+
items: [
|
|
1828
|
+
...buildCacheMenuItems(request),
|
|
1829
|
+
{
|
|
1830
|
+
key: "view-cache-config",
|
|
1831
|
+
label: "\u67E5\u770B\u7F13\u5B58\u914D\u7F6E",
|
|
1832
|
+
separatorBefore: true,
|
|
1833
|
+
onClick: props.onViewCacheConfig
|
|
952
1834
|
}
|
|
1835
|
+
]
|
|
1836
|
+
}
|
|
1837
|
+
) : null,
|
|
1838
|
+
request.columns && request.onToggleColumn ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1839
|
+
ColumnVisibilityMenu,
|
|
1840
|
+
{
|
|
1841
|
+
columns: request.columns,
|
|
1842
|
+
onToggle: request.onToggleColumn,
|
|
1843
|
+
onAdd: () => {
|
|
1844
|
+
setColumnEditor({ request, item: null, parentItem: null });
|
|
1845
|
+
setMenuOpen(false);
|
|
1846
|
+
},
|
|
1847
|
+
onAddChild: (parentItem) => {
|
|
1848
|
+
setColumnEditor({ request, item: null, parentItem });
|
|
1849
|
+
setMenuOpen(false);
|
|
1850
|
+
},
|
|
1851
|
+
onEdit: (item) => {
|
|
1852
|
+
setColumnEditor({ request, item, parentItem: null });
|
|
1853
|
+
setMenuOpen(false);
|
|
1854
|
+
},
|
|
1855
|
+
onDelete: (item) => {
|
|
1856
|
+
request.onDeleteColumn?.(item.key);
|
|
1857
|
+
request.onClose();
|
|
953
1858
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}
|
|
957
|
-
const openScrollbarSettings = () => {
|
|
958
|
-
setScrollbarSettingsRequest(request);
|
|
959
|
-
request.onClose();
|
|
960
|
-
};
|
|
1859
|
+
}
|
|
1860
|
+
) }) : null
|
|
1861
|
+
] }) : null;
|
|
961
1862
|
if (request.scrollbarArea) {
|
|
962
1863
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
963
1864
|
scrollbarDialog,
|
|
@@ -975,14 +1876,6 @@ function ReactTableContextMenuView(props) {
|
|
|
975
1876
|
},
|
|
976
1877
|
surfaceStyle: { ...CONTEXT_MENU_SURFACE_STYLE, width: 260 },
|
|
977
1878
|
children: [
|
|
978
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
979
|
-
ScrollbarModeMenu,
|
|
980
|
-
{
|
|
981
|
-
request,
|
|
982
|
-
onOpenSettings: openScrollbarSettings
|
|
983
|
-
}
|
|
984
|
-
),
|
|
985
|
-
/* @__PURE__ */ jsxRuntime.jsx(StickToBottomMenu, { request }),
|
|
986
1879
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
987
1880
|
MenuAction,
|
|
988
1881
|
{
|
|
@@ -994,22 +1887,7 @@ function ReactTableContextMenuView(props) {
|
|
|
994
1887
|
}
|
|
995
1888
|
),
|
|
996
1889
|
/* @__PURE__ */ jsxRuntime.jsx(ResetMenu, { request }),
|
|
997
|
-
|
|
998
|
-
MenuSubmenu,
|
|
999
|
-
{
|
|
1000
|
-
label: "\u7F13\u5B58\u5230\u672C\u5730",
|
|
1001
|
-
items: [
|
|
1002
|
-
...buildCacheMenuItems(request),
|
|
1003
|
-
{
|
|
1004
|
-
key: "view-cache-config",
|
|
1005
|
-
label: "\u67E5\u770B\u7F13\u5B58\u914D\u7F6E",
|
|
1006
|
-
separatorBefore: true,
|
|
1007
|
-
disabled: request.columnSettingsCacheAvailable !== true,
|
|
1008
|
-
onClick: props.onViewCacheConfig
|
|
1009
|
-
}
|
|
1010
|
-
]
|
|
1011
|
-
}
|
|
1012
|
-
) : null
|
|
1890
|
+
configurationActions
|
|
1013
1891
|
]
|
|
1014
1892
|
}
|
|
1015
1893
|
)
|
|
@@ -1022,6 +1900,8 @@ function ReactTableContextMenuView(props) {
|
|
|
1022
1900
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1023
1901
|
scrollbarDialog,
|
|
1024
1902
|
scrollbarPositionDialog,
|
|
1903
|
+
highlightDialog,
|
|
1904
|
+
duplicateDialog,
|
|
1025
1905
|
conditionalDialog,
|
|
1026
1906
|
columnDialogs,
|
|
1027
1907
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1033,7 +1913,7 @@ function ReactTableContextMenuView(props) {
|
|
|
1033
1913
|
minWidth: 260,
|
|
1034
1914
|
onOpenChange: (open) => {
|
|
1035
1915
|
setMenuOpen(open);
|
|
1036
|
-
if (!open && !moreFormatRequest && !customSelectionRequest && !chartRequest && !conditionalEditor && !columnEditor) {
|
|
1916
|
+
if (!open && !moreFormatRequest && !customSelectionRequest && !chartRequest && !highlightRequest && !duplicateRequest && !conditionalEditor && !columnEditor) {
|
|
1037
1917
|
request.onClose();
|
|
1038
1918
|
}
|
|
1039
1919
|
},
|
|
@@ -1104,6 +1984,33 @@ function ReactTableContextMenuView(props) {
|
|
|
1104
1984
|
}
|
|
1105
1985
|
),
|
|
1106
1986
|
/* @__PURE__ */ jsxRuntime.jsx(MenuAction, { label: "\u67E5\u627E", onClick: request.onOpenSearch }),
|
|
1987
|
+
request.duplicateHighlight && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1988
|
+
MenuSubmenu,
|
|
1989
|
+
{
|
|
1990
|
+
label: "\u91CD\u590D\u9879",
|
|
1991
|
+
items: [
|
|
1992
|
+
{
|
|
1993
|
+
key: "duplicate-highlight",
|
|
1994
|
+
label: "\u91CD\u590D\u9879\u9AD8\u4EAE",
|
|
1995
|
+
onClick: () => {
|
|
1996
|
+
setDuplicateRequest(request);
|
|
1997
|
+
setMenuOpen(false);
|
|
1998
|
+
request.onClose();
|
|
1999
|
+
}
|
|
2000
|
+
},
|
|
2001
|
+
{
|
|
2002
|
+
key: "duplicate-clear",
|
|
2003
|
+
label: "\u6E05\u9664\u91CD\u590D\u9879\u9AD8\u4EAE",
|
|
2004
|
+
disabled: !request.duplicateHighlight.config,
|
|
2005
|
+
onClick: () => {
|
|
2006
|
+
request.duplicateHighlight?.clear();
|
|
2007
|
+
setMenuOpen(false);
|
|
2008
|
+
request.onClose();
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
]
|
|
2012
|
+
}
|
|
2013
|
+
),
|
|
1107
2014
|
request.onPrint ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1108
2015
|
MenuAction,
|
|
1109
2016
|
{
|
|
@@ -1215,44 +2122,6 @@ function ReactTableContextMenuView(props) {
|
|
|
1215
2122
|
onClick: request.onExpandAllCollapsedRows
|
|
1216
2123
|
}
|
|
1217
2124
|
),
|
|
1218
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1219
|
-
MenuAction,
|
|
1220
|
-
{
|
|
1221
|
-
label: request.toggleColumnLabel ?? "",
|
|
1222
|
-
onClick: request.onToggleCurrentColumn
|
|
1223
|
-
}
|
|
1224
|
-
),
|
|
1225
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1226
|
-
MenuSubmenu,
|
|
1227
|
-
{
|
|
1228
|
-
label: "\u81EA\u52A8\u8C03\u6574\u5217\u5BBD",
|
|
1229
|
-
items: [
|
|
1230
|
-
{
|
|
1231
|
-
key: "auto-fit-current",
|
|
1232
|
-
label: "\u5F53\u524D\u5217",
|
|
1233
|
-
onClick: request.onAutoFitCurrentColumn
|
|
1234
|
-
},
|
|
1235
|
-
{
|
|
1236
|
-
key: "auto-fit-all",
|
|
1237
|
-
label: "\u5168\u90E8\u5217",
|
|
1238
|
-
onClick: request.onAutoFitAllColumns
|
|
1239
|
-
},
|
|
1240
|
-
{
|
|
1241
|
-
key: "auto-fit-fill-container",
|
|
1242
|
-
label: "\u81EA\u52A8\u94FA\u6EE1\u5BB9\u5668",
|
|
1243
|
-
onClick: request.onAutoFitFillContainer
|
|
1244
|
-
}
|
|
1245
|
-
]
|
|
1246
|
-
}
|
|
1247
|
-
),
|
|
1248
|
-
/* @__PURE__ */ jsxRuntime.jsx(StickToBottomMenu, { request }),
|
|
1249
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1250
|
-
MenuAction,
|
|
1251
|
-
{
|
|
1252
|
-
label: request.groupingBarVisible ? "\u9690\u85CF\u5206\u7EC4\u680F" : "\u663E\u793A\u5206\u7EC4\u680F",
|
|
1253
|
-
onClick: request.onToggleGroupingBar
|
|
1254
|
-
}
|
|
1255
|
-
),
|
|
1256
2125
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1257
2126
|
MenuAction,
|
|
1258
2127
|
{
|
|
@@ -1260,15 +2129,6 @@ function ReactTableContextMenuView(props) {
|
|
|
1260
2129
|
onClick: request.onExpandAllCollapsedColumns
|
|
1261
2130
|
}
|
|
1262
2131
|
),
|
|
1263
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1264
|
-
MenuAction,
|
|
1265
|
-
{
|
|
1266
|
-
label: request.summaryVisible ? "\u9690\u85CF\u6C47\u603B\u680F" : "\u663E\u793A\u6C47\u603B\u680F",
|
|
1267
|
-
onClick: request.onToggleSummary
|
|
1268
|
-
}
|
|
1269
|
-
),
|
|
1270
|
-
/* @__PURE__ */ jsxRuntime.jsx(SummaryMenu, { request }),
|
|
1271
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlignmentMenu, { request }),
|
|
1272
2132
|
request.onChangeConditionalFormats && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1273
2133
|
MenuSubmenu,
|
|
1274
2134
|
{
|
|
@@ -1304,16 +2164,6 @@ function ReactTableContextMenuView(props) {
|
|
|
1304
2164
|
)) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#64748b", padding: 8 }, children: "\u6682\u65E0\u89C4\u5219" }) })
|
|
1305
2165
|
}
|
|
1306
2166
|
),
|
|
1307
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1308
|
-
DataFormatMenu,
|
|
1309
|
-
{
|
|
1310
|
-
request,
|
|
1311
|
-
onOpenMoreFormat: () => {
|
|
1312
|
-
setMoreFormatRequest(request);
|
|
1313
|
-
setMenuOpen(false);
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
),
|
|
1317
2167
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1318
2168
|
MenuSubmenu,
|
|
1319
2169
|
{
|
|
@@ -1360,37 +2210,7 @@ function ReactTableContextMenuView(props) {
|
|
|
1360
2210
|
]
|
|
1361
2211
|
}
|
|
1362
2212
|
),
|
|
1363
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1364
|
-
MenuSubmenu,
|
|
1365
|
-
{
|
|
1366
|
-
label: "\u56FA\u5B9A",
|
|
1367
|
-
items: [
|
|
1368
|
-
{
|
|
1369
|
-
key: "fix-left",
|
|
1370
|
-
label: "\u5DE6\u4FA7",
|
|
1371
|
-
onClick: request.onFixLeft
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
key: "fix-right",
|
|
1375
|
-
label: "\u53F3\u4FA7",
|
|
1376
|
-
onClick: request.onFixRight
|
|
1377
|
-
},
|
|
1378
|
-
{
|
|
1379
|
-
key: "unfix",
|
|
1380
|
-
label: "\u53D6\u6D88\u56FA\u5B9A",
|
|
1381
|
-
onClick: request.onUnfix
|
|
1382
|
-
}
|
|
1383
|
-
]
|
|
1384
|
-
}
|
|
1385
|
-
),
|
|
1386
2213
|
/* @__PURE__ */ jsxRuntime.jsx(ResetMenu, { request }),
|
|
1387
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1388
|
-
ScrollbarModeMenu,
|
|
1389
|
-
{
|
|
1390
|
-
request,
|
|
1391
|
-
onOpenSettings: openScrollbarSettings
|
|
1392
|
-
}
|
|
1393
|
-
),
|
|
1394
2214
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1395
2215
|
MenuAction,
|
|
1396
2216
|
{
|
|
@@ -1401,75 +2221,7 @@ function ReactTableContextMenuView(props) {
|
|
|
1401
2221
|
}
|
|
1402
2222
|
}
|
|
1403
2223
|
),
|
|
1404
|
-
|
|
1405
|
-
DensityMenu,
|
|
1406
|
-
{
|
|
1407
|
-
value: request.density ?? "middle",
|
|
1408
|
-
onChange: request.onChangeDensity
|
|
1409
|
-
}
|
|
1410
|
-
),
|
|
1411
|
-
request.onOpenPaginationConfig ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1412
|
-
MenuAction,
|
|
1413
|
-
{
|
|
1414
|
-
label: "\u5206\u9875\u914D\u7F6E",
|
|
1415
|
-
onClick: () => {
|
|
1416
|
-
request.onClose();
|
|
1417
|
-
request.onOpenPaginationConfig?.();
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
) : null,
|
|
1421
|
-
/* @__PURE__ */ jsxRuntime.jsx(ZoomMenu, { value: request.zoom ?? 1, onChange: request.onChangeZoom }),
|
|
1422
|
-
request.onToggleDebug ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1423
|
-
MenuAction,
|
|
1424
|
-
{
|
|
1425
|
-
label: request.debugEnabled ? "\u5173\u95ED\u8C03\u8BD5" : "\u5F00\u542F\u8C03\u8BD5",
|
|
1426
|
-
onClick: () => {
|
|
1427
|
-
request.onClose();
|
|
1428
|
-
request.onToggleDebug?.();
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
) : null,
|
|
1432
|
-
request.columnSettingsCacheAvailable === true ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1433
|
-
MenuSubmenu,
|
|
1434
|
-
{
|
|
1435
|
-
label: "\u7F13\u5B58\u5230\u672C\u5730",
|
|
1436
|
-
items: [
|
|
1437
|
-
...buildCacheMenuItems(request),
|
|
1438
|
-
{
|
|
1439
|
-
key: "view-cache-config",
|
|
1440
|
-
label: "\u67E5\u770B\u7F13\u5B58\u914D\u7F6E",
|
|
1441
|
-
separatorBefore: true,
|
|
1442
|
-
onClick: props.onViewCacheConfig
|
|
1443
|
-
}
|
|
1444
|
-
]
|
|
1445
|
-
}
|
|
1446
|
-
) : null,
|
|
1447
|
-
request.columns && request.onToggleColumn ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1448
|
-
/* @__PURE__ */ jsxRuntime.jsx(MenuDivider, {}),
|
|
1449
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1450
|
-
ColumnVisibilityMenu,
|
|
1451
|
-
{
|
|
1452
|
-
columns: request.columns,
|
|
1453
|
-
onToggle: request.onToggleColumn,
|
|
1454
|
-
onAdd: () => {
|
|
1455
|
-
setColumnEditor({ request, item: null, parentItem: null });
|
|
1456
|
-
setMenuOpen(false);
|
|
1457
|
-
},
|
|
1458
|
-
onAddChild: (parentItem) => {
|
|
1459
|
-
setColumnEditor({ request, item: null, parentItem });
|
|
1460
|
-
setMenuOpen(false);
|
|
1461
|
-
},
|
|
1462
|
-
onEdit: (item) => {
|
|
1463
|
-
setColumnEditor({ request, item, parentItem: null });
|
|
1464
|
-
setMenuOpen(false);
|
|
1465
|
-
},
|
|
1466
|
-
onDelete: (item) => {
|
|
1467
|
-
request.onDeleteColumn?.(item.key);
|
|
1468
|
-
request.onClose();
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
)
|
|
1472
|
-
] }) : null
|
|
2224
|
+
configurationActions
|
|
1473
2225
|
] })
|
|
1474
2226
|
}
|
|
1475
2227
|
),
|
|
@@ -1722,6 +2474,8 @@ function MenuSubmenu(props) {
|
|
|
1722
2474
|
{
|
|
1723
2475
|
ref: triggerRef,
|
|
1724
2476
|
type: "button",
|
|
2477
|
+
onClick: () => setOpen(true),
|
|
2478
|
+
"aria-expanded": open,
|
|
1725
2479
|
className: "react-list-table-menu-action react-list-table-menu-action-submenu",
|
|
1726
2480
|
style: {
|
|
1727
2481
|
display: "flex",
|
|
@@ -1859,6 +2613,8 @@ function ZoomMenu(props) {
|
|
|
1859
2613
|
{
|
|
1860
2614
|
ref: triggerRef,
|
|
1861
2615
|
type: "button",
|
|
2616
|
+
onClick: () => setOpen(true),
|
|
2617
|
+
"aria-expanded": open,
|
|
1862
2618
|
className: "react-list-table-menu-action react-list-table-menu-action-submenu",
|
|
1863
2619
|
style: {
|
|
1864
2620
|
display: "flex",
|
|
@@ -2235,6 +2991,8 @@ function ColumnVisibilityMenu(props) {
|
|
|
2235
2991
|
{
|
|
2236
2992
|
ref: triggerRef,
|
|
2237
2993
|
type: "button",
|
|
2994
|
+
onClick: () => setOpen(true),
|
|
2995
|
+
"aria-expanded": open,
|
|
2238
2996
|
className: "react-list-table-menu-action react-list-table-menu-action-submenu",
|
|
2239
2997
|
style: {
|
|
2240
2998
|
display: "flex",
|
|
@@ -6634,6 +7392,52 @@ function ReactListTablePaginationConfigDialog(props) {
|
|
|
6634
7392
|
] })
|
|
6635
7393
|
] }),
|
|
6636
7394
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config", children: [
|
|
7395
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7396
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config-enable react-list-table-pagination-config-cache", children: [
|
|
7397
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "react-list-table-pagination-config-check", children: [
|
|
7398
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7399
|
+
"input",
|
|
7400
|
+
{
|
|
7401
|
+
type: "checkbox",
|
|
7402
|
+
"aria-label": "\u7F13\u5B58\u5230\u672C\u5730",
|
|
7403
|
+
checked: draft.cacheEnabled,
|
|
7404
|
+
onChange: (event) => patch({ cacheEnabled: event.target.checked })
|
|
7405
|
+
}
|
|
7406
|
+
),
|
|
7407
|
+
"\u7F13\u5B58\u5230\u672C\u5730"
|
|
7408
|
+
] }),
|
|
7409
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-pagination-config-cache-scope", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7410
|
+
reactComponents.ReactSelect,
|
|
7411
|
+
{
|
|
7412
|
+
"aria-label": "\u7F13\u5B58\u8303\u56F4",
|
|
7413
|
+
disabled: !draft.cacheEnabled,
|
|
7414
|
+
value: draft.cacheScope,
|
|
7415
|
+
options: [
|
|
7416
|
+
{
|
|
7417
|
+
value: "table",
|
|
7418
|
+
label: "\u5F53\u524D\u8868\u683C",
|
|
7419
|
+
disabled: !props.snapshot.cache?.currentTableAvailable
|
|
7420
|
+
},
|
|
7421
|
+
{ value: "all", label: "\u6240\u6709\u8868\u683C" }
|
|
7422
|
+
],
|
|
7423
|
+
onChange: (scope) => patch({ cacheScope: scope })
|
|
7424
|
+
}
|
|
7425
|
+
) })
|
|
7426
|
+
] }),
|
|
7427
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config-help", children: [
|
|
7428
|
+
draft.cacheScope === "all" ? "\u4F5C\u4E3A\u6240\u6709\u8868\u683C\u7684\u5171\u4EAB\u9ED8\u8BA4\u914D\u7F6E\uFF1B\u660E\u786E\u8BBE\u7F6E pagination=false \u7684\u8868\u683C\u4E0D\u4F7F\u7528\u5171\u4EAB\u7F13\u5B58\u3002\u5355\u8868\u7F13\u5B58\u4F18\u5148\u3002" : "\u4EC5\u4FDD\u5B58\u5230\u5F53\u524D\u8868\u683C\uFF1B\u9700\u8981\u7A33\u5B9A\u7684 storageKey\u3002",
|
|
7429
|
+
" ",
|
|
7430
|
+
"\u5F53\u524D\u9875\u4E0D\u7F13\u5B58\u3002"
|
|
7431
|
+
] }),
|
|
7432
|
+
errors.cache ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7433
|
+
"div",
|
|
7434
|
+
{
|
|
7435
|
+
role: "alert",
|
|
7436
|
+
className: "react-list-table-pagination-config-error",
|
|
7437
|
+
children: errors.cache
|
|
7438
|
+
}
|
|
7439
|
+
) : null
|
|
7440
|
+
] }),
|
|
6637
7441
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config-enable", children: [
|
|
6638
7442
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6639
7443
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "\u542F\u7528\u5206\u9875" }),
|
|
@@ -6773,52 +7577,6 @@ function ReactListTablePaginationConfigDialog(props) {
|
|
|
6773
7577
|
] })
|
|
6774
7578
|
] }) : null
|
|
6775
7579
|
] }),
|
|
6776
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6777
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config-enable react-list-table-pagination-config-cache", children: [
|
|
6778
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "react-list-table-pagination-config-check", children: [
|
|
6779
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6780
|
-
"input",
|
|
6781
|
-
{
|
|
6782
|
-
type: "checkbox",
|
|
6783
|
-
"aria-label": "\u7F13\u5B58\u5230\u672C\u5730",
|
|
6784
|
-
checked: draft.cacheEnabled,
|
|
6785
|
-
onChange: (event) => patch({ cacheEnabled: event.target.checked })
|
|
6786
|
-
}
|
|
6787
|
-
),
|
|
6788
|
-
"\u7F13\u5B58\u5230\u672C\u5730"
|
|
6789
|
-
] }),
|
|
6790
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-pagination-config-cache-scope", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6791
|
-
reactComponents.ReactSelect,
|
|
6792
|
-
{
|
|
6793
|
-
"aria-label": "\u7F13\u5B58\u8303\u56F4",
|
|
6794
|
-
disabled: !draft.cacheEnabled,
|
|
6795
|
-
value: draft.cacheScope,
|
|
6796
|
-
options: [
|
|
6797
|
-
{
|
|
6798
|
-
value: "table",
|
|
6799
|
-
label: "\u5F53\u524D\u8868\u683C",
|
|
6800
|
-
disabled: !props.snapshot.cache?.currentTableAvailable
|
|
6801
|
-
},
|
|
6802
|
-
{ value: "all", label: "\u6240\u6709\u8868\u683C" }
|
|
6803
|
-
],
|
|
6804
|
-
onChange: (scope) => patch({ cacheScope: scope })
|
|
6805
|
-
}
|
|
6806
|
-
) })
|
|
6807
|
-
] }),
|
|
6808
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config-help", children: [
|
|
6809
|
-
draft.cacheScope === "all" ? "\u4F5C\u4E3A\u6240\u6709\u8868\u683C\u7684\u5171\u4EAB\u9ED8\u8BA4\u914D\u7F6E\uFF1B\u660E\u786E\u8BBE\u7F6E pagination=false \u7684\u8868\u683C\u4E0D\u4F7F\u7528\u5171\u4EAB\u7F13\u5B58\u3002\u5355\u8868\u7F13\u5B58\u4F18\u5148\u3002" : "\u4EC5\u4FDD\u5B58\u5230\u5F53\u524D\u8868\u683C\uFF1B\u9700\u8981\u7A33\u5B9A\u7684 storageKey\u3002",
|
|
6810
|
-
" ",
|
|
6811
|
-
"\u5F53\u524D\u9875\u4E0D\u7F13\u5B58\u3002"
|
|
6812
|
-
] }),
|
|
6813
|
-
errors.cache ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6814
|
-
"div",
|
|
6815
|
-
{
|
|
6816
|
-
role: "alert",
|
|
6817
|
-
className: "react-list-table-pagination-config-error",
|
|
6818
|
-
children: errors.cache
|
|
6819
|
-
}
|
|
6820
|
-
) : null
|
|
6821
|
-
] }),
|
|
6822
7580
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "react-list-table-pagination-config-preview", children: [
|
|
6823
7581
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-pagination-config-help", children: "\u5206\u9875\u9884\u89C8" }),
|
|
6824
7582
|
!draft.enabled ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-pagination-config-off", children: "\u5206\u9875\u5DF2\u5173\u95ED" }) : scroll ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-pagination-config-off", children: "\u6EDA\u52A8\u5230\u5E95\u90E8\u52A0\u8F7D\u4E0B\u4E00\u6279\uFF0C\u4E0D\u663E\u793A\u5206\u9875\u63A7\u4EF6" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-pagination-config-pager", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7444,6 +8202,8 @@ var CONFIG_KEYS = [
|
|
|
7444
8202
|
"theme",
|
|
7445
8203
|
"styles",
|
|
7446
8204
|
"keyboardNavigation",
|
|
8205
|
+
"duplicateHighlight",
|
|
8206
|
+
"highlight",
|
|
7447
8207
|
"contextMenu",
|
|
7448
8208
|
"grouping",
|
|
7449
8209
|
"query",
|
|
@@ -7488,7 +8248,12 @@ function useStableTableProps(props) {
|
|
|
7488
8248
|
}
|
|
7489
8249
|
return handler;
|
|
7490
8250
|
};
|
|
7491
|
-
for (const key of [
|
|
8251
|
+
for (const key of [
|
|
8252
|
+
"onChange",
|
|
8253
|
+
"onPaginationConfigChange",
|
|
8254
|
+
"onDuplicateHighlightChange",
|
|
8255
|
+
"onHighlightChange"
|
|
8256
|
+
]) {
|
|
7492
8257
|
if (typeof props[key] === "function") next[key] = event(void 0, key);
|
|
7493
8258
|
}
|
|
7494
8259
|
for (const key of CONFIG_KEYS) {
|
|
@@ -7738,6 +8503,10 @@ function ReactListTableInner(props, ref) {
|
|
|
7738
8503
|
styles,
|
|
7739
8504
|
striped,
|
|
7740
8505
|
highlightMode,
|
|
8506
|
+
highlight,
|
|
8507
|
+
onHighlightChange,
|
|
8508
|
+
duplicateHighlight,
|
|
8509
|
+
onDuplicateHighlightChange,
|
|
7741
8510
|
keyboardNavigation,
|
|
7742
8511
|
contextMenu,
|
|
7743
8512
|
grouping,
|
|
@@ -7862,6 +8631,10 @@ function ReactListTableInner(props, ref) {
|
|
|
7862
8631
|
styles,
|
|
7863
8632
|
striped,
|
|
7864
8633
|
highlightMode,
|
|
8634
|
+
highlight,
|
|
8635
|
+
onHighlightChange,
|
|
8636
|
+
duplicateHighlight,
|
|
8637
|
+
onDuplicateHighlightChange,
|
|
7865
8638
|
keyboardNavigation,
|
|
7866
8639
|
contextMenu,
|
|
7867
8640
|
grouping,
|
|
@@ -7959,6 +8732,10 @@ function ReactListTableInner(props, ref) {
|
|
|
7959
8732
|
styles,
|
|
7960
8733
|
striped,
|
|
7961
8734
|
highlightMode,
|
|
8735
|
+
highlight,
|
|
8736
|
+
onHighlightChange,
|
|
8737
|
+
duplicateHighlight,
|
|
8738
|
+
onDuplicateHighlightChange,
|
|
7962
8739
|
keyboardNavigation,
|
|
7963
8740
|
contextMenu,
|
|
7964
8741
|
grouping,
|
|
@@ -8056,6 +8833,21 @@ function ReactListTableInner(props, ref) {
|
|
|
8056
8833
|
ref,
|
|
8057
8834
|
() => ({
|
|
8058
8835
|
getPaginationConfig: () => tableRef.current?.getPaginationConfig() ?? null,
|
|
8836
|
+
refreshFormulaLayout: () => tableRef.current?.refreshFormulaLayout(),
|
|
8837
|
+
getHighlightConfig: () => tableRef.current?.getHighlightConfig() ?? null,
|
|
8838
|
+
setHighlightConfig: (value) => tableRef.current?.setHighlightConfig(value) ?? {
|
|
8839
|
+
ok: false,
|
|
8840
|
+
error: "\u8868\u683C\u5C1A\u672A\u6302\u8F7D"
|
|
8841
|
+
},
|
|
8842
|
+
getDuplicateHighlightConfig: () => tableRef.current?.getDuplicateHighlightConfig() ?? false,
|
|
8843
|
+
setDuplicateHighlightConfig: (value) => tableRef.current?.setDuplicateHighlightConfig(value) ?? {
|
|
8844
|
+
ok: false,
|
|
8845
|
+
error: "\u8868\u683C\u5C1A\u672A\u6302\u8F7D"
|
|
8846
|
+
},
|
|
8847
|
+
clearDuplicateHighlight: () => tableRef.current?.clearDuplicateHighlight() ?? {
|
|
8848
|
+
ok: false,
|
|
8849
|
+
error: "\u8868\u683C\u5C1A\u672A\u6302\u8F7D"
|
|
8850
|
+
},
|
|
8059
8851
|
setPaginationConfig: (value, cache) => tableRef.current?.setPaginationConfig(value, cache) ?? {
|
|
8060
8852
|
ok: false,
|
|
8061
8853
|
errors: { table: "\u8868\u683C\u5C1A\u672A\u6302\u8F7D" }
|