@shwfed/config 2.3.11 → 2.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/mcp.mjs +664 -525
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-DNokxY7M.js → config-B-1L3Ra-.js} +1 -1
  4. package/dist/preview/assets/{config-_uPI8qV-.js → config-Cf5kO84H.js} +1 -1
  5. package/dist/preview/assets/{config-Bp91DUdU.js → config-DTQkLHVw.js} +1 -1
  6. package/dist/preview/assets/{config-_msO_f2R.js → config-DqxN0Byp.js} +1 -1
  7. package/dist/preview/assets/{config-BZahzuEc.js → config-QUQ71Eo6.js} +1 -1
  8. package/dist/preview/assets/{config-BnZQO-Sp.js → config-oO93sSer.js} +1 -1
  9. package/dist/preview/assets/{config-Be-2ZA2R.js → config-sJ5XKUJy.js} +1 -1
  10. package/dist/preview/assets/{config-57-v4VXo.js → config-zCMkbPQt.js} +1 -1
  11. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-BtScXbs1.js → definition.vue_vue_type_script_setup_true_lang-D-OVRv68.js} +1 -1
  12. package/dist/preview/assets/index-Br_eXThF.css +1 -0
  13. package/dist/preview/assets/index-D8QyOVfp.js +637 -0
  14. package/dist/preview/assets/index-b_t8yWJJ.js +1 -0
  15. package/dist/preview/assets/{runtime-BBms4myv.js → runtime-10_7L7Gz.js} +1 -1
  16. package/dist/preview/assets/{runtime-cKWSGFod.js → runtime-B2EP6060.js} +1 -1
  17. package/dist/preview/assets/{runtime-B9u14qqB.js → runtime-BxlgShjU.js} +1 -1
  18. package/dist/preview/assets/{runtime-Dk9u-Ybw.js → runtime-Cv2doZNu.js} +1 -1
  19. package/dist/preview/assets/{runtime-XXqIAt53.js → runtime-CzDUrqSa.js} +1 -1
  20. package/dist/preview/assets/{runtime-CfR7ZAND.js → runtime-DcYhXvSk.js} +1 -1
  21. package/dist/preview/assets/{runtime-w7V-p3t1.js → runtime-DlDhRVII.js} +1 -1
  22. package/dist/preview/assets/{runtime-D3EyeiyA.js → runtime-cmkN6aik.js} +1 -1
  23. package/dist/preview/index.html +2 -2
  24. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
  25. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +4 -0
  26. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.js +6 -17
  27. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
  28. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
  29. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +4 -4
  30. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +4 -4
  31. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +22 -22
  32. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +22 -22
  33. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
  34. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
  35. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
  36. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
  37. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +12 -12
  38. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +12 -12
  39. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +10 -10
  40. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +10 -10
  41. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.d.vue.ts +12 -12
  42. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue.d.ts +12 -12
  43. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +133 -0
  44. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue +605 -0
  45. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +133 -0
  46. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.d.vue.ts +8 -0
  47. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +324 -0
  48. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue.d.ts +8 -0
  49. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +99 -0
  50. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +129 -0
  51. package/dist/runtime/components/form/unit-config.vue +0 -23
  52. package/dist/runtime/components/table/config.d.vue.ts +2 -2
  53. package/dist/runtime/components/table/config.vue +5 -45
  54. package/dist/runtime/components/table/config.vue.d.ts +2 -2
  55. package/dist/runtime/components/table/schema.d.ts +9 -2
  56. package/dist/runtime/components/table/schema.js +30 -14
  57. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.d.vue.ts +1 -1
  58. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.vue.d.ts +1 -1
  59. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +1 -1
  60. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +1 -1
  61. package/dist/runtime/components/ui/tree/Tree.d.vue.ts +57 -0
  62. package/dist/runtime/components/ui/tree/Tree.vue +325 -0
  63. package/dist/runtime/components/ui/tree/Tree.vue.d.ts +57 -0
  64. package/dist/runtime/components/ui/tree/TreeNode.d.vue.ts +53 -0
  65. package/dist/runtime/components/ui/tree/TreeNode.vue +299 -0
  66. package/dist/runtime/components/ui/tree/TreeNode.vue.d.ts +53 -0
  67. package/dist/runtime/components/ui/tree/index.d.ts +3 -0
  68. package/dist/runtime/components/ui/tree/index.js +2 -0
  69. package/dist/runtime/components/ui/tree/types.d.ts +120 -0
  70. package/dist/runtime/components/ui/tree/types.js +0 -0
  71. package/dist/runtime/components/ui/tree/useTreeState.d.ts +95 -0
  72. package/dist/runtime/components/ui/tree/useTreeState.js +369 -0
  73. package/dist/runtime/shims.d.ts +2 -0
  74. package/package.json +1 -1
  75. package/dist/preview/assets/index-DDbl2Atj.js +0 -1
  76. package/dist/preview/assets/index-DGa3Oj3y.js +0 -1075
  77. package/dist/preview/assets/index-mbGtsgdv.css +0 -1
  78. package/dist/runtime/components/form/ai/fields-button.d.vue.ts +0 -13
  79. package/dist/runtime/components/form/ai/fields-button.vue +0 -460
  80. package/dist/runtime/components/form/ai/fields-button.vue.d.ts +0 -13
  81. package/dist/runtime/components/form/ai/fields-task.md +0 -71
  82. package/dist/runtime/components/table/ai/columns-button.d.vue.ts +0 -12
  83. package/dist/runtime/components/table/ai/columns-button.vue +0 -492
  84. package/dist/runtime/components/table/ai/columns-button.vue.d.ts +0 -12
  85. package/dist/runtime/components/table/ai/columns-task.md +0 -53
  86. package/dist/runtime/components/table/ai/data-source-button.d.vue.ts +0 -20
  87. package/dist/runtime/components/table/ai/data-source-button.vue +0 -324
  88. package/dist/runtime/components/table/ai/data-source-button.vue.d.ts +0 -20
  89. package/dist/runtime/components/table/ai/data-source-task.md +0 -17
  90. package/dist/runtime/utils/ai/cel-prompt.d.ts +0 -11
  91. package/dist/runtime/utils/ai/cel-prompt.js +0 -27
