@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.
- package/LICENSE +110 -21
- package/README.md +61 -6
- package/dist/MachTable-ESOIV4CZ.cjs +2 -0
- package/dist/MachTable-ESOIV4CZ.cjs.map +1 -0
- package/dist/MachTable-USYTNQV5.js +2 -0
- package/dist/async.cjs +1 -22
- package/dist/async.cjs.map +1 -1
- package/dist/async.d.cts +19 -6
- package/dist/async.d.ts +19 -6
- package/dist/async.js +1 -22
- package/dist/async.js.map +1 -1
- package/dist/chunk-7U5IML5K.js +2 -0
- package/dist/chunk-7U5IML5K.js.map +1 -0
- package/dist/chunk-BE4RGLUC.cjs +2 -0
- package/dist/chunk-BE4RGLUC.cjs.map +1 -0
- package/dist/chunk-E7KTBMM6.js +2 -0
- package/dist/chunk-E7KTBMM6.js.map +1 -0
- package/dist/chunk-ICHFPO5U.js +2 -0
- package/dist/chunk-ICHFPO5U.js.map +1 -0
- package/dist/chunk-MVK2O7FM.cjs +2 -0
- package/dist/chunk-MVK2O7FM.cjs.map +1 -0
- package/dist/chunk-Y6OAV3U4.cjs +2 -0
- package/dist/chunk-Y6OAV3U4.cjs.map +1 -0
- package/dist/chunk-Z6YS22CL.cjs +2 -0
- package/dist/chunk-Z6YS22CL.cjs.map +1 -0
- package/dist/chunk-ZUOKB5ID.js +2 -0
- package/dist/chunk-ZUOKB5ID.js.map +1 -0
- package/dist/editors.cjs +2 -0
- package/dist/editors.cjs.map +1 -0
- package/dist/editors.d.cts +34 -0
- package/dist/editors.d.ts +34 -0
- package/dist/editors.js +2 -0
- package/dist/editors.js.map +1 -0
- package/dist/globalRegistration-ySQgs7aA.d.cts +86 -0
- package/dist/globalRegistration-ySQgs7aA.d.ts +86 -0
- package/dist/index.cjs +1 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -12
- package/dist/index.d.ts +54 -12
- package/dist/index.js +1 -110
- package/dist/index.js.map +1 -1
- package/dist/mach-table.css +410 -3
- package/dist/workflows-Dg6KsN85.d.cts +111 -0
- package/dist/workflows-Dg6KsN85.d.ts +111 -0
- package/dist/workflows.cjs +2 -0
- package/dist/workflows.cjs.map +1 -0
- package/dist/workflows.d.cts +3 -0
- package/dist/workflows.d.ts +3 -0
- package/dist/workflows.js +2 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +24 -4
- package/dist/RobotGrid-2KWWM4C4.js +0 -7
- package/dist/RobotGrid-LELHEO4W.cjs +0 -7
- package/dist/RobotGrid-LELHEO4W.cjs.map +0 -1
- package/dist/chunk-345ZEGIE.cjs +0 -21
- package/dist/chunk-345ZEGIE.cjs.map +0 -1
- package/dist/chunk-CHEQLQW4.js +0 -78
- package/dist/chunk-CHEQLQW4.js.map +0 -1
- package/dist/chunk-JJQDDIQU.js +0 -21
- package/dist/chunk-JJQDDIQU.js.map +0 -1
- package/dist/chunk-S3NR7DIG.cjs +0 -78
- package/dist/chunk-S3NR7DIG.cjs.map +0 -1
- package/dist/globalRegistration-CQ2dTNzy.d.cts +0 -25
- package/dist/globalRegistration-CQ2dTNzy.d.ts +0 -25
- /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]}); }); }
|
|
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
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["d:\\office-project\\wl\\MachTable\\packages\\vue\\dist\\index.cjs"],"names":[],"mappings":"AAAA
|
|
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 {
|
|
2
|
-
export {
|
|
3
|
-
import { App,
|
|
4
|
-
import { CellRendererParams, CellRendererFn, DetailRowRendererParams,
|
|
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:
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
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
|
|
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 {
|
|
2
|
-
export {
|
|
3
|
-
import { App,
|
|
4
|
-
import { CellRendererParams, CellRendererFn, DetailRowRendererParams,
|
|
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:
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
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
|
|
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/
|
|
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"]}
|