@shwfed/nuxt 0.10.14 → 0.11.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/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/app.d.vue.ts +2 -1
- package/dist/runtime/components/app.vue.d.ts +2 -1
- package/dist/runtime/components/button.d.vue.ts +67 -4
- package/dist/runtime/components/button.vue +29 -4
- package/dist/runtime/components/button.vue.d.ts +67 -4
- package/dist/runtime/components/component-config.d.ts +12 -0
- package/dist/runtime/components/component-config.js +22 -0
- package/dist/runtime/components/fields.d.vue.ts +9 -5
- package/dist/runtime/components/fields.vue +14 -5
- package/dist/runtime/components/fields.vue.d.ts +9 -5
- package/dist/runtime/components/markdown.d.vue.ts +19 -9
- package/dist/runtime/components/markdown.vue +15 -3
- package/dist/runtime/components/markdown.vue.d.ts +19 -9
- package/dist/runtime/components/menu-tabs.d.vue.ts +14 -4
- package/dist/runtime/components/menu-tabs.vue +15 -3
- package/dist/runtime/components/menu-tabs.vue.d.ts +14 -4
- package/dist/runtime/components/modal.d.vue.ts +3 -1
- package/dist/runtime/components/modal.vue +3 -1
- package/dist/runtime/components/modal.vue.d.ts +3 -1
- package/dist/runtime/components/table.d.vue.ts +8 -3
- package/dist/runtime/components/table.vue +28 -2
- package/dist/runtime/components/table.vue.d.ts +8 -3
- package/dist/runtime/components/ui/app/App.d.vue.ts +7 -5
- package/dist/runtime/components/ui/app/App.vue +23 -8
- package/dist/runtime/components/ui/app/App.vue.d.ts +7 -5
- package/dist/runtime/components/ui/app/OverlayHost.d.vue.ts +3 -0
- package/dist/runtime/components/ui/app/OverlayHost.vue +91 -0
- package/dist/runtime/components/ui/app/OverlayHost.vue.d.ts +3 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +56 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +12 -4
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +56 -0
- package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +62 -5
- package/dist/runtime/components/ui/buttons/Buttons.vue +71 -7
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +62 -5
- package/dist/runtime/components/ui/buttons/schema.d.ts +562 -2
- package/dist/runtime/components/ui/buttons/schema.js +24 -23
- package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +4 -4
- package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +4 -4
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +10 -2
- package/dist/runtime/components/ui/fields/Fields.vue +12 -3
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +10 -2
- package/dist/runtime/components/ui/fields/schema.d.ts +464 -0
- package/dist/runtime/components/ui/fields/schema.js +15 -2
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +4 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +10 -4
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +4 -0
- package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +18 -8
- package/dist/runtime/components/ui/markdown/Markdown.vue +13 -3
- package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +18 -8
- package/dist/runtime/components/ui/markdown/schema.d.ts +51 -6
- package/dist/runtime/components/ui/markdown/schema.js +15 -2
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +16 -7
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue +12 -7
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +16 -7
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +14 -4
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue +16 -5
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +14 -4
- package/dist/runtime/components/ui/menu-tabs/schema.d.ts +42 -5
- package/dist/runtime/components/ui/menu-tabs/schema.js +13 -12
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +12 -3
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue +9 -5
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +12 -3
- package/dist/runtime/components/ui/table/Table.d.vue.ts +6 -2
- package/dist/runtime/components/ui/table/Table.vue +18 -2
- package/dist/runtime/components/ui/table/Table.vue.d.ts +6 -2
- package/dist/runtime/components/ui/table/schema.d.ts +239 -2
- package/dist/runtime/components/ui/table/schema.js +15 -6
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +4 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2 -1
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +4 -0
- package/dist/runtime/composables/useOverlay.d.ts +86 -0
- package/dist/runtime/composables/useOverlay.js +201 -0
- package/dist/runtime/layouts/default.d.vue.ts +2 -1
- package/dist/runtime/layouts/default.vue.d.ts +2 -1
- package/dist/runtime/plugins/overlay/index.d.ts +6 -0
- package/dist/runtime/plugins/overlay/index.js +12 -0
- package/dist/runtime/plugins/toast/index.d.ts +4 -4
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ import { useI18n } from "vue-i18n";
|
|
|
20
20
|
import { useTableRenderers } from "../../../composables/useTableRenderers";
|
|
21
21
|
import { getLocalizedText } from "../../../utils/coders";
|
|
22
22
|
import {
|
|
23
|
+
createTableConfig,
|
|
23
24
|
normalizePaginationPageSizes,
|
|
24
25
|
resolvePaginationPageSize,
|
|
25
26
|
TableConfigC
|
|
@@ -36,12 +37,15 @@ const props = defineProps({
|
|
|
36
37
|
rowCount: { type: Number, required: false }
|
|
37
38
|
});
|
|
38
39
|
const emit = defineEmits(["update:config"]);
|
|
40
|
+
const defaultConfig = createTableConfig({
|
|
41
|
+
columns: []
|
|
42
|
+
});
|
|
39
43
|
function isTableConfigEffect(value) {
|
|
40
44
|
return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function";
|
|
41
45
|
}
|
|
42
46
|
async function resolveTableConfig(value) {
|
|
43
47
|
const nextValue = isTableConfigEffect(value) ? await Effect.runPromise(value) : value;
|
|
44
|
-
return TableConfigC.parse(nextValue);
|
|
48
|
+
return TableConfigC.parse(nextValue ?? defaultConfig);
|
|
45
49
|
}
|
|
46
50
|
const resolvedConfig = computedAsync(async () => resolveTableConfig(props.config));
|
|
47
51
|
const currentConfig = ref();
|
|
@@ -504,7 +508,19 @@ function getAccessorTooltipLabel(column) {
|
|
|
504
508
|
</script>
|
|
505
509
|
|
|
506
510
|
<script>
|
|
507
|
-
export {
|
|
511
|
+
export {
|
|
512
|
+
AccessorC,
|
|
513
|
+
ColumnC,
|
|
514
|
+
CURRENT_COMPATIBILITY_DATE,
|
|
515
|
+
KIND,
|
|
516
|
+
RenderC,
|
|
517
|
+
SUPPORTED_COMPATIBILITY_DATES,
|
|
518
|
+
TableBodyC,
|
|
519
|
+
TableBodyInputC,
|
|
520
|
+
TableConfigC,
|
|
521
|
+
TableConfigInputC,
|
|
522
|
+
createTableConfig
|
|
523
|
+
} from "./schema";
|
|
508
524
|
</script>
|
|
509
525
|
|
|
510
526
|
<template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type CellContext } from '@tanstack/vue-table';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
3
|
import { type TableConfigInput } from './schema.js';
|
|
4
|
-
export type { Accessor, Column, Expression, Markdown, Render, TableConfig } from './schema.js';
|
|
5
|
-
export { AccessorC, ColumnC, RenderC, TableConfigC } from './schema.js';
|
|
4
|
+
export type { Accessor, Column, Expression, Markdown, Render, TableBody, TableBodyInput, TableConfig, TableConfigInput, } from './schema.js';
|
|
5
|
+
export { AccessorC, ColumnC, CURRENT_COMPATIBILITY_DATE, KIND, RenderC, SUPPORTED_COMPATIBILITY_DATES, TableBodyC, TableBodyInputC, TableConfigC, TableConfigInputC, createTableConfig, } from './schema.js';
|
|
6
6
|
export type TableInstance = import('@tanstack/table-core').Table<unknown>;
|
|
7
7
|
declare module '@tanstack/vue-table' {
|
|
8
8
|
interface ColumnMeta<TData extends import('@tanstack/vue-table').RowData, TValue> {
|
|
@@ -20,6 +20,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
20
20
|
rowCount?: number;
|
|
21
21
|
}, import("@tanstack/table-core").Table<unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
22
|
"update:config": (args_0: Readonly<{
|
|
23
|
+
kind: string;
|
|
24
|
+
compatibilityDate: string;
|
|
23
25
|
getRowId?: import("./schema.js").Expression;
|
|
24
26
|
getSubRows?: import("./schema.js").Expression;
|
|
25
27
|
enableRowSelection?: import("./schema.js").Expression;
|
|
@@ -81,6 +83,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
81
83
|
rowCount?: number;
|
|
82
84
|
}> & Readonly<{
|
|
83
85
|
"onUpdate:config"?: ((args_0: Readonly<{
|
|
86
|
+
kind: string;
|
|
87
|
+
compatibilityDate: string;
|
|
84
88
|
getRowId?: import("./schema.js").Expression;
|
|
85
89
|
getSubRows?: import("./schema.js").Expression;
|
|
86
90
|
enableRowSelection?: import("./schema.js").Expression;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import type { LocaleValue } from '../../../utils/coders.js';
|
|
3
|
+
export declare const KIND = "shwfed.component.table";
|
|
4
|
+
export declare const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
5
|
+
export declare const SUPPORTED_COMPATIBILITY_DATES: string[];
|
|
3
6
|
export type Expression = string;
|
|
4
7
|
export type Markdown = string;
|
|
5
8
|
export type Render = string | Readonly<{
|
|
@@ -60,7 +63,33 @@ export type TableProps = Readonly<{
|
|
|
60
63
|
export declare const RenderC: z.ZodType<Render>;
|
|
61
64
|
export declare const AccessorC: z.ZodType<Accessor>;
|
|
62
65
|
export declare const ColumnC: z.ZodType<Column>;
|
|
66
|
+
export type TableBody = Readonly<{
|
|
67
|
+
getRowId?: Expression;
|
|
68
|
+
getSubRows?: Expression;
|
|
69
|
+
enableRowSelection?: Expression;
|
|
70
|
+
enableMultiRowSelection?: Expression;
|
|
71
|
+
columns: ReadonlyArray<Column>;
|
|
72
|
+
cellStyles?: Expression;
|
|
73
|
+
props?: TableProps;
|
|
74
|
+
paginationLeft?: Markdown;
|
|
75
|
+
paginationRight?: Markdown;
|
|
76
|
+
paginationPageSizes?: ReadonlyArray<number>;
|
|
77
|
+
}>;
|
|
78
|
+
export type TableBodyInput = Readonly<{
|
|
79
|
+
getRowId?: Expression;
|
|
80
|
+
getSubRows?: Expression;
|
|
81
|
+
enableRowSelection?: Expression;
|
|
82
|
+
enableMultiRowSelection?: Expression;
|
|
83
|
+
columns?: ReadonlyArray<Column>;
|
|
84
|
+
cellStyles?: Expression;
|
|
85
|
+
props?: TableProps;
|
|
86
|
+
paginationLeft?: Markdown;
|
|
87
|
+
paginationRight?: Markdown;
|
|
88
|
+
paginationPageSizes?: ReadonlyArray<number>;
|
|
89
|
+
}>;
|
|
63
90
|
export type TableConfig = Readonly<{
|
|
91
|
+
kind: string;
|
|
92
|
+
compatibilityDate: string;
|
|
64
93
|
getRowId?: Expression;
|
|
65
94
|
getSubRows?: Expression;
|
|
66
95
|
enableRowSelection?: Expression;
|
|
@@ -73,6 +102,8 @@ export type TableConfig = Readonly<{
|
|
|
73
102
|
paginationPageSizes?: ReadonlyArray<number>;
|
|
74
103
|
}>;
|
|
75
104
|
export type TableConfigInput = Readonly<{
|
|
105
|
+
kind: string;
|
|
106
|
+
compatibilityDate: string;
|
|
76
107
|
getRowId?: Expression;
|
|
77
108
|
getSubRows?: Expression;
|
|
78
109
|
enableRowSelection?: Expression;
|
|
@@ -92,7 +123,210 @@ export declare const TableConfigCellStylesC: z.ZodOptional<z.ZodString>;
|
|
|
92
123
|
export declare function normalizePaginationPageSizes(value: ReadonlyArray<number> | undefined): Array<number> | undefined;
|
|
93
124
|
export declare function resolvePaginationPageSize(pageSize: number | undefined, paginationPageSizes: ReadonlyArray<number> | undefined): number | undefined;
|
|
94
125
|
export declare const TableConfigPaginationPageSizesC: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>>;
|
|
95
|
-
export declare const
|
|
126
|
+
export declare const TableBodyC: z.ZodReadonly<z.ZodObject<{
|
|
127
|
+
getRowId: z.ZodOptional<z.ZodString>;
|
|
128
|
+
getSubRows: z.ZodOptional<z.ZodString>;
|
|
129
|
+
enableRowSelection: z.ZodOptional<z.ZodString>;
|
|
130
|
+
enableMultiRowSelection: z.ZodOptional<z.ZodString>;
|
|
131
|
+
columns: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodType<Readonly<{
|
|
132
|
+
id?: string;
|
|
133
|
+
title?: LocaleValue;
|
|
134
|
+
accessor?: Accessor;
|
|
135
|
+
renderer?: Render;
|
|
136
|
+
tooltip?: LocaleValue;
|
|
137
|
+
size?: number;
|
|
138
|
+
enableSorting?: boolean;
|
|
139
|
+
enableMultiSorting?: boolean;
|
|
140
|
+
enablePinning?: boolean;
|
|
141
|
+
columns?: ReadonlyArray<Column>;
|
|
142
|
+
grow?: boolean;
|
|
143
|
+
}>, unknown, z.core.$ZodTypeInternals<Readonly<{
|
|
144
|
+
id?: string;
|
|
145
|
+
title?: LocaleValue;
|
|
146
|
+
accessor?: Accessor;
|
|
147
|
+
renderer?: Render;
|
|
148
|
+
tooltip?: LocaleValue;
|
|
149
|
+
size?: number;
|
|
150
|
+
enableSorting?: boolean;
|
|
151
|
+
enableMultiSorting?: boolean;
|
|
152
|
+
enablePinning?: boolean;
|
|
153
|
+
columns?: ReadonlyArray<Column>;
|
|
154
|
+
grow?: boolean;
|
|
155
|
+
}>, unknown>>>>>;
|
|
156
|
+
cellStyles: z.ZodOptional<z.ZodString>;
|
|
157
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
initialState: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
159
|
+
columnVisibility: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
160
|
+
columnOrder: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
161
|
+
columnPinning: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
162
|
+
left: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
163
|
+
right: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
164
|
+
}, z.core.$strip>>>;
|
|
165
|
+
rowPinning: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
166
|
+
top: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
167
|
+
bottom: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
168
|
+
}, z.core.$strip>>>;
|
|
169
|
+
columnFilters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
value: z.ZodUnknown;
|
|
172
|
+
}, z.core.$strip>>>>>;
|
|
173
|
+
globalFilter: z.ZodOptional<z.ZodUnknown>;
|
|
174
|
+
sorting: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
175
|
+
id: z.ZodString;
|
|
176
|
+
desc: z.ZodBoolean;
|
|
177
|
+
}, z.core.$strip>>>>>;
|
|
178
|
+
expanded: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodBoolean>]>>;
|
|
179
|
+
grouping: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
180
|
+
columnSizing: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
181
|
+
columnSizingInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
182
|
+
pagination: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
183
|
+
pageIndex: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
}, z.core.$strip>>>;
|
|
186
|
+
rowSelection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
187
|
+
}, z.core.$strip>>>;
|
|
188
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
189
|
+
paginationLeft: z.ZodOptional<z.ZodString>;
|
|
190
|
+
paginationRight: z.ZodOptional<z.ZodString>;
|
|
191
|
+
paginationPageSizes: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
export declare const TableBodyInputC: z.ZodReadonly<z.ZodObject<{
|
|
194
|
+
getRowId: z.ZodOptional<z.ZodString>;
|
|
195
|
+
getSubRows: z.ZodOptional<z.ZodString>;
|
|
196
|
+
enableRowSelection: z.ZodOptional<z.ZodString>;
|
|
197
|
+
enableMultiRowSelection: z.ZodOptional<z.ZodString>;
|
|
198
|
+
columns: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodType<Readonly<{
|
|
199
|
+
id?: string;
|
|
200
|
+
title?: LocaleValue;
|
|
201
|
+
accessor?: Accessor;
|
|
202
|
+
renderer?: Render;
|
|
203
|
+
tooltip?: LocaleValue;
|
|
204
|
+
size?: number;
|
|
205
|
+
enableSorting?: boolean;
|
|
206
|
+
enableMultiSorting?: boolean;
|
|
207
|
+
enablePinning?: boolean;
|
|
208
|
+
columns?: ReadonlyArray<Column>;
|
|
209
|
+
grow?: boolean;
|
|
210
|
+
}>, unknown, z.core.$ZodTypeInternals<Readonly<{
|
|
211
|
+
id?: string;
|
|
212
|
+
title?: LocaleValue;
|
|
213
|
+
accessor?: Accessor;
|
|
214
|
+
renderer?: Render;
|
|
215
|
+
tooltip?: LocaleValue;
|
|
216
|
+
size?: number;
|
|
217
|
+
enableSorting?: boolean;
|
|
218
|
+
enableMultiSorting?: boolean;
|
|
219
|
+
enablePinning?: boolean;
|
|
220
|
+
columns?: ReadonlyArray<Column>;
|
|
221
|
+
grow?: boolean;
|
|
222
|
+
}>, unknown>>>>>;
|
|
223
|
+
cellStyles: z.ZodOptional<z.ZodString>;
|
|
224
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
initialState: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
226
|
+
columnVisibility: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
227
|
+
columnOrder: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
228
|
+
columnPinning: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
229
|
+
left: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
230
|
+
right: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
231
|
+
}, z.core.$strip>>>;
|
|
232
|
+
rowPinning: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
233
|
+
top: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
234
|
+
bottom: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
235
|
+
}, z.core.$strip>>>;
|
|
236
|
+
columnFilters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
value: z.ZodUnknown;
|
|
239
|
+
}, z.core.$strip>>>>>;
|
|
240
|
+
globalFilter: z.ZodOptional<z.ZodUnknown>;
|
|
241
|
+
sorting: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
242
|
+
id: z.ZodString;
|
|
243
|
+
desc: z.ZodBoolean;
|
|
244
|
+
}, z.core.$strip>>>>>;
|
|
245
|
+
expanded: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodBoolean>]>>;
|
|
246
|
+
grouping: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
247
|
+
columnSizing: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
248
|
+
columnSizingInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
249
|
+
pagination: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
250
|
+
pageIndex: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
}, z.core.$strip>>>;
|
|
253
|
+
rowSelection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
254
|
+
}, z.core.$strip>>>;
|
|
255
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
256
|
+
paginationLeft: z.ZodOptional<z.ZodString>;
|
|
257
|
+
paginationRight: z.ZodOptional<z.ZodString>;
|
|
258
|
+
paginationPageSizes: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>>;
|
|
259
|
+
}, z.core.$strip>>;
|
|
260
|
+
export declare const TableConfigC: z.ZodReadonly<z.ZodObject<{
|
|
261
|
+
getRowId: z.ZodOptional<z.ZodString>;
|
|
262
|
+
getSubRows: z.ZodOptional<z.ZodString>;
|
|
263
|
+
enableRowSelection: z.ZodOptional<z.ZodString>;
|
|
264
|
+
enableMultiRowSelection: z.ZodOptional<z.ZodString>;
|
|
265
|
+
columns: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodType<Readonly<{
|
|
266
|
+
id?: string;
|
|
267
|
+
title?: LocaleValue;
|
|
268
|
+
accessor?: Accessor;
|
|
269
|
+
renderer?: Render;
|
|
270
|
+
tooltip?: LocaleValue;
|
|
271
|
+
size?: number;
|
|
272
|
+
enableSorting?: boolean;
|
|
273
|
+
enableMultiSorting?: boolean;
|
|
274
|
+
enablePinning?: boolean;
|
|
275
|
+
columns?: ReadonlyArray<Column>;
|
|
276
|
+
grow?: boolean;
|
|
277
|
+
}>, unknown, z.core.$ZodTypeInternals<Readonly<{
|
|
278
|
+
id?: string;
|
|
279
|
+
title?: LocaleValue;
|
|
280
|
+
accessor?: Accessor;
|
|
281
|
+
renderer?: Render;
|
|
282
|
+
tooltip?: LocaleValue;
|
|
283
|
+
size?: number;
|
|
284
|
+
enableSorting?: boolean;
|
|
285
|
+
enableMultiSorting?: boolean;
|
|
286
|
+
enablePinning?: boolean;
|
|
287
|
+
columns?: ReadonlyArray<Column>;
|
|
288
|
+
grow?: boolean;
|
|
289
|
+
}>, unknown>>>>>;
|
|
290
|
+
cellStyles: z.ZodOptional<z.ZodString>;
|
|
291
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
292
|
+
initialState: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
293
|
+
columnVisibility: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
294
|
+
columnOrder: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
295
|
+
columnPinning: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
296
|
+
left: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
297
|
+
right: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
298
|
+
}, z.core.$strip>>>;
|
|
299
|
+
rowPinning: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
300
|
+
top: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
301
|
+
bottom: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
302
|
+
}, z.core.$strip>>>;
|
|
303
|
+
columnFilters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
304
|
+
id: z.ZodString;
|
|
305
|
+
value: z.ZodUnknown;
|
|
306
|
+
}, z.core.$strip>>>>>;
|
|
307
|
+
globalFilter: z.ZodOptional<z.ZodUnknown>;
|
|
308
|
+
sorting: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
309
|
+
id: z.ZodString;
|
|
310
|
+
desc: z.ZodBoolean;
|
|
311
|
+
}, z.core.$strip>>>>>;
|
|
312
|
+
expanded: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodBoolean>]>>;
|
|
313
|
+
grouping: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
314
|
+
columnSizing: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
315
|
+
columnSizingInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
316
|
+
pagination: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
317
|
+
pageIndex: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
}, z.core.$strip>>>;
|
|
320
|
+
rowSelection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
321
|
+
}, z.core.$strip>>>;
|
|
322
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
323
|
+
paginationLeft: z.ZodOptional<z.ZodString>;
|
|
324
|
+
paginationRight: z.ZodOptional<z.ZodString>;
|
|
325
|
+
paginationPageSizes: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>>;
|
|
326
|
+
kind: z.ZodLiteral<string>;
|
|
327
|
+
compatibilityDate: z.ZodString;
|
|
328
|
+
}, z.core.$strip>>;
|
|
329
|
+
export declare const TableConfigInputC: z.ZodReadonly<z.ZodObject<{
|
|
96
330
|
getRowId: z.ZodOptional<z.ZodString>;
|
|
97
331
|
getSubRows: z.ZodOptional<z.ZodString>;
|
|
98
332
|
enableRowSelection: z.ZodOptional<z.ZodString>;
|
|
@@ -158,6 +392,9 @@ export declare const TableConfigC: z.ZodPipe<z.ZodTransform<{} | null, unknown>,
|
|
|
158
392
|
paginationLeft: z.ZodOptional<z.ZodString>;
|
|
159
393
|
paginationRight: z.ZodOptional<z.ZodString>;
|
|
160
394
|
paginationPageSizes: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>>;
|
|
161
|
-
|
|
395
|
+
kind: z.ZodLiteral<string>;
|
|
396
|
+
compatibilityDate: z.ZodString;
|
|
397
|
+
}, z.core.$strip>>;
|
|
398
|
+
export declare function createTableConfig(body: TableBodyInput): TableConfig;
|
|
162
399
|
export declare function getColumnTechnicalKey(column: Column): string | undefined;
|
|
163
400
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
+
import { createComponentConfig, createComponentConfigMetadataShape } from "../../component-config.js";
|
|
2
3
|
import { dotPropC, expressionC, localeC } from "../../../utils/coders.js";
|
|
4
|
+
export const KIND = "shwfed.component.table";
|
|
5
|
+
export const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
6
|
+
export const SUPPORTED_COMPATIBILITY_DATES = [CURRENT_COMPATIBILITY_DATE];
|
|
3
7
|
export const RenderC = z.union([
|
|
4
8
|
z.string().describe("\u6E32\u67D3\u5668 ID\uFF0C\u4F8B\u5982 table.renderer.text\u3002"),
|
|
5
9
|
z.object({
|
|
@@ -119,7 +123,7 @@ export const TableConfigPaginationPageSizesC = z.preprocess(
|
|
|
119
123
|
normalizePaginationPageSizesInput,
|
|
120
124
|
z.array(z.number().int().positive()).readonly().optional()
|
|
121
125
|
).describe("\u53EF\u9009\u6BCF\u9875\u6761\u6570\u5217\u8868\u3002\u4F1A\u81EA\u52A8\u53BB\u91CD\u3001\u8FC7\u6EE4\u975E\u6B63\u6574\u6570\uFF0C\u5E76\u4FDD\u7559\u6700\u7EC8\u987A\u5E8F\u3002");
|
|
122
|
-
const
|
|
126
|
+
const TableBodyObjectC = z.object({
|
|
123
127
|
getRowId: TableConfigGetRowIdC,
|
|
124
128
|
getSubRows: TableConfigGetSubRowsC,
|
|
125
129
|
enableRowSelection: TableConfigEnableRowSelectionC,
|
|
@@ -130,11 +134,16 @@ const TableConfigObjectC = z.object({
|
|
|
130
134
|
paginationLeft: z.string().optional().describe("\u5206\u9875\u533A\u57DF\u5DE6\u4FA7\u7684 Markdown \u6587\u6848\u3002"),
|
|
131
135
|
paginationRight: z.string().optional().describe("\u5206\u9875\u533A\u57DF\u53F3\u4FA7\u7684 Markdown \u6587\u6848\u3002"),
|
|
132
136
|
paginationPageSizes: TableConfigPaginationPageSizesC
|
|
133
|
-
})
|
|
134
|
-
export const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
});
|
|
138
|
+
export const TableBodyC = TableBodyObjectC.readonly().describe("\u8868\u683C\u7EC4\u4EF6\u914D\u7F6E\u4E3B\u4F53\u3002\u7528\u4E8E\u63CF\u8FF0\u5217\u7ED3\u6784\u3001\u4EA4\u4E92\u80FD\u529B\u3001\u5206\u9875\u6587\u6848\u548C\u521D\u59CB\u72B6\u6001\u3002");
|
|
139
|
+
export const TableBodyInputC = TableBodyC;
|
|
140
|
+
export const TableConfigC = TableBodyObjectC.extend(
|
|
141
|
+
createComponentConfigMetadataShape(KIND, SUPPORTED_COMPATIBILITY_DATES)
|
|
142
|
+
).readonly().describe("\u8868\u683C\u7EC4\u4EF6\u914D\u7F6E\u3002\u7528\u4E8E\u63CF\u8FF0\u5217\u7ED3\u6784\u3001\u4EA4\u4E92\u80FD\u529B\u3001\u5206\u9875\u6587\u6848\u548C\u521D\u59CB\u72B6\u6001\u3002");
|
|
143
|
+
export const TableConfigInputC = TableConfigC;
|
|
144
|
+
export function createTableConfig(body) {
|
|
145
|
+
return TableConfigC.parse(createComponentConfig(KIND, CURRENT_COMPATIBILITY_DATE, body));
|
|
146
|
+
}
|
|
138
147
|
export function getColumnTechnicalKey(column) {
|
|
139
148
|
if (typeof column.accessor === "string") {
|
|
140
149
|
return column.accessor;
|
|
@@ -10,6 +10,8 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
10
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
11
|
"update:open": (value: boolean) => any;
|
|
12
12
|
confirm: (args_0: Readonly<{
|
|
13
|
+
kind: string;
|
|
14
|
+
compatibilityDate: string;
|
|
13
15
|
getRowId?: import("../table/schema.js").Expression;
|
|
14
16
|
getSubRows?: import("../table/schema.js").Expression;
|
|
15
17
|
enableRowSelection?: import("../table/schema.js").Expression;
|
|
@@ -68,6 +70,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
68
70
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
69
71
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
70
72
|
onConfirm?: ((args_0: Readonly<{
|
|
73
|
+
kind: string;
|
|
74
|
+
compatibilityDate: string;
|
|
71
75
|
getRowId?: import("../table/schema.js").Expression;
|
|
72
76
|
getSubRows?: import("../table/schema.js").Expression;
|
|
73
77
|
enableRowSelection?: import("../table/schema.js").Expression;
|
|
@@ -29,6 +29,7 @@ import { Textarea } from "../textarea";
|
|
|
29
29
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../tabs";
|
|
30
30
|
import { Toggle } from "../toggle";
|
|
31
31
|
import {
|
|
32
|
+
createTableConfig,
|
|
32
33
|
getColumnTechnicalKey,
|
|
33
34
|
normalizePaginationPageSizes,
|
|
34
35
|
resolvePaginationPageSize,
|
|
@@ -72,7 +73,7 @@ const { getTableRenderer, listTableRenderers, resolveTableRenderer } = useTableR
|
|
|
72
73
|
const search = ref("");
|
|
73
74
|
const childSearch = ref("");
|
|
74
75
|
const selectedItemId = ref("general");
|
|
75
|
-
const draftBaseConfig = ref({ columns: [] });
|
|
76
|
+
const draftBaseConfig = ref(createTableConfig({ columns: [] }));
|
|
76
77
|
const draftColumnTree = ref(buildTableConfiguratorColumnTree([]));
|
|
77
78
|
const draftGetRowId = ref();
|
|
78
79
|
const draftGetSubRows = ref();
|
|
@@ -10,6 +10,8 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
10
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
11
|
"update:open": (value: boolean) => any;
|
|
12
12
|
confirm: (args_0: Readonly<{
|
|
13
|
+
kind: string;
|
|
14
|
+
compatibilityDate: string;
|
|
13
15
|
getRowId?: import("../table/schema.js").Expression;
|
|
14
16
|
getSubRows?: import("../table/schema.js").Expression;
|
|
15
17
|
enableRowSelection?: import("../table/schema.js").Expression;
|
|
@@ -68,6 +70,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
68
70
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
69
71
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
70
72
|
onConfirm?: ((args_0: Readonly<{
|
|
73
|
+
kind: string;
|
|
74
|
+
compatibilityDate: string;
|
|
71
75
|
getRowId?: import("../table/schema.js").Expression;
|
|
72
76
|
getSubRows?: import("../table/schema.js").Expression;
|
|
73
77
|
enableRowSelection?: import("../table/schema.js").Expression;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Context, Deferred, Effect, type Scope } from 'effect';
|
|
2
|
+
import { type VNode } from 'vue';
|
|
3
|
+
export type OverlayAbortReason = 'close-all' | 'definition' | 'dismiss' | 'owner' | 'scope';
|
|
4
|
+
export type OverlayAborted = Readonly<{
|
|
5
|
+
_tag: 'OverlayAborted';
|
|
6
|
+
reason: OverlayAbortReason;
|
|
7
|
+
}>;
|
|
8
|
+
export type OverlayResult = OverlayAborted | unknown;
|
|
9
|
+
export type OverlayShellProps = Readonly<{
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
showCloseButton?: boolean;
|
|
13
|
+
breakpoint?: string;
|
|
14
|
+
dismissible?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type OverlayBodyProps = Readonly<Record<string, unknown>>;
|
|
17
|
+
export type OverlaySessionInput = Readonly<{
|
|
18
|
+
shell?: Partial<OverlayShellProps>;
|
|
19
|
+
props?: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
21
|
+
export type OverlaySessionPatch = Readonly<{
|
|
22
|
+
shell?: Partial<OverlayShellProps>;
|
|
23
|
+
props?: Record<string, unknown>;
|
|
24
|
+
}>;
|
|
25
|
+
export type OverlaySlotProps = Readonly<{
|
|
26
|
+
props: OverlayBodyProps;
|
|
27
|
+
shell: OverlayShellProps;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
close: (value?: unknown) => void;
|
|
30
|
+
patch: (nextProps: Record<string, unknown>) => void;
|
|
31
|
+
isDesktop: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export type OverlayBodyRender = (props: OverlaySlotProps) => Array<VNode>;
|
|
34
|
+
export type OverlayDefinition = Readonly<{
|
|
35
|
+
definitionId: string;
|
|
36
|
+
ownerId: string;
|
|
37
|
+
render: OverlayBodyRender;
|
|
38
|
+
shell?: OverlayShellProps;
|
|
39
|
+
}>;
|
|
40
|
+
type OverlaySession = {
|
|
41
|
+
sessionId: string;
|
|
42
|
+
definitionId: string;
|
|
43
|
+
shell: OverlayShellProps;
|
|
44
|
+
props: Record<string, unknown>;
|
|
45
|
+
deferred: Deferred.Deferred<OverlayResult, never>;
|
|
46
|
+
};
|
|
47
|
+
export type OverlayHandle = Readonly<{
|
|
48
|
+
sessionId: string;
|
|
49
|
+
patch: (patch: OverlaySessionPatch) => Effect.Effect<void>;
|
|
50
|
+
close: (value?: unknown) => Effect.Effect<void>;
|
|
51
|
+
result: Effect.Effect<OverlayResult>;
|
|
52
|
+
}>;
|
|
53
|
+
export type OverlayDefinitionNotFoundError = Readonly<{
|
|
54
|
+
_tag: 'OverlayDefinitionNotFoundError';
|
|
55
|
+
definitionId: string;
|
|
56
|
+
}>;
|
|
57
|
+
export interface OverlayRuntime {
|
|
58
|
+
definitions: Readonly<Record<string, OverlayDefinition>>;
|
|
59
|
+
sessions: ReadonlyArray<OverlaySession>;
|
|
60
|
+
topSession: OverlaySession | undefined;
|
|
61
|
+
registerDefinition: (definition: OverlayDefinition) => void;
|
|
62
|
+
unregisterDefinition: (definitionId: string, ownerId?: string) => void;
|
|
63
|
+
syncDefinitions: (ownerId: string, definitions: Array<OverlayDefinition>) => void;
|
|
64
|
+
isOpen: (sessionId: string) => boolean;
|
|
65
|
+
patchSync: (sessionId: string, patch: OverlaySessionPatch) => void;
|
|
66
|
+
closeSync: (sessionId: string, value?: unknown) => void;
|
|
67
|
+
closeTopSync: () => void;
|
|
68
|
+
closeAllSync: () => void;
|
|
69
|
+
open: (definitionId: string, options?: OverlaySessionInput) => Effect.Effect<OverlayHandle, OverlayDefinitionNotFoundError, Scope.Scope>;
|
|
70
|
+
patch: (sessionId: string, patch: OverlaySessionPatch) => Effect.Effect<void>;
|
|
71
|
+
close: (sessionId: string, value?: unknown) => Effect.Effect<void>;
|
|
72
|
+
closeTop: () => Effect.Effect<void>;
|
|
73
|
+
closeAll: () => Effect.Effect<void>;
|
|
74
|
+
}
|
|
75
|
+
declare const OverlayService_base: Context.TagClass<OverlayService, "shwfed/OverlayService", OverlayRuntime>;
|
|
76
|
+
export declare class OverlayService extends OverlayService_base {
|
|
77
|
+
}
|
|
78
|
+
export declare function isOverlayAborted(value: unknown): value is OverlayAborted;
|
|
79
|
+
export declare function useOverlay(): OverlayRuntime;
|
|
80
|
+
export declare function provideOverlay<A, E, R>(effect: Effect.Effect<A, E, R>, runtime?: OverlayRuntime): Effect.Effect<A, E, Exclude<R, OverlayService>>;
|
|
81
|
+
export declare function openOverlay(definitionId: string, options?: OverlaySessionInput): Effect.Effect<OverlayHandle, OverlayDefinitionNotFoundError, OverlayService | Scope.Scope>;
|
|
82
|
+
export declare function patchOverlay(sessionId: string, patch: OverlaySessionPatch): Effect.Effect<void, never, OverlayService>;
|
|
83
|
+
export declare function closeOverlay(sessionId: string, value?: unknown): Effect.Effect<void, never, OverlayService>;
|
|
84
|
+
export declare function closeTopOverlay(): Effect.Effect<void, never, OverlayService>;
|
|
85
|
+
export declare function closeAllOverlays(): Effect.Effect<void, never, OverlayService>;
|
|
86
|
+
export {};
|