@bagelink/vue 0.0.1298 → 0.0.1303

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 (36) hide show
  1. package/dist/components/AddressSearch.vue.d.ts +0 -3
  2. package/dist/components/AddressSearch.vue.d.ts.map +1 -1
  3. package/dist/components/DataPreview.vue.d.ts +2 -2
  4. package/dist/components/DataPreview.vue.d.ts.map +1 -1
  5. package/dist/components/DropDown.vue.d.ts +0 -1
  6. package/dist/components/DropDown.vue.d.ts.map +1 -1
  7. package/dist/components/form/inputs/ColorInput.vue.d.ts +21 -0
  8. package/dist/components/form/inputs/ColorInput.vue.d.ts.map +1 -0
  9. package/dist/components/form/inputs/SelectInput.vue.d.ts +0 -6
  10. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/SignaturePad.vue.d.ts +3 -0
  12. package/dist/components/form/inputs/SignaturePad.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/TelInput.vue.d.ts +1 -618
  14. package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
  15. package/dist/components/form/inputs/index.d.ts +1 -1
  16. package/dist/components/form/inputs/index.d.ts.map +1 -1
  17. package/dist/composables/useSchemaField.d.ts.map +1 -1
  18. package/dist/index.cjs +347 -224
  19. package/dist/index.mjs +348 -225
  20. package/dist/style.css +32 -32
  21. package/dist/utils/BagelFormUtils.d.ts +5 -0
  22. package/dist/utils/BagelFormUtils.d.ts.map +1 -1
  23. package/dist/utils/timeAgo.d.ts +1 -0
  24. package/dist/utils/timeAgo.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/components/DataPreview.vue +2 -2
  27. package/src/components/Dropdown.vue +20 -3
  28. package/src/components/Spreadsheet/Index.vue +2 -2
  29. package/src/components/form/FieldArray.vue +1 -1
  30. package/src/components/form/inputs/{ColorPicker.vue → ColorInput.vue} +1 -1
  31. package/src/components/form/inputs/SignaturePad.vue +52 -1
  32. package/src/components/form/inputs/TelInput.vue +198 -172
  33. package/src/components/form/inputs/index.ts +1 -1
  34. package/src/composables/useSchemaField.ts +6 -1
  35. package/src/utils/BagelFormUtils.ts +17 -3
  36. package/src/utils/timeAgo.ts +36 -0
package/dist/index.cjs CHANGED
@@ -868,7 +868,7 @@ const _hoisted_6$j = {
868
868
  key: 0,
869
869
  class: "align-items-center flex justify-content-center h-100p opacity-6"
870
870
  };
871
- const _hoisted_7$e = {
871
+ const _hoisted_7$f = {
872
872
  key: 1,
873
873
  class: "w-100p"
874
874
  };
@@ -898,7 +898,7 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
898
898
  vue.createElementVNode("div", _hoisted_4$r, vue.toDisplayString(__props.day.dateTimeString.substring(8, 10)), 1)
899
899
  ]),
900
900
  vue.createElementVNode("div", _hoisted_5$n, [
901
- __props.day.events.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$j, vue.toDisplayString(vue.unref(getLanguage)(vue.unref(languageKeys).noEvent, __props.time.CALENDAR_LOCALE)), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$e, [
901
+ __props.day.events.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$j, vue.toDisplayString(vue.unref(getLanguage)(vue.unref(languageKeys).noEvent, __props.time.CALENDAR_LOCALE)), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$f, [
902
902
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.day.events, (dayEvent) => {
903
903
  return vue.openBlock(), vue.createBlock(AgendaEventTile, {
904
904
  key: `agenda_event_${dayEvent.id}`,
@@ -1612,7 +1612,7 @@ const _hoisted_6$i = {
1612
1612
  key: 0,
1613
1613
  class: "event-flyout__row is-title"
1614
1614
  };
1615
- const _hoisted_7$d = {
1615
+ const _hoisted_7$e = {
1616
1616
  key: 1,
1617
1617
  class: "event-flyout__row is-time"
1618
1618
  };
@@ -1836,7 +1836,7 @@ const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
1836
1836
  }, null, 4),
1837
1837
  vue.createTextVNode(" " + vue.toDisplayString(calendarEvent.value.title), 1)
1838
1838
  ])) : vue.createCommentVNode("", true),
1839
- calendarEvent.value.time ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$d, vue.toDisplayString(getEventTime.value), 1)) : vue.createCommentVNode("", true),
1839
+ calendarEvent.value.time ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$e, vue.toDisplayString(getEventTime.value), 1)) : vue.createCommentVNode("", true),
1840
1840
  calendarEvent.value.location ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$9, [
1841
1841
  vue.createVNode(vue.unref(Icon), {
1842
1842
  icon: icons.location
@@ -2549,7 +2549,7 @@ const _hoisted_6$h = {
2549
2549
  key: 2,
2550
2550
  class: "calendar-week__event-row is-topic"
2551
2551
  };
2552
- const _hoisted_7$c = {
2552
+ const _hoisted_7$d = {
2553
2553
  key: 3,
2554
2554
  class: "calendar-week__event-row is-description"
2555
2555
  };
@@ -2925,7 +2925,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
2925
2925
  }, null, 8, ["icon"]),
2926
2926
  vue.createElementVNode("span", null, vue.toDisplayString(event.value.topic), 1)
2927
2927
  ])) : vue.createCommentVNode("", true),
2928
- event.value.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$c, [
2928
+ event.value.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$d, [
2929
2929
  vue.createVNode(vue.unref(Icon), {
2930
2930
  icon: icons.value.description,
2931
2931
  class: "calendar-week__event-icon"
@@ -9337,7 +9337,7 @@ const _hoisted_4$2$1 = {
9337
9337
  };
9338
9338
  const _hoisted_5$2$1 = ["x1", "y1", "x2", "y2"];
9339
9339
  const _hoisted_6$2$1 = ["x1", "y1", "x2", "y2"];
9340
- const _hoisted_7$b = ["x1", "y1", "x2", "y2"];
9340
+ const _hoisted_7$c = ["x1", "y1", "x2", "y2"];
9341
9341
  function render$5(_ctx, _cache, $props, $setup, $data, $options) {
9342
9342
  return _ctx.data.length ? (vue.openBlock(), vue.createElementBlock("g", {
9343
9343
  key: 0,
@@ -9393,7 +9393,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
9393
9393
  y1: _ctx.canvas.y,
9394
9394
  x2: _ctx.canvas.width - 1,
9395
9395
  y2: _ctx.canvas.height
9396
- }, null, 8, _hoisted_7$b)
9396
+ }, null, 8, _hoisted_7$c)
9397
9397
  ])
9398
9398
  ], 8, _hoisted_1$4$1)) : vue.createCommentVNode("v-if", true);
9399
9399
  }
