@agile-team/mach-table 0.24.0 → 0.28.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 CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # @agile-team/mach-table
6
6
 
7
- MachTable 0.24 的框架无关 TypeScript Core:零运行时依赖,提供行列双虚拟化、领域化 API、单元格/整行编辑、树与分组、随机访问远程数据、状态持久化和可诊断扩展系统。
7
+ MachTable 0.28 的框架无关 TypeScript Core:零运行时依赖,提供行列双虚拟化、领域化 API、单元格/整行编辑、树与分组、随机访问远程数据、区段隔离状态持久化和可诊断扩展系统。0.28 保持公共 API 不变并清零历史复杂度豁免。
8
8
 
9
9
  ```bash
10
10
  pnpm add @agile-team/mach-table
@@ -39,6 +39,8 @@ console.info(api.diagnostics.get());
39
39
  api.destroy();
40
40
  ```
41
41
 
42
+ `persistence.sections` 同时约束进入 store 的数据与恢复范围;异步 store 写入有序,晚到加载不会覆盖加载期间的用户操作。
43
+
42
44
  公共命令按 `rows`、`columns`、`selection`、`editing`、`filtering`、`sorting`、`pagination`、`hierarchy`、`view`、`state`、`io`、`diagnostics` 划分。完整签名见 [GridApi](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/api/grid-api.md)。
43
45
 
44
46
  大型本地数据 Worker 使用独立入口:
