@ramathibodi/nuxt-commons 4.0.25 → 4.0.27

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 (111) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/runtime/components/Calendar.d.vue.ts +7 -7
  3. package/dist/runtime/components/Calendar.vue.d.ts +7 -7
  4. package/dist/runtime/components/ExportCSV.d.vue.ts +2 -2
  5. package/dist/runtime/components/ExportCSV.vue.d.ts +2 -2
  6. package/dist/runtime/components/FileBtn.d.vue.ts +4 -4
  7. package/dist/runtime/components/FileBtn.vue.d.ts +4 -4
  8. package/dist/runtime/components/ImportCSV.d.vue.ts +4 -4
  9. package/dist/runtime/components/ImportCSV.vue.d.ts +4 -4
  10. package/dist/runtime/components/SplitterPanel.d.vue.ts +3 -3
  11. package/dist/runtime/components/SplitterPanel.vue.d.ts +3 -3
  12. package/dist/runtime/components/TabsGroup.d.vue.ts +3 -3
  13. package/dist/runtime/components/TabsGroup.vue.d.ts +3 -3
  14. package/dist/runtime/components/device/IdCardButton.d.vue.ts +2 -2
  15. package/dist/runtime/components/device/IdCardButton.vue.d.ts +2 -2
  16. package/dist/runtime/components/dialog/Confirm.d.vue.ts +2 -2
  17. package/dist/runtime/components/dialog/Confirm.vue.d.ts +2 -2
  18. package/dist/runtime/components/dialog/ImportProgress.d.vue.ts +2 -2
  19. package/dist/runtime/components/dialog/ImportProgress.vue.d.ts +2 -2
  20. package/dist/runtime/components/dialog/Index.d.vue.ts +2 -2
  21. package/dist/runtime/components/dialog/Index.vue.d.ts +2 -2
  22. package/dist/runtime/components/dialog/Loading.d.vue.ts +2 -2
  23. package/dist/runtime/components/dialog/Loading.vue.d.ts +2 -2
  24. package/dist/runtime/components/dialog/default/Confirm.d.vue.ts +3 -3
  25. package/dist/runtime/components/dialog/default/Confirm.vue.d.ts +3 -3
  26. package/dist/runtime/components/dialog/default/Loading.d.vue.ts +3 -3
  27. package/dist/runtime/components/dialog/default/Loading.vue.d.ts +3 -3
  28. package/dist/runtime/components/dialog/default/Notify.d.vue.ts +1 -1
  29. package/dist/runtime/components/dialog/default/Notify.vue.d.ts +1 -1
  30. package/dist/runtime/components/dialog/default/Printing.d.vue.ts +2 -2
  31. package/dist/runtime/components/dialog/default/Printing.vue.d.ts +2 -2
  32. package/dist/runtime/components/dialog/default/VerifyUser.d.vue.ts +2 -2
  33. package/dist/runtime/components/dialog/default/VerifyUser.vue.d.ts +2 -2
  34. package/dist/runtime/components/document/TemplateBuilderLiveView.d.vue.ts +27 -14
  35. package/dist/runtime/components/document/TemplateBuilderLiveView.vue +175 -68
  36. package/dist/runtime/components/document/TemplateBuilderLiveView.vue.d.ts +27 -14
  37. package/dist/runtime/components/document/TemplatePalette.d.vue.ts +1 -1
  38. package/dist/runtime/components/document/TemplatePalette.vue +11 -1
  39. package/dist/runtime/components/document/TemplatePalette.vue.d.ts +1 -1
  40. package/dist/runtime/components/form/ActionPad.d.vue.ts +9 -9
  41. package/dist/runtime/components/form/ActionPad.vue.d.ts +9 -9
  42. package/dist/runtime/components/form/Birthdate.d.vue.ts +1 -1
  43. package/dist/runtime/components/form/Birthdate.vue.d.ts +1 -1
  44. package/dist/runtime/components/form/CheckboxGroup.d.vue.ts +2 -2
  45. package/dist/runtime/components/form/CheckboxGroup.vue.d.ts +2 -2
  46. package/dist/runtime/components/form/CodeEditor.d.vue.ts +1 -1
  47. package/dist/runtime/components/form/CodeEditor.vue.d.ts +1 -1
  48. package/dist/runtime/components/form/Date.d.vue.ts +4 -4
  49. package/dist/runtime/components/form/Date.vue.d.ts +4 -4
  50. package/dist/runtime/components/form/DateTime.d.vue.ts +3 -3
  51. package/dist/runtime/components/form/DateTime.vue.d.ts +3 -3
  52. package/dist/runtime/components/form/Dialog.d.vue.ts +6 -6
  53. package/dist/runtime/components/form/Dialog.vue.d.ts +6 -6
  54. package/dist/runtime/components/form/EditPad.d.vue.ts +9 -9
  55. package/dist/runtime/components/form/EditPad.vue.d.ts +9 -9
  56. package/dist/runtime/components/form/File.d.vue.ts +4 -4
  57. package/dist/runtime/components/form/File.vue.d.ts +4 -4
  58. package/dist/runtime/components/form/Iterator.d.vue.ts +12 -12
  59. package/dist/runtime/components/form/Iterator.vue.d.ts +12 -12
  60. package/dist/runtime/components/form/Login.d.vue.ts +2 -2
  61. package/dist/runtime/components/form/Login.vue.d.ts +2 -2
  62. package/dist/runtime/components/form/Pad.d.vue.ts +4 -4
  63. package/dist/runtime/components/form/Pad.vue.d.ts +4 -4
  64. package/dist/runtime/components/form/SignPad.d.vue.ts +2 -2
  65. package/dist/runtime/components/form/SignPad.vue.d.ts +2 -2
  66. package/dist/runtime/components/form/System.d.vue.ts +2 -2
  67. package/dist/runtime/components/form/System.vue.d.ts +2 -2
  68. package/dist/runtime/components/form/Table.d.vue.ts +18 -18
  69. package/dist/runtime/components/form/Table.vue.d.ts +18 -18
  70. package/dist/runtime/components/form/TableData.d.vue.ts +9 -9
  71. package/dist/runtime/components/form/TableData.vue.d.ts +9 -9
  72. package/dist/runtime/components/form/Time.d.vue.ts +2 -2
  73. package/dist/runtime/components/form/Time.vue.d.ts +2 -2
  74. package/dist/runtime/components/form/images/Capture.d.vue.ts +2 -2
  75. package/dist/runtime/components/form/images/Capture.vue.d.ts +2 -2
  76. package/dist/runtime/components/label/Date.d.vue.ts +1 -1
  77. package/dist/runtime/components/label/Date.vue.d.ts +1 -1
  78. package/dist/runtime/components/label/Field.d.vue.ts +7 -5
  79. package/dist/runtime/components/label/Field.vue +4 -1
  80. package/dist/runtime/components/label/Field.vue.d.ts +7 -5
  81. package/dist/runtime/components/master/Autocomplete.d.vue.ts +2 -2
  82. package/dist/runtime/components/master/Autocomplete.vue.d.ts +2 -2
  83. package/dist/runtime/components/master/Combobox.d.vue.ts +2 -2
  84. package/dist/runtime/components/master/Combobox.vue.d.ts +2 -2
  85. package/dist/runtime/components/master/RadioGroup.d.vue.ts +2 -2
  86. package/dist/runtime/components/master/RadioGroup.vue.d.ts +2 -2
  87. package/dist/runtime/components/master/Select.d.vue.ts +2 -2
  88. package/dist/runtime/components/master/Select.vue.d.ts +2 -2
  89. package/dist/runtime/components/master/label.d.vue.ts +1 -1
  90. package/dist/runtime/components/master/label.vue.d.ts +1 -1
  91. package/dist/runtime/components/model/Autocomplete.d.vue.ts +2 -2
  92. package/dist/runtime/components/model/Autocomplete.vue.d.ts +2 -2
  93. package/dist/runtime/components/model/Combobox.d.vue.ts +2 -2
  94. package/dist/runtime/components/model/Combobox.vue.d.ts +2 -2
  95. package/dist/runtime/components/model/Pad.d.vue.ts +10 -10
  96. package/dist/runtime/components/model/Pad.vue.d.ts +10 -10
  97. package/dist/runtime/components/model/Select.d.vue.ts +2 -2
  98. package/dist/runtime/components/model/Select.vue.d.ts +2 -2
  99. package/dist/runtime/components/model/Table.d.vue.ts +21 -21
  100. package/dist/runtime/components/model/Table.vue.d.ts +21 -21
  101. package/dist/runtime/components/model/iterator.d.vue.ts +28 -28
  102. package/dist/runtime/components/model/iterator.vue.d.ts +28 -28
  103. package/dist/runtime/components/model/label.d.vue.ts +1 -1
  104. package/dist/runtime/components/model/label.vue.d.ts +1 -1
  105. package/dist/runtime/components/pdf/View.d.vue.ts +2 -2
  106. package/dist/runtime/components/pdf/View.vue.d.ts +2 -2
  107. package/dist/runtime/composables/document/template.d.ts +9 -1
  108. package/dist/runtime/composables/document/template.js +15 -3
  109. package/dist/runtime/composables/document/templateInputTypes.js +3 -0
  110. package/dist/runtime/utils/datetime.d.ts +7 -7
  111. package/package.json +30 -30