@@ -10539,6 +10539,8 @@ function useSchemaField(optns) {
10539
10539
  textarea: TextInput,
10540
10540
  number: NumberInput,
10541
10541
  array: _sfc_main$R,
10542
+ color: _sfc_main$N,
10543
+ tel: TelInput,
10542
10544
  select: SelectInput,
10543
10545
  toggle: ToggleInput,
10544
10546
  check: CheckInput,
@@ -10764,18 +10766,19 @@ const _hoisted_1$N = { class: "data-preview" };
10764
10766
  const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
10765
10767
  __name: "DataPreview",
10766
10768
  props: {
10769
+ data: {},
10767
10770
  schema: { type: Function },
10768
10771
  showFields: {},
10769
10772
  useServerSort: { type: Boolean },
10770
10773
  selectable: { type: Boolean },
10771
10774
  onLastItemVisible: { type: Function },
10772
- data: {},
10775
+ modelValue: {},
10773
10776
  includeUnset: { type: Boolean }
10774
10777
  },
10775
10778
  setup(__props) {
10776
10779
  const props2 = __props;
10777
10780
  const slots = vue.useSlots();
10778
- const data2 = vue.computed(() => Array.isArray(props2.data) ? props2.data : [props2.data]);
10781
+ const data2 = vue.computed(() => Array.isArray(props2.modelValue) ? props2.modelValue : [props2.modelValue]);
10779
10782
  const {
10780
10783
  computedSchema,
10781
10784
  computedData
@@ -10802,7 +10805,7 @@ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
10802
10805
  };
10803
10806
  }
10804
10807
  });
10805
- const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-550fe546"]]);
10808
+ const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-32cd138c"]]);
10806
10809
  function useTableSelection(options) {
10807
10810
  const allSelectorEl = vue.ref();
10808
10811
  const computedSelectedItems = vue.computed(() => options.selectedItems.value);
@@ -11440,7 +11443,7 @@ const _hoisted_3$s = { class: "row first-row" };
11440
11443
  const _hoisted_4$i = { key: 0 };
11441
11444
  const _hoisted_5$h = ["onClick"];
11442
11445
  const _hoisted_6$e = { class: "flex" };
11443
- const _hoisted_7$a = ["onClick"];
11446
+ const _hoisted_7$b = ["onClick"];
11444
11447
  const _hoisted_8$7 = { key: 0 };
11445
11448
  const _hoisted_9$6 = ["value"];
11446
11449
  const _hoisted_10$6 = { key: 1 };
@@ -11635,7 +11638,7 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
11635
11638
  ]))
11636
11639
  ]);
11637
11640
  }), 128))
11638
- ], 10, _hoisted_7$a);
11641
+ ], 10, _hoisted_7$b);
11639
11642
  }), 128)),
11640
11643
  props2.onLastItemVisible !== void 0 ? (vue.openBlock(), vue.createElementBlock("tr", {
11641
11644
  key: 0,
@@ -14758,11 +14761,10 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
14758
14761
  border: { type: Boolean },
14759
14762
  outline: { type: Boolean },
14760
14763
  round: { type: Boolean },
14761
- placement: {},
14764
+ placement: { default: "bottom-start" },
14762
14765
  noAutoFocus: { type: Boolean },
14763
- positioningDisabled: { type: Boolean },
14764
- autoHide: { type: Boolean },
14765
- triggers: {}
14766
+ autoHide: { type: Boolean, default: true },
14767
+ triggers: { default: () => ["click"] }
14766
14768
  }, {
14767
14769
  "shown": {
14768
14770
  type: Boolean,
@@ -14818,8 +14820,10 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
14818
14820
  icon: _ctx.icon,
14819
14821
  value: _ctx.value,
14820
14822
  thin: _ctx.thin,
14821
- flat: _ctx.flat
14822
- }, null, 8, ["class", "iconEnd", "icon", "value", "thin", "flat"])
14823
+ flat: _ctx.flat,
14824
+ outline: _ctx.outline,
14825
+ round: _ctx.round
14826
+ }, null, 8, ["class", "iconEnd", "icon", "value", "thin", "flat", "outline", "round"])
14823
14827
  ])
14824
14828
  ]),
14825
14829
  _: 3
@@ -15014,11 +15018,22 @@ function bglForm(idOrField, ...schema) {
15014
15018
  }
15015
15019
  function telField(id, label, options) {
15016
15020
  return {
15017
- $el: vue.markRaw(TelInput),
15021
+ $el: "tel",
15018
15022
  id,
15019
15023
  label,
15020
15024
  vIf: options == null ? void 0 : options.vIf,
15021
- attrs: options
15025
+ attrs: options,
15026
+ class: options == null ? void 0 : options.class
15027
+ };
15028
+ }
15029
+ function colorField(id, label, options) {
15030
+ return {
15031
+ $el: "color",
15032
+ id,
15033
+ label,
15034
+ vIf: options == null ? void 0 : options.vIf,
15035
+ attrs: options,
15036
+ class: options == null ? void 0 : options.class
15022
15037
  };
15023
15038
  }
15024
15039
  function findBglFieldById(id, _schema) {
@@ -15046,6 +15061,7 @@ const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
15046
15061
  arrField,
15047
15062
  bglForm,
15048
15063
  checkField,
15064
+ colorField,
15049
15065
  dateField,
15050
15066
  findBglFieldById,
15051
15067
  frmRow: frmRow$1,
@@ -15392,7 +15408,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
15392
15408
  const _hoisted_1$K = { class: "label mb-05" };
15393
15409
  const _hoisted_2$x = {
15394
15410
  key: 0,
15395
- class: "ps-025 border-start"
15411
+ class: "ps-025 border-start mb-05"
15396
15412
  };
15397
15413
  const _hoisted_3$r = { class: "bg-gray-80 -my-05 px-025 pt-065 txt-center" };
15398
15414
  const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
@@ -15720,7 +15736,7 @@ const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data
15720
15736
  const _hoisted_1$G = ["title"];
15721
15737
  const _hoisted_2$u = ["id", "placeholder", "required"];
15722
15738
  const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
15723
- __name: "ColorPicker",
15739
+ __name: "ColorInput",
15724
15740
  props: {
15725
15741
  label: {},
15726
15742
  id: {},
@@ -15743,8 +15759,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
15743
15759
  }
15744
15760
  );
15745
15761
  return (_ctx, _cache) => {
15746
- return _ctx.id ? (vue.openBlock(), vue.createElementBlock("div", {
15747
- key: 0,
15762
+ return vue.openBlock(), vue.createElementBlock("div", {
15748
15763
  class: vue.normalizeClass(["bagel-input", { small: _ctx.small }]),
15749
15764
  title: _ctx.label
15750
15765
  }, [
@@ -15761,7 +15776,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
15761
15776
  [vue.vModelText, inputVal.value]
15762
15777
  ])
15763
15778
  ])
15764
- ], 10, _hoisted_1$G)) : vue.createCommentVNode("", true);
15779
+ ], 10, _hoisted_1$G);
15765
15780
  };
15766
15781
  }
15767
15782
  });
@@ -15774,7 +15789,7 @@ const _hoisted_3$o = {
15774
15789
  const _hoisted_4$g = { class: "calendar-section m_border-none pe-05 m_p-0" };
15775
15790
  const _hoisted_5$f = { class: "flex space-between pb-1" };
15776
15791
  const _hoisted_6$c = { class: "flex gap-05" };
15777
- const _hoisted_7$9 = { class: "month-year" };
15792
+ const _hoisted_7$a = { class: "month-year" };
15778
15793
  const _hoisted_8$6 = {
15779
15794
  key: 0,
15780
15795
  class: "calendar-grid grid gap-025"
@@ -15837,7 +15852,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
15837
15852
  };
15838
15853
  return dateObj.toLocaleString(props2.locale || void 0, options);
15839
15854
  };
