@shwfed/config 2.12.5 → 2.12.6
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 +5 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
- package/dist/runtime/components/config/index.vue +23 -3
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +28 -28
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +28 -28
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/sidebar/index.d.vue.ts +22 -3
- package/dist/runtime/components/sidebar/index.vue +66 -5
- package/dist/runtime/components/sidebar/index.vue.d.ts +22 -3
- package/dist/runtime/components/sidebar/node.d.vue.ts +1 -1
- package/dist/runtime/components/sidebar/node.vue +33 -13
- package/dist/runtime/components/sidebar/node.vue.d.ts +1 -1
- package/dist/runtime/components/sidebar/tree.vue +113 -83
- package/dist/runtime/components/sidebar/types.d.ts +8 -0
- package/dist/runtime/components/sidebar/types.js +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/schema.d.ts +68 -68
- package/dist/runtime/components/table/utils/row-reorder.d.ts +3 -2
- package/dist/runtime/components/table/utils/row-reorder.js +1 -12
- package/dist/runtime/components/tabs/index.d.vue.ts +9 -0
- package/dist/runtime/components/tabs/index.vue +92 -0
- package/dist/runtime/components/tabs/index.vue.d.ts +9 -0
- package/dist/runtime/components/tabs/tab.d.vue.ts +22 -0
- package/dist/runtime/components/tabs/tab.vue +85 -0
- package/dist/runtime/components/tabs/tab.vue.d.ts +22 -0
- package/dist/runtime/components/tabs/types.d.ts +19 -0
- package/dist/runtime/components/tabs/types.js +0 -0
- package/dist/runtime/components/tabs/use-reorder.d.ts +10 -0
- package/dist/runtime/components/tabs/use-reorder.js +90 -0
- package/dist/runtime/components/tabs/use-tabs.d.ts +46 -0
- package/dist/runtime/components/tabs/use-tabs.js +101 -0
- package/dist/runtime/components/ui/sidebar/SidebarMenuAction.vue +1 -1
- package/dist/runtime/components/ui/sidebar/index.js +2 -2
- package/dist/runtime/share/reorder.d.ts +2 -0
- package/dist/runtime/share/reorder.js +12 -0
- package/dist/runtime/utils/nav-registry.d.ts +19 -0
- package/dist/runtime/utils/nav-registry.js +14 -0
- package/dist/runtime/utils/page-title-registry.d.ts +3 -0
- package/dist/runtime/utils/page-title-registry.js +11 -0
- package/package.json +1 -1
|
@@ -36,19 +36,19 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
36
36
|
}[]] | undefined;
|
|
37
37
|
readonly keywords?: string | undefined;
|
|
38
38
|
readonly readonly?: string | undefined;
|
|
39
|
+
readonly binding: string;
|
|
40
|
+
readonly derived?: {
|
|
41
|
+
readonly mode: "formula" | "prefill";
|
|
42
|
+
readonly expression: string;
|
|
43
|
+
} | undefined;
|
|
39
44
|
readonly dataSource: {
|
|
40
45
|
readonly data: string;
|
|
41
46
|
readonly request?: string | undefined;
|
|
42
47
|
};
|
|
48
|
+
readonly enableSorting?: boolean | undefined;
|
|
43
49
|
readonly nodeKey: string;
|
|
44
50
|
readonly nodeChildren: string;
|
|
45
51
|
readonly nodeLabel: string;
|
|
46
|
-
readonly enableSorting?: boolean | undefined;
|
|
47
|
-
readonly binding: string;
|
|
48
|
-
readonly derived?: {
|
|
49
|
-
readonly mode: "formula" | "prefill";
|
|
50
|
-
readonly expression: string;
|
|
51
|
-
} | undefined;
|
|
52
52
|
readonly nodeTooltip?: readonly [{
|
|
53
53
|
readonly locale: "zh";
|
|
54
54
|
readonly message: string;
|
|
@@ -94,19 +94,19 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
94
94
|
}[]] | undefined;
|
|
95
95
|
readonly keywords?: string | undefined;
|
|
96
96
|
readonly readonly?: string | undefined;
|
|
97
|
+
readonly binding: string;
|
|
98
|
+
readonly derived?: {
|
|
99
|
+
readonly mode: "formula" | "prefill";
|
|
100
|
+
readonly expression: string;
|
|
101
|
+
} | undefined;
|
|
97
102
|
readonly dataSource: {
|
|
98
103
|
readonly data: string;
|
|
99
104
|
readonly request?: string | undefined;
|
|
100
105
|
};
|
|
106
|
+
readonly enableSorting?: boolean | undefined;
|
|
101
107
|
readonly nodeKey: string;
|
|
102
108
|
readonly nodeChildren: string;
|
|
103
109
|
readonly nodeLabel: string;
|
|
104
|
-
readonly enableSorting?: boolean | undefined;
|
|
105
|
-
readonly binding: string;
|
|
106
|
-
readonly derived?: {
|
|
107
|
-
readonly mode: "formula" | "prefill";
|
|
108
|
-
readonly expression: string;
|
|
109
|
-
} | undefined;
|
|
110
110
|
readonly nodeTooltip?: readonly [{
|
|
111
111
|
readonly locale: "zh";
|
|
112
112
|
readonly message: string;
|
|
@@ -157,40 +157,6 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
|
|
|
157
157
|
readonly message: string;
|
|
158
158
|
}[]] | undefined;
|
|
159
159
|
}[];
|
|
160
|
-
readonly query?: {
|
|
161
|
-
readonly style?: string | undefined;
|
|
162
|
-
readonly id?: string | undefined;
|
|
163
|
-
readonly initial?: {
|
|
164
|
-
readonly data: string;
|
|
165
|
-
readonly request?: string | undefined;
|
|
166
|
-
} | undefined;
|
|
167
|
-
readonly displayName?: string | undefined;
|
|
168
|
-
readonly kind: "shwfed.component.form";
|
|
169
|
-
readonly fields: readonly any[];
|
|
170
|
-
readonly layouts: readonly {
|
|
171
|
-
readonly name: string;
|
|
172
|
-
readonly layout: {
|
|
173
|
-
readonly style?: string | undefined;
|
|
174
|
-
readonly columns: number;
|
|
175
|
-
readonly gap?: number | undefined;
|
|
176
|
-
readonly rows?: number | undefined;
|
|
177
|
-
readonly placements: {
|
|
178
|
-
readonly [x: string]: {
|
|
179
|
-
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
180
|
-
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
181
|
-
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
readonly media?: string | undefined;
|
|
186
|
-
}[];
|
|
187
|
-
readonly readonly?: string | undefined;
|
|
188
|
-
} | undefined;
|
|
189
|
-
readonly dataSource?: {
|
|
190
|
-
readonly data: string;
|
|
191
|
-
readonly total?: string | undefined;
|
|
192
|
-
readonly request?: string | undefined;
|
|
193
|
-
} | undefined;
|
|
194
160
|
readonly actions?: {
|
|
195
161
|
readonly size: "default" | "sm" | "xs";
|
|
196
162
|
readonly style?: string | undefined;
|
|
@@ -258,6 +224,40 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
|
|
|
258
224
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
259
225
|
}[];
|
|
260
226
|
} | undefined;
|
|
227
|
+
readonly query?: {
|
|
228
|
+
readonly style?: string | undefined;
|
|
229
|
+
readonly id?: string | undefined;
|
|
230
|
+
readonly initial?: {
|
|
231
|
+
readonly data: string;
|
|
232
|
+
readonly request?: string | undefined;
|
|
233
|
+
} | undefined;
|
|
234
|
+
readonly displayName?: string | undefined;
|
|
235
|
+
readonly kind: "shwfed.component.form";
|
|
236
|
+
readonly fields: readonly any[];
|
|
237
|
+
readonly layouts: readonly {
|
|
238
|
+
readonly name: string;
|
|
239
|
+
readonly layout: {
|
|
240
|
+
readonly style?: string | undefined;
|
|
241
|
+
readonly columns: number;
|
|
242
|
+
readonly gap?: number | undefined;
|
|
243
|
+
readonly rows?: number | undefined;
|
|
244
|
+
readonly placements: {
|
|
245
|
+
readonly [x: string]: {
|
|
246
|
+
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
247
|
+
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
248
|
+
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly media?: string | undefined;
|
|
253
|
+
}[];
|
|
254
|
+
readonly readonly?: string | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
readonly dataSource?: {
|
|
257
|
+
readonly data: string;
|
|
258
|
+
readonly total?: string | undefined;
|
|
259
|
+
readonly request?: string | undefined;
|
|
260
|
+
} | undefined;
|
|
261
261
|
readonly bottomActions?: {
|
|
262
262
|
readonly size: "default" | "sm" | "xs";
|
|
263
263
|
readonly style?: string | undefined;
|
|
@@ -826,40 +826,6 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
|
|
|
826
826
|
readonly message: string;
|
|
827
827
|
}[]] | undefined;
|
|
828
828
|
}[];
|
|
829
|
-
query?: {
|
|
830
|
-
readonly style?: string | undefined;
|
|
831
|
-
readonly id?: string | undefined;
|
|
832
|
-
readonly initial?: {
|
|
833
|
-
readonly data: string;
|
|
834
|
-
readonly request?: string | undefined;
|
|
835
|
-
} | undefined;
|
|
836
|
-
readonly displayName?: string | undefined;
|
|
837
|
-
readonly kind: "shwfed.component.form";
|
|
838
|
-
readonly fields: readonly any[];
|
|
839
|
-
readonly layouts: readonly {
|
|
840
|
-
readonly name: string;
|
|
841
|
-
readonly layout: {
|
|
842
|
-
readonly style?: string | undefined;
|
|
843
|
-
readonly columns: number;
|
|
844
|
-
readonly gap?: number | undefined;
|
|
845
|
-
readonly rows?: number | undefined;
|
|
846
|
-
readonly placements: {
|
|
847
|
-
readonly [x: string]: {
|
|
848
|
-
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
849
|
-
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
850
|
-
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
851
|
-
};
|
|
852
|
-
};
|
|
853
|
-
};
|
|
854
|
-
readonly media?: string | undefined;
|
|
855
|
-
}[];
|
|
856
|
-
readonly readonly?: string | undefined;
|
|
857
|
-
} | undefined;
|
|
858
|
-
dataSource?: {
|
|
859
|
-
readonly data: string;
|
|
860
|
-
readonly total?: string | undefined;
|
|
861
|
-
readonly request?: string | undefined;
|
|
862
|
-
} | undefined;
|
|
863
829
|
actions?: {
|
|
864
830
|
readonly size: "default" | "sm" | "xs";
|
|
865
831
|
readonly style?: string | undefined;
|
|
@@ -927,6 +893,40 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
|
|
|
927
893
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
928
894
|
}[];
|
|
929
895
|
} | undefined;
|
|
896
|
+
query?: {
|
|
897
|
+
readonly style?: string | undefined;
|
|
898
|
+
readonly id?: string | undefined;
|
|
899
|
+
readonly initial?: {
|
|
900
|
+
readonly data: string;
|
|
901
|
+
readonly request?: string | undefined;
|
|
902
|
+
} | undefined;
|
|
903
|
+
readonly displayName?: string | undefined;
|
|
904
|
+
readonly kind: "shwfed.component.form";
|
|
905
|
+
readonly fields: readonly any[];
|
|
906
|
+
readonly layouts: readonly {
|
|
907
|
+
readonly name: string;
|
|
908
|
+
readonly layout: {
|
|
909
|
+
readonly style?: string | undefined;
|
|
910
|
+
readonly columns: number;
|
|
911
|
+
readonly gap?: number | undefined;
|
|
912
|
+
readonly rows?: number | undefined;
|
|
913
|
+
readonly placements: {
|
|
914
|
+
readonly [x: string]: {
|
|
915
|
+
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
916
|
+
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
917
|
+
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
readonly media?: string | undefined;
|
|
922
|
+
}[];
|
|
923
|
+
readonly readonly?: string | undefined;
|
|
924
|
+
} | undefined;
|
|
925
|
+
dataSource?: {
|
|
926
|
+
readonly data: string;
|
|
927
|
+
readonly total?: string | undefined;
|
|
928
|
+
readonly request?: string | undefined;
|
|
929
|
+
} | undefined;
|
|
930
930
|
bottomActions?: {
|
|
931
931
|
readonly size: "default" | "sm" | "xs";
|
|
932
932
|
readonly style?: string | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import type { ReorderInstruction as RowReorderInstruction } from '../../../share/reorder.js';
|
|
2
|
+
export type { ReorderInstruction as RowReorderInstruction } from '../../../share/reorder.js';
|
|
3
|
+
export { applyReorder } from '../../../share/reorder.js';
|
|
3
4
|
export interface UseRowReorderOptions {
|
|
4
5
|
onReorder: (sourceId: string, targetId: string, position: RowReorderInstruction) => void;
|
|
5
6
|
isEnabled: () => boolean;
|
|
@@ -9,18 +9,7 @@ import {
|
|
|
9
9
|
attachInstruction,
|
|
10
10
|
extractInstruction
|
|
11
11
|
} from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
12
|
-
export
|
|
13
|
-
if (sourceIndex === targetIndex) return rows;
|
|
14
|
-
if (sourceIndex < 0 || sourceIndex >= rows.length) return rows;
|
|
15
|
-
if (targetIndex < 0 || targetIndex >= rows.length) return rows;
|
|
16
|
-
let insertIdx = targetIndex + (position === "reorder-below" ? 1 : 0);
|
|
17
|
-
if (sourceIndex < targetIndex) insertIdx -= 1;
|
|
18
|
-
if (insertIdx === sourceIndex) return rows;
|
|
19
|
-
const next = rows.slice();
|
|
20
|
-
const [moved] = next.splice(sourceIndex, 1);
|
|
21
|
-
next.splice(insertIdx, 0, moved);
|
|
22
|
-
return next;
|
|
23
|
-
}
|
|
12
|
+
export { applyReorder } from "../../../share/reorder.js";
|
|
24
13
|
const SOURCE_KIND = "shwfed-table-row";
|
|
25
14
|
export function useRowReorder(options) {
|
|
26
15
|
const instruction = ref(null);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
storageKey?: string;
|
|
3
|
+
home?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
home: string;
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onBeforeUnmount, onMounted } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { navigateTo, useHead, useRoute, useRouter, useRuntimeConfig } from "#app";
|
|
5
|
+
import ShwfedTab from "./tab.vue";
|
|
6
|
+
import { useTabStore } from "./use-tabs";
|
|
7
|
+
import { useTabReorder } from "./use-reorder";
|
|
8
|
+
defineOptions({ name: "ShwfedTabs" });
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
storageKey: { type: String, required: false },
|
|
11
|
+
home: { type: String, required: false, default: "/" }
|
|
12
|
+
});
|
|
13
|
+
const runtimeConfig = useRuntimeConfig();
|
|
14
|
+
const job = runtimeConfig.public.shwfed.ci.job;
|
|
15
|
+
const store = useTabStore(props.storageKey ?? `shwfed:tabs:${job ?? "default"}`);
|
|
16
|
+
const tabs = store.tabs;
|
|
17
|
+
const activePath = store.activePath;
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
const route = useRoute();
|
|
20
|
+
const { locale } = useI18n({ useScope: "global", inheritLocale: true });
|
|
21
|
+
useHead(() => {
|
|
22
|
+
const tab = tabs.value.find((t) => t.path === activePath.value);
|
|
23
|
+
return tab ? { title: store.resolveTitle(tab, locale.value) } : {};
|
|
24
|
+
});
|
|
25
|
+
let stopAfterEach;
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
store.openOrFocus(route.path, route.fullPath);
|
|
28
|
+
stopAfterEach = router.afterEach((to) => {
|
|
29
|
+
store.openOrFocus(to.path, to.fullPath);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
onBeforeUnmount(() => stopAfterEach?.());
|
|
33
|
+
const reorder = useTabReorder({
|
|
34
|
+
onReorder: (sourcePath, targetPath, edge) => {
|
|
35
|
+
store.reorder(sourcePath, targetPath, edge === "left" ? "reorder-above" : "reorder-below");
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function onActivate(tab) {
|
|
39
|
+
if (tab.path !== activePath.value) void navigateTo(tab.fullPath);
|
|
40
|
+
}
|
|
41
|
+
function onClose(path) {
|
|
42
|
+
const dest = store.close(path, props.home);
|
|
43
|
+
if (dest) void navigateTo(dest);
|
|
44
|
+
}
|
|
45
|
+
function onCloseOthers(path) {
|
|
46
|
+
const dest = store.closeOthers(path);
|
|
47
|
+
if (dest) void navigateTo(dest);
|
|
48
|
+
}
|
|
49
|
+
function onCloseRight(path) {
|
|
50
|
+
const dest = store.closeToRight(path);
|
|
51
|
+
if (dest) void navigateTo(dest);
|
|
52
|
+
}
|
|
53
|
+
function onWheel(event) {
|
|
54
|
+
const el = event.currentTarget;
|
|
55
|
+
if (!el) return;
|
|
56
|
+
if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) return;
|
|
57
|
+
el.scrollLeft += event.deltaY;
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<ClientOnly>
|
|
64
|
+
<div
|
|
65
|
+
v-if="tabs.length"
|
|
66
|
+
class="w-full border-b border-zinc-200 bg-zinc-50"
|
|
67
|
+
>
|
|
68
|
+
<!-- Scroller: overflow-x with the native scrollbar hidden (Firefox +
|
|
69
|
+
WebKit). The vertical-wheel handler drives horizontal scroll, so no
|
|
70
|
+
scrollbar is shown at all. -->
|
|
71
|
+
<div
|
|
72
|
+
class="flex h-9 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
73
|
+
@wheel="onWheel"
|
|
74
|
+
>
|
|
75
|
+
<ShwfedTab
|
|
76
|
+
v-for="tab in tabs"
|
|
77
|
+
:key="tab.path"
|
|
78
|
+
:title="store.resolveTitle(tab, locale)"
|
|
79
|
+
:active="tab.path === activePath"
|
|
80
|
+
:edge="reorder.edgeFor(tab.path)"
|
|
81
|
+
:dragging="reorder.isDragging(tab.path)"
|
|
82
|
+
:closable="tabs.length > 1"
|
|
83
|
+
:register="(el) => reorder.setTab(tab.path, el)"
|
|
84
|
+
@activate="onActivate(tab)"
|
|
85
|
+
@close="onClose(tab.path)"
|
|
86
|
+
@close-others="onCloseOthers(tab.path)"
|
|
87
|
+
@close-right="onCloseRight(tab.path)"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</ClientOnly>
|
|
92
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
storageKey?: string;
|
|
3
|
+
home?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
home: string;
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TabEdge } from './use-reorder.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
edge: TabEdge | null;
|
|
6
|
+
dragging: boolean;
|
|
7
|
+
closable: boolean;
|
|
8
|
+
register: (el: HTMLElement | null) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
close: () => any;
|
|
12
|
+
activate: () => any;
|
|
13
|
+
closeOthers: () => any;
|
|
14
|
+
closeRight: () => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
onActivate?: (() => any) | undefined;
|
|
18
|
+
onCloseOthers?: (() => any) | undefined;
|
|
19
|
+
onCloseRight?: (() => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onBeforeUnmount, onMounted, ref } from "vue";
|
|
3
|
+
import { Icon } from "@iconify/vue";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
import {
|
|
6
|
+
ContextMenu,
|
|
7
|
+
ContextMenuContent,
|
|
8
|
+
ContextMenuItem,
|
|
9
|
+
ContextMenuTrigger
|
|
10
|
+
} from "../ui/context-menu";
|
|
11
|
+
defineOptions({ name: "ShwfedTab" });
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
title: { type: String, required: true },
|
|
14
|
+
active: { type: Boolean, required: true },
|
|
15
|
+
edge: { type: [String, null], required: true },
|
|
16
|
+
dragging: { type: Boolean, required: true },
|
|
17
|
+
closable: { type: Boolean, required: true },
|
|
18
|
+
register: { type: Function, required: true }
|
|
19
|
+
});
|
|
20
|
+
const emit = defineEmits(["activate", "close", "closeOthers", "closeRight"]);
|
|
21
|
+
const { t } = useI18n({
|
|
22
|
+
inheritLocale: true,
|
|
23
|
+
useScope: "global",
|
|
24
|
+
messages: {
|
|
25
|
+
zh: { close: "\u5173\u95ED", closeOthers: "\u5173\u95ED\u5176\u4ED6", closeRight: "\u5173\u95ED\u53F3\u4FA7" },
|
|
26
|
+
en: { close: "Close", closeOthers: "Close others", closeRight: "Close to the right" },
|
|
27
|
+
ja: { close: "\u9589\u3058\u308B", closeOthers: "\u4ED6\u3092\u9589\u3058\u308B", closeRight: "\u53F3\u5074\u3092\u9589\u3058\u308B" },
|
|
28
|
+
ko: { close: "\uB2EB\uAE30", closeOthers: "\uB2E4\uB978 \uD0ED \uB2EB\uAE30", closeRight: "\uC624\uB978\uCABD \uD0ED \uB2EB\uAE30" }
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const root = ref(null);
|
|
32
|
+
onMounted(() => props.register(root.value));
|
|
33
|
+
onBeforeUnmount(() => props.register(null));
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<ContextMenu>
|
|
38
|
+
<ContextMenuTrigger
|
|
39
|
+
as-child
|
|
40
|
+
:disabled="!closable"
|
|
41
|
+
>
|
|
42
|
+
<!-- Fixed width so consecutive closes keep every close button in the same
|
|
43
|
+
spot (Chrome-style). The close button stays in layout (`opacity-0`, not
|
|
44
|
+
hidden) and only reveals on hover / focus-within, so nothing reflows. -->
|
|
45
|
+
<div
|
|
46
|
+
ref="root"
|
|
47
|
+
class="group relative flex h-full w-40 shrink-0 cursor-default select-none items-center gap-1.5 border-r border-zinc-200 px-3 text-sm outline-none transition-colors"
|
|
48
|
+
:class="[
|
|
49
|
+
active ? 'bg-white text-zinc-900' : 'bg-zinc-50 text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600',
|
|
50
|
+
dragging ? 'opacity-50' : ''
|
|
51
|
+
]"
|
|
52
|
+
@click="emit('activate')"
|
|
53
|
+
>
|
|
54
|
+
<span class="flex-1 truncate">{{ title }}</span>
|
|
55
|
+
<button
|
|
56
|
+
v-if="closable"
|
|
57
|
+
type="button"
|
|
58
|
+
class="flex size-4 shrink-0 items-center justify-center rounded-sm text-zinc-400 opacity-0 outline-none transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 hover:bg-zinc-200 hover:text-zinc-700"
|
|
59
|
+
@click.stop="emit('close')"
|
|
60
|
+
>
|
|
61
|
+
<Icon icon="fluent:dismiss-12-regular" />
|
|
62
|
+
</button>
|
|
63
|
+
<span
|
|
64
|
+
v-if="edge"
|
|
65
|
+
class="absolute inset-y-0 z-10 w-0.5 bg-(--primary)"
|
|
66
|
+
:class="edge === 'left' ? '-left-px' : '-right-px'"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</ContextMenuTrigger>
|
|
70
|
+
<ContextMenuContent class="min-w-44">
|
|
71
|
+
<ContextMenuItem @select="emit('close')">
|
|
72
|
+
<Icon icon="fluent:dismiss-20-regular" />
|
|
73
|
+
{{ t("close") }}
|
|
74
|
+
</ContextMenuItem>
|
|
75
|
+
<ContextMenuItem @select="emit('closeOthers')">
|
|
76
|
+
<Icon icon="fluent:dismiss-circle-20-regular" />
|
|
77
|
+
{{ t("closeOthers") }}
|
|
78
|
+
</ContextMenuItem>
|
|
79
|
+
<ContextMenuItem @select="emit('closeRight')">
|
|
80
|
+
<Icon icon="fluent:panel-right-20-regular" />
|
|
81
|
+
{{ t("closeRight") }}
|
|
82
|
+
</ContextMenuItem>
|
|
83
|
+
</ContextMenuContent>
|
|
84
|
+
</ContextMenu>
|
|
85
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TabEdge } from './use-reorder.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
edge: TabEdge | null;
|
|
6
|
+
dragging: boolean;
|
|
7
|
+
closable: boolean;
|
|
8
|
+
register: (el: HTMLElement | null) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
close: () => any;
|
|
12
|
+
activate: () => any;
|
|
13
|
+
closeOthers: () => any;
|
|
14
|
+
closeRight: () => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
onActivate?: (() => any) | undefined;
|
|
18
|
+
onCloseOthers?: (() => any) | undefined;
|
|
19
|
+
onCloseRight?: (() => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One open tab in the app-level MDI strip.
|
|
3
|
+
*
|
|
4
|
+
* Identity is `path` alone — `/orders?status=open` and `/orders?status=closed`
|
|
5
|
+
* are the SAME `/orders` tab. Dedupe, ordering, persistence, and the context
|
|
6
|
+
* menu all key off `path`. The query is page state (read by the page via CEL
|
|
7
|
+
* `location`), never a tab-identity dimension.
|
|
8
|
+
*
|
|
9
|
+
* `fullPath` is the last full URL (path + query) the tab was navigated to, so
|
|
10
|
+
* returning to a tab restores its query view rather than dropping the query.
|
|
11
|
+
*
|
|
12
|
+
* `pinned` (no UI yet) marks a tab that bulk-close operations spare and that
|
|
13
|
+
* `close` refuses to remove — reserved for a future home / pinned-tab feature.
|
|
14
|
+
*/
|
|
15
|
+
export interface Tab {
|
|
16
|
+
path: string;
|
|
17
|
+
fullPath: string;
|
|
18
|
+
pinned?: boolean;
|
|
19
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TabEdge = 'left' | 'right';
|
|
2
|
+
export interface UseTabReorderOptions {
|
|
3
|
+
onReorder: (sourcePath: string, targetPath: string, edge: TabEdge) => void;
|
|
4
|
+
}
|
|
5
|
+
export interface TabReorderApi {
|
|
6
|
+
setTab: (path: string, el: HTMLElement | null) => void;
|
|
7
|
+
edgeFor: (path: string) => TabEdge | null;
|
|
8
|
+
isDragging: (path: string) => boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function useTabReorder(options: UseTabReorderOptions): TabReorderApi;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { onBeforeUnmount, ref } from "vue";
|
|
2
|
+
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
3
|
+
import {
|
|
4
|
+
draggable,
|
|
5
|
+
dropTargetForElements
|
|
6
|
+
} from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
7
|
+
import {
|
|
8
|
+
attachClosestEdge,
|
|
9
|
+
extractClosestEdge
|
|
10
|
+
} from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
11
|
+
const SOURCE_KIND = "shwfed-tab";
|
|
12
|
+
export function useTabReorder(options) {
|
|
13
|
+
const indicator = ref(null);
|
|
14
|
+
const dragging = ref(null);
|
|
15
|
+
const regs = /* @__PURE__ */ new Map();
|
|
16
|
+
function rewire(path, reg) {
|
|
17
|
+
reg.cleanup?.();
|
|
18
|
+
if (!reg.el) {
|
|
19
|
+
reg.cleanup = null;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const el = reg.el;
|
|
23
|
+
reg.cleanup = combine(
|
|
24
|
+
draggable({
|
|
25
|
+
element: el,
|
|
26
|
+
getInitialData: () => ({ kind: SOURCE_KIND, path }),
|
|
27
|
+
onDragStart: () => {
|
|
28
|
+
dragging.value = path;
|
|
29
|
+
},
|
|
30
|
+
onDrop: () => {
|
|
31
|
+
dragging.value = null;
|
|
32
|
+
if (indicator.value) indicator.value = null;
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
dropTargetForElements({
|
|
36
|
+
element: el,
|
|
37
|
+
canDrop: ({ source }) => source.data.kind === SOURCE_KIND && source.data.path !== path,
|
|
38
|
+
getIsSticky: () => true,
|
|
39
|
+
getData: ({ input, element }) => attachClosestEdge(
|
|
40
|
+
{ kind: `${SOURCE_KIND}-target`, path },
|
|
41
|
+
{ input, element, allowedEdges: ["left", "right"] }
|
|
42
|
+
),
|
|
43
|
+
onDrag: ({ self }) => {
|
|
44
|
+
const edge = extractClosestEdge(self.data);
|
|
45
|
+
if (edge === "left" || edge === "right") indicator.value = { path, edge };
|
|
46
|
+
else if (indicator.value?.path === path) indicator.value = null;
|
|
47
|
+
},
|
|
48
|
+
onDragLeave: () => {
|
|
49
|
+
if (indicator.value?.path === path) indicator.value = null;
|
|
50
|
+
},
|
|
51
|
+
onDrop: ({ source, self }) => {
|
|
52
|
+
indicator.value = null;
|
|
53
|
+
const edge = extractClosestEdge(self.data);
|
|
54
|
+
const sourcePath = typeof source.data.path === "string" ? source.data.path : null;
|
|
55
|
+
if ((edge === "left" || edge === "right") && sourcePath && sourcePath !== path) {
|
|
56
|
+
options.onReorder(sourcePath, path, edge);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function setTab(path, el) {
|
|
63
|
+
let reg = regs.get(path);
|
|
64
|
+
if (!reg) {
|
|
65
|
+
reg = { el: null, cleanup: null };
|
|
66
|
+
regs.set(path, reg);
|
|
67
|
+
}
|
|
68
|
+
if (reg.el === el) return;
|
|
69
|
+
reg.el = el;
|
|
70
|
+
rewire(path, reg);
|
|
71
|
+
if (!reg.el && !reg.cleanup) {
|
|
72
|
+
regs.delete(path);
|
|
73
|
+
if (indicator.value?.path === path) indicator.value = null;
|
|
74
|
+
if (dragging.value === path) dragging.value = null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function edgeFor(path) {
|
|
78
|
+
return indicator.value?.path === path ? indicator.value.edge : null;
|
|
79
|
+
}
|
|
80
|
+
function isDragging(path) {
|
|
81
|
+
return dragging.value === path;
|
|
82
|
+
}
|
|
83
|
+
onBeforeUnmount(() => {
|
|
84
|
+
for (const reg of regs.values()) reg.cleanup?.();
|
|
85
|
+
regs.clear();
|
|
86
|
+
indicator.value = null;
|
|
87
|
+
dragging.value = null;
|
|
88
|
+
});
|
|
89
|
+
return { setTab, edgeFor, isDragging };
|
|
90
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import { type ReorderInstruction } from '../../share/reorder.js';
|
|
3
|
+
import type { Tab } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The app-level tab store — a client singleton (per the module's "runtime
|
|
6
|
+
* singletons, not Nuxt injections" direction). Holds the open tabs (persisted to
|
|
7
|
+
* `sessionStorage` so they survive a refresh but die with the browser tab) and
|
|
8
|
+
* the resolved title logic.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately framework-free: it never touches the router. Mutations that imply
|
|
11
|
+
* a navigation RETURN the `fullPath` the caller should navigate to (or `null`
|
|
12
|
+
* when no navigation is needed); the `ShwfedTabs` strip performs the actual
|
|
13
|
+
* `navigateTo`. This keeps the store trivially unit-testable and lets other
|
|
14
|
+
* call sites (the page `close` operation) reuse it without a router in scope.
|
|
15
|
+
*/
|
|
16
|
+
export interface TabStore {
|
|
17
|
+
tabs: Ref<Tab[]>;
|
|
18
|
+
activePath: Ref<string | null>;
|
|
19
|
+
/** Ensure a tab for `path` exists and mark it active (route-change driven). */
|
|
20
|
+
openOrFocus: (path: string, fullPath: string) => void;
|
|
21
|
+
/** Remove a tab; returns the fullPath to navigate to when the active tab was closed. */
|
|
22
|
+
close: (path: string, home?: string) => string | null;
|
|
23
|
+
/** Keep only `path` (and pinned tabs); returns a nav target if the active tab was closed. */
|
|
24
|
+
closeOthers: (path: string) => string | null;
|
|
25
|
+
/** Close non-pinned tabs to the right of `path`; returns a nav target if active was closed. */
|
|
26
|
+
closeToRight: (path: string) => string | null;
|
|
27
|
+
reorder: (sourcePath: string, targetPath: string, instruction: ReorderInstruction) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Title precedence: page title (by path) → nav label (query-specific by
|
|
30
|
+
* fullPath, else by path) → raw path. Takes the tab so the title can reflect
|
|
31
|
+
* the current query variant while identity stays path-only.
|
|
32
|
+
*/
|
|
33
|
+
resolveTitle: (tab: {
|
|
34
|
+
path: string;
|
|
35
|
+
fullPath: string;
|
|
36
|
+
}, locale: string) => string;
|
|
37
|
+
hasTab: (path: string) => boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function createTabStore(storageKey: string): TabStore;
|
|
40
|
+
/**
|
|
41
|
+
* Access the shared tab store. Created once, in a detached effect scope so its
|
|
42
|
+
* `sessionStorage` reactivity is not disposed when the first component that
|
|
43
|
+
* touched it unmounts. `storageKey` only takes effect on first creation (there
|
|
44
|
+
* is one strip per app).
|
|
45
|
+
*/
|
|
46
|
+
export declare function useTabStore(storageKey?: string): TabStore;
|