package/dist/adapter.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var C=(e,n)=>{for(var t in n)f(e,t,{get:n[t],enumerable:!0})},w=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of h(n))!D.call(e,a)&&a!==t&&f(e,a,{get:()=>n[a],enumerable:!(o=O(n,a))||o.enumerable});return e};var M=e=>w(f({},"__esModule",{value:!0}),e);var S={};C(S,{GRID_OPTION_KEYS:()=>g,GRID_OPTION_META:()=>c,mergeMachTableConfig:()=>T,normalizeMachTableConfig:()=>k,resolveMachTableGridOptions:()=>y});module.exports=M(S);var c={columnDefs:{kind:"array",update:"columnDefs"},rowData:{kind:"array",update:"rowData"},defaultColDef:{kind:"object",update:"options"},columnTypes:{kind:"object",update:"options"},rowKey:{kind:"unknown",update:"options"},rowHeight:{kind:"number",update:"options"},headerHeight:{kind:"number",update:"options"},rowBuffer:{kind:"number",update:"options"},columnLayout:{kind:"string",update:"options"},enableColumnResize:{kind:"boolean",update:"options"},domLayout:{kind:"string",update:"options"},rowSelection:{kind:"string",update:"options"},multiSort:{kind:"boolean",update:"options"},size:{kind:"string",update:"options"},stripedRows:{kind:"boolean",update:"options"},showCellBorders:{kind:"boolean",update:"options"},theme:{kind:"string",update:"options"},quickFilterText:{kind:"string",update:"quickFilter"},advancedFilterModel:{kind:"object",update:"options"},masterDetail:{kind:"boolean",update:"options"},detailRowHeight:{kind:"number",update:"options"},detailRowRenderer:{kind:"function",update:"options"},isRowExpandable:{kind:"function",update:"options"},detailToggleColumn:{kind:"boolean",update:"options"},columnMenu:{kind:"boolean",update:"options"},aggFuncs:{kind:"object",update:"options"},components:{kind:"object",update:"options"},actionPolicy:{kind:"object",update:"options"},features:{kind:"array",update:"options"},initialState:{kind:"object",update:"options"},persistence:{kind:"boolean-object",update:"options"},locale:{kind:"object",update:"options"},editType:{kind:"string",update:"options"},editableIndicator:{kind:"string",update:"options"},rowEditValidator:{kind:"function",update:"options"},singleClickEdit:{kind:"boolean",update:"options"},manualSorting:{kind:"boolean",update:"options"},manualFiltering:{kind:"boolean",update:"options"},showSummary:{kind:"boolean",update:"options"},summaryMethod:{kind:"function",update:"options"},treeData:{kind:"boolean",update:"options"},childrenKey:{kind:"string",update:"options"},isTreeRowExpandable:{kind:"function",update:"options"},loadTreeChildren:{kind:"function",update:"options"},autoCheckedChildren:{kind:"boolean",update:"options"},defaultExpandAll:{kind:"boolean",update:"options"},indexOffset:{kind:"number",update:"options"},applyRowDrag:{kind:"boolean",update:"options"},undoStackSize:{kind:"number",update:"options"},asyncTransactionWaitMillis:{kind:"number",update:"options"},getRowHeight:{kind:"function",update:"options"},pinnedTopRowData:{kind:"array",update:"options"},pinnedBottomRowData:{kind:"array",update:"options"},pagination:{kind:"boolean-object",update:"options"},watermark:{kind:"boolean-object",update:"options"},suppressWarnings:{kind:"boolean",update:"options"},enableRangeSelection:{kind:"boolean",update:"options"},suppressClipboard:{kind:"boolean",update:"options"},contextMenu:{kind:"boolean",update:"options"},getContextMenuItems:{kind:"function",update:"options"},tooltipComponent:{kind:"function",update:"options"},tooltipShowDelay:{kind:"number",update:"options"},flashCells:{kind:"boolean",update:"options"},fillHandle:{kind:"boolean",update:"options"},statusBar:{kind:"boolean-object",update:"options"},datasource:{kind:"object",update:"options"},datasourceMode:{kind:"string",update:"options"},blockSize:{kind:"number",update:"options"},infiniteBufferRows:{kind:"number",update:"options"},maxBlocksInCache:{kind:"number",update:"options"},datasourceMaxConcurrentRequests:{kind:"number",update:"options"},blockPrefetch:{kind:"number",update:"options"},datasourceRowCount:{kind:"number",update:"options"},dataProcessor:{kind:"object",update:"options"},dataProcessorMinRows:{kind:"number",update:"options"},datasourceRetryCount:{kind:"number",update:"options"},datasourceRetryDelay:{kind:"number",update:"options"},datasourceRetryJitter:{kind:"number",update:"options"},suppressCellFocus:{kind:"boolean",update:"options"},suppressRowHoverHighlight:{kind:"boolean",update:"options"},suppressNoRowsOverlay:{kind:"boolean",update:"options"},suppressHeaderFocus:{kind:"boolean",update:"options"},ariaLabel:{kind:"string",update:"options"},ariaLabelledBy:{kind:"string",update:"options"},ariaDescribedBy:{kind:"string",update:"options"},loading:{kind:"boolean",update:"options"},error:{kind:"unknown",update:"options"},overlayNoRowsTemplate:{kind:"unknown",update:"options"},overlayLoadingTemplate:{kind:"unknown",update:"options"},overlayErrorTemplate:{kind:"unknown",update:"options"},allowUnsafeOverlayHtml:{kind:"boolean",update:"options"},className:{kind:"string",update:"options"}},g=Object.freeze(Object.keys(c)),v=Object.freeze(g.filter(e=>c[e].update==="options"));function b(e,n){return n===void 0?e:typeof n!="object"||n===null||typeof e!="object"||e===null?n:{...e,...n}}function R(e,n){return typeof e!="function"?n:typeof n!="function"?e:(...t)=>{let o;try{e(...t)}catch(a){o=a}try{n(...t)}catch(a){o??(o=a)}if(o!==void 0)throw o}}function P(e,n){let t={...e,...n,features:n.features??e.features};if((e.defaultColDef||n.defaultColDef)&&(t.defaultColDef={...e.defaultColDef,...n.defaultColDef}),(e.locale||n.locale)&&(t.locale={...e.locale,...n.locale}),(e.components||n.components)&&(t.components={cellRenderers:{...e.components?.cellRenderers,...n.components?.cellRenderers},cellEditors:{...e.components?.cellEditors,...n.components?.cellEditors}}),e.columnTypes||n.columnTypes){let o={};for(let a of new Set([...Object.keys(e.columnTypes??{}),...Object.keys(n.columnTypes??{})]))o[a]={...e.columnTypes?.[a],...n.columnTypes?.[a]};t.columnTypes=o}(e.aggFuncs||n.aggFuncs)&&(t.aggFuncs={...e.aggFuncs,...n.aggFuncs}),t.pagination=b(e.pagination,n.pagination),t.statusBar=b(e.statusBar,n.statusBar),t.watermark=b(e.watermark,n.watermark);for(let o of new Set([...Object.keys(e),...Object.keys(n)])){if(!/^on[A-Z]/.test(o))continue;let a=e[o],i=n[o];typeof a=="function"&&typeof i=="function"&&(t[o]=R(a,i))}return t}function p(...e){return e.reduce(P,{})}function G(e){return e?(Array.isArray(e)?e:[e]).filter(n=>typeof n=="string"&&n.trim().length>0):[]}var E=new Set(["rowData","columnDefs","datasource","loading","error","initialState","persistence","components","columnTypes","stateKey","stateStore","stateSaveDebounceMs","columnStateKey","columnStateStore"]);function m(e,n,t){if(!n||typeof n!="object"||Array.isArray(n))return{};let o={};for(let[a,i]of Object.entries(n)){if(!E.has(a)){o[a]=i;continue}let d={code:t==="defaults"?"INVALID_DEFAULT_OPTION":"INVALID_PRESET_OPTION",option:a,layer:t,message:`[MachTable] "${a}" is instance-only and cannot be declared in config ${t}.`};if(e.onConfigWarning?.(d),e.strict!==!1)throw new TypeError(d.message)}return o}function k(e={}){let n=m(e,e.defaults,"defaults");return{defaults:p({columnTypes:e.columnTypes,components:e.components},n),presets:Object.fromEntries(Object.entries(e.presets??{}).map(([t,o])=>[t,p(m(e,o,`preset:${t}`))])),defaultPreset:e.defaultPreset??!1,strict:e.strict!==!1,...e.onConfigWarning?{onConfigWarning:e.onConfigWarning}:{}}}function T(e,n){let t=k({...n,strict:n.strict??e.strict,onConfigWarning:n.onConfigWarning??e.onConfigWarning}),o={...e.presets};for(let[a,i]of Object.entries(t.presets))o[a]=p(e.presets[a]??{},i);return{defaults:p(e.defaults,t.defaults),presets:o,defaultPreset:n.defaultPreset===void 0?e.defaultPreset:n.defaultPreset,strict:n.strict??e.strict,...n.onConfigWarning??e.onConfigWarning?{onConfigWarning:n.onConfigWarning??e.onConfigWarning}:{}}}function y(e,n,t,o){let a=n===void 0?e.defaultPreset:n,i=[{name:"application defaults",options:e.defaults}];for(let r of G(a)){let s=e.presets[r];if(!s){let l={code:"UNKNOWN_PRESET",preset:r,message:`[MachTable] Unknown preset "${r}". Register it in mach-table.config.ts or remove the preset.`};o?o(l):e.onConfigWarning?e.onConfigWarning(l):console.warn(l.message);continue}i.push({name:`preset:${r}`,options:s})}i.push({name:"table props",options:t});let d=p(...i.map(r=>r.options));return{options:d,explain(r){let s=i.filter(u=>Object.prototype.hasOwnProperty.call(u.options,r)).map(u=>({name:u.name,value:u.options[r]})),l=s[s.length-1];return{key:r,value:d[r],source:l?.name??"MachTable built-in",layers:s}}}}0&&(module.exports={GRID_OPTION_KEYS,GRID_OPTION_META,mergeMachTableConfig,normalizeMachTableConfig,resolveMachTableGridOptions});
1
+ "use strict";var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var C=(e,n)=>{for(var t in n)f(e,t,{get:n[t],enumerable:!0})},w=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of D(n))!h.call(e,o)&&o!==t&&f(e,o,{get:()=>n[o],enumerable:!(a=O(n,o))||a.enumerable});return e};var M=e=>w(f({},"__esModule",{value:!0}),e);var I={};C(I,{GRID_OPTION_KEYS:()=>T,GRID_OPTION_META:()=>c,mergeMachTableConfig:()=>k,normalizeMachTableConfig:()=>m,resolveMachTableGridOptions:()=>y});module.exports=M(I);var c={columnDefs:{kind:"array",update:"columnDefs"},rowData:{kind:"array",update:"rowData"},defaultColDef:{kind:"object",update:"options"},columnTypes:{kind:"object",update:"options"},rowKey:{kind:"unknown",update:"options"},rowHeight:{kind:"number",update:"options"},headerHeight:{kind:"number",update:"options"},rowBuffer:{kind:"number",update:"options"},columnLayout:{kind:"string",update:"options"},enableColumnResize:{kind:"boolean",update:"options"},domLayout:{kind:"string",update:"options"},rowSelection:{kind:"string",update:"options"},multiSort:{kind:"boolean",update:"options"},size:{kind:"string",update:"options"},stripedRows:{kind:"boolean",update:"options"},showCellBorders:{kind:"boolean",update:"options"},theme:{kind:"string",update:"options"},quickFilterText:{kind:"string",update:"quickFilter"},advancedFilterModel:{kind:"object",update:"options"},masterDetail:{kind:"boolean",update:"options"},detailRowHeight:{kind:"number",update:"options"},detailRowRenderer:{kind:"function",update:"options"},isRowExpandable:{kind:"function",update:"options"},detailToggleColumn:{kind:"boolean",update:"options"},columnMenu:{kind:"boolean",update:"options"},aggFuncs:{kind:"object",update:"options"},components:{kind:"object",update:"options"},actionPolicy:{kind:"object",update:"options"},features:{kind:"array",update:"options"},initialState:{kind:"object",update:"options"},persistence:{kind:"boolean-object",update:"options"},locale:{kind:"object",update:"options"},editType:{kind:"string",update:"options"},editableIndicator:{kind:"string",update:"options"},rowEditValidator:{kind:"function",update:"options"},singleClickEdit:{kind:"boolean",update:"options"},manualSorting:{kind:"boolean",update:"options"},manualFiltering:{kind:"boolean",update:"options"},showSummary:{kind:"boolean",update:"options"},summaryMethod:{kind:"function",update:"options"},treeData:{kind:"boolean",update:"options"},childrenKey:{kind:"string",update:"options"},isTreeRowExpandable:{kind:"function",update:"options"},loadTreeChildren:{kind:"function",update:"options"},autoCheckedChildren:{kind:"boolean",update:"options"},defaultExpandAll:{kind:"boolean",update:"options"},indexOffset:{kind:"number",update:"options"},applyRowDrag:{kind:"boolean",update:"options"},undoStackSize:{kind:"number",update:"options"},asyncTransactionWaitMillis:{kind:"number",update:"options"},getRowHeight:{kind:"function",update:"options"},pinnedTopRowData:{kind:"array",update:"options"},pinnedBottomRowData:{kind:"array",update:"options"},pagination:{kind:"boolean-object",update:"options"},watermark:{kind:"boolean-object",update:"options"},suppressWarnings:{kind:"boolean",update:"options"},enableRangeSelection:{kind:"boolean",update:"options"},suppressClipboard:{kind:"boolean",update:"options"},contextMenu:{kind:"boolean",update:"options"},getContextMenuItems:{kind:"function",update:"options"},tooltipComponent:{kind:"function",update:"options"},tooltipShowDelay:{kind:"number",update:"options"},flashCells:{kind:"boolean",update:"options"},fillHandle:{kind:"boolean",update:"options"},statusBar:{kind:"boolean-object",update:"options"},datasource:{kind:"object",update:"options"},datasourceMode:{kind:"string",update:"options"},blockSize:{kind:"number",update:"options"},infiniteBufferRows:{kind:"number",update:"options"},maxBlocksInCache:{kind:"number",update:"options"},datasourceMaxConcurrentRequests:{kind:"number",update:"options"},blockPrefetch:{kind:"number",update:"options"},datasourceRowCount:{kind:"number",update:"options"},dataProcessor:{kind:"object",update:"options"},dataProcessorMinRows:{kind:"number",update:"options"},datasourceRetryCount:{kind:"number",update:"options"},datasourceRetryDelay:{kind:"number",update:"options"},datasourceRetryJitter:{kind:"number",update:"options"},suppressCellFocus:{kind:"boolean",update:"options"},suppressRowHoverHighlight:{kind:"boolean",update:"options"},suppressNoRowsOverlay:{kind:"boolean",update:"options"},suppressHeaderFocus:{kind:"boolean",update:"options"},ariaLabel:{kind:"string",update:"options"},ariaLabelledBy:{kind:"string",update:"options"},ariaDescribedBy:{kind:"string",update:"options"},loading:{kind:"boolean",update:"options"},error:{kind:"unknown",update:"options"},overlayNoRowsTemplate:{kind:"unknown",update:"options"},overlayLoadingTemplate:{kind:"unknown",update:"options"},overlayErrorTemplate:{kind:"unknown",update:"options"},allowUnsafeOverlayHtml:{kind:"boolean",update:"options"},className:{kind:"string",update:"options"}},T=Object.freeze(Object.keys(c)),W=Object.freeze(T.filter(e=>c[e].update==="options"));function g(e,n){return n===void 0?e:typeof n!="object"||n===null||typeof e!="object"||e===null?n:{...e,...n}}function R(e,n){return typeof e!="function"?n:typeof n!="function"?e:(...t)=>{let a;try{e(...t)}catch(o){a=o}try{n(...t)}catch(o){a??(a=o)}if(a!==void 0)throw a}}function G(e,n){if(!(!e.components&&!n.components))return{cellRenderers:{...e.components?.cellRenderers,...n.components?.cellRenderers},cellEditors:{...e.components?.cellEditors,...n.components?.cellEditors}}}function P(e,n){if(!e.columnTypes&&!n.columnTypes)return;let t={},a=new Set([...Object.keys(e.columnTypes??{}),...Object.keys(n.columnTypes??{})]);for(let o of a)t[o]={...e.columnTypes?.[o],...n.columnTypes?.[o]};return t}function E(e,n,t){for(let a of new Set([...Object.keys(n),...Object.keys(t)])){if(!/^on[A-Z]/.test(a))continue;let o=n[a],i=t[a];typeof o!="function"||typeof i!="function"||(e[a]=R(o,i))}}function S(e,n){let t={...e,...n,features:n.features??e.features};(e.defaultColDef||n.defaultColDef)&&(t.defaultColDef={...e.defaultColDef,...n.defaultColDef}),(e.locale||n.locale)&&(t.locale={...e.locale,...n.locale});let a=G(e,n);a&&(t.components=a);let o=P(e,n);return o&&(t.columnTypes=o),(e.aggFuncs||n.aggFuncs)&&(t.aggFuncs={...e.aggFuncs,...n.aggFuncs}),t.pagination=g(e.pagination,n.pagination),t.statusBar=g(e.statusBar,n.statusBar),t.watermark=g(e.watermark,n.watermark),E(t,e,n),t}function p(...e){return e.reduce(S,{})}function j(e){return e?(Array.isArray(e)?e:[e]).filter(n=>typeof n=="string"&&n.trim().length>0):[]}var v=new Set(["rowData","columnDefs","datasource","loading","error","initialState","persistence","components","columnTypes","stateKey","stateStore","stateSaveDebounceMs","columnStateKey","columnStateStore"]);function b(e,n,t){if(!n||typeof n!="object"||Array.isArray(n))return{};let a={};for(let[o,i]of Object.entries(n)){if(!v.has(o)){a[o]=i;continue}let d={code:t==="defaults"?"INVALID_DEFAULT_OPTION":"INVALID_PRESET_OPTION",option:o,layer:t,message:`[MachTable] "${o}" is instance-only and cannot be declared in config ${t}.`};if(e.onConfigWarning?.(d),e.strict!==!1)throw new TypeError(d.message)}return a}function m(e={}){let n=b(e,e.defaults,"defaults");return{defaults:p({columnTypes:e.columnTypes,components:e.components},n),presets:Object.fromEntries(Object.entries(e.presets??{}).map(([t,a])=>[t,p(b(e,a,`preset:${t}`))])),defaultPreset:e.defaultPreset??!1,strict:e.strict!==!1,...e.onConfigWarning?{onConfigWarning:e.onConfigWarning}:{}}}function k(e,n){let t=m({...n,strict:n.strict??e.strict,onConfigWarning:n.onConfigWarning??e.onConfigWarning}),a={...e.presets};for(let[o,i]of Object.entries(t.presets))a[o]=p(e.presets[o]??{},i);return{defaults:p(e.defaults,t.defaults),presets:a,defaultPreset:n.defaultPreset===void 0?e.defaultPreset:n.defaultPreset,strict:n.strict??e.strict,...n.onConfigWarning??e.onConfigWarning?{onConfigWarning:n.onConfigWarning??e.onConfigWarning}:{}}}function y(e,n,t,a){let o=n===void 0?e.defaultPreset:n,i=[{name:"application defaults",options:e.defaults}];for(let r of j(o)){let s=e.presets[r];if(!s){let l={code:"UNKNOWN_PRESET",preset:r,message:`[MachTable] Unknown preset "${r}". Register it in mach-table.config.ts or remove the preset.`};a?a(l):e.onConfigWarning?e.onConfigWarning(l):console.warn(l.message);continue}i.push({name:`preset:${r}`,options:s})}i.push({name:"table props",options:t});let d=p(...i.map(r=>r.options));return{options:d,explain(r){let s=i.filter(u=>Object.prototype.hasOwnProperty.call(u.options,r)).map(u=>({name:u.name,value:u.options[r]})),l=s[s.length-1];return{key:r,value:d[r],source:l?.name??"MachTable built-in",layers:s}}}}0&&(module.exports={GRID_OPTION_KEYS,GRID_OPTION_META,mergeMachTableConfig,normalizeMachTableConfig,resolveMachTableGridOptions});
@@ -1,5 +1,5 @@
1
- import { G as GridOptions, a as GridEventType } from './options-CnUx414l.cjs';
2
- export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-BQ5WYIdm.cjs';
1
+ import { G as GridOptions, a as GridEventType } from './options-CL6BYXVZ.cjs';
2
+ export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-DmUvpJLO.cjs';
3
3
 