15840
- const formatDate = (date2) => {
15855
+ const formatDate2 = (date2) => {
15841
15856
  if (!date2) return "";
15842
15857
  const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
15843
15858
  return props2.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split("T")[0];
@@ -15861,7 +15876,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
15861
15876
  };
15862
15877
  return {
15863
15878
  formatDisplayDate,
15864
- formatDate,
15879
+ formatDate: formatDate2,
15865
15880
  parseUserInput
15866
15881
  };
15867
15882
  }
@@ -15887,10 +15902,10 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
15887
15902
  };
15888
15903
  }
15889
15904
  function useDateState() {
15890
- const { formatDisplayDate, formatDate } = useFormatting();
15905
+ const { formatDisplayDate, formatDate: formatDate2 } = useFormatting();
15891
15906
  const formattedDisplayValue2 = vue.computed(() => formatDisplayDate(props2.modelValue));
15892
- const formattedMin2 = vue.computed(() => formatDate(props2.min));
15893
- const formattedMax2 = vue.computed(() => formatDate(props2.max));
15907
+ const formattedMin2 = vue.computed(() => formatDate2(props2.min));
15908
+ const formattedMax2 = vue.computed(() => formatDate2(props2.max));
15894
15909
  const selectedDate2 = vue.computed(() => {
15895
15910
  if (!props2.modelValue) return null;
15896
15911
  return typeof props2.modelValue === "string" ? new Date(props2.modelValue) : props2.modelValue;
@@ -16224,7 +16239,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
16224
16239
  icon: "chevron_left",
16225
16240
  onClick: vue.unref(previousYear)
16226
16241
  }, null, 8, ["onClick"]),
16227
- vue.createElementVNode("span", _hoisted_7$9, vue.toDisplayString(vue.unref(currentMonthValue).formatted.year), 1),
16242
+ vue.createElementVNode("span", _hoisted_7$a, vue.toDisplayString(vue.unref(currentMonthValue).formatted.year), 1),
16228
16243
  vue.createVNode(vue.unref(Btn), {
16229
16244
  flat: "",
16230
16245
  icon: "chevron_right",
@@ -16333,7 +16348,7 @@ const _hoisted_3$n = {
16333
16348
  const _hoisted_4$f = { class: "date-picker-container" };
16334
16349
  const _hoisted_5$e = ["value", "min", "max", "required", "disabled"];
16335
16350
  const _hoisted_6$b = { class: "flex gap-075 p-05 m_flex-wrap calendar-container justify-content-center h-100p" };
16336
- const _hoisted_7$8 = { class: "calendar-section m_border-none pe-05 m_p-0" };
16351
+ const _hoisted_7$9 = { class: "calendar-section m_border-none pe-05 m_p-0" };
16337
16352
  const _hoisted_8$5 = { class: "flex space-between pb-1" };
16338
16353
  const _hoisted_9$4 = { class: "flex gap-05" };
16339
16354
  const _hoisted_10$4 = { class: "month-year" };
@@ -16403,14 +16418,14 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
16403
16418
  timeZone: props2.timezone
16404
16419
  });
16405
16420
  }
16406
- function formatDate(date2) {
16421
+ function formatDate2(date2) {
16407
16422
  if (!date2) return "";
16408
16423
  const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
16409
16424
  return props2.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split("T")[0];
16410
16425
  }
16411
16426
  const formattedDisplayValue = vue.computed(() => formatDisplayDate(props2.modelValue));
16412
- const formattedMin = vue.computed(() => formatDate(props2.min));
16413
- const formattedMax = vue.computed(() => formatDate(props2.max));
16427
+ const formattedMin = vue.computed(() => formatDate2(props2.min));
16428
+ const formattedMax = vue.computed(() => formatDate2(props2.max));
16414
16429
  const selectedDate = vue.computed(() => {
16415
16430
  if (!props2.modelValue) return null;
16416
16431
  return typeof props2.modelValue === "string" ? new Date(props2.modelValue) : props2.modelValue;
@@ -16580,7 +16595,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
16580
16595
  ]),
16581
16596
  default: vue.withCtx(() => [
16582
16597
  vue.createElementVNode("div", _hoisted_6$b, [
16583
- vue.createElementVNode("div", _hoisted_7$8, [
16598
+ vue.createElementVNode("div", _hoisted_7$9, [
16584
16599
  vue.createElementVNode("div", _hoisted_8$5, [
16585
16600
  vue.unref(currentView) === "days" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
16586
16601
  vue.createVNode(vue.unref(Btn), {
@@ -16783,7 +16798,7 @@ const _hoisted_3$l = { class: "m-05 flex opacity-7 z-99" };
16783
16798
  const _hoisted_4$d = { class: "ellipsis-1 word-break-all h-20 m-0 color-black" };
16784
16799
  const _hoisted_5$d = { class: "flex gap-025 rounded pe-1 ps-05 py-025 bg-gray-80 -my-1" };
16785
16800
  const _hoisted_6$a = { class: "ellipsis-1 word-break-all h-20 m-0 color-black txt16" };
16786
- const _hoisted_7$7 = {
16801
+ const _hoisted_7$8 = {
16787
16802
  key: 1,
16788
16803
  class: "txt-gray txt-12"
16789
16804
  };
@@ -17066,7 +17081,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
17066
17081
  ])
17067
17082
  ]);
17068
17083
  }), 128)),
17069
- !storageFiles.value.length && !fileQueue.value.length ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$7, vue.toDisplayString(_ctx.noFilePlaceholder || "No file selected"), 1)) : vue.createCommentVNode("", true)
17084
+ !storageFiles.value.length && !fileQueue.value.length ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$8, vue.toDisplayString(_ctx.noFilePlaceholder || "No file selected"), 1)) : vue.createCommentVNode("", true)
17070
17085
  ]),
17071
17086
  _: 1
17072
17087
  })) : (vue.openBlock(), vue.createElementBlock("div", {
@@ -17665,7 +17680,7 @@ const _hoisted_6$9 = {
17665
17680
  key: 0,
17666
17681
  class: "m-0 m_txt-14"
17667
17682
  };
17668
- const _hoisted_7$6 = {
17683
+ const _hoisted_7$7 = {
17669
17684
  key: 1,
17670
17685
  class: "txt-gray txt-12 m-0"
17671
17686
  };
@@ -17740,7 +17755,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
17740
17755
  }, null, 8, _hoisted_4$b)) : vue.createCommentVNode("", true),
17741
17756
  vue.createElementVNode("div", _hoisted_5$b, [
17742
17757
  opt.label ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$9, vue.toDisplayString(opt.label), 1)) : vue.createCommentVNode("", true),
17743
- opt.subLabel ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_7$6, vue.toDisplayString(opt.subLabel), 1)) : vue.createCommentVNode("", true)
17758
+ opt.subLabel ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_7$7, vue.toDisplayString(opt.subLabel), 1)) : vue.createCommentVNode("", true)
17744
17759
  ]),
17745
17760
  vue.renderSlot(_ctx.$slots, "radioItem", vue.mergeProps({ ref_for: true }, opt), void 0, true)
17746
17761
  ]),
