@sia.soul/sia-react-ui 0.1.41 → 0.1.43

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.
@@ -95,6 +95,12 @@ function Card({
95
95
  title,
96
96
  description,
97
97
  extra,
98
+ selectable = false,
99
+ selected,
100
+ defaultSelected = false,
101
+ disabled = false,
102
+ onSelectedChange,
103
+ hoverActions,
98
104
  accent,
99
105
  accentColor,
100
106
  collapsible = false,
@@ -107,9 +113,19 @@ function Card({
107
113
  className = "",
108
114
  style,
109
115
  children,
116
+ onClick,
117
+ onKeyDown,
110
118
  ...props
111
119
  }) {
112
120
  const [internalCollapsed, setInternalCollapsed] = useState2(defaultCollapsed);
121
+ const [internalSelected, setInternalSelected] = useState2(defaultSelected);
122
+ const isSelected = selected ?? internalSelected;
123
+ function toggleSelected() {
124
+ if (!selectable || disabled) return;
125
+ const next = !isSelected;
126
+ if (selected === void 0) setInternalSelected(next);
127
+ onSelectedChange?.(next);
128
+ }
113
129
  const isCollapsed = collapsed ?? internalCollapsed;
114
130
  const hasHeader = title || extra || collapsible;
115
131
  const mergedStyle = accentColor ? { "--sia-card-accent": accentColor, ...style } : style;
@@ -123,19 +139,46 @@ function Card({
123
139
  accent || accentColor ? /* @__PURE__ */ jsx2("span", { className: `sia-card__accent${accent ? ` sia-card__accent--${accent}` : ""}`, "aria-hidden": "true" }) : null,
124
140
  title ? /* @__PURE__ */ jsx2("h3", { className: "sia-card__title", children: title }) : null
125
141
  ] });
126
- return /* @__PURE__ */ jsxs2("section", { className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""} ${className}`.trim(), style: mergedStyle, ...withTitleTooltip(props), children: [
127
- hasHeader ? /* @__PURE__ */ jsxs2("header", { className: "sia-card__header", children: [
128
- collapsible ? /* @__PURE__ */ jsxs2("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
129
- heading,
130
- /* @__PURE__ */ jsx2(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
131
- ] }) : heading,
132
- extra ? /* @__PURE__ */ jsx2("div", { className: "sia-card__extra", children: extra }) : null
133
- ] }) : null,
134
- !isCollapsed ? /* @__PURE__ */ jsxs2(Fragment, { children: [
135
- description ? /* @__PURE__ */ jsx2("p", { className: "sia-card__description", children: description }) : null,
136
- /* @__PURE__ */ jsx2("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children })
137
- ] }) : null
138
- ] });
142
+ return /* @__PURE__ */ jsxs2(
143
+ "section",
144
+ {
145
+ className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
146
+ style: mergedStyle,
147
+ role: selectable ? "checkbox" : void 0,
148
+ "aria-checked": selectable ? isSelected : void 0,
149
+ "aria-disabled": selectable ? disabled : void 0,
150
+ tabIndex: selectable && !disabled ? 0 : void 0,
151
+ ...withTitleTooltip(props),
152
+ onClick: (event) => {
153
+ onClick?.(event);
154
+ const target = event.target;
155
+ const interactive = target.closest('button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="radio"], [role="switch"], [contenteditable="true"], [tabindex]');
156
+ if (!event.defaultPrevented && (!interactive || interactive === event.currentTarget)) toggleSelected();
157
+ },
158
+ onKeyDown: (event) => {
159
+ onKeyDown?.(event);
160
+ if (!event.defaultPrevented && event.target === event.currentTarget && selectable && (event.key === "Enter" || event.key === " ")) {
161
+ event.preventDefault();
162
+ toggleSelected();
163
+ }
164
+ },
165
+ children: [
166
+ selectable && isSelected ? /* @__PURE__ */ jsx2("span", { className: "sia-card__selected-corner", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(Icon, { name: "check", size: 16 }) }) : null,
167
+ hasHeader ? /* @__PURE__ */ jsxs2("header", { className: "sia-card__header", children: [
168
+ collapsible ? /* @__PURE__ */ jsxs2("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
169
+ heading,
170
+ /* @__PURE__ */ jsx2(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
171
+ ] }) : heading,
172
+ extra ? /* @__PURE__ */ jsx2("div", { className: "sia-card__extra", children: extra }) : null
173
+ ] }) : null,
174
+ !isCollapsed ? /* @__PURE__ */ jsxs2(Fragment, { children: [
175
+ description ? /* @__PURE__ */ jsx2("p", { className: "sia-card__description", children: description }) : null,
176
+ /* @__PURE__ */ jsx2("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children }),
177
+ hoverActions ? /* @__PURE__ */ jsx2("div", { className: "sia-card__hover-actions", onClick: (event) => event.stopPropagation(), children: hoverActions }) : null
178
+ ] }) : null
179
+ ]
180
+ }
181
+ );
139
182
  }
140
183
 
141
184
  // src/components/Tag.tsx
@@ -52,6 +52,27 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
52
52
  description?: ReactNode;
53
53
  /** 主体之外的补充内容或操作区。 */
54
54
  extra?: ReactNode;
55
+ /**
56
+ * 点击卡片非交互区域切换选中,支持 Enter 和空格键;选中时显示右上角三角勾选标记。
57
+ * @defaultValue false
58
+ */
59
+ selectable?: boolean;
60
+ /** 受控选中状态,需在 onSelectedChange 中更新。 */
61
+ selected?: boolean;
62
+ /**
63
+ * 非受控初始选中状态。
64
+ * @defaultValue false
65
+ */
66
+ defaultSelected?: boolean;
67
+ /**
68
+ * 禁止切换选中,不禁用卡片内独立操作。
69
+ * @defaultValue false
70
+ */
71
+ disabled?: boolean;
72
+ /** 用户切换选中时通知新的布尔状态;禁用时不触发。 */
73
+ onSelectedChange?: (selected: boolean) => void;
74
+ /** 鼠标移入或键盘聚焦卡片时从底部滑入的操作区;触屏设备始终显示。 */
75
+ hoverActions?: ReactNode;
55
76
  /** 强调装饰样式。 */
56
77
  accent?: CardAccent;
57
78
  /** 强调装饰的颜色。 */
@@ -81,7 +102,7 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
81
102
  bodyStyle?: CSSProperties;
82
103
  }
83
104
  /** 卡片组件。 */
84
- declare function Card({ title, description, extra, accent, accentColor, collapsible, collapsed, defaultCollapsed, onCollapsedChange, bodyHeight, bodyClassName, bodyStyle, className, style, children, ...props }: CardProps): react.JSX.Element;
105
+ declare function Card({ title, description, extra, selectable, selected, defaultSelected, disabled, onSelectedChange, hoverActions, accent, accentColor, collapsible, collapsed, defaultCollapsed, onCollapsedChange, bodyHeight, bodyClassName, bodyStyle, className, style, children, onClick, onKeyDown, ...props }: CardProps): react.JSX.Element;
85
106
 
86
107
  declare const iconPaths: {
87
108
  "notepad-file": react.JSX.Element;
@@ -52,6 +52,27 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
52
52
  description?: ReactNode;
53
53
  /** 主体之外的补充内容或操作区。 */
54
54
  extra?: ReactNode;
55
+ /**
56
+ * 点击卡片非交互区域切换选中,支持 Enter 和空格键;选中时显示右上角三角勾选标记。
57
+ * @defaultValue false
58
+ */
59
+ selectable?: boolean;
60
+ /** 受控选中状态,需在 onSelectedChange 中更新。 */
61
+ selected?: boolean;
62
+ /**
63
+ * 非受控初始选中状态。
64
+ * @defaultValue false
65
+ */
66
+ defaultSelected?: boolean;
67
+ /**
68
+ * 禁止切换选中,不禁用卡片内独立操作。
69
+ * @defaultValue false
70
+ */
71
+ disabled?: boolean;
72
+ /** 用户切换选中时通知新的布尔状态;禁用时不触发。 */
73
+ onSelectedChange?: (selected: boolean) => void;
74
+ /** 鼠标移入或键盘聚焦卡片时从底部滑入的操作区;触屏设备始终显示。 */
75
+ hoverActions?: ReactNode;
55
76
  /** 强调装饰样式。 */
56
77
  accent?: CardAccent;
57
78
  /** 强调装饰的颜色。 */
@@ -81,7 +102,7 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
81
102
  bodyStyle?: CSSProperties;
82
103
  }
83
104
  /** 卡片组件。 */
84
- declare function Card({ title, description, extra, accent, accentColor, collapsible, collapsed, defaultCollapsed, onCollapsedChange, bodyHeight, bodyClassName, bodyStyle, className, style, children, ...props }: CardProps): react.JSX.Element;
105
+ declare function Card({ title, description, extra, selectable, selected, defaultSelected, disabled, onSelectedChange, hoverActions, accent, accentColor, collapsible, collapsed, defaultCollapsed, onCollapsedChange, bodyHeight, bodyClassName, bodyStyle, className, style, children, onClick, onKeyDown, ...props }: CardProps): react.JSX.Element;
85
106
 
86
107
  declare const iconPaths: {
87
108
  "notepad-file": react.JSX.Element;
package/dist/core.cjs CHANGED
@@ -1738,6 +1738,12 @@ function Card({
1738
1738
  title,
1739
1739
  description,
1740
1740
  extra,
1741
+ selectable = false,
1742
+ selected,
1743
+ defaultSelected = false,
1744
+ disabled = false,
1745
+ onSelectedChange,
1746
+ hoverActions,
1741
1747
  accent,
1742
1748
  accentColor,
1743
1749
  collapsible = false,
@@ -1750,9 +1756,19 @@ function Card({
1750
1756
  className = "",
1751
1757
  style,
1752
1758
  children,
1759
+ onClick,
1760
+ onKeyDown,
1753
1761
  ...props
1754
1762
  }) {
1755
1763
  const [internalCollapsed, setInternalCollapsed] = (0, import_react9.useState)(defaultCollapsed);
1764
+ const [internalSelected, setInternalSelected] = (0, import_react9.useState)(defaultSelected);
1765
+ const isSelected = selected ?? internalSelected;
1766
+ function toggleSelected() {
1767
+ if (!selectable || disabled) return;
1768
+ const next = !isSelected;
1769
+ if (selected === void 0) setInternalSelected(next);
1770
+ onSelectedChange?.(next);
1771
+ }
1756
1772
  const isCollapsed = collapsed ?? internalCollapsed;
1757
1773
  const hasHeader = title || extra || collapsible;
1758
1774
  const mergedStyle = accentColor ? { "--sia-card-accent": accentColor, ...style } : style;
@@ -1766,19 +1782,46 @@ function Card({
1766
1782
  accent || accentColor ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `sia-card__accent${accent ? ` sia-card__accent--${accent}` : ""}`, "aria-hidden": "true" }) : null,
1767
1783
  title ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "sia-card__title", children: title }) : null
1768
1784
  ] });
1769
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""} ${className}`.trim(), style: mergedStyle, ...withTitleTooltip(props), children: [
1770
- hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("header", { className: "sia-card__header", children: [
1771
- collapsible ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
1772
- heading,
1773
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
1774
- ] }) : heading,
1775
- extra ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "sia-card__extra", children: extra }) : null
1776
- ] }) : null,
1777
- !isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1778
- description ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "sia-card__description", children: description }) : null,
1779
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children })
1780
- ] }) : null
1781
- ] });
1785
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1786
+ "section",
1787
+ {
1788
+ className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
1789
+ style: mergedStyle,
1790
+ role: selectable ? "checkbox" : void 0,
1791
+ "aria-checked": selectable ? isSelected : void 0,
1792
+ "aria-disabled": selectable ? disabled : void 0,
1793
+ tabIndex: selectable && !disabled ? 0 : void 0,
1794
+ ...withTitleTooltip(props),
1795
+ onClick: (event) => {
1796
+ onClick?.(event);
1797
+ const target = event.target;
1798
+ const interactive = target.closest('button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="radio"], [role="switch"], [contenteditable="true"], [tabindex]');
1799
+ if (!event.defaultPrevented && (!interactive || interactive === event.currentTarget)) toggleSelected();
1800
+ },
1801
+ onKeyDown: (event) => {
1802
+ onKeyDown?.(event);
1803
+ if (!event.defaultPrevented && event.target === event.currentTarget && selectable && (event.key === "Enter" || event.key === " ")) {
1804
+ event.preventDefault();
1805
+ toggleSelected();
1806
+ }
1807
+ },
1808
+ children: [
1809
+ selectable && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sia-card__selected-corner", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "check", size: 16 }) }) : null,
1810
+ hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("header", { className: "sia-card__header", children: [
1811
+ collapsible ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
1812
+ heading,
1813
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
1814
+ ] }) : heading,
1815
+ extra ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "sia-card__extra", children: extra }) : null
1816
+ ] }) : null,
1817
+ !isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1818
+ description ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "sia-card__description", children: description }) : null,
1819
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children }),
1820
+ hoverActions ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "sia-card__hover-actions", onClick: (event) => event.stopPropagation(), children: hoverActions }) : null
1821
+ ] }) : null
1822
+ ]
1823
+ }
1824
+ );
1782
1825
  }
