@bagelink/vue 1.2.79 → 1.2.83

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 (66) hide show
  1. package/bin/experimentalGenTypedRoutes.ts +13 -2
  2. package/dist/components/Btn.vue.d.ts +1 -1
  3. package/dist/components/Btn.vue.d.ts.map +1 -1
  4. package/dist/components/DataPreview.vue.d.ts +16 -5
  5. package/dist/components/DataPreview.vue.d.ts.map +1 -1
  6. package/dist/components/Icon/Icon.vue.d.ts +4 -1
  7. package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
  8. package/dist/components/ModalForm.vue.d.ts +2 -1
  9. package/dist/components/ModalForm.vue.d.ts.map +1 -1
  10. package/dist/components/dataTable/DataTable.vue.d.ts.map +1 -1
  11. package/dist/components/dataTable/useSorting.d.ts +1 -1
  12. package/dist/components/dataTable/useSorting.d.ts.map +1 -1
  13. package/dist/components/dataTable/useTableData.d.ts +7 -6
  14. package/dist/components/dataTable/useTableData.d.ts.map +1 -1
  15. package/dist/components/dataTable/useTableVirtualization.d.ts.map +1 -1
  16. package/dist/components/form/BagelForm.vue.d.ts +5 -10
  17. package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
  18. package/dist/components/form/BglMultiStepForm.vue.d.ts +10 -6
  19. package/dist/components/form/BglMultiStepForm.vue.d.ts.map +1 -1
  20. package/dist/components/form/FieldArray.vue.d.ts +3 -2
  21. package/dist/components/form/FieldArray.vue.d.ts.map +1 -1
  22. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +14 -6
  23. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
  24. package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
  25. package/dist/composables/index.d.ts +5 -5
  26. package/dist/composables/index.d.ts.map +1 -1
  27. package/dist/composables/useSchemaField.d.ts +5 -12
  28. package/dist/composables/useSchemaField.d.ts.map +1 -1
  29. package/dist/index.cjs +298 -357
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.mjs +299 -358
  33. package/dist/plugins/modalTypes.d.ts +3 -2
  34. package/dist/plugins/modalTypes.d.ts.map +1 -1
  35. package/dist/style.css +165 -135
  36. package/dist/types/BagelForm.d.ts +14 -11
  37. package/dist/types/BagelForm.d.ts.map +1 -1
  38. package/dist/types/TableSchema.d.ts +9 -9
  39. package/dist/types/TableSchema.d.ts.map +1 -1
  40. package/dist/utils/BagelFormUtils.d.ts +4 -3
  41. package/dist/utils/BagelFormUtils.d.ts.map +1 -1
  42. package/dist/utils/index.d.ts.map +1 -1
  43. package/dist/utils/useSearch.d.ts +44 -0
  44. package/dist/utils/useSearch.d.ts.map +1 -0
  45. package/package.json +1 -1
  46. package/src/components/DataPreview.vue +16 -5
  47. package/src/components/Icon/Icon.vue +12 -3
  48. package/src/components/ModalForm.vue +6 -9
  49. package/src/components/dataTable/DataTable.vue +11 -14
  50. package/src/components/dataTable/useSorting.ts +1 -1
  51. package/src/components/dataTable/useTableData.ts +19 -42
  52. package/src/components/dataTable/useTableVirtualization.ts +4 -8
  53. package/src/components/form/BagelForm.vue +33 -97
  54. package/src/components/form/BglMultiStepForm.vue +52 -36
  55. package/src/components/form/FieldArray.vue +54 -45
  56. package/src/components/form/inputs/CodeEditor/Index.vue +160 -98
  57. package/src/components/form/inputs/RichText/index.vue +13 -12
  58. package/src/composables/index.ts +12 -13
  59. package/src/composables/useSchemaField.ts +37 -35
  60. package/src/index.ts +1 -1
  61. package/src/plugins/modalTypes.ts +3 -2
  62. package/src/types/BagelForm.ts +22 -14
  63. package/src/types/TableSchema.ts +9 -9
  64. package/src/utils/BagelFormUtils.ts +4 -3
  65. package/src/utils/index.ts +38 -13
  66. package/src/utils/{search.ts → useSearch.ts} +1 -2
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { defineComponent, reactive, provide, createElementBlock, openBlock, renderSlot, ref, computed, inject, watch, normalizeClass, createElementVNode, createVNode, unref, createCommentVNode, toDisplayString, Transition, withCtx, Fragment, renderList, createBlock, isRef, useSlots, resolveDirective, withDirectives, resolveDynamicComponent, mergeProps, withKeys, withModifiers, createTextVNode, normalizeStyle, onMounted, onUnmounted, nextTick, resolveComponent, isVNode, h as h$2, getCurrentScope, onScopeDispose, toValue, getCurrentInstance, shallowRef, mergeModels, useCssVars, useModel, vModelCheckbox, createApp, pushScopeId, popScopeId, withScopeId, normalizeProps, guardReactiveProps, toRef, createSlots, vModelText, Comment, Text, vModelRadio, TransitionGroup, vModelDynamic, onBeforeUnmount } from "vue";
4
+ import { defineComponent, reactive, provide, createElementBlock, openBlock, renderSlot, ref, computed, inject, watch, normalizeClass, createElementVNode, createVNode, unref, createCommentVNode, toDisplayString, Transition, withCtx, Fragment, renderList, createBlock, isRef, useSlots, resolveDirective, withDirectives, resolveDynamicComponent, mergeProps, withKeys, withModifiers, createTextVNode, normalizeStyle, onMounted, onUnmounted, nextTick, resolveComponent, isVNode, h as h$2, toRef, toValue, getCurrentScope, onScopeDispose, getCurrentInstance, shallowRef, mergeModels, useCssVars, useModel, vModelCheckbox, createApp, pushScopeId, popScopeId, withScopeId, normalizeProps, guardReactiveProps, createSlots, vModelText, Comment, Text, vModelRadio, TransitionGroup, vModelDynamic, onBeforeUnmount } from "vue";
5
5
  import { RouterLink } from "vue-router";
6
6
  const _sfc_main$1g = /* @__PURE__ */ defineComponent({
7
7
  __name: "Accordion",
@@ -17,7 +17,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
17
17
  };
18
18
  }
19
19
  });
20
- const _hoisted_1$13 = ["aria-expanded", "aria-controls"];
20
+ const _hoisted_1$12 = ["aria-expanded", "aria-controls"];
21
21
  const _hoisted_2$N = { class: "accordion-label" };
22
22
  const _hoisted_3$G = ["id", "aria-hidden"];
23
23
  const _sfc_main$1f = /* @__PURE__ */ defineComponent({
@@ -94,7 +94,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
94
94
  }, [
95
95
  createVNode(unref(_sfc_main$t), { icon: computedIcon.value }, null, 8, ["icon"])
96
96
  ], 2)) : createCommentVNode("", true)
97
- ], 8, _hoisted_1$13),
97
+ ], 8, _hoisted_1$12),
98
98
  createVNode(Transition, { name: "expand" }, {
99
99
  default: withCtx(() => [
100
100
  unref(isOpen) ? (openBlock(), createElementBlock("div", {
@@ -120,7 +120,7 @@ const _export_sfc = (sfc, props2) => {
120
120
  return target;
121
121
  };
122
122
  const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__scopeId", "data-v-3334f637"]]);
123
- const _hoisted_1$12 = { class: "relative" };
123
+ const _hoisted_1$11 = { class: "relative" };
124
124
  const _sfc_main$1e = /* @__PURE__ */ defineComponent({
125
125
  __name: "AddressSearch",
126
126
  emits: ["addressSelected"],
@@ -143,7 +143,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
143
143
  (_a = suggestion.value) == null ? void 0 : _a.show();
144
144
  }
145
145
  return (_ctx, _cache) => {
146
- return openBlock(), createElementBlock("div", _hoisted_1$12, [
146
+ return openBlock(), createElementBlock("div", _hoisted_1$11, [
147
147
  createVNode(unref(_sfc_main$Y), {
148
148
  ref_key: "suggestion",
149
149
  ref: suggestion,
@@ -179,7 +179,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
179
179
  };
180
180
  }
181
181
  });
182
- const _hoisted_1$11 = {
182
+ const _hoisted_1$10 = {
183
183
  key: 1,
184
184
  class: "bgl_btn-flex"
185
185
  };
@@ -252,7 +252,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
252
252
  key: 0,
253
253
  class: "h-100p",
254
254
  size: "15"
255
- })) : (openBlock(), createElementBlock("div", _hoisted_1$11, [
255
+ })) : (openBlock(), createElementBlock("div", _hoisted_1$10, [
256
256
  _ctx.icon ? (openBlock(), createBlock(unref(_sfc_main$t), {
257
257
  key: 0,
258
258
  icon: _ctx.icon,
@@ -277,7 +277,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
277
277
  }
278
278
  });
279
279
  const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-99c4aa53"]]);
280
- const _hoisted_1$10 = ["dismissable"];
280
+ const _hoisted_1$$ = ["dismissable"];
281
281
  const _hoisted_2$M = { class: "m-0" };
282
282
  const _sfc_main$1c = /* @__PURE__ */ defineComponent({
283
283
  __name: "Alert",
@@ -317,12 +317,12 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
317
317
  icon: "close",
318
318
  onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true)
319
319
  })
320
- ], 10, _hoisted_1$10)) : createCommentVNode("", true);
320
+ ], 10, _hoisted_1$$)) : createCommentVNode("", true);
321
321
  };
322
322
  }
323
323
  });
324
324
  const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-15c4ee95"]]);
325
- const _hoisted_1$$ = ["src", "alt"];
325
+ const _hoisted_1$_ = ["src", "alt"];
326
326
  const _sfc_main$1b = /* @__PURE__ */ defineComponent({
327
327
  __name: "Avatar",
328
328
  props: {
@@ -341,7 +341,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
341
341
  key: 0,
342
342
  src: _ctx.src,
343
343
  alt: _ctx.name
344
- }, null, 8, _hoisted_1$$)) : (openBlock(), createElementBlock("p", {
344
+ }, null, 8, _hoisted_1$_)) : (openBlock(), createElementBlock("p", {
345
345
  key: 1,
346
346
  style: normalizeStyle({ "line-height": `${_ctx.size}px`, "font-size": `calc(1.5rem * ${_ctx.size} / 50)` })
347
347
  }, toDisplayString((_ctx.fallback || unref(initials)(_ctx.name || "")).toUpperCase()), 5))
@@ -380,7 +380,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
380
380
  }
