@bagelink/vue 0.0.1300 → 1.0.1
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.
- package/dist/components/AddressSearch.vue.d.ts +0 -3
- package/dist/components/AddressSearch.vue.d.ts.map +1 -1
- package/dist/components/DataPreview.vue.d.ts +1 -1
- package/dist/components/DataPreview.vue.d.ts.map +1 -1
- package/dist/components/DropDown.vue.d.ts +0 -1
- package/dist/components/DropDown.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ColorInput.vue.d.ts +21 -0
- package/dist/components/form/inputs/ColorInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/SelectInput.vue.d.ts +0 -6
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TelInput.vue.d.ts +1 -618
- package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +1 -1
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/composables/useSchemaField.d.ts.map +1 -1
- package/dist/index.cjs +300 -221
- package/dist/index.mjs +301 -222
- package/dist/style.css +32 -32
- package/dist/utils/BagelFormUtils.d.ts +5 -0
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/timeAgo.d.ts +1 -0
- package/dist/utils/timeAgo.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/DataPreview.vue +2 -2
- package/src/components/Dropdown.vue +20 -3
- package/src/components/Spreadsheet/Index.vue +2 -2
- package/src/components/form/FieldArray.vue +1 -1
- package/src/components/form/inputs/{ColorPicker.vue → ColorInput.vue} +1 -1
- package/src/components/form/inputs/TelInput.vue +198 -172
- package/src/components/form/inputs/index.ts +1 -1
- package/src/composables/useSchemaField.ts +6 -1
- package/src/utils/BagelFormUtils.ts +17 -3
- 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,
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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,
|
|
@@ -10767,13 +10769,13 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
10767
10769
|
useServerSort: { type: Boolean },
|
|
10768
10770
|
selectable: { type: Boolean },
|
|
10769
10771
|
onLastItemVisible: { type: Function },
|
|
10770
|
-
|
|
10772
|
+
modelValue: {},
|
|
10771
10773
|
includeUnset: { type: Boolean }
|
|
10772
10774
|
},
|
|
10773
10775
|
setup(__props) {
|
|
10774
10776
|
const props2 = __props;
|
|
10775
10777
|
const slots = useSlots();
|
|
10776
|
-
const data2 = computed(() => Array.isArray(props2.
|
|
10778
|
+
const data2 = computed(() => Array.isArray(props2.modelValue) ? props2.modelValue : [props2.modelValue]);
|
|
10777
10779
|
const {
|
|
10778
10780
|
computedSchema,
|
|
10779
10781
|
computedData
|
|
@@ -10800,7 +10802,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
10800
10802
|
};
|
|
10801
10803
|
}
|
|
10802
10804
|
});
|
|
10803
|
-
const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-
|
|
10805
|
+
const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-74c7df87"]]);
|
|
10804
10806
|
function useTableSelection(options) {
|
|
10805
10807
|
const allSelectorEl = ref();
|
|
10806
10808
|
const computedSelectedItems = computed(() => options.selectedItems.value);
|
|
@@ -11438,7 +11440,7 @@ const _hoisted_3$s = { class: "row first-row" };
|
|
|
11438
11440
|
const _hoisted_4$i = { key: 0 };
|
|
11439
11441
|
const _hoisted_5$h = ["onClick"];
|
|
11440
11442
|
const _hoisted_6$e = { class: "flex" };
|
|
11441
|
-
const _hoisted_7$
|
|
11443
|
+
const _hoisted_7$b = ["onClick"];
|
|
11442
11444
|
const _hoisted_8$7 = { key: 0 };
|
|
11443
11445
|
const _hoisted_9$6 = ["value"];
|
|
11444
11446
|
const _hoisted_10$6 = { key: 1 };
|
|
@@ -11633,7 +11635,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
11633
11635
|
]))
|
|
11634
11636
|
]);
|
|
11635
11637
|
}), 128))
|
|
11636
|
-
], 10, _hoisted_7$
|
|
11638
|
+
], 10, _hoisted_7$b);
|
|
11637
11639
|
}), 128)),
|
|
11638
11640
|
props2.onLastItemVisible !== void 0 ? (openBlock(), createElementBlock("tr", {
|
|
11639
11641
|
key: 0,
|
|
@@ -14756,11 +14758,10 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
14756
14758
|
border: { type: Boolean },
|
|
14757
14759
|
outline: { type: Boolean },
|
|
14758
14760
|
round: { type: Boolean },
|
|
14759
|
-
placement: {},
|
|
14761
|
+
placement: { default: "bottom-start" },
|
|
14760
14762
|
noAutoFocus: { type: Boolean },
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
triggers: {}
|
|
14763
|
+
autoHide: { type: Boolean, default: true },
|
|
14764
|
+
triggers: { default: () => ["click"] }
|
|
14764
14765
|
}, {
|
|
14765
14766
|
"shown": {
|
|
14766
14767
|
type: Boolean,
|
|
@@ -14816,8 +14817,10 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
14816
14817
|
icon: _ctx.icon,
|
|
14817
14818
|
value: _ctx.value,
|
|
14818
14819
|
thin: _ctx.thin,
|
|
14819
|
-
flat: _ctx.flat
|
|
14820
|
-
|
|
14820
|
+
flat: _ctx.flat,
|
|
14821
|
+
outline: _ctx.outline,
|
|
14822
|
+
round: _ctx.round
|
|
14823
|
+
}, null, 8, ["class", "iconEnd", "icon", "value", "thin", "flat", "outline", "round"])
|
|
14821
14824
|
])
|
|
14822
14825
|
]),
|
|
14823
14826
|
_: 3
|
|
@@ -15012,11 +15015,22 @@ function bglForm(idOrField, ...schema) {
|
|
|
15012
15015
|
}
|
|
15013
15016
|
function telField(id, label, options) {
|
|
15014
15017
|
return {
|
|
15015
|
-
$el:
|
|
15018
|
+
$el: "tel",
|
|
15016
15019
|
id,
|
|
15017
15020
|
label,
|
|
15018
15021
|
vIf: options == null ? void 0 : options.vIf,
|
|
15019
|
-
attrs: options
|
|
15022
|
+
attrs: options,
|
|
15023
|
+
class: options == null ? void 0 : options.class
|
|
15024
|
+
};
|
|
15025
|
+
}
|
|
15026
|
+
function colorField(id, label, options) {
|
|
15027
|
+
return {
|
|
15028
|
+
$el: "color",
|
|
15029
|
+
id,
|
|
15030
|
+
label,
|
|
15031
|
+
vIf: options == null ? void 0 : options.vIf,
|
|
15032
|
+
attrs: options,
|
|
15033
|
+
class: options == null ? void 0 : options.class
|
|
15020
15034
|
};
|
|
15021
15035
|
}
|
|
15022
15036
|
function findBglFieldById(id, _schema) {
|
|
@@ -15044,6 +15058,7 @@ const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
|
|
|
15044
15058
|
arrField,
|
|
15045
15059
|
bglForm,
|
|
15046
15060
|
checkField,
|
|
15061
|
+
colorField,
|
|
15047
15062
|
dateField,
|
|
15048
15063
|
findBglFieldById,
|
|
15049
15064
|
frmRow: frmRow$1,
|
|
@@ -15390,7 +15405,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
15390
15405
|
const _hoisted_1$K = { class: "label mb-05" };
|
|
15391
15406
|
const _hoisted_2$x = {
|
|
15392
15407
|
key: 0,
|
|
15393
|
-
class: "ps-025 border-start"
|
|
15408
|
+
class: "ps-025 border-start mb-05"
|
|
15394
15409
|
};
|
|
15395
15410
|
const _hoisted_3$r = { class: "bg-gray-80 -my-05 px-025 pt-065 txt-center" };
|
|
15396
15411
|
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
@@ -15718,7 +15733,7 @@ const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data
|
|
|
15718
15733
|
const _hoisted_1$G = ["title"];
|
|
15719
15734
|
const _hoisted_2$u = ["id", "placeholder", "required"];
|
|
15720
15735
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
15721
|
-
__name: "
|
|
15736
|
+
__name: "ColorInput",
|
|
15722
15737
|
props: {
|
|
15723
15738
|
label: {},
|
|
15724
15739
|
id: {},
|
|
@@ -15741,8 +15756,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
15741
15756
|
}
|
|
15742
15757
|
);
|
|
15743
15758
|
return (_ctx, _cache) => {
|
|
15744
|
-
return
|
|
15745
|
-
key: 0,
|
|
15759
|
+
return openBlock(), createElementBlock("div", {
|
|
15746
15760
|
class: normalizeClass(["bagel-input", { small: _ctx.small }]),
|
|
15747
15761
|
title: _ctx.label
|
|
15748
15762
|
}, [
|
|
@@ -15759,7 +15773,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
15759
15773
|
[vModelText, inputVal.value]
|
|
15760
15774
|
])
|
|
15761
15775
|
])
|
|
15762
|
-
], 10, _hoisted_1$G)
|
|
15776
|
+
], 10, _hoisted_1$G);
|
|
15763
15777
|
};
|
|
15764
15778
|
}
|
|
15765
15779
|
});
|
|
@@ -15772,7 +15786,7 @@ const _hoisted_3$o = {
|
|
|
15772
15786
|
const _hoisted_4$g = { class: "calendar-section m_border-none pe-05 m_p-0" };
|
|
15773
15787
|
const _hoisted_5$f = { class: "flex space-between pb-1" };
|
|
15774
15788
|
const _hoisted_6$c = { class: "flex gap-05" };
|
|
15775
|
-
const _hoisted_7$
|
|
15789
|
+
const _hoisted_7$a = { class: "month-year" };
|
|
15776
15790
|
const _hoisted_8$6 = {
|
|
15777
15791
|
key: 0,
|
|
15778
15792
|
class: "calendar-grid grid gap-025"
|
|
@@ -15835,7 +15849,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
15835
15849
|
};
|
|
15836
15850
|
return dateObj.toLocaleString(props2.locale || void 0, options);
|
|
15837
15851
|
};
|
|
15838
|
-
const
|
|
15852
|
+
const formatDate2 = (date2) => {
|
|
15839
15853
|
if (!date2) return "";
|
|
15840
15854
|
const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
|
|
15841
15855
|
return props2.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split("T")[0];
|
|
@@ -15859,7 +15873,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
15859
15873
|
};
|
|
15860
15874
|
return {
|
|
15861
15875
|
formatDisplayDate,
|
|
15862
|
-
formatDate,
|
|
15876
|
+
formatDate: formatDate2,
|
|
15863
15877
|
parseUserInput
|
|
15864
15878
|
};
|
|
15865
15879
|
}
|
|
@@ -15885,10 +15899,10 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
15885
15899
|
};
|
|
15886
15900
|
}
|
|
15887
15901
|
function useDateState() {
|
|
15888
|
-
const { formatDisplayDate, formatDate } = useFormatting();
|
|
15902
|
+
const { formatDisplayDate, formatDate: formatDate2 } = useFormatting();
|
|
15889
15903
|
const formattedDisplayValue2 = computed(() => formatDisplayDate(props2.modelValue));
|
|
15890
|
-
const formattedMin2 = computed(() =>
|
|
15891
|
-
const formattedMax2 = computed(() =>
|
|
15904
|
+
const formattedMin2 = computed(() => formatDate2(props2.min));
|
|
15905
|
+
const formattedMax2 = computed(() => formatDate2(props2.max));
|
|
15892
15906
|
const selectedDate2 = computed(() => {
|
|
15893
15907
|
if (!props2.modelValue) return null;
|
|
15894
15908
|
return typeof props2.modelValue === "string" ? new Date(props2.modelValue) : props2.modelValue;
|
|
@@ -16222,7 +16236,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
16222
16236
|
icon: "chevron_left",
|
|
16223
16237
|
onClick: unref(previousYear)
|
|
16224
16238
|
}, null, 8, ["onClick"]),
|
|
16225
|
-
createElementVNode("span", _hoisted_7$
|
|
16239
|
+
createElementVNode("span", _hoisted_7$a, toDisplayString(unref(currentMonthValue).formatted.year), 1),
|
|
16226
16240
|
createVNode(unref(Btn), {
|
|
16227
16241
|
flat: "",
|
|
16228
16242
|
icon: "chevron_right",
|
|
@@ -16331,7 +16345,7 @@ const _hoisted_3$n = {
|
|
|
16331
16345
|
const _hoisted_4$f = { class: "date-picker-container" };
|
|
16332
16346
|
const _hoisted_5$e = ["value", "min", "max", "required", "disabled"];
|
|
16333
16347
|
const _hoisted_6$b = { class: "flex gap-075 p-05 m_flex-wrap calendar-container justify-content-center h-100p" };
|
|
16334
|
-
const _hoisted_7$
|
|
16348
|
+
const _hoisted_7$9 = { class: "calendar-section m_border-none pe-05 m_p-0" };
|
|
16335
16349
|
const _hoisted_8$5 = { class: "flex space-between pb-1" };
|
|
16336
16350
|
const _hoisted_9$4 = { class: "flex gap-05" };
|
|
16337
16351
|
const _hoisted_10$4 = { class: "month-year" };
|
|
@@ -16401,14 +16415,14 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
16401
16415
|
timeZone: props2.timezone
|
|
16402
16416
|
});
|
|
16403
16417
|
}
|
|
16404
|
-
function
|
|
16418
|
+
function formatDate2(date2) {
|
|
16405
16419
|
if (!date2) return "";
|
|
16406
16420
|
const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
|
|
16407
16421
|
return props2.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split("T")[0];
|
|
16408
16422
|
}
|
|
16409
16423
|
const formattedDisplayValue = computed(() => formatDisplayDate(props2.modelValue));
|
|
16410
|
-
const formattedMin = computed(() =>
|
|
16411
|
-
const formattedMax = computed(() =>
|
|
16424
|
+
const formattedMin = computed(() => formatDate2(props2.min));
|
|
16425
|
+
const formattedMax = computed(() => formatDate2(props2.max));
|
|
16412
16426
|
const selectedDate = computed(() => {
|
|
16413
16427
|
if (!props2.modelValue) return null;
|
|
16414
16428
|
return typeof props2.modelValue === "string" ? new Date(props2.modelValue) : props2.modelValue;
|
|
@@ -16578,7 +16592,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
16578
16592
|
]),
|
|
16579
16593
|
default: withCtx(() => [
|
|
16580
16594
|
createElementVNode("div", _hoisted_6$b, [
|
|
16581
|
-
createElementVNode("div", _hoisted_7$
|
|
16595
|
+
createElementVNode("div", _hoisted_7$9, [
|
|
16582
16596
|
createElementVNode("div", _hoisted_8$5, [
|
|
16583
16597
|
unref(currentView) === "days" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
16584
16598
|
createVNode(unref(Btn), {
|
|
@@ -16781,7 +16795,7 @@ const _hoisted_3$l = { class: "m-05 flex opacity-7 z-99" };
|
|
|
16781
16795
|
const _hoisted_4$d = { class: "ellipsis-1 word-break-all h-20 m-0 color-black" };
|
|
16782
16796
|
const _hoisted_5$d = { class: "flex gap-025 rounded pe-1 ps-05 py-025 bg-gray-80 -my-1" };
|
|
16783
16797
|
const _hoisted_6$a = { class: "ellipsis-1 word-break-all h-20 m-0 color-black txt16" };
|
|
16784
|
-
const _hoisted_7$
|
|
16798
|
+
const _hoisted_7$8 = {
|
|
16785
16799
|
key: 1,
|
|
16786
16800
|
class: "txt-gray txt-12"
|
|
16787
16801
|
};
|
|
@@ -17064,7 +17078,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
17064
17078
|
])
|
|
17065
17079
|
]);
|
|
17066
17080
|
}), 128)),
|
|
17067
|
-
!storageFiles.value.length && !fileQueue.value.length ? (openBlock(), createElementBlock("span", _hoisted_7$
|
|
17081
|
+
!storageFiles.value.length && !fileQueue.value.length ? (openBlock(), createElementBlock("span", _hoisted_7$8, toDisplayString(_ctx.noFilePlaceholder || "No file selected"), 1)) : createCommentVNode("", true)
|
|
17068
17082
|
]),
|
|
17069
17083
|
_: 1
|
|
17070
17084
|
})) : (openBlock(), createElementBlock("div", {
|
|
@@ -17663,7 +17677,7 @@ const _hoisted_6$9 = {
|
|
|
17663
17677
|
key: 0,
|
|
17664
17678
|
class: "m-0 m_txt-14"
|
|
17665
17679
|
};
|
|
17666
|
-
const _hoisted_7$
|
|
17680
|
+
const _hoisted_7$7 = {
|
|
17667
17681
|
key: 1,
|
|
17668
17682
|
class: "txt-gray txt-12 m-0"
|
|
17669
17683
|
};
|
|
@@ -17738,7 +17752,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
17738
17752
|
}, null, 8, _hoisted_4$b)) : createCommentVNode("", true),
|
|
17739
17753
|
createElementVNode("div", _hoisted_5$b, [
|
|
17740
17754
|
opt.label ? (openBlock(), createElementBlock("p", _hoisted_6$9, toDisplayString(opt.label), 1)) : createCommentVNode("", true),
|
|
17741
|
-
opt.subLabel ? (openBlock(), createElementBlock("p", _hoisted_7$
|
|
17755
|
+
opt.subLabel ? (openBlock(), createElementBlock("p", _hoisted_7$7, toDisplayString(opt.subLabel), 1)) : createCommentVNode("", true)
|
|
17742
17756
|
]),
|
|
17743
17757
|
renderSlot(_ctx.$slots, "radioItem", mergeProps({ ref_for: true }, opt), void 0, true)
|
|
17744
17758
|
]),
|
|
@@ -17839,7 +17853,7 @@ const _hoisted_3$g = { class: "range-slider relative w-100" };
|
|
|
17839
17853
|
const _hoisted_4$9 = ["id", "value", "min", "max", "step", "required", "disabled", "aria-label"];
|
|
17840
17854
|
const _hoisted_5$9 = ["value", "min", "max", "step", "required", "disabled"];
|
|
17841
17855
|
const _hoisted_6$8 = { class: "track absolute pointer-events-none overflow-hidden round" };
|
|
17842
|
-
const _hoisted_7$
|
|
17856
|
+
const _hoisted_7$6 = { class: "txt-center txt-14 user-select-none range-slider-txt flex space-between opacity-4 mx-05" };
|
|
17843
17857
|
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
17844
17858
|
__name: "RangeInput",
|
|
17845
17859
|
props: {
|
|
@@ -17980,7 +17994,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
17980
17994
|
], true)
|
|
17981
17995
|
], 4)) : createCommentVNode("", true)
|
|
17982
17996
|
]),
|
|
17983
|
-
createElementVNode("p", _hoisted_7$
|
|
17997
|
+
createElementVNode("p", _hoisted_7$6, [
|
|
17984
17998
|
renderSlot(_ctx.$slots, "min", {
|
|
17985
17999
|
max: unref(formatValue)(unref(max2)),
|
|
17986
18000
|
min: unref(formatValue)(unref(min2)),
|
|
@@ -19674,7 +19688,7 @@ const _hoisted_4$8 = {
|
|
|
19674
19688
|
};
|
|
19675
19689
|
const _hoisted_5$8 = ["value"];
|
|
19676
19690
|
const _hoisted_6$7 = ["aria-selected", "onClick", "onKeydown"];
|
|
19677
|
-
const _hoisted_7$
|
|
19691
|
+
const _hoisted_7$5 = { class: "block" };
|
|
19678
19692
|
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
19679
19693
|
__name: "SelectInput",
|
|
19680
19694
|
props: {
|
|
@@ -19967,7 +19981,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
19967
19981
|
size: 1.1
|
|
19968
19982
|
})) : createCommentVNode("", true)
|
|
19969
19983
|
], 64)) : createCommentVNode("", true),
|
|
19970
|
-
createElementVNode("span", _hoisted_7$
|
|
19984
|
+
createElementVNode("span", _hoisted_7$5, toDisplayString(getLabel(option2)), 1)
|
|
19971
19985
|
], 42, _hoisted_6$7);
|
|
19972
19986
|
}), 128))
|
|
19973
19987
|
], 2),
|
|
@@ -27865,11 +27879,12 @@ function parsePhoneNumber() {
|
|
|
27865
27879
|
return withMetadataArgument(parsePhoneNumber$1, arguments);
|
|
27866
27880
|
}
|
|
27867
27881
|
const _hoisted_1$o = ["aria-expanded"];
|
|
27868
|
-
const _hoisted_2$e = { class: "
|
|
27869
|
-
const _hoisted_3$b =
|
|
27870
|
-
const _hoisted_4$6 =
|
|
27871
|
-
const _hoisted_5$6 = {
|
|
27872
|
-
const _hoisted_6$5 =
|
|
27882
|
+
const _hoisted_2$e = { class: "flex gap-05" };
|
|
27883
|
+
const _hoisted_3$b = { class: "p-075 tel-countryp-dropdown" };
|
|
27884
|
+
const _hoisted_4$6 = ["aria-selected", "onClick", "onMousemove"];
|
|
27885
|
+
const _hoisted_5$6 = { class: "tel-country" };
|
|
27886
|
+
const _hoisted_6$5 = { key: 1 };
|
|
27887
|
+
const _hoisted_7$4 = ["id", "required", "placeholder", "disabled", "autocomplete", "pattern", "minlength", "maxlength", "name", "readonly", "tabindex", "aria-describedby"];
|
|
27873
27888
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
27874
27889
|
__name: "TelInput",
|
|
27875
27890
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -27893,8 +27908,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
27893
27908
|
mode: { default: "INTERNATIONAL" },
|
|
27894
27909
|
onlyCountries: { default: () => [] },
|
|
27895
27910
|
preferredCountries: { default: () => [] },
|
|
27896
|
-
parseArg: {}
|
|
27897
|
-
debounceDelay: { default: 300 }
|
|
27911
|
+
parseArg: {}
|
|
27898
27912
|
}, {
|
|
27899
27913
|
"modelValue": {
|
|
27900
27914
|
default: ""
|
|
@@ -27915,13 +27929,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
27915
27929
|
setup(__props, { emit: __emit }) {
|
|
27916
27930
|
const props2 = __props;
|
|
27917
27931
|
const emit2 = __emit;
|
|
27918
|
-
|
|
27919
|
-
|
|
27920
|
-
if (apiData) return JSON.parse(apiData);
|
|
27921
|
-
const { data: data2 } = await axios$1.get("https://ipapi.co/json/");
|
|
27922
|
-
sessionStorage.setItem("ipapi", JSON.stringify(data2));
|
|
27923
|
-
return data2;
|
|
27924
|
-
}
|
|
27932
|
+
const open = ref(false);
|
|
27933
|
+
const dropdownOpenDirection = ref("below");
|
|
27925
27934
|
const defaultDropdownOptions = {
|
|
27926
27935
|
hide: false,
|
|
27927
27936
|
disabled: false,
|
|
@@ -27952,52 +27961,169 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
27952
27961
|
...defaultInputOptions,
|
|
27953
27962
|
...props2.inputOptions
|
|
27954
27963
|
}));
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
|
|
27959
|
-
|
|
27960
|
-
|
|
27961
|
-
|
|
27962
|
-
|
|
27963
|
-
|
|
27964
|
-
|
|
27965
|
-
|
|
27966
|
-
)
|
|
27967
|
-
);
|
|
27968
|
-
const isPreferred = (country) => props2.preferredCountries.includes(country == null ? void 0 : country.iso2);
|
|
27969
|
-
const filteredCountries = computed(() => {
|
|
27970
|
-
if (props2.onlyCountries.length > 0) {
|
|
27971
|
-
return props2.allCountries.filter(
|
|
27972
|
-
({ iso2 }) => props2.onlyCountries.some((c2) => c2.toUpperCase() === iso2)
|
|
27964
|
+
function useCountrySelection(props22, emit22) {
|
|
27965
|
+
const activeCountryCode2 = ref();
|
|
27966
|
+
const selectedIndex2 = ref();
|
|
27967
|
+
const searchQuery2 = ref("");
|
|
27968
|
+
const activeCountry = computed(() => {
|
|
27969
|
+
var _a;
|
|
27970
|
+
return (_a = props22.allCountries) == null ? void 0 : _a.find(
|
|
27971
|
+
(country) => {
|
|
27972
|
+
var _a2;
|
|
27973
|
+
return country.iso2 === ((_a2 = activeCountryCode2.value) == null ? void 0 : _a2.toUpperCase());
|
|
27974
|
+
}
|
|
27973
27975
|
);
|
|
27976
|
+
});
|
|
27977
|
+
const filteredCountries = computed(() => {
|
|
27978
|
+
const countries = props22.allCountries || [];
|
|
27979
|
+
const onlyCountries = props22.onlyCountries || [];
|
|
27980
|
+
const excludeCountries = props22.excludeCountries || [];
|
|
27981
|
+
if (onlyCountries.length > 0) {
|
|
27982
|
+
return countries.filter(({ iso2 }) => onlyCountries.some((c2) => c2.toUpperCase() === iso2));
|
|
27983
|
+
}
|
|
27984
|
+
if (excludeCountries.length > 0) {
|
|
27985
|
+
return countries.filter(
|
|
27986
|
+
({ iso2 }) => !excludeCountries.includes(iso2.toUpperCase()) && !excludeCountries.includes(iso2.toLowerCase())
|
|
27987
|
+
);
|
|
27988
|
+
}
|
|
27989
|
+
return countries;
|
|
27990
|
+
});
|
|
27991
|
+
const sortedCountries2 = computed(() => {
|
|
27992
|
+
const preferredCountries = getCountries(props22.preferredCountries || []);
|
|
27993
|
+
const countriesList = [...preferredCountries, ...filteredCountries.value];
|
|
27994
|
+
const cleanInput = searchQuery2.value.replaceAll(
|
|
27995
|
+
/[~`!#$%&*()+={};:'"<>.,\\/@-]/g,
|
|
27996
|
+
""
|
|
27997
|
+
).toLowerCase();
|
|
27998
|
+
return countriesList.filter(
|
|
27999
|
+
(c2) => new RegExp(cleanInput, "i").test(c2.name || "") || new RegExp(cleanInput, "i").test(c2.iso2 || "") || new RegExp(cleanInput, "i").test(c2.dialCode || "")
|
|
28000
|
+
).filter(Boolean);
|
|
28001
|
+
});
|
|
28002
|
+
const findCountry = (iso) => filteredCountries.value.find(
|
|
28003
|
+
(country) => country.iso2 === iso.toUpperCase()
|
|
28004
|
+
);
|
|
28005
|
+
const findCountryByDialCode = (dialCode) => filteredCountries.value.find((country) => Number(country.dialCode) === dialCode);
|
|
28006
|
+
function getCountries(list) {
|
|
28007
|
+
const countryList = [];
|
|
28008
|
+
list.forEach((countryCode) => {
|
|
28009
|
+
const country = findCountry(countryCode);
|
|
28010
|
+
if (country) countryList.push(country);
|
|
28011
|
+
});
|
|
28012
|
+
return countryList;
|
|
27974
28013
|
}
|
|
27975
|
-
|
|
27976
|
-
|
|
27977
|
-
(
|
|
27978
|
-
|
|
28014
|
+
async function initializeCountry2() {
|
|
28015
|
+
if (props22.defaultCountry) {
|
|
28016
|
+
if (typeof props22.defaultCountry === "string") {
|
|
28017
|
+
chooseCountry2(props22.defaultCountry);
|
|
28018
|
+
return;
|
|
28019
|
+
}
|
|
28020
|
+
if (typeof props22.defaultCountry === "number") {
|
|
28021
|
+
const country = findCountryByDialCode(props22.defaultCountry);
|
|
28022
|
+
if (country) {
|
|
28023
|
+
chooseCountry2(country.iso2);
|
|
28024
|
+
return;
|
|
28025
|
+
}
|
|
28026
|
+
}
|
|
28027
|
+
}
|
|
28028
|
+
const fallbackCountry = sortedCountries2.value[0];
|
|
28029
|
+
if (props22.autoDefaultCountry) {
|
|
28030
|
+
try {
|
|
28031
|
+
const res = (await getIp()).country;
|
|
28032
|
+
chooseCountry2(res || activeCountryCode2.value);
|
|
28033
|
+
} catch (error) {
|
|
28034
|
+
console.warn(error);
|
|
28035
|
+
chooseCountry2(fallbackCountry.iso2);
|
|
28036
|
+
}
|
|
28037
|
+
} else {
|
|
28038
|
+
chooseCountry2(fallbackCountry.iso2);
|
|
28039
|
+
}
|
|
27979
28040
|
}
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
|
|
27988
|
-
|
|
28041
|
+
function chooseCountry2(country) {
|
|
28042
|
+
if (!country) return;
|
|
28043
|
+
const parsedCountry = findCountry(country);
|
|
28044
|
+
if (!parsedCountry) return;
|
|
28045
|
+
activeCountryCode2.value = parsedCountry.iso2;
|
|
28046
|
+
emit22("country-changed", parsedCountry);
|
|
28047
|
+
open.value = false;
|
|
28048
|
+
}
|
|
28049
|
+
watch(
|
|
28050
|
+
() => activeCountry.value,
|
|
28051
|
+
(value, oldValue) => {
|
|
28052
|
+
if (!value && (oldValue == null ? void 0 : oldValue.iso2)) {
|
|
28053
|
+
activeCountryCode2.value = oldValue.iso2;
|
|
28054
|
+
return;
|
|
28055
|
+
}
|
|
28056
|
+
if (value == null ? void 0 : value.iso2) emit22("country-changed", value);
|
|
28057
|
+
}
|
|
27989
28058
|
);
|
|
27990
|
-
return
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
|
|
28059
|
+
return {
|
|
28060
|
+
activeCountryCode: activeCountryCode2,
|
|
28061
|
+
activeCountry,
|
|
28062
|
+
selectedIndex: selectedIndex2,
|
|
28063
|
+
searchQuery: searchQuery2,
|
|
28064
|
+
sortedCountries: sortedCountries2,
|
|
28065
|
+
chooseCountry: chooseCountry2,
|
|
28066
|
+
initializeCountry: initializeCountry2,
|
|
28067
|
+
findCountry,
|
|
28068
|
+
findCountryByDialCode
|
|
28069
|
+
};
|
|
28070
|
+
}
|
|
28071
|
+
function usePhoneNumberFormatting(props22, activeCountryCode2) {
|
|
28072
|
+
const parseArgs = computed(() => ({
|
|
28073
|
+
...props22.parseArg,
|
|
28074
|
+
defaultCountry: activeCountryCode2.value
|
|
28075
|
+
}));
|
|
28076
|
+
function formatPhone2(val) {
|
|
28077
|
+
var _a, _b, _c;
|
|
28078
|
+
let phoneNumber = parsePhoneNumber(val, parseArgs.value);
|
|
28079
|
+
if (!phoneNumber && val.startsWith("+")) {
|
|
28080
|
+
const currentCountry = (_a = props22.allCountries) == null ? void 0 : _a.find((c2) => c2.iso2 === activeCountryCode2.value);
|
|
28081
|
+
if (currentCountry) {
|
|
28082
|
+
const { dialCode } = currentCountry;
|
|
28083
|
+
const withoutDialCode = val.replace(new RegExp(`^\\+${dialCode}`), "");
|
|
28084
|
+
phoneNumber = parsePhoneNumber(withoutDialCode, parseArgs.value);
|
|
28085
|
+
}
|
|
28086
|
+
}
|
|
28087
|
+
if (!phoneNumber) {
|
|
28088
|
+
const dialCode = ((_c = (_b = props22.allCountries) == null ? void 0 : _b.find(
|
|
28089
|
+
(c2) => c2.iso2 === activeCountryCode2.value
|
|
28090
|
+
)) == null ? void 0 : _c.dialCode) || "";
|
|
28091
|
+
if (props22.mode === "INTERNATIONAL") return `+${dialCode}`;
|
|
28092
|
+
return dialCode;
|
|
28093
|
+
}
|
|
28094
|
+
const formattedNumber = phoneNumber.format(props22.mode || "INTERNATIONAL");
|
|
28095
|
+
if (props22.mode === "INTERNATIONAL") {
|
|
28096
|
+
const countryCode = phoneNumber.countryCallingCode;
|
|
28097
|
+
const { nationalNumber } = phoneNumber;
|
|
28098
|
+
return `+${countryCode}${nationalNumber}`;
|
|
28099
|
+
}
|
|
28100
|
+
return formattedNumber.replaceAll(" ", "") || "";
|
|
28101
|
+
}
|
|
28102
|
+
return {
|
|
28103
|
+
formatPhone: formatPhone2,
|
|
28104
|
+
parseArgs
|
|
28105
|
+
};
|
|
28106
|
+
}
|
|
27998
28107
|
const debouncedEmit = useDebounceFn((maybeFormatted) => {
|
|
27999
28108
|
emit2("debounce", maybeFormatted);
|
|
28000
|
-
}
|
|
28109
|
+
});
|
|
28110
|
+
const {
|
|
28111
|
+
activeCountryCode,
|
|
28112
|
+
selectedIndex,
|
|
28113
|
+
searchQuery,
|
|
28114
|
+
sortedCountries,
|
|
28115
|
+
chooseCountry,
|
|
28116
|
+
initializeCountry
|
|
28117
|
+
} = useCountrySelection(props2, emit2);
|
|
28118
|
+
const { formatPhone } = usePhoneNumberFormatting(props2, activeCountryCode);
|
|
28119
|
+
const isPreferred = (country) => props2.preferredCountries.includes(country == null ? void 0 : country.iso2) || false;
|
|
28120
|
+
function reset() {
|
|
28121
|
+
if (!sortedCountries.value || !activeCountryCode.value) return;
|
|
28122
|
+
selectedIndex.value = sortedCountries.value.findIndex(
|
|
28123
|
+
(c2) => c2.iso2 === activeCountryCode.value
|
|
28124
|
+
);
|
|
28125
|
+
open.value = false;
|
|
28126
|
+
}
|
|
28001
28127
|
const phone = useModel(__props, "modelValue", {
|
|
28002
28128
|
set: (value) => {
|
|
28003
28129
|
let maybeFormatted = value;
|
|
@@ -28014,99 +28140,18 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28014
28140
|
},
|
|
28015
28141
|
get: (value) => value
|
|
28016
28142
|
});
|
|
28017
|
-
function formatPhone(val) {
|
|
28018
|
-
var _a;
|
|
28019
|
-
const phoneNumber = parsePhoneNumber(val, parseArgs.value);
|
|
28020
|
-
if (!phoneNumber) {
|
|
28021
|
-
const dialCode = ((_a = sortedCountries.value.find((c2) => c2.iso2 === activeCountryCode.value)) == null ? void 0 : _a.dialCode) || "";
|
|
28022
|
-
if (props2.mode === "INTERNATIONAL") return `+${dialCode}`;
|
|
28023
|
-
return dialCode;
|
|
28024
|
-
}
|
|
28025
|
-
return phoneNumber.format(props2.mode).replaceAll(" ", "") || "";
|
|
28026
|
-
}
|
|
28027
|
-
watch(
|
|
28028
|
-
() => activeCountry.value,
|
|
28029
|
-
(value, oldValue) => {
|
|
28030
|
-
if (!value && (oldValue == null ? void 0 : oldValue.iso2)) {
|
|
28031
|
-
activeCountryCode.value = oldValue.iso2;
|
|
28032
|
-
return;
|
|
28033
|
-
}
|
|
28034
|
-
if (value == null ? void 0 : value.iso2) emit2("country-changed", value);
|
|
28035
|
-
}
|
|
28036
|
-
);
|
|
28037
|
-
async function initializeCountry() {
|
|
28038
|
-
if (props2.defaultCountry) {
|
|
28039
|
-
if (typeof props2.defaultCountry === "string") {
|
|
28040
|
-
chooseCountry(props2.defaultCountry);
|
|
28041
|
-
return;
|
|
28042
|
-
}
|
|
28043
|
-
if (typeof props2.defaultCountry === "number") {
|
|
28044
|
-
const country = findCountryByDialCode(props2.defaultCountry);
|
|
28045
|
-
if (country) {
|
|
28046
|
-
chooseCountry(country.iso2);
|
|
28047
|
-
return;
|
|
28048
|
-
}
|
|
28049
|
-
}
|
|
28050
|
-
}
|
|
28051
|
-
const fallbackCountry = sortedCountries.value[0];
|
|
28052
|
-
if (props2.autoDefaultCountry) {
|
|
28053
|
-
try {
|
|
28054
|
-
const res = (await getIp()).country;
|
|
28055
|
-
chooseCountry(res || activeCountryCode.value);
|
|
28056
|
-
} catch (error) {
|
|
28057
|
-
console.warn(error);
|
|
28058
|
-
chooseCountry(fallbackCountry.iso2);
|
|
28059
|
-
}
|
|
28060
|
-
} else {
|
|
28061
|
-
chooseCountry(fallbackCountry.iso2);
|
|
28062
|
-
}
|
|
28063
|
-
}
|
|
28064
|
-
onMounted(initializeCountry);
|
|
28065
|
-
const findCountry = (iso) => filteredCountries.value.find((country) => country.iso2 === iso.toUpperCase());
|
|
28066
|
-
function getCountries(list) {
|
|
28067
|
-
const countryList = [];
|
|
28068
|
-
list.forEach((countryCode) => {
|
|
28069
|
-
const country = findCountry(countryCode);
|
|
28070
|
-
if (country) countryList.push(country);
|
|
28071
|
-
});
|
|
28072
|
-
return countryList;
|
|
28073
|
-
}
|
|
28074
|
-
function findCountryByDialCode(dialCode) {
|
|
28075
|
-
return filteredCountries.value.find((country) => Number(country.dialCode) === dialCode);
|
|
28076
|
-
}
|
|
28077
|
-
const phoneDropdown = ref();
|
|
28078
|
-
function chooseCountry(country) {
|
|
28079
|
-
var _a, _b;
|
|
28080
|
-
if (!country) return;
|
|
28081
|
-
const parsedCountry = findCountry(country);
|
|
28082
|
-
if (!parsedCountry) return;
|
|
28083
|
-
activeCountryCode.value = parsedCountry.iso2;
|
|
28084
|
-
if (((_a = props2.inputOptions) == null ? void 0 : _a.showDialCode) && parsedCountry) {
|
|
28085
|
-
phone.value = `+ ${parsedCountry.dialCode}`;
|
|
28086
|
-
activeCountryCode.value = parsedCountry.iso2 || "";
|
|
28087
|
-
return;
|
|
28088
|
-
}
|
|
28089
|
-
activeCountryCode.value = parsedCountry.iso2 || "";
|
|
28090
|
-
(_b = phoneDropdown.value) == null ? void 0 : _b.hide();
|
|
28091
|
-
}
|
|
28092
28143
|
function onBlur() {
|
|
28093
28144
|
emit2("blur");
|
|
28094
28145
|
}
|
|
28095
28146
|
function onFocus() {
|
|
28096
28147
|
emit2("focus");
|
|
28097
28148
|
}
|
|
28098
|
-
function onEnter(
|
|
28149
|
+
function onEnter() {
|
|
28099
28150
|
emit2("enter");
|
|
28100
28151
|
}
|
|
28101
28152
|
function onSpace() {
|
|
28102
28153
|
emit2("space");
|
|
28103
28154
|
}
|
|
28104
|
-
function reset() {
|
|
28105
|
-
selectedIndex.value = sortedCountries.value.findIndex(
|
|
28106
|
-
(c2) => c2.iso2 === activeCountryCode.value
|
|
28107
|
-
);
|
|
28108
|
-
open.value = false;
|
|
28109
|
-
}
|
|
28110
28155
|
function handleInput(e) {
|
|
28111
28156
|
const keyVal = e.key ?? "";
|
|
28112
28157
|
if (keyVal.length > 1 || e.metaKey) return;
|
|
@@ -28114,6 +28159,14 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28114
28159
|
if (!hasBadChars) return;
|
|
28115
28160
|
e.preventDefault();
|
|
28116
28161
|
}
|
|
28162
|
+
async function getIp() {
|
|
28163
|
+
const apiData = sessionStorage.getItem("ipapi");
|
|
28164
|
+
if (apiData) return JSON.parse(apiData);
|
|
28165
|
+
const { data: data2 } = await axios$1.get("https://ipapi.co/json/");
|
|
28166
|
+
sessionStorage.setItem("ipapi", JSON.stringify(data2));
|
|
28167
|
+
return data2;
|
|
28168
|
+
}
|
|
28169
|
+
onMounted(initializeCountry);
|
|
28117
28170
|
return (_ctx, _cache) => {
|
|
28118
28171
|
return openBlock(), createElementBlock("div", {
|
|
28119
28172
|
class: normalizeClass(["bagel-input", { disabled: _ctx.disabled, [props2.class || ""]: true }])
|
|
@@ -28126,89 +28179,83 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28126
28179
|
tabindex: "-1",
|
|
28127
28180
|
"aria-label": "Country Code Selector",
|
|
28128
28181
|
"aria-haspopup": "listbox",
|
|
28129
|
-
"aria-expanded":
|
|
28182
|
+
"aria-expanded": open.value,
|
|
28130
28183
|
onKeydown: [
|
|
28131
28184
|
withKeys(reset, ["esc"]),
|
|
28132
28185
|
withKeys(reset, ["tab"])
|
|
28133
28186
|
]
|
|
28134
28187
|
}, [
|
|
28135
|
-
|
|
28136
|
-
|
|
28137
|
-
|
|
28138
|
-
ref: phoneDropdown,
|
|
28188
|
+
createVNode(unref(_sfc_main$V), {
|
|
28189
|
+
shown: open.value,
|
|
28190
|
+
"onUpdate:shown": _cache[1] || (_cache[1] = ($event) => open.value = $event),
|
|
28139
28191
|
placement: "bottom-start",
|
|
28140
|
-
disabled: computedDropDownOptions.
|
|
28141
|
-
onHide: _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = false : open = false)
|
|
28192
|
+
disabled: unref(computedDropDownOptions).disabled
|
|
28142
28193
|
}, {
|
|
28143
28194
|
trigger: withCtx(() => [
|
|
28144
|
-
createElementVNode("span",
|
|
28145
|
-
class: "flex gap-05",
|
|
28146
|
-
onClick: _cache[0] || (_cache[0] = ($event) => isRef(open) ? open.value = true : open = true)
|
|
28147
|
-
}, [
|
|
28195
|
+
createElementVNode("span", _hoisted_2$e, [
|
|
28148
28196
|
createVNode(unref(Icon), {
|
|
28149
|
-
icon:
|
|
28197
|
+
icon: open.value ? "collapse_all" : "expand_all"
|
|
28150
28198
|
}, null, 8, ["icon"]),
|
|
28151
|
-
computedDropDownOptions.
|
|
28199
|
+
unref(computedDropDownOptions).showFlags && unref(activeCountryCode) ? (openBlock(), createBlock(unref(Flag), {
|
|
28152
28200
|
key: 0,
|
|
28153
28201
|
country: unref(activeCountryCode)
|
|
28154
28202
|
}, null, 8, ["country"])) : createCommentVNode("", true)
|
|
28155
28203
|
])
|
|
28156
28204
|
]),
|
|
28157
28205
|
default: withCtx(() => [
|
|
28158
|
-
createElementVNode("div",
|
|
28206
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
28159
28207
|
_ctx.searchable ? (openBlock(), createBlock(unref(TextInput), {
|
|
28160
28208
|
key: 0,
|
|
28161
|
-
modelValue: searchQuery
|
|
28162
|
-
"onUpdate:modelValue": _cache[
|
|
28209
|
+
modelValue: unref(searchQuery),
|
|
28210
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
28163
28211
|
"aria-label": "Search by country name or country code",
|
|
28164
28212
|
placeholder: "Search",
|
|
28165
28213
|
icon: "search"
|
|
28166
28214
|
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
28167
28215
|
createElementVNode("ul", {
|
|
28168
|
-
class: normalizeClass(["overflow-y p-0", dropdownOpenDirection.value]),
|
|
28169
|
-
style: { "max-height": "400px" },
|
|
28216
|
+
class: normalizeClass(["overflow-y p-0 max-h-300px", dropdownOpenDirection.value]),
|
|
28170
28217
|
role: "listbox"
|
|
28171
28218
|
}, [
|
|
28172
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(sortedCountries
|
|
28219
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(sortedCountries), (pb, index2) => {
|
|
28173
28220
|
return openBlock(), createElementBlock("li", {
|
|
28174
28221
|
key: pb.iso2 + isPreferred(pb),
|
|
28175
28222
|
role: "option",
|
|
28176
28223
|
class: "flex gap-075",
|
|
28177
28224
|
tabindex: "-1",
|
|
28178
28225
|
"aria-selected": unref(activeCountryCode) === pb.iso2 && !isPreferred(pb),
|
|
28179
|
-
onClick: ($event) => chooseCountry(pb.iso2),
|
|
28180
|
-
onMousemove: ($event) =>
|
|
28226
|
+
onClick: ($event) => unref(chooseCountry)(pb.iso2),
|
|
28227
|
+
onMousemove: ($event) => selectedIndex.value = index2
|
|
28181
28228
|
}, [
|
|
28182
|
-
computedDropDownOptions.
|
|
28229
|
+
unref(computedDropDownOptions).showFlags ? (openBlock(), createBlock(unref(Flag), {
|
|
28183
28230
|
key: 0,
|
|
28184
28231
|
country: pb.iso2
|
|
28185
28232
|
}, null, 8, ["country"])) : createCommentVNode("", true),
|
|
28186
|
-
createElementVNode("p",
|
|
28187
|
-
computedDropDownOptions.
|
|
28188
|
-
], 40,
|
|
28233
|
+
createElementVNode("p", _hoisted_5$6, toDisplayString(pb.name), 1),
|
|
28234
|
+
unref(computedDropDownOptions).showDialCodeInList ? (openBlock(), createElementBlock("span", _hoisted_6$5, " +" + toDisplayString(pb.dialCode), 1)) : createCommentVNode("", true)
|
|
28235
|
+
], 40, _hoisted_4$6);
|
|
28189
28236
|
}), 128))
|
|
28190
28237
|
], 2)
|
|
28191
28238
|
])
|
|
28192
28239
|
]),
|
|
28193
28240
|
_: 1
|
|
28194
|
-
}, 8, ["
|
|
28241
|
+
}, 8, ["shown", "disabled"]),
|
|
28195
28242
|
withDirectives(createElementVNode("input", {
|
|
28196
28243
|
id: _ctx.id,
|
|
28197
|
-
"onUpdate:modelValue": _cache[
|
|
28244
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => phone.value = $event),
|
|
28198
28245
|
required: _ctx.required,
|
|
28199
28246
|
placeholder: props2.placeholder || "Enter a phone number",
|
|
28200
28247
|
disabled: _ctx.disabled,
|
|
28201
28248
|
type: "tel",
|
|
28202
28249
|
autocomplete: _ctx.autocomplete,
|
|
28203
28250
|
class: "vti__input",
|
|
28204
|
-
pattern: computedInputOptions.
|
|
28205
|
-
minlength: computedInputOptions.
|
|
28206
|
-
maxlength: computedInputOptions.
|
|
28207
|
-
name: computedInputOptions.
|
|
28208
|
-
readonly: computedInputOptions.
|
|
28209
|
-
tabindex: computedInputOptions.
|
|
28210
|
-
"aria-describedby": computedInputOptions
|
|
28211
|
-
style: normalizeStyle(computedInputOptions.
|
|
28251
|
+
pattern: unref(computedInputOptions).pattern,
|
|
28252
|
+
minlength: unref(computedInputOptions).minlength,
|
|
28253
|
+
maxlength: unref(computedInputOptions).maxlength,
|
|
28254
|
+
name: unref(computedInputOptions).name,
|
|
28255
|
+
readonly: unref(computedInputOptions).readonly,
|
|
28256
|
+
tabindex: unref(computedInputOptions).tabindex,
|
|
28257
|
+
"aria-describedby": unref(computedInputOptions)["aria-describedby"],
|
|
28258
|
+
style: normalizeStyle(unref(computedInputOptions).style),
|
|
28212
28259
|
onBlur,
|
|
28213
28260
|
onFocus,
|
|
28214
28261
|
onKeyup: [
|
|
@@ -28216,7 +28263,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28216
28263
|
withKeys(onSpace, ["space"])
|
|
28217
28264
|
],
|
|
28218
28265
|
onKeydown: handleInput
|
|
28219
|
-
}, null, 44,
|
|
28266
|
+
}, null, 44, _hoisted_7$4), [
|
|
28220
28267
|
[vModelText, phone.value]
|
|
28221
28268
|
])
|
|
28222
28269
|
], 40, _hoisted_1$o)
|
|
@@ -28225,7 +28272,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28225
28272
|
};
|
|
28226
28273
|
}
|
|
28227
28274
|
});
|
|
28228
|
-
const TelInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-
|
|
28275
|
+
const TelInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-a77caf64"]]);
|
|
28229
28276
|
const _hoisted_1$n = ["title"];
|
|
28230
28277
|
const _hoisted_2$d = ["for"];
|
|
28231
28278
|
const _hoisted_3$a = ["id", "title", "autocomplete", "type", "placeholder", "disabled", "required", "pattern"];
|
|
@@ -35429,7 +35476,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
35429
35476
|
};
|
|
35430
35477
|
}
|
|
35431
35478
|
});
|
|
35432
|
-
const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
35479
|
+
const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f204ab99"]]);
|
|
35433
35480
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
35434
35481
|
__name: "Title",
|
|
35435
35482
|
props: {
|
|
@@ -37267,6 +37314,37 @@ function timeAgo(date2, lang = "en") {
|
|
|
37267
37314
|
}
|
|
37268
37315
|
return selectedLang.justNow;
|
|
37269
37316
|
}
|
|
37317
|
+
const formatMap = {
|
|
37318
|
+
dd: { type: "day", format: "2-digit" },
|
|
37319
|
+
ddd: { type: "weekday", format: "short" },
|
|
37320
|
+
dddd: { type: "weekday", format: "long" },
|
|
37321
|
+
mm: { type: "month", format: "2-digit" },
|
|
37322
|
+
mmm: { type: "month", format: "short" },
|
|
37323
|
+
mmmm: { type: "month", format: "long" },
|
|
37324
|
+
yy: { type: "year", format: "2-digit" },
|
|
37325
|
+
yyyy: { type: "year", format: "numeric" },
|
|
37326
|
+
HH: { type: "hour", format: "2-digit" },
|
|
37327
|
+
hh: { type: "hour", format: "2-digit" },
|
|
37328
|
+
MM: { type: "minute", format: "2-digit" },
|
|
37329
|
+
ss: { type: "second", format: "2-digit" },
|
|
37330
|
+
ampm: { type: "dayPeriod", format: "short" }
|
|
37331
|
+
};
|
|
37332
|
+
function formatDate(date2, format2 = "dd.mm.yy") {
|
|
37333
|
+
if (!date2) return "";
|
|
37334
|
+
try {
|
|
37335
|
+
const formatParts = format2.split(/[.\s:]/);
|
|
37336
|
+
const formatObject = {};
|
|
37337
|
+
for (const part of formatParts) {
|
|
37338
|
+
const formatInfo = formatMap[part];
|
|
37339
|
+
if (!formatInfo) continue;
|
|
37340
|
+
formatObject[formatInfo.type] = formatInfo.format;
|
|
37341
|
+
}
|
|
37342
|
+
const d2 = typeof date2 === "string" ? new Date(date2) : date2;
|
|
37343
|
+
return d2.toLocaleDateString("he-IL", formatObject);
|
|
37344
|
+
} catch (error) {
|
|
37345
|
+
return "";
|
|
37346
|
+
}
|
|
37347
|
+
}
|
|
37270
37348
|
export {
|
|
37271
37349
|
_sfc_main$1m as Accordion,
|
|
37272
37350
|
AccordionItem,
|
|
@@ -37286,7 +37364,7 @@ export {
|
|
|
37286
37364
|
CheckInput,
|
|
37287
37365
|
Checkbox,
|
|
37288
37366
|
CodeEditor,
|
|
37289
|
-
_sfc_main$N as
|
|
37367
|
+
_sfc_main$N as ColorInput,
|
|
37290
37368
|
DataPreview,
|
|
37291
37369
|
DataTable,
|
|
37292
37370
|
DateInput,
|
|
@@ -37357,6 +37435,7 @@ export {
|
|
|
37357
37435
|
copyText,
|
|
37358
37436
|
debounce,
|
|
37359
37437
|
denullify,
|
|
37438
|
+
formatDate,
|
|
37360
37439
|
formatString,
|
|
37361
37440
|
getFallbackSchema,
|
|
37362
37441
|
getNestedValue,
|