@@ -17,6 +17,7 @@ interface Props {
17
17
  sortable?: boolean;
18
18
  palette?: boolean;
19
19
  paletteTypes?: string[];
20
+ height?: number | string;
20
21
  }
21
22
  /**
22
23
  * Public props accepted by DocumentTemplateBuilderLiveView.
@@ -30,9 +31,15 @@ interface Props {
30
31
  * - **Preview** — the preview is a live, fillable form so you can try the
31
32
  * validations; the data typed is shown in the "Preview data" panel.
32
33
  *
33
- * Items with no visual (`FormHidden`, `Separator`) are reachable from the
34
- * **Outline** list (a click opens the editor dialog), which also offers
35
- * reordering for every item.
34
+ * Items with no visual (`FormHidden`, `Separator`) get a placeholder in Design
35
+ * mode (hidden in Preview mode), so they can be selected, moved and deleted
36
+ * like any field. They are also reachable from the **Outline** list (a click
37
+ * opens the editor dialog), which offers reordering and deletion for every item.
38
+ *
39
+ * Both the overlay and the outline carry a **move to position** button between
40
+ * their up / down arrows (DocumentTemplateBuilder's "Enter the new position"):
41
+ * it opens a small menu that takes the new 1-based position (the numbering the
42
+ * outline and the overlay show) and moves the item there on Move / Enter.
36
43
  *
37
44
  * In Design mode every rendered field is also a drag handle: drop it on the
38
45
  * left / top half of another field to insert before it, on the right / bottom
@@ -44,6 +51,11 @@ interface Props {
44
51
  * the preview appends), or click a card to add one after the selected item.
45
52
  * The new item's settings dialog opens at once; cancelling it removes the
46
53
  * item again, saving keeps it.
54
+ *
55
+ * With `height` set the card has a fixed height: the toolbar and the live
56
+ * view bar stay put and only the form (plus the outline and the palette,
57
+ * each on its own from `md` up) scrolls. Use it inside dialogs, where the
58
+ * natural height would scroll the toolbar out of reach.
47
59
  */
48
60
  type __VLS_Props = Props;
49
61
  /** Select (highlight + pin the edit overlay on) the item at `index`, or clear the selection with `null`. */
@@ -88,7 +100,7 @@ type __VLS_ModelProps = {
88
100
  modelValue?: string | Record<string, any>[];
89
101
  };
