@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.
Files changed (42) hide show
  1. package/README.md +23 -18
  2. package/dist/adapter.d.cts +2 -2
  3. package/dist/adapter.d.ts +2 -2
  4. package/dist/analysis.d.cts +2 -2
  5. package/dist/analysis.d.ts +2 -2
  6. package/dist/{api-Di5SQHAP.d.cts → api-DH2BoJ9I.d.cts} +2 -2
  7. package/dist/{api-Di5SQHAP.d.ts → api-DH2BoJ9I.d.ts} +2 -2
  8. package/dist/business.cjs +1 -1
  9. package/dist/business.d.cts +1 -26
  10. package/dist/business.d.ts +1 -26
  11. package/dist/business.js +1 -1
  12. package/dist/{configuration-nh5lvWDe.d.ts → configuration-CDG7IuBP.d.ts} +1 -1
  13. package/dist/{configuration-DlRW86iR.d.cts → configuration-DPbk9Afw.d.cts} +1 -1
  14. package/dist/import.d.cts +1 -1
  15. package/dist/import.d.ts +1 -1
  16. package/dist/index.cjs +5 -5
  17. package/dist/index.d.cts +4 -13
  18. package/dist/index.d.ts +4 -13
  19. package/dist/index.js +5 -5
  20. package/dist/mach-table.css +1 -1
  21. package/dist/multi-range.d.cts +1 -1
  22. package/dist/multi-range.d.ts +1 -1
  23. package/dist/ordering.d.cts +1 -1
  24. package/dist/ordering.d.ts +1 -1
  25. package/dist/preferences.d.cts +1 -1
  26. package/dist/preferences.d.ts +1 -1
  27. package/dist/server-side.cjs +1 -1
  28. package/dist/server-side.d.cts +1 -1
  29. package/dist/server-side.d.ts +1 -1
  30. package/dist/server-side.js +1 -1
  31. package/dist/{shared-O6pPO8H8.d.cts → shared-C-HciMdN.d.cts} +1 -1
  32. package/dist/{shared-BusgJSf4.d.ts → shared-CvUdCijb.d.ts} +1 -1
  33. package/dist/workbench.cjs +1 -1
  34. package/dist/workbench.css +1 -1
  35. package/dist/workbench.d.cts +3 -3
  36. package/dist/workbench.d.ts +3 -3
  37. package/dist/workbench.js +1 -1
  38. package/dist/worker.d.cts +2 -2
  39. package/dist/worker.d.ts +2 -2
  40. package/package.json +2 -2
  41. package/dist/cachedDictionary-C26hMT22.d.cts +0 -30
  42. 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.36.0 的框架无关 TypeScript Core:零运行时依赖,提供行列双虚拟化、领域化 API、单元格/整行编辑、树与分组、随机访问远程数据、区段隔离状态持久化和可诊断扩展系统。本版统一完整表头宽度下限,覆盖初始布局、fit、状态恢复及交互缩列,内置插画空态与亮暗主题继续保留;可选 `/business` 的字典列策略、本地语义合计及字典缓存隔离继续兼容;普通根入口 API 和既有默认行为保持兼容。
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
- ## 0.34 字典列策略与语义合计
119
+ ## 显示策略与本地合计
120
+
121
+ 页面把已准备好的标签与普通格式化函数组合到列上。MachTable 只接收同步函数与普通选项,不持有字典实例、加载服务或订阅协议。异步数据准备与刷新由项目管理。
120
122
 