1783
1826
 
1784
1827
  // src/components/Tag.tsx
package/dist/core.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;
@@ -4865,7 +4930,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4865
4930
  display: flex;
4866
4931
  flex-wrap: wrap;
4867
4932
  align-items: center;
4868
- gap: var(--sia-query-field-gap, 12px);
4933
+ gap: var(--sia-query-field-gap, 6px);
4869
4934
  padding-top: 8px;
4870
4935
  }
4871
4936
  .sia-query-form__field {
@@ -4876,7 +4941,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4876
4941
  max-width: 100%;
4877
4942
  }
4878
4943
  .sia-query-form__field:has(.sia-picker-range-control, .sia-time-range, .sia-select-date-range, .sia-space-compact:not(.sia-space-compact--vertical) > :nth-child(2)) {
4879
- --sia-query-item-width: calc(var(--sia-query-field-width, 220px) + var(--sia-query-field-width, 220px) + var(--sia-query-field-gap, 12px));
4944
+ --sia-query-item-width: calc(var(--sia-query-field-width, 220px) + var(--sia-query-field-width, 220px) + var(--sia-query-field-gap, 6px));
4880
4945
  }
4881
4946
  .sia-query-form__field :is(.sia-picker-range-control, .sia-time-range, .sia-select-date-range, .sia-space-compact:not(.sia-space-compact--vertical)) {
4882
4947
  width: 100%;
package/dist/core.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, 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, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-C2IieVNm.cjs';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, 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, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-CADzSGab.cjs';
2
2
  export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-YJbT-MF1.cjs';
3
3
  import 'react';
4
4
  import './shared-Bx4B28Wh.cjs';
package/dist/core.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, 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, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-ZmKnvCFV.js';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, 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, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-wsymjzoC.js';
2
2
  export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-CCrPqULn.js';
3
3
  import 'react';
4
4
  import './shared-Bx4B28Wh.js';
package/dist/core.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  Typography,
11
11
  Upload,
12
12
  message
13
- } from "./chunk-IPDCEXQO.js";
13
+ } from "./chunk-ORLXJLLW.js";
14
14
  import "./chunk-SMCYEPBL.js";