90
102
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
91
- declare var __VLS_20: {}, __VLS_28: {
103
+ declare var __VLS_19: {}, __VLS_27: {
92
104
  items: Record<string, any>[];
93
105
  operation: {
94
106
  openCreate: typeof openCreate;
@@ -105,7 +117,7 @@ declare var __VLS_20: {}, __VLS_28: {
105
117
  importItems: typeof importItems;
106
118
  convertToAdvanceMode: () => Promise<void>;
107
119
  };
108
- }, __VLS_203: {
120
+ }, __VLS_217: {
109
121
  operation: {
110
122
  openCreate: typeof openCreate;
111
123
  openEdit: typeof openEdit;
@@ -121,7 +133,7 @@ declare var __VLS_20: {}, __VLS_28: {
121
133
  importItems: typeof importItems;
122
134
  convertToAdvanceMode: () => Promise<void>;
123
135
  };
124
- }, __VLS_224: {
136
+ }, __VLS_238: {
125
137
  index: number;
126
138
  item: Record<string, any>;
127
139
  operation: {
@@ -139,20 +151,20 @@ declare var __VLS_20: {}, __VLS_28: {
139
151
  importItems: typeof importItems;
140
152
  convertToAdvanceMode: () => Promise<void>;
141
153
  };
142
- }, __VLS_291: {
154
+ }, __VLS_312: {
143
155
  insert: typeof insertInputType;
144
156
  disabled: boolean;
145
157
  };
146
158
  type __VLS_Slots = {} & {
147
- title?: (props: typeof __VLS_20) => any;
159
+ title?: (props: typeof __VLS_19) => any;
148
160
  } & {
149
- toolbarItems?: (props: typeof __VLS_28) => any;
161
+ toolbarItems?: (props: typeof __VLS_27) => any;
150
162
  } & {
151
- empty?: (props: typeof __VLS_203) => any;
163
+ empty?: (props: typeof __VLS_217) => any;
152
164
  } & {
153
- itemOverlay?: (props: typeof __VLS_224) => any;
165
+ itemOverlay?: (props: typeof __VLS_238) => any;
154
166
  } & {
155
- palette?: (props: typeof __VLS_291) => any;
167
+ palette?: (props: typeof __VLS_312) => any;
156
168
  };
157
169
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
158
170
  templateItems: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
@@ -216,14 +228,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
216
228
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
217
229
  "onUpdate:modelValue"?: ((value: string | Record<string, any>[] | undefined) => any) | undefined;
218
230
  }>, {
231
+ height: string | number;
219
232
  title: string;
220
233
  stringFields: string[];
221
234
  initialData: Record<string, any>;
222
235
  roleCustomCode: string | string[];
223
236
  disableAdvanceMode: boolean;
224
237
  toolbarColor: string;
225
- editorWidth: number | string;
226
- dialogMaxWidth: number | string;
238
+ editorWidth: string | number;
239
+ dialogMaxWidth: string | number;
227
240
  dialogFullscreen: boolean;
228
241
  outline: boolean;
229
242
  importable: boolean;
@@ -25,7 +25,8 @@ const props = defineProps({
25
25
  stringFields: { type: Array, required: false, default: () => [] },
26
26
  sortable: { type: Boolean, required: false, default: true },
27
27
  palette: { type: Boolean, required: false, default: true },
28
- paletteTypes: { type: Array, required: false, default: void 0 }
28
+ paletteTypes: { type: Array, required: false, default: void 0 },
29
+ height: { type: [Number, String], required: false, default: void 0 }
29
30
  });
30
31
  const emit = defineEmits(["update:modelValue", "select", "import", "reorder", "insert"]);
31
32
  const modelValue = defineModel({ type: [String, Array] });
@@ -33,6 +34,7 @@ const { templateItems, isAdvanceMode, advanceModeCode, storedItems, convertToAdv
33
34
  const ITEM_INDEX_ATTRIBUTE = "data-doc-item";
34
35
  const mode = ref("design");
35
36
  const isDesignMode = computed(() => mode.value === "design" && !isAdvanceMode.value);
37
+ const isBounded = computed(() => props.height !== void 0 && props.height !== null && props.height !== "");
36
38
  const outlineOpen = ref(props.outline);
37
39
  const paletteOpen = ref(props.palette);
38
40
  const selectedIndex = ref(null);
@@ -47,7 +49,7 @@ const showPreviewData = ref();
47
49
  const previewTemplate = computed(() => {
48
50
  if (isAdvanceMode.value) return advanceModeCode.value || "";
49
51
  if (!storedItems.value.length) return "";
50
- return useDocumentTemplate(storedItems.value, void 0, { itemIndexAttribute: ITEM_INDEX_ATTRIBUTE });
52
+ return useDocumentTemplate(storedItems.value, void 0, { itemIndexAttribute: ITEM_INDEX_ATTRIBUTE, noVisualPlaceholders: true });
51
53
  });
52
54
  const inputTypeLabel = computed(() => {
53
55
  const acc = {};
@@ -169,6 +171,38 @@ function moveSelected(delta) {
169
171
  function moveItem(from, delta) {
170
172
  moveItemTo(from, from + delta);
171
173
  }
174
+ const moveTo = ref(null);
175
+ const moveToPosition = ref("");
176
+ function openMoveTo(index, event) {
177
+ if (!Number.isInteger(index) || index < 0 || index >= templateItems.value.length) return;
178
+ selectItem(index);
179
+ moveToPosition.value = "";
180
+ moveTo.value = { index, target: event?.currentTarget ?? void 0 };
181
+ }
182
+ function closeMoveTo() {
183
+ moveTo.value = null;
184
+ }
185
+ const moveToIndex = computed(() => {
186
+ if (!moveTo.value) return null;
187
+ const raw = String(moveToPosition.value ?? "").trim();
188
+ if (!/^\d+$/.test(raw)) return null;
189
+ const position = Number(raw);
190
+ if (position < 1 || position > templateItems.value.length || position - 1 === moveTo.value.index) return null;
191
+ return position - 1;
192
+ });
193
+ const moveToError = computed(() => {
194
+ const raw = String(moveToPosition.value ?? "").trim();
195
+ if (!moveTo.value || !raw || moveToIndex.value !== null) return void 0;
196
+ return raw === String(moveTo.value.index + 1) ? `Item ${raw} is already at position ${raw}` : `Enter a number from 1 to ${templateItems.value.length}`;
197
+ });
198
+ function submitMoveTo() {
199
+ const to = moveToIndex.value;
200
+ if (!moveTo.value || to === null) return;
201
+ const from = moveTo.value.index;
202
+ closeMoveTo();
203
+ moveItemTo(from, to);
204
+ }
205
+ watch(() => templateItems.value.length, closeMoveTo);
172
206
  function duplicateItem(index) {
173
207
  const source = templateItems.value[index];
174
208
  if (!source) return;
@@ -279,10 +313,17 @@ function updateOverlay() {
279
313
  const origin = canvas.getBoundingClientRect();
280
314
  overlayRect.value = { top: box.top - origin.top, left: box.left - origin.left, width: box.width, height: box.height };
281
315
  }
316
+ const OVERLAY_INSET = 4;
317
+ const overlayRoot = ref();
318
+ const overlayWidth = ref(0);
319
+ function measureOverlay() {
320
+ overlayWidth.value = overlayRoot.value?.offsetWidth || 0;
321
+ }
282
322
  const overlayStyle = computed(() => {
283
323
  const rect = overlayRect.value;
284
324
  if (!rect) return {};
285
- return { top: `${rect.top}px`, left: `${rect.left + rect.width}px` };
325
+ const left = Math.max(0, rect.left + rect.width - OVERLAY_INSET - overlayWidth.value);
326
+ return { top: `${rect.top}px`, left: `${left}px` };
286
327
  });
287
328
  const DRAGGING_CLASS = "doc-live-view__item--dragging";
288
329
  const DROP_CLASSES = {
@@ -422,6 +463,8 @@ watch(isDesignMode, (design) => {
422
463
  if (!design) hoveredIndex.value = null;
423
464
  });
424
465
  useResizeObserver(previewRoot, () => updateOverlay());
466
+ useResizeObserver(overlayRoot, measureOverlay);
467
+ watch([overlayRect, overlayIndex], measureOverlay, { flush: "post" });
425
468
  useEventListener(typeof window === "undefined" ? void 0 : window, "resize", () => updateOverlay());
426
469
  watch(isAdvanceMode, (advance) => {
427
470
  if (!advance) return;
@@ -448,7 +491,11 @@ defineExpose({
448
491
  </script>
449
492
 
450
493
  <template>
451
- <v-card class="doc-live-view">
494
+ <v-card
495
+ class="doc-live-view"
496
+ :class="{ 'doc-live-view--bounded': isBounded }"
497
+ :height="isBounded ? height : void 0"
498
+ >
452
499
  <v-toolbar :color="toolbarColor">
453
500
  <v-toolbar-title class="pl-3">
454
501
  <slot name="title">{{ title }}</slot>
@@ -536,8 +583,19 @@ defineExpose({
536
583
  {{ itemTypeLabel(item) }}<span v-if="hasNoVisual(item)"> · not rendered</span>
537
584
  </v-list-item-subtitle>
538
585
  <template #append>
539
- <v-btn icon="mdi:mdi-arrow-up-thick" size="x-small" variant="text" density="comfortable" :disabled="index === 0" @click.stop="moveItem(index, -1)" />
540
- <v-btn icon="mdi:mdi-arrow-down-thick" size="x-small" variant="text" density="comfortable" :disabled="index === templateItems.length - 1" @click.stop="moveItem(index, 1)" />
586
+ <v-btn icon="mdi:mdi-arrow-up-thick" size="x-small" variant="text" density="comfortable" title="Move up" :disabled="index === 0" @click.stop="moveItem(index, -1)" />
587
+ <v-btn
588
+ class="doc-live-view__outline-move-to"
589
+ icon="fa:fas fa-arrow-right-to-bracket"
590
+ size="x-small"
591
+ variant="text"
592
+ density="comfortable"
593
+ title="Move to position…"
594
+ :disabled="templateItems.length < 2"
595
+ @click.stop="openMoveTo(index, $event)"
596
+ />
597
+ <v-btn icon="mdi:mdi-arrow-down-thick" size="x-small" variant="text" density="comfortable" title="Move down" :disabled="index === templateItems.length - 1" @click.stop="moveItem(index, 1)" />
598
+ <v-btn class="doc-live-view__outline-delete" icon="mdi:mdi-delete" size="x-small" variant="text" density="comfortable" color="error" title="Delete" @click.stop="confirmDeleteItem(index)" />
541
599
  </template>
542
600
  </v-list-item>
543
601
  <v-list-item v-if="!templateItems.length">
@@ -547,7 +605,7 @@ defineExpose({
547
605
  </v-col>
548
606
 
549
607
  <!-- Live view: full row when the outline / editor stack below md, flexible remainder from md up -->
550
- <v-col cols="12" md class="doc-live-view__preview-col">
608
+ <v-col cols="12" md class="doc-live-view__preview-col" :class="{ 'doc-live-view__preview-col--live': !isAdvanceMode }">
551
609
  <template v-if="isAdvanceMode">
552
610
  <v-row no-gutters>
553
611
  <v-col cols="12" md="6" class="pa-2">
@@ -604,68 +662,82 @@ defineExpose({
604
662
  {{ templateItems.length }} {{ templateItems.length === 1 ? "field" : "fields" }}
605
663
  </span>
606
664
  </div>
607
- <div ref="canvasRoot" class="doc-live-view__canvas" @mouseleave="hoveredIndex = null">
608
- <div
609
- ref="previewRoot"
610
- class="doc-live-view__preview px-2 pb-2"
611
- :class="{ 'doc-live-view__preview--design': isDesignMode, 'doc-live-view__preview--sortable': canSort, 'doc-live-view__preview--dragging': dragIndex !== null, 'doc-live-view__preview--drop-end': dropAtEnd }"
612
- @click.capture="onPreviewClick"
613
- @dblclick.capture="onPreviewDblClick"
614
- @mouseover="onPreviewHover"
615
- @dragstart="onPreviewDragStart"
616
- @dragover="onPreviewDragOver"
617
- @dragleave="onPreviewDragLeave"
618
- @drop="onPreviewDrop"
619
- @dragend="finishDrag"
620
- >
621
- <slot name="empty" v-if="!templateItems.length" :operation="operation">
622
- <v-sheet
623
- class="d-flex flex-column align-center justify-center text-medium-emphasis pa-8 ma-2"
624
- border
625
- rounded
626
- style="border-style: dashed !important; cursor: pointer"
627
- @click="openCreate()"
628
- >
629
- <v-icon size="40" class="mb-2">mdi:mdi-plus-box-outline</v-icon>
630
- <div class="text-body-2">No fields yet. Click <b>add</b> to create the first one.</div>
631
- </v-sheet>
632
- </slot>
633
- <form-pad
634
- v-else
635
- v-model="previewData"
636
- :template="previewTemplate"
637
- :template-script="templateScript"
638
- isolated
639
- />
640
- </div>
641
- <!-- Edit overlay: pinned to the hovered item, else the selected one -->
642
- <div
643
- v-if="overlayIndex !== null && overlayRect"
644
- class="doc-live-view__overlay"
645
- :style="overlayStyle"
646
- role="toolbar"
647
- :aria-label="`Item ${overlayIndex + 1} actions`"
648
- @click.stop
649
- @dblclick.stop
650
- >
651
- <slot name="itemOverlay" :index="overlayIndex" :item="templateItems[overlayIndex]" :operation="operation">
652
- <span class="doc-live-view__overlay-label text-caption">{{ overlayIndex + 1 }} · {{ itemTypeLabel(templateItems[overlayIndex]) }}</span>
653
- <v-btn class="doc-live-view__overlay-edit" icon="mdi:mdi-pencil" size="x-small" variant="flat" color="primary" density="comfortable" title="Edit" @click="openEdit(overlayIndex)" />
654
- <v-btn icon="mdi:mdi-arrow-up-thick" size="x-small" variant="text" density="comfortable" title="Move up" :disabled="overlayIndex === 0" @click="moveItem(overlayIndex, -1)" />
655
- <v-btn icon="mdi:mdi-arrow-down-thick" size="x-small" variant="text" density="comfortable" title="Move down" :disabled="overlayIndex === templateItems.length - 1" @click="moveItem(overlayIndex, 1)" />
656
- <v-btn icon="mdi:mdi-content-copy" size="x-small" variant="text" density="comfortable" title="Duplicate" @click="duplicateItem(overlayIndex)" />
657
- <v-btn class="doc-live-view__overlay-delete" icon="mdi:mdi-delete" size="x-small" variant="text" density="comfortable" color="error" title="Delete" @click="confirmDeleteItem(overlayIndex)" />
658
- </slot>
665
+ <!-- Bounded height: only this part scrolls; the live view bar above stays put. -->
666
+ <div class="doc-live-view__scroll">
667
+ <div ref="canvasRoot" class="doc-live-view__canvas" @mouseleave="hoveredIndex = null">
668
+ <div
669
+ ref="previewRoot"
670
+ class="doc-live-view__preview px-2 pb-2"
671
+ :class="{ 'doc-live-view__preview--design': isDesignMode, 'doc-live-view__preview--sortable': canSort, 'doc-live-view__preview--dragging': dragIndex !== null, 'doc-live-view__preview--drop-end': dropAtEnd }"
672
+ @click.capture="onPreviewClick"
673
+ @dblclick.capture="onPreviewDblClick"
674
+ @mouseover="onPreviewHover"
675
+ @dragstart="onPreviewDragStart"
676
+ @dragover="onPreviewDragOver"
677
+ @dragleave="onPreviewDragLeave"
678
+ @drop="onPreviewDrop"
679
+ @dragend="finishDrag"
680
+ >
681
+ <slot name="empty" v-if="!templateItems.length" :operation="operation">
682
+ <v-sheet
683
+ class="d-flex flex-column align-center justify-center text-medium-emphasis pa-8 ma-2"
684
+ border
685
+ rounded
686
+ style="border-style: dashed !important; cursor: pointer"
687
+ @click="openCreate()"
688
+ >
689
+ <v-icon size="40" class="mb-2">mdi:mdi-plus-box-outline</v-icon>
690
+ <div class="text-body-2">No fields yet. Click <b>add</b> to create the first one.</div>
691
+ </v-sheet>
692
+ </slot>
693
+ <form-pad
694
+ v-else
695
+ v-model="previewData"
696
+ :template="previewTemplate"
697
+ :template-script="templateScript"
698
+ isolated
699
+ />
700
+ </div>
701
+ <!-- Edit overlay: pinned to the hovered item, else the selected one -->
702
+ <div
703
+ v-if="overlayIndex !== null && overlayRect"
704
+ ref="overlayRoot"
705
+ class="doc-live-view__overlay"
706
+ :style="overlayStyle"
707
+ role="toolbar"
708
+ :aria-label="`Item ${overlayIndex + 1} actions`"
709
+ @click.stop
710
+ @dblclick.stop
711
+ >
712
+ <slot name="itemOverlay" :index="overlayIndex" :item="templateItems[overlayIndex]" :operation="operation">
713
+ <span class="doc-live-view__overlay-label text-caption">{{ overlayIndex + 1 }} · {{ itemTypeLabel(templateItems[overlayIndex]) }}</span>
714
+ <v-btn class="doc-live-view__overlay-edit" icon="mdi:mdi-pencil" size="x-small" variant="flat" color="primary" density="comfortable" title="Edit" @click="openEdit(overlayIndex)" />
715
+ <v-btn icon="mdi:mdi-arrow-up-thick" size="x-small" variant="text" density="comfortable" title="Move up" :disabled="overlayIndex === 0" @click="moveItem(overlayIndex, -1)" />
716
+ <v-btn
717
+ class="doc-live-view__overlay-move-to"
718
+ icon="fa:fas fa-arrow-right-to-bracket"
719
+ size="x-small"
720
+ variant="text"
721
+ density="comfortable"
722
+ title="Move to position…"
723
+ :disabled="templateItems.length < 2"
724
+ @click="openMoveTo(overlayIndex, $event)"
725
+ />
726
+ <v-btn icon="mdi:mdi-arrow-down-thick" size="x-small" variant="text" density="comfortable" title="Move down" :disabled="overlayIndex === templateItems.length - 1" @click="moveItem(overlayIndex, 1)" />
727
+ <v-btn icon="mdi:mdi-content-copy" size="x-small" variant="text" density="comfortable" title="Duplicate" @click="duplicateItem(overlayIndex)" />
728
+ <v-btn class="doc-live-view__overlay-delete" icon="mdi:mdi-delete" size="x-small" variant="text" density="comfortable" color="error" title="Delete" @click="confirmDeleteItem(overlayIndex)" />
729
+ </slot>
730
+ </div>
659
731
  </div>
732
+ <v-expansion-panels v-model="showPreviewData" variant="accordion" class="px-2 pb-2" v-if="mode === 'preview' && templateItems.length">
733
+ <v-expansion-panel :value="true">
734
+ <v-expansion-panel-title class="text-caption">Preview data</v-expansion-panel-title>
735
+ <v-expansion-panel-text>
736
+ <pre class="text-caption ma-0">{{ previewData }}</pre>
737
+ </v-expansion-panel-text>
738
+ </v-expansion-panel>
739
+ </v-expansion-panels>
660
740
  </div>
661
- <v-expansion-panels v-model="showPreviewData" variant="accordion" class="px-2 pb-2" v-if="mode === 'preview' && templateItems.length">
662
- <v-expansion-panel :value="true">
663
- <v-expansion-panel-title class="text-caption">Preview data</v-expansion-panel-title>
664
- <v-expansion-panel-text>
665
- <pre class="text-caption ma-0">{{ previewData }}</pre>
666
- </v-expansion-panel-text>
667
- </v-expansion-panel>
668
- </v-expansion-panels>
669
741
  </template>
670
742
  </v-col>
671
743
 
@@ -678,6 +750,41 @@ defineExpose({
678
750
 
679
751
  </v-row>
680
752
 
753
+ <!-- Move to position: one menu, hung from whichever overlay / outline button opened it -->
754
+ <v-menu
755
+ :model-value="moveTo !== null"
756
+ :target="moveTo?.target"
757
+ location="bottom end"
758
+ :close-on-content-click="false"
759
+ @update:model-value="(open) => {
760
+ if (!open) closeMoveTo();
761
+ }"
762
+ >
763
+ <v-card v-if="moveTo" class="doc-live-view__move-to" min-width="260">
764
+ <v-card-text class="pb-0">
765
+ <div class="text-body-2 mb-3">Move item {{ moveTo.index + 1 }} to position</div>
766
+ <v-text-field
767
+ v-model="moveToPosition"
768
+ type="number"
769
+ min="1"
770
+ :max="templateItems.length"
771
+ density="compact"
772
+ variant="outlined"
773
+ autofocus
774
+ persistent-hint
775
+ :hint="`1 \u2013 ${templateItems.length}`"
776
+ :error-messages="moveToError"
777
+ @keydown.enter.prevent="submitMoveTo()"
778
+ />
779
+ </v-card-text>
780
+ <v-card-actions>
781
+ <v-spacer />
782
+ <v-btn variant="text" @click="closeMoveTo()">Cancel</v-btn>
783
+ <v-btn class="doc-live-view__move-to-submit" color="primary" variant="flat" :disabled="moveToIndex === null" @click="submitMoveTo()">Move</v-btn>
784
+ </v-card-actions>
785
+ </v-card>
786
+ </v-menu>
787
+
681
788
  <!-- Item editor dialog: opens on a new item straight away, and from an item's edit overlay -->
682
789
  <FormDialog
683
790
  v-model="dialogOpen"
@@ -726,5 +833,5 @@ defineExpose({
726
833
  </template>
727
834
 
728
835
  <style scoped>
729
- .doc-live-view__outline{border-right:thin solid rgba(var(--v-border-color),var(--v-border-opacity))}.doc-live-view__palette{border-left:thin solid rgba(var(--v-border-color),var(--v-border-opacity))}.doc-live-view__canvas{position:relative}.doc-live-view__overlay{align-items:center;background:rgb(var(--v-theme-surface));border-radius:999px;box-shadow:0 1px 3px rgba(0,0,0,.18),0 0 0 1px rgba(var(--v-theme-primary),.35);display:inline-flex;gap:2px;padding:2px 4px 2px 8px;position:absolute;transform:translate(calc(-100% - 4px),-50%);white-space:nowrap;z-index:2}.doc-live-view__overlay-label{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));margin-right:4px;max-width:14em;overflow:hidden;text-overflow:ellipsis}.doc-live-view__preview--drop-end{background-color:rgba(var(--v-theme-primary),.03);border-radius:4px;outline:2px dashed rgba(var(--v-theme-primary),.7);outline-offset:-4px}.doc-live-view__preview-col{min-width:0}.doc-live-view__preview-bar{align-items:center;border-bottom:thin solid rgba(var(--v-border-color),var(--v-border-opacity));display:flex;gap:12px;min-height:44px;padding:4px 12px}.doc-live-view__bar-label{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));flex-shrink:0;letter-spacing:.12em;line-height:1}.doc-live-view__hint{min-width:0}.doc-live-view__count{font-variant-numeric:tabular-nums}.doc-live-view__mode-toggle{background:rgba(var(--v-theme-on-surface),.06);border-radius:999px;display:inline-flex;flex-shrink:0;gap:2px;padding:3px}.doc-live-view__mode{align-items:center;background:transparent;border:0;border-radius:999px;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));cursor:pointer;display:inline-flex;font:inherit;font-size:.8125rem;font-weight:500;gap:6px;height:28px;line-height:1;padding:0 12px 0 10px;transition:background-color .18s ease,color .18s ease,box-shadow .18s ease}.doc-live-view__mode:hover{color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.doc-live-view__mode:focus-visible{outline:2px solid rgba(var(--v-theme-primary),.5);outline-offset:1px}.doc-live-view__mode--active{background:rgb(var(--v-theme-surface));box-shadow:0 1px 2px rgba(0,0,0,.14),0 0 0 1px rgba(var(--v-theme-on-surface),.06);color:rgb(var(--v-theme-primary))}.doc-live-view__preview{padding-top:8px;transition:background-color .22s ease}.doc-live-view__preview--design{background-color:rgba(var(--v-theme-on-surface),.015);background-image:radial-gradient(rgba(var(--v-theme-on-surface),.14) 1px,transparent 1px);background-position:8px 8px;background-size:16px 16px}.doc-live-view__preview--design :deep([data-doc-item]){border-radius:4px;cursor:pointer;outline:1px dashed transparent;outline-offset:2px;transition:outline-color .12s ease,background-color .12s ease}.doc-live-view__preview--design :deep([data-doc-item]>*){pointer-events:none}.doc-live-view__preview--design :deep([data-doc-item]:hover){background-color:rgba(var(--v-theme-primary),.04);outline-color:rgba(var(--v-theme-primary),.6)}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--selected){background-color:rgba(var(--v-theme-primary),.06);border-radius:4px;outline:2px solid rgb(var(--v-theme-primary));outline-offset:2px}.doc-live-view__preview--sortable :deep([data-doc-item]){cursor:grab}.doc-live-view__preview--dragging :deep([data-doc-item]){cursor:grabbing}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--dragging){opacity:.4}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-before){box-shadow:-4px 0 0 0 rgb(var(--v-theme-primary))}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-after){box-shadow:4px 0 0 0 rgb(var(--v-theme-primary))}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-above){box-shadow:0 -4px 0 0 rgb(var(--v-theme-primary))}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-below){box-shadow:0 4px 0 0 rgb(var(--v-theme-primary))}
836
+ .doc-live-view__outline{border-right:thin solid rgba(var(--v-border-color),var(--v-border-opacity))}.doc-live-view__palette{border-left:thin solid rgba(var(--v-border-color),var(--v-border-opacity))}.doc-live-view__canvas{position:relative}.doc-live-view__overlay{align-items:center;background:rgb(var(--v-theme-surface));border-radius:999px;box-shadow:0 1px 3px rgba(0,0,0,.18),0 0 0 1px rgba(var(--v-theme-primary),.35);display:inline-flex;gap:2px;padding:2px 4px 2px 8px;position:absolute;transform:translateY(-50%);white-space:nowrap;z-index:2}.doc-live-view__overlay-label{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));margin-right:4px;max-width:14em;overflow:hidden;text-overflow:ellipsis}.doc-live-view__preview--drop-end{background-color:rgba(var(--v-theme-primary),.03);border-radius:4px;outline:2px dashed rgba(var(--v-theme-primary),.7);outline-offset:-4px}.doc-live-view__preview-col{min-width:0}.doc-live-view__preview-bar{align-items:center;border-bottom:thin solid rgba(var(--v-border-color),var(--v-border-opacity));display:flex;gap:12px;min-height:44px;padding:4px 12px}.doc-live-view__bar-label{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));flex-shrink:0;letter-spacing:.12em;line-height:1}.doc-live-view__hint{min-width:0}.doc-live-view__count{font-variant-numeric:tabular-nums}.doc-live-view__mode-toggle{background:rgba(var(--v-theme-on-surface),.06);border-radius:999px;display:inline-flex;flex-shrink:0;gap:2px;padding:3px}.doc-live-view__mode{align-items:center;background:transparent;border:0;border-radius:999px;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));cursor:pointer;display:inline-flex;font:inherit;font-size:.8125rem;font-weight:500;gap:6px;height:28px;line-height:1;padding:0 12px 0 10px;transition:background-color .18s ease,color .18s ease,box-shadow .18s ease}.doc-live-view__mode:hover{color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.doc-live-view__mode:focus-visible{outline:2px solid rgba(var(--v-theme-primary),.5);outline-offset:1px}.doc-live-view__mode--active{background:rgb(var(--v-theme-surface));box-shadow:0 1px 2px rgba(0,0,0,.14),0 0 0 1px rgba(var(--v-theme-on-surface),.06);color:rgb(var(--v-theme-primary))}.doc-live-view__preview{padding-top:8px;transition:background-color .22s ease}.doc-live-view__preview--design{background-color:rgba(var(--v-theme-on-surface),.015);background-image:radial-gradient(rgba(var(--v-theme-on-surface),.14) 1px,transparent 1px);background-position:8px 8px;background-size:16px 16px}.doc-live-view__preview--design :deep([data-doc-item]){border-radius:4px;cursor:pointer;outline:1px dashed transparent;outline-offset:2px;transition:outline-color .12s ease,background-color .12s ease}.doc-live-view__preview--design :deep([data-doc-item]>*){pointer-events:none}.doc-live-view__preview--design :deep([data-doc-item]:hover){background-color:rgba(var(--v-theme-primary),.04);outline-color:rgba(var(--v-theme-primary),.6)}.doc-live-view__preview:not(.doc-live-view__preview--design) :deep([data-doc-placeholder]){display:none}.doc-live-view__preview :deep(.doc-template-placeholder){border:1px dashed rgba(var(--v-theme-on-surface),.3);border-radius:4px;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));font-size:.75rem;line-height:1.4;padding:2px 8px;white-space:nowrap}.doc-live-view__preview :deep([data-doc-placeholder=Separator] .doc-template-placeholder){align-items:center;border:none;display:flex;gap:8px;padding:0}.doc-live-view__preview :deep([data-doc-placeholder=Separator] .doc-template-placeholder):after,.doc-live-view__preview :deep([data-doc-placeholder=Separator] .doc-template-placeholder):before{border-top:1px dashed rgba(var(--v-theme-on-surface),.3);content:"";flex:1}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--selected){background-color:rgba(var(--v-theme-primary),.06);border-radius:4px;outline:2px solid rgb(var(--v-theme-primary));outline-offset:2px}.doc-live-view__preview--sortable :deep([data-doc-item]){cursor:grab}.doc-live-view__preview--dragging :deep([data-doc-item]){cursor:grabbing}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--dragging){opacity:.4}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-before){box-shadow:-4px 0 0 0 rgb(var(--v-theme-primary))}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-after){box-shadow:4px 0 0 0 rgb(var(--v-theme-primary))}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-above){box-shadow:0 -4px 0 0 rgb(var(--v-theme-primary))}.doc-live-view__preview :deep([data-doc-item].doc-live-view__item--drop-below){box-shadow:0 4px 0 0 rgb(var(--v-theme-primary))}.doc-live-view--bounded{display:flex;flex-direction:column}.doc-live-view--bounded>.v-toolbar{flex:0 0 auto}.doc-live-view--bounded .doc-live-view__body{flex:1 1 auto;min-height:0;overflow-y:auto}@media (min-width:840px){.doc-live-view--bounded .doc-live-view__body{flex-wrap:nowrap;overflow:hidden}.doc-live-view--bounded .doc-live-view__outline,.doc-live-view--bounded .doc-live-view__palette,.doc-live-view--bounded .doc-live-view__preview-col{height:100%;overflow-y:auto}.doc-live-view--bounded .doc-live-view__preview-col--live{display:flex;flex-direction:column;overflow:hidden}.doc-live-view--bounded .doc-live-view__scroll{flex:1 1 auto;min-height:0;overflow-y:auto}.doc-live-view--bounded .doc-live-view__palette :deep(.doc-palette__body){max-height:none;overflow:visible}}
730
837
  </style>
