@sia.soul/sia-react-ui 0.1.42 → 0.1.44
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/{chunk-IPDCEXQO.js → chunk-KXPNW4E6.js} +59 -16
- package/dist/{chunk-3Q3S6CDZ.js → chunk-NYJSSPIX.js} +16 -3
- package/dist/{chunk-LWVZEUGJ.js → chunk-QIXU7N4X.js} +1 -1
- package/dist/{core-C2IieVNm.d.cts → core-CADzSGab.d.cts} +22 -1
- package/dist/{core-ZmKnvCFV.d.ts → core-wsymjzoC.d.ts} +22 -1
- package/dist/core.cjs +74 -18
- package/dist/core.css +65 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +2 -2
- package/dist/index.cjs +172 -55
- package/dist/index.css +65 -0
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +101 -40
- package/dist/select-date-range.cjs +16 -3
- package/dist/select-date-range.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3348,7 +3348,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3348
3348
|
};
|
|
3349
3349
|
const scanTargets = () => {
|
|
3350
3350
|
scanFrame = 0;
|
|
3351
|
-
const
|
|
3351
|
+
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
3352
|
+
const discovered = [];
|
|
3353
|
+
if (!targetRef) {
|
|
3354
|
+
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, {
|
|
3355
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
3356
|
+
});
|
|
3357
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
3358
|
+
if (node instanceof HTMLElement) discovered.push(node);
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
3352
3362
|
const nextTargets = /* @__PURE__ */ new Set();
|
|
3353
3363
|
candidates.forEach((target) => {
|
|
3354
3364
|
if (canScroll(target, "horizontal") || canScroll(target, "vertical")) {
|
|
@@ -3366,9 +3376,12 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3366
3376
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
3367
3377
|
};
|
|
3368
3378
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
3369
|
-
if (mutations.some((mutation) =>
|
|
3379
|
+
if (mutations.some((mutation) => {
|
|
3380
|
+
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
3381
|
+
return target && !layer.contains(target) && !target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track");
|
|
3382
|
+
})) scheduleScan();
|
|
3370
3383
|
});
|
|
3371
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true });
|
|
3384
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
3372
3385
|
window.addEventListener("resize", scheduleScan);
|
|
3373
3386
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
3374
3387
|
scheduleScan();
|
|
@@ -5071,6 +5084,12 @@ function Card({
|
|
|
5071
5084
|
title,
|
|
5072
5085
|
description,
|
|
5073
5086
|
extra,
|
|
5087
|
+
selectable = false,
|
|
5088
|
+
selected,
|
|
5089
|
+
defaultSelected = false,
|
|
5090
|
+
disabled = false,
|
|
5091
|
+
onSelectedChange,
|
|
5092
|
+
hoverActions,
|
|
5074
5093
|
accent,
|
|
5075
5094
|
accentColor,
|
|
5076
5095
|
collapsible = false,
|
|
@@ -5083,9 +5102,19 @@ function Card({
|
|
|
5083
5102
|
className = "",
|
|
5084
5103
|
style,
|
|
5085
5104
|
children,
|
|
5105
|
+
onClick,
|
|
5106
|
+
onKeyDown,
|
|
5086
5107
|
...props
|
|
5087
5108
|
}) {
|
|
5088
5109
|
const [internalCollapsed, setInternalCollapsed] = (0, import_react24.useState)(defaultCollapsed);
|
|
5110
|
+
const [internalSelected, setInternalSelected] = (0, import_react24.useState)(defaultSelected);
|
|
5111
|
+
const isSelected = selected ?? internalSelected;
|
|
5112
|
+
function toggleSelected() {
|
|
5113
|
+
if (!selectable || disabled) return;
|
|
5114
|
+
const next = !isSelected;
|
|
5115
|
+
if (selected === void 0) setInternalSelected(next);
|
|
5116
|
+
onSelectedChange?.(next);
|
|
5117
|
+
}
|
|
5089
5118
|
const isCollapsed = collapsed ?? internalCollapsed;
|
|
5090
5119
|
const hasHeader = title || extra || collapsible;
|
|
5091
5120
|
const mergedStyle = accentColor ? { "--sia-card-accent": accentColor, ...style } : style;
|
|
@@ -5099,19 +5128,46 @@ function Card({
|
|
|
5099
5128
|
accent || accentColor ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: `sia-card__accent${accent ? ` sia-card__accent--${accent}` : ""}`, "aria-hidden": "true" }) : null,
|
|
5100
5129
|
title ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "sia-card__title", children: title }) : null
|
|
5101
5130
|
] });
|
|
5102
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
5132
|
+
"section",
|
|
5133
|
+
{
|
|
5134
|
+
className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
5135
|
+
style: mergedStyle,
|
|
5136
|
+
role: selectable ? "checkbox" : void 0,
|
|
5137
|
+
"aria-checked": selectable ? isSelected : void 0,
|
|
5138
|
+
"aria-disabled": selectable ? disabled : void 0,
|
|
5139
|
+
tabIndex: selectable && !disabled ? 0 : void 0,
|
|
5140
|
+
...withTitleTooltip(props),
|
|
5141
|
+
onClick: (event) => {
|
|
5142
|
+
onClick?.(event);
|
|
5143
|
+
const target = event.target;
|
|
5144
|
+
const interactive = target.closest('button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="radio"], [role="switch"], [contenteditable="true"], [tabindex]');
|
|
5145
|
+
if (!event.defaultPrevented && (!interactive || interactive === event.currentTarget)) toggleSelected();
|
|
5146
|
+
},
|
|
5147
|
+
onKeyDown: (event) => {
|
|
5148
|
+
onKeyDown?.(event);
|
|
5149
|
+
if (!event.defaultPrevented && event.target === event.currentTarget && selectable && (event.key === "Enter" || event.key === " ")) {
|
|
5150
|
+
event.preventDefault();
|
|
5151
|
+
toggleSelected();
|
|
5152
|
+
}
|
|
5153
|
+
},
|
|
5154
|
+
children: [
|
|
5155
|
+
selectable && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "sia-card__selected-corner", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "check", size: 16 }) }) : null,
|
|
5156
|
+
hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "sia-card__header", children: [
|
|
5157
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
|
|
5158
|
+
heading,
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
5160
|
+
] }) : heading,
|
|
5161
|
+
extra ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "sia-card__extra", children: extra }) : null
|
|
5162
|
+
] }) : null,
|
|
5163
|
+
!isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
5164
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "sia-card__description", children: description }) : null,
|
|
5165
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children }),
|
|
5166
|
+
hoverActions ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "sia-card__hover-actions", onClick: (event) => event.stopPropagation(), children: hoverActions }) : null
|
|
5167
|
+
] }) : null
|
|
5168
|
+
]
|
|
5169
|
+
}
|
|
5170
|
+
);
|
|
5115
5171
|
}
|
|
5116
5172
|
|
|
5117
5173
|
// src/components/Layout.tsx
|
|
@@ -11805,6 +11861,22 @@ function Treemap({
|
|
|
11805
11861
|
// src/components/Table/TableCellContent.tsx
|
|
11806
11862
|
var import_react49 = require("react");
|
|
11807
11863
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11864
|
+
var pendingLayouts = /* @__PURE__ */ new Map();
|
|
11865
|
+
var layoutFrame;
|
|
11866
|
+
function scheduleLayout(element, task) {
|
|
11867
|
+
pendingLayouts.set(element, task);
|
|
11868
|
+
if (layoutFrame !== void 0) return;
|
|
11869
|
+
layoutFrame = requestAnimationFrame(() => {
|
|
11870
|
+
layoutFrame = void 0;
|
|
11871
|
+
const tasks = [...pendingLayouts.values()];
|
|
11872
|
+
pendingLayouts.clear();
|
|
11873
|
+
const layouts = tasks.flatMap((task2) => task2.layouts());
|
|
11874
|
+
layouts.forEach((layout) => {
|
|
11875
|
+
if (!layout.hasAttribute("data-table-inline-layout")) layout.setAttribute("data-table-inline-layout", "");
|
|
11876
|
+
});
|
|
11877
|
+
tasks.forEach((task2) => task2.measure());
|
|
11878
|
+
});
|
|
11879
|
+
}
|
|
11808
11880
|
function TableCellContent({ children, ellipsis, title }) {
|
|
11809
11881
|
const ref = (0, import_react49.useRef)(null);
|
|
11810
11882
|
const [overflowing, setOverflowing] = (0, import_react49.useState)(false);
|
|
@@ -11812,29 +11884,33 @@ function TableCellContent({ children, ellipsis, title }) {
|
|
|
11812
11884
|
(0, import_react49.useLayoutEffect)(() => {
|
|
11813
11885
|
const element = ref.current;
|
|
11814
11886
|
if (!element || !ellipsis || !customContent) return;
|
|
11815
|
-
const
|
|
11816
|
-
const normalizeLayouts = (parent) => {
|
|
11887
|
+
const normalizeLayouts = (parent, layouts) => {
|
|
11817
11888
|
for (const child of parent.children) {
|
|
11818
11889
|
if (!(child instanceof HTMLElement)) continue;
|
|
11819
11890
|
const component = [...child.classList].some((name) => name.startsWith("sia-") && !name.startsWith("sia-space") && name !== "sia-flex");
|
|
11820
11891
|
if (component || child.matches("button, input, textarea, select, [contenteditable]")) continue;
|
|
11821
11892
|
const display = getComputedStyle(child).display;
|
|
11822
11893
|
if (["flex", "inline-flex", "grid", "inline-grid"].includes(display)) {
|
|
11823
|
-
child.setAttribute("data-table-inline-layout", "");
|
|
11824
11894
|
layouts.push(child);
|
|
11825
11895
|
}
|
|
11826
|
-
normalizeLayouts(child);
|
|
11896
|
+
normalizeLayouts(child, layouts);
|
|
11827
11897
|
}
|
|
11828
11898
|
};
|
|
11829
|
-
normalizeLayouts(element);
|
|
11830
11899
|
const update = () => setOverflowing(element.scrollWidth > element.clientWidth + 1 || element.scrollHeight > element.clientHeight + 1);
|
|
11831
|
-
|
|
11900
|
+
scheduleLayout(element, {
|
|
11901
|
+
layouts: () => {
|
|
11902
|
+
const layouts = [];
|
|
11903
|
+
normalizeLayouts(element, layouts);
|
|
11904
|
+
return layouts;
|
|
11905
|
+
},
|
|
11906
|
+
measure: update
|
|
11907
|
+
});
|
|
11832
11908
|
const observer = new ResizeObserver(update);
|
|
11833
11909
|
observer.observe(element);
|
|
11834
11910
|
for (const child of element.children) observer.observe(child);
|
|
11835
11911
|
return () => {
|
|
11836
11912
|
observer.disconnect();
|
|
11837
|
-
|
|
11913
|
+
pendingLayouts.delete(element);
|
|
11838
11914
|
};
|
|
11839
11915
|
}, [children, ellipsis, customContent]);
|
|
11840
11916
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref, className: "sia-table__cell-content", "data-custom-content": customContent || void 0, "data-content-overflow": ellipsis && customContent && overflowing || void 0, children: title ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tooltip, { title, className: "sia-table__cell-tooltip", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children }) }) : children });
|
|
@@ -13637,8 +13713,11 @@ function createResizePlugin(options = {}) {
|
|
|
13637
13713
|
})
|
|
13638
13714
|
};
|
|
13639
13715
|
}
|
|
13716
|
+
function isTableAuxiliaryColumn(column) {
|
|
13717
|
+
return column.meta?.plugin === "index" || column.meta?.plugin === "selection" || column.key === "__index__" || column.key === "__selection__";
|
|
13718
|
+
}
|
|
13640
13719
|
function createColumnSettingItems(columns, visibleKeys) {
|
|
13641
|
-
return flattenTableColumns(columns).map((column, order) => ({
|
|
13720
|
+
return flattenTableColumns(columns).filter((column) => !isTableAuxiliaryColumn(column)).map((column, order) => ({
|
|
13642
13721
|
key: column.key,
|
|
13643
13722
|
width: column.width,
|
|
13644
13723
|
fixed: normalizeFixed(column.fixed),
|
|
@@ -13649,6 +13728,7 @@ function createColumnSettingItems(columns, visibleKeys) {
|
|
|
13649
13728
|
function applyColumnSettingsToTree(columns, items) {
|
|
13650
13729
|
const itemMap = new Map(items.map((item) => [item.key, item]));
|
|
13651
13730
|
const walk = (source) => source.flatMap((column, sourceOrder) => {
|
|
13731
|
+
if (isTableAuxiliaryColumn(column)) return [{ column, order: column.meta?.plugin === "selection" || column.key === "__selection__" ? -2 : -1 }];
|
|
13652
13732
|
if (column.children?.length) {
|
|
13653
13733
|
const children = walk(column.children);
|
|
13654
13734
|
if (children.length === 0) return [];
|
|
@@ -13958,11 +14038,15 @@ function ColumnSettingPanel({
|
|
|
13958
14038
|
var columnSettingLoadTokens = /* @__PURE__ */ new WeakMap();
|
|
13959
14039
|
function createColumnSettingPlugin(options = {}) {
|
|
13960
14040
|
const baseItems = (context) => createColumnSettingItems(context.baseColumns, options.defaultVisibleKeys);
|
|
13961
|
-
const
|
|
14041
|
+
const editableItems = (items, context) => {
|
|
14042
|
+
const keys = new Set(baseItems(context).map((item) => item.key));
|
|
14043
|
+
return items.filter((item) => keys.has(item.key));
|
|
14044
|
+
};
|
|
14045
|
+
const currentItems = (context) => context.state.items?.length ? editableItems(context.state.items, context) : baseItems(context);
|
|
13962
14046
|
const save = (snapshot) => options.adapter && options.scope ? options.adapter.save(options.scope, snapshot).catch(() => void 0) : Promise.resolve();
|
|
13963
14047
|
function apply(items, context, persist = true) {
|
|
13964
14048
|
const normalized = orderColumnSettings(
|
|
13965
|
-
|
|
14049
|
+
editableItems(items, context).sort((a, b) => a.order - b.order)
|
|
13966
14050
|
);
|
|
13967
14051
|
context.setState((state) => ({ ...state, items: normalized, open: false }));
|
|
13968
14052
|
const columnMap = new Map(
|
|
@@ -14369,10 +14453,9 @@ function buildHeaderRows(columns) {
|
|
|
14369
14453
|
function resolveInitialState(plugin) {
|
|
14370
14454
|
return typeof plugin.initialState === "function" ? plugin.initialState() : plugin.initialState;
|
|
14371
14455
|
}
|
|
14372
|
-
function
|
|
14456
|
+
function prepareTableCellMeasurement(cell) {
|
|
14373
14457
|
const content = cell.querySelector(":scope > .sia-table__cell-content");
|
|
14374
14458
|
const target = cell.classList.contains("sia-table__header-cell") ? cell.querySelector(".sia-table__resizable-header > span:first-child, .sia-table__header-label-content") : content;
|
|
14375
|
-
let contentWidth = cell.scrollWidth;
|
|
14376
14459
|
if (target) {
|
|
14377
14460
|
const measurement = target.cloneNode(true);
|
|
14378
14461
|
Object.assign(measurement.style, {
|
|
@@ -14390,11 +14473,8 @@ function measureTableCellContentWidth(cell) {
|
|
|
14390
14473
|
});
|
|
14391
14474
|
measurement.setAttribute("aria-hidden", "true");
|
|
14392
14475
|
cell.appendChild(measurement);
|
|
14393
|
-
|
|
14394
|
-
measurement.remove();
|
|
14476
|
+
return measurement;
|
|
14395
14477
|
}
|
|
14396
|
-
const style = window.getComputedStyle(cell);
|
|
14397
|
-
return contentWidth + (Number.parseFloat(style.paddingLeft) || 0) + (Number.parseFloat(style.paddingRight) || 0) + (Number.parseFloat(style.borderLeftWidth) || 0) + (Number.parseFloat(style.borderRightWidth) || 0);
|
|
14398
14478
|
}
|
|
14399
14479
|
function getTableHorizontalMetrics(viewport, table) {
|
|
14400
14480
|
const contentWidth = Math.max(viewport.clientWidth, table?.getBoundingClientRect().width ?? viewport.clientWidth);
|
|
@@ -14615,18 +14695,22 @@ function TableInner(props, ref) {
|
|
|
14615
14695
|
if (element.scrollLeft > maxLeft) element.scrollLeft = maxLeft > 1 ? maxLeft : 0;
|
|
14616
14696
|
const logicalScrollLeft = Math.min(element.scrollLeft, maxLeft);
|
|
14617
14697
|
const maxTop = Math.max(0, element.scrollHeight - element.clientHeight);
|
|
14618
|
-
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14698
|
+
const setFlag = (key, value) => {
|
|
14699
|
+
const next = String(value);
|
|
14700
|
+
if (root.dataset[key] !== next) root.dataset[key] = next;
|
|
14701
|
+
};
|
|
14702
|
+
setFlag("overflowX", maxLeft > 1);
|
|
14703
|
+
setFlag("overflowY", maxTop > 1);
|
|
14704
|
+
const horizontalTrackElement = root.querySelector(".sia-table__scrollbar--horizontal");
|
|
14705
|
+
const verticalTrackElement = root.querySelector(".sia-table__scrollbar--vertical");
|
|
14706
|
+
const horizontalTrack = horizontalTrackElement?.clientWidth ?? 0;
|
|
14707
|
+
const verticalTrack = verticalTrackElement?.clientHeight ?? 0;
|
|
14622
14708
|
const horizontalThumb = maxLeft > 1 ? Math.min(horizontalTrack, Math.max(36, horizontalTrack * element.clientWidth / horizontalContentWidth)) : 0;
|
|
14623
14709
|
const verticalThumb = maxTop > 1 ? Math.min(verticalTrack, Math.max(36, verticalTrack * element.clientHeight / element.scrollHeight)) : 0;
|
|
14624
14710
|
const horizontalPosition = maxLeft > 0 ? logicalScrollLeft / maxLeft * Math.max(0, horizontalTrack - horizontalThumb) : 0;
|
|
14625
14711
|
const verticalPosition = maxTop > 0 ? element.scrollTop / maxTop * Math.max(0, verticalTrack - verticalThumb) : 0;
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
root.dataset.overflowX = String(maxLeft > 1);
|
|
14629
|
-
root.dataset.overflowY = String(maxTop > 1);
|
|
14712
|
+
setFlag("scrolledLeft", logicalScrollLeft > 1);
|
|
14713
|
+
setFlag("scrolledRight", maxLeft > 1 && logicalScrollLeft < maxLeft - 1);
|
|
14630
14714
|
const viewportRect = element.getBoundingClientRect();
|
|
14631
14715
|
const leftEdge = root.querySelector(".sia-table__header-cell.sia-table__cell--fixed-left-edge");
|
|
14632
14716
|
const rightEdge = root.querySelector(".sia-table__header-cell.sia-table__cell--fixed-right-edge");
|
|
@@ -14638,10 +14722,10 @@ function TableInner(props, ref) {
|
|
|
14638
14722
|
const rightEdgeRect = rightEdge.getBoundingClientRect();
|
|
14639
14723
|
root.style.setProperty("--sia-table-fixed-right-width", `${Math.max(0, viewportRect.right - rightEdgeRect.left)}px`);
|
|
14640
14724
|
}
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14725
|
+
horizontalTrackElement?.style.setProperty("--sia-table-scrollbar-x-size", `${horizontalThumb}px`);
|
|
14726
|
+
horizontalTrackElement?.style.setProperty("--sia-table-scrollbar-x-position", `${horizontalPosition}px`);
|
|
14727
|
+
verticalTrackElement?.style.setProperty("--sia-table-scrollbar-y-size", `${verticalThumb}px`);
|
|
14728
|
+
verticalTrackElement?.style.setProperty("--sia-table-scrollbar-y-position", `${verticalPosition}px`);
|
|
14645
14729
|
}, []);
|
|
14646
14730
|
(0, import_react51.useEffect)(() => {
|
|
14647
14731
|
const element = scrollRef.current;
|
|
@@ -14662,19 +14746,33 @@ function TableInner(props, ref) {
|
|
|
14662
14746
|
const orderedColumns = (0, import_react51.useMemo)(() => sortTableColumnsByFixed(pipeline.columns), [pipeline.columns]);
|
|
14663
14747
|
const leafColumns = (0, import_react51.useMemo)(() => flattenTableColumns(orderedColumns), [orderedColumns]);
|
|
14664
14748
|
const headerRows = (0, import_react51.useMemo)(() => buildHeaderRows(orderedColumns), [orderedColumns]);
|
|
14749
|
+
const measuredCells = (0, import_react51.useRef)(/* @__PURE__ */ new WeakSet());
|
|
14750
|
+
const autoWidthSignature = leafColumns.map((column) => `${column.key}:${column.autoWidth}:${resizedWidths[column.key] ?? ""}`).join("|");
|
|
14751
|
+
(0, import_react51.useEffect)(() => {
|
|
14752
|
+
measuredCells.current = /* @__PURE__ */ new WeakSet();
|
|
14753
|
+
setAutoColumnWidths({});
|
|
14754
|
+
}, [dataSource, baseColumns, size, autoWidthSignature]);
|
|
14665
14755
|
(0, import_react51.useEffect)(() => {
|
|
14666
14756
|
const autoWidthColumns = leafColumns.filter((column) => column.autoWidth && resizedWidths[column.key] === void 0);
|
|
14667
14757
|
const root = rootRef.current;
|
|
14668
14758
|
if (!root || autoWidthColumns.length === 0) return;
|
|
14669
14759
|
const frame = window.requestAnimationFrame(() => {
|
|
14670
14760
|
const measurements = {};
|
|
14671
|
-
const
|
|
14761
|
+
const columnsByKey = new Map(autoWidthColumns.map((column) => [column.key, column]));
|
|
14762
|
+
const cells = [...root.querySelectorAll("th[data-column-key], td[data-column-key]")].filter((cell) => columnsByKey.has(cell.dataset.columnKey) && !measuredCells.current.has(cell));
|
|
14763
|
+
if (cells.length === 0) return;
|
|
14764
|
+
const prepared = cells.map((cell) => ({ cell, node: prepareTableCellMeasurement(cell) }));
|
|
14765
|
+
for (const { cell, node } of prepared) {
|
|
14766
|
+
const key = cell.dataset.columnKey;
|
|
14767
|
+
const style2 = window.getComputedStyle(cell);
|
|
14768
|
+
const padding = (Number.parseFloat(style2.paddingLeft) || 0) + (Number.parseFloat(style2.paddingRight) || 0) + (Number.parseFloat(style2.borderLeftWidth) || 0) + (Number.parseFloat(style2.borderRightWidth) || 0);
|
|
14769
|
+
measurements[key] = Math.max(measurements[key] ?? 0, node ? Math.max(node.scrollWidth, node.getBoundingClientRect().width) + padding : cell.scrollWidth);
|
|
14770
|
+
measuredCells.current.add(cell);
|
|
14771
|
+
}
|
|
14772
|
+
prepared.forEach(({ node }) => node?.remove());
|
|
14672
14773
|
for (const column of autoWidthColumns) {
|
|
14673
|
-
|
|
14674
|
-
|
|
14675
|
-
if (cell.dataset.columnKey !== column.key) continue;
|
|
14676
|
-
width = Math.max(width, measureTableCellContentWidth(cell));
|
|
14677
|
-
}
|
|
14774
|
+
if (measurements[column.key] === void 0) continue;
|
|
14775
|
+
const width = Math.max(column.minWidth ?? 56, autoColumnWidths[column.key] ?? 0, measurements[column.key]);
|
|
14678
14776
|
measurements[column.key] = Math.ceil(Math.min(column.maxWidth ?? Number.POSITIVE_INFINITY, width));
|
|
14679
14777
|
}
|
|
14680
14778
|
setAutoColumnWidths((previous) => {
|
|
@@ -14730,6 +14828,21 @@ function TableInner(props, ref) {
|
|
|
14730
14828
|
const renderedRows = pipeline.rows.slice(startIndex, endIndex);
|
|
14731
14829
|
const topSpacer = shouldVirtualize ? startIndex * rowHeight : 0;
|
|
14732
14830
|
const bottomSpacer = shouldVirtualize ? Math.max(0, (pipeline.rows.length - endIndex) * rowHeight) : 0;
|
|
14831
|
+
const rowElements = (0, import_react51.useMemo)(() => /* @__PURE__ */ new Map(), [
|
|
14832
|
+
dataSource,
|
|
14833
|
+
baseColumns,
|
|
14834
|
+
sortedPlugins,
|
|
14835
|
+
pluginStates,
|
|
14836
|
+
autoColumnWidths,
|
|
14837
|
+
viewportWidth,
|
|
14838
|
+
rowHeight,
|
|
14839
|
+
striped,
|
|
14840
|
+
rowClassName,
|
|
14841
|
+
getRowKey,
|
|
14842
|
+
onRowClick,
|
|
14843
|
+
onRowDoubleClick,
|
|
14844
|
+
onCellContextMenu
|
|
14845
|
+
]);
|
|
14733
14846
|
const toolbarStart = sortedPlugins.map((plugin) => {
|
|
14734
14847
|
const content = plugin.renderToolbarStart?.(getContext(plugin));
|
|
14735
14848
|
return content ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react51.Fragment, { children: content }, `toolbar-start-${plugin.id}`) : null;
|
|
@@ -14756,9 +14869,9 @@ function TableInner(props, ref) {
|
|
|
14756
14869
|
};
|
|
14757
14870
|
const handleScroll = (0, import_react51.useCallback)((event) => {
|
|
14758
14871
|
const element = event.currentTarget;
|
|
14759
|
-
if (shouldVirtualize) setScrollTop(element.scrollTop);
|
|
14872
|
+
if (shouldVirtualize) setScrollTop((previous) => Math.floor(previous / rowHeight) === Math.floor(element.scrollTop / rowHeight) ? previous : element.scrollTop);
|
|
14760
14873
|
updateScrollMetrics();
|
|
14761
|
-
}, [shouldVirtualize, updateScrollMetrics]);
|
|
14874
|
+
}, [shouldVirtualize, rowHeight, updateScrollMetrics]);
|
|
14762
14875
|
const handleScrollbarPointerDown = (0, import_react51.useCallback)((axis, event, track = event.currentTarget) => {
|
|
14763
14876
|
const element = scrollRef.current;
|
|
14764
14877
|
const thumb = track.firstElementChild;
|
|
@@ -14979,10 +15092,12 @@ function TableInner(props, ref) {
|
|
|
14979
15092
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("tbody", { children: [
|
|
14980
15093
|
topSpacer > 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("tr", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("td", { colSpan: leafColumns.length, style: { height: topSpacer, padding: 0, border: 0 } }) }) : null,
|
|
14981
15094
|
renderedRows.map((row, offset) => {
|
|
15095
|
+
const cached = rowElements.get(row.key);
|
|
15096
|
+
if (cached) return cached;
|
|
14982
15097
|
const rowIndex = startIndex + offset;
|
|
14983
15098
|
const pluginClasses = sortedPlugins.map((plugin) => plugin.getRowClassName?.(row, getContext(plugin))).filter(Boolean).join(" ");
|
|
14984
15099
|
const customClass = typeof rowClassName === "function" ? rowClassName(row.record, row.sourceIndex) : rowClassName ?? "";
|
|
14985
|
-
|
|
15100
|
+
const element = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14986
15101
|
TableBodyRow,
|
|
14987
15102
|
{
|
|
14988
15103
|
row,
|
|
@@ -15028,6 +15143,8 @@ function TableInner(props, ref) {
|
|
|
15028
15143
|
},
|
|
15029
15144
|
row.key
|
|
15030
15145
|
);
|
|
15146
|
+
rowElements.set(row.key, element);
|
|
15147
|
+
return element;
|
|
15031
15148
|
}),
|
|
15032
15149
|
bottomSpacer > 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("tr", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("td", { colSpan: leafColumns.length, style: { height: bottomSpacer, padding: 0, border: 0 } }) }) : null
|
|
15033
15150
|
] }),
|
|
@@ -15213,13 +15330,13 @@ function TypographyContent({
|
|
|
15213
15330
|
(0, import_react53.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
15214
15331
|
(0, import_react53.useLayoutEffect)(() => {
|
|
15215
15332
|
const element = contentRef.current;
|
|
15216
|
-
if (!element || !ellipsis || editing || expanded) return;
|
|
15333
|
+
if (!element || !ellipsis || !expandable || editing || expanded) return;
|
|
15217
15334
|
const measure = () => setOverflow(element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
|
|
15218
15335
|
measure();
|
|
15219
15336
|
const observer = new ResizeObserver(measure);
|
|
15220
15337
|
observer.observe(element);
|
|
15221
15338
|
return () => observer.disconnect();
|
|
15222
|
-
}, [content, ellipsis, rows, editing, expanded]);
|
|
15339
|
+
}, [content, ellipsis, rows, expandable, editing, expanded]);
|
|
15223
15340
|
async function copy() {
|
|
15224
15341
|
try {
|
|
15225
15342
|
const text = typeof copyable === "object" ? copyable.text ?? contentRef.current?.textContent ?? "" : contentRef.current?.textContent ?? "";
|
package/dist/index.css
CHANGED
|
@@ -2541,6 +2541,71 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
2541
2541
|
.sia-card--collapsed .sia-card__header {
|
|
2542
2542
|
border-bottom-color: transparent;
|
|
2543
2543
|
}
|
|
2544
|
+
.sia-card--selectable {
|
|
2545
|
+
position: relative;
|
|
2546
|
+
cursor: pointer;
|
|
2547
|
+
}
|
|
2548
|
+
.sia-card__selected-corner {
|
|
2549
|
+
position: absolute;
|
|
2550
|
+
top: 0;
|
|
2551
|
+
right: 0;
|
|
2552
|
+
width: 40px;
|
|
2553
|
+
height: 40px;
|
|
2554
|
+
background: var(--sia-color-primary);
|
|
2555
|
+
color: white;
|
|
2556
|
+
clip-path: polygon(0 0, 100% 0, 100% 100%);
|
|
2557
|
+
border-top-right-radius: var(--sia-radius);
|
|
2558
|
+
pointer-events: none;
|
|
2559
|
+
z-index: 1;
|
|
2560
|
+
}
|
|
2561
|
+
.sia-card__selected-corner > .sia-icon {
|
|
2562
|
+
position: absolute;
|
|
2563
|
+
top: 4px;
|
|
2564
|
+
right: 4px;
|
|
2565
|
+
}
|
|
2566
|
+
.sia-card--selectable[aria-disabled=true] {
|
|
2567
|
+
cursor: default;
|
|
2568
|
+
}
|
|
2569
|
+
.sia-card.sia-card--selected {
|
|
2570
|
+
border-color: var(--sia-color-primary);
|
|
2571
|
+
box-shadow: inset 0 0 0 1px var(--sia-color-primary);
|
|
2572
|
+
}
|
|
2573
|
+
.sia-card--selectable:focus-visible {
|
|
2574
|
+
outline: 2px solid var(--sia-color-primary);
|
|
2575
|
+
outline-offset: 2px;
|
|
2576
|
+
}
|
|
2577
|
+
.sia-card--hover-actions {
|
|
2578
|
+
position: relative;
|
|
2579
|
+
overflow: hidden;
|
|
2580
|
+
}
|
|
2581
|
+
.sia-card__hover-actions {
|
|
2582
|
+
position: absolute;
|
|
2583
|
+
inset: auto 0 0;
|
|
2584
|
+
padding: 8px 16px;
|
|
2585
|
+
background: var(--sia-color-surface);
|
|
2586
|
+
border-top: 1px solid var(--sia-color-border);
|
|
2587
|
+
transform: translateY(100%);
|
|
2588
|
+
visibility: hidden;
|
|
2589
|
+
transition: transform 180ms ease, visibility 180ms;
|
|
2590
|
+
}
|
|
2591
|
+
.sia-card--hover-actions:hover > .sia-card__hover-actions,
|
|
2592
|
+
.sia-card--hover-actions:has(:focus-visible) > .sia-card__hover-actions,
|
|
2593
|
+
.sia-card--hover-actions:focus-visible > .sia-card__hover-actions {
|
|
2594
|
+
transform: translateY(0);
|
|
2595
|
+
visibility: visible;
|
|
2596
|
+
}
|
|
2597
|
+
@media (hover: none) {
|
|
2598
|
+
.sia-card__hover-actions {
|
|
2599
|
+
position: static;
|
|
2600
|
+
transform: none;
|
|
2601
|
+
visibility: visible;
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2605
|
+
.sia-card__hover-actions {
|
|
2606
|
+
transition: none;
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2544
2609
|
.sia-alert {
|
|
2545
2610
|
display: flex;
|
|
2546
2611
|
align-items: flex-start;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-CADzSGab.cjs';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-CADzSGab.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
@@ -2134,6 +2134,7 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2134
2134
|
cellSelection?: boolean;
|
|
2135
2135
|
/**
|
|
2136
2136
|
* 是否显示序号列,默认从 1 开始;搭配分页插件时按页码连续编号,存在勾选列时放在其后。
|
|
2137
|
+
* 序号列固定在业务列之前(勾选列之后),不参与列设置中的排序、显隐和固定位置调整。
|
|
2137
2138
|
* 显式传入 createIndexPlugin 可自定义标题、宽度和起始编号,不会重复生成序号列;false 时禁用序号插件(包括显式传入的插件)。
|
|
2138
2139
|
* @defaultValue true
|
|
2139
2140
|
*/
|
|
@@ -2556,7 +2557,7 @@ interface TableIndexPluginOptions {
|
|
|
2556
2557
|
/** 序号列的起始编号。 */
|
|
2557
2558
|
startIndex?: number;
|
|
2558
2559
|
}
|
|
2559
|
-
/** 创建表格序号列插件。Table 默认内置;显式加入 plugins 可覆盖标题、宽度和起始编号,不重复加载。Table 的 showIndex=false
|
|
2560
|
+
/** 创建表格序号列插件。Table 默认内置;显式加入 plugins 可覆盖标题、宽度和起始编号,不重复加载。Table 的 showIndex=false 时禁用。序号固定在业务列之前(有勾选列时位于其后),不参与列设置。 */
|
|
2560
2561
|
declare function createIndexPlugin<T extends Record<string, unknown>>(options?: TableIndexPluginOptions): TablePlugin<T, undefined>;
|
|
2561
2562
|
/** TableTree的插件配置。 */
|
|
2562
2563
|
interface TableTreePluginOptions<T> {
|
|
@@ -2709,7 +2710,7 @@ interface TableColumnSettingApi {
|
|
|
2709
2710
|
/** 应用传入的配置;是否持久化由方法参数或插件选项控制。 */
|
|
2710
2711
|
apply: (settings: readonly TableColumnSettingItem[]) => void;
|
|
2711
2712
|
}
|
|
2712
|
-
/** 创建表格列设置和持久化插件。将返回值加入 Table 的 plugins
|
|
2713
|
+
/** 创建表格列设置和持久化插件。将返回值加入 Table 的 plugins 后生效;序号和勾选附加列不显示在设置中,不参与业务列排序、显隐、固定位置与宽度配置,旧存储中的附加列配置会被忽略。 */
|
|
2713
2714
|
declare function createColumnSettingPlugin<T extends Record<string, unknown>>(options?: TableColumnSettingPluginOptions<T>): TablePlugin<T, ColumnSettingState, TableColumnSettingApi>;
|
|
2714
2715
|
/** 创建使用 localStorage 持久化表格设置的适配器,按模块及业务标识隔离配置。 */
|
|
2715
2716
|
declare function createLocalStorageTableSettingsAdapter(prefix?: string): TableSettingsAdapter;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-wsymjzoC.js';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-wsymjzoC.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
@@ -2134,6 +2134,7 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2134
2134
|
cellSelection?: boolean;
|
|
2135
2135
|
/**
|
|
2136
2136
|
* 是否显示序号列,默认从 1 开始;搭配分页插件时按页码连续编号,存在勾选列时放在其后。
|
|
2137
|
+
* 序号列固定在业务列之前(勾选列之后),不参与列设置中的排序、显隐和固定位置调整。
|
|
2137
2138
|
* 显式传入 createIndexPlugin 可自定义标题、宽度和起始编号,不会重复生成序号列;false 时禁用序号插件(包括显式传入的插件)。
|
|
2138
2139
|
* @defaultValue true
|
|
2139
2140
|
*/
|
|
@@ -2556,7 +2557,7 @@ interface TableIndexPluginOptions {
|
|
|
2556
2557
|
/** 序号列的起始编号。 */
|
|
2557
2558
|
startIndex?: number;
|
|
2558
2559
|
}
|
|
2559
|
-
/** 创建表格序号列插件。Table 默认内置;显式加入 plugins 可覆盖标题、宽度和起始编号,不重复加载。Table 的 showIndex=false
|
|
2560
|
+
/** 创建表格序号列插件。Table 默认内置;显式加入 plugins 可覆盖标题、宽度和起始编号,不重复加载。Table 的 showIndex=false 时禁用。序号固定在业务列之前(有勾选列时位于其后),不参与列设置。 */
|
|
2560
2561
|
declare function createIndexPlugin<T extends Record<string, unknown>>(options?: TableIndexPluginOptions): TablePlugin<T, undefined>;
|
|
2561
2562
|
/** TableTree的插件配置。 */
|
|
2562
2563
|
interface TableTreePluginOptions<T> {
|
|
@@ -2709,7 +2710,7 @@ interface TableColumnSettingApi {
|
|
|
2709
2710
|
/** 应用传入的配置;是否持久化由方法参数或插件选项控制。 */
|
|
2710
2711
|
apply: (settings: readonly TableColumnSettingItem[]) => void;
|
|
2711
2712
|
}
|
|
2712
|
-
/** 创建表格列设置和持久化插件。将返回值加入 Table 的 plugins
|
|
2713
|
+
/** 创建表格列设置和持久化插件。将返回值加入 Table 的 plugins 后生效;序号和勾选附加列不显示在设置中,不参与业务列排序、显隐、固定位置与宽度配置,旧存储中的附加列配置会被忽略。 */
|
|
2713
2714
|
declare function createColumnSettingPlugin<T extends Record<string, unknown>>(options?: TableColumnSettingPluginOptions<T>): TablePlugin<T, ColumnSettingState, TableColumnSettingApi>;
|
|
2714
2715
|
/** 创建使用 localStorage 持久化表格设置的适配器,按模块及业务标识隔离配置。 */
|
|
2715
2716
|
declare function createLocalStorageTableSettingsAdapter(prefix?: string): TableSettingsAdapter;
|