15
15
  import {
16
16
  Modal,
package/dist/index.cjs CHANGED
@@ -5071,6 +5071,12 @@ function Card({
5071
5071
  title,
5072
5072
  description,
5073
5073
  extra,
5074
+ selectable = false,
5075
+ selected,
5076
+ defaultSelected = false,
5077
+ disabled = false,
5078
+ onSelectedChange,
5079
+ hoverActions,
5074
5080
  accent,
5075
5081
  accentColor,
5076
5082
  collapsible = false,
@@ -5083,9 +5089,19 @@ function Card({
5083
5089
  className = "",
5084
5090
  style,
5085
5091
  children,
5092
+ onClick,
5093
+ onKeyDown,
5086
5094
  ...props
5087
5095
  }) {
5088
5096
  const [internalCollapsed, setInternalCollapsed] = (0, import_react24.useState)(defaultCollapsed);
5097
+ const [internalSelected, setInternalSelected] = (0, import_react24.useState)(defaultSelected);
5098
+ const isSelected = selected ?? internalSelected;
5099
+ function toggleSelected() {
5100
+ if (!selectable || disabled) return;
5101
+ const next = !isSelected;
5102
+ if (selected === void 0) setInternalSelected(next);
5103
+ onSelectedChange?.(next);
5104
+ }
5089
5105
  const isCollapsed = collapsed ?? internalCollapsed;
5090
5106
  const hasHeader = title || extra || collapsible;
5091
5107
  const mergedStyle = accentColor ? { "--sia-card-accent": accentColor, ...style } : style;
@@ -5099,19 +5115,46 @@ function Card({
5099
5115
  accent || accentColor ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: `sia-card__accent${accent ? ` sia-card__accent--${accent}` : ""}`, "aria-hidden": "true" }) : null,
5100
5116
  title ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "sia-card__title", children: title }) : null
5101
5117
  ] });