4
4
  type EventOptionKey = `on${Capitalize<GridEventType>}`;
5
5
  type GridOptionKey = Exclude<keyof GridOptions<any>, EventOptionKey>;
package/dist/adapter.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as GridOptions, a as GridEventType } from './options-CnUx414l.js';
2
- export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-CIdNt43y.js';
1
+ import { G as GridOptions, a as GridEventType } from './options-CL6BYXVZ.js';
2
+ export { M as MachTableOptionExplanation, R as ResolvedMachTableConfig, a as ResolvedMachTableGridOptions, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './configuration-CFMDwmiR.js';
3
3
 
4
4
  type EventOptionKey = `on${Capitalize<GridEventType>}`;
5
5
  type GridOptionKey = Exclude<keyof GridOptions<any>, EventOptionKey>;
package/dist/adapter.js CHANGED
@@ -1 +1 @@
1
- var c={columnDefs:{kind:"array",update:"columnDefs"},rowData:{kind:"array",update:"rowData"},defaultColDef:{kind:"object",update:"options"},columnTypes:{kind:"object",update:"options"},rowKey:{kind:"unknown",update:"options"},rowHeight:{kind:"number",update:"options"},headerHeight:{kind:"number",update:"options"},rowBuffer:{kind:"number",update:"options"},columnLayout:{kind:"string",update:"options"},enableColumnResize:{kind:"boolean",update:"options"},domLayout:{kind:"string",update:"options"},rowSelection:{kind:"string",update:"options"},multiSort:{kind:"boolean",update:"options"},size:{kind:"string",update:"options"},stripedRows:{kind:"boolean",update:"options"},showCellBorders:{kind:"boolean",update:"options"},theme:{kind:"string",update:"options"},quickFilterText:{kind:"string",update:"quickFilter"},advancedFilterModel:{kind:"object",update:"options"},masterDetail:{kind:"boolean",update:"options"},detailRowHeight:{kind:"number",update:"options"},detailRowRenderer:{kind:"function",update:"options"},isRowExpandable:{kind:"function",update:"options"},detailToggleColumn:{kind:"boolean",update:"options"},columnMenu:{kind:"boolean",update:"options"},aggFuncs:{kind:"object",update:"options"},components:{kind:"object",update:"options"},actionPolicy:{kind:"object",update:"options"},features:{kind:"array",update:"options"},initialState:{kind:"object",update:"options"},persistence:{kind:"boolean-object",update:"options"},locale:{kind:"object",update:"options"},editType:{kind:"string",update:"options"},editableIndicator:{kind:"string",update:"options"},rowEditValidator:{kind:"function",update:"options"},singleClickEdit:{kind:"boolean",update:"options"},manualSorting:{kind:"boolean",update:"options"},manualFiltering:{kind:"boolean",update:"options"},showSummary:{kind:"boolean",update:"options"},summaryMethod:{kind:"function",update:"options"},treeData:{kind:"boolean",update:"options"},childrenKey:{kind:"string",update:"options"},isTreeRowExpandable:{kind:"function",update:"options"},loadTreeChildren:{kind:"function",update:"options"},autoCheckedChildren:{kind:"boolean",update:"options"},defaultExpandAll:{kind:"boolean",update:"options"},indexOffset:{kind:"number",update:"options"},applyRowDrag:{kind:"boolean",update:"options"},undoStackSize:{kind:"number",update:"options"},asyncTransactionWaitMillis:{kind:"number",update:"options"},getRowHeight:{kind:"function",update:"options"},pinnedTopRowData:{kind:"array",update:"options"},pinnedBottomRowData:{kind:"array",update:"options"},pagination:{kind:"boolean-object",update:"options"},watermark:{kind:"boolean-object",update:"options"},suppressWarnings:{kind:"boolean",update:"options"},enableRangeSelection:{kind:"boolean",update:"options"},suppressClipboard:{kind:"boolean",update:"options"},contextMenu:{kind:"boolean",update:"options"},getContextMenuItems:{kind:"function",update:"options"},tooltipComponent:{kind:"function",update:"options"},tooltipShowDelay:{kind:"number",update:"options"},flashCells:{kind:"boolean",update:"options"},fillHandle:{kind:"boolean",update:"options"},statusBar:{kind:"boolean-object",update:"options"},datasource:{kind:"object",update:"options"},datasourceMode:{kind:"string",update:"options"},blockSize:{kind:"number",update:"options"},infiniteBufferRows:{kind:"number",update:"options"},maxBlocksInCache:{kind:"number",update:"options"},datasourceMaxConcurrentRequests:{kind:"number",update:"options"},blockPrefetch:{kind:"number",update:"options"},datasourceRowCount:{kind:"number",update:"options"},dataProcessor:{kind:"object",update:"options"},dataProcessorMinRows:{kind:"number",update:"options"},datasourceRetryCount:{kind:"number",update:"options"},datasourceRetryDelay:{kind:"number",update:"options"},datasourceRetryJitter:{kind:"number",update:"options"},suppressCellFocus:{kind:"boolean",update:"options"},suppressRowHoverHighlight:{kind:"boolean",update:"options"},suppressNoRowsOverlay:{kind:"boolean",update:"options"},suppressHeaderFocus:{kind:"boolean",update:"options"},ariaLabel:{kind:"string",update:"options"},ariaLabelledBy:{kind:"string",update:"options"},ariaDescribedBy:{kind:"string",update:"options"},loading:{kind:"boolean",update:"options"},error:{kind:"unknown",update:"options"},overlayNoRowsTemplate:{kind:"unknown",update:"options"},overlayLoadingTemplate:{kind:"unknown",update:"options"},overlayErrorTemplate:{kind:"unknown",update:"options"},allowUnsafeOverlayHtml:{kind:"boolean",update:"options"},className:{kind:"string",update:"options"}},g=Object.freeze(Object.keys(c)),C=Object.freeze(g.filter(e=>c[e].update==="options"));function f(e,n){return n===void 0?e:typeof n!="object"||n===null||typeof e!="object"||e===null?n:{...e,...n}}function m(e,n){return typeof e!="function"?n:typeof n!="function"?e:(...t)=>{let o;try{e(...t)}catch(a){o=a}try{n(...t)}catch(a){o??(o=a)}if(o!==void 0)throw o}}function T(e,n){let t={...e,...n,features:n.features??e.features};if((e.defaultColDef||n.defaultColDef)&&(t.defaultColDef={...e.defaultColDef,...n.defaultColDef}),(e.locale||n.locale)&&(t.locale={...e.locale,...n.locale}),(e.components||n.components)&&(t.components={cellRenderers:{...e.components?.cellRenderers,...n.components?.cellRenderers},cellEditors:{...e.components?.cellEditors,...n.components?.cellEditors}}),e.columnTypes||n.columnTypes){let o={};for(let a of new Set([...Object.keys(e.columnTypes??{}),...Object.keys(n.columnTypes??{})]))o[a]={...e.columnTypes?.[a],...n.columnTypes?.[a]};t.columnTypes=o}(e.aggFuncs||n.aggFuncs)&&(t.aggFuncs={...e.aggFuncs,...n.aggFuncs}),t.pagination=f(e.pagination,n.pagination),t.statusBar=f(e.statusBar,n.statusBar),t.watermark=f(e.watermark,n.watermark);for(let o of new Set([...Object.keys(e),...Object.keys(n)])){if(!/^on[A-Z]/.test(o))continue;let a=e[o],i=n[o];typeof a=="function"&&typeof i=="function"&&(t[o]=m(a,i))}return t}function p(...e){return e.reduce(T,{})}function y(e){return e?(Array.isArray(e)?e:[e]).filter(n=>typeof n=="string"&&n.trim().length>0):[]}var O=new Set(["rowData","columnDefs","datasource","loading","error","initialState","persistence","components","columnTypes","stateKey","stateStore","stateSaveDebounceMs","columnStateKey","columnStateStore"]);function b(e,n,t){if(!n||typeof n!="object"||Array.isArray(n))return{};let o={};for(let[a,i]of Object.entries(n)){if(!O.has(a)){o[a]=i;continue}let d={code:t==="defaults"?"INVALID_DEFAULT_OPTION":"INVALID_PRESET_OPTION",option:a,layer:t,message:`[MachTable] "${a}" is instance-only and cannot be declared in config ${t}.`};if(e.onConfigWarning?.(d),e.strict!==!1)throw new TypeError(d.message)}return o}function k(e={}){let n=b(e,e.defaults,"defaults");return{defaults:p({columnTypes:e.columnTypes,components:e.components},n),presets:Object.fromEntries(Object.entries(e.presets??{}).map(([t,o])=>[t,p(b(e,o,`preset:${t}`))])),defaultPreset:e.defaultPreset??!1,strict:e.strict!==!1,...e.onConfigWarning?{onConfigWarning:e.onConfigWarning}:{}}}function h(e,n){let t=k({...n,strict:n.strict??e.strict,onConfigWarning:n.onConfigWarning??e.onConfigWarning}),o={...e.presets};for(let[a,i]of Object.entries(t.presets))o[a]=p(e.presets[a]??{},i);return{defaults:p(e.defaults,t.defaults),presets:o,defaultPreset:n.defaultPreset===void 0?e.defaultPreset:n.defaultPreset,strict:n.strict??e.strict,...n.onConfigWarning??e.onConfigWarning?{onConfigWarning:n.onConfigWarning??e.onConfigWarning}:{}}}function D(e,n,t,o){let a=n===void 0?e.defaultPreset:n,i=[{name:"application defaults",options:e.defaults}];for(let r of y(a)){let s=e.presets[r];if(!s){let l={code:"UNKNOWN_PRESET",preset:r,message:`[MachTable] Unknown preset "${r}". Register it in mach-table.config.ts or remove the preset.`};o?o(l):e.onConfigWarning?e.onConfigWarning(l):console.warn(l.message);continue}i.push({name:`preset:${r}`,options:s})}i.push({name:"table props",options:t});let d=p(...i.map(r=>r.options));return{options:d,explain(r){let s=i.filter(u=>Object.prototype.hasOwnProperty.call(u.options,r)).map(u=>({name:u.name,value:u.options[r]})),l=s[s.length-1];return{key:r,value:d[r],source:l?.name??"MachTable built-in",layers:s}}}}export{g as GRID_OPTION_KEYS,c as GRID_OPTION_META,h as mergeMachTableConfig,k as normalizeMachTableConfig,D as resolveMachTableGridOptions};
1
+ var c={columnDefs:{kind:"array",update:"columnDefs"},rowData:{kind:"array",update:"rowData"},defaultColDef:{kind:"object",update:"options"},columnTypes:{kind:"object",update:"options"},rowKey:{kind:"unknown",update:"options"},rowHeight:{kind:"number",update:"options"},headerHeight:{kind:"number",update:"options"},rowBuffer:{kind:"number",update:"options"},columnLayout:{kind:"string",update:"options"},enableColumnResize:{kind:"boolean",update:"options"},domLayout:{kind:"string",update:"options"},rowSelection:{kind:"string",update:"options"},multiSort:{kind:"boolean",update:"options"},size:{kind:"string",update:"options"},stripedRows:{kind:"boolean",update:"options"},showCellBorders:{kind:"boolean",update:"options"},theme:{kind:"string",update:"options"},quickFilterText:{kind:"string",update:"quickFilter"},advancedFilterModel:{kind:"object",update:"options"},masterDetail:{kind:"boolean",update:"options"},detailRowHeight:{kind:"number",update:"options"},detailRowRenderer:{kind:"function",update:"options"},isRowExpandable:{kind:"function",update:"options"},detailToggleColumn:{kind:"boolean",update:"options"},columnMenu:{kind:"boolean",update:"options"},aggFuncs:{kind:"object",update:"options"},components:{kind:"object",update:"options"},actionPolicy:{kind:"object",update:"options"},features:{kind:"array",update:"options"},initialState:{kind:"object",update:"options"},persistence:{kind:"boolean-object",update:"options"},locale:{kind:"object",update:"options"},editType:{kind:"string",update:"options"},editableIndicator:{kind:"string",update:"options"},rowEditValidator:{kind:"function",update:"options"},singleClickEdit:{kind:"boolean",update:"options"},manualSorting:{kind:"boolean",update:"options"},manualFiltering:{kind:"boolean",update:"options"},showSummary:{kind:"boolean",update:"options"},summaryMethod:{kind:"function",update:"options"},treeData:{kind:"boolean",update:"options"},childrenKey:{kind:"string",update:"options"},isTreeRowExpandable:{kind:"function",update:"options"},loadTreeChildren:{kind:"function",update:"options"},autoCheckedChildren:{kind:"boolean",update:"options"},defaultExpandAll:{kind:"boolean",update:"options"},indexOffset:{kind:"number",update:"options"},applyRowDrag:{kind:"boolean",update:"options"},undoStackSize:{kind:"number",update:"options"},asyncTransactionWaitMillis:{kind:"number",update:"options"},getRowHeight:{kind:"function",update:"options"},pinnedTopRowData:{kind:"array",update:"options"},pinnedBottomRowData:{kind:"array",update:"options"},pagination:{kind:"boolean-object",update:"options"},watermark:{kind:"boolean-object",update:"options"},suppressWarnings:{kind:"boolean",update:"options"},enableRangeSelection:{kind:"boolean",update:"options"},suppressClipboard:{kind:"boolean",update:"options"},contextMenu:{kind:"boolean",update:"options"},getContextMenuItems:{kind:"function",update:"options"},tooltipComponent:{kind:"function",update:"options"},tooltipShowDelay:{kind:"number",update:"options"},flashCells:{kind:"boolean",update:"options"},fillHandle:{kind:"boolean",update:"options"},statusBar:{kind:"boolean-object",update:"options"},datasource:{kind:"object",update:"options"},datasourceMode:{kind:"string",update:"options"},blockSize:{kind:"number",update:"options"},infiniteBufferRows:{kind:"number",update:"options"},maxBlocksInCache:{kind:"number",update:"options"},datasourceMaxConcurrentRequests:{kind:"number",update:"options"},blockPrefetch:{kind:"number",update:"options"},datasourceRowCount:{kind:"number",update:"options"},dataProcessor:{kind:"object",update:"options"},dataProcessorMinRows:{kind:"number",update:"options"},datasourceRetryCount:{kind:"number",update:"options"},datasourceRetryDelay:{kind:"number",update:"options"},datasourceRetryJitter:{kind:"number",update:"options"},suppressCellFocus:{kind:"boolean",update:"options"},suppressRowHoverHighlight:{kind:"boolean",update:"options"},suppressNoRowsOverlay:{kind:"boolean",update:"options"},suppressHeaderFocus:{kind:"boolean",update:"options"},ariaLabel:{kind:"string",update:"options"},ariaLabelledBy:{kind:"string",update:"options"},ariaDescribedBy:{kind:"string",update:"options"},loading:{kind:"boolean",update:"options"},error:{kind:"unknown",update:"options"},overlayNoRowsTemplate:{kind:"unknown",update:"options"},overlayLoadingTemplate:{kind:"unknown",update:"options"},overlayErrorTemplate:{kind:"unknown",update:"options"},allowUnsafeOverlayHtml:{kind:"boolean",update:"options"},className:{kind:"string",update:"options"}},T=Object.freeze(Object.keys(c)),R=Object.freeze(T.filter(e=>c[e].update==="options"));function f(e,n){return n===void 0?e:typeof n!="object"||n===null||typeof e!="object"||e===null?n:{...e,...n}}function b(e,n){return typeof e!="function"?n:typeof n!="function"?e:(...t)=>{let o;try{e(...t)}catch(a){o=a}try{n(...t)}catch(a){o??(o=a)}if(o!==void 0)throw o}}function k(e,n){if(!(!e.components&&!n.components))return{cellRenderers:{...e.components?.cellRenderers,...n.components?.cellRenderers},cellEditors:{...e.components?.cellEditors,...n.components?.cellEditors}}}function y(e,n){if(!e.columnTypes&&!n.columnTypes)return;let t={},o=new Set([...Object.keys(e.columnTypes??{}),...Object.keys(n.columnTypes??{})]);for(let a of o)t[a]={...e.columnTypes?.[a],...n.columnTypes?.[a]};return t}function O(e,n,t){for(let o of new Set([...Object.keys(n),...Object.keys(t)])){if(!/^on[A-Z]/.test(o))continue;let a=n[o],i=t[o];typeof a!="function"||typeof i!="function"||(e[o]=b(a,i))}}function D(e,n){let t={...e,...n,features:n.features??e.features};(e.defaultColDef||n.defaultColDef)&&(t.defaultColDef={...e.defaultColDef,...n.defaultColDef}),(e.locale||n.locale)&&(t.locale={...e.locale,...n.locale});let o=k(e,n);o&&(t.components=o);let a=y(e,n);return a&&(t.columnTypes=a),(e.aggFuncs||n.aggFuncs)&&(t.aggFuncs={...e.aggFuncs,...n.aggFuncs}),t.pagination=f(e.pagination,n.pagination),t.statusBar=f(e.statusBar,n.statusBar),t.watermark=f(e.watermark,n.watermark),O(t,e,n),t}function p(...e){return e.reduce(D,{})}function h(e){return e?(Array.isArray(e)?e:[e]).filter(n=>typeof n=="string"&&n.trim().length>0):[]}var C=new Set(["rowData","columnDefs","datasource","loading","error","initialState","persistence","components","columnTypes","stateKey","stateStore","stateSaveDebounceMs","columnStateKey","columnStateStore"]);function g(e,n,t){if(!n||typeof n!="object"||Array.isArray(n))return{};let o={};for(let[a,i]of Object.entries(n)){if(!C.has(a)){o[a]=i;continue}let d={code:t==="defaults"?"INVALID_DEFAULT_OPTION":"INVALID_PRESET_OPTION",option:a,layer:t,message:`[MachTable] "${a}" is instance-only and cannot be declared in config ${t}.`};if(e.onConfigWarning?.(d),e.strict!==!1)throw new TypeError(d.message)}return o}function m(e={}){let n=g(e,e.defaults,"defaults");return{defaults:p({columnTypes:e.columnTypes,components:e.components},n),presets:Object.fromEntries(Object.entries(e.presets??{}).map(([t,o])=>[t,p(g(e,o,`preset:${t}`))])),defaultPreset:e.defaultPreset??!1,strict:e.strict!==!1,...e.onConfigWarning?{onConfigWarning:e.onConfigWarning}:{}}}function w(e,n){let t=m({...n,strict:n.strict??e.strict,onConfigWarning:n.onConfigWarning??e.onConfigWarning}),o={...e.presets};for(let[a,i]of Object.entries(t.presets))o[a]=p(e.presets[a]??{},i);return{defaults:p(e.defaults,t.defaults),presets:o,defaultPreset:n.defaultPreset===void 0?e.defaultPreset:n.defaultPreset,strict:n.strict??e.strict,...n.onConfigWarning??e.onConfigWarning?{onConfigWarning:n.onConfigWarning??e.onConfigWarning}:{}}}function M(e,n,t,o){let a=n===void 0?e.defaultPreset:n,i=[{name:"application defaults",options:e.defaults}];for(let r of h(a)){let s=e.presets[r];if(!s){let l={code:"UNKNOWN_PRESET",preset:r,message:`[MachTable] Unknown preset "${r}". Register it in mach-table.config.ts or remove the preset.`};o?o(l):e.onConfigWarning?e.onConfigWarning(l):console.warn(l.message);continue}i.push({name:`preset:${r}`,options:s})}i.push({name:"table props",options:t});let d=p(...i.map(r=>r.options));return{options:d,explain(r){let s=i.filter(u=>Object.prototype.hasOwnProperty.call(u.options,r)).map(u=>({name:u.name,value:u.options[r]})),l=s[s.length-1];return{key:r,value:d[r],source:l?.name??"MachTable built-in",layers:s}}}}export{T as GRID_OPTION_KEYS,c as GRID_OPTION_META,w as mergeMachTableConfig,m as normalizeMachTableConfig,M as resolveMachTableGridOptions};
@@ -1,4 +1,4 @@
1
- import { G as GridOptions, C as ColDef, b as GridComponents } from './options-CnUx414l.js';
1
+ import { G as GridOptions, C as ColDef, b as GridComponents } from './options-CL6BYXVZ.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 { G as GridOptions, C as ColDef, b as GridComponents } from './options-CnUx414l.cjs';
1
+ import { G as GridOptions, C as ColDef, b as GridComponents } from './options-CL6BYXVZ.cjs';
2
2
 
3
3
  type MachTablePresetSelection = string | readonly string[] | false;
4
4
  type MachTableInstanceOptionKey = "rowData" | "columnDefs" | "datasource" | "loading" | "error" | "initialState" | "persistence" | "components" | "columnTypes";