@agile-team/mach-table-vue 0.5.0 → 0.13.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 (65) hide show
  1. package/LICENSE +110 -21
  2. package/README.md +61 -6
  3. package/dist/MachTable-ESOIV4CZ.cjs +2 -0
  4. package/dist/MachTable-ESOIV4CZ.cjs.map +1 -0
  5. package/dist/MachTable-USYTNQV5.js +2 -0
  6. package/dist/async.cjs +1 -22
  7. package/dist/async.cjs.map +1 -1
  8. package/dist/async.d.cts +19 -6
  9. package/dist/async.d.ts +19 -6
  10. package/dist/async.js +1 -22
  11. package/dist/async.js.map +1 -1
  12. package/dist/chunk-7U5IML5K.js +2 -0
  13. package/dist/chunk-7U5IML5K.js.map +1 -0
  14. package/dist/chunk-BE4RGLUC.cjs +2 -0
  15. package/dist/chunk-BE4RGLUC.cjs.map +1 -0
  16. package/dist/chunk-E7KTBMM6.js +2 -0
  17. package/dist/chunk-E7KTBMM6.js.map +1 -0
  18. package/dist/chunk-ICHFPO5U.js +2 -0
  19. package/dist/chunk-ICHFPO5U.js.map +1 -0
  20. package/dist/chunk-MVK2O7FM.cjs +2 -0
  21. package/dist/chunk-MVK2O7FM.cjs.map +1 -0
  22. package/dist/chunk-Y6OAV3U4.cjs +2 -0
  23. package/dist/chunk-Y6OAV3U4.cjs.map +1 -0
  24. package/dist/chunk-Z6YS22CL.cjs +2 -0
  25. package/dist/chunk-Z6YS22CL.cjs.map +1 -0
  26. package/dist/chunk-ZUOKB5ID.js +2 -0
  27. package/dist/chunk-ZUOKB5ID.js.map +1 -0
  28. package/dist/editors.cjs +2 -0
  29. package/dist/editors.cjs.map +1 -0
  30. package/dist/editors.d.cts +34 -0
  31. package/dist/editors.d.ts +34 -0
  32. package/dist/editors.js +2 -0
  33. package/dist/editors.js.map +1 -0
  34. package/dist/globalRegistration-ySQgs7aA.d.cts +86 -0
  35. package/dist/globalRegistration-ySQgs7aA.d.ts +86 -0
  36. package/dist/index.cjs +1 -110
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +54 -12
  39. package/dist/index.d.ts +54 -12
  40. package/dist/index.js +1 -110
  41. package/dist/index.js.map +1 -1
  42. package/dist/mach-table.css +410 -3
  43. package/dist/workflows-Dg6KsN85.d.cts +111 -0
  44. package/dist/workflows-Dg6KsN85.d.ts +111 -0
  45. package/dist/workflows.cjs +2 -0
  46. package/dist/workflows.cjs.map +1 -0
  47. package/dist/workflows.d.cts +3 -0
  48. package/dist/workflows.d.ts +3 -0
  49. package/dist/workflows.js +2 -0
  50. package/dist/workflows.js.map +1 -0
  51. package/package.json +24 -4
  52. package/dist/RobotGrid-2KWWM4C4.js +0 -7
  53. package/dist/RobotGrid-LELHEO4W.cjs +0 -7
  54. package/dist/RobotGrid-LELHEO4W.cjs.map +0 -1
  55. package/dist/chunk-345ZEGIE.cjs +0 -21
  56. package/dist/chunk-345ZEGIE.cjs.map +0 -1
  57. package/dist/chunk-CHEQLQW4.js +0 -78
  58. package/dist/chunk-CHEQLQW4.js.map +0 -1
  59. package/dist/chunk-JJQDDIQU.js +0 -21
  60. package/dist/chunk-JJQDDIQU.js.map +0 -1
  61. package/dist/chunk-S3NR7DIG.cjs +0 -78
  62. package/dist/chunk-S3NR7DIG.cjs.map +0 -1
  63. package/dist/globalRegistration-CQ2dTNzy.d.cts +0 -25
  64. package/dist/globalRegistration-CQ2dTNzy.d.ts +0 -25
  65. /package/dist/{RobotGrid-2KWWM4C4.js.map → MachTable-USYTNQV5.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -1,111 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunk345ZEGIEcjs = require('./chunk-345ZEGIE.cjs');
4
-
5
-
6
- var _chunkS3NR7DIGcjs = require('./chunk-S3NR7DIG.cjs');
7
-
8
- // src/plugin.ts
9
- var MachTablePlugin = Object.freeze({
10
- install(app, options = {}) {
11
- _chunk345ZEGIEcjs.registerGlobalMachTable.call(void 0, app, _chunkS3NR7DIGcjs.RobotGrid, options);
12
- }
13
- });
14
-
15
- // src/adapters.ts
16
- var _vue = require('vue');
17
- function resolveAppContext(explicit) {
18
- if (explicit) return explicit;
19
- try {
20
- return _optionalChain([_vue.getCurrentInstance.call(void 0, ), 'optionalAccess', _ => _.appContext]);
21
- } catch (e) {
22
- return void 0;
23
- }
24
- }
25
- function mountComponent(component, props, host, appContext) {
26
- if (appContext) {
27
- const vnode = _vue.h.call(void 0, component, props);
28
- vnode.appContext = appContext;
29
- _vue.render.call(void 0, vnode, host);
30
- return () => _vue.render.call(void 0, null, host);
31
- }
32
- const app = _vue.createApp.call(void 0, { render: () => _vue.h.call(void 0, component, props) });
33
- app.mount(host);
34
- return () => app.unmount();
35
- }
36
- function vueCellRenderer(component, options) {
37
- const appContext = resolveAppContext(_optionalChain([options, 'optionalAccess', _2 => _2.appContext]));
38
- return (params) => {
39
- const host = document.createElement("div");
40
- host.className = "mach-cell-vue";
41
- host.style.width = "100%";
42
- const unmount = mountComponent(component, params, host, appContext);
43
- let destroyed = false;
44
- return {
45
- el: host,
46
- destroy: () => {
47
- if (destroyed) return;
48
- destroyed = true;
49
- window.setTimeout(unmount, 0);
50
- }
51
- };
52
- };
53
- }
54
- function vueDetailRenderer(component, options) {
55
- const appContext = resolveAppContext(_optionalChain([options, 'optionalAccess', _3 => _3.appContext]));
56
- return (params) => {
57
- const host = document.createElement("div");
58
- host.style.height = "100%";
59
- const unmount = mountComponent(component, params, host, appContext);
60
- let destroyed = false;
61
- return {
62
- el: host,
63
- destroy: () => {
64
- if (destroyed) return;
65
- destroyed = true;
66
- unmount();
67
- }
68
- };
69
- };
70
- }
71
-
72
- // src/useMachTable.ts
73
-
74
- function useMachTable() {
75
- const componentRef = _vue.ref.call(void 0, null);
76
- const api = _vue.shallowRef.call(void 0, null);
77
- const ready = _vue.shallowRef.call(void 0, false);
78
- _vue.watch.call(void 0,
79
- componentRef,
80
- (comp) => {
81
- if (comp && typeof comp.getApi === "function") {
82
- api.value = comp.getApi();
83
- ready.value = api.value != null;
84
- } else {
85
- api.value = null;
86
- ready.value = false;
87
- }
88
- },
89
- { flush: "post" }
90
- );
91
- _vue.onScopeDispose.call(void 0, () => {
92
- componentRef.value = null;
93
- api.value = null;
94
- ready.value = false;
95
- });
96
- return { ref: componentRef, api, ready };
97
- }
98
-
99
- // src/index.ts
100
- var _machtable = require('@agile-team/mach-table'); _createStarExport(_machtable);
101
- var src_default = MachTablePlugin;
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
- exports.MachTable = _chunkS3NR7DIGcjs.RobotGrid; exports.MachTablePlugin = MachTablePlugin; exports.RobotGrid = _chunkS3NR7DIGcjs.RobotGrid; exports.default = src_default; exports.useMachTable = useMachTable; exports.vueCellRenderer = vueCellRenderer; exports.vueDetailRenderer = vueDetailRenderer;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _chunkZ6YS22CLcjs = require('./chunk-Z6YS22CL.cjs');var _chunkY6OAV3U4cjs = require('./chunk-Y6OAV3U4.cjs');var _chunkBE4RGLUCcjs = require('./chunk-BE4RGLUC.cjs');var _chunkMVK2O7FMcjs = require('./chunk-MVK2O7FM.cjs');var i={install(a,e){_chunkZ6YS22CLcjs.a.call(void 0, a,_chunkBE4RGLUCcjs.j,e)}};var _vue = require('vue');function Q(){let a=_vue.ref.call(void 0, null),e=_vue.shallowRef.call(void 0, null),l=_vue.shallowRef.call(void 0, !1),t=0;return _vue.watch.call(void 0, a,r=>{let c=++t;if(r&&typeof r.getApi=="function"){e.value=r.getApi(),l.value=!1;let o=e.value;o&&o.whenReady().then(()=>{t===c&&e.value===o&&!o.isDestroyed()&&(l.value=!0)})}else e.value=null,l.value=!1},{flush:"post"}),_vue.onScopeDispose.call(void 0, ()=>{t++,a.value=null,e.value=null,l.value=!1}),{ref:a,api:e,ready:l}}var _machtable = require('@agile-team/mach-table'); _createStarExport(_machtable);var z=i;exports.MACH_TABLE_CONFIG_KEY = _chunkMVK2O7FMcjs.f; exports.MACH_TABLE_DEFAULTS_KEY = _chunkMVK2O7FMcjs.e; exports.MachTable = _chunkBE4RGLUCcjs.j; exports.MachTablePlugin = i; exports.RobotGrid = _chunkBE4RGLUCcjs.k; exports.applyVueSlots = _chunkBE4RGLUCcjs.h; exports.createVueSlotEnhancer = _chunkBE4RGLUCcjs.i; exports.default = z; exports.defineMachTableConfig = _chunkMVK2O7FMcjs.a; exports.mergeMachTableConfig = _chunkMVK2O7FMcjs.c; exports.normalizeMachTableConfig = _chunkMVK2O7FMcjs.b; exports.provideMachTableConfig = _chunkMVK2O7FMcjs.h; exports.provideMachTableDefaults = _chunkMVK2O7FMcjs.i; exports.resolveMachTableGridOptions = _chunkMVK2O7FMcjs.d; exports.useMachTable = Q; exports.useMachTableConfig = _chunkMVK2O7FMcjs.k; exports.useMachTableDefaults = _chunkMVK2O7FMcjs.j; exports.useMachTableEditing = _chunkY6OAV3U4cjs.a; exports.useMachTableQuery = _chunkY6OAV3U4cjs.b; exports.vueCellEditorSlot = _chunkBE4RGLUCcjs.e; exports.vueCellRenderer = _chunkBE4RGLUCcjs.a; exports.vueCellSlotRenderer = _chunkBE4RGLUCcjs.c; exports.vueDetailRenderer = _chunkBE4RGLUCcjs.b; exports.vueDetailSlotRenderer = _chunkBE4RGLUCcjs.f; exports.vueHeaderSlotRenderer = _chunkBE4RGLUCcjs.d; exports.vueOverlaySlot = _chunkBE4RGLUCcjs.g;
111
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["d:\\office-project\\wl\\MachTable\\packages\\vue\\dist\\index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;AACA,IAAI,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC;AACpC,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE;AAC7B,IAAI,uDAAuB,GAAI,EAAE,2BAAS,EAAE,OAAO,CAAC;AACpD,EAAE;AACF,CAAC,CAAC;AACF;AACA;AACA,0BAA8D;AAC9D,SAAS,iBAAiB,CAAC,QAAQ,EAAE;AACrC,EAAE,GAAG,CAAC,QAAQ,EAAE,OAAO,QAAQ;AAC/B,EAAE,IAAI;AACN,IAAI,uBAAO,qCAAkB,CAAE,2BAAE,YAAU;AAC3C,EAAE,EAAE,UAAM;AACV,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE;AACF;AACA,SAAS,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE;AAC5D,EAAE,GAAG,CAAC,UAAU,EAAE;AAClB,IAAI,MAAM,MAAM,EAAE,oBAAC,SAAU,EAAE,KAAK,CAAC;AACrC,IAAI,KAAK,CAAC,WAAW,EAAE,UAAU;AACjC,IAAI,yBAAM,KAAM,EAAE,IAAI,CAAC;AACvB,IAAI,OAAO,CAAC,EAAE,GAAG,yBAAM,IAAK,EAAE,IAAI,CAAC;AACnC,EAAE;AACF,EAAE,MAAM,IAAI,EAAE,4BAAS,EAAG,MA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AE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC;AAC1C;AACA;AACA;AACA,kFAAsC;AACtC,IAAI,YAAY,EAAE,eAAe;AACjC;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,0SAAC","file":"D:\\office-project\\wl\\MachTable\\packages\\vue\\dist\\index.cjs","sourcesContent":[null]}
1
+ {"version":3,"sources":["d:\\office-project\\wl\\MachTable\\packages\\vue\\dist\\index.cjs"],"names":[],"mappings":"AAAA,yZAAwC,wDAAgD,wDAA+G,wDAAwG,IAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iCAAC,CAAE,CAAC,mBAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAAwE,SAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAC,IAAK,CAAC,CAAC,CAAC,CAAC,6BAAC,IAAK,CAAC,CAAC,CAAC,CAAC,6BAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,wBAAC,CAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,iCAAC,CAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,kFAAmC,IAAK,CAAC,CAAC,CAAC,CAAC,2tCAAqnB","file":"D:\\office-project\\wl\\MachTable\\packages\\vue\\dist\\index.cjs","sourcesContent":[null]}
package/dist/index.d.cts CHANGED
@@ -1,12 +1,13 @@
1
- import { M as MachTablePluginOptions } from './globalRegistration-CQ2dTNzy.cjs';
2
- export { a as MachTable, a as RobotGrid, R as RobotGridVueProps } from './globalRegistration-CQ2dTNzy.cjs';
3
- import { App, Component, AppContext, Ref, ShallowRef } from 'vue';
4
- import { CellRendererParams, CellRendererFn, DetailRowRendererParams, GridApi } from '@agile-team/mach-table';
1
+ import { a as MachTablePluginOptions, R as ResolvedMachTableConfig, b as MachTableRuntimeConfig } from './globalRegistration-ySQgs7aA.cjs';
2
+ export { c as MachTable, d as MachTableConfigWarning, e as MachTableOptionExplanation, f as MachTablePresetSelection, M as MachTableVueProps, g as ResolvedMachTableGridOptions, h as RobotGrid, i as RobotGridVueProps, j as defineMachTableConfig, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './globalRegistration-ySQgs7aA.cjs';
3
+ import { App, Slot, AppContext, Component, Slots, InjectionKey, Ref } from 'vue';
4
+ import { CellEditorParams, CellRendererParams, CellEditorFactory, CellRendererFn, DetailRowRendererParams, ICellRendererResult, HeaderComponentParams, OverlayTemplate, GridOptions } from '@agile-team/mach-table';
5
5
  export * from '@agile-team/mach-table';
6
+ export { M as MachTablePageRequest, a as MachTablePageResult, b as MachTableQuerySource, c as MachTableRemoteSelectionState, U as UseMachTableEditingOptions, d as UseMachTableEditingReturn, e as UseMachTableQueryOptions, f as UseMachTableQueryReturn, g as UseMachTableReturn, u as useMachTable, h as useMachTableEditing, i as useMachTableQuery } from './workflows-Dg6KsN85.cjs';
6
7
 
7
- declare const MachTablePlugin: Readonly<{
8
+ declare const MachTablePlugin: {
8
9
  install(app: App, options?: MachTablePluginOptions): void;
9
- }>;
10
+ };
10
11
 
11
12
  type VueCellRendererProps<TData = any, TValue = any> = CellRendererParams<TData, TValue>;
12
13
  declare function vueCellRenderer<TData = any, TValue = any>(component: Component, options?: {
@@ -18,12 +19,53 @@ declare function vueDetailRenderer<TData = any>(component: Component, options?:
18
19
  el: HTMLElement;
19
20
  destroy?: () => void;
20
21
  };
22
+ /** Internal/public bridge used by automatic `#cell-*` Vue slots. */
23
+ declare function vueCellSlotRenderer<TData = any, TValue = any>(slot: Slot, options?: {
24
+ appContext?: AppContext;
25
+ }): CellRendererFn;
26
+ declare function vueHeaderSlotRenderer<TData = any>(slot: Slot, options?: {
27
+ appContext?: AppContext;
28
+ }): (params: HeaderComponentParams<TData>) => ICellRendererResult;
29
+ interface VueCellEditorSlotProps<TData = any, TValue = any> extends CellEditorParams<TData, TValue> {
30
+ value: TValue;
31
+ setValue(value: TValue): void;
32
+ commit(): void;
33
+ cancel(): void;
34
+ }
35
+ declare function vueCellEditorSlot<TData = any, TValue = any>(slot: Slot, options?: {
36
+ appContext?: AppContext;
37
+ }): CellEditorFactory;
38
+ declare function vueDetailSlotRenderer<TData = any>(slot: Slot, options?: {
39
+ appContext?: AppContext;
40
+ }): (params: DetailRowRendererParams<TData>) => ICellRendererResult;
41
+ declare function vueOverlaySlot(slot: Slot, options?: {
42
+ appContext?: AppContext;
43
+ }): OverlayTemplate;
21
44
 
22
- interface UseMachTableReturn<TData = any> {
23
- ref: Ref<any>;
24
- api: ShallowRef<GridApi<TData> | null>;
25
- ready: ShallowRef<boolean>;
45
+ interface MachTableVueSlots<TData = any> {
46
+ cell?: (props: CellRendererParams<TData>) => any;
47
+ header?: (props: HeaderComponentParams<TData>) => any;
48
+ editor?: (props: VueCellEditorSlotProps<TData>) => any;
49
+ detail?: (props: DetailRowRendererParams<TData>) => any;
50
+ loading?: () => any;
51
+ empty?: () => any;
52
+ actions?: (props: CellRendererParams<TData>) => any;
53
+ [name: `cell-${string}`]: ((props: CellRendererParams<TData>) => any) | undefined;
54
+ [name: `header-${string}`]: ((props: HeaderComponentParams<TData>) => any) | undefined;
55
+ [name: `editor-${string}`]: ((props: CellEditorParams<TData>) => any) | undefined;
26
56
  }
27
- declare function useMachTable<TData = any>(): UseMachTableReturn<TData>;
57
+ declare function applyVueSlots<TData>(options: GridOptions<TData>, slots: Slots, appContext?: AppContext): GridOptions<TData>;
58
+ /** Creates a stable enhancer so unrelated reactive prop updates do not rebuild columns. */
59
+ declare function createVueSlotEnhancer<TData>(slots: Slots, appContext?: AppContext): (options: GridOptions<TData>) => GridOptions<TData>;
60
+
61
+ declare const MACH_TABLE_DEFAULTS_KEY: InjectionKey<Partial<GridOptions<any>>>;
62
+ declare const MACH_TABLE_CONFIG_KEY: InjectionKey<Readonly<Ref<ResolvedMachTableConfig>>>;
63
+ type MachTableConfigSource = MachTableRuntimeConfig | Readonly<Ref<MachTableRuntimeConfig>> | (() => MachTableRuntimeConfig);
64
+ /** Provides route/layout-scoped defaults, presets and diagnostics reactively. */
65
+ declare function provideMachTableConfig(source: MachTableConfigSource): Readonly<Ref<ResolvedMachTableConfig>>;
66
+ /** Provides route/layout-scoped defaults. Per-table props always take precedence. */
67
+ declare function provideMachTableDefaults<TData>(defaults: Partial<GridOptions<TData>> | Readonly<Ref<Partial<GridOptions<TData>>>> | (() => Partial<GridOptions<TData>>)): void;
68
+ declare function useMachTableDefaults<TData>(): Partial<GridOptions<TData>>;
69
+ declare function useMachTableConfig(): Readonly<Ref<ResolvedMachTableConfig>>;
28
70
 
29
- export { MachTablePlugin, MachTablePluginOptions, type UseMachTableReturn, type VueCellRendererProps, MachTablePlugin as default, useMachTable, vueCellRenderer, vueDetailRenderer };
71
+ export { MACH_TABLE_CONFIG_KEY, MACH_TABLE_DEFAULTS_KEY, type MachTableConfigSource, MachTablePlugin, MachTablePluginOptions, MachTableRuntimeConfig, type MachTableVueSlots, ResolvedMachTableConfig, type VueCellEditorSlotProps, type VueCellRendererProps, applyVueSlots, createVueSlotEnhancer, MachTablePlugin as default, provideMachTableConfig, provideMachTableDefaults, useMachTableConfig, useMachTableDefaults, vueCellEditorSlot, vueCellRenderer, vueCellSlotRenderer, vueDetailRenderer, vueDetailSlotRenderer, vueHeaderSlotRenderer, vueOverlaySlot };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { M as MachTablePluginOptions } from './globalRegistration-CQ2dTNzy.js';
2
- export { a as MachTable, a as RobotGrid, R as RobotGridVueProps } from './globalRegistration-CQ2dTNzy.js';
3
- import { App, Component, AppContext, Ref, ShallowRef } from 'vue';
4
- import { CellRendererParams, CellRendererFn, DetailRowRendererParams, GridApi } from '@agile-team/mach-table';
1
+ import { a as MachTablePluginOptions, R as ResolvedMachTableConfig, b as MachTableRuntimeConfig } from './globalRegistration-ySQgs7aA.js';
2
+ export { c as MachTable, d as MachTableConfigWarning, e as MachTableOptionExplanation, f as MachTablePresetSelection, M as MachTableVueProps, g as ResolvedMachTableGridOptions, h as RobotGrid, i as RobotGridVueProps, j as defineMachTableConfig, m as mergeMachTableConfig, n as normalizeMachTableConfig, r as resolveMachTableGridOptions } from './globalRegistration-ySQgs7aA.js';
3
+ import { App, Slot, AppContext, Component, Slots, InjectionKey, Ref } from 'vue';
4
+ import { CellEditorParams, CellRendererParams, CellEditorFactory, CellRendererFn, DetailRowRendererParams, ICellRendererResult, HeaderComponentParams, OverlayTemplate, GridOptions } from '@agile-team/mach-table';
5
5
  export * from '@agile-team/mach-table';
6
+ export { M as MachTablePageRequest, a as MachTablePageResult, b as MachTableQuerySource, c as MachTableRemoteSelectionState, U as UseMachTableEditingOptions, d as UseMachTableEditingReturn, e as UseMachTableQueryOptions, f as UseMachTableQueryReturn, g as UseMachTableReturn, u as useMachTable, h as useMachTableEditing, i as useMachTableQuery } from './workflows-Dg6KsN85.js';
6
7
 
7
- declare const MachTablePlugin: Readonly<{
8
+ declare const MachTablePlugin: {
8
9
  install(app: App, options?: MachTablePluginOptions): void;
9
- }>;
10
+ };
10
11
 
11
12
  type VueCellRendererProps<TData = any, TValue = any> = CellRendererParams<TData, TValue>;
12
13
  declare function vueCellRenderer<TData = any, TValue = any>(component: Component, options?: {
@@ -18,12 +19,53 @@ declare function vueDetailRenderer<TData = any>(component: Component, options?:
18
19
  el: HTMLElement;
19
20
  destroy?: () => void;
20
21
  };
22
+ /** Internal/public bridge used by automatic `#cell-*` Vue slots. */
23
+ declare function vueCellSlotRenderer<TData = any, TValue = any>(slot: Slot, options?: {
24
+ appContext?: AppContext;
25
+ }): CellRendererFn;
26
+ declare function vueHeaderSlotRenderer<TData = any>(slot: Slot, options?: {
27
+ appContext?: AppContext;
28
+ }): (params: HeaderComponentParams<TData>) => ICellRendererResult;
29
+ interface VueCellEditorSlotProps<TData = any, TValue = any> extends CellEditorParams<TData, TValue> {
30
+ value: TValue;
31
+ setValue(value: TValue): void;
32
+ commit(): void;
33
+ cancel(): void;
34
+ }
35
+ declare function vueCellEditorSlot<TData = any, TValue = any>(slot: Slot, options?: {
36
+ appContext?: AppContext;
37
+ }): CellEditorFactory;
38
+ declare function vueDetailSlotRenderer<TData = any>(slot: Slot, options?: {
39
+ appContext?: AppContext;
40
+ }): (params: DetailRowRendererParams<TData>) => ICellRendererResult;
41
+ declare function vueOverlaySlot(slot: Slot, options?: {
42
+ appContext?: AppContext;
43
+ }): OverlayTemplate;
21
44
 
22
- interface UseMachTableReturn<TData = any> {
23
- ref: Ref<any>;
24
- api: ShallowRef<GridApi<TData> | null>;
25
- ready: ShallowRef<boolean>;
45
+ interface MachTableVueSlots<TData = any> {
46
+ cell?: (props: CellRendererParams<TData>) => any;
47
+ header?: (props: HeaderComponentParams<TData>) => any;
48
+ editor?: (props: VueCellEditorSlotProps<TData>) => any;
49
+ detail?: (props: DetailRowRendererParams<TData>) => any;
50
+ loading?: () => any;
51
+ empty?: () => any;
52
+ actions?: (props: CellRendererParams<TData>) => any;
53
+ [name: `cell-${string}`]: ((props: CellRendererParams<TData>) => any) | undefined;
54
+ [name: `header-${string}`]: ((props: HeaderComponentParams<TData>) => any) | undefined;
55
+ [name: `editor-${string}`]: ((props: CellEditorParams<TData>) => any) | undefined;
26
56
  }
27
- declare function useMachTable<TData = any>(): UseMachTableReturn<TData>;
57
+ declare function applyVueSlots<TData>(options: GridOptions<TData>, slots: Slots, appContext?: AppContext): GridOptions<TData>;
58
+ /** Creates a stable enhancer so unrelated reactive prop updates do not rebuild columns. */
59
+ declare function createVueSlotEnhancer<TData>(slots: Slots, appContext?: AppContext): (options: GridOptions<TData>) => GridOptions<TData>;
60
+
61
+ declare const MACH_TABLE_DEFAULTS_KEY: InjectionKey<Partial<GridOptions<any>>>;
62
+ declare const MACH_TABLE_CONFIG_KEY: InjectionKey<Readonly<Ref<ResolvedMachTableConfig>>>;
63
+ type MachTableConfigSource = MachTableRuntimeConfig | Readonly<Ref<MachTableRuntimeConfig>> | (() => MachTableRuntimeConfig);
64
+ /** Provides route/layout-scoped defaults, presets and diagnostics reactively. */
65
+ declare function provideMachTableConfig(source: MachTableConfigSource): Readonly<Ref<ResolvedMachTableConfig>>;
66
+ /** Provides route/layout-scoped defaults. Per-table props always take precedence. */
67
+ declare function provideMachTableDefaults<TData>(defaults: Partial<GridOptions<TData>> | Readonly<Ref<Partial<GridOptions<TData>>>> | (() => Partial<GridOptions<TData>>)): void;
68
+ declare function useMachTableDefaults<TData>(): Partial<GridOptions<TData>>;
69
+ declare function useMachTableConfig(): Readonly<Ref<ResolvedMachTableConfig>>;
28
70
 
29
- export { MachTablePlugin, MachTablePluginOptions, type UseMachTableReturn, type VueCellRendererProps, MachTablePlugin as default, useMachTable, vueCellRenderer, vueDetailRenderer };
71
+ export { MACH_TABLE_CONFIG_KEY, MACH_TABLE_DEFAULTS_KEY, type MachTableConfigSource, MachTablePlugin, MachTablePluginOptions, MachTableRuntimeConfig, type MachTableVueSlots, ResolvedMachTableConfig, type VueCellEditorSlotProps, type VueCellRendererProps, applyVueSlots, createVueSlotEnhancer, MachTablePlugin as default, provideMachTableConfig, provideMachTableDefaults, useMachTableConfig, useMachTableDefaults, vueCellEditorSlot, vueCellRenderer, vueCellSlotRenderer, vueDetailRenderer, vueDetailSlotRenderer, vueHeaderSlotRenderer, vueOverlaySlot };
package/dist/index.js CHANGED
@@ -1,111 +1,2 @@
1
- import {
2
- registerGlobalMachTable
3
- } from "./chunk-JJQDDIQU.js";
4
- import {
5
- RobotGrid
6
- } from "./chunk-CHEQLQW4.js";
7
-
8
- // src/plugin.ts
9
- var MachTablePlugin = Object.freeze({
10
- install(app, options = {}) {
11
- registerGlobalMachTable(app, RobotGrid, options);
12
- }
13
- });
14
-
15
- // src/adapters.ts
16
- import { createApp, h, render, getCurrentInstance } from "vue";
17
- function resolveAppContext(explicit) {
18
- if (explicit) return explicit;
19
- try {
20
- return getCurrentInstance()?.appContext;
21
- } catch {
22
- return void 0;
23
- }
24
- }
25
- function mountComponent(component, props, host, appContext) {
26
- if (appContext) {
27
- const vnode = h(component, props);
28
- vnode.appContext = appContext;
29
- render(vnode, host);
30
- return () => render(null, host);
31
- }
32
- const app = createApp({ render: () => h(component, props) });
33
- app.mount(host);
34
- return () => app.unmount();
35
- }
36
- function vueCellRenderer(component, options) {
37
- const appContext = resolveAppContext(options?.appContext);
38
- return (params) => {
39
- const host = document.createElement("div");
40
- host.className = "mach-cell-vue";
41
- host.style.width = "100%";
42
- const unmount = mountComponent(component, params, host, appContext);
43
- let destroyed = false;
44
- return {
45
- el: host,
46
- destroy: () => {
47
- if (destroyed) return;
48
- destroyed = true;
49
- window.setTimeout(unmount, 0);
50
- }
51
- };
52
- };
53
- }
54
- function vueDetailRenderer(component, options) {
55
- const appContext = resolveAppContext(options?.appContext);
56
- return (params) => {
57
- const host = document.createElement("div");
58
- host.style.height = "100%";
59
- const unmount = mountComponent(component, params, host, appContext);
60
- let destroyed = false;
61
- return {
62
- el: host,
63
- destroy: () => {
64
- if (destroyed) return;
65
- destroyed = true;
66
- unmount();
67
- }
68
- };
69
- };
70
- }
71
-
72
- // src/useMachTable.ts
73
- import { onScopeDispose, ref, shallowRef, watch } from "vue";
74
- function useMachTable() {
75
- const componentRef = ref(null);
76
- const api = shallowRef(null);
77
- const ready = shallowRef(false);
78
- watch(
79
- componentRef,
80
- (comp) => {
81
- if (comp && typeof comp.getApi === "function") {
82
- api.value = comp.getApi();
83
- ready.value = api.value != null;
84
- } else {
85
- api.value = null;
86
- ready.value = false;
87
- }
88
- },
89
- { flush: "post" }
90
- );
91
- onScopeDispose(() => {
92
- componentRef.value = null;
93
- api.value = null;
94
- ready.value = false;
95
- });
96
- return { ref: componentRef, api, ready };
97
- }
98
-
99
- // src/index.ts
100
- export * from "@agile-team/mach-table";
101
- var src_default = MachTablePlugin;
102
- export {
103
- RobotGrid as MachTable,
104
- MachTablePlugin,
105
- RobotGrid,
106
- src_default as default,
107
- useMachTable,
108
- vueCellRenderer,
109
- vueDetailRenderer
110
- };
1
+ import{a as p}from"./chunk-ZUOKB5ID.js";import{a as G,b as U}from"./chunk-E7KTBMM6.js";import{a as R,b as v,c as x,d as S,e as C,f as P,g as A,h as E,i as D,j as n,k as O}from"./chunk-7U5IML5K.js";import{a as f,b as s,c as h,d as T,e as b,f as M,h as m,i as d,j as g,k as y}from"./chunk-ICHFPO5U.js";var i={install(a,e){p(a,n,e)}};import{onScopeDispose as V,ref as w,shallowRef as u,watch as _}from"vue";function Q(){let a=w(null),e=u(null),l=u(!1),t=0;return _(a,r=>{let c=++t;if(r&&typeof r.getApi=="function"){e.value=r.getApi(),l.value=!1;let o=e.value;o&&o.whenReady().then(()=>{t===c&&e.value===o&&!o.isDestroyed()&&(l.value=!0)})}else e.value=null,l.value=!1},{flush:"post"}),V(()=>{t++,a.value=null,e.value=null,l.value=!1}),{ref:a,api:e,ready:l}}export*from"@agile-team/mach-table";var z=i;export{M as MACH_TABLE_CONFIG_KEY,b as MACH_TABLE_DEFAULTS_KEY,n as MachTable,i as MachTablePlugin,O as RobotGrid,E as applyVueSlots,D as createVueSlotEnhancer,z as default,f as defineMachTableConfig,h as mergeMachTableConfig,s as normalizeMachTableConfig,m as provideMachTableConfig,d as provideMachTableDefaults,T as resolveMachTableGridOptions,Q as useMachTable,y as useMachTableConfig,g as useMachTableDefaults,G as useMachTableEditing,U as useMachTableQuery,C as vueCellEditorSlot,R as vueCellRenderer,x as vueCellSlotRenderer,v as vueDetailRenderer,P as vueDetailSlotRenderer,S as vueHeaderSlotRenderer,A as vueOverlaySlot};
111
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin.ts","../src/adapters.ts","../src/useMachTable.ts","../src/index.ts"],"sourcesContent":["import type { App } from \"vue\";\nimport { RobotGrid } from \"./RobotGrid\";\nimport { registerGlobalMachTable, type MachTablePluginOptions } from \"./globalRegistration\";\n\nexport const MachTablePlugin = Object.freeze({\n install(app: App, options: MachTablePluginOptions = {}): void {\n registerGlobalMachTable(app, RobotGrid, options);\n }\n});\n\nexport type { MachTablePluginOptions } from \"./globalRegistration\";\n","import { createApp, h, render, getCurrentInstance, type AppContext, type Component } from \"vue\";\nimport type { CellRendererParams, CellRendererFn, DetailRowRendererParams } from \"@agile-team/mach-table\";\n\nexport type VueCellRendererProps<TData = any, TValue = any> = CellRendererParams<TData, TValue>;\n\n/**\n * 解析适配器可用的 appContext:\n * 1. 显式传入优先;\n * 2. 否则在 <script setup> 内同步调用工厂时自动捕获宿主组件上下文\n * (使单元格/明细内的 naive、EP 组件继承 ConfigProvider 的主题与国际化)。\n */\nfunction resolveAppContext(explicit?: AppContext): AppContext | undefined {\n if (explicit) return explicit;\n try {\n return getCurrentInstance()?.appContext;\n } catch {\n return undefined;\n }\n}\n\nfunction mountComponent(\n component: Component,\n props: Record<string, any>,\n host: HTMLElement,\n appContext?: AppContext\n): () => void {\n if (appContext) {\n const vnode = h(component, props);\n vnode.appContext = appContext;\n render(vnode, host);\n return () => render(null, host);\n }\n const app = createApp({ render: () => h(component, props) });\n app.mount(host);\n return () => app.unmount();\n}\n\nexport function vueCellRenderer<TData = any, TValue = any>(\n component: Component,\n options?: { appContext?: AppContext }\n): CellRendererFn {\n const appContext = resolveAppContext(options?.appContext);\n return (params: CellRendererParams<TData, TValue>) => {\n const host = document.createElement(\"div\");\n host.className = \"mach-cell-vue\";\n host.style.width = \"100%\";\n const unmount = mountComponent(component, params as Record<string, any>, host, appContext);\n let destroyed = false;\n return {\n el: host,\n destroy: () => {\n if (destroyed) return;\n destroyed = true;\n window.setTimeout(unmount, 0);\n }\n };\n };\n}\n\nexport function vueDetailRenderer<TData = any>(\n component: Component,\n options?: { appContext?: AppContext }\n): (params: DetailRowRendererParams<TData>) => { el: HTMLElement; destroy?: () => void } {\n const appContext = resolveAppContext(options?.appContext);\n return (params) => {\n const host = document.createElement(\"div\");\n host.style.height = \"100%\";\n const unmount = mountComponent(component, params as Record<string, any>, host, appContext);\n let destroyed = false;\n return {\n el: host,\n destroy: () => {\n if (destroyed) return;\n destroyed = true;\n unmount();\n }\n };\n };\n}\n","import { onScopeDispose, ref, shallowRef, watch, type Ref, type ShallowRef } from \"vue\";\nimport type { GridApi } from \"@agile-team/mach-table\";\n\nexport interface UseMachTableReturn<TData = any> {\n ref: Ref<any>;\n api: ShallowRef<GridApi<TData> | null>;\n ready: ShallowRef<boolean>;\n}\n\nexport function useMachTable<TData = any>(): UseMachTableReturn<TData> {\n const componentRef = ref<any>(null);\n const api = shallowRef<GridApi<TData> | null>(null);\n const ready = shallowRef(false);\n\n watch(\n componentRef,\n (comp) => {\n if (comp && typeof comp.getApi === \"function\") {\n api.value = comp.getApi();\n ready.value = api.value != null;\n } else {\n api.value = null;\n ready.value = false;\n }\n },\n { flush: \"post\" }\n );\n\n onScopeDispose(() => {\n componentRef.value = null;\n api.value = null;\n ready.value = false;\n });\n\n return { ref: componentRef, api, ready };\n}\n","import { RobotGrid } from \"./RobotGrid\";\nimport { MachTablePlugin } from \"./plugin\";\n\nexport { RobotGrid };\nexport { RobotGrid as MachTable };\nexport type { RobotGridVueProps } from \"./RobotGrid\";\nexport { vueCellRenderer, vueDetailRenderer } from \"./adapters\";\nexport { useMachTable } from \"./useMachTable\";\nexport type { UseMachTableReturn } from \"./useMachTable\";\nexport type { VueCellRendererProps } from \"./adapters\";\nexport { MachTablePlugin } from \"./plugin\";\nexport type { MachTablePluginOptions } from \"./plugin\";\nexport * from \"@agile-team/mach-table\";\n\nexport default MachTablePlugin;\n"],"mappings":";;;;;;;;AAIO,IAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,QAAQ,KAAU,UAAkC,CAAC,GAAS;AAC5D,4BAAwB,KAAK,WAAW,OAAO;AAAA,EACjD;AACF,CAAC;;;ACRD,SAAS,WAAW,GAAG,QAAQ,0BAA2D;AAW1F,SAAS,kBAAkB,UAA+C;AACxE,MAAI,SAAU,QAAO;AACrB,MAAI;AACF,WAAO,mBAAmB,GAAG;AAAA,EAC/B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,eACP,WACA,OACA,MACA,YACY;AACZ,MAAI,YAAY;AACd,UAAM,QAAQ,EAAE,WAAW,KAAK;AAChC,UAAM,aAAa;AACnB,WAAO,OAAO,IAAI;AAClB,WAAO,MAAM,OAAO,MAAM,IAAI;AAAA,EAChC;AACA,QAAM,MAAM,UAAU,EAAE,QAAQ,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC;AAC3D,MAAI,MAAM,IAAI;AACd,SAAO,MAAM,IAAI,QAAQ;AAC3B;AAEO,SAAS,gBACd,WACA,SACgB;AAChB,QAAM,aAAa,kBAA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K,cAAc,KAAK,MAAM;AACzC;;;ACvBA,cAAc;AAEd,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/plugin.ts","../src/useMachTable.ts","../src/index.ts"],"sourcesContent":["import type { App } from \"vue\";\nimport { MachTable } from \"./MachTable\";\nimport { registerGlobalMachTable, type MachTablePluginOptions } from \"./globalRegistration\";\n\nexport const MachTablePlugin = {\n install(app: App, options?: MachTablePluginOptions): void {\n registerGlobalMachTable(app, MachTable, options);\n }\n};\n\nexport type { MachTablePluginOptions } from \"./globalRegistration\";\n","import { onScopeDispose, ref, shallowRef, watch, type Ref, type ShallowRef } from \"vue\";\nimport type { GridApi } from \"@agile-team/mach-table\";\n\nexport interface UseMachTableReturn<TData = any> {\n ref: Ref<any>;\n api: ShallowRef<GridApi<TData> | null>;\n ready: ShallowRef<boolean>;\n}\n\nexport function useMachTable<TData = any>(): UseMachTableReturn<TData> {\n const componentRef = ref<any>(null);\n const api = shallowRef<GridApi<TData> | null>(null);\n const ready = shallowRef(false);\n let generation = 0;\n\n watch(\n componentRef,\n (comp) => {\n const currentGeneration = ++generation;\n if (comp && typeof comp.getApi === \"function\") {\n api.value = comp.getApi();\n ready.value = false;\n const currentApi = api.value;\n if (currentApi) {\n void currentApi.whenReady().then(() => {\n if (generation === currentGeneration && api.value === currentApi && !currentApi.isDestroyed()) {\n ready.value = true;\n }\n });\n }\n } else {\n api.value = null;\n ready.value = false;\n }\n },\n { flush: \"post\" }\n );\n\n onScopeDispose(() => {\n generation++;\n componentRef.value = null;\n api.value = null;\n ready.value = false;\n });\n\n return { ref: componentRef, api, ready };\n}\n","import { MachTable, RobotGrid } from \"./MachTable\";\nimport { MachTablePlugin } from \"./plugin\";\n\nexport { MachTable, RobotGrid };\nexport type { MachTableVueProps, RobotGridVueProps } from \"./MachTable\";\nexport {\n vueCellEditorSlot,\n vueCellRenderer,\n vueCellSlotRenderer,\n vueDetailRenderer,\n vueDetailSlotRenderer,\n vueHeaderSlotRenderer,\n vueOverlaySlot\n} from \"./adapters\";\nexport { useMachTable } from \"./useMachTable\";\nexport type { UseMachTableReturn } from \"./useMachTable\";\nexport { useMachTableEditing } from \"./useMachTableEditing\";\nexport type {\n UseMachTableEditingOptions,\n UseMachTableEditingReturn\n} from \"./useMachTableEditing\";\nexport { useMachTableQuery } from \"./useMachTableQuery\";\nexport type {\n MachTablePageRequest,\n MachTablePageResult,\n MachTableQuerySource,\n MachTableRemoteSelectionState,\n UseMachTableQueryOptions,\n UseMachTableQueryReturn\n} from \"./useMachTableQuery\";\nexport type { VueCellRendererProps } from \"./adapters\";\nexport type { VueCellEditorSlotProps } from \"./adapters\";\nexport { applyVueSlots, createVueSlotEnhancer } from \"./slots\";\nexport type { MachTableVueSlots } from \"./slots\";\nexport { MachTablePlugin } from \"./plugin\";\nexport type { MachTablePluginOptions } from \"./plugin\";\nexport {\n MACH_TABLE_CONFIG_KEY,\n MACH_TABLE_DEFAULTS_KEY,\n provideMachTableConfig,\n provideMachTableDefaults,\n useMachTableConfig,\n useMachTableDefaults\n} from \"./defaults\";\nexport type { MachTableConfigSource } from \"./defaults\";\nexport {\n defineMachTableConfig,\n mergeMachTableConfig,\n normalizeMachTableConfig,\n resolveMachTableGridOptions\n} from \"./configuration\";\nexport type {\n MachTableConfigWarning,\n MachTableOptionExplanation,\n MachTablePresetSelection,\n MachTableRuntimeConfig,\n ResolvedMachTableConfig,\n ResolvedMachTableGridOptions\n} from \"./configuration\";\nexport * from \"@agile-team/mach-table\";\n\nexport default MachTablePlugin;\n"],"mappings":"4SAIO,IAAMA,EAAkB,CAC7B,QAAQC,EAAUC,EAAwC,CACxDC,EAAwBF,EAAKG,EAAWF,CAAO,CACjD,CACF,ECRA,OAAS,kBAAAG,EAAgB,OAAAC,EAAK,cAAAC,EAAY,SAAAC,MAAwC,MAS3E,SAASC,GAAuD,CACrE,IAAMC,EAAeJ,EAAS,IAAI,EAC5BK,EAAMJ,EAAkC,IAAI,EAC5CK,EAAQL,EAAW,EAAK,EAC1BM,EAAa,EAEjB,OAAAL,EACEE,EACCI,GAAS,CACR,IAAMC,EAAoB,EAAEF,EAC5B,GAAIC,GAAQ,OAAOA,EAAK,QAAW,WAAY,CAC7CH,EAAI,MAAQG,EAAK,OAAO,EACxBF,EAAM,MAAQ,GACd,IAAMI,EAAaL,EAAI,MACnBK,GACGA,EAAW,UAAU,EAAE,KAAK,IAAM,CACjCH,IAAeE,GAAqBJ,EAAI,QAAUK,GAAc,CAACA,EAAW,YAAY,IAC1FJ,EAAM,MAAQ,GAElB,CAAC,CAEL,MACED,EAAI,MAAQ,KACZC,EAAM,MAAQ,EAElB,EACA,CAAE,MAAO,MAAO,CAClB,EAEAP,EAAe,IAAM,CACnBQ,IACAH,EAAa,MAAQ,KACrBC,EAAI,MAAQ,KACZC,EAAM,MAAQ,EAChB,CAAC,EAEM,CAAE,IAAKF,EAAc,IAAAC,EAAK,MAAAC,CAAM,CACzC,CCaA,WAAc,yBAEd,IAAOK,EAAQC","names":["MachTablePlugin","app","options","registerGlobalMachTable","MachTable","onScopeDispose","ref","shallowRef","watch","useMachTable","componentRef","api","ready","generation","comp","currentGeneration","currentApi","src_default","MachTablePlugin"]}