@agile-team/mach-table 0.23.0 → 0.25.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.
@@ -0,0 +1,384 @@
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
+
4
+ type EventOptionKey = `on${Capitalize<GridEventType>}`;
5
+ type GridOptionKey = Exclude<keyof GridOptions<any>, EventOptionKey>;
6
+ /**
7
+ * Runtime single source of truth for every non-event GridOptions property.
8
+ *
9
+ * The mapped `satisfies` type intentionally makes adding a GridOptions field a
10
+ * compile error until its adapter/update behavior is declared here.
11
+ */
12
+ declare const GRID_OPTION_META: {
13
+ readonly columnDefs: {
14
+ readonly kind: "array";
15
+ readonly update: "columnDefs";
16
+ };
17
+ readonly rowData: {
18
+ readonly kind: "array";
19
+ readonly update: "rowData";
20
+ };
21
+ readonly defaultColDef: {
22
+ readonly kind: "object";
23
+ readonly update: "options";
24
+ };
25
+ readonly columnTypes: {
26
+ readonly kind: "object";
27
+ readonly update: "options";
28
+ };
29
+ readonly rowKey: {
30
+ readonly kind: "unknown";
31
+ readonly update: "options";
32
+ };
33
+ readonly rowHeight: {
34
+ readonly kind: "number";
35
+ readonly update: "options";
36
+ };
37
+ readonly headerHeight: {
38
+ readonly kind: "number";
39
+ readonly update: "options";
40
+ };
41
+ readonly rowBuffer: {
42
+ readonly kind: "number";
43
+ readonly update: "options";
44
+ };
45
+ readonly columnLayout: {
46
+ readonly kind: "string";
47
+ readonly update: "options";
48
+ };
49
+ readonly enableColumnResize: {
50
+ readonly kind: "boolean";
51
+ readonly update: "options";
52
+ };
53
+ readonly domLayout: {
54
+ readonly kind: "string";
55
+ readonly update: "options";
56
+ };
57
+ readonly rowSelection: {
58
+ readonly kind: "string";
59
+ readonly update: "options";
60
+ };
61
+ readonly multiSort: {
62
+ readonly kind: "boolean";
63
+ readonly update: "options";
64
+ };
65
+ readonly size: {
66
+ readonly kind: "string";
67
+ readonly update: "options";
68
+ };
69
+ readonly stripedRows: {
70
+ readonly kind: "boolean";
71
+ readonly update: "options";
72
+ };
73
+ readonly showCellBorders: {
74
+ readonly kind: "boolean";
75
+ readonly update: "options";
76
+ };
77
+ readonly theme: {
78
+ readonly kind: "string";
79
+ readonly update: "options";
80
+ };
81
+ readonly quickFilterText: {
82
+ readonly kind: "string";
83
+ readonly update: "quickFilter";
84
+ };
85
+ readonly advancedFilterModel: {
86
+ readonly kind: "object";
87
+ readonly update: "options";
88
+ };
89
+ readonly masterDetail: {
90
+ readonly kind: "boolean";
91
+ readonly update: "options";
92
+ };
93
+ readonly detailRowHeight: {
94
+ readonly kind: "number";
95
+ readonly update: "options";
96
+ };
97
+ readonly detailRowRenderer: {
98
+ readonly kind: "function";
99
+ readonly update: "options";
100
+ };
101
+ readonly isRowExpandable: {
102
+ readonly kind: "function";
103
+ readonly update: "options";
104
+ };
105
+ readonly detailToggleColumn: {
106
+ readonly kind: "boolean";
107
+ readonly update: "options";
108
+ };
109
+ readonly columnMenu: {
110
+ readonly kind: "boolean";
111
+ readonly update: "options";
112
+ };
113
+ readonly aggFuncs: {
114
+ readonly kind: "object";
115
+ readonly update: "options";
116
+ };
117
+ readonly components: {
118
+ readonly kind: "object";
119
+ readonly update: "options";
120
+ };
121
+ readonly actionPolicy: {
122
+ readonly kind: "object";
123
+ readonly update: "options";
124
+ };
125
+ readonly features: {
126
+ readonly kind: "array";
127
+ readonly update: "options";
128
+ };
129
+ readonly initialState: {
130
+ readonly kind: "object";
131
+ readonly update: "options";
132
+ };
133
+ readonly persistence: {
134
+ readonly kind: "boolean-object";
135
+ readonly update: "options";
136
+ };
137
+ readonly locale: {
138
+ readonly kind: "object";
139
+ readonly update: "options";
140
+ };
141
+ readonly editType: {
142
+ readonly kind: "string";
143
+ readonly update: "options";
144
+ };
145
+ readonly editableIndicator: {
146
+ readonly kind: "string";
147
+ readonly update: "options";
148
+ };
149
+ readonly rowEditValidator: {
150
+ readonly kind: "function";
151
+ readonly update: "options";
152
+ };
153
+ readonly singleClickEdit: {
154
+ readonly kind: "boolean";
155
+ readonly update: "options";
156
+ };
157
+ readonly manualSorting: {
158
+ readonly kind: "boolean";
159
+ readonly update: "options";
160
+ };
161
+ readonly manualFiltering: {
162
+ readonly kind: "boolean";
163
+ readonly update: "options";
164
+ };
165
+ readonly showSummary: {
166
+ readonly kind: "boolean";
167
+ readonly update: "options";
168
+ };
169
+ readonly summaryMethod: {
170
+ readonly kind: "function";
171
+ readonly update: "options";
172
+ };
173
+ readonly treeData: {
174
+ readonly kind: "boolean";
175
+ readonly update: "options";
176
+ };
177
+ readonly childrenKey: {
178
+ readonly kind: "string";
179
+ readonly update: "options";
180
+ };
181
+ readonly isTreeRowExpandable: {
182
+ readonly kind: "function";
183
+ readonly update: "options";
184
+ };
185
+ readonly loadTreeChildren: {
186
+ readonly kind: "function";
187
+ readonly update: "options";
188
+ };
189
+ readonly autoCheckedChildren: {
190
+ readonly kind: "boolean";
191
+ readonly update: "options";
192
+ };
193
+ readonly defaultExpandAll: {
194
+ readonly kind: "boolean";
195
+ readonly update: "options";
196
+ };
197
+ readonly indexOffset: {
198
+ readonly kind: "number";
199
+ readonly update: "options";
200
+ };
201
+ readonly applyRowDrag: {
202
+ readonly kind: "boolean";
203
+ readonly update: "options";
204
+ };
205
+ readonly undoStackSize: {
206
+ readonly kind: "number";
207
+ readonly update: "options";
208
+ };
209
+ readonly asyncTransactionWaitMillis: {
210
+ readonly kind: "number";
211
+ readonly update: "options";
212
+ };
213
+ readonly getRowHeight: {
214
+ readonly kind: "function";
215
+ readonly update: "options";
216
+ };
217
+ readonly pinnedTopRowData: {
218
+ readonly kind: "array";
219
+ readonly update: "options";
220
+ };
221
+ readonly pinnedBottomRowData: {
222
+ readonly kind: "array";
223
+ readonly update: "options";
224
+ };
225
+ readonly pagination: {
226
+ readonly kind: "boolean-object";
227
+ readonly update: "options";
228
+ };
229
+ readonly watermark: {
230
+ readonly kind: "boolean-object";
231
+ readonly update: "options";
232
+ };
233
+ readonly suppressWarnings: {
234
+ readonly kind: "boolean";
235
+ readonly update: "options";
236
+ };
237
+ readonly enableRangeSelection: {
238
+ readonly kind: "boolean";
239
+ readonly update: "options";
240
+ };
241
+ readonly suppressClipboard: {
242
+ readonly kind: "boolean";
243
+ readonly update: "options";
244
+ };
245
+ readonly contextMenu: {
246
+ readonly kind: "boolean";
247
+ readonly update: "options";
248
+ };
249
+ readonly getContextMenuItems: {
250
+ readonly kind: "function";
251
+ readonly update: "options";
252
+ };
253
+ readonly tooltipComponent: {
254
+ readonly kind: "function";
255
+ readonly update: "options";
256
+ };
257
+ readonly tooltipShowDelay: {
258
+ readonly kind: "number";
259
+ readonly update: "options";
260
+ };
261
+ readonly flashCells: {
262
+ readonly kind: "boolean";
263
+ readonly update: "options";
264
+ };
265
+ readonly fillHandle: {
266
+ readonly kind: "boolean";
267
+ readonly update: "options";
268
+ };
269
+ readonly statusBar: {
270
+ readonly kind: "boolean-object";
271
+ readonly update: "options";
272
+ };
273
+ readonly datasource: {
274
+ readonly kind: "object";
275
+ readonly update: "options";
276
+ };
277
+ readonly datasourceMode: {
278
+ readonly kind: "string";
279
+ readonly update: "options";
280
+ };
281
+ readonly blockSize: {
282
+ readonly kind: "number";
283
+ readonly update: "options";
284
+ };
285
+ readonly infiniteBufferRows: {
286
+ readonly kind: "number";
287
+ readonly update: "options";
288
+ };
289
+ readonly maxBlocksInCache: {
290
+ readonly kind: "number";
291
+ readonly update: "options";
292
+ };
293
+ readonly datasourceMaxConcurrentRequests: {
294
+ readonly kind: "number";
295
+ readonly update: "options";
296
+ };
297
+ readonly blockPrefetch: {
298
+ readonly kind: "number";
299
+ readonly update: "options";
300
+ };
301
+ readonly datasourceRowCount: {
302
+ readonly kind: "number";
303
+ readonly update: "options";
304
+ };
305
+ readonly dataProcessor: {
306
+ readonly kind: "object";
307
+ readonly update: "options";
308
+ };
309
+ readonly dataProcessorMinRows: {
310
+ readonly kind: "number";
311
+ readonly update: "options";
312
+ };
313
+ readonly datasourceRetryCount: {
314
+ readonly kind: "number";
315
+ readonly update: "options";
316
+ };
317
+ readonly datasourceRetryDelay: {
318
+ readonly kind: "number";
319
+ readonly update: "options";
320
+ };
321
+ readonly datasourceRetryJitter: {
322
+ readonly kind: "number";
323
+ readonly update: "options";
324
+ };
325
+ readonly suppressCellFocus: {
326
+ readonly kind: "boolean";
327
+ readonly update: "options";
328
+ };
329
+ readonly suppressRowHoverHighlight: {
330
+ readonly kind: "boolean";
331
+ readonly update: "options";
332
+ };
333
+ readonly suppressNoRowsOverlay: {
334
+ readonly kind: "boolean";
335
+ readonly update: "options";
336
+ };
337
+ readonly suppressHeaderFocus: {
338
+ readonly kind: "boolean";
339
+ readonly update: "options";
340
+ };
341
+ readonly ariaLabel: {
342
+ readonly kind: "string";
343
+ readonly update: "options";
344
+ };
345
+ readonly ariaLabelledBy: {
346
+ readonly kind: "string";
347
+ readonly update: "options";
348
+ };
349
+ readonly ariaDescribedBy: {
350
+ readonly kind: "string";
351
+ readonly update: "options";
352
+ };
353
+ readonly loading: {
354
+ readonly kind: "boolean";
355
+ readonly update: "options";
356
+ };
357
+ readonly error: {
358
+ readonly kind: "unknown";
359
+ readonly update: "options";
360
+ };
361
+ readonly overlayNoRowsTemplate: {
362
+ readonly kind: "unknown";
363
+ readonly update: "options";
364
+ };
365
+ readonly overlayLoadingTemplate: {
366
+ readonly kind: "unknown";
367
+ readonly update: "options";
368
+ };
369
+ readonly overlayErrorTemplate: {
370
+ readonly kind: "unknown";
371
+ readonly update: "options";
372
+ };
373
+ readonly allowUnsafeOverlayHtml: {
374
+ readonly kind: "boolean";
375
+ readonly update: "options";
376
+ };
377
+ readonly className: {
378
+ readonly kind: "string";
379
+ readonly update: "options";
380
+ };
381
+ };
382
+ declare const GRID_OPTION_KEYS: readonly GridOptionKey[];
383
+
384
+ export { GRID_OPTION_KEYS, GRID_OPTION_META };
@@ -0,0 +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};
@@ -0,0 +1,57 @@
1
+ import { G as GridOptions, C as ColDef, b as GridComponents } from './options-CL6BYXVZ.js';
2
+
3
+ type MachTablePresetSelection = string | readonly string[] | false;
4
+ type MachTableInstanceOptionKey = "rowData" | "columnDefs" | "datasource" | "loading" | "error" | "initialState" | "persistence" | "components" | "columnTypes";
5
+ /** Safe application/preset defaults. Data, request state and persistence identity stay per table. */
6
+ type MachTableDefaults = Omit<Partial<GridOptions<any>>, MachTableInstanceOptionKey>;
7
+ type MachTablePreset = MachTableDefaults;
8
+ interface MachTableConfigWarning {
9
+ code: "UNKNOWN_PRESET" | "INVALID_DEFAULT_OPTION" | "INVALID_PRESET_OPTION";
10
+ message: string;
11
+ preset?: string;
12
+ option?: string;
13
+ layer?: string;
14
+ }
15
+ interface MachTableRuntimeConfig {
16
+ /** Defaults inherited by every table in this application or subtree. */
17
+ defaults?: MachTableDefaults;
18
+ /** Application-wide semantic column types. Kept separate for config readability. */
19
+ columnTypes?: Readonly<Record<string, Partial<ColDef<any>>>>;
20
+ /** Application-wide renderer/editor registry. Per-table components can override it. */
21
+ components?: GridComponents;
22
+ /** Named, reusable behavior profiles such as `list`, `crud` or `picker`. */
23
+ presets?: Readonly<Record<string, MachTablePreset>>;
24
+ /** Preset used when a table does not declare its own preset. Set false to disable. */
25
+ defaultPreset?: MachTablePresetSelection;
26
+ /** Throw on unsafe config-center keys. Defaults to true. */
27
+ strict?: boolean;
28
+ onConfigWarning?: (warning: MachTableConfigWarning) => void;
29
+ }
30
+ interface ResolvedMachTableConfig {
31
+ readonly defaults: MachTableDefaults;
32
+ readonly presets: Readonly<Record<string, MachTablePreset>>;
33
+ readonly defaultPreset: MachTablePresetSelection;
34
+ readonly strict: boolean;
35
+ readonly onConfigWarning?: (warning: MachTableConfigWarning) => void;
36
+ }
37
+ interface MachTableOptionExplanation {
38
+ readonly key: keyof GridOptions<any> | string;
39
+ readonly value: unknown;
40
+ readonly source: string;
41
+ readonly layers: readonly {
42
+ name: string;
43
+ value: unknown;
44
+ }[];
45
+ }
46
+ interface ResolvedMachTableGridOptions<TData = any> {
47
+ readonly options: GridOptions<TData>;
48
+ explain(key: keyof GridOptions<TData> | string): MachTableOptionExplanation;
49
+ }
50
+ /** Type-checks a dedicated `mach-table.config.ts` without runtime work. */
51
+ declare function defineMachTableConfig<const TConfig extends MachTableRuntimeConfig>(config: TConfig): TConfig;
52
+ declare function normalizeMachTableConfig(config?: MachTableRuntimeConfig): ResolvedMachTableConfig;
53
+ /** Merges app, route and layout configuration while preserving named presets. */
54
+ declare function mergeMachTableConfig(parent: ResolvedMachTableConfig, child: MachTableRuntimeConfig): ResolvedMachTableConfig;
55
+ declare function resolveMachTableGridOptions<TData>(config: ResolvedMachTableConfig, requestedPreset: MachTablePresetSelection | undefined, explicit: Partial<GridOptions<TData>>, reportWarning?: (warning: MachTableConfigWarning) => void): ResolvedMachTableGridOptions<TData>;
56
+
57
+ export { type MachTableOptionExplanation as M, type ResolvedMachTableConfig as R, type ResolvedMachTableGridOptions as a, type MachTableConfigWarning as b, type MachTableDefaults as c, type MachTableInstanceOptionKey as d, type MachTablePreset as e, type MachTablePresetSelection as f, type MachTableRuntimeConfig as g, defineMachTableConfig as h, mergeMachTableConfig as m, normalizeMachTableConfig as n, resolveMachTableGridOptions as r };
@@ -0,0 +1,57 @@
1
+ import { G as GridOptions, C as ColDef, b as GridComponents } from './options-CL6BYXVZ.cjs';
2
+
3
+ type MachTablePresetSelection = string | readonly string[] | false;
4
+ type MachTableInstanceOptionKey = "rowData" | "columnDefs" | "datasource" | "loading" | "error" | "initialState" | "persistence" | "components" | "columnTypes";
5
+ /** Safe application/preset defaults. Data, request state and persistence identity stay per table. */
6
+ type MachTableDefaults = Omit<Partial<GridOptions<any>>, MachTableInstanceOptionKey>;
7
+ type MachTablePreset = MachTableDefaults;
8
+ interface MachTableConfigWarning {
9
+ code: "UNKNOWN_PRESET" | "INVALID_DEFAULT_OPTION" | "INVALID_PRESET_OPTION";
10
+ message: string;
11
+ preset?: string;
12
+ option?: string;
13
+ layer?: string;
14
+ }
15
+ interface MachTableRuntimeConfig {
16
+ /** Defaults inherited by every table in this application or subtree. */
17
+ defaults?: MachTableDefaults;
18
+ /** Application-wide semantic column types. Kept separate for config readability. */
19
+ columnTypes?: Readonly<Record<string, Partial<ColDef<any>>>>;
20
+ /** Application-wide renderer/editor registry. Per-table components can override it. */
21
+ components?: GridComponents;
22
+ /** Named, reusable behavior profiles such as `list`, `crud` or `picker`. */
23
+ presets?: Readonly<Record<string, MachTablePreset>>;
24
+ /** Preset used when a table does not declare its own preset. Set false to disable. */
25
+ defaultPreset?: MachTablePresetSelection;
26
+ /** Throw on unsafe config-center keys. Defaults to true. */
27
+ strict?: boolean;
28
+ onConfigWarning?: (warning: MachTableConfigWarning) => void;
29
+ }
30
+ interface ResolvedMachTableConfig {
31
+ readonly defaults: MachTableDefaults;
32
+ readonly presets: Readonly<Record<string, MachTablePreset>>;
33
+ readonly defaultPreset: MachTablePresetSelection;
34
+ readonly strict: boolean;
35
+ readonly onConfigWarning?: (warning: MachTableConfigWarning) => void;
36
+ }
37
+ interface MachTableOptionExplanation {
38
+ readonly key: keyof GridOptions<any> | string;
39
+ readonly value: unknown;
40
+ readonly source: string;
41
+ readonly layers: readonly {
42
+ name: string;
43
+ value: unknown;
44
+ }[];
45
+ }
46
+ interface ResolvedMachTableGridOptions<TData = any> {
47
+ readonly options: GridOptions<TData>;
48
+ explain(key: keyof GridOptions<TData> | string): MachTableOptionExplanation;
49
+ }
50
+ /** Type-checks a dedicated `mach-table.config.ts` without runtime work. */
51
+ declare function defineMachTableConfig<const TConfig extends MachTableRuntimeConfig>(config: TConfig): TConfig;
52
+ declare function normalizeMachTableConfig(config?: MachTableRuntimeConfig): ResolvedMachTableConfig;
53
+ /** Merges app, route and layout configuration while preserving named presets. */
54
+ declare function mergeMachTableConfig(parent: ResolvedMachTableConfig, child: MachTableRuntimeConfig): ResolvedMachTableConfig;
55
+ declare function resolveMachTableGridOptions<TData>(config: ResolvedMachTableConfig, requestedPreset: MachTablePresetSelection | undefined, explicit: Partial<GridOptions<TData>>, reportWarning?: (warning: MachTableConfigWarning) => void): ResolvedMachTableGridOptions<TData>;
56
+
57
+ export { type MachTableOptionExplanation as M, type ResolvedMachTableConfig as R, type ResolvedMachTableGridOptions as a, type MachTableConfigWarning as b, type MachTableDefaults as c, type MachTableInstanceOptionKey as d, type MachTablePreset as e, type MachTablePresetSelection as f, type MachTableRuntimeConfig as g, defineMachTableConfig as h, mergeMachTableConfig as m, normalizeMachTableConfig as n, resolveMachTableGridOptions as r };