@agile-team/mach-table-react 0.31.1 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -1
- package/dist/analysis.cjs +1 -0
- package/dist/analysis.d.cts +7 -0
- package/dist/analysis.d.ts +7 -0
- package/dist/analysis.js +1 -0
- package/dist/mach-table.css +1 -1
- package/dist/multi-range.cjs +1 -0
- package/dist/multi-range.d.cts +1 -0
- package/dist/multi-range.d.ts +1 -0
- package/dist/multi-range.js +1 -0
- package/dist/ordering.cjs +1 -0
- package/dist/ordering.d.cts +1 -0
- package/dist/ordering.d.ts +1 -0
- package/dist/ordering.js +1 -0
- package/dist/preferences.cjs +1 -0
- package/dist/preferences.d.cts +1 -0
- package/dist/preferences.d.ts +1 -0
- package/dist/preferences.js +1 -0
- package/dist/server-side.cjs +1 -0
- package/dist/server-side.css +1 -0
- package/dist/server-side.css.d.ts +2 -0
- package/dist/server-side.d.cts +1 -0
- package/dist/server-side.d.ts +1 -0
- package/dist/server-side.js +1 -0
- package/dist/workbench.cjs +1 -0
- package/dist/workbench.css +1 -0
- package/dist/workbench.css.d.ts +2 -0
- package/dist/workbench.d.cts +1 -0
- package/dist/workbench.d.ts +1 -0
- package/dist/workbench.js +1 -0
- package/dist/workflows.cjs +1 -1
- package/dist/workflows.js +1 -1
- package/package.json +71 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# @agile-team/mach-table-react
|
|
6
6
|
|
|
7
|
-
MachTable 0.
|
|
7
|
+
MachTable 0.32.0 的官方 React 18+ 适配包。一个依赖即可获得 Core、泛型 `<MachTable>`、应用/路由配置、按需工作流、StrictMode 安全清理和最新闭包事件处理。
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
pnpm add @agile-team/mach-table-react
|
|
@@ -77,6 +77,8 @@ export default defineMachTableConfig({
|
|
|
77
77
|
|
|
78
78
|
Provider 可按路由/布局嵌套,最近一层覆盖外层,表格 props 优先级最高。
|
|
79
79
|
|
|
80
|
+
编辑、粘贴、清空和填充复用已有列与整行校验。`useMachTableEditing()` 隔离重挂载或数据替换前的保存结果、错误和冲突;查询工作流在 StrictMode 下保留 `immediate: false`,重复设置相同搜索值不会重新请求。
|
|
81
|
+
|
|
80
82
|
## 按需加载
|
|
81
83
|
|
|
82
84
|
React 不模拟全局组件注册。路由本身懒加载时普通 import 已自然拆包;需要独立边界时:
|
|
@@ -134,4 +136,30 @@ const options: GridOptions<Plan> = {
|
|
|
134
136
|
|
|
135
137
|
文档:[React 指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/react.md) · [企业接入](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/enterprise-integration.md) · [SSR](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/ssr.md)
|
|
136
138
|
|
|
139
|
+
## 按需高级入口(0.32)
|
|
140
|
+
|
|
141
|
+
仍从本包导入,无需另装高级功能包。普通根入口不加载这些实现或附加 CSS。
|
|
142
|
+
|
|
143
|
+
| 子路径 | 功能 |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| `/workbench` | 高级过滤草稿与应用、修改差异/部分保存/冲突审阅、手动诊断 |
|
|
146
|
+
| `/preferences` | 复合身份隔离、CAS、有序写入、历史版本及列 ID/类型迁移报告 |
|
|
147
|
+
| `/ordering` | 多行/树移动、防环与业务约束、失败回滚、持久化撤销/重做 |
|
|
148
|
+
| `/server-side` | 服务端分组/聚合、route 分页、缓存/刷新/事务及层级选择 |
|
|
149
|
+
| `/multi-range` | Ctrl/Cmd 追加范围、格式化复制、校验清空及撤销 |
|
|
150
|
+
| `/analysis` | Pivot、安全公式、柱/折线图和数据表回退 |
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
import { mountAdvancedFilterBuilder } from "@agile-team/mach-table-react/workbench";
|
|
154
|
+
import "@agile-team/mach-table-react/styles/workbench.css";
|
|
155
|
+
|
|
156
|
+
const filters = mountAdvancedFilterBuilder(host, { api });
|
|
157
|
+
// 宿主卸载时调用;表格销毁也会释放工作台。
|
|
158
|
+
filters.destroy();
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
服务端分组控件使用 `/styles/server-side.css`,分析与多范围使用 `/styles/workbench.css`。排序、偏好和纯分析计算无需附加 CSS。服务端 Store 按 route 分页,不提供全树任意显示 offset;分析只处理当前已加载数据并显示范围。排序 undo/redo 的 transport 必须一次 CAS 保存 `context.operations` 的完整批次或 `context.plan.after`,只保存首参数无法完整恢复非连续/跨父级位置。
|
|
162
|
+
|
|
163
|
+
完整示例与限制:[工作台](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/workbench.md) · [排序](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/row-presentation.md) · [企业偏好](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/enterprise-preferences.md) · [服务端 Store](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/server-side-store.md) · [多范围](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/multi-range.md) · [分析](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/analysis.md)。
|
|
164
|
+
|
|
137
165
|
Source-available © ChenyCHENYU (Agile Team). 任何使用均须事先取得书面授权。详见 [LICENSE](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSE) 与[授权流程](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSING.md)。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _analysis = require('@agile-team/mach-table/analysis'); _createStarExport(_analysis);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/analysis';
|
|
2
|
+
import '@agile-team/mach-table/multi-range';
|
|
3
|
+
import '@agile-team/mach-table/ordering';
|
|
4
|
+
import '@agile-team/mach-table/preferences';
|
|
5
|
+
import '@agile-team/mach-table/server-side';
|
|
6
|
+
import '@agile-team/mach-table/workbench';
|
|
7
|
+
import '@agile-team/mach-table/worker';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/analysis';
|
|
2
|
+
import '@agile-team/mach-table/multi-range';
|
|
3
|
+
import '@agile-team/mach-table/ordering';
|
|
4
|
+
import '@agile-team/mach-table/preferences';
|
|
5
|
+
import '@agile-team/mach-table/server-side';
|
|
6
|
+
import '@agile-team/mach-table/workbench';
|
|
7
|
+
import '@agile-team/mach-table/worker';
|
package/dist/analysis.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@agile-team/mach-table/analysis";
|
package/dist/mach-table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mach-root{--mach-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;--mach-font-size: 13px;--mach-font-size-sm: 12px;--mach-header-font-weight: 650;--mach-cell-padding: 9px;--mach-row-h: 36px;--mach-header-h: 40px;--mach-primary: #2563eb;--mach-primary-weak: #dbeafe;--mach-success: #16a34a;--mach-warning: #d97706;--mach-danger: #dc2626;--mach-info: #0284c7;--mach-border-color: #e6eaf0;--mach-row-border-color: #eef1f6;--mach-cell-border-color: transparent;--mach-border-width: 1px;--mach-header-border-width: 1px;--mach-header-accent-color: #d9e1eb;--mach-header-bg: #f4f7fb;--mach-header-group-bg: #edf2f8;--mach-header-fg: #344054;--mach-body-bg: #ffffff;--mach-body-fg: #26303f;--mach-row-hover-bg: #f6f8fa;--mach-row-selected-bg: #eff6ff;--mach-zebra-bg: #fafbfd;--mach-cell-focus-color: #2563eb;--mach-focus-width: 1.5px;--mach-scrollbar-thumb: #c9d2dd;--mach-radius-sm: 4px;--mach-radius: 6px;--mach-radius-lg: 8px;--mach-shadow-sm: 0 1px 4px rgba(15, 23, 42, .08);--mach-shadow: 0 6px 20px rgba(15, 23, 42, .12);--mach-transition: .15s ease;--mach-z-overlay: 10;--mach-z-loading: 15;--mach-z-popup: 1000;--mach-z-menu: 1001;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:120px;overflow:hidden;font-family:var(--mach-font-family);font-size:var(--mach-font-size);color:var(--mach-body-fg);background:var(--mach-body-bg);outline:none;box-sizing:border-box;border:1px solid var(--mach-border-color);color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-variant-numeric:tabular-nums;contain:layout style}.mach-root.mach-dom-layout--auto-height{height:auto;min-height:0}.mach-root.mach-dom-layout--auto-height .mach-body{flex:none}.mach-root.mach-dom-layout--auto-height .mach-body-viewport--scroll{overflow-y:hidden}.mach-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:6px 8px;font:13px/1.4 var(--mach-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);color:var(--mach-body-fg, #26303f);background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-bottom:0;border-radius:var(--mach-radius-lg, 8px) var(--mach-radius-lg, 8px) 0 0}.mach-toolbar__main,.mach-toolbar__aside{display:flex;align-items:center;gap:6px;min-width:0}.mach-toolbar__search{display:flex;align-items:center;gap:6px;width:min(240px,32vw);height:32px;padding:0 9px;color:#64748b;background:var(--mach-header-bg, #fafbfd);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease)}.mach-toolbar__search:focus-within{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-toolbar__search input{min-width:0;width:100%;color:inherit;background:transparent;border:0;outline:0}.mach-toolbar__button,.mach-toolbar__select-host,.mach-toolbar__selection{height:32px;padding:0 10px;color:inherit;background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;cursor:pointer;transition:color var(--mach-transition, .15s ease),border-color var(--mach-transition, .15s ease),background var(--mach-transition, .15s ease)}.mach-toolbar__button{min-width:32px;padding:0 8px;font-size:16px}.mach-toolbar__button:hover:not(:disabled),.mach-toolbar__select-host:hover{color:var(--mach-primary, #2563eb);border-color:var(--mach-primary, #2563eb)}.mach-toolbar__button:disabled{cursor:not-allowed;opacity:.45}.mach-toolbar__selection{color:var(--mach-primary, #2563eb);background:var(--mach-primary-weak, #dbeafe);border-color:transparent;font-size:12px}.mach-toolbar__select-host{width:82px;padding:0}.mach-toolbar__select-control,.mach-toolbar__select-control .mach-select-trigger{width:100%;height:100%}.mach-toolbar__select-control .mach-select-trigger{border:0;border-radius:5px;background:transparent;box-shadow:none}@media(max-width:640px){.mach-toolbar{align-items:stretch;flex-direction:column}.mach-toolbar__main,.mach-toolbar__aside{flex-wrap:wrap}.mach-toolbar__search{flex:1;width:auto}}.mach-size--compact{--mach-font-size: 12px;--mach-cell-padding: 6px}.mach-size--normal{--mach-font-size: 13px;--mach-cell-padding: 9px}.mach-size--large{--mach-font-size: 14px;--mach-cell-padding: 12px}.mach-root.mach-cell-borders{--mach-cell-border-color: var(--mach-border-color)}.mach-root.mach-theme-dark,.mach-root.mach-theme-dark.mach-size--compact,.mach-root.mach-theme-dark.mach-size--normal,.mach-root.mach-theme-dark.mach-size--large{--mach-border-color: #26324a;--mach-row-border-color: #1c2740;--mach-header-accent-color: #33415e;--mach-header-bg: #101a2e;--mach-header-group-bg: #16213a;--mach-header-fg: #c3cee0;--mach-body-bg: #0d1526;--mach-body-fg: #dbe4f0;--mach-row-hover-bg: #142138;--mach-row-selected-bg: #14304f;--mach-zebra-bg: #0f1a2e;--mach-cell-focus-color: #60a5fa;--mach-primary: #60a5fa;--mach-primary-weak: #1e3a5f;--mach-scrollbar-thumb: #33415e;--mach-success: #4ade80;--mach-warning: #fbbf24;--mach-danger: #f87171;--mach-info: #38bdf8;--mach-shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);--mach-shadow: 0 6px 20px rgba(0, 0, 0, .5);color-scheme:dark}.mach-root *,.mach-root *:before,.mach-root *:after{box-sizing:border-box}.mach-portal,.mach-portal *,.mach-portal *:before,.mach-portal *:after{box-sizing:border-box}.mach-root:focus-visible{outline:2px solid var(--mach-primary);outline-offset:-2px}.mach-header{display:flex;flex-shrink:0;width:100%;height:var(--mach-header-h);background:var(--mach-header-bg);border-bottom:var(--mach-header-border-width) solid var(--mach-header-accent-color);box-shadow:0 1px 2px color-mix(in srgb,var(--mach-header-fg) 8%,transparent);overflow:hidden;position:relative;z-index:3;user-select:none}.mach-body{display:flex;flex:1;min-height:0;width:100%;position:relative;overflow:hidden}.mach-pane{position:relative;overflow:hidden;flex-shrink:0}.mach-pane--center{flex:1 1 auto;min-width:0}.mach-pane--hidden{display:none}.mach-header-viewport{width:100%;height:100%;overflow:hidden}.mach-header-rows{position:relative;height:100%;width:100%}.mach-header-row{position:absolute;left:0}.mach-header-row .mach-header-cell{position:absolute;top:0}.mach-header-cell--group{justify-content:center;border-bottom:var(--mach-border-width) solid var(--mach-border-color);font-weight:var(--mach-header-font-weight);background:var(--mach-header-group-bg)}.mach-header-label--custom{display:inline-flex;align-items:center;min-width:0;overflow:hidden}.mach-header-cell{display:flex;align-items:center;gap:4px;padding:0 var(--mach-cell-padding);border-right:var(--mach-border-width) solid transparent;color:var(--mach-header-fg);font-weight:var(--mach-header-font-weight);font-size:var(--mach-font-size);letter-spacing:.15px;cursor:default;overflow:hidden;white-space:nowrap;background:var(--mach-header-bg);transition:color var(--mach-transition),background-color var(--mach-transition)}.mach-header-cell--leaf:hover{background:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-header-bg))}.mach-header-cell.mach-header-cell--sorted{color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 5%,var(--mach-header-bg))}.mach-root.mach-cell-borders .mach-header-cell{border-right-color:var(--mach-border-color)}.mach-header-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.mach-header-cell--selection{justify-content:center;gap:0;padding:0}.mach-header-cell--selection .mach-header-label:empty{display:none}.mach-sort-indicator{display:inline-flex;align-items:center;gap:3px;color:var(--mach-primary);flex-shrink:0}.mach-sort-indicator svg{width:10px;height:10px}.mach-sort-indicator:empty{display:none}.mach-sort-badge{font-size:9px;line-height:1;padding:1.5px 4px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-weight:600}.mach-filter-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-filter-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-cell:hover .mach-filter-btn,.mach-header-cell:hover .mach-menu-btn{opacity:.62}.mach-filter-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-filter-btn--active{opacity:1;color:var(--mach-primary)}.mach-filter-tag{display:inline-flex;align-items:center;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px;height:16px;line-height:16px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-size:10px;font-weight:500;flex-shrink:0}.mach-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;font-size:12px;line-height:1;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-menu-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-menu-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-resize{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;z-index:2;touch-action:none}.mach-header-resize:hover:after,.mach-header-resize--active:after{content:"";position:absolute;inset:0 3px;background:var(--mach-primary);opacity:.45;border-radius:1px}.mach-column-resize-guide{position:absolute;bottom:0;width:2px;pointer-events:none;background:var(--mach-primary);box-shadow:0 0 0 1px var(--mach-primary-weak);z-index:8}.mach-column-resize-label{position:absolute;top:6px;min-width:52px;padding:3px 7px;border-radius:var(--mach-radius-sm);color:#fff;background:var(--mach-primary);font:600 11px/1.5 var(--mach-font-family);text-align:center;white-space:nowrap;transform:translate(-50%);box-shadow:var(--mach-shadow-sm)}.mach-header-cell--dragging{opacity:.22}.mach-column-drag-ghost{position:fixed;top:0;left:0;z-index:calc(var(--mach-z-menu) + 1);display:flex;align-items:center;height:var(--mach-header-h);max-width:calc(100vw - 16px);padding:0 var(--mach-cell-padding);overflow:hidden;color:var(--mach-body-fg);font:var(--mach-header-font-weight) var(--mach-font-size)/1.3 var(--mach-font-family);text-overflow:ellipsis;white-space:nowrap;pointer-events:none;background:var(--mach-body-bg);border:1px solid var(--mach-primary);border-radius:var(--mach-radius);box-shadow:var(--mach-shadow);opacity:.96;will-change:transform}.mach-drop-indicator{position:absolute;top:3px;left:0;width:2px;height:calc(100% - 6px);border-radius:2px;background:var(--mach-primary);z-index:4;pointer-events:none;will-change:transform}.mach-root--dragging{cursor:grabbing}.mach-root--dragging .mach-header-cell,.mach-root--resizing .mach-header-cell{cursor:default}.mach-root--resizing{cursor:col-resize}.mach-body-viewport{position:relative;width:100%;height:100%;overflow:hidden}.mach-body-viewport--scroll{overflow:auto;overscroll-behavior:contain}.mach-body-viewport--scroll{scrollbar-width:thin;scrollbar-color:var(--mach-scrollbar-thumb) transparent}.mach-body-viewport--scroll::-webkit-scrollbar{width:10px;height:10px}.mach-body-viewport--scroll::-webkit-scrollbar-track{background:transparent}.mach-body-viewport--scroll::-webkit-scrollbar-thumb{background:var(--mach-scrollbar-thumb);border-radius:999px;border:3px solid transparent;background-clip:padding-box;transition:background-color var(--mach-transition)}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--mach-scrollbar-thumb) 60%,var(--mach-primary));background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:active{background:var(--mach-primary);background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-corner{background:transparent}.mach-row-container{position:relative;width:100%}.mach-row{position:absolute;top:0;left:0;display:flex;width:100%;background:var(--mach-body-bg);border-bottom:var(--mach-border-width) solid var(--mach-row-border-color);contain:layout style}.mach-row,.mach-row .mach-cell{transition:background-color var(--mach-transition)}.mach-root.mach-striped .mach-row--odd,.mach-root.mach-striped .mach-row--odd .mach-cell{background:var(--mach-zebra-bg)}.mach-cell{position:absolute;top:0;display:flex;align-items:center;height:100%;padding:0 var(--mach-cell-padding);border-right:1px solid var(--mach-cell-border-color);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;line-height:calc(var(--mach-row-h) - 2px)}.mach-cell--loading{pointer-events:none}.mach-cell-loading-bar{display:block;height:8px;max-width:132px;border-radius:999px;background:linear-gradient(90deg,var(--mach-row-hover-bg),var(--mach-border-color),var(--mach-row-hover-bg));background-size:200% 100%;animation:mach-cell-loading 1.25s ease-in-out infinite}@keyframes mach-cell-loading{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.mach-cell-loading-bar{animation:none}}.mach-cell--num{justify-content:flex-end}.mach-cell--selection{justify-content:center;padding:0}.mach-cell--editing{padding:0 3px}.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color);border-radius:var(--mach-radius-sm);z-index:1}.mach-cell--selection.mach-cell--focus{box-shadow:none;border-radius:0;z-index:auto}.mach-row--hover,.mach-row--hover .mach-cell{background:var(--mach-row-hover-bg)}.mach-row--selected,.mach-row--selected .mach-cell{background:var(--mach-row-selected-bg)}.mach-row--selected.mach-row--hover,.mach-row--selected.mach-row--hover .mach-cell{background:var(--mach-row-selected-bg);filter:brightness(.985)}input.mach-row-checkbox,input.mach-select-all{width:13px;height:13px;margin:0;accent-color:var(--mach-primary);cursor:pointer;flex-shrink:0}.mach-detail-row{background:var(--mach-zebra-bg);z-index:0}.mach-detail{height:100%;overflow:auto;padding:10px 12px}.mach-cell--detail-toggle{justify-content:center;padding:0;cursor:pointer}.mach-detail-toggle{display:inline-flex;align-items:center;justify-content:center;width:100%;font-size:10px;color:var(--mach-header-fg);transition:transform .15s ease}.mach-detail-toggle--open{transform:rotate(90deg)}.mach-detail-toggle--loading{animation:mach-tree-spin .8s linear infinite;color:var(--mach-primary)}.mach-detail-toggle--error{color:#dc2626}@keyframes mach-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mach-detail-toggle--loading{animation:none}}.mach-cell--group{cursor:pointer;background:var(--mach-header-bg)}.mach-row .mach-cell--group,.mach-row:has(.mach-cell--group){background:var(--mach-header-bg)}.mach-group-label{display:inline-flex;align-items:center;gap:5px;min-width:0;overflow:hidden}.mach-group-text{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-group-count{color:var(--mach-header-fg);font-size:10px;flex-shrink:0;opacity:.8}.mach-tree-cell{display:inline-flex;align-items:center;gap:4px;min-width:0;width:100%}.mach-tree-indent{flex-shrink:0}.mach-tree-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;cursor:pointer}.mach-tree-toggle:hover,.mach-tree-toggle:focus-visible{color:var(--mach-primary);background:var(--mach-primary-weak)}.mach-tree-toggle:focus-visible{outline:1px solid var(--mach-primary);outline-offset:-1px}.mach-tree-toggle>.mach-detail-toggle{width:10px;line-height:1;color:inherit;pointer-events:none}.mach-tree-toggle>.mach-detail-toggle--loading{color:var(--mach-primary)}.mach-tree-toggle>.mach-detail-toggle--error{color:var(--mach-danger)}.mach-tree-toggle-spacer{flex:0 0 20px;width:20px}.mach-tree-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-cell--drag{justify-content:center;padding:0;cursor:grab}.mach-row-drag-handle{display:grid;place-items:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;opacity:.55;cursor:grab;user-select:none;touch-action:none;transition:color var(--mach-transition),background var(--mach-transition),opacity var(--mach-transition)}.mach-row-drag-handle:before{content:"";width:10px;height:14px;background:radial-gradient(circle,currentColor 1.3px,transparent 1.5px) 0 0 / 5px 5px}.mach-row-drag-handle:hover:not(:disabled),.mach-row-drag-handle:focus-visible{opacity:1;color:var(--mach-primary);background:var(--mach-primary-weak);border-color:color-mix(in srgb,var(--mach-primary) 28%,transparent);outline:none}.mach-row-drag-handle:disabled{opacity:.2;cursor:not-allowed}.mach-row-drop-indicator{position:absolute;top:0;left:0;width:100%;height:2px;background:var(--mach-primary);box-shadow:0 0 0 1px color-mix(in srgb,var(--mach-body-bg) 65%,transparent);z-index:5;pointer-events:none;will-change:transform}.mach-row-drop-indicator:before{content:"";position:absolute;left:1px;top:-2px;width:6px;height:6px;border-radius:50%;background:var(--mach-primary)}.mach-pane--center .mach-row-drop-indicator:before,.mach-pane--right .mach-row-drop-indicator:before{display:none}.mach-row-drag-preview{position:absolute;top:0;left:0;z-index:var(--mach-z-overlay);max-width:min(216px,calc(100% - 16px));padding:9px 14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid color-mix(in srgb,var(--mach-primary) 35%,var(--mach-border-color));border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);box-shadow:var(--mach-shadow);font-weight:600;pointer-events:none}.mach-root--row-dragging,.mach-root--row-dragging .mach-cell,.mach-root--row-dragging .mach-row-drag-handle{cursor:grabbing;user-select:none}.mach-root .mach-row--drag-source{opacity:.45}.mach-cell--index{color:var(--mach-header-fg);font-size:calc(var(--mach-font-size) - 1px)}.mach-editor-input.mach-editor-invalid,.mach-editor-invalid .mach-editor-input,.mach-editor-invalid .mach-select-trigger,.mach-editor-invalid input,.mach-editor-invalid select:not([hidden]){border-color:#ef4444!important;box-shadow:0 0 0 1px #ef444459}.mach-editor-validating{cursor:progress;opacity:.72}.mach-footer{display:flex;flex-shrink:0;width:100%;overflow:hidden;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);font-weight:600;color:var(--mach-header-fg);position:relative;z-index:3}.mach-footer-row{position:relative;overflow:hidden;flex-shrink:0}.mach-footer-row--center{flex:1 1 auto;min-width:0}.mach-footer-cell{position:absolute;top:0;display:flex;align-items:center;padding:0 var(--mach-cell-padding);border-right:1px solid transparent;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:100%;font-variant-numeric:tabular-nums}.mach-root.mach-cell-borders .mach-footer-cell{border-right-color:var(--mach-border-color)}.mach-cell--range{background:color-mix(in srgb,var(--mach-primary) 7%,transparent)!important}.mach-cell--range:after{content:"";position:absolute;inset:0;z-index:2;border:0 solid var(--mach-primary);pointer-events:none}.mach-cell--range.mach-cell--range-top:after{border-top-width:1.5px}.mach-cell--range.mach-cell--range-bottom:after{border-bottom-width:1.5px}.mach-cell--range.mach-cell--range-left:after{border-left-width:1.5px}.mach-cell--range.mach-cell--range-right:after{border-right-width:1.5px}.mach-cell--range.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color)}.mach-cell--range.mach-cell--focus:after{display:none}.mach-context-menu{position:fixed;z-index:var(--mach-z-menu);display:flex;flex-direction:column;min-width:140px;padding:5px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow);font-family:var(--mach-font-family);font-size:var(--mach-font-size)}.mach-context-menu-item{text-align:left;padding:6px 10px;border:none;border-radius:var(--mach-radius);background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap}.mach-context-menu-item:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-fill-handle{position:absolute;width:8px;height:8px;border-radius:2px;background:var(--mach-primary);border:1.5px solid var(--mach-body-bg);cursor:crosshair;z-index:6;box-shadow:0 0 0 1px #2563eb59}.mach-root--filling,.mach-root--filling *{user-select:none!important;cursor:crosshair!important}.mach-infinite-loading{position:absolute;left:50%;bottom:14px;transform:translate(-50%);display:flex;align-items:center;gap:8px;padding:5px 14px;border-radius:999px;background:var(--mach-body-bg);border:1px solid var(--mach-border-color);box-shadow:var(--mach-shadow-sm);color:var(--mach-header-fg);font-size:12px;z-index:var(--mach-z-loading)}.mach-infinite-loading .mach-spinner{width:14px;height:14px;border-width:2px}.mach-statusbar{display:flex;align-items:center;gap:18px;flex-shrink:0;height:28px;padding:0 12px;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);color:var(--mach-header-fg);font-size:11px;overflow:hidden;white-space:nowrap;font-variant-numeric:tabular-nums}.mach-statusbar-item--rangeAggregate{margin-left:auto}.mach-pinned-rows{display:flex;width:100%;overflow:hidden;background:var(--mach-header-bg);flex-shrink:0;border-bottom:1px solid var(--mach-border-color)}.mach-pinned-rows--bottom{border-bottom:none;border-top:1px solid var(--mach-border-color)}.mach-pinned-viewport{flex:1 1 auto;min-width:0;overflow:hidden}.mach-pinned-seg{position:relative;overflow:hidden;flex-shrink:0}.mach-pinned-seg--center{position:relative}.mach-pinned-row{position:relative;width:100%;border-bottom:1px solid var(--mach-row-border-color)}.mach-pinned-row .mach-cell{position:absolute;top:0;background:var(--mach-header-bg);font-weight:600;color:var(--mach-header-fg)}.mach-pinned-row:last-child{border-bottom:none}.mach-cell--wrap{white-space:normal;word-break:break-word;line-height:1.45;align-items:flex-start;padding-top:5px;padding-bottom:5px}.mach-editor-input,.mach-editor-select-control .mach-select-trigger{width:100%;height:calc(var(--mach-row-h) - 8px);padding:0 6px;border:1px solid var(--mach-primary);border-radius:var(--mach-radius-sm);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none}.mach-select-control{position:relative;display:inline-flex;min-width:0;font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px)}.mach-select-native[hidden]{display:none!important}.mach-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;height:34px;padding:0 10px;border:1px solid var(--mach-border-color, #e6eaf0);border-radius:var(--mach-radius, 6px);outline:none;color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);font:inherit;line-height:1;text-align:left;cursor:pointer;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-trigger:hover{border-color:color-mix(in srgb,var(--mach-primary, #2563eb) 44%,var(--mach-border-color, #e6eaf0));background:color-mix(in srgb,var(--mach-primary, #2563eb) 3%,var(--mach-body-bg, #fff))}.mach-select-trigger:focus-visible,.mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-select-caret{width:8px;height:8px;flex:0 0 auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform var(--mach-transition, .15s ease)}.mach-select-trigger[aria-expanded=true] .mach-select-caret{transform:translateY(2px) rotate(225deg)}.mach-select-listbox{position:fixed;z-index:var(--mach-z-menu, 1200);display:none;flex-direction:column;gap:2px;min-width:112px;max-width:min(320px,calc(100vw - 16px));max-height:min(244px,calc(100vh - 16px));padding:5px;overflow:auto;overscroll-behavior:contain;border:1px solid color-mix(in srgb,var(--mach-border-color, #e6eaf0) 88%,var(--mach-primary, #2563eb));border-radius:calc(var(--mach-radius-lg, 8px) + 1px);color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg, #1f2937) 18%,transparent),var(--mach-shadow-sm, 0 1px 3px rgba(15, 23, 42, .12));font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px);isolation:isolate}.mach-select-listbox--open{display:flex;animation:mach-select-listbox-in .12s ease-out}.mach-select-option{position:relative;display:flex;align-items:center;flex:0 0 auto;width:100%;min-height:32px;padding:0 30px 0 10px;border:0;border-radius:var(--mach-radius, 6px);outline:none;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer;transition:color var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-option:hover,.mach-select-option:focus-visible,.mach-select-option--active{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 9%,var(--mach-body-bg, #fff))}.mach-select-option[aria-selected=true]{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 13%,var(--mach-body-bg, #fff));font-weight:600}.mach-select-option[aria-selected=true]:after{content:"\2713";position:absolute;right:10px;font-size:12px;font-weight:700}.mach-select-option:disabled{opacity:.42;cursor:not-allowed}@keyframes mach-select-listbox-in{0%{transform:translateY(-3px) scale(.99)}to{transform:translateY(0) scale(1)}}.mach-select-listbox--above{transform-origin:bottom}.mach-filter-select-control{width:100%}.mach-filter-select-trigger{width:100%;background:color-mix(in srgb,var(--mach-header-bg) 62%,var(--mach-body-bg))}.mach-filter-listbox{width:auto}.mach-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:var(--mach-body-bg);z-index:var(--mach-z-overlay)}.mach-overlay-text{color:var(--mach-header-fg);font-size:var(--mach-font-size)}.mach-overlay-content{max-width:min(100%,320px)}.mach-loading{display:grid;justify-items:center;gap:14px;min-width:172px;padding:20px 24px}.mach-loading__visual{position:relative;display:grid;gap:8px;width:132px;padding:14px 16px;overflow:hidden;background:color-mix(in srgb,var(--mach-header-bg) 82%,var(--mach-body-bg));border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow-sm)}.mach-loading__visual:before{content:"";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(100deg,transparent 20%,color-mix(in srgb,var(--mach-primary) 11%,transparent) 50%,transparent 80%);animation:mach-loading-sweep 1.35s ease-in-out infinite}.mach-loading__row{height:7px;border-radius:999px;background:color-mix(in srgb,var(--mach-primary) 13%,var(--mach-border-color))}.mach-loading__row:nth-child(2){width:82%}.mach-loading__row:nth-child(3){width:92%}.mach-loading__row:nth-child(4){width:66%}.mach-loading__status{display:inline-flex;align-items:center;gap:8px;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm)}.mach-loading__spinner{width:14px;height:14px}.mach-loading__label{line-height:1}.mach-spinner{width:22px;height:22px;border:2px solid var(--mach-border-color);border-top-color:var(--mach-primary);border-radius:50%;animation:mach-spin .8s linear infinite}@keyframes mach-spin{to{transform:rotate(360deg)}}@keyframes mach-loading-sweep{to{transform:translate(100%)}}.mach-filter-panel{position:fixed;z-index:var(--mach-z-popup);display:flex;flex-direction:column;gap:10px;width:224px;max-width:calc(100vw - 16px);padding:12px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid color-mix(in srgb,var(--mach-border-color) 88%,var(--mach-primary));border-radius:calc(var(--mach-radius-lg) + 2px);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg) 16%,transparent),var(--mach-shadow-sm);font-family:var(--mach-font-family);font-size:var(--mach-font-size);animation:mach-filter-panel-in .14s ease-out}.mach-filter-body{display:flex;flex-direction:column;gap:8px}.mach-filter-input{width:100%;height:34px;padding:0 10px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none;transition:border-color var(--mach-transition),box-shadow var(--mach-transition)}.mach-filter-input:focus{border-color:var(--mach-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary) 12%,transparent)}@keyframes mach-filter-panel-in{0%{opacity:0;transform:translateY(-3px) scale(.99)}}.mach-filter-set-list{max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-filter-set-item{display:flex;align-items:center;gap:6px;padding:3px 5px;border-radius:var(--mach-radius-sm);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-filter-set-item:hover{background:var(--mach-row-hover-bg)}.mach-filter-set-item input{accent-color:var(--mach-primary);margin:0;width:13px;height:13px}.mach-filter-footer{display:flex;justify-content:flex-end;gap:6px}.mach-filter-footer button{padding:4px 12px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:var(--mach-font-size);cursor:pointer}.mach-filter-footer button:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-filter-btn-apply{background:var(--mach-primary)!important;border-color:var(--mach-primary)!important;color:#fff!important}.mach-filter-btn-apply:hover{opacity:.9;color:#fff!important}.mach-column-panel{min-width:220px;max-height:70vh;overflow:auto}.mach-column-panel[role=dialog]{width:min(440px,calc(100vw - 16px))}.mach-column-workbench-search{box-sizing:border-box;width:100%;height:30px;padding:0 9px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);font:inherit;outline:none}.mach-column-workbench-search:focus{border-color:var(--mach-primary);box-shadow:0 0 0 2px var(--mach-primary-weak)}.mach-column-panel-title{font-weight:600;color:var(--mach-header-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-column-panel-subtitle{font-size:11px;color:var(--mach-header-fg);margin-top:2px}.mach-column-panel-actions{display:flex;gap:6px;flex-wrap:wrap}.mach-column-panel-btn{flex:1;min-width:60px;padding:4px 8px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:12px;cursor:pointer;white-space:nowrap}.mach-column-panel-btn:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-column-panel-divider{height:1px;background:var(--mach-border-color);margin:4px 0}.mach-column-panel-list{max-height:280px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-column-workbench-item{display:grid;grid-template-columns:minmax(120px,1fr) 108px 26px 26px;align-items:center;gap:4px;min-height:32px;padding:2px 3px;border-radius:var(--mach-radius)}.mach-column-workbench-item:hover{background:var(--mach-row-hover-bg)}.mach-column-workbench-label{display:flex;min-width:0;align-items:center;gap:7px;cursor:pointer}.mach-column-workbench-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-column-workbench-pin-control,.mach-column-workbench-move{height:26px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:inherit;font:inherit}.mach-column-workbench-pin-control{width:108px;border:0}.mach-column-workbench-pin-control .mach-select-trigger{width:100%;height:26px;padding:0 7px;border-radius:var(--mach-radius);font-size:12px;box-shadow:none}.mach-column-workbench-move{padding:0;cursor:pointer}.mach-column-workbench-move:disabled{cursor:not-allowed;opacity:.35}.mach-tag{display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:20px;line-height:18px;border-radius:999px;font-size:var(--mach-font-size-sm);font-weight:500;white-space:nowrap}.mach-tag:before{content:"";width:5px;height:5px;border-radius:999px;background:currentColor}.mach-tag--success{color:var(--mach-success);background:color-mix(in srgb,var(--mach-success) 10%,transparent)}.mach-tag--warning{color:var(--mach-warning);background:color-mix(in srgb,var(--mach-warning) 12%,transparent)}.mach-tag--danger{color:var(--mach-danger);background:color-mix(in srgb,var(--mach-danger) 10%,transparent)}.mach-tag--info{color:var(--mach-info);background:color-mix(in srgb,var(--mach-info) 10%,transparent)}.mach-tag--neutral{color:var(--mach-header-fg);background:color-mix(in srgb,var(--mach-header-fg) 10%,transparent)}.mach-progress{display:flex;align-items:center;gap:6px;width:100%}.mach-progress__track{flex:1;min-width:0;height:6px;border-radius:999px;background:color-mix(in srgb,var(--mach-header-fg) 14%,transparent);overflow:hidden}.mach-progress__bar{height:100%;border-radius:999px;background:var(--mach-primary);transition:width var(--mach-transition)}.mach-progress__label{flex-shrink:0;font-size:var(--mach-font-size-sm);color:var(--mach-header-fg);font-variant-numeric:tabular-nums}.mach-link{color:var(--mach-primary);cursor:pointer}.mach-link:hover{text-decoration:underline}.mach-actions{display:inline-flex;align-items:center;gap:2px}.mach-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.mach-action-btn{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm);line-height:1;cursor:pointer;white-space:nowrap;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-action-btn:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-action-btn--danger:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);color:var(--mach-danger);transform:scale(1.06)}.mach-action-btn--success:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);color:var(--mach-success);transform:scale(1.06)}.mach-action-btn--primary{color:var(--mach-primary)}.mach-action-btn--warning{color:var(--mach-warning)}.mach-action-btn--success,.mach-edit-control--confirm{color:var(--mach-success)}.mach-action-btn--danger{color:var(--mach-danger)}.mach-action-btn:focus-visible,.mach-edit-control:focus-visible,.mach-cell-edit-trigger:focus-visible,.mach-action-drawer__close:focus-visible{outline:2px solid color-mix(in srgb,var(--mach-primary) 65%,transparent);outline-offset:1px}.mach-action-btn:disabled{cursor:not-allowed;opacity:.4}.mach-action-btn--loading svg{animation:mach-spin .8s linear infinite}.mach-dictionary-value--loading{color:var(--mach-header-fg);opacity:.72}.mach-dictionary-value--error{text-decoration:underline dotted;text-underline-offset:3px}.mach-action-btn--icon{padding:0;width:24px}.mach-context-menu-item--danger{color:var(--mach-danger)}.mach-context-menu-item,.mach-action-drawer__item{display:flex;align-items:center;gap:9px}.mach-context-menu-item--primary,.mach-action-drawer__item--primary{color:var(--mach-primary)}.mach-context-menu-item--warning,.mach-action-drawer__item--warning{color:var(--mach-warning)}.mach-context-menu-item--success,.mach-action-drawer__item--success{color:var(--mach-success)}.mach-context-menu-item--danger,.mach-action-drawer__item--danger{color:var(--mach-danger)}.mach-action-drawer-backdrop{position:fixed;inset:0;z-index:calc(var(--mach-z-menu) + 2);background:#0f172a33;backdrop-filter:blur(1px)}.mach-action-drawer{position:absolute;top:0;right:0;display:flex;flex-direction:column;width:min(340px,calc(100vw - 24px));height:100%;background:var(--mach-body-bg);color:var(--mach-body-fg);border-left:1px solid var(--mach-border-color);box-shadow:-16px 0 40px #0f172a24;font-family:var(--mach-font-family);animation:mach-drawer-in .18s ease-out}.mach-action-drawer__header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:0 16px 0 20px;border-bottom:1px solid var(--mach-border-color)}.mach-action-drawer__close{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:var(--mach-radius);background:transparent;color:var(--mach-header-fg);cursor:pointer}.mach-action-drawer__close:hover{color:var(--mach-primary);background:var(--mach-row-hover-bg)}.mach-action-drawer__body{display:flex;flex-direction:column;gap:4px;padding:12px;overflow:auto}.mach-action-drawer__item{width:100%;min-height:40px;padding:0 12px;border:0;border-radius:var(--mach-radius);background:transparent;font:inherit;text-align:left;cursor:pointer}.mach-action-drawer__item:hover:not(:disabled){background:var(--mach-row-hover-bg)}.mach-action-drawer__item:disabled{opacity:.4;cursor:not-allowed}@keyframes mach-drawer-in{0%{transform:translate(18px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:640px){.mach-action-drawer{top:auto;bottom:0;width:100%;height:auto;max-height:min(70vh,520px);border-top:1px solid var(--mach-border-color);border-left:0;border-radius:var(--mach-radius-lg) var(--mach-radius-lg) 0 0;animation-name:mach-drawer-up}}@keyframes mach-drawer-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.mach-cell:has(.mach-cell-edit-trigger){padding-right:29px}.mach-cell-edit-trigger{position:absolute;right:5px;top:50%;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;transform:translateY(-50%);border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;opacity:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-cell-edit-trigger svg{width:13px;height:13px}.mach-cell:hover .mach-cell-edit-trigger--hover,.mach-cell:focus-within .mach-cell-edit-trigger--hover,.mach-cell-edit-trigger--always{opacity:.72}.mach-cell-edit-trigger:hover{opacity:1;color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 9%,transparent)}.mach-cell--editing{overflow:visible;z-index:4}.mach-cell-editor-shell,.mach-row-editor-shell{display:flex;align-items:center;width:100%;min-width:0;gap:5px}.mach-cell-editor-shell>.mach-editor-input,.mach-cell-editor-shell>.mach-editor-select-control,.mach-cell-editor-shell>:not(.mach-cell-editor-controls),.mach-row-editor-shell>*{flex:1 1 auto;min-width:0}.mach-cell-editor-controls{display:inline-flex;flex:0 0 auto;align-items:center;gap:2px;padding:2px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);box-shadow:var(--mach-shadow-sm)}.mach-edit-control{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-edit-control svg{width:14px;height:14px}.mach-edit-control--confirm{color:var(--mach-success)}.mach-edit-control--confirm:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);transform:scale(1.06)}.mach-edit-control--cancel{color:var(--mach-danger)}.mach-edit-control--cancel:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);transform:scale(1.06)}.mach-edit-control:disabled{opacity:.35;cursor:wait}.mach-row--editing,.mach-row--editing .mach-cell{background:color-mix(in srgb,var(--mach-primary) 3%,var(--mach-body-bg))}.mach-cell--row-editing .mach-editor-input,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger{border-color:color-mix(in srgb,var(--mach-primary) 45%,var(--mach-border-color));box-shadow:0 1px 2px #0f172a0a}.mach-cell--row-editing .mach-editor-input:focus,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger:focus-visible,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary) 12%,transparent)}.mach-tooltip{position:fixed;z-index:var(--mach-z-menu);max-width:320px;padding:6px 10px;border-radius:var(--mach-radius);background:var(--mach-body-fg);color:var(--mach-body-bg);font-size:var(--mach-font-size-sm);line-height:1.5;box-shadow:var(--mach-shadow);pointer-events:none;word-break:break-word}.mach-cell--flash{animation:mach-flash .8s ease-out}@keyframes mach-flash{0%{background-color:color-mix(in srgb,var(--mach-primary) 35%,transparent)}to{background-color:transparent}}.mach-context-menu-separator{height:1px;margin:4px 6px;background:var(--mach-border-color)}.mach-context-menu-item:disabled{opacity:.45;cursor:not-allowed}.mach-pagination{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-shrink:0;height:40px;padding:0 12px;background:var(--mach-body-bg);border-top:var(--mach-border-width) solid var(--mach-border-color);color:var(--mach-body-fg);font-size:var(--mach-font-size-sm);user-select:none}.mach-pagination-total{color:var(--mach-header-fg);margin-right:8px;font-variant-numeric:tabular-nums}.mach-pagination-page{min-width:72px;text-align:center;color:var(--mach-body-fg);font-variant-numeric:tabular-nums}.mach-pagination-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:var(--mach-border-width) solid var(--mach-border-color);border-radius:var(--mach-radius-sm);background:var(--mach-body-bg);color:var(--mach-header-fg);font-size:13px;line-height:1;cursor:pointer;transition:border-color var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-pagination-btn:hover:not(:disabled){border-color:var(--mach-primary);color:var(--mach-primary)}.mach-pagination-btn:disabled{opacity:.35;cursor:not-allowed}.mach-pagination-size-control{height:24px;margin-left:6px;width:92px;font-size:var(--mach-font-size-sm)}.mach-pagination-size-control .mach-select-trigger{width:100%;height:24px;padding:0 6px;border-width:var(--mach-border-width);border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);box-shadow:none}.mach-watermark{position:absolute;inset:0;z-index:6;pointer-events:none;background-repeat:repeat}.mach-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:32px 16px;min-height:160px}.mach-empty__icon{margin-bottom:6px}.mach-empty__title{font-size:var(--mach-font-size);color:var(--mach-body-fg);font-weight:500}.mach-empty__hint{font-size:var(--mach-font-size-sm);color:var(--mach-header-fg)}@media(prefers-reduced-motion:reduce){.mach-spinner,.mach-loading__visual:before{animation-duration:2.4s}}.mach-cell--center{justify-content:center}.mach-cell--right{justify-content:flex-end}.mach-header-cell--center .mach-header-label{text-align:center}.mach-header-cell--right .mach-header-label{text-align:right}@media(prefers-reduced-motion:reduce){.mach-root *,.mach-root *:before,.mach-root *:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.mach-action-drawer{animation:none!important}}.mach-root{--mach-row-warning-bg: color-mix(in srgb, var(--mach-warning) 11%, var(--mach-body-bg));--mach-row-danger-bg: color-mix(in srgb, var(--mach-danger) 9%, var(--mach-body-bg));--mach-row-success-bg: color-mix(in srgb, var(--mach-success) 10%, var(--mach-body-bg));--mach-row-info-bg: color-mix(in srgb, var(--mach-info) 10%, var(--mach-body-bg))}.mach-row--styled[data-row-tone=warning]{--mach-row-rule-bg: var(--mach-row-warning-bg)}.mach-row--styled[data-row-tone=danger]{--mach-row-rule-bg: var(--mach-row-danger-bg)}.mach-row--styled[data-row-tone=success]{--mach-row-rule-bg: var(--mach-row-success-bg)}.mach-row--styled[data-row-tone=info]{--mach-row-rule-bg: var(--mach-row-info-bg)}.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled,.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled .mach-cell{background-color:var(--mach-row-rule-bg, var(--mach-body-bg));color:var(--mach-row-rule-fg, var(--mach-body-fg))}.mach-root .mach-row--styled.mach-row--hover,.mach-root .mach-row--styled.mach-row--hover .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-row-rule-bg, var(--mach-body-bg)))}.mach-root .mach-row--styled.mach-row--selected,.mach-root .mach-row--styled.mach-row--selected .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 12%,var(--mach-row-rule-bg, var(--mach-body-bg)))}
|
|
1
|
+
.mach-root{--mach-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;--mach-font-size: 13px;--mach-font-size-sm: 12px;--mach-header-font-weight: 650;--mach-cell-padding: 9px;--mach-row-h: 36px;--mach-header-h: 40px;--mach-primary: #2563eb;--mach-primary-weak: #dbeafe;--mach-success: #16a34a;--mach-warning: #d97706;--mach-danger: #dc2626;--mach-info: #0284c7;--mach-border-color: #e6eaf0;--mach-row-border-color: #eef1f6;--mach-cell-border-color: transparent;--mach-border-width: 1px;--mach-header-border-width: 1px;--mach-header-accent-color: #d9e1eb;--mach-header-bg: #f4f7fb;--mach-header-group-bg: #edf2f8;--mach-header-fg: #344054;--mach-body-bg: #ffffff;--mach-body-fg: #26303f;--mach-row-hover-bg: #f6f8fa;--mach-row-selected-bg: #eff6ff;--mach-zebra-bg: #fafbfd;--mach-cell-focus-color: #2563eb;--mach-focus-width: 1.5px;--mach-scrollbar-thumb: #c9d2dd;--mach-radius-sm: 4px;--mach-radius: 6px;--mach-radius-lg: 8px;--mach-shadow-sm: 0 1px 4px rgba(15, 23, 42, .08);--mach-shadow: 0 6px 20px rgba(15, 23, 42, .12);--mach-transition: .15s ease;--mach-z-overlay: 10;--mach-z-loading: 15;--mach-z-popup: 1000;--mach-z-menu: 1001;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:120px;overflow:hidden;font-family:var(--mach-font-family);font-size:var(--mach-font-size);color:var(--mach-body-fg);background:var(--mach-body-bg);outline:none;box-sizing:border-box;border:1px solid var(--mach-border-color);color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-variant-numeric:tabular-nums;contain:layout style}.mach-root.mach-dom-layout--auto-height{height:auto;min-height:0}.mach-root.mach-dom-layout--auto-height .mach-body{flex:none}.mach-root.mach-dom-layout--auto-height .mach-body-viewport--scroll{overflow-y:hidden}.mach-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:6px 8px;font:13px/1.4 var(--mach-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);color:var(--mach-body-fg, #26303f);background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-bottom:0;border-radius:var(--mach-radius-lg, 8px) var(--mach-radius-lg, 8px) 0 0}.mach-toolbar__main,.mach-toolbar__aside{display:flex;align-items:center;gap:6px;min-width:0}.mach-toolbar__search{display:flex;align-items:center;gap:6px;width:min(240px,32vw);height:32px;padding:0 9px;color:#64748b;background:var(--mach-header-bg, #fafbfd);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease)}.mach-toolbar__search:focus-within{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-toolbar__search input{min-width:0;width:100%;color:inherit;background:transparent;border:0;outline:0}.mach-toolbar__button,.mach-toolbar__select-host,.mach-toolbar__selection{height:32px;padding:0 10px;color:inherit;background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;cursor:pointer;transition:color var(--mach-transition, .15s ease),border-color var(--mach-transition, .15s ease),background var(--mach-transition, .15s ease)}.mach-toolbar__button{min-width:32px;padding:0 8px;font-size:16px}.mach-toolbar__button:hover:not(:disabled),.mach-toolbar__select-host:hover{color:var(--mach-primary, #2563eb);border-color:var(--mach-primary, #2563eb)}.mach-toolbar__button:disabled{cursor:not-allowed;opacity:.45}.mach-toolbar__selection{color:var(--mach-primary, #2563eb);background:var(--mach-primary-weak, #dbeafe);border-color:transparent;font-size:12px}.mach-toolbar__select-host{width:82px;padding:0}.mach-toolbar__select-control,.mach-toolbar__select-control .mach-select-trigger{width:100%;height:100%}.mach-toolbar__select-control .mach-select-trigger{border:0;border-radius:5px;background:transparent;box-shadow:none}@media(max-width:640px){.mach-toolbar{align-items:stretch;flex-direction:column}.mach-toolbar__main,.mach-toolbar__aside{flex-wrap:wrap}.mach-toolbar__search{flex:1;width:auto}}.mach-size--compact{--mach-font-size: 12px;--mach-cell-padding: 6px}.mach-size--normal{--mach-font-size: 13px;--mach-cell-padding: 9px}.mach-size--large{--mach-font-size: 14px;--mach-cell-padding: 12px}.mach-root.mach-cell-borders{--mach-cell-border-color: var(--mach-border-color)}.mach-root.mach-theme-dark,.mach-root.mach-theme-dark.mach-size--compact,.mach-root.mach-theme-dark.mach-size--normal,.mach-root.mach-theme-dark.mach-size--large{--mach-border-color: #26324a;--mach-row-border-color: #1c2740;--mach-header-accent-color: #33415e;--mach-header-bg: #101a2e;--mach-header-group-bg: #16213a;--mach-header-fg: #c3cee0;--mach-body-bg: #0d1526;--mach-body-fg: #dbe4f0;--mach-row-hover-bg: #142138;--mach-row-selected-bg: #14304f;--mach-zebra-bg: #0f1a2e;--mach-cell-focus-color: #60a5fa;--mach-primary: #60a5fa;--mach-primary-weak: #1e3a5f;--mach-scrollbar-thumb: #33415e;--mach-success: #4ade80;--mach-warning: #fbbf24;--mach-danger: #f87171;--mach-info: #38bdf8;--mach-shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);--mach-shadow: 0 6px 20px rgba(0, 0, 0, .5);color-scheme:dark}.mach-root *,.mach-root *:before,.mach-root *:after{box-sizing:border-box}.mach-portal,.mach-portal *,.mach-portal *:before,.mach-portal *:after{box-sizing:border-box}.mach-root:focus-visible{outline:2px solid var(--mach-primary);outline-offset:-2px}.mach-header{display:flex;flex-shrink:0;width:100%;height:var(--mach-header-h);background:var(--mach-header-bg);border-bottom:var(--mach-header-border-width) solid var(--mach-header-accent-color);box-shadow:0 1px 2px color-mix(in srgb,var(--mach-header-fg) 8%,transparent);overflow:hidden;position:relative;z-index:3;user-select:none}.mach-body{display:flex;flex:1;min-height:0;width:100%;position:relative;overflow:hidden}.mach-pane{position:relative;overflow:hidden;flex-shrink:0}.mach-pane--center{flex:1 1 auto;min-width:0}.mach-pane--hidden{display:none}.mach-header-viewport{width:100%;height:100%;overflow:hidden}.mach-header-rows{position:relative;height:100%;width:100%}.mach-header-row{position:absolute;left:0}.mach-header-row .mach-header-cell{position:absolute;top:0}.mach-header-cell--group{justify-content:center;border-bottom:var(--mach-border-width) solid var(--mach-border-color);font-weight:var(--mach-header-font-weight);background:var(--mach-header-group-bg)}.mach-header-label--custom{display:inline-flex;align-items:center;min-width:0;overflow:hidden}.mach-header-cell{display:flex;align-items:center;gap:4px;padding:0 var(--mach-cell-padding);border-right:var(--mach-border-width) solid transparent;color:var(--mach-header-fg);font-weight:var(--mach-header-font-weight);font-size:var(--mach-font-size);letter-spacing:.15px;cursor:default;overflow:hidden;white-space:nowrap;background:var(--mach-header-bg);transition:color var(--mach-transition),background-color var(--mach-transition)}.mach-header-cell--leaf:hover{background:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-header-bg))}.mach-header-cell.mach-header-cell--sorted{color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 5%,var(--mach-header-bg))}.mach-root.mach-cell-borders .mach-header-cell{border-right-color:var(--mach-border-color)}.mach-header-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.mach-header-cell--selection{justify-content:center;gap:0;padding:0}.mach-header-cell--selection .mach-header-label:empty{display:none}.mach-sort-indicator{display:inline-flex;align-items:center;gap:3px;color:var(--mach-primary);flex-shrink:0}.mach-sort-indicator svg{width:10px;height:10px}.mach-sort-indicator:empty{display:none}.mach-sort-badge{font-size:9px;line-height:1;padding:1.5px 4px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-weight:600}.mach-filter-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-filter-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-cell:hover .mach-filter-btn,.mach-header-cell:hover .mach-menu-btn{opacity:.62}.mach-filter-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-filter-btn--active{opacity:1;color:var(--mach-primary)}.mach-filter-tag{display:inline-flex;align-items:center;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px;height:16px;line-height:16px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-size:10px;font-weight:500;flex-shrink:0}.mach-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;font-size:12px;line-height:1;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-menu-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-menu-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-resize{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;z-index:2;touch-action:none}.mach-header-resize:hover:after,.mach-header-resize--active:after{content:"";position:absolute;inset:0 3px;background:var(--mach-primary);opacity:.45;border-radius:1px}.mach-column-resize-guide{position:absolute;bottom:0;width:2px;pointer-events:none;background:var(--mach-primary);box-shadow:0 0 0 1px var(--mach-primary-weak);z-index:8}.mach-column-resize-label{position:absolute;top:6px;min-width:52px;padding:3px 7px;border-radius:var(--mach-radius-sm);color:#fff;background:var(--mach-primary);font:600 11px/1.5 var(--mach-font-family);text-align:center;white-space:nowrap;transform:translate(-50%);box-shadow:var(--mach-shadow-sm)}.mach-header-cell--dragging{opacity:.22}.mach-column-drag-ghost{position:fixed;top:0;left:0;z-index:calc(var(--mach-z-menu) + 1);display:flex;align-items:center;height:var(--mach-header-h);max-width:calc(100vw - 16px);padding:0 var(--mach-cell-padding);overflow:hidden;color:var(--mach-body-fg);font:var(--mach-header-font-weight) var(--mach-font-size)/1.3 var(--mach-font-family);text-overflow:ellipsis;white-space:nowrap;pointer-events:none;background:var(--mach-body-bg);border:1px solid var(--mach-primary);border-radius:var(--mach-radius);box-shadow:var(--mach-shadow);opacity:.96;will-change:transform}.mach-drop-indicator{position:absolute;top:3px;left:0;width:2px;height:calc(100% - 6px);border-radius:2px;background:var(--mach-primary);z-index:4;pointer-events:none;will-change:transform}.mach-root--dragging{cursor:grabbing}.mach-root--dragging .mach-header-cell,.mach-root--resizing .mach-header-cell{cursor:default}.mach-root--resizing{cursor:col-resize}.mach-body-viewport{position:relative;width:100%;height:100%;overflow:hidden}.mach-body-viewport--scroll{overflow:auto;overscroll-behavior:contain;overflow-anchor:none}.mach-body-viewport--scroll{scrollbar-width:thin;scrollbar-color:var(--mach-scrollbar-thumb) transparent}.mach-body-viewport--scroll::-webkit-scrollbar{width:10px;height:10px}.mach-body-viewport--scroll::-webkit-scrollbar-track{background:transparent}.mach-body-viewport--scroll::-webkit-scrollbar-thumb{background:var(--mach-scrollbar-thumb);border-radius:999px;border:3px solid transparent;background-clip:padding-box;transition:background-color var(--mach-transition)}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--mach-scrollbar-thumb) 60%,var(--mach-primary));background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:active{background:var(--mach-primary);background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-corner{background:transparent}.mach-row-container{position:relative;width:100%}.mach-row{position:absolute;top:0;left:0;display:flex;width:100%;background:var(--mach-body-bg);border-bottom:var(--mach-border-width) solid var(--mach-row-border-color);contain:layout style}.mach-row,.mach-row .mach-cell{transition:background-color var(--mach-transition)}.mach-root.mach-striped .mach-row--odd,.mach-root.mach-striped .mach-row--odd .mach-cell{background:var(--mach-zebra-bg)}.mach-cell{position:absolute;top:0;display:flex;align-items:center;height:100%;padding:0 var(--mach-cell-padding);border-right:1px solid var(--mach-cell-border-color);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;line-height:calc(var(--mach-row-h) - 2px)}.mach-cell--loading{pointer-events:none}.mach-cell-loading-bar{display:block;height:8px;max-width:132px;border-radius:999px;background:linear-gradient(90deg,var(--mach-row-hover-bg),var(--mach-border-color),var(--mach-row-hover-bg));background-size:200% 100%;animation:mach-cell-loading 1.25s ease-in-out infinite}@keyframes mach-cell-loading{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.mach-cell-loading-bar{animation:none}}.mach-cell--num{justify-content:flex-end}.mach-cell--selection{justify-content:center;padding:0}.mach-cell--editing{padding:0 3px}.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color);border-radius:var(--mach-radius-sm);z-index:1}.mach-cell--selection.mach-cell--focus{box-shadow:none;border-radius:0;z-index:auto}.mach-row--hover,.mach-row--hover .mach-cell{background:var(--mach-row-hover-bg)}.mach-row--selected,.mach-row--selected .mach-cell{background:var(--mach-row-selected-bg)}.mach-row--selected.mach-row--hover,.mach-row--selected.mach-row--hover .mach-cell{background:var(--mach-row-selected-bg);filter:brightness(.985)}input.mach-row-checkbox,input.mach-select-all{width:13px;height:13px;margin:0;accent-color:var(--mach-primary);cursor:pointer;flex-shrink:0}.mach-detail-row{background:var(--mach-zebra-bg);z-index:0}.mach-detail{height:100%;overflow:auto;padding:10px 12px}.mach-cell--detail-toggle{justify-content:center;padding:0;cursor:pointer}.mach-detail-toggle{display:inline-flex;align-items:center;justify-content:center;width:100%;font-size:10px;color:var(--mach-header-fg);transition:transform .15s ease}.mach-detail-toggle--open{transform:rotate(90deg)}.mach-detail-toggle--loading{animation:mach-tree-spin .8s linear infinite;color:var(--mach-primary)}.mach-detail-toggle--error{color:#dc2626}@keyframes mach-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mach-detail-toggle--loading{animation:none}}.mach-cell--group{cursor:pointer;background:var(--mach-header-bg)}.mach-row .mach-cell--group,.mach-row:has(.mach-cell--group){background:var(--mach-header-bg)}.mach-group-label{display:inline-flex;align-items:center;gap:5px;min-width:0;overflow:hidden}.mach-group-text{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-group-count{color:var(--mach-header-fg);font-size:10px;flex-shrink:0;opacity:.8}.mach-tree-cell{display:inline-flex;align-items:center;gap:4px;min-width:0;width:100%}.mach-tree-indent{flex-shrink:0}.mach-tree-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;cursor:pointer}.mach-tree-toggle:hover,.mach-tree-toggle:focus-visible{color:var(--mach-primary);background:var(--mach-primary-weak)}.mach-tree-toggle:focus-visible{outline:1px solid var(--mach-primary);outline-offset:-1px}.mach-tree-toggle>.mach-detail-toggle{width:10px;line-height:1;color:inherit;pointer-events:none}.mach-tree-toggle>.mach-detail-toggle--loading{color:var(--mach-primary)}.mach-tree-toggle>.mach-detail-toggle--error{color:var(--mach-danger)}.mach-tree-toggle-spacer{flex:0 0 20px;width:20px}.mach-tree-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-cell--drag{justify-content:center;padding:0;cursor:grab}.mach-row-drag-handle{display:grid;place-items:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;opacity:.55;cursor:grab;user-select:none;touch-action:none;transition:color var(--mach-transition),background var(--mach-transition),opacity var(--mach-transition)}.mach-row-drag-handle:before{content:"";width:10px;height:14px;background:radial-gradient(circle,currentColor 1.3px,transparent 1.5px) 0 0 / 5px 5px}.mach-row-drag-handle:hover:not(:disabled),.mach-row-drag-handle:focus-visible{opacity:1;color:var(--mach-primary);background:var(--mach-primary-weak);border-color:color-mix(in srgb,var(--mach-primary) 28%,transparent);outline:none}.mach-row-drag-handle:disabled{opacity:.2;cursor:not-allowed}.mach-row-drop-indicator{position:absolute;top:0;left:0;width:100%;height:2px;background:var(--mach-primary);box-shadow:0 0 0 1px color-mix(in srgb,var(--mach-body-bg) 65%,transparent);z-index:5;pointer-events:none;will-change:transform}.mach-row-drop-indicator:before{content:"";position:absolute;left:1px;top:-2px;width:6px;height:6px;border-radius:50%;background:var(--mach-primary)}.mach-pane--center .mach-row-drop-indicator:before,.mach-pane--right .mach-row-drop-indicator:before{display:none}.mach-row-drag-preview{position:absolute;top:0;left:0;z-index:var(--mach-z-overlay);max-width:min(216px,calc(100% - 16px));padding:9px 14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid color-mix(in srgb,var(--mach-primary) 35%,var(--mach-border-color));border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);box-shadow:var(--mach-shadow);font-weight:600;pointer-events:none}.mach-root--row-dragging,.mach-root--row-dragging .mach-cell,.mach-root--row-dragging .mach-row-drag-handle{cursor:grabbing;user-select:none}.mach-root .mach-row--drag-source{opacity:.45}.mach-cell--index{color:var(--mach-header-fg);font-size:calc(var(--mach-font-size) - 1px)}.mach-editor-input.mach-editor-invalid,.mach-editor-invalid .mach-editor-input,.mach-editor-invalid .mach-select-trigger,.mach-editor-invalid input,.mach-editor-invalid select:not([hidden]){border-color:#ef4444!important;box-shadow:0 0 0 1px #ef444459}.mach-editor-validating{cursor:progress;opacity:.72}.mach-footer{display:flex;flex-shrink:0;width:100%;overflow:hidden;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);font-weight:600;color:var(--mach-header-fg);position:relative;z-index:3}.mach-footer-row{position:relative;overflow:hidden;flex-shrink:0}.mach-footer-row--center{flex:1 1 auto;min-width:0}.mach-footer-cell{position:absolute;top:0;display:flex;align-items:center;padding:0 var(--mach-cell-padding);border-right:1px solid transparent;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:100%;font-variant-numeric:tabular-nums}.mach-root.mach-cell-borders .mach-footer-cell{border-right-color:var(--mach-border-color)}.mach-cell--range{background:color-mix(in srgb,var(--mach-primary) 7%,transparent)!important}.mach-cell--range:after{content:"";position:absolute;inset:0;z-index:2;border:0 solid var(--mach-primary);pointer-events:none}.mach-cell--range.mach-cell--range-top:after{border-top-width:1.5px}.mach-cell--range.mach-cell--range-bottom:after{border-bottom-width:1.5px}.mach-cell--range.mach-cell--range-left:after{border-left-width:1.5px}.mach-cell--range.mach-cell--range-right:after{border-right-width:1.5px}.mach-cell--range.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color)}.mach-cell--range.mach-cell--focus:after{display:none}.mach-context-menu{position:fixed;z-index:var(--mach-z-menu);display:flex;flex-direction:column;min-width:140px;padding:5px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow);font-family:var(--mach-font-family);font-size:var(--mach-font-size)}.mach-context-menu-item{text-align:left;padding:6px 10px;border:none;border-radius:var(--mach-radius);background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap}.mach-context-menu-item:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-fill-handle{position:absolute;width:8px;height:8px;border-radius:2px;background:var(--mach-primary);border:1.5px solid var(--mach-body-bg);cursor:crosshair;z-index:6;box-shadow:0 0 0 1px #2563eb59}.mach-root--filling,.mach-root--filling *{user-select:none!important;cursor:crosshair!important}.mach-infinite-loading{position:absolute;left:50%;bottom:14px;transform:translate(-50%);display:flex;align-items:center;gap:8px;padding:5px 14px;border-radius:999px;background:var(--mach-body-bg);border:1px solid var(--mach-border-color);box-shadow:var(--mach-shadow-sm);color:var(--mach-header-fg);font-size:12px;z-index:var(--mach-z-loading)}.mach-infinite-loading .mach-spinner{width:14px;height:14px;border-width:2px}.mach-statusbar{display:flex;align-items:center;gap:18px;flex-shrink:0;height:28px;padding:0 12px;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);color:var(--mach-header-fg);font-size:11px;overflow:hidden;white-space:nowrap;font-variant-numeric:tabular-nums}.mach-statusbar-item--rangeAggregate{margin-left:auto}.mach-pinned-rows{display:flex;width:100%;overflow:hidden;background:var(--mach-header-bg);flex-shrink:0;border-bottom:1px solid var(--mach-border-color)}.mach-pinned-rows--bottom{border-bottom:none;border-top:1px solid var(--mach-border-color)}.mach-pinned-viewport{flex:1 1 auto;min-width:0;overflow:hidden}.mach-pinned-seg{position:relative;overflow:hidden;flex-shrink:0}.mach-pinned-seg--center{position:relative}.mach-pinned-row{position:relative;width:100%;border-bottom:1px solid var(--mach-row-border-color)}.mach-pinned-row .mach-cell{position:absolute;top:0;background:var(--mach-header-bg);font-weight:600;color:var(--mach-header-fg)}.mach-pinned-row:last-child{border-bottom:none}.mach-cell--wrap{white-space:normal;word-break:break-word;line-height:1.45;align-items:flex-start;padding-top:5px;padding-bottom:5px}.mach-editor-input,.mach-editor-select-control .mach-select-trigger{width:100%;height:calc(var(--mach-row-h) - 8px);padding:0 6px;border:1px solid var(--mach-primary);border-radius:var(--mach-radius-sm);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none}.mach-select-control{position:relative;display:inline-flex;min-width:0;font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px)}.mach-select-native[hidden]{display:none!important}.mach-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;height:34px;padding:0 10px;border:1px solid var(--mach-border-color, #e6eaf0);border-radius:var(--mach-radius, 6px);outline:none;color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);font:inherit;line-height:1;text-align:left;cursor:pointer;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-trigger:hover{border-color:color-mix(in srgb,var(--mach-primary, #2563eb) 44%,var(--mach-border-color, #e6eaf0));background:color-mix(in srgb,var(--mach-primary, #2563eb) 3%,var(--mach-body-bg, #fff))}.mach-select-trigger:focus-visible,.mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-select-caret{width:8px;height:8px;flex:0 0 auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform var(--mach-transition, .15s ease)}.mach-select-trigger[aria-expanded=true] .mach-select-caret{transform:translateY(2px) rotate(225deg)}.mach-select-listbox{position:fixed;z-index:var(--mach-z-menu, 1200);display:none;flex-direction:column;gap:2px;min-width:112px;max-width:min(320px,calc(100vw - 16px));max-height:min(244px,calc(100vh - 16px));padding:5px;overflow:auto;overscroll-behavior:contain;border:1px solid color-mix(in srgb,var(--mach-border-color, #e6eaf0) 88%,var(--mach-primary, #2563eb));border-radius:calc(var(--mach-radius-lg, 8px) + 1px);color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg, #1f2937) 18%,transparent),var(--mach-shadow-sm, 0 1px 3px rgba(15, 23, 42, .12));font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px);isolation:isolate}.mach-select-listbox--open{display:flex;animation:mach-select-listbox-in .12s ease-out}.mach-select-option{position:relative;display:flex;align-items:center;flex:0 0 auto;width:100%;min-height:32px;padding:0 30px 0 10px;border:0;border-radius:var(--mach-radius, 6px);outline:none;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer;transition:color var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-option:hover,.mach-select-option:focus-visible,.mach-select-option--active{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 9%,var(--mach-body-bg, #fff))}.mach-select-option[aria-selected=true]{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 13%,var(--mach-body-bg, #fff));font-weight:600}.mach-select-option[aria-selected=true]:after{content:"\2713";position:absolute;right:10px;font-size:12px;font-weight:700}.mach-select-option:disabled{opacity:.42;cursor:not-allowed}@keyframes mach-select-listbox-in{0%{transform:translateY(-3px) scale(.99)}to{transform:translateY(0) scale(1)}}.mach-select-listbox--above{transform-origin:bottom}.mach-filter-select-control{width:100%}.mach-filter-select-trigger{width:100%;background:color-mix(in srgb,var(--mach-header-bg) 62%,var(--mach-body-bg))}.mach-filter-listbox{width:auto}.mach-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:var(--mach-body-bg);z-index:var(--mach-z-overlay)}.mach-overlay-text{color:var(--mach-header-fg);font-size:var(--mach-font-size)}.mach-overlay-content{max-width:min(100%,320px)}.mach-loading{display:grid;justify-items:center;gap:14px;min-width:172px;padding:20px 24px}.mach-loading__visual{position:relative;display:grid;gap:8px;width:132px;padding:14px 16px;overflow:hidden;background:color-mix(in srgb,var(--mach-header-bg) 82%,var(--mach-body-bg));border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow-sm)}.mach-loading__visual:before{content:"";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(100deg,transparent 20%,color-mix(in srgb,var(--mach-primary) 11%,transparent) 50%,transparent 80%);animation:mach-loading-sweep 1.35s ease-in-out infinite}.mach-loading__row{height:7px;border-radius:999px;background:color-mix(in srgb,var(--mach-primary) 13%,var(--mach-border-color))}.mach-loading__row:nth-child(2){width:82%}.mach-loading__row:nth-child(3){width:92%}.mach-loading__row:nth-child(4){width:66%}.mach-loading__status{display:inline-flex;align-items:center;gap:8px;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm)}.mach-loading__spinner{width:14px;height:14px}.mach-loading__label{line-height:1}.mach-spinner{width:22px;height:22px;border:2px solid var(--mach-border-color);border-top-color:var(--mach-primary);border-radius:50%;animation:mach-spin .8s linear infinite}@keyframes mach-spin{to{transform:rotate(360deg)}}@keyframes mach-loading-sweep{to{transform:translate(100%)}}.mach-filter-panel{position:fixed;z-index:var(--mach-z-popup);display:flex;flex-direction:column;gap:10px;width:224px;max-width:calc(100vw - 16px);padding:12px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid color-mix(in srgb,var(--mach-border-color) 88%,var(--mach-primary));border-radius:calc(var(--mach-radius-lg) + 2px);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg) 16%,transparent),var(--mach-shadow-sm);font-family:var(--mach-font-family);font-size:var(--mach-font-size);animation:mach-filter-panel-in .14s ease-out}.mach-filter-body{display:flex;flex-direction:column;gap:8px}.mach-filter-input{width:100%;height:34px;padding:0 10px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none;transition:border-color var(--mach-transition),box-shadow var(--mach-transition)}.mach-filter-input:focus{border-color:var(--mach-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary) 12%,transparent)}@keyframes mach-filter-panel-in{0%{opacity:0;transform:translateY(-3px) scale(.99)}}.mach-filter-set-list{max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-filter-set-item{display:flex;align-items:center;gap:6px;padding:3px 5px;border-radius:var(--mach-radius-sm);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-filter-set-item:hover{background:var(--mach-row-hover-bg)}.mach-filter-set-item input{accent-color:var(--mach-primary);margin:0;width:13px;height:13px}.mach-filter-footer{display:flex;justify-content:flex-end;gap:6px}.mach-filter-footer button{padding:4px 12px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:var(--mach-font-size);cursor:pointer}.mach-filter-footer button:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-filter-btn-apply{background:var(--mach-primary)!important;border-color:var(--mach-primary)!important;color:#fff!important}.mach-filter-btn-apply:hover{opacity:.9;color:#fff!important}.mach-column-panel{min-width:220px;max-height:70vh;overflow:auto}.mach-column-panel[role=dialog]{width:min(440px,calc(100vw - 16px))}.mach-column-workbench-search{box-sizing:border-box;width:100%;height:30px;padding:0 9px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);font:inherit;outline:none}.mach-column-workbench-search:focus{border-color:var(--mach-primary);box-shadow:0 0 0 2px var(--mach-primary-weak)}.mach-column-panel-title{font-weight:600;color:var(--mach-header-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-column-panel-subtitle{font-size:11px;color:var(--mach-header-fg);margin-top:2px}.mach-column-panel-actions{display:flex;gap:6px;flex-wrap:wrap}.mach-column-panel-btn{flex:1;min-width:60px;padding:4px 8px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:12px;cursor:pointer;white-space:nowrap}.mach-column-panel-btn:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-column-panel-divider{height:1px;background:var(--mach-border-color);margin:4px 0}.mach-column-panel-list{max-height:280px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-column-workbench-item{display:grid;grid-template-columns:minmax(120px,1fr) 108px 26px 26px;align-items:center;gap:4px;min-height:32px;padding:2px 3px;border-radius:var(--mach-radius)}.mach-column-workbench-item:hover{background:var(--mach-row-hover-bg)}.mach-column-workbench-label{display:flex;min-width:0;align-items:center;gap:7px;cursor:pointer}.mach-column-workbench-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-column-workbench-pin-control,.mach-column-workbench-move{height:26px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:inherit;font:inherit}.mach-column-workbench-pin-control{width:108px;border:0}.mach-column-workbench-pin-control .mach-select-trigger{width:100%;height:26px;padding:0 7px;border-radius:var(--mach-radius);font-size:12px;box-shadow:none}.mach-column-workbench-move{padding:0;cursor:pointer}.mach-column-workbench-move:disabled{cursor:not-allowed;opacity:.35}.mach-tag{display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:20px;line-height:18px;border-radius:999px;font-size:var(--mach-font-size-sm);font-weight:500;white-space:nowrap}.mach-tag:before{content:"";width:5px;height:5px;border-radius:999px;background:currentColor}.mach-tag--success{color:var(--mach-success);background:color-mix(in srgb,var(--mach-success) 10%,transparent)}.mach-tag--warning{color:var(--mach-warning);background:color-mix(in srgb,var(--mach-warning) 12%,transparent)}.mach-tag--danger{color:var(--mach-danger);background:color-mix(in srgb,var(--mach-danger) 10%,transparent)}.mach-tag--info{color:var(--mach-info);background:color-mix(in srgb,var(--mach-info) 10%,transparent)}.mach-tag--neutral{color:var(--mach-header-fg);background:color-mix(in srgb,var(--mach-header-fg) 10%,transparent)}.mach-progress{display:flex;align-items:center;gap:6px;width:100%}.mach-progress__track{flex:1;min-width:0;height:6px;border-radius:999px;background:color-mix(in srgb,var(--mach-header-fg) 14%,transparent);overflow:hidden}.mach-progress__bar{height:100%;border-radius:999px;background:var(--mach-primary);transition:width var(--mach-transition)}.mach-progress__label{flex-shrink:0;font-size:var(--mach-font-size-sm);color:var(--mach-header-fg);font-variant-numeric:tabular-nums}.mach-link{color:var(--mach-primary);cursor:pointer}.mach-link:hover{text-decoration:underline}.mach-actions{display:inline-flex;align-items:center;gap:2px}.mach-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.mach-action-btn{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm);line-height:1;cursor:pointer;white-space:nowrap;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-action-btn:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-action-btn--danger:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);color:var(--mach-danger);transform:scale(1.06)}.mach-action-btn--success:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);color:var(--mach-success);transform:scale(1.06)}.mach-action-btn--primary{color:var(--mach-primary)}.mach-action-btn--warning{color:var(--mach-warning)}.mach-action-btn--success,.mach-edit-control--confirm{color:var(--mach-success)}.mach-action-btn--danger{color:var(--mach-danger)}.mach-action-btn:focus-visible,.mach-edit-control:focus-visible,.mach-cell-edit-trigger:focus-visible,.mach-action-drawer__close:focus-visible{outline:2px solid color-mix(in srgb,var(--mach-primary) 65%,transparent);outline-offset:1px}.mach-action-btn:disabled{cursor:not-allowed;opacity:.4}.mach-action-btn--loading svg{animation:mach-spin .8s linear infinite}.mach-dictionary-value--loading{color:var(--mach-header-fg);opacity:.72}.mach-dictionary-value--error{text-decoration:underline dotted;text-underline-offset:3px}.mach-action-btn--icon{padding:0;width:24px}.mach-context-menu-item--danger{color:var(--mach-danger)}.mach-context-menu-item,.mach-action-drawer__item{display:flex;align-items:center;gap:9px}.mach-context-menu-item--primary,.mach-action-drawer__item--primary{color:var(--mach-primary)}.mach-context-menu-item--warning,.mach-action-drawer__item--warning{color:var(--mach-warning)}.mach-context-menu-item--success,.mach-action-drawer__item--success{color:var(--mach-success)}.mach-context-menu-item--danger,.mach-action-drawer__item--danger{color:var(--mach-danger)}.mach-action-drawer-backdrop{position:fixed;inset:0;z-index:calc(var(--mach-z-menu) + 2);background:#0f172a33;backdrop-filter:blur(1px)}.mach-action-drawer{position:absolute;top:0;right:0;display:flex;flex-direction:column;width:min(340px,calc(100vw - 24px));height:100%;background:var(--mach-body-bg);color:var(--mach-body-fg);border-left:1px solid var(--mach-border-color);box-shadow:-16px 0 40px #0f172a24;font-family:var(--mach-font-family);animation:mach-drawer-in .18s ease-out}.mach-action-drawer__header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:0 16px 0 20px;border-bottom:1px solid var(--mach-border-color)}.mach-action-drawer__close{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:var(--mach-radius);background:transparent;color:var(--mach-header-fg);cursor:pointer}.mach-action-drawer__close:hover{color:var(--mach-primary);background:var(--mach-row-hover-bg)}.mach-action-drawer__body{display:flex;flex-direction:column;gap:4px;padding:12px;overflow:auto}.mach-action-drawer__item{width:100%;min-height:40px;padding:0 12px;border:0;border-radius:var(--mach-radius);background:transparent;font:inherit;text-align:left;cursor:pointer}.mach-action-drawer__item:hover:not(:disabled){background:var(--mach-row-hover-bg)}.mach-action-drawer__item:disabled{opacity:.4;cursor:not-allowed}@keyframes mach-drawer-in{0%{transform:translate(18px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:640px){.mach-action-drawer{top:auto;bottom:0;width:100%;height:auto;max-height:min(70vh,520px);border-top:1px solid var(--mach-border-color);border-left:0;border-radius:var(--mach-radius-lg) var(--mach-radius-lg) 0 0;animation-name:mach-drawer-up}}@keyframes mach-drawer-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.mach-cell:has(.mach-cell-edit-trigger){padding-right:29px}.mach-cell-edit-trigger{position:absolute;right:5px;top:50%;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;transform:translateY(-50%);border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;opacity:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-cell-edit-trigger svg{width:13px;height:13px}.mach-cell:hover .mach-cell-edit-trigger--hover,.mach-cell:focus-within .mach-cell-edit-trigger--hover,.mach-cell-edit-trigger--always{opacity:.72}.mach-cell-edit-trigger:hover{opacity:1;color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 9%,transparent)}.mach-cell--editing{overflow:visible;z-index:4}.mach-cell-editor-shell,.mach-row-editor-shell{display:flex;align-items:center;width:100%;min-width:0;gap:5px}.mach-cell-editor-shell>.mach-editor-input,.mach-cell-editor-shell>.mach-editor-select-control,.mach-cell-editor-shell>:not(.mach-cell-editor-controls),.mach-row-editor-shell>*{flex:1 1 auto;min-width:0}.mach-cell-editor-controls{display:inline-flex;flex:0 0 auto;align-items:center;gap:2px;padding:2px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);box-shadow:var(--mach-shadow-sm)}.mach-edit-control{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-edit-control svg{width:14px;height:14px}.mach-edit-control--confirm{color:var(--mach-success)}.mach-edit-control--confirm:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);transform:scale(1.06)}.mach-edit-control--cancel{color:var(--mach-danger)}.mach-edit-control--cancel:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);transform:scale(1.06)}.mach-edit-control:disabled{opacity:.35;cursor:wait}.mach-row--editing,.mach-row--editing .mach-cell{background:color-mix(in srgb,var(--mach-primary) 3%,var(--mach-body-bg))}.mach-cell--row-editing .mach-editor-input,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger{border-color:color-mix(in srgb,var(--mach-primary) 45%,var(--mach-border-color));box-shadow:0 1px 2px #0f172a0a}.mach-cell--row-editing .mach-editor-input:focus,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger:focus-visible,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary) 12%,transparent)}.mach-tooltip{position:fixed;z-index:var(--mach-z-menu);max-width:320px;padding:6px 10px;border-radius:var(--mach-radius);background:var(--mach-body-fg);color:var(--mach-body-bg);font-size:var(--mach-font-size-sm);line-height:1.5;box-shadow:var(--mach-shadow);pointer-events:none;word-break:break-word}.mach-cell--flash{animation:mach-flash .8s ease-out}@keyframes mach-flash{0%{background-color:color-mix(in srgb,var(--mach-primary) 35%,transparent)}to{background-color:transparent}}.mach-context-menu-separator{height:1px;margin:4px 6px;background:var(--mach-border-color)}.mach-context-menu-item:disabled{opacity:.45;cursor:not-allowed}.mach-pagination{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-shrink:0;height:40px;padding:0 12px;background:var(--mach-body-bg);border-top:var(--mach-border-width) solid var(--mach-border-color);color:var(--mach-body-fg);font-size:var(--mach-font-size-sm);user-select:none}.mach-pagination-total{color:var(--mach-header-fg);margin-right:8px;font-variant-numeric:tabular-nums}.mach-pagination-page{min-width:72px;text-align:center;color:var(--mach-body-fg);font-variant-numeric:tabular-nums}.mach-pagination-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:var(--mach-border-width) solid var(--mach-border-color);border-radius:var(--mach-radius-sm);background:var(--mach-body-bg);color:var(--mach-header-fg);font-size:13px;line-height:1;cursor:pointer;transition:border-color var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-pagination-btn:hover:not(:disabled){border-color:var(--mach-primary);color:var(--mach-primary)}.mach-pagination-btn:disabled{opacity:.35;cursor:not-allowed}.mach-pagination-size-control{height:24px;margin-left:6px;width:92px;font-size:var(--mach-font-size-sm)}.mach-pagination-size-control .mach-select-trigger{width:100%;height:24px;padding:0 6px;border-width:var(--mach-border-width);border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);box-shadow:none}.mach-watermark{position:absolute;inset:0;z-index:6;pointer-events:none;background-repeat:repeat}.mach-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:32px 16px;min-height:160px}.mach-empty__icon{margin-bottom:6px}.mach-empty__title{font-size:var(--mach-font-size);color:var(--mach-body-fg);font-weight:500}.mach-empty__hint{font-size:var(--mach-font-size-sm);color:var(--mach-header-fg)}@media(prefers-reduced-motion:reduce){.mach-spinner,.mach-loading__visual:before{animation-duration:2.4s}}.mach-cell--center{justify-content:center}.mach-cell--right{justify-content:flex-end}.mach-header-cell--center .mach-header-label{text-align:center}.mach-header-cell--right .mach-header-label{text-align:right}@media(prefers-reduced-motion:reduce){.mach-root *,.mach-root *:before,.mach-root *:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.mach-action-drawer{animation:none!important}}.mach-root{--mach-row-warning-bg: color-mix(in srgb, var(--mach-warning) 11%, var(--mach-body-bg));--mach-row-danger-bg: color-mix(in srgb, var(--mach-danger) 9%, var(--mach-body-bg));--mach-row-success-bg: color-mix(in srgb, var(--mach-success) 10%, var(--mach-body-bg));--mach-row-info-bg: color-mix(in srgb, var(--mach-info) 10%, var(--mach-body-bg))}.mach-row--styled[data-row-tone=warning]{--mach-row-rule-bg: var(--mach-row-warning-bg)}.mach-row--styled[data-row-tone=danger]{--mach-row-rule-bg: var(--mach-row-danger-bg)}.mach-row--styled[data-row-tone=success]{--mach-row-rule-bg: var(--mach-row-success-bg)}.mach-row--styled[data-row-tone=info]{--mach-row-rule-bg: var(--mach-row-info-bg)}.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled,.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled .mach-cell{background-color:var(--mach-row-rule-bg, var(--mach-body-bg));color:var(--mach-row-rule-fg, var(--mach-body-fg))}.mach-root .mach-row--styled.mach-row--hover,.mach-root .mach-row--styled.mach-row--hover .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-row-rule-bg, var(--mach-body-bg)))}.mach-root .mach-row--styled.mach-row--selected,.mach-root .mach-row--styled.mach-row--selected .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 12%,var(--mach-row-rule-bg, var(--mach-body-bg)))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _multirange = require('@agile-team/mach-table/multi-range'); _createStarExport(_multirange);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/multi-range';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/multi-range';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@agile-team/mach-table/multi-range";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _ordering = require('@agile-team/mach-table/ordering'); _createStarExport(_ordering);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/ordering';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/ordering';
|
package/dist/ordering.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@agile-team/mach-table/ordering";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _preferences = require('@agile-team/mach-table/preferences'); _createStarExport(_preferences);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/preferences';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/preferences';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@agile-team/mach-table/preferences";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _serverside = require('@agile-team/mach-table/server-side'); _createStarExport(_serverside);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mach-server-header,.mach-server-cell,.mach-server-paging{display:flex;align-items:center;gap:6px;min-width:0;font:inherit;color:inherit}.mach-server-header{flex-wrap:wrap;gap:4px}.mach-server-cell{width:100%;box-sizing:border-box}.mach-server-cell input[type=checkbox]{flex:none;accent-color:var(--mach-primary,#2563eb);width:14px;height:14px;margin:0 2px}.mach-server-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:20px}.mach-server-paging{margin-inline-start:auto;flex:none;font-size:11px;gap:3px}.mach-server-range{font-variant-numeric:tabular-nums;opacity:.72;white-space:nowrap}.mach-server-button{font:inherit;font-size:11px;line-height:20px;min-width:22px;padding:0 5px;border:1px solid transparent;border-radius:4px;background:transparent;color:inherit;cursor:pointer;white-space:nowrap}.mach-server-button:hover:not(:disabled){background:var(--mach-row-hover-bg,rgba(128,140,160,.12));border-color:var(--mach-border-color,#d9e1eb)}.mach-server-button:focus-visible{outline:2px solid var(--mach-primary,#2563eb);outline-offset:1px}.mach-server-button:disabled{opacity:.35;cursor:default}.mach-server-sync-notice{position:absolute;inset-inline-start:8px;top:5px;z-index:15;max-width:calc(100% - 16px);box-sizing:border-box;padding:6px 10px;border:1px solid var(--mach-border-color,#d9e1eb);border-radius:5px;background:var(--mach-header-bg,#f4f7fb);color:var(--mach-header-fg,#344054);box-shadow:0 2px 8px #0f172a1f;font-size:12px;line-height:18px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/server-side';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/server-side';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@agile-team/mach-table/server-side";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _workbench = require('@agile-team/mach-table/workbench'); _createStarExport(_workbench);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mach-workbench{--wb-bg: var(--mach-body-bg, #fff);--wb-fg: var(--mach-body-fg, #26303f);--wb-muted: var(--mach-header-fg, #475467);--wb-border: var(--mach-border-color, #e6eaf0);--wb-soft: var(--mach-header-bg, #f4f7fb);--wb-primary: var(--mach-primary, #2563eb);--wb-danger: var(--mach-danger, #b42318);display:flex;flex-direction:column;gap:12px;max-height:min(760px,80vh);min-width:0;padding:18px;border:1px solid var(--wb-border);border-radius:var(--mach-radius-lg, 8px);background:var(--wb-bg);color:var(--wb-fg);box-shadow:var(--mach-shadow-sm, 0 2px 12px #0f172a0d);font:var(--mach-font-size, 13px)/1.6 var(--mach-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif);color-scheme:light}.mach-workbench[data-theme=dark]{--wb-bg: var(--mach-body-bg, #0d1526);--wb-fg: var(--mach-body-fg, #dbe4f0);--wb-muted: var(--mach-header-fg, #c3cee0);--wb-border: var(--mach-border-color, #33415e);--wb-soft: var(--mach-header-bg, #16213a);--wb-primary: var(--mach-primary, #60a5fa);--wb-danger: var(--mach-danger, #f87171);color-scheme:dark}.mach-workbench,.mach-workbench *{box-sizing:border-box}.mach-workbench__header,.mach-workbench__footer,.mach-workbench__tools,.mach-workbench__values{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.mach-workbench__header{justify-content:space-between;padding-bottom:12px;border-bottom:1px solid var(--wb-border)}.mach-workbench__title{margin:0;font-size:15px;font-weight:650;letter-spacing:.015em}.mach-workbench__body{min-height:100px;overflow:auto;padding:2px;overscroll-behavior:contain}.mach-workbench__footer{justify-content:flex-end;padding-top:12px;border-top:1px solid var(--wb-border)}.mach-workbench__button,.mach-workbench__input{min-height:34px;max-width:100%;margin:0;padding:6px 10px;border:1px solid var(--wb-border);border-radius:var(--mach-radius, 6px);color:var(--wb-fg);background:var(--wb-bg);font:inherit}.mach-workbench__button{cursor:pointer;white-space:nowrap}.mach-workbench__button:hover:not(:disabled){border-color:var(--wb-primary);background:var(--wb-soft)}.mach-workbench__button:disabled{cursor:default;opacity:.5}.mach-workbench__button--primary{border-color:var(--wb-primary);background:var(--wb-primary);color:var(--wb-bg);font-weight:600}.mach-workbench__button--primary:hover:not(:disabled){background:var(--wb-primary);filter:brightness(.94)}.mach-workbench :is(button,input,select,a):focus-visible{outline:2px solid var(--wb-primary);outline-offset:2px}.mach-workbench__input{width:auto;min-width:min(160px,100%)}.mach-workbench__input[type=number],.mach-workbench__input[type=date]{width:170px}.mach-workbench__input[type=text]{flex:1;min-width:min(200px,100%)}.mach-workbench__group{margin:10px 0;padding:12px;border:1px solid var(--wb-border);border-left:3px solid var(--wb-primary);border-radius:6px;min-width:0}.mach-workbench__group legend{padding:0 6px;color:var(--wb-muted);font-weight:600}.mach-workbench__group>.mach-workbench__button{margin-right:8px}.mach-workbench__condition{display:flex;flex-wrap:wrap;align-items:start;gap:8px;margin:12px 0;padding:12px;background:var(--wb-soft);border:1px solid var(--wb-border);border-radius:6px}.mach-workbench__values{flex:1 1 100%}.mach-workbench__dictionary{flex:1 1 100%;min-height:96px}.mach-workbench__check{display:inline-flex;gap:6px;align-items:center;white-space:nowrap}.mach-workbench__hint{flex:1 1 100%;color:var(--wb-muted)}.mach-workbench__status{min-height:24px;margin:0;color:var(--wb-muted)}.mach-workbench__status{white-space:pre-line}.mach-review__row{margin-bottom:14px;padding:12px;border:1px solid var(--wb-border);border-radius:6px;overflow:auto}.mach-review__title{flex:1;margin:0;font-size:13px;font-weight:650}.mach-review__table{width:100%;border-collapse:collapse;margin:10px 0}.mach-review__table th,.mach-review__table td{padding:7px 10px;text-align:left;border-bottom:1px solid var(--wb-border);max-width:300px;overflow-wrap:anywhere}.mach-review__table thead{background:var(--wb-soft)}.mach-review__old{color:var(--wb-muted)}.mach-review__new{font-weight:600}.mach-review__issue{color:var(--wb-danger);overflow-wrap:anywhere}.mach-review__cell--issue{border-left:3px solid var(--wb-danger)}.mach-review__server pre{overflow:auto;max-height:180px;white-space:pre-wrap}.mach-diagnostics__overview{display:grid;grid-template-columns:max-content 1fr;gap:6px 16px}.mach-diagnostics__overview dt{color:var(--wb-muted)}.mach-diagnostics__overview dd{margin:0;font-variant-numeric:tabular-nums}.mach-diagnostics__section{padding:12px 0;border-top:1px solid var(--wb-border)}.mach-diagnostics__section h3{margin:0 0 10px;font-size:13px}.mach-diagnostics__section pre{max-height:240px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.mach-diagnostics__rules{padding-left:22px}.mach-diagnostics__rules li{margin:6px 0}.mach-cell.mach-cell--multi-range{background-image:linear-gradient(color-mix(in srgb,var(--mach-primary, #2563eb) 10%,transparent),color-mix(in srgb,var(--mach-primary, #2563eb) 10%,transparent));outline:1px solid var(--mach-cell-focus-color, #2563eb);outline-offset:-1px}.mach-analysis__settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.mach-analysis__settings>fieldset{grid-column:1 / -1;margin:0}.mach-analysis__dimension{display:flex;flex-direction:column;gap:6px;font-weight:600}.mach-analysis__dimension select{min-height:110px;width:100%;font-weight:400}.mach-analysis__dimension small{font-weight:400}.mach-analysis__settings .mach-workbench__values{margin-bottom:8px}.mach-analysis__results{margin-top:20px;display:grid;gap:12px}.mach-analysis__chart{margin:0;padding:12px;border:1px solid var(--wb-border);border-radius:6px;background:var(--wb-bg)}.mach-analysis__chart svg{display:block;width:100%;max-height:300px;color:var(--wb-primary)}.mach-analysis__chart figcaption{margin-top:8px}.mach-analysis__table-wrap{overflow:auto;max-height:420px;border:1px solid var(--wb-border);border-radius:6px}.mach-analysis__table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}.mach-analysis__table caption{padding:8px;text-align:left;color:var(--wb-muted)}.mach-analysis__table th,.mach-analysis__table td{padding:8px 12px;border-bottom:1px solid var(--wb-border);white-space:nowrap;text-align:right}.mach-analysis__table th:first-child{text-align:left}.mach-analysis__table thead,.mach-analysis__table tfoot{background:var(--wb-soft);font-weight:600}.mach-analysis__table thead th{position:sticky;top:0;background:var(--wb-soft)}.mach-workbench__status--error{color:var(--wb-danger)}.mach-workbench__empty{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:28px 12px;color:var(--wb-muted)}@media(max-width:560px){.mach-workbench{padding:12px}.mach-workbench__group{padding:8px}.mach-workbench__values>.mach-workbench__input{flex:1 1 100%;width:100%}.mach-analysis__settings{grid-template-columns:minmax(0,1fr)}}@media(forced-colors:active){.mach-workbench,.mach-workbench[data-theme]{--wb-bg: Canvas;--wb-fg: CanvasText;--wb-muted: CanvasText;--wb-border: CanvasText;--wb-soft: Canvas;--wb-primary: Highlight;--wb-danger: CanvasText;box-shadow:none}.mach-workbench__button--primary{color:HighlightText;background:Highlight}.mach-workbench__status--error{border-left:3px solid CanvasText;padding-left:8px}.mach-cell.mach-cell--multi-range{background-image:none;outline:2px solid Highlight;outline-offset:-2px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/workbench';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agile-team/mach-table/workbench';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@agile-team/mach-table/workbench";
|
package/dist/workflows.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkII7TCYIUcjs = require('./chunk-II7TCYIU.cjs');var _react = require('react');var _machtable = require('@agile-team/mach-table');function ee(t,a={}){let[v,R]=_react.useState.call(void 0, []),[w,Q]=_react.useState.call(void 0, []),[D,l]=_react.useState.call(void 0, !1),[M,y]=_react.useState.call(void 0, null),[i,F]=_react.useState.call(void 0, null),S=_react.useRef.call(void 0, !1),g=_react.useCallback.call(void 0, ()=>{let r=t.apiRef.current;if(!r||r.isDestroyed()){Q([]),R([]);return}Q(r.editing.getDirtyRowIds()),R(r.editing.getChanges())},[t.apiRef]);_react.useEffect.call(void 0, ()=>{let r=t.api;return g(),r&&!r.isDestroyed()?r.on("dirtyStateChanged",g):void 0},[t.api,g]);let P=_react.useCallback.call(void 0, async(r,u)=>{let d=t.apiRef.current;if(!d||d.isDestroyed())throw new Error("[MachTable] Cannot save before the grid is ready.");if(S.current)throw new Error("[MachTable] A save operation is already in progress.");S.current=!0,l(!0),y(null),F(null);try{let o=await d.editing.save(r,u);return F(o),g(),_optionalChain([a, 'access', _2 => _2.onSaveSuccess, 'optionalCall', _3 => _3(o.saved)]),_optionalChain([a, 'access', _4 => _4.onSaveResult, 'optionalCall', _5 => _5(o)]),o}catch(o){throw y(o),_optionalChain([a, 'access', _6 => _6.onSaveError, 'optionalCall', _7 => _7(o)]),o}finally{S.current=!1,l(!1)}},[a,g,t.apiRef]),N=_react.useCallback.call(void 0, async(r,u)=>(await P(r,u)).saved,[P]),L=_react.useCallback.call(void 0, ()=>F(null),[]),V=_react.useCallback.call(void 0, (r,u)=>{let d=_optionalChain([i, 'optionalAccess', _8 => _8.conflicts, 'access', _9 => _9.find, 'call', _10 => _10(T=>T.rowId===r)]),o=t.apiRef.current;return!i||!d||!o||!_machtable.resolveSaveConflict.call(void 0, o,d,u)?!1:(F({...i,failures:i.failures,conflicts:i.conflicts.filter(T=>T.rowId!==r)}),g(),!0)},[i,g,t.apiRef]),U=_react.useCallback.call(void 0, r=>{let u=_nullishCoalesce(_optionalChain([t, 'access', _11 => _11.apiRef, 'access', _12 => _12.current, 'optionalAccess', _13 => _13.editing, 'access', _14 => _14.rollback, 'call', _15 => _15(r)]), () => (!1));return g(),u},[g,t.apiRef]),j=_react.useCallback.call(void 0, r=>{_optionalChain([t, 'access', _16 => _16.apiRef, 'access', _17 => _17.current, 'optionalAccess', _18 => _18.editing, 'access', _19 => _19.markSaved, 'call', _20 => _20(r)]),g()},[g,t.apiRef]),q=_react.useCallback.call(void 0, (r,u,d=!1)=>{let o=t.apiRef.current,T=_optionalChain([o, 'optionalAccess', _21 => _21.rows, 'access', _22 => _22.getById, 'call', _23 => _23(r)]);return!o||!T||T.rowIndex<0?!1:(o.view.scrollToRow(T.rowIndex,"middle"),u&&d?o.editing.startCell({rowIndex:T.rowIndex,colId:u}):!0)},[t.apiRef]);_react.useEffect.call(void 0, ()=>{if(!a.guardBeforeUnload||typeof window>"u")return;let r=u=>{if(w.length===0)return;let d=_nullishCoalesce(a.beforeUnloadMessage, () => ("\u5B58\u5728\u672A\u4FDD\u5B58\u7684\u8868\u683C\u4FEE\u6539\u3002"));return u.preventDefault(),u.returnValue=d,d};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[w.length,a.beforeUnloadMessage,a.guardBeforeUnload]);let O=_react.useMemo.call(void 0, ()=>[..._nullishCoalesce(_optionalChain([i, 'optionalAccess', _24 => _24.failures]), () => ([])),..._nullishCoalesce(_optionalChain([i, 'optionalAccess', _25 => _25.conflicts]), () => ([]))],[i]),W=_react.useMemo.call(void 0, ()=>[...new Set(O.map(r=>r.rowId))],[O]);return _react.useMemo.call(void 0, ()=>({changes:v,dirtyRowIds:w,dirty:w.length>0,saving:D,saveError:M,lastSaveResult:i,saveIssues:O,failedRowIds:W,save:N,saveDetailed:P,clearSaveIssues:L,resolveConflict:V,rollback:U,markSaved:j,reveal:q,refresh:g}),[v,L,w,W,i,j,g,V,q,U,N,P,M,O,D])}function re(t,a){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):a}function Ue(t){return(t instanceof DOMException||typeof t=="object"&&t!=null&&"name"in t)&&t.name==="AbortError"}function qe(t){return typeof t=="function"?t():t}function Oe(t){let a=_react.useRef.call(void 0, t);a.current=t;let[v,R]=_react.useState.call(void 0, []),[w,Q]=_react.useState.call(void 0, !1),[D,l]=_react.useState.call(void 0, null),[M,y]=_react.useState.call(void 0, re(t.initialPage,1)),[i,F]=_react.useState.call(void 0, re(t.pageSize,20)),[S,g]=_react.useState.call(void 0, 0),[P,N]=_react.useState.call(void 0, []),[L,V]=_react.useState.call(void 0, {}),[U,j]=_react.useState.call(void 0, null),[q,O]=_react.useState.call(void 0, _nullishCoalesce(t.initialQuickFilterText, () => (null))),[,W]=_react.useReducer.call(void 0, e=>e+1,0),r=_react.useRef.call(void 0, {page:M,pageSize:i,sortModel:P,filterModel:L,advancedFilterModel:U,quickFilterText:q,rows:v});r.current={page:M,pageSize:i,sortModel:P,filterModel:L,advancedFilterModel:U,quickFilterText:q,rows:v};let u=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, null),o=_react.useRef.call(void 0, null),T=_react.useRef.call(void 0, 0),C=_react.useRef.call(void 0, new Set),x=_react.useRef.call(void 0, new Set),h=_react.useRef.call(void 0, new Map),I=_react.useRef.call(void 0, !1),K=_react.useRef.call(void 0, !1),$=_react.useRef.call(void 0, !1),p=_react.useCallback.call(void 0, e=>{let n=a.current.rowKey,s=typeof n=="function"?n(e):_machtable.getByPath.call(void 0, e,n);if(s==null||String(s).length===0)throw new Error(`[MachTable] useMachTableQuery rowKey "${String(n)}" returned an empty value.`);return String(s)},[]),H=_react.useCallback.call(void 0, e=>I.current?!x.current.has(e):C.current.has(e),[]),k=_react.useCallback.call(void 0, ()=>W(),[]),A=_react.useCallback.call(void 0, ()=>{let e=u.current;if(!(!e||e.isDestroyed())){$.current=!0;try{e.selection.setRows(r.current.rows.filter(n=>H(p(n))),!0)}finally{$.current=!1}}},[p,H]),te=_react.useCallback.call(void 0, ()=>{T.current++,_optionalChain([d, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.abort, 'call', _28 => _28()]),d.current=null,o.current&&clearTimeout(o.current),o.current=null,Q(!1)},[]),X=_react.useCallback.call(void 0, (e,n)=>e.signal.aborted||n!==T.current,[]),ne=_react.useCallback.call(void 0, (e,n,s)=>{if(X(n,s))return;if(!e||!Array.isArray(e.rows)||!Number.isFinite(e.total)||e.total<0)throw new TypeError("[MachTable] Remote request must resolve to { rows: TData[], total: non-negative number }.");let c=[...e.rows];for(let Y of c){let Z=p(Y);H(Z)?h.current.set(Z,Y):h.current.delete(Z)}r.current.rows=c,R(c),g(Math.floor(e.total)),k(),_optionalChain([a, 'access', _29 => _29.current, 'access', _30 => _30.onSuccess, 'optionalCall', _31 => _31(e)]),queueMicrotask(A)},[X,k,p,H,A]),ae=_react.useCallback.call(void 0, (e,n,s)=>{if(X(n,s)||Ue(e))return;let c=_nullishCoalesce(e, () => (new Error("Remote request failed")));l(c),_optionalChain([a, 'access', _32 => _32.current, 'access', _33 => _33.onError, 'optionalCall', _34 => _34(c)])},[X]),oe=_react.useCallback.call(void 0, (e,n)=>{n===T.current&&(Q(!1),d.current===e&&(d.current=null))},[]),m=_react.useCallback.call(void 0, async()=>{o.current&&clearTimeout(o.current),o.current=null,_optionalChain([d, 'access', _35 => _35.current, 'optionalAccess', _36 => _36.abort, 'call', _37 => _37()]);let e=new AbortController;d.current=e;let n=++T.current;Q(!0),l(null),a.current.keepPreviousData===!1&&(r.current.rows=[],R([]));let s=r.current;try{let c=await a.current.request({page:s.page,pageSize:s.pageSize,query:qe(a.current.query),sortModel:s.sortModel.map(Y=>({...Y})),filterModel:{...s.filterModel},advancedFilterModel:_machtable.normalizeAdvancedFilterModel.call(void 0, s.advancedFilterModel),quickFilterText:s.quickFilterText,signal:e.signal});ne(c,e,n)}catch(c){ae(c,e,n)}finally{oe(e,n)}},[ne,oe,ae]),B=_react.useCallback.call(void 0, e=>{e&&(r.current.page=1,y(1)),_optionalChain([d, 'access', _38 => _38.current, 'optionalAccess', _39 => _39.abort, 'call', _40 => _40()]),d.current=null;let n=Math.max(0,_nullishCoalesce(a.current.debounceMs, () => (0)));o.current&&clearTimeout(o.current),n===0?m():o.current=setTimeout(()=>{m()},n)},[m]),z=_react.useCallback.call(void 0, ()=>{let e=I.current||C.current.size>0||x.current.size>0||h.current.size>0;I.current=!1,C.current.clear(),x.current.clear(),h.current.clear(),e&&k(),$.current=!0;try{_optionalChain([u, 'access', _41 => _41.current, 'optionalAccess', _42 => _42.selection, 'access', _43 => _43.clear, 'call', _44 => _44()])}finally{$.current=!1}},[k]),le=_react.useCallback.call(void 0, e=>{if(K.current)return;let n=r.current;e.page===n.page&&e.pageSize===n.pageSize||(n.page=e.page,n.pageSize=e.pageSize,y(e.page),F(e.pageSize),a.current.mode!=="manual"&&m())},[m]),ie=_react.useCallback.call(void 0, e=>{if(K.current)return;let n=e.sortModel.map(s=>({...s}));r.current.sortModel=n,N(n),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},[B]),se=_react.useCallback.call(void 0, e=>{if(K.current)return;let n={...e.filterModel};r.current.filterModel=n;let s=_machtable.normalizeAdvancedFilterModel.call(void 0, e.advancedFilterModel);r.current.advancedFilterModel=s,r.current.quickFilterText=e.api.filtering.getQuickText(),V(n),j(s),O(r.current.quickFilterText),a.current.clearSelectionOnQueryChange!==!1&&z(),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},[z,B]),ce=_react.useCallback.call(void 0, e=>{if($.current)return;let n=new Set(r.current.rows.map(p)),s=new Set(e.selectedRows.map(p));if(I.current)for(let c of n)s.has(c)?x.current.delete(c):(x.current.add(c),h.current.delete(c));else{if((_nullishCoalesce(a.current.selectionScope, () => ("preserve")))==="page")C.current.clear(),h.current.clear();else for(let c of n)C.current.delete(c),h.current.delete(c);for(let c of e.selectedRows)C.current.add(p(c))}for(let c of e.selectedRows)h.current.set(p(c),c);k()},[k,p]),Me=_react.useCallback.call(void 0, async(e={})=>{e.resetPage&&(r.current.page=1,y(1)),await m()},[m]),Se=_react.useCallback.call(void 0, async()=>{r.current.page=1,r.current.sortModel=[],r.current.filterModel={},r.current.advancedFilterModel=null,r.current.quickFilterText=null,y(1),N([]),V({}),j(null),O(null),z(),K.current=!0;try{_optionalChain([u, 'access', _45 => _45.current, 'optionalAccess', _46 => _46.sorting, 'access', _47 => _47.setModel, 'call', _48 => _48(null)]),_optionalChain([u, 'access', _49 => _49.current, 'optionalAccess', _50 => _50.filtering, 'access', _51 => _51.setModel, 'call', _52 => _52(null)]),_optionalChain([u, 'access', _53 => _53.current, 'optionalAccess', _54 => _54.filtering, 'access', _55 => _55.setAdvancedModel, 'call', _56 => _56(null)]),_optionalChain([u, 'access', _57 => _57.current, 'optionalAccess', _58 => _58.filtering, 'access', _59 => _59.setQuickText, 'call', _60 => _60(null)])}finally{K.current=!1}await m()},[z,m]),we=_react.useCallback.call(void 0, ()=>{I.current=!0,C.current.clear(),x.current.clear(),h.current.clear();for(let e of r.current.rows)h.current.set(p(e),e);k(),A()},[k,p,A]),Re=_react.useCallback.call(void 0, e=>{C.current.clear(),x.current.clear(),h.current.clear(),I.current=e.mode==="allMatching";for(let n of(e.mode==="allMatching"?e.excludedKeys:e.selectedKeys).map(String))e.mode==="allMatching"?x.current.add(n):C.current.add(n);for(let n of r.current.rows)H(p(n))&&h.current.set(p(n),n);k(),A()},[k,p,H,A]),ue=_react.useRef.call(void 0, !0),De=t.queryKey===void 0?t.query:t.queryKey;_react.useEffect.call(void 0, ()=>{if(ue.current){ue.current=!1;return}a.current.clearSelectionOnQueryChange!==!1&&z(),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},[De,z,B]),_react.useEffect.call(void 0, ()=>(t.mode!=="manual"&&t.immediate!==!1&&m(),te),[]);let de=_react.useMemo.call(void 0, ()=>{let e=[...new Set((_nullishCoalesce(t.pageSizeOptions, () => ([10,20,50,100]))).map(n=>re(n,0)).filter(Boolean))];return e.includes(i)||e.push(i),e.sort((n,s)=>n-s)},[t.pageSizeOptions,i]),Ce=_react.useMemo.call(void 0, ()=>({rowData:v,loading:w,error:D,rowKey:p,manualSorting:!0,manualFiltering:!0,advancedFilterModel:U,quickFilterText:q,overlayErrorTemplate:D?()=>_nullishCoalesce(_optionalChain([a, 'access', _61 => _61.current, 'access', _62 => _62.errorOverlay, 'optionalCall', _63 => _63({error:D,retry:m})]), () => ("Remote request failed. Please retry.")):void 0,overlayNoRowsTemplate:t.emptyOverlay,pagination:{mode:"server",page:M,pageSize:i,pageSizeOptions:de,total:S,showTotal:!0,showPageSizeSelector:!0},onGridReady:({api:e})=>{u.current=e,queueMicrotask(A)},onPaginationChanged:le,onSortChanged:ie,onFilterChanged:se,onSelectionChanged:ce}),[U,D,m,w,se,le,ce,ie,t.emptyOverlay,M,i,de,q,p,v,A,S]),fe=I.current?[]:[...C.current],xe=[...h.current.entries()].filter(([e])=>!x.current.has(e)).map(([,e])=>e),ke=I.current?{mode:"allMatching",excludedKeys:[...x.current]}:{mode:"explicit",selectedKeys:fe};return{rows:v,loading:w,error:D,page:M,pageSize:i,total:S,sortModel:P,filterModel:L,advancedFilterModel:U,quickFilterText:q,setQuickFilterText(e){r.current.quickFilterText=e,O(e),K.current=!0;try{_optionalChain([u, 'access', _64 => _64.current, 'optionalAccess', _65 => _65.filtering, 'access', _66 => _66.setQuickText, 'call', _67 => _67(e)])}finally{K.current=!1}a.current.clearSelectionOnQueryChange!==!1&&z(),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},selectedKeys:fe,selectedRows:xe,selectionState:ke,bindings:Ce,reload:Me,retry:m,reset:Se,abort:te,clearSelection:z,selectAllMatching:we,applySelectionState:Re}}function Ae(t={}){let a=_chunkII7TCYIUcjs.a.call(void 0, ),v=ee(a,t.editing),[R,w]=_react.useState.call(void 0, _nullishCoalesce(t.initialSearch, () => (""))),[Q,D]=_react.useState.call(void 0, []),l=_nullishCoalesce(t.query, () => (null));_react.useEffect.call(void 0, ()=>{let S=a.api;if(!S||S.isDestroyed()||l)return;let g=()=>D(S.selection.getRows());return g(),S.on("selectionChanged",g)},[l,a.api]),_react.useEffect.call(void 0, ()=>{l?l.setQuickFilterText(R||null):_optionalChain([a, 'access', _68 => _68.apiRef, 'access', _69 => _69.current, 'optionalAccess', _70 => _70.filtering, 'access', _71 => _71.setQuickText, 'call', _72 => _72(R||null)])},[l,R,a.apiRef]);let M=_react.useMemo.call(void 0, ()=>async()=>{l?await l.reload():_optionalChain([a, 'access', _73 => _73.apiRef, 'access', _74 => _74.current, 'optionalAccess', _75 => _75.rows, 'access', _76 => _76.isRemote, 'call', _77 => _77()])?await a.apiRef.current.rows.reload():_optionalChain([a, 'access', _78 => _78.apiRef, 'access', _79 => _79.current, 'optionalAccess', _80 => _80.view, 'access', _81 => _81.refreshCells, 'call', _82 => _82()])},[l,a.apiRef]),y=_react.useMemo.call(void 0, ()=>_machtable.createMachTableCommands.call(void 0, {getApi:()=>a.apiRef.current,reload:M}),[M,a.apiRef]),i=_nullishCoalesce(_optionalChain([l, 'optionalAccess', _83 => _83.selectedRows]), () => (Q)),F=l?l.selectionState.mode==="allMatching"?Math.max(0,l.total-l.selectionState.excludedKeys.length):l.selectionState.selectedKeys.length:i.length;return{table:a,query:l,editing:v,bindings:_nullishCoalesce(_optionalChain([l, 'optionalAccess', _84 => _84.bindings]), () => ({})),search:R,setSearch:w,selectedRows:i,selectedCount:F,busy:_optionalChain([l, 'optionalAccess', _85 => _85.loading])===!0||v.saving,error:_nullishCoalesce(_nullishCoalesce(_optionalChain([l, 'optionalAccess', _86 => _86.error]), () => (v.saveError)), () => (null)),commands:y,reload:M}}exports.useMachTableController = Ae; exports.useMachTableEditing = ee; exports.useMachTableQuery = Oe;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkII7TCYIUcjs = require('./chunk-II7TCYIU.cjs');var _react = require('react');var _machtable = require('@agile-team/mach-table');function te(r,n={}){let[R,F]=_react.useState.call(void 0, []),[k,A]=_react.useState.call(void 0, []),[E,i]=_react.useState.call(void 0, !1),[w,b]=_react.useState.call(void 0, null),[g,U]=_react.useState.call(void 0, null),v=_react.useRef.call(void 0, !1),O=_react.useRef.call(void 0, 0),D=_react.useRef.call(void 0, null),m=_react.useCallback.call(void 0, ()=>{let a=r.apiRef.current;if(!a||a.isDestroyed()){A([]),F([]);return}A(a.editing.getDirtyRowIds()),F(a.editing.getChanges())},[r.apiRef]);_react.useEffect.call(void 0, ()=>{let a=r.api;O.current++,v.current=!1,i(!1),b(null),U(null),D.current=null,m();let l=a&&!a.isDestroyed()?a.on("dirtyStateChanged",m):void 0;return()=>{O.current++,_optionalChain([l, 'optionalCall', _2 => _2()])}},[r.api,m]);let z=_react.useCallback.call(void 0, async(a,l)=>{let f=r.apiRef.current;if(!f||f.isDestroyed())throw new Error("[MachTable] Cannot save before the grid is ready.");if(v.current)throw new Error("[MachTable] A save operation is already in progress.");v.current=!0,i(!0),b(null),U(null),D.current=null;let y=O.current,c=()=>y===O.current&&r.apiRef.current===f&&!f.isDestroyed(),h=f.editing.getDirtyRowIds().filter(s=>!l||l.includes(s)).map(s=>{let P=f.rows.getById(s);return{rowId:s,node:P,data:_optionalChain([P, 'optionalAccess', _3 => _3.data])}}),C=s=>{let P=s===void 0?h:h.filter(p=>p.rowId===s);return c()&&P.every(({rowId:p,node:I,data:x})=>f.rows.getById(p)===I&&_optionalChain([I, 'optionalAccess', _4 => _4.data])===x)};try{let s=await f.editing.save(a,l);return C()&&(D.current=C,U(s),m(),_optionalChain([n, 'access', _5 => _5.onSaveSuccess, 'optionalCall', _6 => _6(s.saved)]),_optionalChain([n, 'access', _7 => _7.onSaveResult, 'optionalCall', _8 => _8(s)])),s}catch(s){throw C()&&(b(s),_optionalChain([n, 'access', _9 => _9.onSaveError, 'optionalCall', _10 => _10(s)])),s}finally{c()&&(v.current=!1,i(!1))}},[n,m,r.apiRef]),j=_react.useCallback.call(void 0, async(a,l)=>(await z(a,l)).saved,[z]),G=_react.useCallback.call(void 0, ()=>{D.current=null,U(null)},[]),$=_react.useCallback.call(void 0, (a,l)=>{let f=_optionalChain([g, 'optionalAccess', _11 => _11.conflicts, 'access', _12 => _12.find, 'call', _13 => _13(c=>c.rowId===a)]),y=r.apiRef.current;return!g||!f||!y||!_optionalChain([D, 'access', _14 => _14.current, 'optionalCall', _15 => _15(a)])||!_machtable.resolveSaveConflict.call(void 0, y,f,l)?!1:(U(c=>c&&{...c,conflicts:c.conflicts.filter(h=>h.rowId!==a)}),m(),!0)},[g,m,r.apiRef]),K=_react.useCallback.call(void 0, a=>{let l=_nullishCoalesce(_optionalChain([r, 'access', _16 => _16.apiRef, 'access', _17 => _17.current, 'optionalAccess', _18 => _18.editing, 'access', _19 => _19.rollback, 'call', _20 => _20(a)]), () => (!1));return m(),l},[m,r.apiRef]),V=_react.useCallback.call(void 0, a=>{_optionalChain([r, 'access', _21 => _21.apiRef, 'access', _22 => _22.current, 'optionalAccess', _23 => _23.editing, 'access', _24 => _24.markSaved, 'call', _25 => _25(a)]),m()},[m,r.apiRef]),W=_react.useCallback.call(void 0, (a,l,f=!1)=>{let y=r.apiRef.current,c=_optionalChain([y, 'optionalAccess', _26 => _26.rows, 'access', _27 => _27.getById, 'call', _28 => _28(a)]);return!y||!c||c.rowIndex<0?!1:(y.view.scrollToRow(c.rowIndex,"middle"),l&&f?y.editing.startCell({rowIndex:c.rowIndex,colId:l}):!0)},[r.apiRef]);_react.useEffect.call(void 0, ()=>{if(!n.guardBeforeUnload||typeof window>"u")return;let a=l=>{if(k.length===0)return;let f=_nullishCoalesce(n.beforeUnloadMessage, () => ("\u5B58\u5728\u672A\u4FDD\u5B58\u7684\u8868\u683C\u4FEE\u6539\u3002"));return l.preventDefault(),l.returnValue=f,f};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[k.length,n.beforeUnloadMessage,n.guardBeforeUnload]);let o=_react.useMemo.call(void 0, ()=>[..._nullishCoalesce(_optionalChain([g, 'optionalAccess', _29 => _29.failures]), () => ([])),..._nullishCoalesce(_optionalChain([g, 'optionalAccess', _30 => _30.conflicts]), () => ([]))],[g]),Q=_react.useMemo.call(void 0, ()=>[...new Set(o.map(a=>a.rowId))],[o]);return _react.useMemo.call(void 0, ()=>({changes:R,dirtyRowIds:k,dirty:k.length>0,saving:E,saveError:w,lastSaveResult:g,saveIssues:o,failedRowIds:Q,save:j,saveDetailed:z,clearSaveIssues:G,resolveConflict:$,rollback:K,markSaved:V,reveal:W,refresh:m}),[R,G,k,Q,g,V,m,$,W,K,j,z,w,o,E])}function ne(r,n){return typeof r=="number"&&Number.isFinite(r)&&r>0?Math.floor(r):n}function qe(r){return(r instanceof DOMException||typeof r=="object"&&r!=null&&"name"in r)&&r.name==="AbortError"}function Ue(r){return typeof r=="function"?r():r}function Oe(r){let n=_react.useRef.call(void 0, r);n.current=r;let[R,F]=_react.useState.call(void 0, []),[k,A]=_react.useState.call(void 0, !1),[E,i]=_react.useState.call(void 0, null),[w,b]=_react.useState.call(void 0, ne(r.initialPage,1)),[g,U]=_react.useState.call(void 0, ne(r.pageSize,20)),[v,O]=_react.useState.call(void 0, 0),[D,m]=_react.useState.call(void 0, []),[z,j]=_react.useState.call(void 0, {}),[G,$]=_react.useState.call(void 0, null),[K,V]=_react.useState.call(void 0, _nullishCoalesce(r.initialQuickFilterText, () => (null))),[,W]=_react.useReducer.call(void 0, e=>e+1,0),o=_react.useRef.call(void 0, {page:w,pageSize:g,sortModel:D,filterModel:z,advancedFilterModel:G,quickFilterText:K,rows:R});o.current={page:w,pageSize:g,sortModel:D,filterModel:z,advancedFilterModel:G,quickFilterText:K,rows:R};let Q=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),f=_react.useRef.call(void 0, 0),y=_react.useRef.call(void 0, new Set),c=_react.useRef.call(void 0, new Set),h=_react.useRef.call(void 0, new Map),C=_react.useRef.call(void 0, !1),s=_react.useRef.call(void 0, !1),P=_react.useRef.call(void 0, !1),p=_react.useCallback.call(void 0, e=>{let t=n.current.rowKey,u=typeof t=="function"?t(e):_machtable.getByPath.call(void 0, e,t);if(u==null||String(u).length===0)throw new Error(`[MachTable] useMachTableQuery rowKey "${String(t)}" returned an empty value.`);return String(u)},[]),I=_react.useCallback.call(void 0, e=>C.current?!c.current.has(e):y.current.has(e),[]),x=_react.useCallback.call(void 0, ()=>W(),[]),B=_react.useCallback.call(void 0, ()=>{let e=Q.current;if(!(!e||e.isDestroyed())){P.current=!0;try{e.selection.setRows(o.current.rows.filter(t=>I(p(t))),!0)}finally{P.current=!1}}},[p,I]),ae=_react.useCallback.call(void 0, ()=>{f.current++,_optionalChain([a, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.abort, 'call', _33 => _33()]),a.current=null,l.current&&clearTimeout(l.current),l.current=null,A(!1)},[]),X=_react.useCallback.call(void 0, (e,t)=>e.signal.aborted||t!==f.current,[]),oe=_react.useCallback.call(void 0, (e,t,u)=>{if(X(t,u))return;if(!e||!Array.isArray(e.rows)||!Number.isFinite(e.total)||e.total<0)throw new TypeError("[MachTable] Remote request must resolve to { rows: TData[], total: non-negative number }.");let d=[...e.rows];for(let Z of d){let _=p(Z);I(_)?h.current.set(_,Z):h.current.delete(_)}o.current.rows=d,F(d),O(Math.floor(e.total)),x(),_optionalChain([n, 'access', _34 => _34.current, 'access', _35 => _35.onSuccess, 'optionalCall', _36 => _36(e)]),queueMicrotask(B)},[X,x,p,I,B]),le=_react.useCallback.call(void 0, (e,t,u)=>{if(X(t,u)||qe(e))return;let d=_nullishCoalesce(e, () => (new Error("Remote request failed")));i(d),_optionalChain([n, 'access', _37 => _37.current, 'access', _38 => _38.onError, 'optionalCall', _39 => _39(d)])},[X]),ie=_react.useCallback.call(void 0, (e,t)=>{t===f.current&&(A(!1),a.current===e&&(a.current=null))},[]),M=_react.useCallback.call(void 0, async()=>{l.current&&clearTimeout(l.current),l.current=null,_optionalChain([a, 'access', _40 => _40.current, 'optionalAccess', _41 => _41.abort, 'call', _42 => _42()]);let e=new AbortController;a.current=e;let t=++f.current;A(!0),i(null),n.current.keepPreviousData===!1&&(o.current.rows=[],F([]));let u=o.current;try{let d=await n.current.request({page:u.page,pageSize:u.pageSize,query:Ue(n.current.query),sortModel:u.sortModel.map(Z=>({...Z})),filterModel:{...u.filterModel},advancedFilterModel:_machtable.normalizeAdvancedFilterModel.call(void 0, u.advancedFilterModel),quickFilterText:u.quickFilterText,signal:e.signal});oe(d,e,t)}catch(d){le(d,e,t)}finally{ie(e,t)}},[oe,ie,le]),N=_react.useCallback.call(void 0, e=>{e&&(o.current.page=1,b(1)),_optionalChain([a, 'access', _43 => _43.current, 'optionalAccess', _44 => _44.abort, 'call', _45 => _45()]),a.current=null;let t=Math.max(0,_nullishCoalesce(n.current.debounceMs, () => (0)));l.current&&clearTimeout(l.current),t===0?M():l.current=setTimeout(()=>{M()},t)},[M]),L=_react.useCallback.call(void 0, ()=>{let e=C.current||y.current.size>0||c.current.size>0||h.current.size>0;C.current=!1,y.current.clear(),c.current.clear(),h.current.clear(),e&&x(),P.current=!0;try{_optionalChain([Q, 'access', _46 => _46.current, 'optionalAccess', _47 => _47.selection, 'access', _48 => _48.clear, 'call', _49 => _49()])}finally{P.current=!1}},[x]),se=_react.useCallback.call(void 0, e=>{if(s.current)return;let t=o.current;e.page===t.page&&e.pageSize===t.pageSize||(t.page=e.page,t.pageSize=e.pageSize,b(e.page),U(e.pageSize),n.current.mode!=="manual"&&M())},[M]),ce=_react.useCallback.call(void 0, e=>{if(s.current)return;let t=e.sortModel.map(u=>({...u}));o.current.sortModel=t,m(t),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1))},[N]),ue=_react.useCallback.call(void 0, e=>{if(s.current)return;let t={...e.filterModel};o.current.filterModel=t;let u=_machtable.normalizeAdvancedFilterModel.call(void 0, e.advancedFilterModel);o.current.advancedFilterModel=u,o.current.quickFilterText=e.api.filtering.getQuickText(),j(t),$(u),V(o.current.quickFilterText),n.current.clearSelectionOnQueryChange!==!1&&L(),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1))},[L,N]),de=_react.useCallback.call(void 0, e=>{if(P.current)return;let t=new Set(o.current.rows.map(p)),u=new Set(e.selectedRows.map(p));if(C.current)for(let d of t)u.has(d)?c.current.delete(d):(c.current.add(d),h.current.delete(d));else{if((_nullishCoalesce(n.current.selectionScope, () => ("preserve")))==="page")y.current.clear(),h.current.clear();else for(let d of t)y.current.delete(d),h.current.delete(d);for(let d of e.selectedRows)y.current.add(p(d))}for(let d of e.selectedRows)h.current.set(p(d),d);x()},[x,p]),Re=_react.useCallback.call(void 0, async(e={})=>{e.resetPage&&(o.current.page=1,b(1)),await M()},[M]),we=_react.useCallback.call(void 0, async()=>{o.current.page=1,o.current.sortModel=[],o.current.filterModel={},o.current.advancedFilterModel=null,o.current.quickFilterText=null,b(1),m([]),j({}),$(null),V(null),L(),s.current=!0;try{_optionalChain([Q, 'access', _50 => _50.current, 'optionalAccess', _51 => _51.sorting, 'access', _52 => _52.setModel, 'call', _53 => _53(null)]),_optionalChain([Q, 'access', _54 => _54.current, 'optionalAccess', _55 => _55.filtering, 'access', _56 => _56.setModel, 'call', _57 => _57(null)]),_optionalChain([Q, 'access', _58 => _58.current, 'optionalAccess', _59 => _59.filtering, 'access', _60 => _60.setAdvancedModel, 'call', _61 => _61(null)]),_optionalChain([Q, 'access', _62 => _62.current, 'optionalAccess', _63 => _63.filtering, 'access', _64 => _64.setQuickText, 'call', _65 => _65(null)])}finally{s.current=!1}await M()},[L,M]),De=_react.useCallback.call(void 0, ()=>{C.current=!0,y.current.clear(),c.current.clear(),h.current.clear();for(let e of o.current.rows)h.current.set(p(e),e);x(),B()},[x,p,B]),Ce=_react.useCallback.call(void 0, e=>{y.current.clear(),c.current.clear(),h.current.clear(),C.current=e.mode==="allMatching";for(let t of(e.mode==="allMatching"?e.excludedKeys:e.selectedKeys).map(String))e.mode==="allMatching"?c.current.add(t):y.current.add(t);for(let t of o.current.rows)I(p(t))&&h.current.set(p(t),t);x(),B()},[x,p,I,B]),Y=r.queryKey===void 0?r.query:r.queryKey,fe=_react.useRef.call(void 0, Y);_react.useEffect.call(void 0, ()=>{Object.is(fe.current,Y)||(fe.current=Y,n.current.clearSelectionOnQueryChange!==!1&&L(),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1)))},[Y,L,N]),_react.useEffect.call(void 0, ()=>(r.mode!=="manual"&&r.immediate!==!1&&M(),ae),[]);let ge=_react.useMemo.call(void 0, ()=>{let e=[...new Set((_nullishCoalesce(r.pageSizeOptions, () => ([10,20,50,100]))).map(t=>ne(t,0)).filter(Boolean))];return e.includes(g)||e.push(g),e.sort((t,u)=>t-u)},[r.pageSizeOptions,g]),xe=_react.useMemo.call(void 0, ()=>({rowData:R,loading:k,error:E,rowKey:p,manualSorting:!0,manualFiltering:!0,advancedFilterModel:G,quickFilterText:K,overlayErrorTemplate:E?()=>_nullishCoalesce(_optionalChain([n, 'access', _66 => _66.current, 'access', _67 => _67.errorOverlay, 'optionalCall', _68 => _68({error:E,retry:M})]), () => ("Remote request failed. Please retry.")):void 0,overlayNoRowsTemplate:r.emptyOverlay,pagination:{mode:"server",page:w,pageSize:g,pageSizeOptions:ge,total:v,showTotal:!0,showPageSizeSelector:!0},onGridReady:({api:e})=>{Q.current=e,queueMicrotask(B)},onPaginationChanged:se,onSortChanged:ce,onFilterChanged:ue,onSelectionChanged:de}),[G,E,M,k,ue,se,de,ce,r.emptyOverlay,w,g,ge,K,p,R,B,v]),ye=C.current?[]:[...y.current],ke=[...h.current.entries()].filter(([e])=>!c.current.has(e)).map(([,e])=>e),Ee=C.current?{mode:"allMatching",excludedKeys:[...c.current]}:{mode:"explicit",selectedKeys:ye};return{rows:R,loading:k,error:E,page:w,pageSize:g,total:v,sortModel:D,filterModel:z,advancedFilterModel:G,quickFilterText:K,setQuickFilterText(e){if(o.current.quickFilterText!==e){o.current.quickFilterText=e,V(e),s.current=!0;try{_optionalChain([Q, 'access', _69 => _69.current, 'optionalAccess', _70 => _70.filtering, 'access', _71 => _71.setQuickText, 'call', _72 => _72(e)])}finally{s.current=!1}n.current.clearSelectionOnQueryChange!==!1&&L(),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1))}},selectedKeys:ye,selectedRows:ke,selectionState:Ee,bindings:xe,reload:Re,retry:M,reset:we,abort:ae,clearSelection:L,selectAllMatching:De,applySelectionState:Ce}}function Ae(r={}){let n=_chunkII7TCYIUcjs.a.call(void 0, ),R=te(n,r.editing),[F,k]=_react.useState.call(void 0, _nullishCoalesce(r.initialSearch, () => (""))),[A,E]=_react.useState.call(void 0, []),i=_nullishCoalesce(r.query, () => (null));_react.useEffect.call(void 0, ()=>{let v=n.api;if(i)return;if(!v||v.isDestroyed()){E(D=>D.length?[]:D);return}let O=()=>E(v.selection.getRows());return O(),v.on("selectionChanged",O)},[i,n.api]),_react.useEffect.call(void 0, ()=>{i?i.setQuickFilterText(F||null):_optionalChain([n, 'access', _73 => _73.apiRef, 'access', _74 => _74.current, 'optionalAccess', _75 => _75.filtering, 'access', _76 => _76.setQuickText, 'call', _77 => _77(F||null)])},[i,F,n.api,n.apiRef]);let w=_react.useMemo.call(void 0, ()=>async()=>{i?await i.reload():_optionalChain([n, 'access', _78 => _78.apiRef, 'access', _79 => _79.current, 'optionalAccess', _80 => _80.rows, 'access', _81 => _81.isRemote, 'call', _82 => _82()])?await n.apiRef.current.rows.reload():_optionalChain([n, 'access', _83 => _83.apiRef, 'access', _84 => _84.current, 'optionalAccess', _85 => _85.view, 'access', _86 => _86.refreshCells, 'call', _87 => _87()])},[i,n.apiRef]),b=_react.useMemo.call(void 0, ()=>_machtable.createMachTableCommands.call(void 0, {getApi:()=>n.apiRef.current,reload:w}),[w,n.apiRef]),g=_nullishCoalesce(_optionalChain([i, 'optionalAccess', _88 => _88.selectedRows]), () => (A)),U=i?i.selectionState.mode==="allMatching"?Math.max(0,i.total-i.selectionState.excludedKeys.length):i.selectionState.selectedKeys.length:g.length;return{table:n,query:i,editing:R,bindings:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _89 => _89.bindings]), () => ({})),search:F,setSearch:k,selectedRows:g,selectedCount:U,busy:_optionalChain([i, 'optionalAccess', _90 => _90.loading])===!0||R.saving,error:_nullishCoalesce(_nullishCoalesce(_optionalChain([i, 'optionalAccess', _91 => _91.error]), () => (R.saveError)), () => (null)),commands:b,reload:w}}exports.useMachTableController = Ae; exports.useMachTableEditing = te; exports.useMachTableQuery = Oe;
|
package/dist/workflows.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ge}from"./chunk-FN4LWAOL.js";import{useCallback as G,useEffect as pe,useMemo as _,useRef as Ee,useState as J}from"react";import{resolveSaveConflict as Qe}from"@agile-team/mach-table";function ee(t,a={}){let[v,R]=J([]),[w,Q]=J([]),[D,l]=J(!1),[M,y]=J(null),[i,F]=J(null),S=Ee(!1),g=G(()=>{let r=t.apiRef.current;if(!r||r.isDestroyed()){Q([]),R([]);return}Q(r.editing.getDirtyRowIds()),R(r.editing.getChanges())},[t.apiRef]);pe(()=>{let r=t.api;return g(),r&&!r.isDestroyed()?r.on("dirtyStateChanged",g):void 0},[t.api,g]);let P=G(async(r,u)=>{let d=t.apiRef.current;if(!d||d.isDestroyed())throw new Error("[MachTable] Cannot save before the grid is ready.");if(S.current)throw new Error("[MachTable] A save operation is already in progress.");S.current=!0,l(!0),y(null),F(null);try{let o=await d.editing.save(r,u);return F(o),g(),a.onSaveSuccess?.(o.saved),a.onSaveResult?.(o),o}catch(o){throw y(o),a.onSaveError?.(o),o}finally{S.current=!1,l(!1)}},[a,g,t.apiRef]),N=G(async(r,u)=>(await P(r,u)).saved,[P]),L=G(()=>F(null),[]),V=G((r,u)=>{let d=i?.conflicts.find(T=>T.rowId===r),o=t.apiRef.current;return!i||!d||!o||!Qe(o,d,u)?!1:(F({...i,failures:i.failures,conflicts:i.conflicts.filter(T=>T.rowId!==r)}),g(),!0)},[i,g,t.apiRef]),U=G(r=>{let u=t.apiRef.current?.editing.rollback(r)??!1;return g(),u},[g,t.apiRef]),j=G(r=>{t.apiRef.current?.editing.markSaved(r),g()},[g,t.apiRef]),q=G((r,u,d=!1)=>{let o=t.apiRef.current,T=o?.rows.getById(r);return!o||!T||T.rowIndex<0?!1:(o.view.scrollToRow(T.rowIndex,"middle"),u&&d?o.editing.startCell({rowIndex:T.rowIndex,colId:u}):!0)},[t.apiRef]);pe(()=>{if(!a.guardBeforeUnload||typeof window>"u")return;let r=u=>{if(w.length===0)return;let d=a.beforeUnloadMessage??"\u5B58\u5728\u672A\u4FDD\u5B58\u7684\u8868\u683C\u4FEE\u6539\u3002";return u.preventDefault(),u.returnValue=d,d};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[w.length,a.beforeUnloadMessage,a.guardBeforeUnload]);let O=_(()=>[...i?.failures??[],...i?.conflicts??[]],[i]),W=_(()=>[...new Set(O.map(r=>r.rowId))],[O]);return _(()=>({changes:v,dirtyRowIds:w,dirty:w.length>0,saving:D,saveError:M,lastSaveResult:i,saveIssues:O,failedRowIds:W,save:N,saveDetailed:P,clearSaveIssues:L,resolveConflict:V,rollback:U,markSaved:j,reveal:q,refresh:g}),[v,L,w,W,i,j,g,V,q,U,N,P,M,O,D])}import{useCallback as f,useEffect as ye,useMemo as Te,useReducer as Fe,useRef as b,useState as E}from"react";import{getByPath as Pe,normalizeAdvancedFilterModel as he}from"@agile-team/mach-table";function re(t,a){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):a}function Ue(t){return(t instanceof DOMException||typeof t=="object"&&t!=null&&"name"in t)&&t.name==="AbortError"}function qe(t){return typeof t=="function"?t():t}function Oe(t){let a=b(t);a.current=t;let[v,R]=E([]),[w,Q]=E(!1),[D,l]=E(null),[M,y]=E(re(t.initialPage,1)),[i,F]=E(re(t.pageSize,20)),[S,g]=E(0),[P,N]=E([]),[L,V]=E({}),[U,j]=E(null),[q,O]=E(t.initialQuickFilterText??null),[,W]=Fe(e=>e+1,0),r=b({page:M,pageSize:i,sortModel:P,filterModel:L,advancedFilterModel:U,quickFilterText:q,rows:v});r.current={page:M,pageSize:i,sortModel:P,filterModel:L,advancedFilterModel:U,quickFilterText:q,rows:v};let u=b(null),d=b(null),o=b(null),T=b(0),C=b(new Set),x=b(new Set),h=b(new Map),I=b(!1),K=b(!1),$=b(!1),p=f(e=>{let n=a.current.rowKey,s=typeof n=="function"?n(e):Pe(e,n);if(s==null||String(s).length===0)throw new Error(`[MachTable] useMachTableQuery rowKey "${String(n)}" returned an empty value.`);return String(s)},[]),H=f(e=>I.current?!x.current.has(e):C.current.has(e),[]),k=f(()=>W(),[]),A=f(()=>{let e=u.current;if(!(!e||e.isDestroyed())){$.current=!0;try{e.selection.setRows(r.current.rows.filter(n=>H(p(n))),!0)}finally{$.current=!1}}},[p,H]),te=f(()=>{T.current++,d.current?.abort(),d.current=null,o.current&&clearTimeout(o.current),o.current=null,Q(!1)},[]),X=f((e,n)=>e.signal.aborted||n!==T.current,[]),ne=f((e,n,s)=>{if(X(n,s))return;if(!e||!Array.isArray(e.rows)||!Number.isFinite(e.total)||e.total<0)throw new TypeError("[MachTable] Remote request must resolve to { rows: TData[], total: non-negative number }.");let c=[...e.rows];for(let Y of c){let Z=p(Y);H(Z)?h.current.set(Z,Y):h.current.delete(Z)}r.current.rows=c,R(c),g(Math.floor(e.total)),k(),a.current.onSuccess?.(e),queueMicrotask(A)},[X,k,p,H,A]),ae=f((e,n,s)=>{if(X(n,s)||Ue(e))return;let c=e??new Error("Remote request failed");l(c),a.current.onError?.(c)},[X]),oe=f((e,n)=>{n===T.current&&(Q(!1),d.current===e&&(d.current=null))},[]),m=f(async()=>{o.current&&clearTimeout(o.current),o.current=null,d.current?.abort();let e=new AbortController;d.current=e;let n=++T.current;Q(!0),l(null),a.current.keepPreviousData===!1&&(r.current.rows=[],R([]));let s=r.current;try{let c=await a.current.request({page:s.page,pageSize:s.pageSize,query:qe(a.current.query),sortModel:s.sortModel.map(Y=>({...Y})),filterModel:{...s.filterModel},advancedFilterModel:he(s.advancedFilterModel),quickFilterText:s.quickFilterText,signal:e.signal});ne(c,e,n)}catch(c){ae(c,e,n)}finally{oe(e,n)}},[ne,oe,ae]),B=f(e=>{e&&(r.current.page=1,y(1)),d.current?.abort(),d.current=null;let n=Math.max(0,a.current.debounceMs??0);o.current&&clearTimeout(o.current),n===0?m():o.current=setTimeout(()=>{m()},n)},[m]),z=f(()=>{let e=I.current||C.current.size>0||x.current.size>0||h.current.size>0;I.current=!1,C.current.clear(),x.current.clear(),h.current.clear(),e&&k(),$.current=!0;try{u.current?.selection.clear()}finally{$.current=!1}},[k]),le=f(e=>{if(K.current)return;let n=r.current;e.page===n.page&&e.pageSize===n.pageSize||(n.page=e.page,n.pageSize=e.pageSize,y(e.page),F(e.pageSize),a.current.mode!=="manual"&&m())},[m]),ie=f(e=>{if(K.current)return;let n=e.sortModel.map(s=>({...s}));r.current.sortModel=n,N(n),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},[B]),se=f(e=>{if(K.current)return;let n={...e.filterModel};r.current.filterModel=n;let s=he(e.advancedFilterModel);r.current.advancedFilterModel=s,r.current.quickFilterText=e.api.filtering.getQuickText(),V(n),j(s),O(r.current.quickFilterText),a.current.clearSelectionOnQueryChange!==!1&&z(),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},[z,B]),ce=f(e=>{if($.current)return;let n=new Set(r.current.rows.map(p)),s=new Set(e.selectedRows.map(p));if(I.current)for(let c of n)s.has(c)?x.current.delete(c):(x.current.add(c),h.current.delete(c));else{if((a.current.selectionScope??"preserve")==="page")C.current.clear(),h.current.clear();else for(let c of n)C.current.delete(c),h.current.delete(c);for(let c of e.selectedRows)C.current.add(p(c))}for(let c of e.selectedRows)h.current.set(p(c),c);k()},[k,p]),Me=f(async(e={})=>{e.resetPage&&(r.current.page=1,y(1)),await m()},[m]),Se=f(async()=>{r.current.page=1,r.current.sortModel=[],r.current.filterModel={},r.current.advancedFilterModel=null,r.current.quickFilterText=null,y(1),N([]),V({}),j(null),O(null),z(),K.current=!0;try{u.current?.sorting.setModel(null),u.current?.filtering.setModel(null),u.current?.filtering.setAdvancedModel(null),u.current?.filtering.setQuickText(null)}finally{K.current=!1}await m()},[z,m]),we=f(()=>{I.current=!0,C.current.clear(),x.current.clear(),h.current.clear();for(let e of r.current.rows)h.current.set(p(e),e);k(),A()},[k,p,A]),Re=f(e=>{C.current.clear(),x.current.clear(),h.current.clear(),I.current=e.mode==="allMatching";for(let n of(e.mode==="allMatching"?e.excludedKeys:e.selectedKeys).map(String))e.mode==="allMatching"?x.current.add(n):C.current.add(n);for(let n of r.current.rows)H(p(n))&&h.current.set(p(n),n);k(),A()},[k,p,H,A]),ue=b(!0),De=t.queryKey===void 0?t.query:t.queryKey;ye(()=>{if(ue.current){ue.current=!1;return}a.current.clearSelectionOnQueryChange!==!1&&z(),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},[De,z,B]),ye(()=>(t.mode!=="manual"&&t.immediate!==!1&&m(),te),[]);let de=Te(()=>{let e=[...new Set((t.pageSizeOptions??[10,20,50,100]).map(n=>re(n,0)).filter(Boolean))];return e.includes(i)||e.push(i),e.sort((n,s)=>n-s)},[t.pageSizeOptions,i]),Ce=Te(()=>({rowData:v,loading:w,error:D,rowKey:p,manualSorting:!0,manualFiltering:!0,advancedFilterModel:U,quickFilterText:q,overlayErrorTemplate:D?()=>a.current.errorOverlay?.({error:D,retry:m})??"Remote request failed. Please retry.":void 0,overlayNoRowsTemplate:t.emptyOverlay,pagination:{mode:"server",page:M,pageSize:i,pageSizeOptions:de,total:S,showTotal:!0,showPageSizeSelector:!0},onGridReady:({api:e})=>{u.current=e,queueMicrotask(A)},onPaginationChanged:le,onSortChanged:ie,onFilterChanged:se,onSelectionChanged:ce}),[U,D,m,w,se,le,ce,ie,t.emptyOverlay,M,i,de,q,p,v,A,S]),fe=I.current?[]:[...C.current],xe=[...h.current.entries()].filter(([e])=>!x.current.has(e)).map(([,e])=>e),ke=I.current?{mode:"allMatching",excludedKeys:[...x.current]}:{mode:"explicit",selectedKeys:fe};return{rows:v,loading:w,error:D,page:M,pageSize:i,total:S,sortModel:P,filterModel:L,advancedFilterModel:U,quickFilterText:q,setQuickFilterText(e){r.current.quickFilterText=e,O(e),K.current=!0;try{u.current?.filtering.setQuickText(e)}finally{K.current=!1}a.current.clearSelectionOnQueryChange!==!1&&z(),a.current.mode!=="manual"?B(!0):(r.current.page=1,y(1))},selectedKeys:fe,selectedRows:xe,selectionState:ke,bindings:Ce,reload:Me,retry:m,reset:Se,abort:te,clearSelection:z,selectAllMatching:we,applySelectionState:Re}}import{useEffect as me,useMemo as be,useState as ve}from"react";import{createMachTableCommands as Ie}from"@agile-team/mach-table";function Ae(t={}){let a=ge(),v=ee(a,t.editing),[R,w]=ve(t.initialSearch??""),[Q,D]=ve([]),l=t.query??null;me(()=>{let S=a.api;if(!S||S.isDestroyed()||l)return;let g=()=>D(S.selection.getRows());return g(),S.on("selectionChanged",g)},[l,a.api]),me(()=>{l?l.setQuickFilterText(R||null):a.apiRef.current?.filtering.setQuickText(R||null)},[l,R,a.apiRef]);let M=be(()=>async()=>{l?await l.reload():a.apiRef.current?.rows.isRemote()?await a.apiRef.current.rows.reload():a.apiRef.current?.view.refreshCells()},[l,a.apiRef]),y=be(()=>Ie({getApi:()=>a.apiRef.current,reload:M}),[M,a.apiRef]),i=l?.selectedRows??Q,F=l?l.selectionState.mode==="allMatching"?Math.max(0,l.total-l.selectionState.excludedKeys.length):l.selectionState.selectedKeys.length:i.length;return{table:a,query:l,editing:v,bindings:l?.bindings??{},search:R,setSearch:w,selectedRows:i,selectedCount:F,busy:l?.loading===!0||v.saving,error:l?.error??v.saveError??null,commands:y,reload:M}}export{Ae as useMachTableController,ee as useMachTableEditing,Oe as useMachTableQuery};
|
|
1
|
+
import{a as pe}from"./chunk-FN4LWAOL.js";import{useCallback as H,useEffect as Te,useMemo as ee,useRef as re,useState as J}from"react";import{resolveSaveConflict as Qe}from"@agile-team/mach-table";function te(r,n={}){let[R,F]=J([]),[k,A]=J([]),[E,i]=J(!1),[w,b]=J(null),[g,U]=J(null),v=re(!1),O=re(0),D=re(null),m=H(()=>{let a=r.apiRef.current;if(!a||a.isDestroyed()){A([]),F([]);return}A(a.editing.getDirtyRowIds()),F(a.editing.getChanges())},[r.apiRef]);Te(()=>{let a=r.api;O.current++,v.current=!1,i(!1),b(null),U(null),D.current=null,m();let l=a&&!a.isDestroyed()?a.on("dirtyStateChanged",m):void 0;return()=>{O.current++,l?.()}},[r.api,m]);let z=H(async(a,l)=>{let f=r.apiRef.current;if(!f||f.isDestroyed())throw new Error("[MachTable] Cannot save before the grid is ready.");if(v.current)throw new Error("[MachTable] A save operation is already in progress.");v.current=!0,i(!0),b(null),U(null),D.current=null;let y=O.current,c=()=>y===O.current&&r.apiRef.current===f&&!f.isDestroyed(),h=f.editing.getDirtyRowIds().filter(s=>!l||l.includes(s)).map(s=>{let P=f.rows.getById(s);return{rowId:s,node:P,data:P?.data}}),C=s=>{let P=s===void 0?h:h.filter(p=>p.rowId===s);return c()&&P.every(({rowId:p,node:I,data:x})=>f.rows.getById(p)===I&&I?.data===x)};try{let s=await f.editing.save(a,l);return C()&&(D.current=C,U(s),m(),n.onSaveSuccess?.(s.saved),n.onSaveResult?.(s)),s}catch(s){throw C()&&(b(s),n.onSaveError?.(s)),s}finally{c()&&(v.current=!1,i(!1))}},[n,m,r.apiRef]),j=H(async(a,l)=>(await z(a,l)).saved,[z]),G=H(()=>{D.current=null,U(null)},[]),$=H((a,l)=>{let f=g?.conflicts.find(c=>c.rowId===a),y=r.apiRef.current;return!g||!f||!y||!D.current?.(a)||!Qe(y,f,l)?!1:(U(c=>c&&{...c,conflicts:c.conflicts.filter(h=>h.rowId!==a)}),m(),!0)},[g,m,r.apiRef]),K=H(a=>{let l=r.apiRef.current?.editing.rollback(a)??!1;return m(),l},[m,r.apiRef]),V=H(a=>{r.apiRef.current?.editing.markSaved(a),m()},[m,r.apiRef]),W=H((a,l,f=!1)=>{let y=r.apiRef.current,c=y?.rows.getById(a);return!y||!c||c.rowIndex<0?!1:(y.view.scrollToRow(c.rowIndex,"middle"),l&&f?y.editing.startCell({rowIndex:c.rowIndex,colId:l}):!0)},[r.apiRef]);Te(()=>{if(!n.guardBeforeUnload||typeof window>"u")return;let a=l=>{if(k.length===0)return;let f=n.beforeUnloadMessage??"\u5B58\u5728\u672A\u4FDD\u5B58\u7684\u8868\u683C\u4FEE\u6539\u3002";return l.preventDefault(),l.returnValue=f,f};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[k.length,n.beforeUnloadMessage,n.guardBeforeUnload]);let o=ee(()=>[...g?.failures??[],...g?.conflicts??[]],[g]),Q=ee(()=>[...new Set(o.map(a=>a.rowId))],[o]);return ee(()=>({changes:R,dirtyRowIds:k,dirty:k.length>0,saving:E,saveError:w,lastSaveResult:g,saveIssues:o,failedRowIds:Q,save:j,saveDetailed:z,clearSaveIssues:G,resolveConflict:$,rollback:K,markSaved:V,reveal:W,refresh:m}),[R,G,k,Q,g,V,m,$,W,K,j,z,w,o,E])}import{useCallback as T,useEffect as he,useMemo as me,useReducer as Fe,useRef as S,useState as q}from"react";import{getByPath as Pe,normalizeAdvancedFilterModel as be}from"@agile-team/mach-table";function ne(r,n){return typeof r=="number"&&Number.isFinite(r)&&r>0?Math.floor(r):n}function qe(r){return(r instanceof DOMException||typeof r=="object"&&r!=null&&"name"in r)&&r.name==="AbortError"}function Ue(r){return typeof r=="function"?r():r}function Oe(r){let n=S(r);n.current=r;let[R,F]=q([]),[k,A]=q(!1),[E,i]=q(null),[w,b]=q(ne(r.initialPage,1)),[g,U]=q(ne(r.pageSize,20)),[v,O]=q(0),[D,m]=q([]),[z,j]=q({}),[G,$]=q(null),[K,V]=q(r.initialQuickFilterText??null),[,W]=Fe(e=>e+1,0),o=S({page:w,pageSize:g,sortModel:D,filterModel:z,advancedFilterModel:G,quickFilterText:K,rows:R});o.current={page:w,pageSize:g,sortModel:D,filterModel:z,advancedFilterModel:G,quickFilterText:K,rows:R};let Q=S(null),a=S(null),l=S(null),f=S(0),y=S(new Set),c=S(new Set),h=S(new Map),C=S(!1),s=S(!1),P=S(!1),p=T(e=>{let t=n.current.rowKey,u=typeof t=="function"?t(e):Pe(e,t);if(u==null||String(u).length===0)throw new Error(`[MachTable] useMachTableQuery rowKey "${String(t)}" returned an empty value.`);return String(u)},[]),I=T(e=>C.current?!c.current.has(e):y.current.has(e),[]),x=T(()=>W(),[]),B=T(()=>{let e=Q.current;if(!(!e||e.isDestroyed())){P.current=!0;try{e.selection.setRows(o.current.rows.filter(t=>I(p(t))),!0)}finally{P.current=!1}}},[p,I]),ae=T(()=>{f.current++,a.current?.abort(),a.current=null,l.current&&clearTimeout(l.current),l.current=null,A(!1)},[]),X=T((e,t)=>e.signal.aborted||t!==f.current,[]),oe=T((e,t,u)=>{if(X(t,u))return;if(!e||!Array.isArray(e.rows)||!Number.isFinite(e.total)||e.total<0)throw new TypeError("[MachTable] Remote request must resolve to { rows: TData[], total: non-negative number }.");let d=[...e.rows];for(let Z of d){let _=p(Z);I(_)?h.current.set(_,Z):h.current.delete(_)}o.current.rows=d,F(d),O(Math.floor(e.total)),x(),n.current.onSuccess?.(e),queueMicrotask(B)},[X,x,p,I,B]),le=T((e,t,u)=>{if(X(t,u)||qe(e))return;let d=e??new Error("Remote request failed");i(d),n.current.onError?.(d)},[X]),ie=T((e,t)=>{t===f.current&&(A(!1),a.current===e&&(a.current=null))},[]),M=T(async()=>{l.current&&clearTimeout(l.current),l.current=null,a.current?.abort();let e=new AbortController;a.current=e;let t=++f.current;A(!0),i(null),n.current.keepPreviousData===!1&&(o.current.rows=[],F([]));let u=o.current;try{let d=await n.current.request({page:u.page,pageSize:u.pageSize,query:Ue(n.current.query),sortModel:u.sortModel.map(Z=>({...Z})),filterModel:{...u.filterModel},advancedFilterModel:be(u.advancedFilterModel),quickFilterText:u.quickFilterText,signal:e.signal});oe(d,e,t)}catch(d){le(d,e,t)}finally{ie(e,t)}},[oe,ie,le]),N=T(e=>{e&&(o.current.page=1,b(1)),a.current?.abort(),a.current=null;let t=Math.max(0,n.current.debounceMs??0);l.current&&clearTimeout(l.current),t===0?M():l.current=setTimeout(()=>{M()},t)},[M]),L=T(()=>{let e=C.current||y.current.size>0||c.current.size>0||h.current.size>0;C.current=!1,y.current.clear(),c.current.clear(),h.current.clear(),e&&x(),P.current=!0;try{Q.current?.selection.clear()}finally{P.current=!1}},[x]),se=T(e=>{if(s.current)return;let t=o.current;e.page===t.page&&e.pageSize===t.pageSize||(t.page=e.page,t.pageSize=e.pageSize,b(e.page),U(e.pageSize),n.current.mode!=="manual"&&M())},[M]),ce=T(e=>{if(s.current)return;let t=e.sortModel.map(u=>({...u}));o.current.sortModel=t,m(t),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1))},[N]),ue=T(e=>{if(s.current)return;let t={...e.filterModel};o.current.filterModel=t;let u=be(e.advancedFilterModel);o.current.advancedFilterModel=u,o.current.quickFilterText=e.api.filtering.getQuickText(),j(t),$(u),V(o.current.quickFilterText),n.current.clearSelectionOnQueryChange!==!1&&L(),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1))},[L,N]),de=T(e=>{if(P.current)return;let t=new Set(o.current.rows.map(p)),u=new Set(e.selectedRows.map(p));if(C.current)for(let d of t)u.has(d)?c.current.delete(d):(c.current.add(d),h.current.delete(d));else{if((n.current.selectionScope??"preserve")==="page")y.current.clear(),h.current.clear();else for(let d of t)y.current.delete(d),h.current.delete(d);for(let d of e.selectedRows)y.current.add(p(d))}for(let d of e.selectedRows)h.current.set(p(d),d);x()},[x,p]),Re=T(async(e={})=>{e.resetPage&&(o.current.page=1,b(1)),await M()},[M]),we=T(async()=>{o.current.page=1,o.current.sortModel=[],o.current.filterModel={},o.current.advancedFilterModel=null,o.current.quickFilterText=null,b(1),m([]),j({}),$(null),V(null),L(),s.current=!0;try{Q.current?.sorting.setModel(null),Q.current?.filtering.setModel(null),Q.current?.filtering.setAdvancedModel(null),Q.current?.filtering.setQuickText(null)}finally{s.current=!1}await M()},[L,M]),De=T(()=>{C.current=!0,y.current.clear(),c.current.clear(),h.current.clear();for(let e of o.current.rows)h.current.set(p(e),e);x(),B()},[x,p,B]),Ce=T(e=>{y.current.clear(),c.current.clear(),h.current.clear(),C.current=e.mode==="allMatching";for(let t of(e.mode==="allMatching"?e.excludedKeys:e.selectedKeys).map(String))e.mode==="allMatching"?c.current.add(t):y.current.add(t);for(let t of o.current.rows)I(p(t))&&h.current.set(p(t),t);x(),B()},[x,p,I,B]),Y=r.queryKey===void 0?r.query:r.queryKey,fe=S(Y);he(()=>{Object.is(fe.current,Y)||(fe.current=Y,n.current.clearSelectionOnQueryChange!==!1&&L(),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1)))},[Y,L,N]),he(()=>(r.mode!=="manual"&&r.immediate!==!1&&M(),ae),[]);let ge=me(()=>{let e=[...new Set((r.pageSizeOptions??[10,20,50,100]).map(t=>ne(t,0)).filter(Boolean))];return e.includes(g)||e.push(g),e.sort((t,u)=>t-u)},[r.pageSizeOptions,g]),xe=me(()=>({rowData:R,loading:k,error:E,rowKey:p,manualSorting:!0,manualFiltering:!0,advancedFilterModel:G,quickFilterText:K,overlayErrorTemplate:E?()=>n.current.errorOverlay?.({error:E,retry:M})??"Remote request failed. Please retry.":void 0,overlayNoRowsTemplate:r.emptyOverlay,pagination:{mode:"server",page:w,pageSize:g,pageSizeOptions:ge,total:v,showTotal:!0,showPageSizeSelector:!0},onGridReady:({api:e})=>{Q.current=e,queueMicrotask(B)},onPaginationChanged:se,onSortChanged:ce,onFilterChanged:ue,onSelectionChanged:de}),[G,E,M,k,ue,se,de,ce,r.emptyOverlay,w,g,ge,K,p,R,B,v]),ye=C.current?[]:[...y.current],ke=[...h.current.entries()].filter(([e])=>!c.current.has(e)).map(([,e])=>e),Ee=C.current?{mode:"allMatching",excludedKeys:[...c.current]}:{mode:"explicit",selectedKeys:ye};return{rows:R,loading:k,error:E,page:w,pageSize:g,total:v,sortModel:D,filterModel:z,advancedFilterModel:G,quickFilterText:K,setQuickFilterText(e){if(o.current.quickFilterText!==e){o.current.quickFilterText=e,V(e),s.current=!0;try{Q.current?.filtering.setQuickText(e)}finally{s.current=!1}n.current.clearSelectionOnQueryChange!==!1&&L(),n.current.mode!=="manual"?N(!0):(o.current.page=1,b(1))}},selectedKeys:ye,selectedRows:ke,selectionState:Ee,bindings:xe,reload:Re,retry:M,reset:we,abort:ae,clearSelection:L,selectAllMatching:De,applySelectionState:Ce}}import{useEffect as ve,useMemo as Me,useState as Se}from"react";import{createMachTableCommands as Ie}from"@agile-team/mach-table";function Ae(r={}){let n=pe(),R=te(n,r.editing),[F,k]=Se(r.initialSearch??""),[A,E]=Se([]),i=r.query??null;ve(()=>{let v=n.api;if(i)return;if(!v||v.isDestroyed()){E(D=>D.length?[]:D);return}let O=()=>E(v.selection.getRows());return O(),v.on("selectionChanged",O)},[i,n.api]),ve(()=>{i?i.setQuickFilterText(F||null):n.apiRef.current?.filtering.setQuickText(F||null)},[i,F,n.api,n.apiRef]);let w=Me(()=>async()=>{i?await i.reload():n.apiRef.current?.rows.isRemote()?await n.apiRef.current.rows.reload():n.apiRef.current?.view.refreshCells()},[i,n.apiRef]),b=Me(()=>Ie({getApi:()=>n.apiRef.current,reload:w}),[w,n.apiRef]),g=i?.selectedRows??A,U=i?i.selectionState.mode==="allMatching"?Math.max(0,i.total-i.selectionState.excludedKeys.length):i.selectionState.selectedKeys.length:g.length;return{table:n,query:i,editing:R,bindings:i?.bindings??{},search:F,setSearch:k,selectedRows:g,selectedCount:U,busy:i?.loading===!0||R.saving,error:i?.error??R.saveError??null,commands:b,reload:w}}export{Ae as useMachTableController,te as useMachTableEditing,Oe as useMachTableQuery};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agile-team/mach-table-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Official React 18+ adapter for the MachTable enterprise data grid",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -88,6 +88,74 @@
|
|
|
88
88
|
"./styles/mach-table.css": {
|
|
89
89
|
"types": "./dist/mach-table.css.d.ts",
|
|
90
90
|
"default": "./dist/mach-table.css"
|
|
91
|
+
},
|
|
92
|
+
"./workbench": {
|
|
93
|
+
"import": {
|
|
94
|
+
"types": "./dist/workbench.d.ts",
|
|
95
|
+
"default": "./dist/workbench.js"
|
|
96
|
+
},
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./dist/workbench.d.cts",
|
|
99
|
+
"default": "./dist/workbench.cjs"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"./preferences": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/preferences.d.ts",
|
|
105
|
+
"default": "./dist/preferences.js"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/preferences.d.cts",
|
|
109
|
+
"default": "./dist/preferences.cjs"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"./ordering": {
|
|
113
|
+
"import": {
|
|
114
|
+
"types": "./dist/ordering.d.ts",
|
|
115
|
+
"default": "./dist/ordering.js"
|
|
116
|
+
},
|
|
117
|
+
"require": {
|
|
118
|
+
"types": "./dist/ordering.d.cts",
|
|
119
|
+
"default": "./dist/ordering.cjs"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"./server-side": {
|
|
123
|
+
"import": {
|
|
124
|
+
"types": "./dist/server-side.d.ts",
|
|
125
|
+
"default": "./dist/server-side.js"
|
|
126
|
+
},
|
|
127
|
+
"require": {
|
|
128
|
+
"types": "./dist/server-side.d.cts",
|
|
129
|
+
"default": "./dist/server-side.cjs"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"./analysis": {
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/analysis.d.ts",
|
|
135
|
+
"default": "./dist/analysis.js"
|
|
136
|
+
},
|
|
137
|
+
"require": {
|
|
138
|
+
"types": "./dist/analysis.d.cts",
|
|
139
|
+
"default": "./dist/analysis.cjs"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"./multi-range": {
|
|
143
|
+
"import": {
|
|
144
|
+
"types": "./dist/multi-range.d.ts",
|
|
145
|
+
"default": "./dist/multi-range.js"
|
|
146
|
+
},
|
|
147
|
+
"require": {
|
|
148
|
+
"types": "./dist/multi-range.d.cts",
|
|
149
|
+
"default": "./dist/multi-range.cjs"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"./styles/workbench.css": {
|
|
153
|
+
"types": "./dist/workbench.css.d.ts",
|
|
154
|
+
"default": "./dist/workbench.css"
|
|
155
|
+
},
|
|
156
|
+
"./styles/server-side.css": {
|
|
157
|
+
"types": "./dist/server-side.css.d.ts",
|
|
158
|
+
"default": "./dist/server-side.css"
|
|
91
159
|
}
|
|
92
160
|
},
|
|
93
161
|
"files": [
|
|
@@ -97,7 +165,7 @@
|
|
|
97
165
|
"**/*.css"
|
|
98
166
|
],
|
|
99
167
|
"dependencies": {
|
|
100
|
-
"@agile-team/mach-table": "0.
|
|
168
|
+
"@agile-team/mach-table": "0.32.0"
|
|
101
169
|
},
|
|
102
170
|
"peerDependencies": {
|
|
103
171
|
"react": ">=18.0.0",
|
|
@@ -113,5 +181,5 @@
|
|
|
113
181
|
"test": "vitest run",
|
|
114
182
|
"test:coverage": "vitest run --coverage"
|
|
115
183
|
},
|
|
116
|
-
"readme": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/ChenyCHENYU/MachTable/main/assets/mach-table-logo.svg\" alt=\"MachTable\" width=\"760\" />\n</p>\n\n# @agile-team/mach-table-react\n\nMachTable 0.
|
|
184
|
+
"readme": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/ChenyCHENYU/MachTable/main/assets/mach-table-logo.svg\" alt=\"MachTable\" width=\"760\" />\n</p>\n\n# @agile-team/mach-table-react\n\nMachTable 0.32.0 的官方 React 18+ 适配包。一个依赖即可获得 Core、泛型 `<MachTable>`、应用/路由配置、按需工作流、StrictMode 安全清理和最新闭包事件处理。\n\n```bash\npnpm add @agile-team/mach-table-react\n```\n\n应用入口只引入一次样式:\n\n```ts\nimport \"@agile-team/mach-table-react/styles.css\";\n```\n\n## 基础接入\n\n```tsx\nimport { useMemo } from \"react\";\nimport { MachTable, indexColumn, useMachTable, type ColDef } from \"@agile-team/mach-table-react\";\n\ninterface Row { id: string; name: string }\n\nexport function Customers({ rows }: { rows: Row[] }) {\n const table = useMachTable<Row>();\n const columns = useMemo<ColDef<Row>[]>(\n () => [indexColumn({ headerName: \"序号\" }), { field: \"name\", flex: 1, editable: true }],\n []\n );\n\n return (\n <div style={{ height: 520 }}>\n <MachTable<Row>\n apiRef={table.apiRef}\n rowData={rows}\n columnDefs={columns}\n rowKey=\"id\"\n enableColumnResize\n persistence={{ key: \"customers:list\", sections: [\"columns\"] }}\n />\n </div>\n );\n}\n```\n\n对象型列和配置建议用 `useMemo` 保持引用稳定。`useMachTable()` 同时提供 `apiRef`、响应式 `api` 与 `ready`。\n\n## 应用配置\n\n```ts\n// src/config/mach-table.config.ts\nimport { defineMachTableConfig, defineMachTablePreset } from \"@agile-team/mach-table-react\";\n\nexport default defineMachTableConfig({\n defaults: {\n size: \"compact\",\n columnLayout: \"fit\",\n enableColumnResize: true,\n defaultColDef: { sortable: true, filter: true, resizable: true }\n },\n defaultPreset: \"list\",\n presets: {\n list: defineMachTablePreset({ stripedRows: true }),\n crud: defineMachTablePreset({ rowSelection: \"multiple\", editType: \"fullRow\" })\n }\n});\n```\n\n```tsx\n<MachTableProvider config={machTableConfig}>\n <App />\n</MachTableProvider>\n```\n\nProvider 可按路由/布局嵌套,最近一层覆盖外层,表格 props 优先级最高。\n\n编辑、粘贴、清空和填充复用已有列与整行校验。`useMachTableEditing()` 隔离重挂载或数据替换前的保存结果、错误和冲突;查询工作流在 StrictMode 下保留 `immediate: false`,重复设置相同搜索值不会重新请求。\n\n## 按需加载\n\nReact 不模拟全局组件注册。路由本身懒加载时普通 import 已自然拆包;需要独立边界时:\n\n```tsx\nconst MachTable = lazy(() => import(\"@agile-team/mach-table-react\"));\n```\n\n可选能力使用子入口:\n\n```tsx\nimport { useMachTableQuery, useMachTableEditing } from \"@agile-team/mach-table-react/workflows\";\nimport { MachTableToolbar } from \"@agile-team/mach-table-react/ui\";\nimport { reactCellRenderer } from \"@agile-team/mach-table-react/adapters\";\nimport { createWorkerDataProcessor } from \"@agile-team/mach-table-react/worker\";\n```\n\n- `/workflows`:请求取消、防过期覆盖、服务端分页、跨页选择、脏数据和冲突保存;`reset()` 清空全部表格过滤且只请求一次。\n- `/ui`:可选标准工具栏。\n- `/adapters`:自定义 React cell/detail renderer 桥接。\n- `/worker`:大型本地过滤/排序的独立 Worker 能力。\n\n```tsx\nconst query = useMachTableQuery({\n query: filters,\n queryKey: filters,\n rowKey: \"id\",\n request: orderApi.page,\n mode: \"manual\"\n});\n\n<MachTable<Row> apiRef={table.apiRef} columnDefs={columns} {...query.bindings} />;\n```\n\n该包自动依赖 `@agile-team/mach-table` 并重导出 Core 类型;宿主只需提供 `react` 和 `react-dom >= 18`。\n\n## 行拖拽与条件整行颜色\n\n```ts\nimport { dragColumn, type GridOptions } from \"@agile-team/mach-table-react\";\n\ninterface Plan { id: string; name: string; status: string }\nconst options: GridOptions<Plan> = {\n rowKey: \"id\",\n columnDefs: [dragColumn(), { field: \"name\" }, { field: \"status\" }],\n rowStyleRules: [\n { when: ({ data }) => data.status === \"pending\", tone: \"warning\" },\n { when: ({ data }) => data.status === \"failed\", tone: \"danger\" },\n { when: ({ data }) => data.status === \"done\", tone: \"success\" }\n ]\n};\n```\n\n状态码由应用定义,包内不识别业务状态。颜色规则取第一条命中结果,未命中时沿用默认样式;支持自定义背景/文字颜色、固定列、明暗主题、选择和虚拟行复用。拖拽提供主题手柄、落点线、位置浮层、边缘滚动、Esc 取消和 Alt + ↑/↓ 移动。扁平外部数据设置 `applyRowDrag: false`,由 `onRowDragEnd` 处理持久化;自动模式先完成移动再发出事件,使用 `targetIndex` 读取最终下标。树、分组及排序等自动模式限制见[完整配方](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/row-presentation.md)。\n\n文档:[React 指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/react.md) · [企业接入](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/enterprise-integration.md) · [SSR](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/ssr.md)\n\n## 按需高级入口(0.32)\n\n仍从本包导入,无需另装高级功能包。普通根入口不加载这些实现或附加 CSS。\n\n| 子路径 | 功能 |\n| --- | --- |\n| `/workbench` | 高级过滤草稿与应用、修改差异/部分保存/冲突审阅、手动诊断 |\n| `/preferences` | 复合身份隔离、CAS、有序写入、历史版本及列 ID/类型迁移报告 |\n| `/ordering` | 多行/树移动、防环与业务约束、失败回滚、持久化撤销/重做 |\n| `/server-side` | 服务端分组/聚合、route 分页、缓存/刷新/事务及层级选择 |\n| `/multi-range` | Ctrl/Cmd 追加范围、格式化复制、校验清空及撤销 |\n| `/analysis` | Pivot、安全公式、柱/折线图和数据表回退 |\n\n```ts\nimport { mountAdvancedFilterBuilder } from \"@agile-team/mach-table-react/workbench\";\nimport \"@agile-team/mach-table-react/styles/workbench.css\";\n\nconst filters = mountAdvancedFilterBuilder(host, { api });\n// 宿主卸载时调用;表格销毁也会释放工作台。\nfilters.destroy();\n```\n\n服务端分组控件使用 `/styles/server-side.css`,分析与多范围使用 `/styles/workbench.css`。排序、偏好和纯分析计算无需附加 CSS。服务端 Store 按 route 分页,不提供全树任意显示 offset;分析只处理当前已加载数据并显示范围。排序 undo/redo 的 transport 必须一次 CAS 保存 `context.operations` 的完整批次或 `context.plan.after`,只保存首参数无法完整恢复非连续/跨父级位置。\n\n完整示例与限制:[工作台](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/workbench.md) · [排序](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/row-presentation.md) · [企业偏好](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/enterprise-preferences.md) · [服务端 Store](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/server-side-store.md) · [多范围](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/multi-range.md) · [分析](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/analysis.md)。\n\nSource-available © ChenyCHENYU (Agile Team). 任何使用均须事先取得书面授权。详见 [LICENSE](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSE) 与[授权流程](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSING.md)。\n"
|
|
117
185
|
}
|