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