121
123
  ```ts
122
- import { createDictionaryColumn, summarizeRows } from "@agile-team/mach-table/business";
124
+ import { summarizeRows } from "@agile-team/mach-table/business";
123
125
 
124
- const options = [{ value: "ready", label: "已就绪" }];
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
- ...createDictionaryColumn({ get: key => labels.get(key) }, {
129
- options,
130
- display: "label",
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` 无 UI、请求或缓存,连接已有 Provider;异步标签先预热,动态选项用新数组替换快照。原始数字/文本编码保留类型,重复标签拒绝歧义;未配置的输出通道保留原码,旧 renderer 的导出行为不变。
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` 保留。字典/formatter 的文字可参与默认语义匹配;显式 renderer 优先。状态配置只控制展示,导出继续遵循原有列值政策。
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
 
@@ -1,5 +1,5 @@
1
- import { b as GridApi, c as GridOptions, j as GridEventType } from './api-Di5SQHAP.cjs';
2
- export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-DlRW86iR.cjs';
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-Di5SQHAP.js';
2
- export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-nh5lvWDe.js';
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;
@@ -1,5 +1,5 @@
1
- import { W as WorkbenchOptions, a as WorkbenchHandle } from './shared-O6pPO8H8.cjs';
2
- import './api-Di5SQHAP.cjs';
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;
@@ -1,5 +1,5 @@
1
- import { W as WorkbenchOptions, a as WorkbenchHandle } from './shared-BusgJSf4.js';
2
- import './api-Di5SQHAP.js';
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 for dictionary fields whose stored value differs from its display text. */
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 ColumnWorkbenchItem 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 ValueOutputTarget as V, type ColumnLayoutMode as W, type ColumnMovedEvent as X, type ColumnResizedEvent as Y, type ColumnStatus as Z, type ColumnVisibilityChangedEvent as _, type GridCellRange as a, type OverlayTemplate as a$, type ContextMenuItem as a0, type ContextMenuParams as a1, type CsvExportParams as a2, DEFAULT_LOCALE as a3, type DatasourceMode as a4, type DateFilterCondition as a5, type DateFilterMatch as a6, type DetailRowRendererParams as a7, type DetailToggledEvent as a8, type DirtyStateChangedEvent as a9, type GridFilteringApi as aA, type GridHierarchyApi as aB, type GridIoApi as aC, type GridPaginationApi as aD, type GridPerformanceSnapshot as aE, type GridPersistenceOptions as aF, type GridReadyEvent as aG, type GridRowsApi as aH, type GridSelectionApi as aI, type GridSortingApi as aJ, type GridStateApi as aK, type GridStateSection as aL, type GridUpdateSchedulerSnapshot as aM, type GridViewApi as aN, type HeaderComponentParams as aO, type ICellEditor as aP, type ICellRendererResult as aQ, type ImportCsvOptions as aR, type InfiniteGetRowsParams as aS, LOCALE_EN as aT, type MachTableLocale as aU, type MachTableLocaleKey as aV, type MatrixExportParams as aW, type ModelUpdatedEvent as aX, type NumberFilterCondition as aY, type NumberFilterMatch as aZ, type OverlayContent as a_, type DomLayoutMode as aa, EVENT_TYPES as ab, type EditableIndicator as ac, type EditableParams as ad, type EventHandlers as ae, type FilterChangedEvent as af, type GetRowHeightParams as ag, type GridAsyncOptions as ah, type GridBatchSaveResult as ai, type GridCellChange as aj, type GridColumnsApi as ak, type GridDataProcessorColumn as al, type GridDataProcessorRequest as am, type GridDataProcessorResult as an, type GridDataProcessorRow as ao, type GridDatasource as ap, type GridDiagnosticError as aq, type GridDiagnostics as ar, type GridDiagnosticsApi as as, type GridEditType as at, type GridEditingApi as au, type GridErrorCode as av, type GridErrorEvent as aw, type GridEventBase as ax, type GridEventMap as ay, type GridFeatureContext as az, type GridApi as b, type PaginationChangedEvent as b0, type PaginationConfig as b1, type PinnedDirection as b2, type PrintOptions as b3, type RangeSelectionChangedEvent as b4, type RefreshCellsParams as b5, type RemoteBlockCacheSnapshot as b6, type ResolvedGridOptions as b7, type RowClickEvent as b8, type RowDragEndEvent as b9, type TextFilterMatch as bA, type ThemeMode as bB, type TooltipParams as bC, type TreeChildrenLoadFailedEvent as bD, type TreeChildrenLoadedEvent as bE, type TreeDataLoadParams as bF, type ValueFormatterParams as bG, type ValueGetterParams as bH, type ValueInputSource 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 RowDragIntent as ba, type RowDragPolicy as bb, type RowEditChange as bc, type RowEditValidationParams as bd, type RowEditValidationResult as be, type RowEditingStartedEvent as bf, type RowEditingStoppedEvent as bg, type RowNode as bh, type RowSelectionMode as bi, type RowStyleParams as bj, type RowStyleRule as bk, type RowTone as bl, type RowTransaction as bm, type SaveChangeIssue as bn, type SaveChangesResult as bo, type SelectEditorOption as bp, type SelectEditorParams as bq, type SelectionChangedEvent as br, type SetFilterCondition as bs, type SetFilterParams as bt, type SortChangedEvent as bu, type SortDirection as bv, type SortModelItem as bw, type StatusBarConfig as bx, type StatusBarPanel as by, type TextFilterCondition 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 };
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 for dictionary fields whose stored value differs from its display text. */
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 ColumnWorkbenchItem 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 ValueOutputTarget as V, type ColumnLayoutMode as W, type ColumnMovedEvent as X, type ColumnResizedEvent as Y, type ColumnStatus as Z, type ColumnVisibilityChangedEvent as _, type GridCellRange as a, type OverlayTemplate as a$, type ContextMenuItem as a0, type ContextMenuParams as a1, type CsvExportParams as a2, DEFAULT_LOCALE as a3, type DatasourceMode as a4, type DateFilterCondition as a5, type DateFilterMatch as a6, type DetailRowRendererParams as a7, type DetailToggledEvent as a8, type DirtyStateChangedEvent as a9, type GridFilteringApi as aA, type GridHierarchyApi as aB, type GridIoApi as aC, type GridPaginationApi as aD, type GridPerformanceSnapshot as aE, type GridPersistenceOptions as aF, type GridReadyEvent as aG, type GridRowsApi as aH, type GridSelectionApi as aI, type GridSortingApi as aJ, type GridStateApi as aK, type GridStateSection as aL, type GridUpdateSchedulerSnapshot as aM, type GridViewApi as aN, type HeaderComponentParams as aO, type ICellEditor as aP, type ICellRendererResult as aQ, type ImportCsvOptions as aR, type InfiniteGetRowsParams as aS, LOCALE_EN as aT, type MachTableLocale as aU, type MachTableLocaleKey as aV, type MatrixExportParams as aW, type ModelUpdatedEvent as aX, type NumberFilterCondition as aY, type NumberFilterMatch as aZ, type OverlayContent as a_, type DomLayoutMode as aa, EVENT_TYPES as ab, type EditableIndicator as ac, type EditableParams as ad, type EventHandlers as ae, type FilterChangedEvent as af, type GetRowHeightParams as ag, type GridAsyncOptions as ah, type GridBatchSaveResult as ai, type GridCellChange as aj, type GridColumnsApi as ak, type GridDataProcessorColumn as al, type GridDataProcessorRequest as am, type GridDataProcessorResult as an, type GridDataProcessorRow as ao, type GridDatasource as ap, type GridDiagnosticError as aq, type GridDiagnostics as ar, type GridDiagnosticsApi as as, type GridEditType as at, type GridEditingApi as au, type GridErrorCode as av, type GridErrorEvent as aw, type GridEventBase as ax, type GridEventMap as ay, type GridFeatureContext as az, type GridApi as b, type PaginationChangedEvent as b0, type PaginationConfig as b1, type PinnedDirection as b2, type PrintOptions as b3, type RangeSelectionChangedEvent as b4, type RefreshCellsParams as b5, type RemoteBlockCacheSnapshot as b6, type ResolvedGridOptions as b7, type RowClickEvent as b8, type RowDragEndEvent as b9, type TextFilterMatch as bA, type ThemeMode as bB, type TooltipParams as bC, type TreeChildrenLoadFailedEvent as bD, type TreeChildrenLoadedEvent as bE, type TreeDataLoadParams as bF, type ValueFormatterParams as bG, type ValueGetterParams as bH, type ValueInputSource 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 RowDragIntent as ba, type RowDragPolicy as bb, type RowEditChange as bc, type RowEditValidationParams as bd, type RowEditValidationResult as be, type RowEditingStartedEvent as bf, type RowEditingStoppedEvent as bg, type RowNode as bh, type RowSelectionMode as bi, type RowStyleParams as bj, type RowStyleRule as bk, type RowTone as bl, type RowTransaction as bm, type SaveChangeIssue as bn, type SaveChangesResult as bo, type SelectEditorOption as bp, type SelectEditorParams as bq, type SelectionChangedEvent as br, type SetFilterCondition as bs, type SetFilterParams as bt, type SortChangedEvent as bu, type SortDirection as bv, type SortModelItem as bw, type StatusBarConfig as bx, type StatusBarPanel as by, type TextFilterCondition 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 };
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 f=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var N=(n,e)=>{for(var o in e)f(n,o,{get:e[o],enumerable:!0})},R=(n,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of P(e))!E.call(n,r)&&r!==o&&f(n,r,{get:()=>e[r],enumerable:!(a=x(e,r))||a.enumerable});return n};var O=n=>R(f({},"__esModule",{value:!0}),n);var B={};N(B,{createDictionaryColumn:()=>C,summarizeRows:()=>k});module.exports=O(B);var g=Symbol("ambiguous dictionary input");function S(n,e,o){let a=n.get(e);n.set(e,a!==void 0&&a!==o?g:o)}function A(n,e){return n===void 0?e:e===void 0||e===n?n:g}function C(n,e={}){let o=[],a=o,r=new Map,i=new Map,u=new Map,m=new Map,K=()=>{let t=typeof e.options=="function"?e.options():e.options??o;if(t===a)return;let s=new Map(t.map(c=>[c.value,c])),y=new Map,l=new Map,T=new Map;for(let[c,V]of s)S(y,String(c),c),S(l,V.label,c),S(T,`${String(c)} \xB7 ${V.label}`,c);a=t,r=s,i=y,u=l,m=T},w=t=>typeof t=="string"||typeof t=="number"||typeof t=="boolean",h=t=>(K(),n.get(t)??r.get(t)?.label),p=(t,s)=>{if(Array.isArray(t))return t.map(T=>p(T,s)).join(e.separator??"\u3001");if(t==null||!w(t))return"";let y=String(t);if(s==="code")return y;let l=h(t);return l===void 0?y:s==="label"?l:`${y} \xB7 ${l}`},D=t=>{if(Array.isArray(t))return t.map(D);if(!w(t)||t===""||(K(),r.has(t)||n.get(t)!==void 0||typeof t!="string"))return t;let s=i.get(t)??A(u.get(t),m.get(t));if(s===g)throw new TypeError(`[MachTable] Ambiguous dictionary value: ${t}`);return s??t};return{valueFormatter:({value:t})=>p(t,e.display??"label"),valueParser:({value:t})=>D(t),valueSerializer:({value:t,target:s})=>{let y=e.output?.[s]??"code";return y==="code"?t:p(t,y)}}}function b(n){if(typeof n!="number"||!Number.isFinite(n)||Math.abs(n)>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 n}function d(n){if(n!=null&&typeof n.then=="function")throw Promise.resolve(n).catch(()=>{}),new TypeError("[MachTable] Summary numeric callbacks must return synchronous values.");return n}var z={zero:()=>0,add:(n,e)=>b(n+b(e)),divide:(n,e)=>e===0?null:b(n/e)};function M(n,e){let o=new Map;for(let a of n)(a.kind==="sum"||a.kind==="ratio")&&o.set(a.id,{value:d(e.zero()),denominator:d(e.zero())});return{rowCount:0,totals:o}}function G(n,e,o,a){e.rowCount++;for(let r of o){if(r.kind==="count"||r.kind==="none")continue;let i=e.totals.get(r.id),u=r.kind==="sum"?r.value(n):r.numerator(n);if(u!=null&&u!==""&&(i.value=d(a.add(i.value,u))),r.kind==="ratio"){let m=r.denominator(n);m!=null&&m!==""&&(i.denominator=d(a.add(i.denominator,m)))}}}function $(n,e,o){let a=Object.create(null);for(let r of e)if(r.kind!=="none")if(r.kind==="count")a[r.id]=n.rowCount;else{let i=n.totals.get(r.id);a[r.id]=r.kind==="sum"?i.value:d(o.divide(i.value,i.denominator))}return a}function k(n,e){let o=new Set;for(let i of e.metrics){if(!i.id||o.has(i.id))throw new TypeError("[MachTable] Summary metric IDs must be non-empty and unique.");o.add(i.id)}let a=e.numeric??z,r=new Map;e.groupBy||r.set(void 0,M(e.metrics,a));for(let i of n){let u=e.groupBy?.(i);if(e.groupBy&&typeof u!="string"&&(typeof u!="number"||!Number.isFinite(u)))throw new TypeError("[MachTable] Summary group keys must be strings or finite numbers.");let m=r.get(u);m||(m=M(e.metrics,a),r.set(u,m)),G(i,m,e.metrics,a)}return{scope:e.scope,groups:[...r].map(([i,u])=>({key:i,rowCount:u.rowCount,values:$(u,e.metrics,a)}))}}0&&(module.exports={createDictionaryColumn,summarizeRows});
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});
@@ -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 DictionaryColumnOptions, type DictionaryColumnSource, type DictionaryDisplay, type SemanticSummaryMetric, type SemanticSummaryOptions, type SemanticSummaryResult, type SummaryNumericStrategy, type SummaryScope, createDictionaryColumn, summarizeRows };
43
+ export { type SemanticSummaryMetric, type SemanticSummaryOptions, type SemanticSummaryResult, type SummaryNumericStrategy, type SummaryScope, summarizeRows };
@@ -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 DictionaryColumnOptions, type DictionaryColumnSource, type DictionaryDisplay, type SemanticSummaryMetric, type SemanticSummaryOptions, type SemanticSummaryResult, type SummaryNumericStrategy, type SummaryScope, createDictionaryColumn, summarizeRows };
43
+ export { type SemanticSummaryMetric, type SemanticSummaryOptions, type SemanticSummaryResult, type SummaryNumericStrategy, type SummaryScope, summarizeRows };
package/dist/business.js CHANGED
@@ -1 +1 @@
1
- var S=Symbol("ambiguous dictionary input");function f(t,n,i){let a=t.get(n);t.set(n,a!==void 0&&a!==i?S:i)}function M(t,n){return t===void 0?n:n===void 0||n===t?t:S}function k(t,n={}){let i=[],a=i,r=new Map,o=new Map,u=new Map,m=new Map,b=()=>{let e=typeof n.options=="function"?n.options():n.options??i;if(e===a)return;let s=new Map(e.map(c=>[c.value,c])),y=new Map,l=new Map,T=new Map;for(let[c,D]of s)f(y,String(c),c),f(l,D.label,c),f(T,`${String(c)} \xB7 ${D.label}`,c);a=e,r=s,o=y,u=l,m=T},K=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean",C=e=>(b(),t.get(e)??r.get(e)?.label),p=(e,s)=>{if(Array.isArray(e))return e.map(T=>p(T,s)).join(n.separator??"\u3001");if(e==null||!K(e))return"";let y=String(e);if(s==="code")return y;let l=C(e);return l===void 0?y:s==="label"?l:`${y} \xB7 ${l}`},w=e=>{if(Array.isArray(e))return e.map(w);if(!K(e)||e===""||(b(),r.has(e)||t.get(e)!==void 0||typeof e!="string"))return e;let s=o.get(e)??M(u.get(e),m.get(e));if(s===S)throw new TypeError(`[MachTable] Ambiguous dictionary value: ${e}`);return s??e};return{valueFormatter:({value:e})=>p(e,n.display??"label"),valueParser:({value:e})=>w(e),valueSerializer:({value:e,target:s})=>{let y=n.output?.[s]??"code";return y==="code"?e:p(e,y)}}}function g(t){if(typeof t!="number"||!Number.isFinite(t)||Math.abs(t)>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 t}function d(t){if(t!=null&&typeof t.then=="function")throw Promise.resolve(t).catch(()=>{}),new TypeError("[MachTable] Summary numeric callbacks must return synchronous values.");return t}var h={zero:()=>0,add:(t,n)=>g(t+g(n)),divide:(t,n)=>n===0?null:g(t/n)};function V(t,n){let i=new Map;for(let a of t)(a.kind==="sum"||a.kind==="ratio")&&i.set(a.id,{value:d(n.zero()),denominator:d(n.zero())});return{rowCount:0,totals:i}}function x(t,n,i,a){n.rowCount++;for(let r of i){if(r.kind==="count"||r.kind==="none")continue;let o=n.totals.get(r.id),u=r.kind==="sum"?r.value(t):r.numerator(t);if(u!=null&&u!==""&&(o.value=d(a.add(o.value,u))),r.kind==="ratio"){let m=r.denominator(t);m!=null&&m!==""&&(o.denominator=d(a.add(o.denominator,m)))}}}function P(t,n,i){let a=Object.create(null);for(let r of n)if(r.kind!=="none")if(r.kind==="count")a[r.id]=t.rowCount;else{let o=t.totals.get(r.id);a[r.id]=r.kind==="sum"?o.value:d(i.divide(o.value,o.denominator))}return a}function E(t,n){let i=new Set;for(let o of n.metrics){if(!o.id||i.has(o.id))throw new TypeError("[MachTable] Summary metric IDs must be non-empty and unique.");i.add(o.id)}let a=n.numeric??h,r=new Map;n.groupBy||r.set(void 0,V(n.metrics,a));for(let o of t){let u=n.groupBy?.(o);if(n.groupBy&&typeof u!="string"&&(typeof u!="number"||!Number.isFinite(u)))throw new TypeError("[MachTable] Summary group keys must be strings or finite numbers.");let m=r.get(u);m||(m=V(n.metrics,a),r.set(u,m)),x(o,m,n.metrics,a)}return{scope:n.scope,groups:[...r].map(([o,u])=>({key:o,rowCount:u.rowCount,values:P(u,n.metrics,a)}))}}export{k as createDictionaryColumn,E as summarizeRows};
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-Di5SQHAP.js';
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-Di5SQHAP.cjs';
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
@@ -1,4 +1,4 @@
1
- import { I as ImportMatrixOptions, b as GridApi } from './api-Di5SQHAP.cjs';
1
+ import { I as ImportMatrixOptions, b as GridApi } from './api-DH2BoJ9I.cjs';
2
2
 
3
3
  interface ImportIssue {
4
4
  /** Zero-based data-row index, excluding the header. -1 denotes the complete plan. */
package/dist/import.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as ImportMatrixOptions, b as GridApi } from './api-Di5SQHAP.js';
1
+ import { I as ImportMatrixOptions, b as GridApi } from './api-DH2BoJ9I.js';
2
2
 
3
3
  interface ImportIssue {
4
4
  /** Zero-based data-row index, excluding the header. -1 denotes the complete plan. */