@@ -17841,7 +17856,7 @@ const _hoisted_3$g = { class: "range-slider relative w-100" };
17841
17856
  const _hoisted_4$9 = ["id", "value", "min", "max", "step", "required", "disabled", "aria-label"];
17842
17857
  const _hoisted_5$9 = ["value", "min", "max", "step", "required", "disabled"];
17843
17858
  const _hoisted_6$8 = { class: "track absolute pointer-events-none overflow-hidden round" };
17844
- const _hoisted_7$5 = { class: "txt-center txt-14 user-select-none range-slider-txt flex space-between opacity-4 mx-05" };
17859
+ const _hoisted_7$6 = { class: "txt-center txt-14 user-select-none range-slider-txt flex space-between opacity-4 mx-05" };
17845
17860
  const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
17846
17861
  __name: "RangeInput",
17847
17862
  props: {
@@ -17982,7 +17997,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
17982
17997
  ], true)
17983
17998
  ], 4)) : vue.createCommentVNode("", true)
17984
17999
  ]),
17985
- vue.createElementVNode("p", _hoisted_7$5, [
18000
+ vue.createElementVNode("p", _hoisted_7$6, [
17986
18001
  vue.renderSlot(_ctx.$slots, "min", {
17987
18002
  max: vue.unref(formatValue)(vue.unref(max2)),
17988
18003
  min: vue.unref(formatValue)(vue.unref(min2)),
@@ -19676,7 +19691,7 @@ const _hoisted_4$8 = {
19676
19691
  };
19677
19692
  const _hoisted_5$8 = ["value"];
19678
19693
  const _hoisted_6$7 = ["aria-selected", "onClick", "onKeydown"];
19679
- const _hoisted_7$4 = { class: "block" };
19694
+ const _hoisted_7$5 = { class: "block" };
19680
19695
  const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
19681
19696
  __name: "SelectInput",
19682
19697
  props: {
@@ -19969,7 +19984,7 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
19969
19984
  size: 1.1
19970
19985
  })) : vue.createCommentVNode("", true)
19971
19986
  ], 64)) : vue.createCommentVNode("", true),
19972
- vue.createElementVNode("span", _hoisted_7$4, vue.toDisplayString(getLabel(option2)), 1)
19987
+ vue.createElementVNode("span", _hoisted_7$5, vue.toDisplayString(getLabel(option2)), 1)
19973
19988
  ], 42, _hoisted_6$7);
19974
19989
  }), 128))
19975
19990
  ], 2),
@@ -20586,7 +20601,7 @@ const _hoisted_2$g = {
20586
20601
  placeholder: "required",
20587
20602
  type: "text",
20588
20603
  required: "",
20589
- class: "pixel"
20604
+ class: "pixel opacity-0"
20590
20605
  };
20591
20606
  const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
20592
20607
  __name: "SignaturePad",
@@ -20604,12 +20619,15 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
20604
20619
  required: { type: Boolean }
20605
20620
  }, {
20606
20621
  "modelValue": {},
20607
- "modelModifiers": {}
20622
+ "modelModifiers": {},
20623
+ "file": {},
20624
+ "fileModifiers": {}
20608
20625
  }),
20609
- emits: ["update:modelValue"],
20626
+ emits: ["update:modelValue", "update:file"],
20610
20627
  setup(__props, { expose: __expose }) {
20611
20628
  const props2 = __props;
20612
20629
  const sigData = vue.useModel(__props, "modelValue");
20630
+ const fileData = vue.useModel(__props, "file");
20613
20631
  const vCanvas = vue.ref();
20614
20632
  let sig = vue.ref();
20615
20633
  let _isEmpty = vue.ref(true);
@@ -20624,6 +20642,24 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
20624
20642
  format2 = format2 || props2.format;
20625
20643
  return format2 ? (_a = sig.value) == null ? void 0 : _a.toDataURL(format2) : (_b = sig.value) == null ? void 0 : _b.toDataURL();
20626
20644
  }
20645
+ function saveFile() {
20646
+ const data2 = save2();
20647
+ if (!data2) return;
20648
+ if (props2.format === "image/svg+xml") {
20649
+ fileData.value = new File([data2], "signature.svg", { type: "image/svg+xml" });
20650
+ } else {
20651
+ const base64Data = data2.split(",")[1];
20652
+ const byteCharacters = atob(base64Data);
20653
+ const byteNumbers = new Array(byteCharacters.length);
20654
+ for (let i2 = 0; i2 < byteCharacters.length; i2++) {
20655
+ byteNumbers[i2] = byteCharacters.charCodeAt(i2);
20656
+ }
20657
+ const byteArray = new Uint8Array(byteNumbers);
20658
+ const blob = new Blob([byteArray], { type: props2.format || "image/png" });
20659
+ const extension = (props2.format || "image/png").split("/")[1];
20660
+ fileData.value = new File([blob], `signature.${extension}`, { type: props2.format || "image/png" });
20661
+ }
20662
+ }
20627
20663
  const fromDataURL = (url) => {
20628
20664
  var _a;
20629
20665
  return (_a = sig.value) == null ? void 0 : _a.fromDataURL(url);
@@ -20685,7 +20721,26 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
20685
20721
  _isEmpty.value = ((_a = sig.value) == null ? void 0 : _a.isEmpty()) ?? false;
20686
20722
  const data2 = save2();
20687
20723
  sigData.value = data2;
20724
+ saveFile();
20725
+ }
20726
+ async function loadFile(file) {
20727
+ if (!file) return;
20728
+ const reader = new FileReader();
20729
+ return new Promise((resolve) => {
20730
+ reader.onload = (e) => {
20731
+ var _a;
20732
+ const dataUrl = (_a = e.target) == null ? void 0 : _a.result;
20733
+ fromDataURL(dataUrl);
20734
+ _isEmpty.value = false;
20735
+ sigData.value = dataUrl;
20736
+ resolve(true);
20737
+ };
20738
+ reader.readAsDataURL(file);
20739
+ });
20688
20740
  }
20741
+ vue.watch(fileData, (newFile) => {
20742
+ loadFile(newFile);
20743
+ });
20689
20744
  function draw() {
20690
20745
  const canvas = vCanvas.value;
20691
20746
  sig.value = new SignaturePad(canvas, signatureOptions.value);
@@ -20708,6 +20763,9 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
20708
20763
  else sig.value.on();
20709
20764
  _isEmpty.value = sig.value.isEmpty();
20710
20765
  sig.value.addEventListener("endStroke", onEndStroke);
20766
+ if (fileData.value) {
20767
+ loadFile(fileData.value);
20768
+ }
20711
20769
  }
20712
20770
  vue.onMounted(draw);