381
381
  });
382
382
  const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-689f051f"]]);
383
- const _hoisted_1$_ = ["src"];
383
+ const _hoisted_1$Z = ["src"];
384
384
  const _hoisted_2$L = ["autoplay", "muted", "loop", "controls", "playsinline"];
385
385
  const _hoisted_3$F = ["src", "type"];
386
386
  const _sfc_main$19 = /* @__PURE__ */ defineComponent({
@@ -460,7 +460,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
460
460
  allowfullscreen: "",
461
461
  title: "Video",
462
462
  allow: "autoplay"
463
- }, null, 12, _hoisted_1$_)) : _ctx.src ? (openBlock(), createElementBlock("video", {
463
+ }, null, 12, _hoisted_1$Z)) : _ctx.src ? (openBlock(), createElementBlock("video", {
464
464
  key: 1,
465
465
  ref_key: "video",
466
466
  ref: video,
@@ -547,12 +547,12 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
547
547
  }
548
548
  });
549
549
  const CalendarPopover = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-6f51f6b3"]]);
550
- const _hoisted_1$Z = { class: "agenda-view" };
550
+ const _hoisted_1$Y = { class: "agenda-view" };
551
551
  const _hoisted_2$K = ["data-date", "onClick"];
552
552
  const _hoisted_3$E = { class: "event-content" };
553
553
  const _hoisted_4$r = { class: "event-time" };
554
554
  const _hoisted_5$q = { class: "event-details" };
555
- const _hoisted_6$n = { class: "event-title" };
555
+ const _hoisted_6$m = { class: "event-title" };
556
556
  const _sfc_main$17 = /* @__PURE__ */ defineComponent({
557
557
  __name: "AgendaView",
558
558
  props: {
@@ -651,7 +651,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
651
651
  }
652
652
  });
653
653
  return (_ctx, _cache) => {
654
- return openBlock(), createElementBlock("div", _hoisted_1$Z, [
654
+ return openBlock(), createElementBlock("div", _hoisted_1$Y, [
655
655
  _cache[0] || (_cache[0] = createElementVNode("div", { class: "agenda-header" }, [
656
656
  createElementVNode("div", { class: "time-column" }, " Time "),
657
657
  createElementVNode("div", { class: "event-column" }, " Event ")
@@ -675,7 +675,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
675
675
  createElementVNode("div", _hoisted_3$E, [
676
676
  createElementVNode("div", _hoisted_4$r, toDisplayString(unref(formatDate)(event.start_time, { fmt: "HH:mm" })), 1),
677
677
  createElementVNode("div", _hoisted_5$q, [
678
- createElementVNode("div", _hoisted_6$n, toDisplayString(event.title), 1),
678
+ createElementVNode("div", _hoisted_6$m, toDisplayString(event.title), 1),
679
679
  createElementVNode("div", {
680
680
  class: normalizeClass(["event-day", { today: event.isToday }])
681
681
  }, toDisplayString(event.dayLabel), 3)
@@ -689,12 +689,12 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
689
689
  }
690
690
  });
691
691
  const AgendaView = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-1e2b483b"]]);
692
- const _hoisted_1$Y = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
692
+ const _hoisted_1$X = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
693
693
  const _hoisted_2$J = { class: "border-bottom me-1 txt-center p-05 dayGrid" };
694
694
  const _hoisted_3$D = { class: "overflow h-100p pe-05" };
695
695
  const _hoisted_4$q = { class: "time-column" };
696
696
  const _hoisted_5$p = { class: "events-column" };
697
- const _hoisted_6$m = ["onClick"];
697
+ const _hoisted_6$l = ["onClick"];
698
698
  const _hoisted_7$h = { class: "event-content" };
699
699
  const _hoisted_8$b = { class: "white-space ellipsis-1" };
700
700
  const _hoisted_9$7 = { class: "event-time opacity-8" };
@@ -835,7 +835,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
835
835
  }
836
836
  });
837
837
  return (_ctx, _cache) => {
838
- return openBlock(), createElementBlock("div", _hoisted_1$Y, [
838
+ return openBlock(), createElementBlock("div", _hoisted_1$X, [
839
839
  createElementVNode("div", _hoisted_2$J, [
840
840
  _cache[0] || (_cache[0] = createElementVNode("div", null, null, -1)),
841
841
  createElementVNode("div", null, toDisplayString(unref(formatDate)(_ctx.startDate)), 1)
@@ -878,7 +878,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
878
878
  createElementVNode("div", _hoisted_8$b, toDisplayString(event.title), 1),
879
879
  createElementVNode("div", _hoisted_9$7, toDisplayString(unref(formatDate)(new Date(event.start_time), { fmt: "HH:mm" })) + " - " + toDisplayString(unref(formatDate)(new Date(event.end_time), { fmt: "HH:mm" })), 1)
880
880
  ])
881
- ], 12, _hoisted_6$m);
881
+ ], 12, _hoisted_6$l);
882
882
  }), 128))
883
883
  ]),
884
884
  dragState.value.isDragging && dragState.value.start && dragState.value.end ? (openBlock(), createElementBlock("div", {
@@ -901,12 +901,12 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
901
901
  }
902
902
  });
903
903
  const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-8b1a770f"]]);
904
- const _hoisted_1$X = { class: "month-view" };
904
+ const _hoisted_1$W = { class: "month-view" };
905
905
  const _hoisted_2$I = { class: "month-header" };
906
906
  const _hoisted_3$C = { class: "month-grid" };
907
907
  const _hoisted_4$p = { class: "day-number" };
908
908
  const _hoisted_5$o = { class: "day-events" };
909
- const _hoisted_6$l = {
909
+ const _hoisted_6$k = {
910
910
  key: 0,
911
911
  class: "event-dot"
912
912
  };
@@ -987,7 +987,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
987
987
  }
988
988
  }
989
989
  return (_ctx, _cache) => {
990
- return openBlock(), createElementBlock("div", _hoisted_1$X, [
990
+ return openBlock(), createElementBlock("div", _hoisted_1$W, [
991
991
  createElementVNode("div", _hoisted_2$I, [
992
992
  (openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
993
993
  return openBlock(), createElementBlock("div", {
@@ -1009,7 +1009,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
1009
1009
  createElementVNode("div", _hoisted_4$p, toDisplayString(unref(fmtDate)(day.date, { fmt: "DD" })), 1),
1010
1010
  createElementVNode("div", _hoisted_5$o, [
1011
1011
  isMobile.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1012
- day.events.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6$l)) : createCommentVNode("", true)
1012
+ day.events.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6$k)) : createCommentVNode("", true)
1013
1013
  ], 64)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(day.events, (event) => {
1014
1014
  return openBlock(), createElementBlock("div", {
1015
1015
  key: event.id,
@@ -1030,12 +1030,12 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
1030
1030
  }
1031
1031
  });
1032
1032
  const MonthView = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-0b1117c4"]]);
1033
- const _hoisted_1$W = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
1033
+ const _hoisted_1$V = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
1034
1034
  const _hoisted_2$H = { class: "overflow h-100p pe-05" };
1035
1035
  const _hoisted_3$B = ["onMousedown"];
1036
1036
  const _hoisted_4$o = ["onClick"];
1037
1037
  const _hoisted_5$n = { class: "overflow-hidden color-white p-025 txt12 h-100p" };
1038
- const _hoisted_6$k = { class: "white-space ellipsis-1" };
1038
+ const _hoisted_6$j = { class: "white-space ellipsis-1" };
1039
1039
  const _hoisted_7$f = { class: "txt10 opacity-8 user-select-none" };
1040
1040
  const _hoisted_8$9 = { class: "color-primary txt-12 p-025" };
1041
1041
  const slotHeight = 60;
@@ -1294,7 +1294,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
1294
1294
  }
1295
1295
  });
1296
1296
  return (_ctx, _cache) => {
1297
- return openBlock(), createElementBlock("div", _hoisted_1$W, [
1297
+ return openBlock(), createElementBlock("div", _hoisted_1$V, [
1298
1298
  createElementVNode("div", {
1299
1299
  ref_key: "calendarGrid",
1300
1300
  ref: calendarGrid,
@@ -1366,7 +1366,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
1366
1366
  onClick: withModifiers(($event) => handleEventSelection(event, $event), ["stop"])
1367
1367
  }, [
1368
1368
  createElementVNode("div", _hoisted_5$n, [
1369
- createElementVNode("div", _hoisted_6$k, toDisplayString(event.title), 1),
1369
+ createElementVNode("div", _hoisted_6$j, toDisplayString(event.title), 1),
1370
1370
  createElementVNode("div", _hoisted_7$f, toDisplayString(unref(formatDate)(event.start_time, { fmt: "HH:mm" })) + " - " + toDisplayString(unref(formatDate)(event.end_time, { fmt: "HH:mm" })), 1)
1371
1371
  ])
1372
1372
  ], 44, _hoisted_4$o);
@@ -1393,7 +1393,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
1393
1393
  }
1394
1394
  });
1395
1395
  const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-2d5bca17"]]);
1396
- const _hoisted_1$V = { class: "calendar" };
1396
+ const _hoisted_1$U = { class: "calendar" };
1397
1397
  const _hoisted_2$G = { class: "flex m_block m_pb-1" };
1398
1398
  const _hoisted_3$A = { class: "txt-light my-0" };
1399
1399
  const _hoisted_4$n = { class: "ms-auto flex gap-025" };
@@ -1489,7 +1489,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1489
1489
  emit2("ready", state2.value);
1490
1490
  });
1491
1491
  return (_ctx, _cache) => {
1492
- return openBlock(), createElementBlock("div", _hoisted_1$V, [
1492
+ return openBlock(), createElementBlock("div", _hoisted_1$U, [
1493
1493
  createElementVNode("div", _hoisted_2$G, [
1494
1494
  createElementVNode("h3", _hoisted_3$A, [
1495
1495
  createElementVNode("b", null, toDisplayString(unref(fmtDate)(currentDate.value, { fmt: "MMMM" })), 1),
@@ -1568,7 +1568,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1568
1568
  }
1569
1569
  });
1570
1570
  const Index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-840b6594"]]);
1571
- const _hoisted_1$U = {
1571
+ const _hoisted_1$T = {
1572
1572
  key: 0,
1573
1573
  class: "card_label"
1574
1574
  };
@@ -1601,7 +1601,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
1601
1601
  }])
1602
1602
  }, {
1603
1603
  default: withCtx(() => [
1604
- _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$U, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
1604
+ _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$T, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
1605
1605
  renderSlot(_ctx.$slots, "default")
1606
1606
  ]),
1607
1607
  _: 3
@@ -1611,7 +1611,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
1611
1611
  };
1612
1612
  }
1613
1613
  });
1614
- const _hoisted_1$T = ["dir"];
1614
+ const _hoisted_1$S = ["dir"];
1615
1615
  const _hoisted_2$F = {
1616
1616
  key: 0,
1617
1617
  class: "dots"
@@ -2084,7 +2084,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
2084
2084
  }, void 0, true)
2085
2085
  ])
2086
2086
  ], 2)
