@agile-team/mach-table-vue 0.19.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -111
- package/dist/MachTable-AXAVVKW5.cjs +1 -0
- package/dist/MachTable-PX2BHIPK.js +1 -0
- package/dist/{MachTable-DH0offab.d.cts → MachTable-jS92BIXm.d.cts} +3 -6
- package/dist/{MachTable-DH0offab.d.ts → MachTable-jS92BIXm.d.ts} +3 -6
- package/dist/adapters.cjs +1 -0
- package/dist/adapters.d.cts +53 -0
- package/dist/adapters.d.ts +53 -0
- package/dist/adapters.js +1 -0
- package/dist/async.cjs +1 -2
- package/dist/async.d.cts +4 -3
- package/dist/async.d.ts +4 -3
- package/dist/async.js +1 -2
- package/dist/chunk-3LIWCBSP.cjs +1 -0
- package/dist/chunk-7LXDVLDD.cjs +1 -0
- package/dist/chunk-7MRR4IDI.js +1 -0
- package/dist/chunk-CVSAWAOZ.js +1 -0
- package/dist/chunk-EGEQGM3D.cjs +1 -0
- package/dist/chunk-IS6G3WLH.js +1 -0
- package/dist/chunk-OFITMI6J.cjs +1 -0
- package/dist/chunk-SQVY5G55.js +1 -0
- package/dist/chunk-XECIDGIZ.cjs +1 -0
- package/dist/chunk-YTEW56VQ.js +1 -0
- package/dist/editors.cjs +0 -1
- package/dist/editors.js +0 -1
- package/dist/globalRegistration-bUvkfBzA.d.ts +13 -0
- package/dist/globalRegistration-oxdZVSgD.d.cts +13 -0
- package/dist/index.cjs +1 -2
- package/dist/index.d.cts +8 -60
- package/dist/index.d.ts +8 -60
- package/dist/index.js +1 -2
- package/dist/ui.cjs +1 -2
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -2
- package/dist/useMachTable-DXGZxgIJ.d.ts +12 -0
- package/dist/useMachTable-YH4Xj6dS.d.cts +12 -0
- package/dist/worker.cjs +0 -1
- package/dist/worker.js +0 -1
- package/dist/workflows.cjs +1 -2
- package/dist/workflows.d.cts +139 -4
- package/dist/workflows.d.ts +139 -4
- package/dist/workflows.js +1 -2
- package/package.json +13 -3
- package/dist/MachTable-7H7Z4ACQ.cjs +0 -2
- package/dist/MachTable-7H7Z4ACQ.cjs.map +0 -1
- package/dist/MachTable-CIBYH7LC.js +0 -2
- package/dist/MachTable-CIBYH7LC.js.map +0 -1
- package/dist/async.cjs.map +0 -1
- package/dist/async.js.map +0 -1
- package/dist/chunk-BW56NYGC.cjs +0 -2
- package/dist/chunk-BW56NYGC.cjs.map +0 -1
- package/dist/chunk-HBEB7H4E.js +0 -2
- package/dist/chunk-HBEB7H4E.js.map +0 -1
- package/dist/chunk-IZZT6PAH.js +0 -2
- package/dist/chunk-IZZT6PAH.js.map +0 -1
- package/dist/chunk-MCLI6WUN.cjs +0 -2
- package/dist/chunk-MCLI6WUN.cjs.map +0 -1
- package/dist/chunk-P7PVLT5L.js +0 -2
- package/dist/chunk-P7PVLT5L.js.map +0 -1
- package/dist/chunk-PPNQWKVV.cjs +0 -2
- package/dist/chunk-PPNQWKVV.cjs.map +0 -1
- package/dist/chunk-SUSVK2OW.js +0 -2
- package/dist/chunk-SUSVK2OW.js.map +0 -1
- package/dist/chunk-UST6E3TU.cjs +0 -2
- package/dist/chunk-UST6E3TU.cjs.map +0 -1
- package/dist/editors.cjs.map +0 -1
- package/dist/editors.js.map +0 -1
- package/dist/globalRegistration-BhAR-B5k.d.cts +0 -19
- package/dist/globalRegistration-DTWLNxPI.d.ts +0 -19
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.js.map +0 -1
- package/dist/worker.cjs.map +0 -1
- package/dist/worker.js.map +0 -1
- package/dist/workflows-CyXKgNRx.d.ts +0 -145
- package/dist/workflows-DEOJrSuj.d.cts +0 -145
- package/dist/workflows.cjs.map +0 -1
- package/dist/workflows.js.map +0 -1
- package/dist/{MachTableToolbar-CDkTtitl.d.cts → MachTableToolbar-BUFcnsF4.d.cts} +1 -1
- package/dist/{MachTableToolbar-CDkTtitl.d.ts → MachTableToolbar-BUFcnsF4.d.ts} +1 -1
package/README.md
CHANGED
|
@@ -4,31 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
# @agile-team/mach-table-vue
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Install
|
|
7
|
+
MachTable 0.24 的官方 Vue 3 适配包。一个依赖即可获得 Core、泛型 `<MachTable>`、原生 slots、应用/路由配置、按需工作流、异步组件边界和自动生命周期清理。
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
10
|
pnpm add @agile-team/mach-table-vue
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
应用入口只引入一次样式:
|
|
16
14
|
|
|
17
15
|
```ts
|
|
18
16
|
import "@agile-team/mach-table-vue/styles.css";
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { createWorkerDataProcessor } from "@agile-team/mach-table-vue/worker";
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Integration modes
|
|
28
|
-
|
|
29
|
-
### Local, route-level import
|
|
30
|
-
|
|
31
|
-
Best when only a few routes use a grid. A lazy-loaded route naturally keeps MachTable in that route's chunk.
|
|
19
|
+
## 局部接入
|
|
32
20
|
|
|
33
21
|
```vue
|
|
34
22
|
<script setup lang="ts">
|
|
@@ -36,149 +24,87 @@ import { ref } from "vue";
|
|
|
36
24
|
import { MachTable, useMachTable, type ColDef } from "@agile-team/mach-table-vue";
|
|
37
25
|
|
|
38
26
|
interface Row { id: string; name: string }
|
|
39
|
-
const
|
|
27
|
+
const table = useMachTable<Row>();
|
|
40
28
|
const rows = ref<Row[]>([{ id: "1", name: "MachTable" }]);
|
|
41
|
-
const columns: ColDef<Row>[] = [{ field: "name",
|
|
29
|
+
const columns: ColDef<Row>[] = [{ field: "name", flex: 1, editable: true }];
|
|
42
30
|
</script>
|
|
43
31
|
|
|
44
32
|
<template>
|
|
45
33
|
<div style="height: 520px">
|
|
46
34
|
<MachTable
|
|
47
|
-
:ref="
|
|
35
|
+
:ref="table.ref"
|
|
48
36
|
:row-data="rows"
|
|
49
37
|
:column-defs="columns"
|
|
50
38
|
row-key="id"
|
|
51
|
-
state-key="customer-list"
|
|
52
39
|
enable-column-resize
|
|
53
|
-
|
|
40
|
+
:persistence="{ key: 'customers:list', sections: ['columns'] }"
|
|
54
41
|
/>
|
|
55
42
|
</div>
|
|
56
43
|
</template>
|
|
57
44
|
```
|
|
58
45
|
|
|
59
|
-
|
|
46
|
+
## 全局接入
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
表格页面较多时,全局注册一次,页面模板直接使用 `<MachTable>`:
|
|
62
49
|
|
|
63
50
|
```ts
|
|
64
|
-
// main.ts
|
|
65
51
|
import { createApp } from "vue";
|
|
66
52
|
import { MachTablePlugin } from "@agile-team/mach-table-vue";
|
|
67
|
-
import "
|
|
68
|
-
import App from "./App.vue";
|
|
53
|
+
import machTableConfig from "@/config/mach-table.config";
|
|
69
54
|
|
|
70
|
-
createApp(App).use(MachTablePlugin).mount("#app");
|
|
55
|
+
createApp(App).use(MachTablePlugin, machTableConfig).mount("#app");
|
|
71
56
|
```
|
|
72
57
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Best for large admin or low-code applications. The plugin is registered at startup, while the component and Core stay in a separate chunk until the first `<MachTable>` is rendered.
|
|
58
|
+
需要减少首屏代码时改用异步全局插件:
|
|
76
59
|
|
|
77
60
|
```ts
|
|
78
|
-
// main.ts
|
|
79
|
-
import { createApp } from "vue";
|
|
80
61
|
import AsyncMachTablePlugin, { preloadMachTable } from "@agile-team/mach-table-vue/async";
|
|
81
|
-
import "@agile-team/mach-table-vue/styles.css";
|
|
82
|
-
import App from "./App.vue";
|
|
83
|
-
|
|
84
|
-
createApp(App).use(AsyncMachTablePlugin).mount("#app");
|
|
85
|
-
|
|
86
|
-
// Optional route-hover prefetch; dynamic imports are cached and idempotent.
|
|
87
|
-
void preloadMachTable();
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The standard toolbar is a separate, tree-shakeable entry. Register it globally only when needed:
|
|
91
62
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
app.use(MachTableUiPlugin);
|
|
63
|
+
app.use(AsyncMachTablePlugin, machTableConfig);
|
|
64
|
+
void preloadMachTable(); // 可选:路由 hover 时预取
|
|
95
65
|
```
|
|
96
66
|
|
|
97
|
-
|
|
67
|
+
推荐把约定集中到独立文件:
|
|
98
68
|
|
|
99
69
|
```ts
|
|
100
|
-
// mach-table.config.ts
|
|
70
|
+
// src/config/mach-table.config.ts
|
|
101
71
|
import { defineMachTableConfig, defineMachTablePreset } from "@agile-team/mach-table-vue";
|
|
72
|
+
|
|
102
73
|
export default defineMachTableConfig({
|
|
103
74
|
defaults: {
|
|
104
75
|
size: "compact",
|
|
76
|
+
columnLayout: "fit",
|
|
105
77
|
enableColumnResize: true,
|
|
106
|
-
|
|
107
|
-
defaultColDef: { sortable: true, resizable: true, filter: true }
|
|
78
|
+
defaultColDef: { sortable: true, filter: true, resizable: true }
|
|
108
79
|
},
|
|
109
80
|
defaultPreset: "list",
|
|
110
|
-
presets: {
|
|
81
|
+
presets: {
|
|
82
|
+
list: defineMachTablePreset({ stripedRows: true }),
|
|
83
|
+
crud: defineMachTablePreset({ rowSelection: "multiple", editType: "fullRow" })
|
|
84
|
+
}
|
|
111
85
|
});
|
|
112
|
-
|
|
113
|
-
// main.ts
|
|
114
|
-
app.use(MachTablePlugin, machTableConfig);
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Layouts can reactively refine defaults and presets with `provideMachTableConfig(...)`; direct table props always win. `provideMachTableDefaults(...)` remains as a smaller compatibility API. The async plugin also accepts `asyncComponentOptions` with `loadingComponent`, `errorComponent`, `delay`, `timeout` and `onError`.
|
|
118
|
-
|
|
119
|
-
The adapter installs the matching `@agile-team/mach-table` core automatically and re-exports its complete API and types. Only `vue >= 3.2` remains a peer dependency supplied by the host application. Existing local imports remain fully supported.
|
|
120
|
-
|
|
121
|
-
Remote B-side lists can bind `useMachTableQuery()` directly. Use `mode: "auto"` for live filters or `mode: "manual"` for a submit-to-search form. For the smallest composable-only chunk, import query/editing/controller helpers from `@agile-team/mach-table-vue/workflows`. They own controlled server pagination, AbortSignal cancellation, stale-response protection, retry state and cross-page selection without exposing `gridApi` to ordinary pages.
|
|
122
|
-
|
|
123
|
-
`useMachTableController()` composes table readiness, query, editing, selection, errors and standard commands. Pair it with `MachTableToolbar` from `/ui`, or bind `controller.commands` to your own design-system toolbar.
|
|
124
|
-
|
|
125
|
-
Million-row batch actions use `selectionScope: "query"` and compact `allMatching + excludedKeys` rules, so clients never download every matching row ID.
|
|
126
|
-
|
|
127
|
-
`useMachTableEditing()` exposes reactive dirty changes, detailed partial-save results, validation failures, version conflicts, failed-row reveal, rollback and an optional unsaved-page guard. `lastSaveResult`, `saveIssues`, `failedRowIds` and `resolveConflict()` keep page code small while preserving explicit business decisions. Semantic business types and cached dictionaries are configured once with `createBusinessColumnTypes()` and `createCachedDictionary()`.
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
const editing = useMachTableEditing(grid, { guardBeforeUnload: true });
|
|
131
|
-
const result = await editing.saveDetailed(orderApi.saveChanges);
|
|
132
|
-
if (result.conflicts.length) editing.reveal(result.conflicts[0].rowId);
|
|
133
|
-
|
|
134
|
-
async function saveCurrentView() {
|
|
135
|
-
if (!grid.api.value) return;
|
|
136
|
-
const views = createGridViewManager(grid.api.value, {
|
|
137
|
-
scope: `${tenantId}:${userId}:orders`
|
|
138
|
-
});
|
|
139
|
-
await views.save("My pending orders");
|
|
140
|
-
}
|
|
141
86
|
```
|
|
142
87
|
|
|
143
|
-
|
|
88
|
+
布局或路由可用响应式 `provideMachTableConfig()` 叠加配置,表格 props 始终拥有最高优先级。
|
|
144
89
|
|
|
145
|
-
|
|
90
|
+
## 按需子入口
|
|
146
91
|
|
|
147
92
|
```ts
|
|
93
|
+
import { useMachTableQuery, useMachTableEditing } from "@agile-team/mach-table-vue/workflows";
|
|
94
|
+
import { MachTableToolbar } from "@agile-team/mach-table-vue/ui";
|
|
95
|
+
import { vueCellRenderer } from "@agile-team/mach-table-vue/adapters";
|
|
148
96
|
import { createElementPlusEditors } from "@agile-team/mach-table-vue/editors";
|
|
149
|
-
|
|
150
|
-
const ep = createElementPlusEditors({
|
|
151
|
-
input: ElInput,
|
|
152
|
-
inputNumber: ElInputNumber,
|
|
153
|
-
select: ElSelect,
|
|
154
|
-
datePicker: ElDatePicker
|
|
155
|
-
});
|
|
97
|
+
import { createWorkerDataProcessor } from "@agile-team/mach-table-vue/worker";
|
|
156
98
|
```
|
|
157
99
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```vue
|
|
165
|
-
<script setup lang="ts">
|
|
166
|
-
import { rowActionsColumn } from "@agile-team/mach-table-vue";
|
|
167
|
-
|
|
168
|
-
const columns = [
|
|
169
|
-
{ field: "name", editable: true },
|
|
170
|
-
{ field: "age", editable: true, cellEditor: "number" },
|
|
171
|
-
rowActionsColumn({ onView, onDelete, overflow: "drawer" })
|
|
172
|
-
];
|
|
173
|
-
</script>
|
|
174
|
-
|
|
175
|
-
<template>
|
|
176
|
-
<MachTable edit-type="fullRow" :column-defs="columns" :row-data="rows" />
|
|
177
|
-
</template>
|
|
178
|
-
```
|
|
100
|
+
- `/workflows`:请求取消、防过期覆盖、服务端分页、跨页选择、脏数据和冲突保存。
|
|
101
|
+
- `/ui`:可选标准工具栏;需要全局组件时另行 `app.use(MachTableUiPlugin)`。
|
|
102
|
+
- `/adapters`:自定义 Vue renderer/editor/detail/overlay 桥接。
|
|
103
|
+
- `/editors`:可选 Element Plus 编辑器,Element Plus 由宿主注入。
|
|
104
|
+
- `/worker`:大型本地过滤/排序的独立 Worker 能力。
|
|
179
105
|
|
|
180
|
-
|
|
106
|
+
该包自动依赖 `@agile-team/mach-table` 并重导出 Core 类型;宿主只需提供 `vue >= 3.2`。
|
|
181
107
|
|
|
182
|
-
|
|
108
|
+
文档:[Vue 指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/vue.md) · [企业接入](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/enterprise-integration.md) · [配置中心](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/configuration.md)
|
|
183
109
|
|
|
184
|
-
Source-available © ChenyCHENYU (Agile Team).
|
|
110
|
+
Source-available © ChenyCHENYU (Agile Team). 任何使用均须事先取得书面授权。详见 [LICENSE](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSE) 与[授权流程](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSING.md)。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3LIWCBSPcjs = require('./chunk-3LIWCBSP.cjs');require('./chunk-7LXDVLDD.cjs');require('./chunk-XECIDGIZ.cjs');exports.MachTable = _chunk3LIWCBSPcjs.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-IS6G3WLH.js";import"./chunk-7MRR4IDI.js";import"./chunk-SQVY5G55.js";export{a as MachTable};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DefineComponent } from 'vue';
|
|
2
|
-
import { GridOptions, MachTablePresetSelection, GridApi
|
|
2
|
+
import { GridOptions, MachTablePresetSelection, GridApi } from '@agile-team/mach-table';
|
|
3
|
+
import { MachTableOptionExplanation } from '@agile-team/mach-table/adapter';
|
|
3
4
|
|
|
4
5
|
type AdapterOnlyGridOption = "className" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy";
|
|
5
6
|
type MachTableVueProps<TData = any> = Omit<GridOptions<TData>, AdapterOnlyGridOption> & {
|
|
@@ -26,9 +27,5 @@ interface MachTableVueComponent extends DefineComponent<MachTableVueProps<any>>
|
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
declare const MachTable: MachTableVueComponent;
|
|
29
|
-
/** @deprecated Use MachTable. Kept as a source-compatible alias through 0.x. */
|
|
30
|
-
declare const RobotGrid: MachTableVueComponent;
|
|
31
|
-
/** @deprecated Use MachTableVueProps. */
|
|
32
|
-
type RobotGridVueProps<TData = any> = MachTableVueProps<TData>;
|
|
33
30
|
|
|
34
|
-
export { type MachTableVueComponent as M,
|
|
31
|
+
export { type MachTableVueComponent as M, MachTable as a, type MachTableVueExposed as b, type MachTableVueProps as c };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DefineComponent } from 'vue';
|
|
2
|
-
import { GridOptions, MachTablePresetSelection, GridApi
|
|
2
|
+
import { GridOptions, MachTablePresetSelection, GridApi } from '@agile-team/mach-table';
|
|
3
|
+
import { MachTableOptionExplanation } from '@agile-team/mach-table/adapter';
|
|
3
4
|
|
|
4
5
|
type AdapterOnlyGridOption = "className" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy";
|
|
5
6
|
type MachTableVueProps<TData = any> = Omit<GridOptions<TData>, AdapterOnlyGridOption> & {
|
|
@@ -26,9 +27,5 @@ interface MachTableVueComponent extends DefineComponent<MachTableVueProps<any>>
|
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
declare const MachTable: MachTableVueComponent;
|
|
29
|
-
/** @deprecated Use MachTable. Kept as a source-compatible alias through 0.x. */
|
|
30
|
-
declare const RobotGrid: MachTableVueComponent;
|
|
31
|
-
/** @deprecated Use MachTableVueProps. */
|
|
32
|
-
type RobotGridVueProps<TData = any> = MachTableVueProps<TData>;
|
|
33
30
|
|
|
34
|
-
export { type MachTableVueComponent as M,
|
|
31
|
+
export { type MachTableVueComponent as M, MachTable as a, type MachTableVueExposed as b, type MachTableVueProps as c };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXECIDGIZcjs = require('./chunk-XECIDGIZ.cjs');exports.applyVueSlots = _chunkXECIDGIZcjs.h; exports.createVueSlotEnhancer = _chunkXECIDGIZcjs.i; exports.vueCellEditorSlot = _chunkXECIDGIZcjs.e; exports.vueCellRenderer = _chunkXECIDGIZcjs.a; exports.vueCellSlotRenderer = _chunkXECIDGIZcjs.c; exports.vueDetailRenderer = _chunkXECIDGIZcjs.b; exports.vueDetailSlotRenderer = _chunkXECIDGIZcjs.f; exports.vueHeaderSlotRenderer = _chunkXECIDGIZcjs.d; exports.vueOverlaySlot = _chunkXECIDGIZcjs.g;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Slot, AppContext, Component, Slots } from 'vue';
|
|
2
|
+
import { CellEditorParams, CellRendererParams, CellEditorFactory, CellRendererFn, DetailRowRendererParams, ICellRendererResult, HeaderComponentParams, OverlayTemplate, GridOptions } from '@agile-team/mach-table';
|
|
3
|
+
|
|
4
|
+
type VueCellRendererProps<TData = any, TValue = any> = CellRendererParams<TData, TValue>;
|
|
5
|
+
declare function vueCellRenderer<TData = any, TValue = any>(component: Component, options?: {
|
|
6
|
+
appContext?: AppContext;
|
|
7
|
+
}): CellRendererFn;
|
|
8
|
+
declare function vueDetailRenderer<TData = any>(component: Component, options?: {
|
|
9
|
+
appContext?: AppContext;
|
|
10
|
+
}): (params: DetailRowRendererParams<TData>) => {
|
|
11
|
+
el: HTMLElement;
|
|
12
|
+
destroy?: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** Internal/public bridge used by automatic `#cell-*` Vue slots. */
|
|
15
|
+
declare function vueCellSlotRenderer<TData = any, TValue = any>(slot: Slot, options?: {
|
|
16
|
+
appContext?: AppContext;
|
|
17
|
+
}): CellRendererFn;
|
|
18
|
+
declare function vueHeaderSlotRenderer<TData = any>(slot: Slot, options?: {
|
|
19
|
+
appContext?: AppContext;
|
|
20
|
+
}): (params: HeaderComponentParams<TData>) => ICellRendererResult;
|
|
21
|
+
interface VueCellEditorSlotProps<TData = any, TValue = any> extends CellEditorParams<TData, TValue> {
|
|
22
|
+
value: TValue;
|
|
23
|
+
setValue(value: TValue): void;
|
|
24
|
+
commit(): void;
|
|
25
|
+
cancel(): void;
|
|
26
|
+
}
|
|
27
|
+
declare function vueCellEditorSlot<TData = any, TValue = any>(slot: Slot, options?: {
|
|
28
|
+
appContext?: AppContext;
|
|
29
|
+
}): CellEditorFactory;
|
|
30
|
+
declare function vueDetailSlotRenderer<TData = any>(slot: Slot, options?: {
|
|
31
|
+
appContext?: AppContext;
|
|
32
|
+
}): (params: DetailRowRendererParams<TData>) => ICellRendererResult;
|
|
33
|
+
declare function vueOverlaySlot(slot: Slot, options?: {
|
|
34
|
+
appContext?: AppContext;
|
|
35
|
+
}): OverlayTemplate;
|
|
36
|
+
|
|
37
|
+
interface MachTableVueSlots<TData = any> {
|
|
38
|
+
cell?: (props: CellRendererParams<TData>) => any;
|
|
39
|
+
header?: (props: HeaderComponentParams<TData>) => any;
|
|
40
|
+
editor?: (props: VueCellEditorSlotProps<TData>) => any;
|
|
41
|
+
detail?: (props: DetailRowRendererParams<TData>) => any;
|
|
42
|
+
loading?: () => any;
|
|
43
|
+
empty?: () => any;
|
|
44
|
+
actions?: (props: CellRendererParams<TData>) => any;
|
|
45
|
+
[name: `cell-${string}`]: ((props: CellRendererParams<TData>) => any) | undefined;
|
|
46
|
+
[name: `header-${string}`]: ((props: HeaderComponentParams<TData>) => any) | undefined;
|
|
47
|
+
[name: `editor-${string}`]: ((props: CellEditorParams<TData>) => any) | undefined;
|
|
48
|
+
}
|
|
49
|
+
declare function applyVueSlots<TData>(options: GridOptions<TData>, slots: Slots, appContext?: AppContext): GridOptions<TData>;
|
|
50
|
+
/** Creates a stable enhancer so unrelated reactive prop updates do not rebuild columns. */
|
|
51
|
+
declare function createVueSlotEnhancer<TData>(slots: Slots, appContext?: AppContext): (options: GridOptions<TData>) => GridOptions<TData>;
|
|
52
|
+
|
|
53
|
+
export { type MachTableVueSlots, type VueCellEditorSlotProps, type VueCellRendererProps, applyVueSlots, createVueSlotEnhancer, vueCellEditorSlot, vueCellRenderer, vueCellSlotRenderer, vueDetailRenderer, vueDetailSlotRenderer, vueHeaderSlotRenderer, vueOverlaySlot };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Slot, AppContext, Component, Slots } from 'vue';
|
|
2
|
+
import { CellEditorParams, CellRendererParams, CellEditorFactory, CellRendererFn, DetailRowRendererParams, ICellRendererResult, HeaderComponentParams, OverlayTemplate, GridOptions } from '@agile-team/mach-table';
|
|
3
|
+
|
|
4
|
+
type VueCellRendererProps<TData = any, TValue = any> = CellRendererParams<TData, TValue>;
|
|
5
|
+
declare function vueCellRenderer<TData = any, TValue = any>(component: Component, options?: {
|
|
6
|
+
appContext?: AppContext;
|
|
7
|
+
}): CellRendererFn;
|
|
8
|
+
declare function vueDetailRenderer<TData = any>(component: Component, options?: {
|
|
9
|
+
appContext?: AppContext;
|
|
10
|
+
}): (params: DetailRowRendererParams<TData>) => {
|
|
11
|
+
el: HTMLElement;
|
|
12
|
+
destroy?: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** Internal/public bridge used by automatic `#cell-*` Vue slots. */
|
|
15
|
+
declare function vueCellSlotRenderer<TData = any, TValue = any>(slot: Slot, options?: {
|
|
16
|
+
appContext?: AppContext;
|
|
17
|
+
}): CellRendererFn;
|
|
18
|
+
declare function vueHeaderSlotRenderer<TData = any>(slot: Slot, options?: {
|
|
19
|
+
appContext?: AppContext;
|
|
20
|
+
}): (params: HeaderComponentParams<TData>) => ICellRendererResult;
|
|
21
|
+
interface VueCellEditorSlotProps<TData = any, TValue = any> extends CellEditorParams<TData, TValue> {
|
|
22
|
+
value: TValue;
|
|
23
|
+
setValue(value: TValue): void;
|
|
24
|
+
commit(): void;
|
|
25
|
+
cancel(): void;
|
|
26
|
+
}
|
|
27
|
+
declare function vueCellEditorSlot<TData = any, TValue = any>(slot: Slot, options?: {
|
|
28
|
+
appContext?: AppContext;
|
|
29
|
+
}): CellEditorFactory;
|
|
30
|
+
declare function vueDetailSlotRenderer<TData = any>(slot: Slot, options?: {
|
|
31
|
+
appContext?: AppContext;
|
|
32
|
+
}): (params: DetailRowRendererParams<TData>) => ICellRendererResult;
|
|
33
|
+
declare function vueOverlaySlot(slot: Slot, options?: {
|
|
34
|
+
appContext?: AppContext;
|
|
35
|
+
}): OverlayTemplate;
|
|
36
|
+
|
|
37
|
+
interface MachTableVueSlots<TData = any> {
|
|
38
|
+
cell?: (props: CellRendererParams<TData>) => any;
|
|
39
|
+
header?: (props: HeaderComponentParams<TData>) => any;
|
|
40
|
+
editor?: (props: VueCellEditorSlotProps<TData>) => any;
|
|
41
|
+
detail?: (props: DetailRowRendererParams<TData>) => any;
|
|
42
|
+
loading?: () => any;
|
|
43
|
+
empty?: () => any;
|
|
44
|
+
actions?: (props: CellRendererParams<TData>) => any;
|
|
45
|
+
[name: `cell-${string}`]: ((props: CellRendererParams<TData>) => any) | undefined;
|
|
46
|
+
[name: `header-${string}`]: ((props: HeaderComponentParams<TData>) => any) | undefined;
|
|
47
|
+
[name: `editor-${string}`]: ((props: CellEditorParams<TData>) => any) | undefined;
|
|
48
|
+
}
|
|
49
|
+
declare function applyVueSlots<TData>(options: GridOptions<TData>, slots: Slots, appContext?: AppContext): GridOptions<TData>;
|
|
50
|
+
/** Creates a stable enhancer so unrelated reactive prop updates do not rebuild columns. */
|
|
51
|
+
declare function createVueSlotEnhancer<TData>(slots: Slots, appContext?: AppContext): (options: GridOptions<TData>) => GridOptions<TData>;
|
|
52
|
+
|
|
53
|
+
export { type MachTableVueSlots, type VueCellEditorSlotProps, type VueCellRendererProps, applyVueSlots, createVueSlotEnhancer, vueCellEditorSlot, vueCellRenderer, vueCellSlotRenderer, vueDetailRenderer, vueDetailSlotRenderer, vueHeaderSlotRenderer, vueOverlaySlot };
|
package/dist/adapters.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as r,c as l,d as o,e as t,f as u,g as a,h as p,i as d}from"./chunk-SQVY5G55.js";export{p as applyVueSlots,d as createVueSlotEnhancer,t as vueCellEditorSlot,e as vueCellRenderer,l as vueCellSlotRenderer,r as vueDetailRenderer,u as vueDetailSlotRenderer,o as vueHeaderSlotRenderer,a as vueOverlaySlot};
|
package/dist/async.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var
|
|
2
|
-
//# sourceMappingURL=async.cjs.map
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkOFITMI6Jcjs = require('./chunk-OFITMI6J.cjs');require('./chunk-7LXDVLDD.cjs');var _vue = require('vue');var p=()=>Promise.resolve().then(() => _interopRequireWildcard(require("./MachTable-AXAVVKW5.cjs"))).then(({MachTable:e})=>e);function t(e={}){return _vue.defineAsyncComponent.call(void 0, {loader:p,...e})}var c=t(),i= exports.AsyncMachTablePlugin =Object.freeze({install(e,n={}){let a=n.asyncComponentOptions?t(n.asyncComponentOptions):c;_chunkOFITMI6Jcjs.a.call(void 0, e,a,n)}}),b= exports.default =i;exports.AsyncMachTable = c; exports.AsyncMachTablePlugin = i; exports.createAsyncMachTable = t; exports.default = b; exports.preloadMachTable = p;
|
package/dist/async.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { M as MachTableVueComponent } from './MachTable-
|
|
1
|
+
import { M as MachTableVueComponent } from './MachTable-jS92BIXm.cjs';
|
|
2
2
|
import { Component, App } from 'vue';
|
|
3
|
-
import { M as MachTablePluginOptions } from './globalRegistration-
|
|
3
|
+
import { M as MachTablePluginOptions } from './globalRegistration-oxdZVSgD.cjs';
|
|
4
4
|
import '@agile-team/mach-table';
|
|
5
|
-
import '
|
|
5
|
+
import '@agile-team/mach-table/adapter';
|
|
6
|
+
import './MachTableToolbar-BUFcnsF4.cjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Starts loading the Vue adapter ahead of first render. The browser and bundler
|
package/dist/async.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { M as MachTableVueComponent } from './MachTable-
|
|
1
|
+
import { M as MachTableVueComponent } from './MachTable-jS92BIXm.js';
|
|
2
2
|
import { Component, App } from 'vue';
|
|
3
|
-
import { M as MachTablePluginOptions } from './globalRegistration-
|
|
3
|
+
import { M as MachTablePluginOptions } from './globalRegistration-bUvkfBzA.js';
|
|
4
4
|
import '@agile-team/mach-table';
|
|
5
|
-
import '
|
|
5
|
+
import '@agile-team/mach-table/adapter';
|
|
6
|
+
import './MachTableToolbar-BUFcnsF4.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Starts loading the Vue adapter ahead of first render. The browser and bundler
|
package/dist/async.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=async.js.map
|
|
1
|
+
import{a as o}from"./chunk-CVSAWAOZ.js";import"./chunk-7MRR4IDI.js";import{defineAsyncComponent as r}from"vue";var p=()=>import("./MachTable-PX2BHIPK.js").then(({MachTable:e})=>e);function t(e={}){return r({loader:p,...e})}var c=t(),i=Object.freeze({install(e,n={}){let a=n.asyncComponentOptions?t(n.asyncComponentOptions):c;o(e,a,n)}}),b=i;export{c as AsyncMachTable,i as AsyncMachTablePlugin,t as createAsyncMachTable,b as default,p as preloadMachTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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; }var _chunk7LXDVLDDcjs = require('./chunk-7LXDVLDD.cjs');var _chunkXECIDGIZcjs = require('./chunk-XECIDGIZ.cjs');var _vue = require('vue');var _machtable = require('@agile-team/mach-table');var _adapter = require('@agile-team/mach-table/adapter');var A=_adapter.GRID_OPTION_KEYS.filter(r=>!["className","ariaLabel","ariaLabelledBy","ariaDescribedBy"].includes(r)),l={};for(let r of A){let s=_adapter.GRID_OPTION_META[r].kind,c=s==="boolean"?Boolean:s==="number"?Number:s==="array"?Array:s==="function"?Function:s==="boolean-object"?[Boolean,Object]:s==="object"?Object:s==="string"?String:void 0;l[r]={type:c,default:void 0}}l.className={type:String,default:void 0};l.gridClassName={type:String,default:void 0};l.gridAriaLabel={type:String,default:void 0};l.gridAriaLabelledBy={type:String,default:void 0};l.gridAriaDescribedBy={type:String,default:void 0};l.preset={type:[String,Array,Boolean],default:void 0};function P(r){return"on"+r.charAt(0).toUpperCase()+r.slice(1)}var V=_vue.defineComponent.call(void 0, {name:"MachTable",inheritAttrs:!1,props:l,emits:[..._machtable.EVENT_TYPES],setup(r,{expose:s,attrs:c,emit:D,slots:M}){let a=r,f=_vue.ref.call(void 0, null),d=null,p=_chunk7LXDVLDDcjs.e.call(void 0, ),G=_chunkXECIDGIZcjs.i.call(void 0, M,_optionalChain([_vue.getCurrentInstance.call(void 0, ), 'optionalAccess', _ => _.appContext])),u=null,m=new Set,y=()=>{let n={};for(let e of A){let o=a[e];o!==void 0&&(n[e]=o)}a.gridClassName!==void 0&&(n.className=a.gridClassName),a.gridAriaLabel!==void 0&&(n.ariaLabel=a.gridAriaLabel),a.gridAriaLabelledBy!==void 0&&(n.ariaLabelledBy=a.gridAriaLabelledBy),a.gridAriaDescribedBy!==void 0&&(n.ariaDescribedBy=a.gridAriaDescribedBy);let t=_chunk7LXDVLDDcjs.a.call(void 0, p.value,a.preset,n,e=>{let o=`${e.code}:${_nullishCoalesce(e.preset, () => (""))}`;m.has(o)||(m.add(o),p.value.onConfigWarning?p.value.onConfigWarning(e):console.warn(e.message))}),i=G(t.options);return u={options:i,explain:e=>e==="columnDefs"&&i.columnDefs!==t.options.columnDefs?{key:e,value:i.columnDefs,source:"Vue slots",layers:[...t.explain(e).layers,{name:"Vue slots",value:i.columnDefs}]}:t.explain(e)},u.options};return _vue.onMounted.call(void 0, ()=>{if(!f.value)return;let n=y();for(let t of _machtable.EVENT_TYPES){let i=P(t),e=n[i];n[i]=o=>{typeof e=="function"&&e(o),D(t,o)}}d=_machtable.createGrid.call(void 0, f.value,n)}),_vue.onBeforeUnmount.call(void 0, ()=>{_optionalChain([d, 'optionalAccess', _2 => _2.destroy, 'call', _3 => _3()]),d=null}),_vue.watch.call(void 0, ()=>{let n=y();return[..._adapter.GRID_OPTION_KEYS.map(t=>n[t])]},(n,t)=>{if(!d)return;let i={};n.forEach((e,o)=>{if(Object.is(e,t[o]))return;let x=_adapter.GRID_OPTION_KEYS[o];i[x]=e}),Object.keys(i).length>0&&d.updateOptions(i)}),s({getApi:()=>d,getResolvedConfig:()=>_nullishCoalesce(_optionalChain([u, 'optionalAccess', _4 => _4.options]), () => (y())),explainOption:n=>(_nullishCoalesce(u, () => (_chunk7LXDVLDDcjs.a.call(void 0, p.value,a.preset,{})))).explain(n)}),()=>_vue.h.call(void 0, "div",{...c,ref:f,class:["mach-vue-host",a.className,c.class]})}}),Y= exports.a =V;exports.a = Y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _machtable = require('@agile-team/mach-table');var _adapter = require('@agile-team/mach-table/adapter');var _vue = require('vue');var o=Symbol("mach-table-config"),f=_adapter.normalizeMachTableConfig.call(void 0, );function g(e){return typeof e=="function"?e():_vue.isRef.call(void 0, e)?e.value:e}function u(e){return _vue.shallowRef.call(void 0, _adapter.normalizeMachTableConfig.call(void 0, e))}function y(e){let c=_vue.inject.call(void 0, o,_vue.shallowRef.call(void 0, f)),i=_vue.computed.call(void 0, ()=>_adapter.mergeMachTableConfig.call(void 0, c.value,g(e)));return _vue.provide.call(void 0, o,i),i}function s(){return _vue.inject.call(void 0, o,_vue.shallowRef.call(void 0, f))}exports.a = _adapter.resolveMachTableGridOptions; exports.b = o; exports.c = u; exports.d = y; exports.e = s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineMachTableConfig as p}from"@agile-team/mach-table";import{mergeMachTableConfig as t,normalizeMachTableConfig as a,resolveMachTableGridOptions as R}from"@agile-team/mach-table/adapter";import{computed as r,inject as l,isRef as b,provide as h,shallowRef as n}from"vue";var o=Symbol("mach-table-config"),f=a();function g(e){return typeof e=="function"?e():b(e)?e.value:e}function u(e){return n(a(e))}function y(e){let c=l(o,n(f)),i=r(()=>t(c.value,g(e)));return h(o,i),i}function s(){return l(o,n(f))}export{R as a,o as b,u as c,y as d,s as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,c as l}from"./chunk-7MRR4IDI.js";function i(e,a,n={}){let r=l(n);e.provide(t,r);let o=e.component("MachTable");if(o&&o!==a)throw new Error('[MachTable] Cannot register global component "MachTable" because that name is already in use.');o||e.component("MachTable",a)}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _vue = require('vue');function c(){let t=_vue.ref.call(void 0, null),e=_vue.shallowRef.call(void 0, null),a=_vue.shallowRef.call(void 0, !1),n=0;return _vue.watch.call(void 0, t,o=>{let r=++n;if(o&&typeof o.getApi=="function"){e.value=o.getApi(),a.value=!1;let l=e.value;l&&l.whenReady().then(()=>{n===r&&e.value===l&&!l.isDestroyed()&&(a.value=!0)})}else e.value=null,a.value=!1},{flush:"post"}),_vue.onScopeDispose.call(void 0, ()=>{n++,t.value=null,e.value=null,a.value=!1}),{ref:t,api:e,ready:a}}exports.a = c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g,e as h}from"./chunk-7MRR4IDI.js";import{i as O}from"./chunk-SQVY5G55.js";import{defineComponent as B,getCurrentInstance as C,h as N,onBeforeUnmount as v,onMounted as S,ref as E,watch as L}from"vue";import{createGrid as R,EVENT_TYPES as T}from"@agile-team/mach-table";import{GRID_OPTION_KEYS as b,GRID_OPTION_META as k}from"@agile-team/mach-table/adapter";var A=b.filter(r=>!["className","ariaLabel","ariaLabelledBy","ariaDescribedBy"].includes(r)),l={};for(let r of A){let s=k[r].kind,c=s==="boolean"?Boolean:s==="number"?Number:s==="array"?Array:s==="function"?Function:s==="boolean-object"?[Boolean,Object]:s==="object"?Object:s==="string"?String:void 0;l[r]={type:c,default:void 0}}l.className={type:String,default:void 0};l.gridClassName={type:String,default:void 0};l.gridAriaLabel={type:String,default:void 0};l.gridAriaLabelledBy={type:String,default:void 0};l.gridAriaDescribedBy={type:String,default:void 0};l.preset={type:[String,Array,Boolean],default:void 0};function P(r){return"on"+r.charAt(0).toUpperCase()+r.slice(1)}var V=B({name:"MachTable",inheritAttrs:!1,props:l,emits:[...T],setup(r,{expose:s,attrs:c,emit:D,slots:M}){let a=r,f=E(null),d=null,p=h(),G=O(M,C()?.appContext),u=null,m=new Set,y=()=>{let n={};for(let e of A){let o=a[e];o!==void 0&&(n[e]=o)}a.gridClassName!==void 0&&(n.className=a.gridClassName),a.gridAriaLabel!==void 0&&(n.ariaLabel=a.gridAriaLabel),a.gridAriaLabelledBy!==void 0&&(n.ariaLabelledBy=a.gridAriaLabelledBy),a.gridAriaDescribedBy!==void 0&&(n.ariaDescribedBy=a.gridAriaDescribedBy);let t=g(p.value,a.preset,n,e=>{let o=`${e.code}:${e.preset??""}`;m.has(o)||(m.add(o),p.value.onConfigWarning?p.value.onConfigWarning(e):console.warn(e.message))}),i=G(t.options);return u={options:i,explain:e=>e==="columnDefs"&&i.columnDefs!==t.options.columnDefs?{key:e,value:i.columnDefs,source:"Vue slots",layers:[...t.explain(e).layers,{name:"Vue slots",value:i.columnDefs}]}:t.explain(e)},u.options};return S(()=>{if(!f.value)return;let n=y();for(let t of T){let i=P(t),e=n[i];n[i]=o=>{typeof e=="function"&&e(o),D(t,o)}}d=R(f.value,n)}),v(()=>{d?.destroy(),d=null}),L(()=>{let n=y();return[...b.map(t=>n[t])]},(n,t)=>{if(!d)return;let i={};n.forEach((e,o)=>{if(Object.is(e,t[o]))return;let x=b[o];i[x]=e}),Object.keys(i).length>0&&d.updateOptions(i)}),s({getApi:()=>d,getResolvedConfig:()=>u?.options??y(),explainOption:n=>(u??g(p.value,a.preset,{})).explain(n)}),()=>N("div",{...c,ref:f,class:["mach-vue-host",a.className,c.class]})}}),Y=V;export{Y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7LXDVLDDcjs = require('./chunk-7LXDVLDD.cjs');function i(e,a,n={}){let r=_chunk7LXDVLDDcjs.c.call(void 0, n);e.provide(_chunk7LXDVLDDcjs.b,r);let o=e.component("MachTable");if(o&&o!==a)throw new Error('[MachTable] Cannot register global component "MachTable" because that name is already in use.');o||e.component("MachTable",a)}exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as m,render as p,renderSlot as P,getCurrentInstance as g,shallowReactive as C}from"vue";function s(t){if(t)return t;try{return g()?.appContext}catch{return}}function R(t,e,n,r){let o=m({setup:()=>()=>m(t,{...e})});return r&&(o.appContext=r),p(o,n),()=>p(null,n)}function c(t,e,n,r,a=!0){let d=m({name:"MachTableSlot",setup:()=>()=>P({default:t},"default",e())});r&&(d.appContext=r);let l=!1,u=()=>{l||p(d,n)};return a?queueMicrotask(u):u(),()=>{l=!0,p(null,n)}}function E(t,e){let n=s(e?.appContext);return r=>{let a=document.createElement("div");a.className="mach-cell-vue",a.style.width="100%";let o=C({...r}),d=R(t,o,a,n),l=!1;return{el:a,refresh:u=>(Object.assign(o,u),!0),destroy:()=>{l||(l=!0,window.setTimeout(d,0))}}}}function A(t,e){let n=s(e?.appContext);return r=>{let a=document.createElement("div");a.style.height="100%";let o=R(t,r,a,n),d=!1;return{el:a,destroy:()=>{d||(d=!0,o())}}}}function x(t,e){let n=s(e?.appContext);return r=>{let a=document.createElement("div");a.className="mach-cell-vue mach-cell-vue--slot",a.style.width="100%";let o=C({...r}),d=c(t,()=>o,a,n);return{el:a,refresh:l=>(Object.assign(o,l),!0),destroy:d}}}function h(t,e){let n=s(e?.appContext);return r=>{let a=document.createElement("div");a.className="mach-header-vue-slot";let o=c(t,()=>r,a,n);return{el:a,destroy:o}}}function S(t,e){let n=s(e?.appContext);return r=>{let a=C({value:r.value}),o=document.createElement("div");o.className="mach-cell-vue mach-cell-vue--editor";let l=c(t,()=>({...r,value:a.value,setValue:u=>{a.value=u},commit:()=>{r.api.editing.stop()},cancel:()=>{r.api.editing.stop({cancel:!0})}}),o,n,!1);return{el:o,getValue:()=>a.value,focus:()=>{o.querySelector("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])")?.focus()},destroy:l}}}function D(t,e){let n=s(e?.appContext);return r=>{let a=document.createElement("div");a.className="mach-detail-vue-slot",a.style.height="100%";let o=c(t,()=>r,a,n);return{el:a,destroy:o}}}function i(t,e){let n=s(e?.appContext);return()=>{let r=document.createElement("div");r.className="mach-overlay-vue-slot";let a=c(t,()=>({}),r,n);return{el:r,destroy:a}}}function T(t,e,n){return t[`${e}-${n}`]??t[`${e}-${n.replace(/[.\s]+/g,"-")}`]}function y(t,e,n){return t.map((r,a)=>{if(Array.isArray(r.children)){let v=r;return{...v,children:y(v.children,e,n)}}let o=r,d=o.colId??o.field??`col_${a}`,l=T(e,"cell",d)??(d==="op"?e.actions:void 0)??e.cell,u=T(e,"header",d)??e.header,f=T(e,"editor",d)??e.editor;return{...o,...l?{cellRenderer:x(l,{appContext:n})}:{},...u?{headerComponent:h(u,{appContext:n})}:{},...f?{cellEditor:S(f,{appContext:n})}:{}}})}function O(t,e,n){let r=t.columnDefs?y(t.columnDefs,e,n):t.columnDefs;return{...t,columnDefs:r,...e.detail&&!t.detailRowRenderer?{detailRowRenderer:D(e.detail,{appContext:n})}:{},...e.loading?{overlayLoadingTemplate:i(e.loading,{appContext:n})}:{},...e.empty?{overlayNoRowsTemplate:i(e.empty,{appContext:n})}:{}}}function G(t,e){let n,r,a=t.detail?D(t.detail,{appContext:e}):void 0,o=t.loading?i(t.loading,{appContext:e}):void 0,d=t.empty?i(t.empty,{appContext:e}):void 0;return l=>(l.columnDefs!==n&&(n=l.columnDefs,r=l.columnDefs?y(l.columnDefs,t,e):l.columnDefs),{...l,columnDefs:r,...a&&!l.detailRowRenderer?{detailRowRenderer:a}:{},...o?{overlayLoadingTemplate:o}:{},...d?{overlayNoRowsTemplate:d}:{}})}export{E as a,A as b,x as c,h as d,S as e,D as f,i as g,O as h,G as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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; }var _vue = require('vue');function s(t){if(t)return t;try{return _optionalChain([_vue.getCurrentInstance.call(void 0, ), 'optionalAccess', _ => _.appContext])}catch (e2){return}}function R(t,e,n,r){let o=_vue.h.call(void 0, {setup:()=>()=>_vue.h.call(void 0, t,{...e})});return r&&(o.appContext=r),_vue.render.call(void 0, o,n),()=>_vue.render.call(void 0, null,n)}function c(t,e,n,r,a=!0){let d=_vue.h.call(void 0, {name:"MachTableSlot",setup:()=>()=>_vue.renderSlot.call(void 0, {default:t},"default",e())});r&&(d.appContext=r);let l=!1,u=()=>{l||_vue.render.call(void 0, d,n)};return a?queueMicrotask(u):u(),()=>{l=!0,_vue.render.call(void 0, null,n)}}function E(t,e){let n=s(_optionalChain([e, 'optionalAccess', _2 => _2.appContext]));return r=>{let a=document.createElement("div");a.className="mach-cell-vue",a.style.width="100%";let o=_vue.shallowReactive.call(void 0, {...r}),d=R(t,o,a,n),l=!1;return{el:a,refresh:u=>(Object.assign(o,u),!0),destroy:()=>{l||(l=!0,window.setTimeout(d,0))}}}}function A(t,e){let n=s(_optionalChain([e, 'optionalAccess', _3 => _3.appContext]));return r=>{let a=document.createElement("div");a.style.height="100%";let o=R(t,r,a,n),d=!1;return{el:a,destroy:()=>{d||(d=!0,o())}}}}function x(t,e){let n=s(_optionalChain([e, 'optionalAccess', _4 => _4.appContext]));return r=>{let a=document.createElement("div");a.className="mach-cell-vue mach-cell-vue--slot",a.style.width="100%";let o=_vue.shallowReactive.call(void 0, {...r}),d=c(t,()=>o,a,n);return{el:a,refresh:l=>(Object.assign(o,l),!0),destroy:d}}}function h(t,e){let n=s(_optionalChain([e, 'optionalAccess', _5 => _5.appContext]));return r=>{let a=document.createElement("div");a.className="mach-header-vue-slot";let o=c(t,()=>r,a,n);return{el:a,destroy:o}}}function S(t,e){let n=s(_optionalChain([e, 'optionalAccess', _6 => _6.appContext]));return r=>{let a=_vue.shallowReactive.call(void 0, {value:r.value}),o=document.createElement("div");o.className="mach-cell-vue mach-cell-vue--editor";let l=c(t,()=>({...r,value:a.value,setValue:u=>{a.value=u},commit:()=>{r.api.editing.stop()},cancel:()=>{r.api.editing.stop({cancel:!0})}}),o,n,!1);return{el:o,getValue:()=>a.value,focus:()=>{_optionalChain([o, 'access', _7 => _7.querySelector, 'call', _8 => _8("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])"), 'optionalAccess', _9 => _9.focus, 'call', _10 => _10()])},destroy:l}}}function D(t,e){let n=s(_optionalChain([e, 'optionalAccess', _11 => _11.appContext]));return r=>{let a=document.createElement("div");a.className="mach-detail-vue-slot",a.style.height="100%";let o=c(t,()=>r,a,n);return{el:a,destroy:o}}}function i(t,e){let n=s(_optionalChain([e, 'optionalAccess', _12 => _12.appContext]));return()=>{let r=document.createElement("div");r.className="mach-overlay-vue-slot";let a=c(t,()=>({}),r,n);return{el:r,destroy:a}}}function T(t,e,n){return _nullishCoalesce(t[`${e}-${n}`], () => (t[`${e}-${n.replace(/[.\s]+/g,"-")}`]))}function y(t,e,n){return t.map((r,a)=>{if(Array.isArray(r.children)){let v=r;return{...v,children:y(v.children,e,n)}}let o=r,d=_nullishCoalesce(_nullishCoalesce(o.colId, () => (o.field)), () => (`col_${a}`)),l=_nullishCoalesce(_nullishCoalesce(T(e,"cell",d), () => ((d==="op"?e.actions:void 0))), () => (e.cell)),u=_nullishCoalesce(T(e,"header",d), () => (e.header)),f=_nullishCoalesce(T(e,"editor",d), () => (e.editor));return{...o,...l?{cellRenderer:x(l,{appContext:n})}:{},...u?{headerComponent:h(u,{appContext:n})}:{},...f?{cellEditor:S(f,{appContext:n})}:{}}})}function O(t,e,n){let r=t.columnDefs?y(t.columnDefs,e,n):t.columnDefs;return{...t,columnDefs:r,...e.detail&&!t.detailRowRenderer?{detailRowRenderer:D(e.detail,{appContext:n})}:{},...e.loading?{overlayLoadingTemplate:i(e.loading,{appContext:n})}:{},...e.empty?{overlayNoRowsTemplate:i(e.empty,{appContext:n})}:{}}}function G(t,e){let n,r,a=t.detail?D(t.detail,{appContext:e}):void 0,o=t.loading?i(t.loading,{appContext:e}):void 0,d=t.empty?i(t.empty,{appContext:e}):void 0;return l=>(l.columnDefs!==n&&(n=l.columnDefs,r=l.columnDefs?y(l.columnDefs,t,e):l.columnDefs),{...l,columnDefs:r,...a&&!l.detailRowRenderer?{detailRowRenderer:a}:{},...o?{overlayLoadingTemplate:o}:{},...d?{overlayNoRowsTemplate:d}:{}})}exports.a = E; exports.b = A; exports.c = x; exports.d = h; exports.e = S; exports.f = D; exports.g = i; exports.h = O; exports.i = G;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{onScopeDispose as f,ref as i,shallowRef as u,watch as s}from"vue";function c(){let t=i(null),e=u(null),a=u(!1),n=0;return s(t,o=>{let r=++n;if(o&&typeof o.getApi=="function"){e.value=o.getApi(),a.value=!1;let l=e.value;l&&l.whenReady().then(()=>{n===r&&e.value===l&&!l.isDestroyed()&&(a.value=!0)})}else e.value=null,a.value=!1},{flush:"post"}),f(()=>{n++,t.value=null,e.value=null,a.value=!1}),{ref:t,api:e,ready:a}}export{c as a};
|
package/dist/editors.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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; }var _vue = require('vue');function V(t){if(t)return t;try{return _optionalChain([_vue.getCurrentInstance.call(void 0, ), 'optionalAccess', _ => _.appContext])}catch (e2){return}}function T(t,e,r){if(r){let a=_vue.h.call(void 0, t);return a.appContext=r,_vue.render.call(void 0, a,e),()=>_vue.render.call(void 0, null,e)}let l=_vue.createApp.call(void 0, t);return l.mount(e),()=>l.unmount()}function d(t,e={}){let r=V(e.appContext),l=_nullishCoalesce(e.valueProp, () => ("modelValue")),a=_nullishCoalesce(e.updateEvent, () => ("onUpdate:modelValue"));return i=>{let o=_vue.shallowReactive.call(void 0, {value:i.value}),n=document.createElement("div");n.className=`mach-cell-vue mach-cell-vue--editor${e.className?` ${e.className}`:""}`,n.style.width="100%";let C=T({name:"MachTableVueCellEditor",setup:()=>()=>{let u=typeof e.props=="function"?e.props(i):e.props,c=E=>{o.value=E};return _vue.h.call(void 0, t,{..._nullishCoalesce(u, () => ({})),[l]:o.value,[a]:c,style:[{width:"100%"},_optionalChain([u, 'optionalAccess', _2 => _2.style])]},e.children?()=>e.children({params:i,value:o.value,setValue:c}):void 0)}},n,r),p=!1;return{el:n,getValue:()=>o.value,focus:()=>{let u=_nullishCoalesce(e.focusSelector, () => ("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])"));_optionalChain([n, 'access', _3 => _3.querySelector, 'call', _4 => _4(u), 'optionalAccess', _5 => _5.focus, 'call', _6 => _6()])},destroy:()=>{p||(p=!0,C())}}}}function b(t,e={}){return{input:t.input?d(t.input,e.input):void 0,number:t.inputNumber?d(t.inputNumber,e.number):void 0,select:t.select?d(t.select,{props:{teleported:!0},...e.select}):void 0,date:t.datePicker?d(t.datePicker,{props:{teleported:!0,valueFormat:"YYYY-MM-DD"},...e.date}):void 0}}exports.createElementPlusEditors = b; exports.vueCellEditor = d;
|
|
2
|
-
//# sourceMappingURL=editors.cjs.map
|
package/dist/editors.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
import{createApp as v,getCurrentInstance as f,h as m,render as s,shallowReactive as y}from"vue";function V(t){if(t)return t;try{return f()?.appContext}catch{return}}function T(t,e,r){if(r){let a=m(t);return a.appContext=r,s(a,e),()=>s(null,e)}let l=v(t);return l.mount(e),()=>l.unmount()}function d(t,e={}){let r=V(e.appContext),l=e.valueProp??"modelValue",a=e.updateEvent??"onUpdate:modelValue";return i=>{let o=y({value:i.value}),n=document.createElement("div");n.className=`mach-cell-vue mach-cell-vue--editor${e.className?` ${e.className}`:""}`,n.style.width="100%";let C=T({name:"MachTableVueCellEditor",setup:()=>()=>{let u=typeof e.props=="function"?e.props(i):e.props,c=E=>{o.value=E};return m(t,{...u??{},[l]:o.value,[a]:c,style:[{width:"100%"},u?.style]},e.children?()=>e.children({params:i,value:o.value,setValue:c}):void 0)}},n,r),p=!1;return{el:n,getValue:()=>o.value,focus:()=>{let u=e.focusSelector??"input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])";n.querySelector(u)?.focus()},destroy:()=>{p||(p=!0,C())}}}}function b(t,e={}){return{input:t.input?d(t.input,e.input):void 0,number:t.inputNumber?d(t.inputNumber,e.number):void 0,select:t.select?d(t.select,{props:{teleported:!0},...e.select}):void 0,date:t.datePicker?d(t.datePicker,{props:{teleported:!0,valueFormat:"YYYY-MM-DD"},...e.date}):void 0}}export{b as createElementPlusEditors,d as vueCellEditor};
|
|
2
|
-
//# sourceMappingURL=editors.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as MachTable } from './MachTable-jS92BIXm.js';
|
|
2
|
+
import { M as MachTableToolbar } from './MachTableToolbar-BUFcnsF4.js';
|
|
3
|
+
import { MachTableRuntimeConfig } from '@agile-team/mach-table';
|
|
4
|
+
|
|
5
|
+
declare module "vue" {
|
|
6
|
+
interface GlobalComponents {
|
|
7
|
+
MachTable: typeof MachTable;
|
|
8
|
+
MachTableToolbar: typeof MachTableToolbar;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
type MachTablePluginOptions = MachTableRuntimeConfig;
|
|
12
|
+
|
|
13
|
+
export type { MachTablePluginOptions as M };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as MachTable } from './MachTable-jS92BIXm.cjs';
|
|
2
|
+
import { M as MachTableToolbar } from './MachTableToolbar-BUFcnsF4.cjs';
|
|
3
|
+
import { MachTableRuntimeConfig } from '@agile-team/mach-table';
|
|
4
|
+
|
|
5
|
+
declare module "vue" {
|
|
6
|
+
interface GlobalComponents {
|
|
7
|
+
MachTable: typeof MachTable;
|
|
8
|
+
MachTableToolbar: typeof MachTableToolbar;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
type MachTablePluginOptions = MachTableRuntimeConfig;
|
|
12
|
+
|
|
13
|
+
export type { MachTablePluginOptions as M };
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
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
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
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 _chunkOFITMI6Jcjs = require('./chunk-OFITMI6J.cjs');var _chunkEGEQGM3Dcjs = require('./chunk-EGEQGM3D.cjs');var _chunk3LIWCBSPcjs = require('./chunk-3LIWCBSP.cjs');var _chunk7LXDVLDDcjs = require('./chunk-7LXDVLDD.cjs');require('./chunk-XECIDGIZ.cjs');var o={install(r,p){_chunkOFITMI6Jcjs.a.call(void 0, r,_chunk3LIWCBSPcjs.a,p)}};var _machtable = require('@agile-team/mach-table'); _createStarExport(_machtable);var m=o;exports.MACH_TABLE_CONFIG_KEY = _chunk7LXDVLDDcjs.b; exports.MachTable = _chunk3LIWCBSPcjs.a; exports.MachTablePlugin = o; exports.default = m; exports.provideMachTableConfig = _chunk7LXDVLDDcjs.d; exports.useMachTable = _chunkEGEQGM3Dcjs.a; exports.useMachTableConfig = _chunk7LXDVLDDcjs.e;
|