20713
20771
  vue.onUnmounted(() => {
@@ -27824,11 +27882,12 @@ function parsePhoneNumber() {
27824
27882
  return withMetadataArgument(parsePhoneNumber$1, arguments);
27825
27883
  }
27826
27884
  const _hoisted_1$o = ["aria-expanded"];
27827
- const _hoisted_2$e = { class: "p-075 tel-countryp-dropdown" };
27828
- const _hoisted_3$b = ["aria-selected", "onClick", "onMousemove"];
27829
- const _hoisted_4$6 = { class: "tel-country" };
27830
- const _hoisted_5$6 = { key: 1 };
27831
- const _hoisted_6$5 = ["id", "required", "placeholder", "disabled", "autocomplete", "pattern", "minlength", "maxlength", "name", "readonly", "tabindex", "aria-describedby"];
27885
+ const _hoisted_2$e = { class: "flex gap-05" };
27886
+ const _hoisted_3$b = { class: "p-075 tel-countryp-dropdown" };
27887
+ const _hoisted_4$6 = ["aria-selected", "onClick", "onMousemove"];
27888
+ const _hoisted_5$6 = { class: "tel-country" };
27889
+ const _hoisted_6$5 = { key: 1 };
27890
+ const _hoisted_7$4 = ["id", "required", "placeholder", "disabled", "autocomplete", "pattern", "minlength", "maxlength", "name", "readonly", "tabindex", "aria-describedby"];
27832
27891
  const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
27833
27892
  __name: "TelInput",
27834
27893
  props: /* @__PURE__ */ vue.mergeModels({
@@ -27852,8 +27911,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
27852
27911
  mode: { default: "INTERNATIONAL" },
27853
27912
  onlyCountries: { default: () => [] },
27854
27913
  preferredCountries: { default: () => [] },
27855
- parseArg: {},
27856
- debounceDelay: { default: 300 }
27914
+ parseArg: {}
27857
27915
  }, {
27858
27916
  "modelValue": {
27859
27917
  default: ""
@@ -27874,13 +27932,8 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
27874
27932
  setup(__props, { emit: __emit }) {
27875
27933
  const props2 = __props;
27876
27934
  const emit2 = __emit;
27877
- async function getIp() {
27878
- const apiData = sessionStorage.getItem("ipapi");
27879
- if (apiData) return JSON.parse(apiData);
27880
- const { data: data2 } = await axios$1.get("https://ipapi.co/json/");
27881
- sessionStorage.setItem("ipapi", JSON.stringify(data2));
27882
- return data2;
27883
- }
27935
+ const open = vue.ref(false);
27936
+ const dropdownOpenDirection = vue.ref("below");
27884
27937
  const defaultDropdownOptions = {
27885
27938
  hide: false,
27886
27939
  disabled: false,
@@ -27911,52 +27964,169 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
27911
27964
  ...defaultInputOptions,
27912
27965
  ...props2.inputOptions
27913
27966
  }));
27914
- let activeCountryCode = vue.ref();
27915
- let open = vue.ref(false);
27916
- let selectedIndex = vue.ref();
27917
- const dropdownOpenDirection = vue.ref("below");
27918
- const searchQuery = vue.ref("");
27919
- const activeCountry = vue.computed(
27920
- () => props2.allCountries.find(
27921
- (country) => {
27922
- var _a;
27923
- return country.iso2 === ((_a = activeCountryCode.value) == null ? void 0 : _a.toUpperCase());
27924
- }
27925
- )
27926
- );
27927
- const isPreferred = (country) => props2.preferredCountries.includes(country == null ? void 0 : country.iso2);
27928
- const filteredCountries = vue.computed(() => {
27929
- if (props2.onlyCountries.length > 0) {
27930
- return props2.allCountries.filter(
27931
- ({ iso2 }) => props2.onlyCountries.some((c2) => c2.toUpperCase() === iso2)
27967
+ function useCountrySelection(props22, emit22) {
27968
+ const activeCountryCode2 = vue.ref();
27969
+ const selectedIndex2 = vue.ref();
27970
+ const searchQuery2 = vue.ref("");
27971
+ const activeCountry = vue.computed(() => {
27972
+ var _a;
27973
+ return (_a = props22.allCountries) == null ? void 0 : _a.find(
27974
+ (country) => {
27975
+ var _a2;
27976
+ return country.iso2 === ((_a2 = activeCountryCode2.value) == null ? void 0 : _a2.toUpperCase());
27977
+ }
27932
27978
  );
27979
+ });
27980
+ const filteredCountries = vue.computed(() => {
27981
+ const countries = props22.allCountries || [];
27982
+ const onlyCountries = props22.onlyCountries || [];
27983
+ const excludeCountries = props22.excludeCountries || [];
27984
+ if (onlyCountries.length > 0) {
27985
+ return countries.filter(({ iso2 }) => onlyCountries.some((c2) => c2.toUpperCase() === iso2));
27986
+ }
27987
+ if (excludeCountries.length > 0) {
27988
+ return countries.filter(
27989
+ ({ iso2 }) => !excludeCountries.includes(iso2.toUpperCase()) && !excludeCountries.includes(iso2.toLowerCase())
27990
+ );
27991
+ }
27992
+ return countries;
27993
+ });
27994
+ const sortedCountries2 = vue.computed(() => {
27995
+ const preferredCountries = getCountries(props22.preferredCountries || []);
27996
+ const countriesList = [...preferredCountries, ...filteredCountries.value];
27997
+ const cleanInput = searchQuery2.value.replaceAll(
27998
+ /[~`!#$%&*()+={};:'"<>.,\\/@-]/g,
27999
+ ""
28000
+ ).toLowerCase();
28001
+ return countriesList.filter(
28002
+ (c2) => new RegExp(cleanInput, "i").test(c2.name || "") || new RegExp(cleanInput, "i").test(c2.iso2 || "") || new RegExp(cleanInput, "i").test(c2.dialCode || "")
28003
+ ).filter(Boolean);
28004
+ });
28005
+ const findCountry = (iso) => filteredCountries.value.find(
28006
+ (country) => country.iso2 === iso.toUpperCase()
28007
+ );
28008
+ const findCountryByDialCode = (dialCode) => filteredCountries.value.find((country) => Number(country.dialCode) === dialCode);
28009
+ function getCountries(list) {
28010
+ const countryList = [];
28011
+ list.forEach((countryCode) => {
28012
+ const country = findCountry(countryCode);
28013
+ if (country) countryList.push(country);
28014
+ });
28015
+ return countryList;
27933
28016
  }
27934
- if (props2.excludeCountries.length > 0) {
27935
- return props2.allCountries.filter(
27936
- ({ iso2 }) => !props2.excludeCountries.includes(iso2.toUpperCase()) && !props2.excludeCountries.includes(iso2.toLowerCase())
27937
- );
28017
+ async function initializeCountry2() {
28018
+ if (props22.defaultCountry) {
28019
+ if (typeof props22.defaultCountry === "string") {
28020
+ chooseCountry2(props22.defaultCountry);
28021
+ return;
28022
+ }
28023
+ if (typeof props22.defaultCountry === "number") {
28024
+ const country = findCountryByDialCode(props22.defaultCountry);
28025
+ if (country) {
28026
+ chooseCountry2(country.iso2);
28027
+ return;
28028
+ }
28029
+ }
28030
+ }
28031
+ const fallbackCountry = sortedCountries2.value[0];
28032
+ if (props22.autoDefaultCountry) {
28033
+ try {
28034
+ const res = (await getIp()).country;
28035
+ chooseCountry2(res || activeCountryCode2.value);
28036
+ } catch (error) {
28037
+ console.warn(error);
28038
+ chooseCountry2(fallbackCountry.iso2);
28039
+ }
28040
+ } else {
28041
+ chooseCountry2(fallbackCountry.iso2);
28042
+ }
27938
28043
  }
27939
- return props2.allCountries;
27940
- });
27941
- const sortedCountries = vue.computed(() => {
27942
- const preferredCountries = getCountries(props2.preferredCountries);
27943
- const countriesList = [...preferredCountries, ...filteredCountries.value];
27944
- const cleanInput = searchQuery.value.replaceAll(
27945
- // eslint-disable-next-line regexp/no-obscure-range
27946
- /[~`!#$%&*()+={};:'"<>.,/?-_]/g,
27947
- ""
28044
+ function chooseCountry2(country) {
28045
+ if (!country) return;
28046
+ const parsedCountry = findCountry(country);
28047
+ if (!parsedCountry) return;
28048
+ activeCountryCode2.value = parsedCountry.iso2;
28049
+ emit22("country-changed", parsedCountry);
28050
+ open.value = false;
28051
+ }
28052
+ vue.watch(
28053
+ () => activeCountry.value,
28054
+ (value, oldValue) => {
28055
+ if (!value && (oldValue == null ? void 0 : oldValue.iso2)) {
28056
+ activeCountryCode2.value = oldValue.iso2;
28057
+ return;
28058
+ }
28059
+ if (value == null ? void 0 : value.iso2) emit22("country-changed", value);
28060
+ }
27948
28061
  );
27949
- return countriesList.filter(
27950
- (c2) => new RegExp(cleanInput, "i").test(c2.name || "") || new RegExp(cleanInput, "i").test(c2.iso2 || "") || new RegExp(cleanInput, "i").test(c2.dialCode || "")
27951
- ).filter(Boolean);
27952
- });
27953
- const parseArgs = vue.computed(() => ({
27954
- ...props2.parseArg,
27955
- defaultCountry: activeCountryCode.value
27956
- }));
28062
+ return {
28063
+ activeCountryCode: activeCountryCode2,
28064
+ activeCountry,
28065
+ selectedIndex: selectedIndex2,
28066
+ searchQuery: searchQuery2,
28067
+ sortedCountries: sortedCountries2,
28068
+ chooseCountry: chooseCountry2,
28069
+ initializeCountry: initializeCountry2,
28070
+ findCountry,
28071
+ findCountryByDialCode
28072
+ };
28073
+ }
28074
+ function usePhoneNumberFormatting(props22, activeCountryCode2) {
28075
+ const parseArgs = vue.computed(() => ({
28076
+ ...props22.parseArg,
28077
+ defaultCountry: activeCountryCode2.value
28078
+ }));
28079
+ function formatPhone2(val) {
28080
+ var _a, _b, _c;
28081
+ let phoneNumber = parsePhoneNumber(val, parseArgs.value);
28082
+ if (!phoneNumber && val.startsWith("+")) {
28083
+ const currentCountry = (_a = props22.allCountries) == null ? void 0 : _a.find((c2) => c2.iso2 === activeCountryCode2.value);
28084
+ if (currentCountry) {
28085
+ const { dialCode } = currentCountry;
28086
+ const withoutDialCode = val.replace(new RegExp(`^\\+${dialCode}`), "");
28087
+ phoneNumber = parsePhoneNumber(withoutDialCode, parseArgs.value);
28088
+ }
28089
+ }
28090
+ if (!phoneNumber) {
28091
+ const dialCode = ((_c = (_b = props22.allCountries) == null ? void 0 : _b.find(
28092
+ (c2) => c2.iso2 === activeCountryCode2.value
28093
+ )) == null ? void 0 : _c.dialCode) || "";
28094
+ if (props22.mode === "INTERNATIONAL") return `+${dialCode}`;
28095
+ return dialCode;
28096
+ }
28097
+ const formattedNumber = phoneNumber.format(props22.mode || "INTERNATIONAL");
28098
+ if (props22.mode === "INTERNATIONAL") {
28099
+ const countryCode = phoneNumber.countryCallingCode;
28100
+ const { nationalNumber } = phoneNumber;
28101
+ return `+${countryCode}${nationalNumber}`;
28102
+ }
28103
+ return formattedNumber.replaceAll(" ", "") || "";
28104
+ }
28105
+ return {
28106
+ formatPhone: formatPhone2,
28107
+ parseArgs
28108
+ };
28109
+ }
27957
28110
  const debouncedEmit = useDebounceFn((maybeFormatted) => {
27958
28111
  emit2("debounce", maybeFormatted);
27959
- }, props2.debounceDelay);
28112
+ });
28113
+ const {
28114
+ activeCountryCode,
28115
+ selectedIndex,
28116
+ searchQuery,
28117
+ sortedCountries,
28118
+ chooseCountry,
28119
+ initializeCountry
28120
+ } = useCountrySelection(props2, emit2);
28121
+ const { formatPhone } = usePhoneNumberFormatting(props2, activeCountryCode);
28122
+ const isPreferred = (country) => props2.preferredCountries.includes(country == null ? void 0 : country.iso2) || false;
28123
+ function reset() {
28124
+ if (!sortedCountries.value || !activeCountryCode.value) return;
28125
+ selectedIndex.value = sortedCountries.value.findIndex(
28126
+ (c2) => c2.iso2 === activeCountryCode.value
28127
+ );
28128
+ open.value = false;
28129
+ }
27960
28130
  const phone = vue.useModel(__props, "modelValue", {
27961
28131
  set: (value) => {
27962
28132
  let maybeFormatted = value;
@@ -27973,99 +28143,18 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
27973
28143
  },
27974
28144
  get: (value) => value
27975
28145
  });
27976
- function formatPhone(val) {
27977
- var _a;
27978
- const phoneNumber = parsePhoneNumber(val, parseArgs.value);
27979
- if (!phoneNumber) {
27980
- const dialCode = ((_a = sortedCountries.value.find((c2) => c2.iso2 === activeCountryCode.value)) == null ? void 0 : _a.dialCode) || "";
27981
- if (props2.mode === "INTERNATIONAL") return `+${dialCode}`;
27982
- return dialCode;
27983
- }
27984
- return phoneNumber.format(props2.mode).replaceAll(" ", "") || "";
27985
- }
27986
- vue.watch(
27987
- () => activeCountry.value,
27988
- (value, oldValue) => {
27989
- if (!value && (oldValue == null ? void 0 : oldValue.iso2)) {
27990
- activeCountryCode.value = oldValue.iso2;
27991
- return;
27992
- }
27993
- if (value == null ? void 0 : value.iso2) emit2("country-changed", value);
27994
- }
27995
- );
27996
- async function initializeCountry() {
27997
- if (props2.defaultCountry) {
27998
- if (typeof props2.defaultCountry === "string") {
27999
- chooseCountry(props2.defaultCountry);
28000
- return;
28001
- }
28002
- if (typeof props2.defaultCountry === "number") {
28003
- const country = findCountryByDialCode(props2.defaultCountry);
28004
- if (country) {
28005
- chooseCountry(country.iso2);
28006
- return;
28007
- }
28008
- }
28009
- }
28010
- const fallbackCountry = sortedCountries.value[0];
28011
- if (props2.autoDefaultCountry) {
28012
- try {
28013
- const res = (await getIp()).country;
28014
- chooseCountry(res || activeCountryCode.value);
28015
- } catch (error) {
28016
- console.warn(error);
28017
- chooseCountry(fallbackCountry.iso2);
28018
- }
28019
- } else {
28020
- chooseCountry(fallbackCountry.iso2);
28021
- }
28022
- }
28023
- vue.onMounted(initializeCountry);
28024
- const findCountry = (iso) => filteredCountries.value.find((country) => country.iso2 === iso.toUpperCase());
28025
- function getCountries(list) {
28026
- const countryList = [];
28027
- list.forEach((countryCode) => {
28028
- const country = findCountry(countryCode);
28029
- if (country) countryList.push(country);
28030
- });
28031
- return countryList;
28032
- }
28033
- function findCountryByDialCode(dialCode) {
28034
- return filteredCountries.value.find((country) => Number(country.dialCode) === dialCode);
28035
- }
28036
- const phoneDropdown = vue.ref();
28037
- function chooseCountry(country) {
28038
- var _a, _b;
28039
- if (!country) return;
28040
- const parsedCountry = findCountry(country);
28041
- if (!parsedCountry) return;
28042
- activeCountryCode.value = parsedCountry.iso2;
28043
- if (((_a = props2.inputOptions) == null ? void 0 : _a.showDialCode) && parsedCountry) {
28044
- phone.value = `+ ${parsedCountry.dialCode}`;
28045
- activeCountryCode.value = parsedCountry.iso2 || "";
28046
- return;
28047
- }
28048
- activeCountryCode.value = parsedCountry.iso2 || "";
28049
- (_b = phoneDropdown.value) == null ? void 0 : _b.hide();
28050
- }
28051
28146
  function onBlur() {
28052
28147
  emit2("blur");
28053
28148
  }
28054
28149
  function onFocus() {
28055
28150
  emit2("focus");
28056
28151
  }
28057
- function onEnter(e) {
28152
+ function onEnter() {
28058
28153
  emit2("enter");
28059
28154
  }
28060
28155
  function onSpace() {
28061
28156
  emit2("space");
28062
28157
  }
28063
- function reset() {
28064
- selectedIndex.value = sortedCountries.value.findIndex(
28065
- (c2) => c2.iso2 === activeCountryCode.value
28066
- );
28067
- open.value = false;
28068
- }
28069
28158
  function handleInput(e) {
28070
28159
  const keyVal = e.key ?? "";
28071
28160
  if (keyVal.length > 1 || e.metaKey) return;
@@ -28073,6 +28162,14 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
28073
28162
  if (!hasBadChars) return;
28074
28163
  e.preventDefault();
28075
28164
  }
28165
+ async function getIp() {
28166
+ const apiData = sessionStorage.getItem("ipapi");
28167
+ if (apiData) return JSON.parse(apiData);
28168
+ const { data: data2 } = await axios$1.get("https://ipapi.co/json/");
28169
+ sessionStorage.setItem("ipapi", JSON.stringify(data2));
28170
+ return data2;
28171
+ }
28172
+ vue.onMounted(initializeCountry);
28076
28173
  return (_ctx, _cache) => {
28077
28174
  return vue.openBlock(), vue.createElementBlock("div", {
28078
28175
  class: vue.normalizeClass(["bagel-input", { disabled: _ctx.disabled, [props2.class || ""]: true }])
@@ -28085,89 +28182,83 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
28085
28182
  tabindex: "-1",
28086
28183
  "aria-label": "Country Code Selector",
28087
28184
  "aria-haspopup": "listbox",
28088
- "aria-expanded": vue.unref(open),
28185
+ "aria-expanded": open.value,
28089
28186
  onKeydown: [
28090
28187
  vue.withKeys(reset, ["esc"]),
28091
28188
  vue.withKeys(reset, ["tab"])
28092
28189
  ]
28093
28190
  }, [
28094
- !computedDropDownOptions.value.hide ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$V), {
28095
- key: 0,
28096
- ref_key: "phoneDropdown",
28097
- ref: phoneDropdown,
28191
+ vue.createVNode(vue.unref(_sfc_main$V), {
28192
+ shown: open.value,
28193
+ "onUpdate:shown": _cache[1] || (_cache[1] = ($event) => open.value = $event),
28098
28194
  placement: "bottom-start",
28099
- disabled: computedDropDownOptions.value.disabled,
28100
- onHide: _cache[2] || (_cache[2] = ($event) => vue.isRef(open) ? open.value = false : open = false)
28195
+ disabled: vue.unref(computedDropDownOptions).disabled
28101
28196
  }, {
28102
28197
  trigger: vue.withCtx(() => [
28103
- vue.createElementVNode("span", {
28104
- class: "flex gap-05",
28105
- onClick: _cache[0] || (_cache[0] = ($event) => vue.isRef(open) ? open.value = true : open = true)
28106
- }, [
28198
+ vue.createElementVNode("span", _hoisted_2$e, [
28107
28199
  vue.createVNode(vue.unref(Icon), {
28108
- icon: vue.unref(open) ? "collapse_all" : "expand_all"
28200
+ icon: open.value ? "collapse_all" : "expand_all"
28109
28201
  }, null, 8, ["icon"]),
28110
- computedDropDownOptions.value.showFlags && vue.unref(activeCountryCode) ? (vue.openBlock(), vue.createBlock(vue.unref(Flag), {
28202
+ vue.unref(computedDropDownOptions).showFlags && vue.unref(activeCountryCode) ? (vue.openBlock(), vue.createBlock(vue.unref(Flag), {
28111
28203
  key: 0,
28112
28204
  country: vue.unref(activeCountryCode)
28113
28205
  }, null, 8, ["country"])) : vue.createCommentVNode("", true)
28114
28206
  ])
28115
28207
  ]),
28116
28208
  default: vue.withCtx(() => [
28117
- vue.createElementVNode("div", _hoisted_2$e, [
28209
+ vue.createElementVNode("div", _hoisted_3$b, [
28118
28210
  _ctx.searchable ? (vue.openBlock(), vue.createBlock(vue.unref(TextInput), {
28119
28211
  key: 0,
28120
- modelValue: searchQuery.value,
28121
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
28212
+ modelValue: vue.unref(searchQuery),
28213
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
28122
28214
  "aria-label": "Search by country name or country code",
28123
28215
  placeholder: "Search",
28124
28216
  icon: "search"
28125
28217
  }, null, 8, ["modelValue"])) : vue.createCommentVNode("", true),
28126
28218
  vue.createElementVNode("ul", {
28127
- class: vue.normalizeClass(["overflow-y p-0", dropdownOpenDirection.value]),
28128
- style: { "max-height": "400px" },
28219
+ class: vue.normalizeClass(["overflow-y p-0 max-h-300px", dropdownOpenDirection.value]),
28129
28220
  role: "listbox"
28130
28221
  }, [
28131
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sortedCountries.value, (pb, index2) => {
28222
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(sortedCountries), (pb, index2) => {
28132
28223
  return vue.openBlock(), vue.createElementBlock("li", {
28133
28224
  key: pb.iso2 + isPreferred(pb),
28134
28225
  role: "option",
28135
28226
  class: "flex gap-075",
28136
28227
  tabindex: "-1",
28137
28228
  "aria-selected": vue.unref(activeCountryCode) === pb.iso2 && !isPreferred(pb),
28138
- onClick: ($event) => chooseCountry(pb.iso2),
28139
- onMousemove: ($event) => vue.isRef(selectedIndex) ? selectedIndex.value = index2 : selectedIndex = index2
28229
+ onClick: ($event) => vue.unref(chooseCountry)(pb.iso2),
28230
+ onMousemove: ($event) => selectedIndex.value = index2
28140
28231
  }, [
28141
- computedDropDownOptions.value.showFlags ? (vue.openBlock(), vue.createBlock(vue.unref(Flag), {
28232
+ vue.unref(computedDropDownOptions).showFlags ? (vue.openBlock(), vue.createBlock(vue.unref(Flag), {
28142
28233
  key: 0,
28143
28234
  country: pb.iso2
28144
28235
  }, null, 8, ["country"])) : vue.createCommentVNode("", true),
28145
- vue.createElementVNode("p", _hoisted_4$6, vue.toDisplayString(pb.name), 1),
28146
- computedDropDownOptions.value.showDialCodeInList ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$6, " +" + vue.toDisplayString(pb.dialCode), 1)) : vue.createCommentVNode("", true)
28147
- ], 40, _hoisted_3$b);
28236
+ vue.createElementVNode("p", _hoisted_5$6, vue.toDisplayString(pb.name), 1),
28237
+ vue.unref(computedDropDownOptions).showDialCodeInList ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$5, " +" + vue.toDisplayString(pb.dialCode), 1)) : vue.createCommentVNode("", true)
28238
+ ], 40, _hoisted_4$6);
28148
28239
  }), 128))
28149
28240
  ], 2)
28150
28241
  ])
28151
28242
  ]),
28152
28243
  _: 1
28153
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
28244
+ }, 8, ["shown", "disabled"]),
28154
28245
  vue.withDirectives(vue.createElementVNode("input", {
28155
28246
  id: _ctx.id,
28156
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => phone.value = $event),
28247
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => phone.value = $event),
28157
28248
  required: _ctx.required,
28158
28249
  placeholder: props2.placeholder || "Enter a phone number",
28159
28250
  disabled: _ctx.disabled,
28160
28251
  type: "tel",
28161
28252
  autocomplete: _ctx.autocomplete,
28162
28253
  class: "vti__input",
28163
- pattern: computedInputOptions.value.pattern,
28164
- minlength: computedInputOptions.value.minlength,
28165
- maxlength: computedInputOptions.value.maxlength,
28166
- name: computedInputOptions.value.name,
28167
- readonly: computedInputOptions.value.readonly,
28168
- tabindex: computedInputOptions.value.tabindex,
28169
- "aria-describedby": computedInputOptions.value["aria-describedby"],
28170
- style: vue.normalizeStyle(computedInputOptions.value.style),
28254
+ pattern: vue.unref(computedInputOptions).pattern,
28255
+ minlength: vue.unref(computedInputOptions).minlength,
28256
+ maxlength: vue.unref(computedInputOptions).maxlength,
28257
+ name: vue.unref(computedInputOptions).name,
28258
+ readonly: vue.unref(computedInputOptions).readonly,
28259
+ tabindex: vue.unref(computedInputOptions).tabindex,
28260
+ "aria-describedby": vue.unref(computedInputOptions)["aria-describedby"],
28261
+ style: vue.normalizeStyle(vue.unref(computedInputOptions).style),
28171
28262
  onBlur,
28172
28263
  onFocus,
28173
28264
  onKeyup: [
@@ -28175,7 +28266,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
28175
28266
  vue.withKeys(onSpace, ["space"])
28176
28267
  ],
28177
28268
  onKeydown: handleInput
28178
- }, null, 44, _hoisted_6$5), [
28269
+ }, null, 44, _hoisted_7$4), [
28179
28270
  [vue.vModelText, phone.value]
28180
28271
  ])
28181
28272
  ], 40, _hoisted_1$o)
@@ -28184,7 +28275,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
28184
28275
  };
28185
28276
  }
28186
28277
  });
28187
- const TelInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-492fcc54"]]);
28278
+ const TelInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-a77caf64"]]);
28188
28279
  const _hoisted_1$n = ["title"];
28189
28280
  const _hoisted_2$d = ["for"];
28190
28281
  const _hoisted_3$a = ["id", "title", "autocomplete", "type", "placeholder", "disabled", "required", "pattern"];
@@ -35388,7 +35479,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
35388
35479
  };
35389
35480
  }
35390
35481
  });
35391
- const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2976f0c9"]]);
35482
+ const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f204ab99"]]);
35392
35483
  const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
35393
35484
  __name: "Title",
35394
35485
  props: {
@@ -37226,6 +37317,37 @@ function timeAgo(date2, lang = "en") {
37226
37317
  }
37227
37318
  return selectedLang.justNow;
37228
37319
  }
37320
+ const formatMap = {
37321
+ dd: { type: "day", format: "2-digit" },
37322
+ ddd: { type: "weekday", format: "short" },
37323
+ dddd: { type: "weekday", format: "long" },
37324
+ mm: { type: "month", format: "2-digit" },
37325
+ mmm: { type: "month", format: "short" },
37326
+ mmmm: { type: "month", format: "long" },
37327
+ yy: { type: "year", format: "2-digit" },
37328
+ yyyy: { type: "year", format: "numeric" },
37329
+ HH: { type: "hour", format: "2-digit" },
37330
+ hh: { type: "hour", format: "2-digit" },
37331
+ MM: { type: "minute", format: "2-digit" },
37332
+ ss: { type: "second", format: "2-digit" },
37333
+ ampm: { type: "dayPeriod", format: "short" }
37334
+ };
37335
+ function formatDate(date2, format2 = "dd.mm.yy") {
37336
+ if (!date2) return "";
37337
+ try {
37338
+ const formatParts = format2.split(/[.\s:]/);
37339
+ const formatObject = {};
37340
+ for (const part of formatParts) {
37341
+ const formatInfo = formatMap[part];
37342
+ if (!formatInfo) continue;
37343
+ formatObject[formatInfo.type] = formatInfo.format;
37344
+ }
37345
+ const d2 = typeof date2 === "string" ? new Date(date2) : date2;
37346
+ return d2.toLocaleDateString("he-IL", formatObject);
37347
+ } catch (error) {
37348
+ return "";
37349
+ }
37350
+ }
37229
37351
  exports.Accordion = _sfc_main$1m;
37230
37352
  exports.AccordionItem = AccordionItem;
37231
37353
  exports.AddressSearch = _sfc_main$1k;
@@ -37244,7 +37366,7 @@ exports.Carousel = Carousel;
37244
37366
  exports.CheckInput = CheckInput;
37245
37367
  exports.Checkbox = Checkbox;
37246
37368
  exports.CodeEditor = CodeEditor;
37247
- exports.ColorPicker = _sfc_main$N;
37369
+ exports.ColorInput = _sfc_main$N;
37248
37370
  exports.DataPreview = DataPreview;
37249
37371
  exports.DataTable = DataTable;
37250
37372
  exports.DateInput = DateInput;
@@ -37315,6 +37437,7 @@ exports.classify = classify;
37315
37437
  exports.copyText = copyText;
37316
37438
  exports.debounce = debounce;
37317
37439
  exports.denullify = denullify;
37440
+ exports.formatDate = formatDate;
37318
37441
  exports.formatString = formatString;
37319
37442
  exports.getFallbackSchema = getFallbackSchema;
37320
37443
  exports.getNestedValue = getNestedValue;