@shwfed/config 2.12.7 → 2.12.9

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 (68) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
  3. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
  4. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
  5. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
  6. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
  7. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +6 -6
  8. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +6 -6
  9. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +8 -8
  10. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +8 -8
  11. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
  12. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
  13. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +6 -6
  14. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +6 -6
  15. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/config.d.vue.ts +15 -0
  16. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/config.vue +47 -0
  17. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/config.vue.d.ts +15 -0
  18. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/schema.d.ts +12 -0
  19. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/schema.js +28 -0
  20. package/dist/runtime/components/operations/utils/resolve.d.ts +7 -1
  21. package/dist/runtime/components/operations/utils/resolve.js +14 -6
  22. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
  23. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
  24. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
  25. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
  26. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
  27. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
  28. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
  29. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
  30. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
  31. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
  32. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
  33. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
  34. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  35. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  36. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  37. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  38. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  39. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  40. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  41. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  42. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  43. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  44. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  45. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  46. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  47. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  48. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  49. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  50. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  51. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  52. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  53. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  54. package/dist/runtime/components/table/config.vue +93 -4
  55. package/dist/runtime/components/table/index.vue +207 -168
  56. package/dist/runtime/components/table/schema.d.ts +70 -69
  57. package/dist/runtime/components/table/schema.js +13 -1
  58. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
  59. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
  60. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
  61. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
  62. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
  63. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
  64. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  65. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  66. package/dist/runtime/share/clipboard.d.ts +1 -1
  67. package/dist/runtime/share/clipboard.js +1 -1
  68. package/package.json +1 -1
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
+ readonly enableSorting?: boolean | undefined;
48
49
  readonly nodeKey: string;
49
50
  readonly nodeChildren: string;
50
51
  readonly nodeLabel: string;