@@ -17,6 +17,7 @@ interface Props {
17
17
  sortable?: boolean;
18
18
  palette?: boolean;
19
19
  paletteTypes?: string[];
20
+ height?: number | string;
20
21
  }
21
22
  /**
22
23
  * Public props accepted by DocumentTemplateBuilderLiveView.
@@ -30,9 +31,15 @@ interface Props {
30
31
  * - **Preview** — the preview is a live, fillable form so you can try the
31
32
  * validations; the data typed is shown in the "Preview data" panel.
32
33
  *
33
- * Items with no visual (`FormHidden`, `Separator`) are reachable from the
34
- * **Outline** list (a click opens the editor dialog), which also offers
35
- * reordering for every item.
34
+ * Items with no visual (`FormHidden`, `Separator`) get a placeholder in Design
35
+ * mode (hidden in Preview mode), so they can be selected, moved and deleted
36
+ * like any field. They are also reachable from the **Outline** list (a click
37
+ * opens the editor dialog), which offers reordering and deletion for every item.
38
+ *
39
+ * Both the overlay and the outline carry a **move to position** button between
40
+ * their up / down arrows (DocumentTemplateBuilder's "Enter the new position"):
41
+ * it opens a small menu that takes the new 1-based position (the numbering the
42
+ * outline and the overlay show) and moves the item there on Move / Enter.
36
43
  *
37
44
  * In Design mode every rendered field is also a drag handle: drop it on the
38
45
  * left / top half of another field to insert before it, on the right / bottom
@@ -44,6 +51,11 @@ interface Props {
44
51
  * the preview appends), or click a card to add one after the selected item.
45
52
  * The new item's settings dialog opens at once; cancelling it removes the
46
53
  * item again, saving keeps it.
54
+ *
55
+ * With `height` set the card has a fixed height: the toolbar and the live
56
+ * view bar stay put and only the form (plus the outline and the palette,
57
+ * each on its own from `md` up) scrolls. Use it inside dialogs, where the
58
+ * natural height would scroll the toolbar out of reach.
47
59
  */