2087
- ], 8, _hoisted_1$T);
2087
+ ], 8, _hoisted_1$S);
2088
2088
  };
2089
2089
  }
2090
2090
  });
@@ -7925,7 +7925,7 @@ const _hoisted_2$1$1 = ["width", "height", "viewBox"];
7925
7925
  const _hoisted_3$y = { class: "layer-rectangles" };
7926
7926
  const _hoisted_4$m = ["transform", "onMouseover"];
7927
7927
  const _hoisted_5$m = ["width", "height"];
7928
- const _hoisted_6$j = {
7928
+ const _hoisted_6$i = {
7929
7929
  x: 0 + 10,
7930
7930
  y: 0 + 20,
7931
7931
  "font-size": `15px`,
@@ -7968,7 +7968,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
7968
7968
  }, () => [
7969
7969
  createElementVNode(
7970
7970
  "text",
7971
- _hoisted_6$j,
7971
+ _hoisted_6$i,
7972
7972
  toDisplayString(r2.data.name),
7973
7973
  1
7974
7974
  /* TEXT */
@@ -8032,13 +8032,13 @@ var script = defineComponent({
8032
8032
  return { bar, canvas, direction, mouse };
8033
8033
  }
8034
8034
  });
8035
- const _hoisted_1$S = {
8035
+ const _hoisted_1$R = {
8036
8036
  key: 0,
8037
8037
  class: "layer-hover-bar"
8038
8038
  };
8039
8039
  const _hoisted_2$E = ["x", "y", "width", "height"];
8040
8040
  function render(_ctx, _cache, $props, $setup, $data, $options) {
8041
- return _ctx.mouse.hover ? (openBlock(), createElementBlock("g", _hoisted_1$S, [
8041
+ return _ctx.mouse.hover ? (openBlock(), createElementBlock("g", _hoisted_1$R, [
8042
8042
  createElementVNode("rect", mergeProps({ class: "hover-bar" }, _ctx.barStyle, {
8043
8043
  x: _ctx.bar.x,
8044
8044
  y: _ctx.bar.y,
@@ -8239,7 +8239,7 @@ ${indent}}`;
8239
8239
  return typeof field.$el === "object" ? field.$el : componentMap[field.$el] ?? field.$el ?? "div";
8240
8240
  }
8241
8241
  function renderChild(child, slots) {
8242
- if (typeof child === "string") return child;
8242
+ if (typeof child === "string") return h$2(child);
8243
8243
  if (isVNode(child)) return child;
8244
8244
  return renderField(
8245
8245
  child,
@@ -8247,8 +8247,9 @@ ${indent}}`;
8247
8247
  );
8248
8248
  }
8249
8249
  function renderField(field, slots) {
8250
+ var _a;
8250
8251
  const Component = getComponent(field);
8251
- if (!Component) return null;
8252
+ if (!Component) return;
8252
8253
  const rowData = (getFormData == null ? void 0 : getFormData()) || {};
8253
8254
  const condition = field.vIf ?? field["v-if"];
8254
8255
  if (condition !== void 0) {
@@ -8257,14 +8258,14 @@ ${indent}}`;
8257
8258
  field.id ? rowData == null ? void 0 : rowData[field.id] : void 0,
8258
8259
  rowData
8259
8260
  )) {
8260
- return null;
8261
+ return;
8261
8262
  }
8262
8263
  } else if (typeof condition === "string") {
8263
8264
  if (!(rowData == null ? void 0 : rowData[condition])) {
8264
- return null;
8265
+ return;
8265
8266
  }
8266
8267
  } else if (!condition) {
8267
- return null;
8268
+ return;
8268
8269
  }
8269
8270
  }
8270
8271
  const {
@@ -8343,23 +8344,24 @@ ${indent}}`;
8343
8344
  Object.entries(fieldSlots).forEach(([name, slot]) => {
8344
8345
  componentSlots[name] = () => {
8345
8346
  if (Array.isArray(slot)) {
8346
- return slot.map((schemaField) => renderField(schemaField, slots));
8347
- }
8348
- if (isVNode(slot)) {
8349
- return slot;
8350
- }
8351
- if (typeof slot === "function") {
8352
- const slotFn = slot;
8353
- return slotFn({ row: rowData, field });
8347
+ return slot.map((schemaField) => {
8348
+ if (typeof schemaField === "function") {
8349
+ const slotFn = schemaField;
8350
+ return slotFn({ row: rowData, field });
8351
+ }
8352
+ if (isVNode(schemaField)) {
8353
+ return schemaField;
8354
+ }
8355
+ return renderField(schemaField, slots);
8356
+ });
8354
8357
  }
8355
- return slot;
8356
8358
  };
8357
8359
  });
8358
8360
  }
8359
- const slotContent = field.id && (slots == null ? void 0 : slots[field.id]) ? slots[field.id]({ row: rowData, field }) : void 0;
8361
+ const slotContent = field.id ? (_a = slots == null ? void 0 : slots[field.id]) == null ? void 0 : _a.call(slots, { row: rowData, field }) : void 0;
8360
8362
  if (mode === "preview") {
8361
8363
  if (!includeUnset && (transformedValue === void 0 || transformedValue === null || transformedValue.length === 0)) {
8362
- return null;
8364
+ return;
8363
8365
  }
8364
8366
  return h$2("div", { class: "preview-field" }, [
8365
8367
  h$2("div", { class: "field-label" }, `${field.label || keyToLabel(field.id || "")}:`),
@@ -8383,27 +8385,13 @@ function useTableData(options) {
8383
8385
  const sortDirection = ref("ASC");
8384
8386
  const schemaState = ref("loading");
8385
8387
  const resolvedSchema = ref([]);
8386
- function getValue(value) {
8387
- if (value === void 0 || value === null) {
8388
- return void 0;
8389
- }
8390
- try {
8391
- if (value && typeof value === "object" && "value" in value) {
8392
- return value.value;
8393
- }
8394
- return value;
8395
- } catch (error) {
8396
- console.error("Error in getValue:", error);
8397
- return void 0;
8398
- }
8399
- }
8400
- async function resolveSchemaAsync() {
8388
+ function resolveSchema() {
8401
8389
  try {
8402
8390
  schemaState.value = "loading";
8403
8391
  const dataValue = options.data.value || [];
8404
8392
  const schema = useBglSchema({
8405
- schema: await getValue(options.schema),
8406
- columns: getValue(options.columns),
8393
+ schema: options.schema,
8394
+ columns: options.columns,
8407
8395
  data: dataValue
8408
8396
  });
8409
8397
  if (Array.isArray(schema) && schema.length > 0) {
@@ -8412,6 +8400,7 @@ function useTableData(options) {
8412
8400
  const firstItem = dataValue[0];
8413
8401
  resolvedSchema.value = Object.keys(firstItem || {}).filter((key) => key !== "id" && !key.startsWith("_")).map((key) => ({
8414
8402
  id: key,
8403
+ // Cast to any to resolve type issues with Path<T>
8415
8404
  label: keyToLabel(key),
8416
8405
  $el: "div",
8417
8406
  transform: (val) => {
@@ -8431,15 +8420,12 @@ function useTableData(options) {
8431
8420
  }
8432
8421
  }
8433
8422
  watch([
8434
- () => getValue(options.schema),
8435
- () => getValue(options.columns),
8436
- () => options.data.value
8423
+ options.schema || toRef({}),
8424
+ options.columns || toRef([]),
8425
+ options.data
8437
8426
  ], () => {
8438
- resolveSchemaAsync();
8427
+ resolveSchema();
8439
8428
  }, { immediate: true });
8440
- onMounted(() => {
8441
- resolveSchemaAsync();
8442
- });
8443
8429
  const computedSchema = computed(() => resolvedSchema.value);
8444
8430
  function transform(rowData) {
8445
8431
  const transformed = { ...rowData };
@@ -8480,8 +8466,8 @@ function useTableData(options) {
8480
8466
  if (!Array.isArray(currentData) || currentData.length === 0) {
8481
8467
  return [];
8482
8468
  }
8483
- const useServerSortValue = getValue(options.useServerSort);
8484
- if (!sortField.value || useServerSortValue === true) {
8469
+ const useServerSortValue = computed(() => toValue(options.useServerSort));
8470
+ if (!sortField.value || useServerSortValue.value === true) {
8485
8471
  return currentData.map(transform);
8486
8472
  }
8487
8473
  return currentData.map(transform).sort((a2, z2) => {
@@ -8526,7 +8512,7 @@ function useTableData(options) {
8526
8512
  schemaState: computed(() => schemaState.value)
8527
8513
  };
8528
8514
  }
8529
- const _hoisted_1$R = { class: "data-preview" };
8515
+ const _hoisted_1$Q = { class: "data-preview" };
8530
8516
  const _hoisted_2$D = {
8531
8517
  key: 1,
8532
8518
  class: "empty-preview"
@@ -8534,13 +8520,13 @@ const _hoisted_2$D = {
8534
8520
  const _sfc_main$$ = /* @__PURE__ */ defineComponent({
8535
8521
  __name: "DataPreview",
8536
8522
  props: {
8537
- schema: { type: Function },
8523
+ modelValue: {},
8524
+ includeUnset: { type: Boolean },
8525
+ schema: {},
8538
8526
  columns: {},
8539
- useServerSort: { type: Boolean },
8527
+ useServerSort: {},
8540
8528
  selectable: { type: Boolean },
8541
- onLastItemVisible: { type: Function },
8542
- modelValue: {},
8543
- includeUnset: { type: Boolean }
8529
+ onLastItemVisible: { type: Function }
8544
8530
  },
8545
8531
  setup(__props) {
8546
8532
  const props2 = __props;
@@ -8573,7 +8559,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
8573
8559
  onUpdateModelValue: void 0
8574
8560
  });
8575
8561
  return (_ctx, _cache) => {
8576
- return openBlock(), createElementBlock("div", _hoisted_1$R, [
8562
+ return openBlock(), createElementBlock("div", _hoisted_1$Q, [
8577
8563
  unref(computedSchema) && unref(computedSchema).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(computedSchema), (field) => {
8578
8564
  return openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(field, unref(slots))), {
8579
8565
  key: field.id
@@ -8583,7 +8569,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
8583
8569
  };
8584
8570
  }
8585
8571
  });
8586
- const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-430b1998"]]);
8572
+ const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-d084907a"]]);
8587
8573
  function useTableSelection(options) {
8588
8574
  const allSelectorEl = ref();
8589
8575
  const computedSelectedItems = computed(() => options.selectedItems.value);
@@ -9500,12 +9486,7 @@ function useTableVirtualization(options) {
9500
9486
  await until(() => lastItemEl.value).toBeTruthy();
9501
9487
  useIntersectionObserver(lastItemEl, ([entry]) => {
9502
9488
  var _a;
9503
- let dataLength = 0;
9504
- if (isRef(options.data) && options.data.value) {
9505
- dataLength = Array.isArray(options.data.value) ? options.data.value.length : 0;
9506
- } else if (Array.isArray(options.data)) {
9507
- dataLength = options.data.length;
9508
- }
9489
+ const dataLength = toValue(options.data).length || 0;
9509
9490
  if (entry.isIntersecting && dataLength > 0) {
9510
9491
  (_a = options.onLastItemVisible) == null ? void 0 : _a.call(options);
9511
9492
  }
@@ -9520,30 +9501,26 @@ function useTableVirtualization(options) {
9520
9501
  registerLastItemObserver
9521
9502
  };
9522
9503
  }
9523
- const _hoisted_1$Q = {
9504
+ const _hoisted_1$P = {
9524
9505
  key: 0,
9525
9506
  class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
9526
9507
  };
9527
- const _hoisted_2$C = {
9528
- key: 1,
9529
- class: "flex-center h-300px txt-red"
9530
- };
9531
- const _hoisted_3$x = { class: "infinite-wrapper" };
9532
- const _hoisted_4$l = { class: "row first-row" };
9533
- const _hoisted_5$l = { key: 0 };
9534
- const _hoisted_6$i = ["onClick"];
9535
- const _hoisted_7$d = { class: "flex" };
9536
- const _hoisted_8$8 = ["onClick"];
9537
- const _hoisted_9$5 = { key: 0 };
9538
- const _hoisted_10$5 = ["value"];
9539
- const _hoisted_11$5 = { key: 1 };
9508
+ const _hoisted_2$C = { class: "infinite-wrapper" };
9509
+ const _hoisted_3$x = { class: "row first-row" };
9510
+ const _hoisted_4$l = { key: 0 };
9511
+ const _hoisted_5$l = ["onClick"];
9512
+ const _hoisted_6$h = { class: "flex" };
9513
+ const _hoisted_7$d = ["onClick"];
9514
+ const _hoisted_8$8 = { key: 0 };
9515
+ const _hoisted_9$5 = ["value"];
9516
+ const _hoisted_10$5 = { key: 1 };
9540
9517
  const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9541
9518
  __name: "DataTable",
9542
9519
  props: /* @__PURE__ */ mergeModels({
9543
9520
  data: {},
9544
- schema: { type: Function },
9521
+ schema: {},
9545
9522
  columns: {},
9546
- useServerSort: { type: Boolean },
9523
+ useServerSort: {},
9547
9524
  selectable: { type: Boolean },
9548
9525
  onLastItemVisible: { type: Function }
9549
9526
  }, {
@@ -9557,7 +9534,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9557
9534
  emits: /* @__PURE__ */ mergeModels(["orderBy", "select", "lastItemVisible"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
9558
9535
  setup(__props, { emit: __emit }) {
9559
9536
  useCssVars((_ctx) => ({
9560
- "18d61d81": unref(computedItemHeight)
9537
+ "6f015429": unref(computedItemHeight)
9561
9538
  }));
9562
9539
  const props2 = __props;
9563
9540
  const emit2 = __emit;
@@ -9575,8 +9552,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9575
9552
  sortField,
9576
9553
  sortDirection,
9577
9554
  toggleSort,
9578
- cleanTransformedData,
9579
- schemaState
9555
+ cleanTransformedData
9580
9556
  } = useTableData({
9581
9557
  data: data2,
9582
9558
  schema,
@@ -9653,20 +9629,20 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9653
9629
  scrollTo(0);
9654
9630
  }
9655
9631
  );
9656
- const showLoading = computed(() => loading.value || schemaState.value === "loading");
9632
+ const showLoading = computed(() => loading.value);
9657
9633
  return (_ctx, _cache) => {
9658
9634
  return openBlock(), createElementBlock("div", mergeProps({ class: "table-list-wrap h-100" }, unref(containerProps), {
9659
9635
  class: { "loading-table": showLoading.value }
9660
9636
  }), [
9661
- showLoading.value ? (openBlock(), createElementBlock("div", _hoisted_1$Q, _cache[4] || (_cache[4] = [
9637
+ showLoading.value ? (openBlock(), createElementBlock("div", _hoisted_1$P, _cache[4] || (_cache[4] = [
9662
9638
  createElementVNode("div", { class: "loading-table-animation fixed oval top-7" }, null, -1)
9663
- ]))) : unref(schemaState) === "error" ? (openBlock(), createElementBlock("div", _hoisted_2$C, " Error loading table schema ")) : createCommentVNode("", true),
9639
+ ]))) : createCommentVNode("", true),
9664
9640
  createElementVNode("div", mergeProps(unref(wrapperProps), {
9665
9641
  class: { "pointer-events-none": showLoading.value }
9666
9642
  }), [
9667
- createElementVNode("table", _hoisted_3$x, [
9668
- createElementVNode("thead", _hoisted_4$l, [
9669
- unref(isSelectable) ? (openBlock(), createElementBlock("th", _hoisted_5$l, [
9643
+ createElementVNode("table", _hoisted_2$C, [
9644
+ createElementVNode("thead", _hoisted_3$x, [
9645
+ unref(isSelectable) ? (openBlock(), createElementBlock("th", _hoisted_4$l, [
9670
9646
  createElementVNode("input", {
9671
9647
  ref_key: "allSelectorEl",
9672
9648
  ref: allSelectorEl,
@@ -9682,7 +9658,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9682
9658
  class: "col",
9683
9659
  onClick: ($event) => unref(toggleSort)((field == null ? void 0 : field.id) || "")
9684
9660
  }, [
9685
- createElementVNode("div", _hoisted_7$d, [
9661
+ createElementVNode("div", _hoisted_6$h, [
9686
9662
  createTextVNode(toDisplayString(field.label || unref(keyToLabel)(field == null ? void 0 : field.id)) + " ", 1),
9687
9663
  createElementVNode("div", {
9688
9664
  class: normalizeClass(["list-arrows", { sorted: unref(sortField) === (field == null ? void 0 : field.id) }])
@@ -9693,7 +9669,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9693
9669
  }, null, 8, ["class"])
9694
9670
  ], 2)
9695
9671
  ])
9696
- ], 8, _hoisted_6$i);
9672
+ ], 8, _hoisted_5$l);
9697
9673
  }), 128))
9698
9674
  ]),
9699
9675
  createElementVNode("tbody", null, [
@@ -9703,7 +9679,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9703
9679
  class: normalizeClass(["row row-item position-relative", { selected: (row == null ? void 0 : row.id) && unref(computedSelectedItems).includes(row.id) }]),
9704
9680
  onClick: ($event) => unref(toggleSelectItem)(row)
9705
9681
  }, [
9706
- unref(isSelectable) ? (openBlock(), createElementBlock("td", _hoisted_9$5, [
9682
+ unref(isSelectable) ? (openBlock(), createElementBlock("td", _hoisted_8$8, [
9707
9683
  createElementVNode("div", {
9708
9684
  onClick: _cache[3] || (_cache[3] = withModifiers(() => {
9709
9685
  }, ["stop"]))
@@ -9712,26 +9688,27 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9712
9688
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedItems.value = $event),
9713
9689
  type: "checkbox",
9714
9690
  value: (row == null ? void 0 : row.id) || ""
9715
- }, null, 8, _hoisted_10$5), [
9691
+ }, null, 8, _hoisted_9$5), [
9716
9692
  [vModelCheckbox, selectedItems.value]
9717
9693
  ])
9718
9694
  ])
9719
9695
  ])) : createCommentVNode("", true),
9720
9696
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(computedSchema), (field) => {
9697
+ var _a;
9721
9698
  return openBlock(), createElementBlock("td", {
9722
9699
  key: `${field.id}-${(row == null ? void 0 : row.id) || Math.random()}`,
9723
9700
  class: "col"
9724
9701
  }, [
9725
- field.id && unref(slots)[field.id] ? renderSlot(_ctx.$slots, field.id, {
9702
+ field.id && ((_a = unref(slots)) == null ? void 0 : _a[field.id]) ? renderSlot(_ctx.$slots, field.id, {
9726
9703
  key: 0,
9727
9704
  row,
9728
9705
  field
9729
- }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_11$5, [
9706
+ }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_10$5, [
9730
9707
  (openBlock(), createBlock(resolveDynamicComponent(renderFieldForRow(field, row))))
9731
9708
  ]))
9732
9709
  ]);
9733
9710
  }), 128))
9734
- ], 10, _hoisted_8$8);
9711
+ ], 10, _hoisted_7$d);
9735
9712
  }), 128)),
9736
9713
  props2.onLastItemVisible !== void 0 ? (openBlock(), createElementBlock("tr", {
9737
9714
  key: 0,
@@ -9746,7 +9723,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
9746
9723
  };
9747
9724
  }
9748
9725
  });
9749
- const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-382d1c94"]]);
9726
+ const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-b10460ed"]]);
9750
9727
  function useDraggable(options = {}) {
9751
9728
  const isDragging = ref(false);
9752
9729
  const dragElement = ref(null);
@@ -12935,7 +12912,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
12935
12912
  };
12936
12913
  }
12937
12914
  });
12938
- const _hoisted_1$P = { class: "px-1 pt-025 pb-1" };
12915
+ const _hoisted_1$O = { class: "px-1 pt-025 pb-1" };
12939
12916
  const _hoisted_2$B = { class: "ms-1" };
12940
12917
  const _sfc_main$X = /* @__PURE__ */ defineComponent({
12941
12918
  __name: "FieldSetVue",
@@ -12945,7 +12922,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
12945
12922
  },
12946
12923
  setup(__props) {
12947
12924
  return (_ctx, _cache) => {
12948
- return openBlock(), createElementBlock("fieldset", _hoisted_1$P, [
12925
+ return openBlock(), createElementBlock("fieldset", _hoisted_1$O, [
12949
12926
  createElementVNode("legend", _hoisted_2$B, toDisplayString(_ctx.legend || _ctx.label), 1),
12950
12927
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
12951
12928
  ]);
@@ -13394,17 +13371,19 @@ function getFallbackSchema(data2, columns) {
13394
13371
  function sleep(ms = 100) {
13395
13372
  return new Promise((resolve) => setTimeout(resolve, ms));
13396
13373
  }
13397
- function appendScript(src, options) {
13398
- return new Promise((resolve, reject3) => {
13399
- if (options == null ? void 0 : options.id) {
13400
- if (document.getElementById(options.id)) {
13401
- resolve();
13402
- return;
13403
- }
13404
- } else if (document.querySelector(`script[src="${src}"]`)) {
13405
- resolve();
13406
- return;
13407
- }
13374
+ const scriptsLoading = /* @__PURE__ */ new Map();
13375
+ async function appendScript(src, options) {
13376
+ const scriptId = (options == null ? void 0 : options.id) || src;
13377
+ await sleep(1);
13378
+ if (scriptsLoading.has(scriptId)) {
13379
+ return scriptsLoading.get(scriptId);
13380
+ }
13381
+ if ((options == null ? void 0 : options.id) && document.getElementById(options.id)) {
13382
+ return Promise.resolve();
13383
+ } else if (document.querySelector(`script[src="${src}"]`)) {
13384
+ return Promise.resolve();
13385
+ }
13386
+ const loadingPromise = new Promise((resolve, reject3) => {
13408
13387
  const script2 = document.createElement("script");
13409
13388
  script2.src = src;
13410
13389
  if (options == null ? void 0 : options.id) {
@@ -13412,10 +13391,16 @@ function appendScript(src, options) {
13412
13391
  }
13413
13392
  script2.onload = () => {
13414
13393
  resolve();
13394
+ scriptsLoading.delete(scriptId);
13395
+ };
13396
+ script2.onerror = (err) => {
13397
+ reject3(err);
13398
+ scriptsLoading.delete(scriptId);
13415
13399
  };
13416
- script2.onerror = reject3;
13417
13400
  document.head.append(script2);
13418
13401
  });
13402
+ scriptsLoading.set(scriptId, loadingPromise);
13403
+ return loadingPromise;
13419
13404
  }
13420
13405
  function appendStyle(src) {
13421
13406
  return new Promise((resolve, reject3) => {
@@ -13464,7 +13449,6 @@ function getNestedValue(obj, path, defaultValue = void 0) {
13464
13449
  }
13465
13450
  return current ?? defaultValue;
13466
13451
  }
13467
- const _hoisted_1$O = { class: "flex-center h-300px" };
13468
13452
  const _sfc_main$V = /* @__PURE__ */ defineComponent({
13469
13453
  __name: "BagelForm",
13470
13454
  props: {
@@ -13483,10 +13467,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13483
13467
  const formData = ref(clone2(props2.modelValue ?? {}));
13484
13468
  const initialFormData = ref(clone2(props2.modelValue ?? {}));
13485
13469
  const formState = ref("idle");
13486
- const schemaState = ref("loaded");
13487
- const resolvedSchemaData = ref();
13488
- const schemaRef = toRef(props2, "schema");
13489
- const resolvedSchema = computed(() => resolvedSchemaData.value);
13470
+ const resolvedSchema = computed(() => toValue(props2.schema));
13490
13471
  const isDirty = computed(() => {
13491
13472
  try {
13492
13473
  return JSON.stringify(formData.value) !== JSON.stringify(initialFormData.value);
@@ -13496,42 +13477,12 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13496
13477
  });
13497
13478
  onMounted(() => {
13498
13479
  if (props2.modelValue) initialFormData.value = clone2(props2.modelValue);
13499
- refreshSchema();
13500
13480
  });
13501
13481
  watch(() => props2.modelValue, (val) => {
13502
13482
  if (val !== void 0) formData.value = clone2(val);
13503
13483
  }, { immediate: true, deep: true });
13504
- async function resolveSchema(schema) {
13505
- if (!schema) {
13506
- resolvedSchemaData.value = void 0;
13507
- schemaState.value = "loaded";
13508
- return;
13509
- }
13510
- try {
13511
- schemaState.value = "loading";
13512
- const isPromise = (obj) => obj && typeof obj.then === "function";
13513
- let result2;
13514
- if (typeof schema === "function") {
13515
- result2 = schema();
13516
- result2 = isPromise(result2) ? await result2 : result2;
13517
- } else {
13518
- result2 = isPromise(schema) ? await schema : schema;
13519
- }
13520
- resolvedSchemaData.value = result2;
13521
- schemaState.value = "loaded";
13522
- } catch (error) {
13523
- console.error("Schema error:", error);
13524
- schemaState.value = "error";
13525
- resolvedSchemaData.value = void 0;
13526
- }
13527
- }
13528
- async function refreshSchema() {
13529
- await resolveSchema(props2.schema);
13530
- return resolvedSchemaData.value;
13531
- }
13532
- watch(schemaRef, resolveSchema, { immediate: true, deep: true });
13533
- function updateFormData(fieldId, value) {
13534
- const keys4 = fieldId.split(".");
13484
+ function updateFormData({ fieldId, value }) {
13485
+ const keys4 = (fieldId == null ? void 0 : fieldId.split(".")) || [];
13535
13486
  const newData = clone2(formData.value);
13536
13487
  let current = newData;
13537
13488
  for (let i2 = 0; i2 < keys4.length - 1; i2++) {
@@ -13547,6 +13498,10 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13547
13498
  var _a;
13548
13499
  return ((_a = form.value) == null ? void 0 : _a.reportValidity()) ?? false;
13549
13500
  };
13501
+ const checkValidity = () => {
13502
+ var _a;
13503
+ return ((_a = form.value) == null ? void 0 : _a.checkValidity()) ?? false;
13504
+ };
13550
13505
  const formError = ref();
13551
13506
  async function handleSubmit() {
13552
13507
  var _a;
@@ -13574,7 +13529,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13574
13529
  onUpdateModelValue: (field, value) => {
13575
13530
  var _a;
13576
13531
  if (!field.id) return;
13577
- updateFormData(field.id, value);
13532
+ updateFormData({ fieldId: field.id, value });
13578
13533
  (_a = field.onUpdate) == null ? void 0 : _a.call(field, value, formData.value);
13579
13534
  }
13580
13535
  });
@@ -13583,10 +13538,10 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13583
13538
  const input = event.target;
13584
13539
  if (input.name) {
13585
13540
  const value = input.type === "checkbox" ? input.checked : input.value;
13586
- updateFormData(input.name, value);
13541
+ updateFormData({ fieldId: input.name, value });
13587
13542
  }
13588
13543
  }
13589
- __expose({ form, isDirty, validateForm, resolveSchema, refreshSchema });
13544
+ __expose({ form, isDirty, validateForm, checkValidity });
13590
13545
  return (_ctx, _cache) => {
13591
13546
  return openBlock(), createElementBlock(Fragment, null, [
13592
13547
  formState.value !== "success" || !_ctx.$slots.success ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -13598,30 +13553,19 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13598
13553
  onSubmit: withModifiers(handleSubmit, ["prevent"]),
13599
13554
  onInput: handleSlotInputChange
13600
13555
  }, [
13601
- schemaState.value === "loading" ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
13602
- createElementVNode("div", _hoisted_1$O, [
13603
- createVNode(unref(Loading))
13604
- ])
13605
- ]) : schemaState.value === "error" ? renderSlot(_ctx.$slots, "schema-error", { key: 1 }, () => [
13606
- _cache[0] || (_cache[0] = createElementVNode("div", { class: "flex-center h-300px txt-red" }, " Error loading form ", -1))
13607
- ]) : resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(resolvedSchema.value, (field) => {
13556
+ resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(resolvedSchema.value, (field) => {
13608
13557
  return openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), {
13609
13558
  key: field.id
13610
13559
  });
13611
- }), 128)) : renderSlot(_ctx.$slots, "default", { key: 3 }),
13560
+ }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
13612
13561
  renderSlot(_ctx.$slots, "submit", {
13613
13562
  submit: handleSubmit,
13614
13563
  isDirty: isDirty.value,
13615
13564
  validateForm,
13616
- formState: formState.value,
13617
- schemaState: schemaState.value
13565
+ formState: formState.value
13618
13566
  })
13619
13567
  ], 34)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
13620
- schemaState.value === "loading" ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
13621
- createVNode(unref(Loading))
13622
- ]) : schemaState.value === "error" ? renderSlot(_ctx.$slots, "schema-error", { key: 1 }, () => [
13623
- _cache[1] || (_cache[1] = createElementVNode("div", { class: "flex-center h-300px txt-red" }, " Error loading form ", -1))
13624
- ]) : resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(resolvedSchema.value, (field) => {
13568
+ resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(resolvedSchema.value, (field) => {
13625
13569
  return openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), {
13626
13570
  key: field.id,
13627
13571
  class: normalizeClass(props2.class)
@@ -13649,7 +13593,7 @@ const _hoisted_5$k = {
13649
13593
  key: 0,
13650
13594
  class: "bgl-step-label"
13651
13595
  };
13652
- const _hoisted_6$h = { class: "bgl-form-wrapper" };
13596
+ const _hoisted_6$g = { class: "bgl-form-wrapper" };
13653
13597
  const _hoisted_7$c = { class: "bgl-step-controls" };
13654
13598
  const _sfc_main$U = /* @__PURE__ */ defineComponent({
13655
13599
  __name: "BglMultiStepForm",
@@ -13671,6 +13615,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13671
13615
  }),
13672
13616
  emits: /* @__PURE__ */ mergeModels(["submit", "stepChange"], ["update:modelValue"]),
13673
13617
  setup(__props, { expose: __expose, emit: __emit }) {
13618
+ var _a;
13674
13619
  const props2 = __props;
13675
13620
  const emits = __emit;
13676
13621
  const formRef = ref();
@@ -13687,11 +13632,11 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13687
13632
  return isValid;
13688
13633
  }
13689
13634
  const computedSchema = computed(
13690
- () => useBglSchema({ schema: props2.schema })
13635
+ () => useBglSchema({ schema: toValue(props2.schema) })
13691
13636
  );
13692
13637
  const filteredSchema = computed(() => {
13693
13638
  const schema = computedSchema.value;
13694
- return schema.filter((step, index2) => {
13639
+ return schema.filter((step, _index) => {
13695
13640
  if (step.vIf !== void 0 || step["v-if"] !== void 0) {
13696
13641
  const condition = step.vIf ?? step["v-if"];
13697
13642
  if (typeof condition === "function") {
@@ -13732,8 +13677,6 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13732
13677
  const actualIndex = schemaIndexMap.value[currentStep.value];
13733
13678
  return [computedSchema.value[actualIndex]];
13734
13679
  });
13735
- const isStepping = ref(false);
13736
- let isSteppingTO;
13737
13680
  const slideDirection = ref(props2.rtl ? "right" : "left");
13738
13681
  watch(
13739
13682
  () => currentStep.value,
@@ -13744,9 +13687,6 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13744
13687
  slideDirection.value = props2.direction;
13745
13688
  }
13746
13689
  previousStep.value = oldStep;
13747
- clearTimeout(isSteppingTO);
13748
- isStepping.value = true;
13749
- isSteppingTO = setTimeout(() => isStepping.value = false, 200);
13750
13690
  emits("stepChange", {
13751
13691
  newStep,
13752
13692
  oldStep,
@@ -13755,15 +13695,24 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13755
13695
  });
13756
13696
  }
13757
13697
  );
13758
- const canDoNext = computed(() => currentStep.value < numberOfSteps.value - 1);
13698
+ const isLastStep = computed(() => currentStep.value === numberOfSteps.value - 1);
13759
13699
  const isStepValidated = computed(() => (stepIndex) => validatedSteps.value.includes(stepIndex));
13700
+ const isStepValid = ref(false);
13701
+ async function checkCurrentStepValidity() {
13702
+ var _a2;
13703
+ await nextTick();
13704
+ if (!props2.validateOnSteps) isStepValid.value = true;
13705
+ else isStepValid.value = ((_a2 = formRef.value) == null ? void 0 : _a2.checkValidity()) ?? false;
13706
+ }
13760
13707
  function prevStep() {
13761
13708
  if (currentStep.value > 0) currentStep.value--;
13762
13709
  }
13763
13710
  const formContainer = ref();
13764
- function nextStep() {
13711
+ async function nextStep() {
13765
13712
  if (props2.validateOnSteps && reportValidity() === false) return;
13766
- if (canDoNext.value) currentStep.value++;
13713
+ if (!isLastStep.value) currentStep.value++;
13714
+ await sleep(400);
13715
+ checkCurrentStepValidity();
13767
13716
  }
13768
13717
  function goToStep(stepIndex) {
13769
13718
  if (stepIndex < currentStep.value || validatedSteps.value.includes(stepIndex)) {
@@ -13788,6 +13737,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13788
13737
  currentStep.value = 0;
13789
13738
  }
13790
13739
  watch(() => formData.value, () => {
13740
+ checkCurrentStepValidity();
13791
13741
  if (currentStep.value >= numberOfSteps.value && numberOfSteps.value > 0) {
13792
13742
  currentStep.value = 0;
13793
13743
  }
@@ -13795,14 +13745,16 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13795
13745
  __expose({
13796
13746
  submit: handleSubmit,
13797
13747
  validateForm: reportValidity,
13748
+ checkValidity: (_a = formRef.value) == null ? void 0 : _a.checkValidity,
13798
13749
  isDirty: computed(() => {
13799
- var _a;
13800
- return (_a = formRef.value) == null ? void 0 : _a.isDirty;
13750
+ var _a2;
13751
+ return (_a2 = formRef.value) == null ? void 0 : _a2.isDirty;
13801
13752
  }),
13802
13753
  reset,
13803
13754
  goToStep,
13804
13755
  currentStep: computed(() => currentStep.value),
13805
13756
  totalSteps: computed(() => numberOfSteps.value),
13757
+ isStepValid,
13806
13758
  nextStep,
13807
13759
  prevStep
13808
13760
  });
@@ -13835,13 +13787,13 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13835
13787
  ])
13836
13788
  ], true)
13837
13789
  ])) : createCommentVNode("", true),
13838
- createElementVNode("div", _hoisted_6$h, [
13790
+ createElementVNode("div", _hoisted_6$g, [
13839
13791
  createVNode(Transition, {
13840
13792
  name: slideDirection.value === "right" ? "slide-right" : "slide-left",
13841
13793
  mode: "out-in"
13842
13794
  }, {
13843
13795
  default: withCtx(() => [
13844
- !isStepping.value ? (openBlock(), createElementBlock("div", {
13796
+ (openBlock(), createElementBlock("div", {
13845
13797
  key: currentStep.value,
13846
13798
  ref_key: "formContainer",
13847
13799
  ref: formContainer,
@@ -13869,7 +13821,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13869
13821
  key: "1"
13870
13822
  } : void 0
13871
13823
  ]), 1040, ["modelValue", "schema"])
13872
- ])) : createCommentVNode("", true)
13824
+ ]))
13873
13825
  ]),
13874
13826
  _: 3
13875
13827
  }, 8, ["name"]),
@@ -13880,19 +13832,21 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13880
13832
  submit: handleSubmit,
13881
13833
  currentStep: currentStep.value,
13882
13834
  totalSteps: numberOfSteps.value,
13883
- canDoNext: canDoNext.value
13835
+ isLastStep: isLastStep.value,
13836
+ isStepValid: isStepValid.value
13884
13837
  })), () => [
13885
13838
  currentStep.value !== 0 ? (openBlock(), createBlock(unref(Btn), {
13886
13839
  key: 0,
13887
13840
  color: "gray",
13888
13841
  icon: "arrow_back",
13889
- click: "prevStep"
13842
+ onClick: prevStep
13890
13843
  })) : createCommentVNode("", true),
13891
- canDoNext.value ? (openBlock(), createBlock(unref(Btn), {
13844
+ !isLastStep.value ? (openBlock(), createBlock(unref(Btn), {
13892
13845
  key: 1,
13893
13846
  icon: "arrow_forward",
13847
+ disabled: props2.validateOnSteps && !isStepValid.value,
13894
13848
  onClick: nextStep
13895
- })) : (openBlock(), createBlock(unref(Btn), {
13849
+ }, null, 8, ["disabled"])) : (openBlock(), createBlock(unref(Btn), {
13896
13850
  key: 2,
13897
13851
  value: "Submit",
13898
13852
  onClick: handleSubmit
@@ -13904,7 +13858,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
13904
13858
  };
13905
13859
  }
13906
13860
  });
13907
- const BglMultiStepForm = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-53bb3be3"]]);
13861
+ const BglMultiStepForm = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-8f701fbc"]]);
13908
13862
  const _hoisted_1$M = {
13909
13863
  key: 0,
13910
13864
  class: "label mb-05"
@@ -13922,7 +13876,7 @@ const _hoisted_5$j = {
13922
13876
  key: 0,
13923
13877
  class: "minimizedText txt14 p-025 opacity-7"
13924
13878
  };
13925
- const _hoisted_6$g = { class: "bg-gray-80 -my-05 px-025 pt-065 pb-05 txt-center space-between flex column" };
13879
+ const _hoisted_6$f = { class: "bg-gray-80 -my-05 px-025 pt-065 pb-05 txt-center space-between flex column" };
13926
13880
  const _sfc_main$T = /* @__PURE__ */ defineComponent({
13927
13881
  __name: "FieldArray",
13928
13882
  props: {
@@ -13952,10 +13906,6 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
13952
13906
  const minimizedItems = ref([]);
13953
13907
  const internalData = ref(props2.modelValue || []);
13954
13908
  const schemaState = ref("loaded");
13955
- const resolvedSchemaData = ref([]);
13956
- watch(() => props2.modelValue, (newValue) => {
13957
- internalData.value = newValue || [];
13958
- }, { deep: true });
13959
13909
  const primitiveSchema = computed(() => {
13960
13910
  if (props2.type === "text") {
13961
13911
  return [{ id: "value", type: "text", label: "", $el: "text" }];
@@ -13964,36 +13914,13 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
13964
13914
  }
13965
13915
  return [];
13966
13916
  });
13967
- async function resolveSchema() {
13968
- if (props2.type !== "object") {
13969
- resolvedSchemaData.value = primitiveSchema.value;
13970
- schemaState.value = "loaded";
13971
- return;
13972
- }
13973
- if (!props2.schema) {
13974
- resolvedSchemaData.value = [];
13975
- schemaState.value = "loaded";
13976
- return;
13977
- }
13978
- try {
13979
- schemaState.value = "loading";
13980
- const isPromise = (obj) => obj && typeof obj.then === "function";
13981
- let result2;
13982
- if (typeof props2.schema === "function") {
13983
- result2 = props2.schema();
13984
- result2 = isPromise(result2) ? await result2 : result2;
13985
- } else {
13986
- result2 = isPromise(props2.schema) ? await props2.schema : props2.schema;
13987
- }
13988
- resolvedSchemaData.value = result2;
13989
- schemaState.value = "loaded";
13990
- } catch (error) {
13991
- console.error("Schema error:", error);
13992
- schemaState.value = "error";
13993
- resolvedSchemaData.value = [];
13994
- }
13995
- }
13996
- onMounted(resolveSchema);
13917
+ const resolvedSchemaData = computed(() => {
13918
+ if (props2.type !== "object") return primitiveSchema.value;
13919
+ return toValue(props2.schema);
13920
+ });
13921
+ watch(() => props2.modelValue, (newValue) => {
13922
+ internalData.value = newValue || [];
13923
+ }, { deep: true });
13997
13924
  function emitValue() {
13998
13925
  emit2("update:modelValue", internalData.value);
13999
13926
  }
@@ -14023,10 +13950,14 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
14023
13950
  }
14024
13951
  const isPrimitiveType = computed(() => props2.type === "text" || props2.type === "number");
14025
13952
  const canRenderItems = computed(
14026
- () => isPrimitiveType.value || props2.type === "object" && resolvedSchemaData.value.length > 0
13953
+ () => {
13954
+ var _a;
13955
+ return isPrimitiveType.value || props2.type === "object" && Number((_a = resolvedSchemaData.value) == null ? void 0 : _a.length) > 0;
13956
+ }
14027
13957
  );
14028
13958
  const showMinimizeButton = computed(() => {
14029
- return resolvedSchemaData.value.length > 2 || resolvedSchemaData.value.some((schema) => schema.$el === "richtext");
13959
+ var _a, _b;
13960
+ return Number((_a = resolvedSchemaData.value) == null ? void 0 : _a.length) > 2 || ((_b = resolvedSchemaData.value) == null ? void 0 : _b.some((schema) => schema.$el === "richtext"));
14030
13961
  });
14031
13962
  return (_ctx, _cache) => {
14032
13963
  return openBlock(), createElementBlock("div", {
@@ -14053,10 +13984,10 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
14053
13984
  minimizedItems.value[i2] ? (openBlock(), createElementBlock("p", _hoisted_5$j, toDisplayString(_ctx.label) + " " + toDisplayString(i2 + 1), 1)) : (openBlock(), createBlock(unref(_sfc_main$V), {
14054
13985
  key: 1,
14055
13986
  "model-value": isPrimitiveType.value ? { value: item } : item,
14056
- schema: resolvedSchemaData.value,
13987
+ schema: unref(resolvedSchemaData),
14057
13988
  "onUpdate:modelValue": (val) => updateItem(i2, val)
14058
13989
  }, null, 8, ["model-value", "schema", "onUpdate:modelValue"])),
14059
- createElementVNode("div", _hoisted_6$g, [
13990
+ createElementVNode("div", _hoisted_6$f, [
14060
13991
  showMinimizeButton.value ? (openBlock(), createBlock(unref(Btn), {
14061
13992
  key: 0,
14062
13993
  class: "block rotate-180 txt10 opacity-7 p-025",
@@ -14170,55 +14101,54 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
14170
14101
  }
14171
14102
  });
14172
14103
  const CheckInput = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-722373de"]]);
14173
- const _hoisted_1$J = { class: "mb-05" };
14174
- const _hoisted_2$x = {
14104
+ const _hoisted_1$J = {
14175
14105
  key: 0,
14176
- class: "label txt-start"
14106
+ class: "label"
14177
14107
  };
14108
+ const _hoisted_2$x = { class: "editor-content-papa relative" };
14178
14109
  const _hoisted_3$t = {
14179
- key: 1,
14180
- class: "code-editor-wrap grid rounded p-1 overflow hm-300px ltr txt-start relative h-100p"
14110
+ class: "code-display",
14111
+ wrap: ""
14181
14112
  };
14182
- const _hoisted_4$i = { class: "overflow-hidden absolute inset-0 p-0 m-0 h-100 codeText" };
14183
- const _hoisted_5$i = ["innerHTML"];
14184
- const _hoisted_6$f = ["onKeydown"];
14113
+ const _hoisted_4$i = ["innerHTML"];
14114
+ const _hoisted_5$i = ["value"];
14185
14115
  const _sfc_main$Q = /* @__PURE__ */ defineComponent({
14186
14116
  __name: "Index",
14187
14117
  props: {
14188
- language: {},
14118
+ language: { default: "html" },
14189
14119
  readonly: { type: Boolean, default: false },
14190
14120
  modelValue: { default: "" },
14191
- autodetect: { type: Boolean },
14121
+ autodetect: { type: Boolean, default: true },
14192
14122
  ignoreIllegals: { type: Boolean, default: true },
14193
- label: {},
14194
- height: { default: "300px" }
14123
+ label: { default: "" },
14124
+ height: { default: "240px" }
14195
14125
  },
14196
14126
  emits: ["update:modelValue"],
14197
14127
  setup(__props, { emit: __emit }) {
14128
+ const props2 = __props;
14198
14129
  const emit2 = __emit;
14199
- let hljs = ref(null);
14200
- let elHeight = ref(__props.height);
14201
- let code = ref("");
14202
- const textarea = ref();
14203
- let loaded = ref(false);
14204
- const cannotDetectLanguage = computed(() => {
14205
- var _a;
14206
- const lang = __props.language || "";
14207
- return !(__props.autodetect ?? !lang) && !((_a = hljs.value) == null ? void 0 : _a.getLanguage(lang));
14208
- });
14209
- const className = computed(() => {
14210
- if (cannotDetectLanguage.value) return "";
14211
- return `hljs ${__props.language || ""}`;
14212
- });
14213
- const highlightedCode = computed(() => {
14214
- var _a, _b;
14215
- if (cannotDetectLanguage.value) {
14216
- console.warn(`The language "${__props.language}" you specified could not be found.`);
14130
+ const code = ref(props2.modelValue || "");
14131
+ const editorRef = ref();
14132
+ const loaded = ref(false);
14133
+ const hljs = ref(null);
14134
+ const maxHeight = computed(() => {
14135
+ const h2 = props2.height ?? "240px";
14136
+ return h2.match(/^\d+$/) ? `${h2}px` : h2;
14137
+ });
14138
+ const formattedCode = computed(() => {
14139
+ if (!hljs.value) return escapeHtml(code.value);
14140
+ try {
14141
+ const lang = props2.language || "";
14142
+ if (lang && !props2.autodetect && !hljs.value.getLanguage(lang)) {
14143
+ console.warn(`The language "${lang}" is not available.`);
14144
+ return escapeHtml(code.value);
14145
+ }
14146
+ const result2 = props2.autodetect ? hljs.value.highlightAuto(code.value) : hljs.value.highlight(code.value, { language: lang, ignoreIllegals: props2.ignoreIllegals });
14147
+ return result2.value || escapeHtml(code.value);
14148
+ } catch (error) {
14149
+ console.error("Highlighting error:", error);
14217
14150
  return escapeHtml(code.value);
14218
14151
  }
14219
- const lang = __props.language || "";
14220
- const result2 = __props.autodetect ? (_a = hljs.value) == null ? void 0 : _a.highlightAuto(code.value) : (_b = hljs.value) == null ? void 0 : _b.highlight(code.value, { language: lang, ignoreIllegals: __props.ignoreIllegals });
14221
- return (result2 == null ? void 0 : result2.value) || "";
14222
14152
  });
14223
14153
  function escapeHtml(unsafe) {
14224
14154
  return unsafe.replace(/[&<>"']/g, (m2) => {
@@ -14232,75 +14162,77 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
14232
14162
  return replacements[m2] || "";
14233
14163
  });
14234
14164
  }
14165
+ function handleInput(e) {
14166
+ const target = e.target;
14167
+ code.value = target.value;
14168
+ emit2("update:modelValue", code.value);
14169
+ }
14235
14170
  function handleTab(event) {
14171
+ if (event.key !== "Tab") return;
14172
+ event.preventDefault();
14236
14173
  const target = event.target;
14237
14174
  const start = target.selectionStart;
14238
- const tab = " ";
14239
- code.value = code.value.slice(0, start) + tab + code.value.slice(start);
14240
- nextTick(() => {
14241
- target.selectionStart = target.selectionEnd = start + tab.length;
14242
- });
14243
- }
14244
- function adjustHeight() {
14245
- var _a;
14246
- if (((_a = textarea.value) == null ? void 0 : _a.scrollHeight) && textarea.value.scrollHeight > Number.parseInt(elHeight.value)) {
14247
- elHeight.value = `${textarea.value.scrollHeight}px`;
14248
- }
14175
+ const end = target.selectionEnd;
14176
+ const newValue = `${code.value.substring(0, start)} ${code.value.substring(end)}`;
14177
+ code.value = newValue;
14178
+ emit2("update:modelValue", code.value);
14179
+ setTimeout(() => {
14180
+ target.selectionStart = target.selectionEnd = start + 2;
14181
+ }, 0);
14249
14182
  }
14250
14183
  onMounted(async () => {
14251
- await appendScript("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.0/highlight.min.js", { id: "hljs-cdn" });
14252
- await appendStyle("https://cdn.jsdelivr.net/npm/highlight.js/styles/atom-one-dark.min.css");
14253
- if (window.hljs) {
14254
- hljs.value = window.hljs;
14255
- loaded.value = true;
14256
- } else {
14257
- console.error("Highlight.js failed to load.");
14184
+ try {
14185
+ await appendScript("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.0/highlight.min.js", { id: "hljs-cdn" });
14186
+ await appendStyle("https://cdn.jsdelivr.net/npm/highlight.js/styles/atom-one-dark.min.css");
14187
+ if (window.hljs) {
14188
+ hljs.value = window.hljs;
14189
+ loaded.value = true;
14190
+ } else {
14191
+ console.error("Failed to load highlight.js");
14192
+ }
14193
+ } catch (error) {
14194
+ console.error("Error loading highlight.js:", error);
14258
14195
  }
14259
14196
  });
14260
- watch(() => __props.modelValue, (newVal) => {
14261
- adjustHeight();
14262
- if (newVal !== code.value) {
14197
+ watch(() => props2.modelValue, (newVal) => {
14198
+ if (newVal !== void 0 && newVal !== code.value) {
14263
14199
  code.value = newVal;
14264
14200
  }
14265
14201
  }, { immediate: true });
14266
14202
  return (_ctx, _cache) => {
14267
- return openBlock(), createElementBlock("div", _hoisted_1$J, [
14268
- _ctx.label ? (openBlock(), createElementBlock("label", _hoisted_2$x, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
14269
- unref(loaded) ? (openBlock(), createElementBlock("div", _hoisted_3$t, [
14270
- createElementVNode("div", {
14271
- class: "relative block h-100",
14272
- style: normalizeStyle({ height: `calc(${unref(elHeight)} - 2rem)` })
14273
- }, [
14274
- createElementVNode("pre", _hoisted_4$i, [
14275
- _cache[2] || (_cache[2] = createTextVNode(" ")),
14276
- createElementVNode("code", {
14277
- class: normalizeClass(["absolute inset-0", className.value]),
14278
- innerHTML: highlightedCode.value
14279
- }, null, 10, _hoisted_5$i),
14280
- _cache[3] || (_cache[3] = createTextVNode("\n "))
14203
+ return openBlock(), createElementBlock("div", {
14204
+ class: "code-editor-container ltr",
14205
+ style: normalizeStyle({ maxHeight: maxHeight.value })
14206
+ }, [
14207
+ _ctx.label ? (openBlock(), createElementBlock("label", _hoisted_1$J, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
14208
+ loaded.value ? (openBlock(), createElementBlock("div", {
14209
+ key: 1,
14210
+ ref_key: "editorRef",
14211
+ ref: editorRef,
14212
+ class: "code-editor-grandpa"
14213
+ }, [
14214
+ createElementVNode("div", _hoisted_2$x, [
14215
+ createElementVNode("pre", _hoisted_3$t, [
14216
+ createElementVNode("code", { innerHTML: formattedCode.value }, null, 8, _hoisted_4$i)
14281
14217
  ]),
14282
- !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("textarea", {
14218
+ !_ctx.readonly ? (openBlock(), createElementBlock("textarea", {
14283
14219
  key: 0,
14284
- ref_key: "textarea",
14285
- ref: textarea,
14286
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(code) ? code.value = $event : code = $event),
14287
- class: "code-editor absolute inset-0 bg-transparent overflow-hidden h-100 p-0 m-0 codeText border-none txt-start",
14220
+ value: code.value,
14221
+ class: "code-input",
14288
14222
  spellcheck: "false",
14289
- placeholder: "Write your code here",
14290
- "aria-label": "Code Editor",
14291
- "data-gramm": "false",
14292
- onKeydown: withKeys(withModifiers(handleTab, ["prevent"]), ["tab"]),
14293
- onInput: _cache[1] || (_cache[1] = ($event) => emit2("update:modelValue", unref(code)))
14294
- }, null, 40, _hoisted_6$f)), [
14295
- [vModelText, unref(code)]
14296
- ]) : createCommentVNode("", true)
14297
- ], 4)
14298
- ])) : createCommentVNode("", true)
14299
- ]);
14223
+ autocomplete: "off",
14224
+ autocorrect: "off",
14225
+ autocapitalize: "off",
14226
+ onInput: handleInput,
14227
+ onKeydown: handleTab
14228
+ }, null, 40, _hoisted_5$i)) : createCommentVNode("", true)
14229
+ ])
14230
+ ], 512)) : createCommentVNode("", true)
14231
+ ], 4);
14300
14232
  };
14301
14233
  }
14302
14234
  });
14303
- const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-13335b34"]]);
14235
+ const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-6ab9613f"]]);
14304
14236
  const _hoisted_1$I = ["title"];
14305
14237
  const _hoisted_2$w = { class: "flex bg-input rounded px-025 colorInputPickWrap" };
14306
14238
  const _hoisted_3$s = ["id", "placeholder", "required"];
@@ -18795,6 +18727,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18795
18727
  const editor = useEditor();
18796
18728
  const isInitializing = ref(false);
18797
18729
  const hasInitialized = ref(false);
18730
+ editor.state.content = props2.modelValue;
18798
18731
  if (props2.debug) {
18799
18732
  editor.initDebugger();
18800
18733
  }
@@ -18842,6 +18775,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18842
18775
  doc.designMode = "on";
18843
18776
  doc.body.contentEditable = "true";
18844
18777
  doc.body.dir = hasRTL.value ? "rtl" : "ltr";
18778
+ editor.state.content = doc.body.innerHTML;
18845
18779
  editor.init(doc);
18846
18780
  useEditorKeyboard(doc, commands);
18847
18781
  if (!doc.body.firstElementChild) {
@@ -18849,6 +18783,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18849
18783
  p2.dir = doc.body.dir;
18850
18784
  p2.innerHTML = "<br>";
18851
18785
  doc.body.appendChild(p2);
18786
+ editor.state.content = doc.body.innerHTML;
18852
18787
  } else {
18853
18788
  const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT);
18854
18789
  const textNodes = [];
@@ -18869,6 +18804,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18869
18804
  doc.body.removeChild(textNode);
18870
18805
  }
18871
18806
  });
18807
+ editor.state.content = doc.body.innerHTML;
18872
18808
  }
18873
18809
  doc.body.focus();
18874
18810
  hasInitialized.value = true;
@@ -18889,7 +18825,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18889
18825
  });
18890
18826
  watch(() => editor.state.content, (newValue) => {
18891
18827
  var _a;
18892
- if ((_a = editor.state.doc) == null ? void 0 : _a.body.innerHTML) {
18828
+ if ((_a = editor.state.doc) == null ? void 0 : _a.body) {
18893
18829
  editor.state.doc.body.dir = hasRTL.value ? "rtl" : "ltr";
18894
18830
  }
18895
18831
  emit2("update:modelValue", newValue);
@@ -18930,8 +18866,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18930
18866
  _cache[1] || (_cache[1] = ($event) => unref(editor).updateState.content("html"))
18931
18867
  ],
18932
18868
  language: "html",
18933
- class: "code-editor"
18934
- }, null, 8, ["modelValue"])) : createCommentVNode("", true)
18869
+ height: unref(editor).state.isFullscreen ? "calc(100vh - 4rem)" : "250px"
18870
+ }, null, 8, ["modelValue", "height"])) : createCommentVNode("", true)
18935
18871
  ], 2),
18936
18872
  _ctx.debug ? (openBlock(), createElementBlock("div", _hoisted_3$h, [
18937
18873
  _cache[6] || (_cache[6] = createElementVNode("p", { class: "text12 txt-gray mb-0 p-0" }, " Debug ", -1)),
@@ -18977,7 +18913,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18977
18913
  };
18978
18914
  }
18979
18915
  });
18980
- const RichText = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-30bcda4c"]]);
18916
+ const RichText = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-d643f2ae"]]);
18981
18917
  const _hoisted_1$t = { key: 0 };
18982
18918
  const _hoisted_2$j = { class: "flex gap-05" };
18983
18919
  const _hoisted_3$g = ["disabled"];
@@ -32530,8 +32466,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32530
32466
  props: {
32531
32467
  icon: {},
32532
32468
  name: {},
32533
- size: {},
32469
+ size: { default: 1 },
32534
32470
  color: {},
32471
+ round: { type: Boolean },
32535
32472
  weight: {}
32536
32473
  },
32537
32474
  setup(__props) {
@@ -32546,9 +32483,15 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32546
32483
  return (_ctx, _cache) => {
32547
32484
  return iconRenderType.value === "material" ? (openBlock(), createElementBlock("span", {
32548
32485
  key: 0,
32549
- class: "bgl_icon-font",
32550
- style: normalizeStyle({ "fontSize": `${_ctx.size}rem`, color: _ctx.color, "font-variation-settings": `'wght' ${_ctx.weight || 400}` })
32551
- }, toDisplayString(iconRender.value), 5)) : iconRenderType.value === "font-awesome" ? (openBlock(), createElementBlock("span", {
32486
+ class: normalizeClass(["bgl_icon-font", { "round flex aspect-ratio-1 justify-content-center": _ctx.round }]),
32487
+ style: normalizeStyle({
32488
+ "fontSize": `${_ctx.size}rem`,
32489
+ color: _ctx.color,
32490
+ "font-variation-settings": `'wght' ${_ctx.weight || 400}`,
32491
+ "width": _ctx.round ? `calc(${_ctx.size}rem * 2)` : "auto",
32492
+ "height": _ctx.round ? `calc(${_ctx.size}rem * 2)` : "auto"
32493
+ })
32494
+ }, toDisplayString(iconRender.value), 7)) : iconRenderType.value === "font-awesome" ? (openBlock(), createElementBlock("span", {
32552
32495
  key: 1,
32553
32496
  class: normalizeClass(["fa far bgl_icon-font", [`fa-${iconRender.value}`, { "fa-brands": isFaBrand.value }]]),
32554
32497
  style: normalizeStyle({ "fontSize": `${_ctx.size}rem`, color: _ctx.color, "font-variation-settings": `'wght' ${_ctx.weight || 400}` })
@@ -33780,7 +33723,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
33780
33723
  };
33781
33724
  }
33782
33725
  });
33783
- const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-1c0f6894"]]);
33726
+ const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-c62c6888"]]);
33784
33727
  const _hoisted_1$8 = { class: "full-nav" };
33785
33728
  const _hoisted_2$6 = { class: "nav-scroll" };
33786
33729
  const _hoisted_3$5 = { class: "nav-links-wrapper" };
@@ -36197,14 +36140,12 @@ function useValidateFieldValue(inputVal, getInput, validateFn, getFormData) {
36197
36140
  );
36198
36141
  }
36199
36142
  function useBglSchema({ schema, columns, data: data2 } = {}) {
36200
- let _schema = schema;
36201
- if (typeof _schema === "function") {
36202
- _schema = _schema();
36203
- }
36204
- if (_schema) {
36205
- return columns && columns.length > 0 ? _schema.filter((f2) => columns.includes(f2.id)) : _schema;
36143
+ const _schema = computed(() => toValue(schema));
36144
+ const _columns = computed(() => toValue(columns));
36145
+ if (_schema.value) {
36146
+ return _columns.value && _columns.value.length > 0 ? _schema.value.filter((f2) => _columns.value.includes(f2.id)) : _schema.value;
36206
36147
  }
36207
- return getFallbackSchema(data2, columns);
36148
+ return getFallbackSchema(data2, _columns.value);
36208
36149
  }
36209
36150
  function localRef(key, initialValue) {
36210
36151
  const storedValue = localStorage.getItem(key);