@@ -0,0 +1,369 @@
1
+ import { computed, reactive, ref, shallowRef } from "vue";
2
+ import { Cause, Effect, Exit } from "effect";
3
+ export function useTreeState(opts) {
4
+ const expanded = reactive(new Set(opts.initialExpanded()));
5
+ const selected = reactive(new Set(opts.initialSelection()));
6
+ const loadState = reactive(/* @__PURE__ */ new Map());
7
+ const requested = reactive(/* @__PURE__ */ new Set());
8
+ const focusedKey = ref(null);
9
+ const rootsView = shallowRef(opts.rootsRef.value);
10
+ /* @__PURE__ */ ((roots) => {
11
+ void roots;
12
+ })(opts.rootsRef);
13
+ function syncRoots() {
14
+ rootsView.value = opts.rootsRef.value;
15
+ }
16
+ function locate(key) {
17
+ const stack = [
18
+ { siblings: rootsView.value, parent: null, depth: 0 }
19
+ ];
20
+ while (stack.length) {
21
+ const frame = stack.pop();
22
+ for (let i = 0; i < frame.siblings.length; i++) {
23
+ const n = frame.siblings[i];
24
+ if (opts.getKey(n) === key) {
25
+ return {
26
+ node: n,
27
+ parent: frame.parent,
28
+ depth: frame.depth,
29
+ index: i,
30
+ siblings: frame.siblings
31
+ };
32
+ }
33
+ const kids = resolvedChildren(n);
34
+ if (kids && kids.length) {
35
+ stack.push({ siblings: kids, parent: n, depth: frame.depth + 1 });
36
+ }
37
+ }
38
+ }
39
+ return null;
40
+ }
41
+ function resolvedChildren(node) {
42
+ const k = opts.getKey(node);
43
+ const cached = loadState.get(k);
44
+ if (cached?.status === "loaded") return cached.children;
45
+ const inline = opts.getChildren?.(node);
46
+ if (inline === void 0) {
47
+ if (opts.loadChildren) return null;
48
+ return void 0;
49
+ }
50
+ if (inline.length > 0) return inline;
51
+ if (opts.loadChildren) return null;
52
+ return inline;
53
+ }
54
+ function isExpandable(node) {
55
+ const cached = loadState.get(opts.getKey(node));
56
+ if (cached?.status === "loaded" && cached.children.length > 0) return true;
57
+ const inline = opts.getChildren?.(node);
58
+ if (inline === void 0) return false;
59
+ if (inline.length > 0) return true;
60
+ return Boolean(opts.loadChildren);
61
+ }
62
+ function ensureLoaded(node) {
63
+ const loader = opts.loadChildren;
64
+ if (!loader) return;
65
+ const inline = opts.getChildren?.(node);
66
+ if (!(inline !== void 0 && inline.length === 0)) return;
67
+ const key = opts.getKey(node);
68
+ if (requested.has(key)) return;
69
+ const prior = loadState.get(key);
70
+ if (prior?.status === "loaded") return;
71
+ requested.add(key);
72
+ loadState.set(key, { status: "loading" });
73
+ Effect.runPromiseExit(loader(node)).then((exit) => {
74
+ Exit.match(exit, {
75
+ onSuccess: (children) => {
76
+ loadState.set(key, { status: "loaded", children });
77
+ },
78
+ onFailure: (cause) => {
79
+ const failure = Cause.failureOption(cause);
80
+ const error = failure._tag === "Some" ? failure.value : cause;
81
+ loadState.set(key, { status: "error", error });
82
+ }
83
+ });
84
+ });
85
+ }
86
+ function retry(key) {
87
+ requested.delete(key);
88
+ loadState.delete(key);
89
+ const loc = locate(key);
90
+ if (loc) ensureLoaded(loc.node);
91
+ }
92
+ function invalidate(key) {
93
+ requested.delete(key);
94
+ loadState.delete(key);
95
+ }
96
+ function expand(key) {
97
+ const loc = locate(key);
98
+ if (!loc) return;
99
+ if (!isExpandable(loc.node)) return;
100
+ expanded.add(key);
101
+ ensureLoaded(loc.node);
102
+ }
103
+ function collapse(key) {
104
+ expanded.delete(key);
105
+ }
106
+ function toggleExpand(key) {
107
+ if (expanded.has(key)) collapse(key);
108
+ else expand(key);
109
+ }
110
+ function emitSelection() {
111
+ opts.onSelectionChange(Array.from(selected));
112
+ }
113
+ function selectSingle(key) {
114
+ selected.clear();
115
+ selected.add(key);
116
+ emitSelection();
117
+ }
118
+ function clearSelection() {
119
+ if (selected.size === 0) return;
120
+ selected.clear();
121
+ emitSelection();
122
+ }
123
+ function walkSubtree(node, visit, depth = 0) {
124
+ visit(node, depth);
125
+ const kids = resolvedChildren(node);
126
+ if (kids && kids.length > 0) {
127
+ for (const c of kids) walkSubtree(c, visit, depth + 1);
128
+ }
129
+ }
130
+ function cascadeToggle(node, depth, on) {
131
+ walkSubtree(node, (n, d) => {
132
+ if (!opts.selectable(n, depth + d)) return;
133
+ const k = opts.getKey(n);
134
+ if (on) selected.add(k);
135
+ else selected.delete(k);
136
+ });
137
+ }
138
+ function toggleMulti(key) {
139
+ const loc = locate(key);
140
+ if (!loc) return;
141
+ if (!opts.selectable(loc.node, loc.depth)) return;
142
+ const mode = opts.cascade();
143
+ const turningOn = !selected.has(key);
144
+ if (mode === "independent") {
145
+ if (turningOn) selected.add(key);
146
+ else selected.delete(key);
147
+ } else {
148
+ cascadeToggle(loc.node, loc.depth, turningOn);
149
+ }
150
+ emitSelection();
151
+ }
152
+ function selectKey(key) {
153
+ const mode = opts.selectionMode();
154
+ if (mode === "none") return;
155
+ if (mode === "single") {
156
+ const loc = locate(key);
157
+ if (!loc || !opts.selectable(loc.node, loc.depth)) return;
158
+ selectSingle(key);
159
+ return;
160
+ }
161
+ if (selected.has(key)) return;
162
+ toggleMulti(key);
163
+ }
164
+ function deselectKey(key) {
165
+ const mode = opts.selectionMode();
166
+ if (mode === "none") return;
167
+ if (mode === "single") {
168
+ if (!selected.has(key)) return;
169
+ selected.delete(key);
170
+ emitSelection();
171
+ return;
172
+ }
173
+ if (!selected.has(key)) return;
174
+ toggleMulti(key);
175
+ }
176
+ function descendantSelectionStats(node, depth) {
177
+ let total = 0;
178
+ let selectedCount = 0;
179
+ const kids = resolvedChildren(node);
180
+ if (!kids || kids.length === 0) return { total, selectedCount };
181
+ for (const c of kids) {
182
+ walkSubtree(c, (n, d) => {
183
+ if (!opts.selectable(n, depth + 1 + d)) return;
184
+ total++;
185
+ if (selected.has(opts.getKey(n))) selectedCount++;
186
+ });
187
+ }
188
+ return { selectedCount, total };
189
+ }
190
+ function isIndeterminate(node, depth) {
191
+ if (opts.selectionMode() !== "multi") return false;
192
+ if (opts.cascade() !== "cascade-both") return false;
193
+ const { selectedCount, total } = descendantSelectionStats(node, depth);
194
+ if (total === 0) return false;
195
+ return selectedCount > 0 && selectedCount < total;
196
+ }
197
+ function isVisuallySelected(node, depth) {
198
+ const k = opts.getKey(node);
199
+ if (selected.has(k)) return true;
200
+ if (opts.selectionMode() !== "multi") return false;
201
+ if (opts.cascade() !== "cascade-both") return false;
202
+ const { selectedCount, total } = descendantSelectionStats(node, depth);
203
+ return total > 0 && selectedCount === total;
204
+ }
205
+ function withMutation(next) {
206
+ opts.setRoots(next);
207
+ rootsView.value = next;
208
+ }
209
+ function mutateSiblings(parentKey, op) {
210
+ if (parentKey === null) {
211
+ const next = rootsView.value.slice();
212
+ op(next);
213
+ withMutation(next);
214
+ return true;
215
+ }
216
+ const parentLoc = locate(parentKey);
217
+ if (!parentLoc) return false;
218
+ const inline = opts.getChildren?.(parentLoc.node);
219
+ if (inline !== void 0) {
220
+ op(inline);
221
+ } else {
222
+ const ls = loadState.get(parentKey);
223
+ if (ls?.status === "loaded") {
224
+ op(ls.children);
225
+ } else {
226
+ const arr = [];
227
+ op(arr);
228
+ loadState.set(parentKey, { status: "loaded", children: arr });
229
+ requested.add(parentKey);
230
+ }
231
+ }
232
+ withMutation(rootsView.value.slice());
233
+ return true;
234
+ }
235
+ function insert(parentKey, node, index) {
236
+ mutateSiblings(parentKey, (siblings) => {
237
+ const at = index ?? siblings.length;
238
+ siblings.splice(Math.max(0, Math.min(at, siblings.length)), 0, node);
239
+ });
240
+ }
241
+ function remove(key) {
242
+ const loc = locate(key);
243
+ if (!loc) return;
244
+ loc.siblings.splice(loc.index, 1);
245
+ selected.delete(key);
246
+ expanded.delete(key);
247
+ loadState.delete(key);
248
+ requested.delete(key);
249
+ withMutation(rootsView.value.slice());
250
+ }
251
+ function move(key, newParentKey, index) {
252
+ const loc = locate(key);
253
+ if (!loc) return;
254
+ const [node] = loc.siblings.splice(loc.index, 1);
255
+ if (!node) return;
256
+ if (newParentKey === null) {
257
+ const next = rootsView.value.slice();
258
+ const at = Math.max(0, Math.min(index, next.length));
259
+ next.splice(at, 0, node);
260
+ withMutation(next);
261
+ return;
262
+ }
263
+ const parentLoc = locate(newParentKey);
264
+ if (!parentLoc) {
265
+ loc.siblings.splice(loc.index, 0, node);
266
+ return;
267
+ }
268
+ const inline = opts.getChildren?.(parentLoc.node);
269
+ if (inline !== void 0) {
270
+ const at = Math.max(0, Math.min(index, inline.length));
271
+ inline.splice(at, 0, node);
272
+ } else {
273
+ const ls = loadState.get(newParentKey);
274
+ if (ls?.status === "loaded") {
275
+ const at = Math.max(0, Math.min(index, ls.children.length));
276
+ ls.children.splice(at, 0, node);
277
+ } else {
278
+ const arr = [node];
279
+ loadState.set(newParentKey, { status: "loaded", children: arr });
280
+ requested.add(newParentKey);
281
+ }
282
+ }
283
+ withMutation(rootsView.value.slice());
284
+ }
285
+ function update(key, patch) {
286
+ const loc = locate(key);
287
+ if (!loc) return;
288
+ Object.assign(loc.node, patch);
289
+ withMutation(rootsView.value.slice());
290
+ }
291
+ function flattenVisible(filter) {
292
+ const out = [];
293
+ function walk(siblings, depth) {
294
+ for (const n of siblings) {
295
+ if (!filter || filter(n)) {
296
+ out.push({ node: n, depth, key: opts.getKey(n) });
297
+ }
298
+ const kids = resolvedChildren(n);
299
+ if (kids && kids.length > 0 && expanded.has(opts.getKey(n))) {
300
+ walk(kids, depth + 1);
301
+ }
302
+ }
303
+ }
304
+ walk(rootsView.value, 0);
305
+ return out;
306
+ }
307
+ function findPath(key) {
308
+ const trail = [];
309
+ function walk(siblings) {
310
+ for (const n of siblings) {
311
+ trail.push(n);
312
+ if (opts.getKey(n) === key) return true;
313
+ const kids = resolvedChildren(n);
314
+ if (kids && kids.length && walk(kids)) return true;
315
+ trail.pop();
316
+ }
317
+ return false;
318
+ }
319
+ return walk(rootsView.value) ? trail.slice() : null;
320
+ }
321
+ function snapshot() {
322
+ return {
323
+ roots: rootsView.value.slice(),
324
+ selected: Array.from(selected),
325
+ expanded: Array.from(expanded)
326
+ };
327
+ }
328
+ const selectedNodes = computed(() => {
329
+ const out = [];
330
+ for (const k of selected) {
331
+ const loc = locate(k);
332
+ if (loc) out.push(loc.node);
333
+ }
334
+ return out;
335
+ });
336
+ return {
337
+ // state (reactive)
338
+ expanded,
339
+ selected,
340
+ loadState,
341
+ focusedKey,
342
+ rootsView,
343
+ // queries
344
+ locate,
345
+ resolvedChildren,
346
+ isExpandable,
347
+ isIndeterminate,
348
+ isVisuallySelected,
349
+ flattenVisible,
350
+ selectedNodes,
351
+ // mutations / commands
352
+ syncRoots,
353
+ expand,
354
+ collapse,
355
+ toggleExpand,
356
+ selectKey,
357
+ deselectKey,
358
+ clearSelection,
359
+ toggleMulti,
360
+ insert,
361
+ remove,
362
+ move,
363
+ update,
364
+ invalidate,
365
+ retry,
366
+ findPath,
367
+ snapshot
368
+ };
369
+ }
@@ -2,3 +2,5 @@ declare module '*.md?raw' {
2
2
  const content: string
3
3
  export default content
4
4
  }
5
+
6
+ declare module '*.css'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.3.11",
3
+ "version": "2.3.12",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1 +0,0 @@
1
- import{aH as e}from"./index-DGa3Oj3y.js";import{aI as r,aJ as s,aK as t}from"./index-DGa3Oj3y.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};