5102
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""} ${className}`.trim(), style: mergedStyle, ...withTitleTooltip(props), children: [
5103
- hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "sia-card__header", children: [
5104
- collapsible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
5105
- heading,
5106
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
5107
- ] }) : heading,
5108
- extra ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "sia-card__extra", children: extra }) : null
5109
- ] }) : null,
5110
- !isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
5111
- description ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "sia-card__description", children: description }) : null,
5112
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children })
5113
- ] }) : null
5114
- ] });
5118
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
5119
+ "section",
5120
+ {
5121
+ className: `sia-card${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
5122
+ style: mergedStyle,
5123
+ role: selectable ? "checkbox" : void 0,
5124
+ "aria-checked": selectable ? isSelected : void 0,
5125
+ "aria-disabled": selectable ? disabled : void 0,
5126
+ tabIndex: selectable && !disabled ? 0 : void 0,
5127
+ ...withTitleTooltip(props),
5128
+ onClick: (event) => {
5129
+ onClick?.(event);
5130
+ const target = event.target;
5131
+ const interactive = target.closest('button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="radio"], [role="switch"], [contenteditable="true"], [tabindex]');
5132
+ if (!event.defaultPrevented && (!interactive || interactive === event.currentTarget)) toggleSelected();
5133
+ },
5134
+ onKeyDown: (event) => {
5135
+ onKeyDown?.(event);
5136
+ if (!event.defaultPrevented && event.target === event.currentTarget && selectable && (event.key === "Enter" || event.key === " ")) {
5137
+ event.preventDefault();
5138
+ toggleSelected();
5139
+ }
5140
+ },
5141
+ children: [
5142
+ 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,
5143
+ hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "sia-card__header", children: [
5144
+ collapsible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
5145
+ heading,
5146
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
5147
+ ] }) : heading,
5148
+ extra ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "sia-card__extra", children: extra }) : null
5149
+ ] }) : null,
5150
+ !isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
5151
+ description ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "sia-card__description", children: description }) : null,
5152
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children }),
5153
+ hoverActions ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "sia-card__hover-actions", onClick: (event) => event.stopPropagation(), children: hoverActions }) : null
5154
+ ] }) : null
5155
+ ]
5156
+ }
5157
+ );
5115
5158
  }
