@agile-team/mach-table 0.36.0 → 0.37.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 +23 -18
- package/dist/adapter.d.cts +2 -2
- package/dist/adapter.d.ts +2 -2
- package/dist/analysis.d.cts +2 -2
- package/dist/analysis.d.ts +2 -2
- package/dist/{api-Di5SQHAP.d.cts → api-DH2BoJ9I.d.cts} +2 -2
- package/dist/{api-Di5SQHAP.d.ts → api-DH2BoJ9I.d.ts} +2 -2
- package/dist/business.cjs +1 -1
- package/dist/business.d.cts +1 -26
- package/dist/business.d.ts +1 -26
- package/dist/business.js +1 -1
- package/dist/{configuration-nh5lvWDe.d.ts → configuration-CDG7IuBP.d.ts} +1 -1
- package/dist/{configuration-DlRW86iR.d.cts → configuration-DPbk9Afw.d.cts} +1 -1
- package/dist/import.d.cts +1 -1
- package/dist/import.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -13
- package/dist/index.d.ts +4 -13
- package/dist/index.js +5 -5
- package/dist/mach-table.css +1 -1
- package/dist/multi-range.d.cts +1 -1
- package/dist/multi-range.d.ts +1 -1
- package/dist/ordering.d.cts +1 -1
- package/dist/ordering.d.ts +1 -1
- package/dist/preferences.d.cts +1 -1
- package/dist/preferences.d.ts +1 -1
- package/dist/server-side.cjs +1 -1
- package/dist/server-side.d.cts +1 -1
- package/dist/server-side.d.ts +1 -1
- package/dist/server-side.js +1 -1
- package/dist/{shared-O6pPO8H8.d.cts → shared-C-HciMdN.d.cts} +1 -1
- package/dist/{shared-BusgJSf4.d.ts → shared-CvUdCijb.d.ts} +1 -1
- package/dist/workbench.cjs +1 -1
- package/dist/workbench.css +1 -1
- package/dist/workbench.d.cts +3 -3
- package/dist/workbench.d.ts +3 -3
- package/dist/workbench.js +1 -1
- package/dist/worker.d.cts +2 -2
- package/dist/worker.d.ts +2 -2
- package/package.json +2 -2
- package/dist/cachedDictionary-C26hMT22.d.cts +0 -30
- package/dist/cachedDictionary-C26hMT22.d.ts +0 -30
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# @agile-team/mach-table
|
|
6
6
|
|
|
7
|
-
MachTable 0.
|
|
7
|
+
MachTable 0.37.0 的框架无关 TypeScript Core:零运行时依赖,提供行列双虚拟化、领域化 API、单元格/整行编辑、树与分组、随机访问远程数据、区段隔离状态持久化和可诊断扩展系统。本版统一完整表头宽度下限,覆盖初始布局、fit、状态恢复及交互缩列,内置插画空态与亮暗主题继续保留;本版移除内置字典服务与专用列适配,页面通过通用格式化、选项和刷新 API 组合独立数据插件;`/business` 保留本地语义合计。删除的 API 与迁移见升级指南。
|
|
8
8
|
|
|
9
9
|
小型本地明细可使用 `domLayout: "autoHeight"` 随当前页内容收起;本版为该模式的空态、加载态和错误态预留必要展示空间,恢复数据后释放最小高度。可通过 `--mach-overlay-min-height` 局部调整。大数据表继续使用有明确高度的默认虚拟布局。
|
|
10
10
|
|
|
@@ -98,7 +98,7 @@ const options: GridOptions<Plan> = {
|
|
|
98
98
|
| `/server-side` | 服务端分组/聚合、route 分页、缓存/刷新/事务及层级选择 |
|
|
99
99
|
| `/multi-range` | Ctrl/Cmd 追加范围、格式化复制、校验清空及撤销 |
|
|
100
100
|
| `/import` | 有界数据预览、共享同步/异步校验、结构化错误与过期保护 |
|
|
101
|
-
| `/business` |
|
|
101
|
+
| `/business` | 范围与币种/单位分组的本地语义合计 |
|
|
102
102
|
| `/analysis` | Pivot、安全公式、柱/折线图和数据表回退 |
|
|
103
103
|
|
|
104
104
|
```ts
|
|
@@ -116,28 +116,33 @@ filters.destroy();
|
|
|
116
116
|
|
|
117
117
|
Source-available © ChenyCHENYU (Agile Team). 任何使用均须事先取得书面授权。详见 [LICENSE](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSE) 与[授权流程](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSING.md)。
|
|
118
118
|
|
|
119
|
-
##
|
|
119
|
+
## 显示策略与本地合计
|
|
120
|
+
|
|
121
|
+
页面把已准备好的标签与普通格式化函数组合到列上。MachTable 只接收同步函数与普通选项,不持有字典实例、加载服务或订阅协议。异步数据准备与刷新由项目管理。
|
|
120
122
|
|
|
121
123
|
```ts
|
|
122
|
-
import {
|
|
124
|
+
import { summarizeRows } from "@agile-team/mach-table/business";
|
|
123
125
|
|
|
124
|
-
const
|
|
125
|
-
const labels = new Map(options.map(entry => [entry.value, entry.label]));
|
|
126
|
+
const labels = new Map([["ready", "已就绪"]]);
|
|
126
127
|
const statusColumn = {
|
|
127
128
|
field: "status",
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
output: { clipboard: "label", csv: "code-label" }
|
|
132
|
-
})
|
|
129
|
+
valueFormatter: ({ value }) => labels.get(String(value)) ?? String(value ?? ""),
|
|
130
|
+
valueSerializer: ({ value, target }) =>
|
|
131
|
+
target === "clipboard" ? labels.get(String(value)) ?? value : value
|
|
133
132
|
};
|
|
133
|
+
const rows = [{ currency: "CNY", unit: "t", amount: 120, completed: 2, planned: 4 }];
|
|
134
|
+
const summary = summarizeRows(rows, {
|
|
135
|
+
scope: "page",
|
|
136
|
+
groupBy: row => JSON.stringify([row.currency, row.unit]),
|
|
137
|
+
metrics: [
|
|
138
|
+
{ id: "amount", kind: "sum", value: row => row.amount },
|
|
139
|
+
{ id: "count", kind: "count" },
|
|
140
|
+
{ id: "completion", kind: "ratio", numerator: row => row.completed, denominator: row => row.planned }
|
|
141
|
+
]
|
|
142
|
+
});
|
|
134
143
|
```
|
|
135
144
|
|
|
136
|
-
`/business`
|
|
137
|
-
|
|
138
|
-
`summarizeRows(rows, { scope, metrics, groupBy?, numeric? })` 只计算传入记录,支持 sum/count/ratio/none;ratio 先分别汇总分子分母。业务按币种、单位分组,scope 仅声明 page/selected/query,不自动获取全量。默认有限 number 仍遵循浮点语义,精确金额使用已有同步 numeric 策略;结果接入原 summaryMethod 或固定行。详见[业务列与字典](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/business-columns.md)。
|
|
139
|
-
|
|
140
|
-
根入口的 `createCachedDictionary()` 现在复用同 key 在途请求,失效隔离旧响应并结束旧等待,缺失项受同一 TTL/LRU 约束。失败可重试,销毁拒绝未完成请求,错误观察回调不会阻塞清理。具体升级边界见[升级指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/upgrading.md)。
|
|
145
|
+
`/business` 只提供本地语义合计;scope 声明 page/selected/query,实际只处理传入记录。ratio 先汇总分子分母,精确金额可注入 numeric 策略;服务端全量由后端计算。详情见[业务列与合计](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/business-columns.md)。
|
|
141
146
|
|
|
142
147
|
## 列值与运行边界(自 0.33)
|
|
143
148
|
|
|
@@ -150,7 +155,7 @@ const statusColumn = {
|
|
|
150
155
|
|
|
151
156
|
## 内容列宽与状态颜色(0.35)
|
|
152
157
|
|
|
153
|
-
未声明 `width` 的列默认按表头和已加载数据的显示文本测宽:每列均匀抽样最多 100 行,默认 80–360px,`minWidth/maxWidth`
|
|
158
|
+
未声明 `width` 的列默认按表头和已加载数据的显示文本测宽:每列均匀抽样最多 100 行,默认 80–360px,`minWidth/maxWidth` 可覆盖。长内容在单元格内省略,表格保留内部横向滚动;不为测宽请求远程数据或执行自定义渲染器。格式化文本及状态标签文字都参与测量。图形/操作等特殊列请指定宽度。
|
|
154
159
|
|
|
155
160
|
```ts
|
|
156
161
|
const columns = [
|
|
@@ -164,7 +169,7 @@ const columns = [
|
|
|
164
169
|
];
|
|
165
170
|
```
|
|
166
171
|
|
|
167
|
-
`status` 复用主题标签,支持 `success/warning/danger/info/neutral` 及 CSS 颜色;未知代码保持中性,`0/false`
|
|
172
|
+
`status` 复用主题标签,支持 `success/warning/danger/info/neutral` 及 CSS 颜色;未知代码保持中性,`0/false` 保留。formatter 的文字可参与默认语义匹配;显式 renderer 优先。状态配置只控制展示,导出继续遵循原有列值政策。
|
|
168
173
|
|
|
169
174
|
普通布局尊重显式 `width` 和拖动后的宽度;`autoWidth: false` 保留原默认 150px。显式选择 `columnLayout: "fit"` 时仍按首选宽度比例铺满,360px 限制的是内容首选宽度,实际铺满仍遵循显式 minWidth/maxWidth;配置 `flex` 则主动允许本列吸收余量。手动调宽、列状态恢复及主动 `columns.fit()` 不受自动默认上限限制。更新数据或刷新单元格会重新测量,普通布局刷新复用结果。
|
|
170
175
|
|
package/dist/adapter.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as GridApi, c as GridOptions, j as GridEventType } from './api-
|
|
2
|
-
export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-
|
|
1
|
+
import { b as GridApi, c as GridOptions, j as GridEventType } from './api-DH2BoJ9I.cjs';
|
|
2
|
+
export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-DPbk9Afw.cjs';
|
|
3
3
|
|
|
4
4
|
/** Bounded structural comparison for small immutable config values, never row data. */
|
|
5
5
|
declare function equivalentConfigValue(left: unknown, right: unknown, depth?: number): boolean;
|
package/dist/adapter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as GridApi, c as GridOptions, j as GridEventType } from './api-
|
|
2
|
-
export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-
|
|
1
|
+
import { b as GridApi, c as GridOptions, j as GridEventType } from './api-DH2BoJ9I.js';
|
|
2
|
+
export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-CDG7IuBP.js';
|
|
3
3
|
|
|
4
4
|
/** Bounded structural comparison for small immutable config values, never row data. */
|
|
5
5
|
declare function equivalentConfigValue(left: unknown, right: unknown, depth?: number): boolean;
|
package/dist/analysis.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WorkbenchOptions, a as WorkbenchHandle } from './shared-
|
|
2
|
-
import './api-
|
|
1
|
+
import { W as WorkbenchOptions, a as WorkbenchHandle } from './shared-C-HciMdN.cjs';
|
|
2
|
+
import './api-DH2BoJ9I.cjs';
|
|
3
3
|
|
|
4
4
|
type PivotAggregate = "sum" | "count" | "avg" | "min" | "max";
|
|
5
5
|
type PivotDimension = string | number | boolean | null;
|
package/dist/analysis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WorkbenchOptions, a as WorkbenchHandle } from './shared-
|
|
2
|
-
import './api-
|
|
1
|
+
import { W as WorkbenchOptions, a as WorkbenchHandle } from './shared-CvUdCijb.js';
|
|
2
|
+
import './api-DH2BoJ9I.js';
|
|
3
3
|
|
|
4
4
|
type PivotAggregate = "sum" | "count" | "avg" | "min" | "max";
|
|
5
5
|
type PivotDimension = string | number | boolean | null;
|
|
@@ -219,7 +219,7 @@ interface SelectEditorOption {
|
|
|
219
219
|
interface SelectEditorParams {
|
|
220
220
|
/** Primitive options kept for concise same-label/same-value selects. */
|
|
221
221
|
values?: readonly (string | number)[];
|
|
222
|
-
/** Label/value options
|
|
222
|
+
/** Label/value options when the stored value differs from its display text. */
|
|
223
223
|
options?: readonly SelectEditorOption[];
|
|
224
224
|
}
|
|
225
225
|
interface SetFilterParams {
|
|
@@ -1435,4 +1435,4 @@ interface GridApi<TData = any> {
|
|
|
1435
1435
|
isDestroyed(): boolean;
|
|
1436
1436
|
}
|
|
1437
1437
|
|
|
1438
|
-
export { type
|
|
1438
|
+
export { type ContextMenuItem as $, type AdvancedFilterModel as A, type ApplyGridStateOptions as B, type ColDef as C, type CellAlign as D, type CellClassParams as E, type FilterType as F, type GridFeature as G, type CellClassRule as H, type ImportMatrixOptions as I, type CellClickEvent as J, type CellContextMenuEvent as K, type CellDoubleClickEvent as L, type CellEditingStartedEvent as M, type CellEditingStoppedEvent as N, type CellEditorFactory as O, type CellEditorParams as P, type CellRendererOutput as Q, type CellStyleRule as R, type SortModel as S, type CellValueChangedEvent as T, type ColDefOrGroup as U, type ColumnLayoutMode as V, type ColumnMovedEvent as W, type ColumnResizedEvent as X, type ColumnStatus as Y, type ColumnVisibilityChangedEvent as Z, type ColumnWorkbenchItem as _, type GridCellRange as a, type PaginationChangedEvent as a$, type ContextMenuParams as a0, type CsvExportParams as a1, DEFAULT_LOCALE as a2, type DatasourceMode as a3, type DateFilterCondition as a4, type DateFilterMatch as a5, type DetailRowRendererParams as a6, type DetailToggledEvent as a7, type DirtyStateChangedEvent as a8, type DomLayoutMode as a9, type GridHierarchyApi as aA, type GridIoApi as aB, type GridPaginationApi as aC, type GridPerformanceSnapshot as aD, type GridPersistenceOptions as aE, type GridReadyEvent as aF, type GridRowsApi as aG, type GridSelectionApi as aH, type GridSortingApi as aI, type GridStateApi as aJ, type GridStateSection as aK, type GridUpdateSchedulerSnapshot as aL, type GridViewApi as aM, type HeaderComponentParams as aN, type ICellEditor as aO, type ICellRendererResult as aP, type ImportCsvOptions as aQ, type InfiniteGetRowsParams as aR, LOCALE_EN as aS, type MachTableLocale as aT, type MachTableLocaleKey as aU, type MatrixExportParams as aV, type ModelUpdatedEvent as aW, type NumberFilterCondition as aX, type NumberFilterMatch as aY, type OverlayContent as aZ, type OverlayTemplate as a_, EVENT_TYPES as aa, type EditableIndicator as ab, type EditableParams as ac, type EventHandlers as ad, type FilterChangedEvent as ae, type GetRowHeightParams as af, type GridAsyncOptions as ag, type GridBatchSaveResult as ah, type GridCellChange as ai, type GridColumnsApi as aj, type GridDataProcessorColumn as ak, type GridDataProcessorRequest as al, type GridDataProcessorResult as am, type GridDataProcessorRow as an, type GridDatasource as ao, type GridDiagnosticError as ap, type GridDiagnostics as aq, type GridDiagnosticsApi as ar, type GridEditType as as, type GridEditingApi as at, type GridErrorCode as au, type GridErrorEvent as av, type GridEventBase as aw, type GridEventMap as ax, type GridFeatureContext as ay, type GridFilteringApi as az, type GridApi as b, type PaginationConfig as b0, type PinnedDirection as b1, type PrintOptions as b2, type RangeSelectionChangedEvent as b3, type RefreshCellsParams as b4, type RemoteBlockCacheSnapshot as b5, type ResolvedGridOptions as b6, type RowClickEvent as b7, type RowDragEndEvent as b8, type RowDragIntent as b9, type ThemeMode as bA, type TooltipParams as bB, type TreeChildrenLoadFailedEvent as bC, type TreeChildrenLoadedEvent as bD, type TreeDataLoadParams as bE, type ValueFormatterParams as bF, type ValueGetterParams as bG, type ValueInputSource as bH, type ValueOutputTarget as bI, type ValueParserParams as bJ, type ValueSerializerParams as bK, type ValueSetterParams as bL, type WatermarkConfig as bM, formatText as bN, formatTwo as bO, isColDefGroup as bP, matchLocaleKey as bQ, type RowDragPolicy as ba, type RowEditChange as bb, type RowEditValidationParams as bc, type RowEditValidationResult as bd, type RowEditingStartedEvent as be, type RowEditingStoppedEvent as bf, type RowNode as bg, type RowSelectionMode as bh, type RowStyleParams as bi, type RowStyleRule as bj, type RowTone as bk, type RowTransaction as bl, type SaveChangeIssue as bm, type SaveChangesResult as bn, type SelectEditorOption as bo, type SelectEditorParams as bp, type SelectionChangedEvent as bq, type SetFilterCondition as br, type SetFilterParams as bs, type SortChangedEvent as bt, type SortDirection as bu, type SortModelItem as bv, type StatusBarConfig as bw, type StatusBarPanel as bx, type TextFilterCondition as by, type TextFilterMatch as bz, type GridOptions as c, type GridDataProcessor as d, type GridComponents as e, type GridState as f, type GridStateStore as g, type FilterModel as h, type FieldPath as i, type GridEventType as j, type SaveChangesHandler as k, type ColumnFilter as l, type AdvancedFilterCondition as m, type AdvancedFilterNode as n, type AdvancedFilterGroup as o, type ColDefGroup as p, type GridStateInput as q, type GridSize as r, type CellRendererParams as s, type GridChange as t, type CellRendererFn as u, type FieldPathValue as v, type SaveChangeConflict as w, type ColumnState as x, type ActionPolicy as y, type ActionPolicyContext as z };
|
|
@@ -219,7 +219,7 @@ interface SelectEditorOption {
|
|
|
219
219
|
interface SelectEditorParams {
|
|
220
220
|
/** Primitive options kept for concise same-label/same-value selects. */
|
|
221
221
|
values?: readonly (string | number)[];
|
|
222
|
-
/** Label/value options
|
|
222
|
+
/** Label/value options when the stored value differs from its display text. */
|
|
223
223
|
options?: readonly SelectEditorOption[];
|
|
224
224
|
}
|
|
225
225
|
interface SetFilterParams {
|
|
@@ -1435,4 +1435,4 @@ interface GridApi<TData = any> {
|
|
|
1435
1435
|
isDestroyed(): boolean;
|
|
1436
1436
|
}
|
|
1437
1437
|
|
|
1438
|
-
export { type
|
|
1438
|
+
export { type ContextMenuItem as $, type AdvancedFilterModel as A, type ApplyGridStateOptions as B, type ColDef as C, type CellAlign as D, type CellClassParams as E, type FilterType as F, type GridFeature as G, type CellClassRule as H, type ImportMatrixOptions as I, type CellClickEvent as J, type CellContextMenuEvent as K, type CellDoubleClickEvent as L, type CellEditingStartedEvent as M, type CellEditingStoppedEvent as N, type CellEditorFactory as O, type CellEditorParams as P, type CellRendererOutput as Q, type CellStyleRule as R, type SortModel as S, type CellValueChangedEvent as T, type ColDefOrGroup as U, type ColumnLayoutMode as V, type ColumnMovedEvent as W, type ColumnResizedEvent as X, type ColumnStatus as Y, type ColumnVisibilityChangedEvent as Z, type ColumnWorkbenchItem as _, type GridCellRange as a, type PaginationChangedEvent as a$, type ContextMenuParams as a0, type CsvExportParams as a1, DEFAULT_LOCALE as a2, type DatasourceMode as a3, type DateFilterCondition as a4, type DateFilterMatch as a5, type DetailRowRendererParams as a6, type DetailToggledEvent as a7, type DirtyStateChangedEvent as a8, type DomLayoutMode as a9, type GridHierarchyApi as aA, type GridIoApi as aB, type GridPaginationApi as aC, type GridPerformanceSnapshot as aD, type GridPersistenceOptions as aE, type GridReadyEvent as aF, type GridRowsApi as aG, type GridSelectionApi as aH, type GridSortingApi as aI, type GridStateApi as aJ, type GridStateSection as aK, type GridUpdateSchedulerSnapshot as aL, type GridViewApi as aM, type HeaderComponentParams as aN, type ICellEditor as aO, type ICellRendererResult as aP, type ImportCsvOptions as aQ, type InfiniteGetRowsParams as aR, LOCALE_EN as aS, type MachTableLocale as aT, type MachTableLocaleKey as aU, type MatrixExportParams as aV, type ModelUpdatedEvent as aW, type NumberFilterCondition as aX, type NumberFilterMatch as aY, type OverlayContent as aZ, type OverlayTemplate as a_, EVENT_TYPES as aa, type EditableIndicator as ab, type EditableParams as ac, type EventHandlers as ad, type FilterChangedEvent as ae, type GetRowHeightParams as af, type GridAsyncOptions as ag, type GridBatchSaveResult as ah, type GridCellChange as ai, type GridColumnsApi as aj, type GridDataProcessorColumn as ak, type GridDataProcessorRequest as al, type GridDataProcessorResult as am, type GridDataProcessorRow as an, type GridDatasource as ao, type GridDiagnosticError as ap, type GridDiagnostics as aq, type GridDiagnosticsApi as ar, type GridEditType as as, type GridEditingApi as at, type GridErrorCode as au, type GridErrorEvent as av, type GridEventBase as aw, type GridEventMap as ax, type GridFeatureContext as ay, type GridFilteringApi as az, type GridApi as b, type PaginationConfig as b0, type PinnedDirection as b1, type PrintOptions as b2, type RangeSelectionChangedEvent as b3, type RefreshCellsParams as b4, type RemoteBlockCacheSnapshot as b5, type ResolvedGridOptions as b6, type RowClickEvent as b7, type RowDragEndEvent as b8, type RowDragIntent as b9, type ThemeMode as bA, type TooltipParams as bB, type TreeChildrenLoadFailedEvent as bC, type TreeChildrenLoadedEvent as bD, type TreeDataLoadParams as bE, type ValueFormatterParams as bF, type ValueGetterParams as bG, type ValueInputSource as bH, type ValueOutputTarget as bI, type ValueParserParams as bJ, type ValueSerializerParams as bK, type ValueSetterParams as bL, type WatermarkConfig as bM, formatText as bN, formatTwo as bO, isColDefGroup as bP, matchLocaleKey as bQ, type RowDragPolicy as ba, type RowEditChange as bb, type RowEditValidationParams as bc, type RowEditValidationResult as bd, type RowEditingStartedEvent as be, type RowEditingStoppedEvent as bf, type RowNode as bg, type RowSelectionMode as bh, type RowStyleParams as bi, type RowStyleRule as bj, type RowTone as bk, type RowTransaction as bl, type SaveChangeIssue as bm, type SaveChangesResult as bn, type SelectEditorOption as bo, type SelectEditorParams as bp, type SelectionChangedEvent as bq, type SetFilterCondition as br, type SetFilterParams as bs, type SortChangedEvent as bt, type SortDirection as bu, type SortModelItem as bv, type StatusBarConfig as bw, type StatusBarPanel as bx, type TextFilterCondition as by, type TextFilterMatch as bz, type GridOptions as c, type GridDataProcessor as d, type GridComponents as e, type GridState as f, type GridStateStore as g, type FilterModel as h, type FieldPath as i, type GridEventType as j, type SaveChangesHandler as k, type ColumnFilter as l, type AdvancedFilterCondition as m, type AdvancedFilterNode as n, type AdvancedFilterGroup as o, type ColDefGroup as p, type GridStateInput as q, type GridSize as r, type CellRendererParams as s, type GridChange as t, type CellRendererFn as u, type FieldPathValue as v, type SaveChangeConflict as w, type ColumnState as x, type ActionPolicy as y, type ActionPolicyContext as z };
|
package/dist/business.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var u in e)c(r,u,{get:e[u],enumerable:!0})},p=(r,e,u,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of y(e))!S.call(r,t)&&t!==u&&c(r,t,{get:()=>e[t],enumerable:!(a=T(e,t))||a.enumerable});return r};var g=r=>p(c({},"__esModule",{value:!0}),r);var k={};f(k,{summarizeRows:()=>d});module.exports=g(k);function s(r){if(typeof r!="number"||!Number.isFinite(r)||Math.abs(r)>Number.MAX_SAFE_INTEGER)throw new TypeError("[MachTable] Summary arithmetic requires finite numbers within the safe range; provide numeric for decimal strings or exact arithmetic.");return r}function m(r){if(r!=null&&typeof r.then=="function")throw Promise.resolve(r).catch(()=>{}),new TypeError("[MachTable] Summary numeric callbacks must return synchronous values.");return r}var V={zero:()=>0,add:(r,e)=>s(r+s(e)),divide:(r,e)=>e===0?null:s(r/e)};function l(r,e){let u=new Map;for(let a of r)(a.kind==="sum"||a.kind==="ratio")&&u.set(a.id,{value:m(e.zero()),denominator:m(e.zero())});return{rowCount:0,totals:u}}function b(r,e,u,a){e.rowCount++;for(let t of u){if(t.kind==="count"||t.kind==="none")continue;let n=e.totals.get(t.id),o=t.kind==="sum"?t.value(r):t.numerator(r);if(o!=null&&o!==""&&(n.value=m(a.add(n.value,o))),t.kind==="ratio"){let i=t.denominator(r);i!=null&&i!==""&&(n.denominator=m(a.add(n.denominator,i)))}}}function w(r,e,u){let a=Object.create(null);for(let t of e)if(t.kind!=="none")if(t.kind==="count")a[t.id]=r.rowCount;else{let n=r.totals.get(t.id);a[t.id]=t.kind==="sum"?n.value:m(u.divide(n.value,n.denominator))}return a}function d(r,e){let u=new Set;for(let n of e.metrics){if(!n.id||u.has(n.id))throw new TypeError("[MachTable] Summary metric IDs must be non-empty and unique.");u.add(n.id)}let a=e.numeric??V,t=new Map;e.groupBy||t.set(void 0,l(e.metrics,a));for(let n of r){let o=e.groupBy?.(n);if(e.groupBy&&typeof o!="string"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError("[MachTable] Summary group keys must be strings or finite numbers.");let i=t.get(o);i||(i=l(e.metrics,a),t.set(o,i)),b(n,i,e.metrics,a)}return{scope:e.scope,groups:[...t].map(([n,o])=>({key:n,rowCount:o.rowCount,values:w(o,e.metrics,a)}))}}0&&(module.exports={summarizeRows});
|
package/dist/business.d.cts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
import { V as ValueOutputTarget, C as ColDef } from './api-Di5SQHAP.cjs';
|
|
2
|
-
import { D as DictionaryKey } from './cachedDictionary-C26hMT22.cjs';
|
|
3
|
-
|
|
4
|
-
type DictionaryDisplay = "code" | "label" | "code-label";
|
|
5
|
-
type ColumnKey = DictionaryKey | boolean;
|
|
6
|
-
interface ColumnEntry<TKey extends ColumnKey> {
|
|
7
|
-
value: TKey;
|
|
8
|
-
label: string;
|
|
9
|
-
}
|
|
10
|
-
/** Structural adapter for an existing provider; this helper never loads or caches remote data. */
|
|
11
|
-
interface DictionaryColumnSource<TKey extends ColumnKey = ColumnKey> {
|
|
12
|
-
get(key: TKey): string | undefined;
|
|
13
|
-
}
|
|
14
|
-
interface DictionaryColumnOptions<TKey extends ColumnKey = ColumnKey> {
|
|
15
|
-
/** Immutable snapshot for reverse parsing. Replace its identity when options change. */
|
|
16
|
-
options?: readonly ColumnEntry<TKey>[] | (() => readonly ColumnEntry<TKey>[]);
|
|
17
|
-
display?: DictionaryDisplay;
|
|
18
|
-
/** Array display/output only; input strings are never split implicitly. */
|
|
19
|
-
separator?: string;
|
|
20
|
-
/** Omitted targets preserve the original code and its type. */
|
|
21
|
-
output?: Partial<Record<ValueOutputTarget, DictionaryDisplay>>;
|
|
22
|
-
}
|
|
23
|
-
/** Explicit, synchronous dictionary presentation and typed IO; no existing defaults are changed. */
|
|
24
|
-
declare function createDictionaryColumn<TData = any, TKey extends ColumnKey = ColumnKey>(source: DictionaryColumnSource<TKey>, config?: DictionaryColumnOptions<TKey>): Partial<ColDef<TData>>;
|
|
25
|
-
|
|
26
1
|
type SummaryScope = "page" | "selected" | "query";
|
|
27
2
|
type SemanticSummaryMetric<TData> = {
|
|
28
3
|
id: string;
|
|
@@ -65,4 +40,4 @@ interface SemanticSummaryResult<TValue = number> {
|
|
|
65
40
|
/** O(rows × metrics) local aggregation, with explicit scope and no implicit currency/unit mixing. */
|
|
66
41
|
declare function summarizeRows<TData, TValue = number>(rows: readonly TData[], options: SemanticSummaryOptions<TData, TValue>): SemanticSummaryResult<TValue>;
|
|
67
42
|
|
|
68
|
-
export { type
|
|
43
|
+
export { type SemanticSummaryMetric, type SemanticSummaryOptions, type SemanticSummaryResult, type SummaryNumericStrategy, type SummaryScope, summarizeRows };
|
package/dist/business.d.ts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
import { V as ValueOutputTarget, C as ColDef } from './api-Di5SQHAP.js';
|
|
2
|
-
import { D as DictionaryKey } from './cachedDictionary-C26hMT22.js';
|
|
3
|
-
|
|
4
|
-
type DictionaryDisplay = "code" | "label" | "code-label";
|
|
5
|
-
type ColumnKey = DictionaryKey | boolean;
|
|
6
|
-
interface ColumnEntry<TKey extends ColumnKey> {
|
|
7
|
-
value: TKey;
|
|
8
|
-
label: string;
|
|
9
|
-
}
|
|
10
|
-
/** Structural adapter for an existing provider; this helper never loads or caches remote data. */
|
|
11
|
-
interface DictionaryColumnSource<TKey extends ColumnKey = ColumnKey> {
|
|
12
|
-
get(key: TKey): string | undefined;
|
|
13
|
-
}
|
|
14
|
-
interface DictionaryColumnOptions<TKey extends ColumnKey = ColumnKey> {
|
|
15
|
-
/** Immutable snapshot for reverse parsing. Replace its identity when options change. */
|
|
16
|
-
options?: readonly ColumnEntry<TKey>[] | (() => readonly ColumnEntry<TKey>[]);
|
|
17
|
-
display?: DictionaryDisplay;
|
|
18
|
-
/** Array display/output only; input strings are never split implicitly. */
|
|
19
|
-
separator?: string;
|
|
20
|
-
/** Omitted targets preserve the original code and its type. */
|
|
21
|
-
output?: Partial<Record<ValueOutputTarget, DictionaryDisplay>>;
|
|
22
|
-
}
|
|
23
|
-
/** Explicit, synchronous dictionary presentation and typed IO; no existing defaults are changed. */
|
|
24
|
-
declare function createDictionaryColumn<TData = any, TKey extends ColumnKey = ColumnKey>(source: DictionaryColumnSource<TKey>, config?: DictionaryColumnOptions<TKey>): Partial<ColDef<TData>>;
|
|
25
|
-
|
|
26
1
|
type SummaryScope = "page" | "selected" | "query";
|
|
27
2
|
type SemanticSummaryMetric<TData> = {
|
|
28
3
|
id: string;
|
|
@@ -65,4 +40,4 @@ interface SemanticSummaryResult<TValue = number> {
|
|
|
65
40
|
/** O(rows × metrics) local aggregation, with explicit scope and no implicit currency/unit mixing. */
|
|
66
41
|
declare function summarizeRows<TData, TValue = number>(rows: readonly TData[], options: SemanticSummaryOptions<TData, TValue>): SemanticSummaryResult<TValue>;
|
|
67
42
|
|
|
68
|
-
export { type
|
|
43
|
+
export { type SemanticSummaryMetric, type SemanticSummaryOptions, type SemanticSummaryResult, type SummaryNumericStrategy, type SummaryScope, summarizeRows };
|
package/dist/business.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function c(e){if(typeof e!="number"||!Number.isFinite(e)||Math.abs(e)>Number.MAX_SAFE_INTEGER)throw new TypeError("[MachTable] Summary arithmetic requires finite numbers within the safe range; provide numeric for decimal strings or exact arithmetic.");return e}function m(e){if(e!=null&&typeof e.then=="function")throw Promise.resolve(e).catch(()=>{}),new TypeError("[MachTable] Summary numeric callbacks must return synchronous values.");return e}var l={zero:()=>0,add:(e,r)=>c(e+c(r)),divide:(e,r)=>r===0?null:c(e/r)};function s(e,r){let o=new Map;for(let n of e)(n.kind==="sum"||n.kind==="ratio")&&o.set(n.id,{value:m(r.zero()),denominator:m(r.zero())});return{rowCount:0,totals:o}}function d(e,r,o,n){r.rowCount++;for(let t of o){if(t.kind==="count"||t.kind==="none")continue;let a=r.totals.get(t.id),u=t.kind==="sum"?t.value(e):t.numerator(e);if(u!=null&&u!==""&&(a.value=m(n.add(a.value,u))),t.kind==="ratio"){let i=t.denominator(e);i!=null&&i!==""&&(a.denominator=m(n.add(a.denominator,i)))}}}function T(e,r,o){let n=Object.create(null);for(let t of r)if(t.kind!=="none")if(t.kind==="count")n[t.id]=e.rowCount;else{let a=e.totals.get(t.id);n[t.id]=t.kind==="sum"?a.value:m(o.divide(a.value,a.denominator))}return n}function y(e,r){let o=new Set;for(let a of r.metrics){if(!a.id||o.has(a.id))throw new TypeError("[MachTable] Summary metric IDs must be non-empty and unique.");o.add(a.id)}let n=r.numeric??l,t=new Map;r.groupBy||t.set(void 0,s(r.metrics,n));for(let a of e){let u=r.groupBy?.(a);if(r.groupBy&&typeof u!="string"&&(typeof u!="number"||!Number.isFinite(u)))throw new TypeError("[MachTable] Summary group keys must be strings or finite numbers.");let i=t.get(u);i||(i=s(r.metrics,n),t.set(u,i)),d(a,i,r.metrics,n)}return{scope:r.scope,groups:[...t].map(([a,u])=>({key:a,rowCount:u.rowCount,values:T(u,r.metrics,n)}))}}export{y as summarizeRows};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as GridOptions, d as GridDataProcessor, C as ColDef, e as GridComponents } from './api-
|
|
1
|
+
import { c as GridOptions, d as GridDataProcessor, C as ColDef, e as GridComponents } from './api-DH2BoJ9I.js';
|
|
2
2
|
|
|
3
3
|
type MachTablePresetSelection = string | readonly string[] | false;
|
|
4
4
|
type MachTableInstanceOptionKey = "rowData" | "columnDefs" | "datasource" | "loading" | "error" | "initialState" | "persistence" | "components" | "columnTypes";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as GridOptions, d as GridDataProcessor, C as ColDef, e as GridComponents } from './api-
|
|
1
|
+
import { c as GridOptions, d as GridDataProcessor, C as ColDef, e as GridComponents } from './api-DH2BoJ9I.cjs';
|
|
2
2
|
|
|
3
3
|
type MachTablePresetSelection = string | readonly string[] | false;
|
|
4
4
|
type MachTableInstanceOptionKey = "rowData" | "columnDefs" | "datasource" | "loading" | "error" | "initialState" | "persistence" | "components" | "columnTypes";
|
package/dist/import.d.cts
CHANGED
package/dist/import.d.ts
CHANGED