51
- readonly enableSorting?: boolean | undefined;
52
52
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
53
53
  readonly nodeTooltip?: readonly [{
54
54
  readonly locale: "zh";
@@ -104,10 +104,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
104
104
  readonly data: string;
105
105
  readonly request?: string | undefined;
106
106
  };
107
+ readonly enableSorting?: boolean | undefined;
107
108
  readonly nodeKey: string;
108
109
  readonly nodeChildren: string;
109
110
  readonly nodeLabel: string;
110
- readonly enableSorting?: boolean | undefined;
111
111
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
112
112
  readonly nodeTooltip?: readonly [{
113
113
  readonly locale: "zh";
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
+ readonly enableSorting?: boolean | undefined;
48
49
  readonly nodeKey: string;
49
50
  readonly nodeChildren: string;
50
51
  readonly nodeLabel: string;
51
- readonly enableSorting?: boolean | undefined;
52
52
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
53
53
  readonly nodeTooltip?: readonly [{
54
54
  readonly locale: "zh";
@@ -104,10 +104,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
104
104
  readonly data: string;
105
105
  readonly request?: string | undefined;
106
106
  };
107
+ readonly enableSorting?: boolean | undefined;
107
108
  readonly nodeKey: string;
108
109
  readonly nodeChildren: string;
109
110
  readonly nodeLabel: string;
110
- readonly enableSorting?: boolean | undefined;
111
111
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
112
112
  readonly nodeTooltip?: readonly [{
113
113
  readonly locale: "zh";
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
+ readonly enableSorting?: boolean | undefined;
48
49
  readonly nodeKey: string;
49
50
  readonly nodeChildren: string;
50
51
  readonly nodeLabel: string;
51
- readonly enableSorting?: boolean | undefined;
52
52
  readonly nodeTooltip?: readonly [{
53
53
  readonly locale: "zh";
54
54
  readonly message: string;
@@ -103,10 +103,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
103
  readonly data: string;
104
104
  readonly request?: string | undefined;
105
105
  };
106
+ readonly enableSorting?: boolean | undefined;
106
107
  readonly nodeKey: string;
107
108
  readonly nodeChildren: string;
108
109
  readonly nodeLabel: string;
109
- readonly enableSorting?: boolean | undefined;
110
110
  readonly nodeTooltip?: readonly [{
111
111
  readonly locale: "zh";
112
112
  readonly message: string;
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
+ readonly enableSorting?: boolean | undefined;
48
49
  readonly nodeKey: string;
49
50
  readonly nodeChildren: string;
50
51
  readonly nodeLabel: string;
51
- readonly enableSorting?: boolean | undefined;
52
52
  readonly nodeTooltip?: readonly [{
53
53
  readonly locale: "zh";
54
54
  readonly message: string;
@@ -103,10 +103,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
103
  readonly data: string;
104
104
  readonly request?: string | undefined;
105
105
  };
106
+ readonly enableSorting?: boolean | undefined;
106
107
  readonly nodeKey: string;
107
108
  readonly nodeChildren: string;
108
109
  readonly nodeLabel: string;
109
- readonly enableSorting?: boolean | undefined;
110
110
  readonly nodeTooltip?: readonly [{
111
111
  readonly locale: "zh";
112
112
  readonly message: string;
@@ -13,6 +13,7 @@ import {
13
13
  } from "../../composables/useTreeDnd";
14
14
  import { getStructFieldDescription, getStructFieldTitle } from "./utils/schema-meta";
15
15
  import { provideEventAncestor } from "../../share/event-bus";
16
+ import { readClip, reidFragment, writeClip } from "../../share/clipboard";
16
17
  import { Markdown } from "../ui/markdown";
17
18
  import { Badge } from "../ui/badge";
18
19
  import { ScrollArea } from "../ui/scroll-area";
@@ -251,6 +252,9 @@ function writeGeneralPatch(patch) {
251
252
  const editingGeneralConfig = computed(() => readGeneral());
252
253
  const selected = ref(props.hideDataSource ? { kind: "general" } : { kind: "ai" });
253
254
  const fieldErrors = ref({});
255
+ const pickedColumnIds = ref([]);
256
+ const pickedColumnIdSet = computed(() => new Set(pickedColumnIds.value));
257
+ const pickAnchor = ref(null);
254
258
  watch(
255
259
  config,
256
260
  (value) => {
@@ -524,6 +528,10 @@ function deleteColumn(columnId) {
524
528
  resolveSelection();
525
529
  }
526
530
  function resolveSelection() {
531
+ const live = new Set(editingColumns.value.map((c) => c.id));
532
+ if (pickedColumnIds.value.some((id) => !live.has(id))) {
533
+ pickedColumnIds.value = pickedColumnIds.value.filter((id) => live.has(id));
534
+ }
527
535
  const s = selected.value;
528
536
  if (s.kind === "ai") return;
529
537
  if (s.kind === "general") return;
@@ -552,9 +560,88 @@ function selectQuery() {
552
560
  function selectGroup(id) {
553
561
  selected.value = { kind: "group", id };
554
562
  }
555
- function selectColumn(id) {
563
+ const orderedColumnIds = computed(
564
+ () => renderEntries.value.filter((e) => e.kind === "column").map((e) => e.columnId)
565
+ );
566
+ function columnRange(a, b) {
567
+ const ord = orderedColumnIds.value;
568
+ const ia = ord.indexOf(a);
569
+ const ib = ord.indexOf(b);
570
+ if (ia === -1 || ib === -1) return [b];
571
+ const [lo, hi] = ia <= ib ? [ia, ib] : [ib, ia];
572
+ return ord.slice(lo, hi + 1);
573
+ }
574
+ function selectColumn(id, e) {
575
+ const meta = !!e && (e.metaKey || e.ctrlKey);
576
+ if (meta && e.shiftKey) {
577
+ const range = pickAnchor.value ? columnRange(pickAnchor.value, id) : [id];
578
+ const set = new Set(pickedColumnIds.value);
579
+ for (const cid of range) set.add(cid);
580
+ pickedColumnIds.value = orderedColumnIds.value.filter((cid) => set.has(cid));
581
+ pickAnchor.value = id;
582
+ return;
583
+ }
584
+ if (meta) {
585
+ const set = new Set(pickedColumnIds.value);
586
+ if (set.has(id)) set.delete(id);
587
+ else set.add(id);
588
+ pickedColumnIds.value = orderedColumnIds.value.filter((cid) => set.has(cid));
589
+ pickAnchor.value = id;
590
+ return;
591
+ }
592
+ pickedColumnIds.value = [];
593
+ pickAnchor.value = null;
556
594
  selected.value = { kind: "column", id };
557
595
  }
596
+ watch(selected, (s) => {
597
+ if (s.kind !== "column") {
598
+ pickedColumnIds.value = [];
599
+ pickAnchor.value = null;
600
+ }
601
+ });
602
+ async function copyColumns() {
603
+ if (pickedColumnIds.value.length === 0) return;
604
+ const set = pickedColumnIdSet.value;
605
+ const cols = orderedColumnIds.value.filter((id) => set.has(id)).map((id) => editingColumns.value.find((c) => c.id === id)).filter((c) => !!c).map(({ groupId: _g, ...rest }) => rest);
606
+ if (cols.length === 0) return;
607
+ const ok = await writeClip("table", cols);
608
+ if (ok) toast.success(`\u5DF2\u590D\u5236 ${cols.length} \u5217`);
609
+ else toast.error("\u590D\u5236\u5931\u8D25");
610
+ }
611
+ async function pasteColumns() {
612
+ const clip = await readClip();
613
+ if (!clip || clip.surface !== "table") return;
614
+ const { items } = reidFragment(clip.items);
615
+ const pasted = items.map(({ groupId: _g, ...rest }) => rest);
616
+ if (pasted.length === 0) return;
617
+ editingColumns.value = [...editingColumns.value, ...pasted];
618
+ const ids = pasted.map((c) => c.id);
619
+ pickedColumnIds.value = ids;
620
+ pickAnchor.value = ids[ids.length - 1] ?? null;
621
+ if (ids.length > 0) selected.value = { kind: "column", id: ids[ids.length - 1] };
622
+ toast.success(`\u5DF2\u7C98\u8D34 ${pasted.length} \u5217`);
623
+ }
624
+ function isTextInput(el) {
625
+ if (!(el instanceof HTMLElement)) return false;
626
+ const tag = el.tagName;
627
+ return tag === "INPUT" || tag === "TEXTAREA" || el.isContentEditable;
628
+ }
629
+ function onColumnListKeydown(e) {
630
+ if (isTextInput(e.target)) return;
631
+ const mod = e.metaKey || e.ctrlKey;
632
+ if (!mod || e.shiftKey || e.altKey) return;
633
+ const key = e.key.toLowerCase();
634
+ if (key === "c") {
635
+ if (pickedColumnIds.value.length === 0) return;
636
+ const sel = window.getSelection();
637
+ if (sel && !sel.isCollapsed) return;
638
+ e.preventDefault();
639
+ void copyColumns();
640
+ } else if (key === "v") {
641
+ e.preventDefault();
642
+ void pasteColumns();
643
+ }
644
+ }
558
645
  const breadcrumbExt = inject(BREADCRUMB_EXTENSION_KEY, null);
559
646
  if (breadcrumbExt) {
560
647
  const crumb = breadcrumbExt.add();
@@ -1074,7 +1161,9 @@ const tableQueryValue = computed({
1074
1161
  <div class="flex min-h-128 gap-6">
1075
1162
  <div
1076
1163
  v-if="!isDrilled"
1077
- class="flex w-64 shrink-0 flex-col"
1164
+ class="flex w-64 shrink-0 flex-col outline-none"
1165
+ tabindex="-1"
1166
+ @keydown="onColumnListKeydown"
1078
1167
  >
1079
1168
  <ScrollArea class="flex-1">
1080
1169
  <div class="flex flex-col gap-1">
@@ -1224,10 +1313,10 @@ const tableQueryValue = computed({
1224
1313
  class="row group column-row"
1225
1314
  :class="[
1226
1315
  entry.groupId ? 'pl-6' : 'pl-2',
1227
- selected.kind === 'column' && selected.id === entry.columnId ? 'bg-[color-mix(in_srgb,var(--primary)_10%,white)] text-(--primary)' : 'text-zinc-600 hover:bg-zinc-50'
1316
+ selected.kind === 'column' && selected.id === entry.columnId ? 'bg-[color-mix(in_srgb,var(--primary)_10%,white)] text-(--primary)' : pickedColumnIdSet.has(entry.columnId) ? 'bg-zinc-100 text-zinc-700' : 'text-zinc-600 hover:bg-zinc-50'
1228
1317
  ]"
1229
1318
  :data-instruction="dnd.instructionFor(entry.columnId) ?? void 0"
1230
- @click.stop="selectColumn(entry.columnId)"
1319
+ @click.stop="selectColumn(entry.columnId, $event)"
1231
1320
  >
1232
1321
  <Icon
1233
1322
  icon="fluent:re-order-dots-vertical-20-filled"