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