5116
5159
 
5117
5160
  // src/components/Layout.tsx
@@ -13637,8 +13680,11 @@ function createResizePlugin(options = {}) {
13637
13680
  })
13638
13681
  };
13639
13682
  }
13683
+ function isTableAuxiliaryColumn(column) {
13684
+ return column.meta?.plugin === "index" || column.meta?.plugin === "selection" || column.key === "__index__" || column.key === "__selection__";
13685
+ }
13640
13686
  function createColumnSettingItems(columns, visibleKeys) {
13641
- return flattenTableColumns(columns).map((column, order) => ({
13687
+ return flattenTableColumns(columns).filter((column) => !isTableAuxiliaryColumn(column)).map((column, order) => ({
13642
13688
  key: column.key,
13643
13689
  width: column.width,
13644
13690
  fixed: normalizeFixed(column.fixed),
@@ -13649,6 +13695,7 @@ function createColumnSettingItems(columns, visibleKeys) {
13649
13695
  function applyColumnSettingsToTree(columns, items) {
13650
13696
  const itemMap = new Map(items.map((item) => [item.key, item]));
13651
13697
  const walk = (source) => source.flatMap((column, sourceOrder) => {
13698
+ if (isTableAuxiliaryColumn(column)) return [{ column, order: column.meta?.plugin === "selection" || column.key === "__selection__" ? -2 : -1 }];
13652
13699
  if (column.children?.length) {
13653
13700
  const children = walk(column.children);
13654
13701
  if (children.length === 0) return [];
@@ -13958,11 +14005,15 @@ function ColumnSettingPanel({
13958
14005
  var columnSettingLoadTokens = /* @__PURE__ */ new WeakMap();
13959
14006
  function createColumnSettingPlugin(options = {}) {
13960
14007
  const baseItems = (context) => createColumnSettingItems(context.baseColumns, options.defaultVisibleKeys);
13961
- const currentItems = (context) => context.state.items?.length ? context.state.items : baseItems(context);
14008
+ const editableItems = (items, context) => {
14009
+ const keys = new Set(baseItems(context).map((item) => item.key));
14010
+ return items.filter((item) => keys.has(item.key));
14011
+ };
14012
+ const currentItems = (context) => context.state.items?.length ? editableItems(context.state.items, context) : baseItems(context);
13962
14013
  const save = (snapshot) => options.adapter && options.scope ? options.adapter.save(options.scope, snapshot).catch(() => void 0) : Promise.resolve();
13963
14014
  function apply(items, context, persist = true) {
13964
14015
  const normalized = orderColumnSettings(
13965
- [...items].sort((a, b) => a.order - b.order)
14016
+ editableItems(items, context).sort((a, b) => a.order - b.order)
13966
14017
  );
13967
14018
  context.setState((state) => ({ ...state, items: normalized, open: false }));
13968
14019
  const columnMap = new Map(
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;
@@ -4865,7 +4930,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4865
4930
  display: flex;
4866
4931
  flex-wrap: wrap;
4867
4932
  align-items: center;
4868
- gap: var(--sia-query-field-gap, 12px);
4933
+ gap: var(--sia-query-field-gap, 6px);
4869
4934
  padding-top: 8px;
4870
4935
  }
4871
4936
  .sia-query-form__field {
@@ -4876,7 +4941,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4876
4941
  max-width: 100%;
4877
4942
  }
4878
4943
  .sia-query-form__field:has(.sia-picker-range-control, .sia-time-range, .sia-select-date-range, .sia-space-compact:not(.sia-space-compact--vertical) > :nth-child(2)) {
4879
- --sia-query-item-width: calc(var(--sia-query-field-width, 220px) + var(--sia-query-field-width, 220px) + var(--sia-query-field-gap, 12px));
4944
+ --sia-query-item-width: calc(var(--sia-query-field-width, 220px) + var(--sia-query-field-width, 220px) + var(--sia-query-field-gap, 6px));
4880
4945
  }
4881
4946
  .sia-query-form__field :is(.sia-picker-range-control, .sia-time-range, .sia-select-date-range, .sia-space-compact:not(.sia-space-compact--vertical)) {
4882
4947
  width: 100%;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TagStatus, B as BadgeProps } from './core-C2IieVNm.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-C2IieVNm.cjs';
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;
@@ -3080,7 +3081,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
3080
3081
  */
3081
3082
  loading?: boolean;
3082
3083
  /**
3083
- * 单列查询字段的默认宽度,数值单位为像素,可传 CSS 尺寸字符串。区间及横向组合控件默认为两倍此宽度加列间距;列间距可通过 --sia-query-field-gap 调整(默认 12px)。
3084
+ * 单列查询字段的默认宽度,数值单位为像素,可传 CSS 尺寸字符串。区间及横向组合控件默认为两倍此宽度加列间距;行列间距可通过 --sia-query-field-gap 调整(默认 6px)。
3084
3085
  * @defaultValue 220
3085
3086
  */
3086
3087
  fieldWidth?: number | string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TagStatus, B as BadgeProps } from './core-ZmKnvCFV.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-ZmKnvCFV.js';
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;
@@ -3080,7 +3081,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
3080
3081
  */
3081
3082
  loading?: boolean;
3082
3083
  /**
3083
- * 单列查询字段的默认宽度,数值单位为像素,可传 CSS 尺寸字符串。区间及横向组合控件默认为两倍此宽度加列间距;列间距可通过 --sia-query-field-gap 调整(默认 12px)。
3084
+ * 单列查询字段的默认宽度,数值单位为像素,可传 CSS 尺寸字符串。区间及横向组合控件默认为两倍此宽度加列间距;行列间距可通过 --sia-query-field-gap 调整(默认 6px)。
3084
3085
  * @defaultValue 220
3085
3086
  */
3086
3087
  fieldWidth?: number | string;
package/dist/index.js CHANGED
@@ -80,7 +80,7 @@ import {
80
80
  Watermark,
81
81
  message,
82
82
  notification
83
- } from "./chunk-IPDCEXQO.js";
83
+ } from "./chunk-ORLXJLLW.js";
84
84
  import {
85
85
  TextArea
86
86
  } from "./chunk-SMCYEPBL.js";
@@ -6484,8 +6484,11 @@ function createResizePlugin(options = {}) {
6484
6484
  })
6485
6485
  };
6486
6486
  }
6487
+ function isTableAuxiliaryColumn(column) {
6488
+ return column.meta?.plugin === "index" || column.meta?.plugin === "selection" || column.key === "__index__" || column.key === "__selection__";
6489
+ }
6487
6490
  function createColumnSettingItems(columns, visibleKeys) {
6488
- return flattenTableColumns(columns).map((column, order) => ({
6491
+ return flattenTableColumns(columns).filter((column) => !isTableAuxiliaryColumn(column)).map((column, order) => ({
6489
6492
  key: column.key,
6490
6493
  width: column.width,
6491
6494
  fixed: normalizeFixed(column.fixed),
@@ -6496,6 +6499,7 @@ function createColumnSettingItems(columns, visibleKeys) {
6496
6499
  function applyColumnSettingsToTree(columns, items) {
6497
6500
  const itemMap = new Map(items.map((item) => [item.key, item]));
6498
6501
  const walk = (source) => source.flatMap((column, sourceOrder) => {
6502
+ if (isTableAuxiliaryColumn(column)) return [{ column, order: column.meta?.plugin === "selection" || column.key === "__selection__" ? -2 : -1 }];
6499
6503
  if (column.children?.length) {
6500
6504
  const children = walk(column.children);
6501
6505
  if (children.length === 0) return [];
@@ -6805,11 +6809,15 @@ function ColumnSettingPanel({
6805
6809
  var columnSettingLoadTokens = /* @__PURE__ */ new WeakMap();
6806
6810
  function createColumnSettingPlugin(options = {}) {
6807
6811
  const baseItems = (context) => createColumnSettingItems(context.baseColumns, options.defaultVisibleKeys);
6808
- const currentItems = (context) => context.state.items?.length ? context.state.items : baseItems(context);
6812
+ const editableItems = (items, context) => {
6813
+ const keys = new Set(baseItems(context).map((item) => item.key));
6814
+ return items.filter((item) => keys.has(item.key));
6815
+ };
6816
+ const currentItems = (context) => context.state.items?.length ? editableItems(context.state.items, context) : baseItems(context);
6809
6817
  const save = (snapshot) => options.adapter && options.scope ? options.adapter.save(options.scope, snapshot).catch(() => void 0) : Promise.resolve();
6810
6818
  function apply(items, context, persist = true) {
6811
6819
  const normalized = orderColumnSettings(
6812
- [...items].sort((a, b) => a.order - b.order)
6820
+ editableItems(items, context).sort((a, b) => a.order - b.order)
6813
6821
  );
6814
6822
  context.setState((state) => ({ ...state, items: normalized, open: false }));
6815
6823
  const columnMap = new Map(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",