@sia.soul/sia-react-ui 0.1.105 → 0.1.106

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/core.css CHANGED
@@ -3813,6 +3813,15 @@ fieldset:disabled .sia-input-number__floating-placeholder {
3813
3813
  .sia-table__row--striped .sia-table__cell {
3814
3814
  background: color-mix(in srgb, var(--sia-color-background) 55%, var(--sia-color-surface));
3815
3815
  }
3816
+ .sia-table__row--success .sia-table__cell {
3817
+ background: color-mix(in srgb, var(--sia-color-success) 10%, var(--sia-color-surface));
3818
+ }
3819
+ .sia-table__row--warning .sia-table__cell {
3820
+ background: color-mix(in srgb, var(--sia-color-warning) 10%, var(--sia-color-surface));
3821
+ }
3822
+ .sia-table__row--error .sia-table__cell {
3823
+ background: color-mix(in srgb, var(--sia-color-error) 10%, var(--sia-color-surface));
3824
+ }
3816
3825
  .sia-table__row:hover .sia-table__cell {
3817
3826
  background: var(--sia-color-control-hover);
3818
3827
  }
package/dist/index.cjs CHANGED
@@ -15978,6 +15978,7 @@ function TableInner(props, ref) {
15978
15978
  onRowDoubleClick,
15979
15979
  onCellContextMenu,
15980
15980
  rowClassName,
15981
+ rowStatus,
15981
15982
  tableStyle,
15982
15983
  className = "",
15983
15984
  style,
@@ -16249,6 +16250,7 @@ function TableInner(props, ref) {
16249
16250
  rowHeight,
16250
16251
  striped,
16251
16252
  rowClassName,
16253
+ rowStatus,
16252
16254
  getRowKey,
16253
16255
  canvas,
16254
16256
  scrollLeft,
@@ -16514,6 +16516,8 @@ function TableInner(props, ref) {
16514
16516
  if (cached) return cached;
16515
16517
  const rowIndex = startIndex + offset;
16516
16518
  const pluginClasses = sortedPlugins.map((plugin) => plugin.getRowClassName?.(row, getContext(plugin))).filter(Boolean).join(" ");
16519
+ const status = typeof rowStatus === "function" ? rowStatus(row.record, row.sourceIndex) : rowStatus;
16520
+ const statusClass = status ? `sia-table__row--${status}` : "";
16517
16521
  const customClass = typeof rowClassName === "function" ? rowClassName(row.record, row.sourceIndex) : rowClassName ?? "";
16518
16522
  const element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
16519
16523
  TableBodyRow,
@@ -16529,7 +16533,7 @@ function TableInner(props, ref) {
16529
16533
  rightFixedEdgeKey,
16530
16534
  striped,
16531
16535
  rowHeight,
16532
- className: `${pluginClasses} ${customClass}`.trim(),
16536
+ className: `${statusClass} ${pluginClasses} ${customClass}`.trim(),
16533
16537
  onClick: () => {
16534
16538
  for (const plugin of sortedPlugins) plugin.onRowClick?.(row, getContext(plugin));
16535
16539
  onRowClick?.(row.record, row.sourceIndex);
package/dist/index.css CHANGED
@@ -3813,6 +3813,15 @@ fieldset:disabled .sia-input-number__floating-placeholder {
3813
3813
  .sia-table__row--striped .sia-table__cell {
3814
3814
  background: color-mix(in srgb, var(--sia-color-background) 55%, var(--sia-color-surface));
3815
3815
  }
3816
+ .sia-table__row--success .sia-table__cell {
3817
+ background: color-mix(in srgb, var(--sia-color-success) 10%, var(--sia-color-surface));
3818
+ }
3819
+ .sia-table__row--warning .sia-table__cell {
3820
+ background: color-mix(in srgb, var(--sia-color-warning) 10%, var(--sia-color-surface));
3821
+ }
3822
+ .sia-table__row--error .sia-table__cell {
3823
+ background: color-mix(in srgb, var(--sia-color-error) 10%, var(--sia-color-surface));
3824
+ }
3816
3825
  .sia-table__row:hover .sia-table__cell {
3817
3826
  background: var(--sia-color-control-hover);
3818
3827
  }
package/dist/index.d.cts CHANGED
@@ -2270,6 +2270,12 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
2270
2270
  onRowDoubleClick?: (record: T, index: number) => void;
2271
2271
  /** 单元格右键事件,可用于业务上下文菜单 */
2272
2272
  onCellContextMenu?: (record: T, column: TableColumn<T>, index: number, event: MouseEvent<HTMLTableCellElement>) => void;
2273
+ /**
2274
+ * 行的语义状态,使用框架成功、警告、错误背景色;默认不设置。
2275
+ * 可传固定状态或计算函数,函数参数为当前记录和原始数据索引,返回 undefined 时沿用普通行背景。
2276
+ * 状态背景覆盖斑马纹,悬停和勾选反馈优先;普通列、固定列及 Canvas 模式行为一致。
2277
+ */
2278
+ rowStatus?: "success" | "warning" | "error" | ((record: T, index: number) => "success" | "warning" | "error" | undefined);
2273
2279
  /** 行的 CSS 类名或计算函数。 */
2274
2280
  rowClassName?: string | ((record: T, index: number) => string);
2275
2281
  /** 表格元素的内联样式。 */
package/dist/index.d.ts CHANGED
@@ -2270,6 +2270,12 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
2270
2270
  onRowDoubleClick?: (record: T, index: number) => void;
2271
2271
  /** 单元格右键事件,可用于业务上下文菜单 */
2272
2272
  onCellContextMenu?: (record: T, column: TableColumn<T>, index: number, event: MouseEvent<HTMLTableCellElement>) => void;
2273
+ /**
2274
+ * 行的语义状态,使用框架成功、警告、错误背景色;默认不设置。
2275
+ * 可传固定状态或计算函数,函数参数为当前记录和原始数据索引,返回 undefined 时沿用普通行背景。
2276
+ * 状态背景覆盖斑马纹,悬停和勾选反馈优先;普通列、固定列及 Canvas 模式行为一致。
2277
+ */
2278
+ rowStatus?: "success" | "warning" | "error" | ((record: T, index: number) => "success" | "warning" | "error" | undefined);
2273
2279
  /** 行的 CSS 类名或计算函数。 */
2274
2280
  rowClassName?: string | ((record: T, index: number) => string);
2275
2281
  /** 表格元素的内联样式。 */
package/dist/index.js CHANGED
@@ -8161,6 +8161,7 @@ function TableInner(props, ref) {
8161
8161
  onRowDoubleClick,
8162
8162
  onCellContextMenu,
8163
8163
  rowClassName,
8164
+ rowStatus,
8164
8165
  tableStyle,
8165
8166
  className = "",
8166
8167
  style,
@@ -8432,6 +8433,7 @@ function TableInner(props, ref) {
8432
8433
  rowHeight,
8433
8434
  striped,
8434
8435
  rowClassName,
8436
+ rowStatus,
8435
8437
  getRowKey,
8436
8438
  canvas,
8437
8439
  scrollLeft,
@@ -8697,6 +8699,8 @@ function TableInner(props, ref) {
8697
8699
  if (cached) return cached;
8698
8700
  const rowIndex = startIndex + offset;
8699
8701
  const pluginClasses = sortedPlugins.map((plugin) => plugin.getRowClassName?.(row, getContext(plugin))).filter(Boolean).join(" ");
8702
+ const status = typeof rowStatus === "function" ? rowStatus(row.record, row.sourceIndex) : rowStatus;
8703
+ const statusClass = status ? `sia-table__row--${status}` : "";
8700
8704
  const customClass = typeof rowClassName === "function" ? rowClassName(row.record, row.sourceIndex) : rowClassName ?? "";
8701
8705
  const element = /* @__PURE__ */ jsx24(
8702
8706
  TableBodyRow,
@@ -8712,7 +8716,7 @@ function TableInner(props, ref) {
8712
8716
  rightFixedEdgeKey,
8713
8717
  striped,
8714
8718
  rowHeight,
8715
- className: `${pluginClasses} ${customClass}`.trim(),
8719
+ className: `${statusClass} ${pluginClasses} ${customClass}`.trim(),
8716
8720
  onClick: () => {
8717
8721
  for (const plugin of sortedPlugins) plugin.onRowClick?.(row, getContext(plugin));
8718
8722
  onRowClick?.(row.record, row.sourceIndex);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.105",
3
+ "version": "0.1.106",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",