48
60
  type __VLS_Props = Props;
49
61
  /** Select (highlight + pin the edit overlay on) the item at `index`, or clear the selection with `null`. */
@@ -88,7 +100,7 @@ type __VLS_ModelProps = {
88
100
  modelValue?: string | Record<string, any>[];
89
101
  };
90
102
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
91
- declare var __VLS_20: {}, __VLS_28: {
103
+ declare var __VLS_19: {}, __VLS_27: {
92
104
  items: Record<string, any>[];
93
105
  operation: {
94
106
  openCreate: typeof openCreate;
@@ -105,7 +117,7 @@ declare var __VLS_20: {}, __VLS_28: {
105
117
  importItems: typeof importItems;
106
118
  convertToAdvanceMode: () => Promise<void>;
107
119
  };
108
- }, __VLS_203: {
120
+ }, __VLS_217: {
109
121
  operation: {
110
122
  openCreate: typeof openCreate;
111
123
  openEdit: typeof openEdit;
@@ -121,7 +133,7 @@ declare var __VLS_20: {}, __VLS_28: {
121
133
  importItems: typeof importItems;
122
134
  convertToAdvanceMode: () => Promise<void>;
123
135
  };
124
- }, __VLS_224: {
136
+ }, __VLS_238: {
125
137
  index: number;
126
138
  item: Record<string, any>;
127
139
  operation: {
@@ -139,20 +151,20 @@ declare var __VLS_20: {}, __VLS_28: {
139
151
  importItems: typeof importItems;
140
152
  convertToAdvanceMode: () => Promise<void>;
141
153
  };
142
- }, __VLS_291: {
154
+ }, __VLS_312: {
143
155
  insert: typeof insertInputType;
144
156
  disabled: boolean;
145
157
  };
146
158
  type __VLS_Slots = {} & {
147
- title?: (props: typeof __VLS_20) => any;
159
+ title?: (props: typeof __VLS_19) => any;
148
160
  } & {
149
- toolbarItems?: (props: typeof __VLS_28) => any;
161
+ toolbarItems?: (props: typeof __VLS_27) => any;
150
162
  } & {
151
- empty?: (props: typeof __VLS_203) => any;
163
+ empty?: (props: typeof __VLS_217) => any;
152
164
  } & {
153
- itemOverlay?: (props: typeof __VLS_224) => any;
165
+ itemOverlay?: (props: typeof __VLS_238) => any;
154
166
  } & {
155
- palette?: (props: typeof __VLS_291) => any;
167
+ palette?: (props: typeof __VLS_312) => any;
156
168
  };
157
169
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
158
170
  templateItems: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
@@ -216,14 +228,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
216
228
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
217
229
  "onUpdate:modelValue"?: ((value: string | Record<string, any>[] | undefined) => any) | undefined;
218
230
  }>, {
231
+ height: string | number;
219
232
  title: string;
220
233
  stringFields: string[];
221
234
  initialData: Record<string, any>;
222
235
  roleCustomCode: string | string[];
223
236
  disableAdvanceMode: boolean;
224
237
  toolbarColor: string;
225
- editorWidth: number | string;
226
- dialogMaxWidth: number | string;
238
+ editorWidth: string | number;
239
+ dialogMaxWidth: string | number;
227
240
  dialogFullscreen: boolean;
228
241
  outline: boolean;
229
242
  importable: boolean;
@@ -7,7 +7,7 @@ interface Props {
7
7
  grouped?: boolean;
8
8
  disabled?: boolean;
9
9
  }
10
- type Thumb = 'text' | 'textarea' | 'date' | 'time' | 'datetime' | 'select' | 'radio' | 'radio-inline' | 'checkbox' | 'checkbox-group' | 'switch' | 'file' | 'images' | 'sign' | 'table' | 'header' | 'separator' | 'hidden' | 'form' | 'code' | 'custom';
10
+ type Thumb = 'text' | 'textarea' | 'date' | 'time' | 'datetime' | 'select' | 'radio' | 'radio-inline' | 'checkbox' | 'checkbox-group' | 'switch' | 'file' | 'images' | 'sign' | 'table' | 'header' | 'label' | 'separator' | 'hidden' | 'form' | 'code' | 'custom';
11
11
  interface PaletteCard {
12
12
  entry: DocumentTemplateInputType;
13
13
  value: string;
@@ -34,6 +34,7 @@ const THUMBS = {
34
34
  FormTable: "table",
35
35
  FormTableData: "table",
36
36
  Header: "header",
37
+ LabelField: "label",
37
38
  Separator: "separator",
38
39
  FormHidden: "hidden",
39
40
  DocumentForm: "form",
@@ -73,6 +74,7 @@ const THUMB_GROUP = {
73
74
  "sign": "media",
74
75
  "table": "table",
75
76
  "header": "layout",
77
+ "label": "layout",
76
78
  "separator": "layout",
77
79
  "hidden": "advanced",
78
80
  "form": "advanced",
@@ -317,6 +319,14 @@ defineExpose({ search, cards, sections });
317
319
  </div>
318
320
  <v-divider class="mt-1" />
319
321
  </template>
322
+ <template v-else-if="card.thumb === 'label'">
323
+ <div class="doc-palette__label-caption">
324
+ Label
325
+ </div>
326
+ <div class="doc-palette__label-value">
327
+ Value
328
+ </div>
329
+ </template>
320
330
  <v-divider
321
331
  v-else-if="card.thumb === 'separator'"
322
332
  class="doc-palette__separator"
@@ -358,5 +368,5 @@ defineExpose({ search, cards, sections });
358
368
  </template>
359
369
 
360
370
  <style scoped>
361
- .doc-palette{--doc-palette-radius:10px;display:flex;flex-direction:column;min-height:0}.doc-palette__head{background:rgb(var(--v-theme-surface));border-bottom:thin solid rgba(var(--v-border-color),var(--v-border-opacity));padding:10px 10px 8px;position:sticky;top:0;z-index:1}.doc-palette__title{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));letter-spacing:.12em;line-height:1.6;margin-bottom:4px}.doc-palette__search :deep(.v-field__input){font-size:.8125rem;min-height:34px}.doc-palette__body{max-height:70vh;overflow-y:auto;padding:8px 8px 12px}.doc-palette__section+.doc-palette__section{margin-top:12px}.doc-palette__section-label{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));font-size:.625rem;letter-spacing:.14em;line-height:1.6;padding:0 2px 6px}.doc-palette__grid{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}.doc-palette__card{background:rgb(var(--v-theme-surface));border:thin solid rgba(var(--v-border-color),var(--v-border-opacity));border-radius:var(--doc-palette-radius);cursor:grab;display:flex;flex-direction:column;outline:none;position:relative;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease,opacity .14s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}.doc-palette__card:focus-visible,.doc-palette__card:hover{border-color:rgba(var(--v-theme-primary),.7);box-shadow:0 2px 10px rgba(var(--v-theme-on-surface),.08);transform:translateY(-1px)}.doc-palette__card:focus-visible{box-shadow:0 0 0 2px rgba(var(--v-theme-primary),.35)}.doc-palette__card:active{cursor:grabbing;transform:translateY(0)}.doc-palette__card--dragging{opacity:.45}.doc-palette__thumb{background:linear-gradient(rgba(var(--v-theme-on-surface),.035),rgba(var(--v-theme-on-surface),.035)),rgb(var(--v-theme-surface));border-radius:var(--doc-palette-radius) var(--doc-palette-radius) 0 0;display:flex;flex-direction:column;height:56px;justify-content:center;overflow:hidden;padding:4px 8px 0;pointer-events:none}.doc-palette__thumb :deep(.v-input){font-size:.75rem}.doc-palette__thumb :deep(.v-field){--v-field-padding-start:8px;--v-field-padding-end:6px}.doc-palette__thumb :deep(.v-field__input){min-height:32px;padding-bottom:0;padding-top:0}.doc-palette__thumb :deep(.v-label){font-size:.75rem}.doc-palette__thumb :deep(.v-selection-control){--v-selection-control-size:22px;min-height:0}.doc-palette__thumb :deep(.v-selection-control-group){-moz-column-gap:8px;column-gap:8px;row-gap:0}.doc-palette__thumb :deep(.v-selection-control .v-label){font-size:.7rem}.doc-palette__thumb :deep(.v-input__control){min-height:0}.doc-palette__thumb--textarea :deep(.v-field__input){min-height:40px}.doc-palette__thumb--checkbox-group,.doc-palette__thumb--radio,.doc-palette__thumb--table{justify-content:flex-start}.doc-palette__table{background:transparent;font-size:.65rem}.doc-palette__table :deep(td),.doc-palette__table :deep(th){height:16px!important;line-height:16px;padding:0 6px!important}.doc-palette__separator{border-style:dashed}.doc-palette__icon{align-items:center;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));display:flex;height:100%;justify-content:center}.doc-palette__foot{align-items:center;border-top:thin solid rgba(var(--v-border-color),var(--v-border-opacity));display:flex;gap:4px;min-height:30px;padding:2px 4px 2px 8px}.doc-palette__name{display:-webkit-box;flex:1 1 auto;font-size:.75rem;line-height:1.2;min-width:0;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}.doc-palette__add{flex:0 0 auto;opacity:0;transition:opacity .14s ease}.doc-palette__card:focus-within .doc-palette__add,.doc-palette__card:hover .doc-palette__add{opacity:1}@media (hover:none){.doc-palette__add{opacity:1}}.doc-palette--disabled .doc-palette__card{border-color:rgba(var(--v-border-color),var(--v-border-opacity));box-shadow:none;cursor:default;opacity:.55;transform:none}.doc-palette--disabled .doc-palette__add{display:none}.doc-palette__empty{padding:8px 2px}
371
+ .doc-palette{--doc-palette-radius:10px;display:flex;flex-direction:column;min-height:0}.doc-palette__head{background:rgb(var(--v-theme-surface));border-bottom:thin solid rgba(var(--v-border-color),var(--v-border-opacity));padding:10px 10px 8px;position:sticky;top:0;z-index:1}.doc-palette__title{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));letter-spacing:.12em;line-height:1.6;margin-bottom:4px}.doc-palette__search :deep(.v-field__input){font-size:.8125rem;min-height:34px}.doc-palette__body{max-height:70vh;overflow-y:auto;padding:8px 8px 12px}.doc-palette__section+.doc-palette__section{margin-top:12px}.doc-palette__section-label{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));font-size:.625rem;letter-spacing:.14em;line-height:1.6;padding:0 2px 6px}.doc-palette__grid{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}.doc-palette__card{background:rgb(var(--v-theme-surface));border:thin solid rgba(var(--v-border-color),var(--v-border-opacity));border-radius:var(--doc-palette-radius);cursor:grab;display:flex;flex-direction:column;outline:none;position:relative;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease,opacity .14s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}.doc-palette__card:focus-visible,.doc-palette__card:hover{border-color:rgba(var(--v-theme-primary),.7);box-shadow:0 2px 10px rgba(var(--v-theme-on-surface),.08);transform:translateY(-1px)}.doc-palette__card:focus-visible{box-shadow:0 0 0 2px rgba(var(--v-theme-primary),.35)}.doc-palette__card:active{cursor:grabbing;transform:translateY(0)}.doc-palette__card--dragging{opacity:.45}.doc-palette__thumb{background:linear-gradient(rgba(var(--v-theme-on-surface),.035),rgba(var(--v-theme-on-surface),.035)),rgb(var(--v-theme-surface));border-radius:var(--doc-palette-radius) var(--doc-palette-radius) 0 0;display:flex;flex-direction:column;height:56px;justify-content:center;overflow:hidden;padding:4px 8px 0;pointer-events:none}.doc-palette__thumb :deep(.v-input){font-size:.75rem}.doc-palette__thumb :deep(.v-field){--v-field-padding-start:8px;--v-field-padding-end:6px}.doc-palette__thumb :deep(.v-field__input){min-height:32px;padding-bottom:0;padding-top:0}.doc-palette__thumb :deep(.v-label){font-size:.75rem}.doc-palette__thumb :deep(.v-selection-control){--v-selection-control-size:22px;min-height:0}.doc-palette__thumb :deep(.v-selection-control-group){-moz-column-gap:8px;column-gap:8px;row-gap:0}.doc-palette__thumb :deep(.v-selection-control .v-label){font-size:.7rem}.doc-palette__thumb :deep(.v-input__control){min-height:0}.doc-palette__thumb--textarea :deep(.v-field__input){min-height:40px}.doc-palette__thumb--checkbox-group,.doc-palette__thumb--radio,.doc-palette__thumb--table{justify-content:flex-start}.doc-palette__table{background:transparent;font-size:.65rem}.doc-palette__table :deep(td),.doc-palette__table :deep(th){height:16px!important;line-height:16px;padding:0 6px!important}.doc-palette__label-caption{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));font-size:.65rem;line-height:1.3}.doc-palette__label-value{font-size:.875rem;font-weight:600;line-height:1.3}.doc-palette__separator{border-style:dashed}.doc-palette__icon{align-items:center;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));display:flex;height:100%;justify-content:center}.doc-palette__foot{align-items:center;border-top:thin solid rgba(var(--v-border-color),var(--v-border-opacity));display:flex;gap:4px;min-height:30px;padding:2px 4px 2px 8px}.doc-palette__name{display:-webkit-box;flex:1 1 auto;font-size:.75rem;line-height:1.2;min-width:0;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}.doc-palette__add{flex:0 0 auto;opacity:0;transition:opacity .14s ease}.doc-palette__card:focus-within .doc-palette__add,.doc-palette__card:hover .doc-palette__add{opacity:1}@media (hover:none){.doc-palette__add{opacity:1}}.doc-palette--disabled .doc-palette__card{border-color:rgba(var(--v-border-color),var(--v-border-opacity));box-shadow:none;cursor:default;opacity:.55;transform:none}.doc-palette--disabled .doc-palette__add{display:none}.doc-palette__empty{padding:8px 2px}
362
372
  </style>
@@ -7,7 +7,7 @@ interface Props {
7
7
  grouped?: boolean;
8
8
  disabled?: boolean;
9
9
  }
10
- type Thumb = 'text' | 'textarea' | 'date' | 'time' | 'datetime' | 'select' | 'radio' | 'radio-inline' | 'checkbox' | 'checkbox-group' | 'switch' | 'file' | 'images' | 'sign' | 'table' | 'header' | 'separator' | 'hidden' | 'form' | 'code' | 'custom';
10
+ type Thumb = 'text' | 'textarea' | 'date' | 'time' | 'datetime' | 'select' | 'radio' | 'radio-inline' | 'checkbox' | 'checkbox-group' | 'switch' | 'file' | 'images' | 'sign' | 'table' | 'header' | 'label' | 'separator' | 'hidden' | 'form' | 'code' | 'custom';
11
11
  interface PaletteCard {
12
12
  entry: DocumentTemplateInputType;
13
13
  value: string;