@bagelink/vue 0.0.1300 → 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.
- 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 +2 -2
- 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 +301 -221
- package/dist/index.mjs +302 -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,
|
|
@@ -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
|
-
|
|
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.
|
|
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-
|
|
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$
|
|
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$
|
|
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
|
-
|
|
14762
|
-
|
|
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
|
-
|
|
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:
|
|
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: "
|
|
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
|
|
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)
|
|
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$
|
|
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
|
|
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(() =>
|
|
15891
|
-
const formattedMax2 = computed(() =>
|
|
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$
|
|
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$
|
|
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
|
|
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(() =>
|
|
16411
|
-
const formattedMax = computed(() =>
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
19985
|
+
createElementVNode("span", _hoisted_7$5, toDisplayString(getLabel(option2)), 1)
|
|
19971
19986
|
], 42, _hoisted_6$7);
|
|
19972
19987
|
}), 128))
|
|
19973
19988
|
], 2),
|
|
@@ -27865,11 +27880,12 @@ function parsePhoneNumber() {
|
|
|
27865
27880
|
return withMetadataArgument(parsePhoneNumber$1, arguments);
|
|
27866
27881
|
}
|
|
27867
27882
|
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 =
|
|
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"];
|
|
27873
27889
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
27874
27890
|
__name: "TelInput",
|
|
27875
27891
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -27893,8 +27909,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
27893
27909
|
mode: { default: "INTERNATIONAL" },
|
|
27894
27910
|
onlyCountries: { default: () => [] },
|
|
27895
27911
|
preferredCountries: { default: () => [] },
|
|
27896
|
-
parseArg: {}
|
|
27897
|
-
debounceDelay: { default: 300 }
|
|
27912
|
+
parseArg: {}
|
|
27898
27913
|
}, {
|
|
27899
27914
|
"modelValue": {
|
|
27900
27915
|
default: ""
|
|
@@ -27915,13 +27930,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
27915
27930
|
setup(__props, { emit: __emit }) {
|
|
27916
27931
|
const props2 = __props;
|
|
27917
27932
|
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
|
-
}
|
|
27933
|
+
const open = ref(false);
|
|
27934
|
+
const dropdownOpenDirection = ref("below");
|
|
27925
27935
|
const defaultDropdownOptions = {
|
|
27926
27936
|
hide: false,
|
|
27927
27937
|
disabled: false,
|
|
@@ -27952,52 +27962,169 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
27952
27962
|
...defaultInputOptions,
|
|
27953
27963
|
...props2.inputOptions
|
|
27954
27964
|
}));
|
|
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)
|
|
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
|
+
}
|
|
27973
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;
|
|
27974
28014
|
}
|
|
27975
|
-
|
|
27976
|
-
|
|
27977
|
-
(
|
|
27978
|
-
|
|
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
|
+
}
|
|
27979
28041
|
}
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
|
|
27988
|
-
|
|
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
|
+
}
|
|
27989
28059
|
);
|
|
27990
|
-
return
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
|
|
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
|
+
}
|
|
27998
28108
|
const debouncedEmit = useDebounceFn((maybeFormatted) => {
|
|
27999
28109
|
emit2("debounce", maybeFormatted);
|
|
28000
|
-
}
|
|
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
|
+
}
|
|
28001
28128
|
const phone = useModel(__props, "modelValue", {
|
|
28002
28129
|
set: (value) => {
|
|
28003
28130
|
let maybeFormatted = value;
|
|
@@ -28014,99 +28141,18 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28014
28141
|
},
|
|
28015
28142
|
get: (value) => value
|
|
28016
28143
|
});
|
|
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
28144
|
function onBlur() {
|
|
28093
28145
|
emit2("blur");
|
|
28094
28146
|
}
|
|
28095
28147
|
function onFocus() {
|
|
28096
28148
|
emit2("focus");
|
|
28097
28149
|
}
|
|
28098
|
-
function onEnter(
|
|
28150
|
+
function onEnter() {
|
|
28099
28151
|
emit2("enter");
|
|
28100
28152
|
}
|
|
28101
28153
|
function onSpace() {
|
|
28102
28154
|
emit2("space");
|
|
28103
28155
|
}
|
|
28104
|
-
function reset() {
|
|
28105
|
-
selectedIndex.value = sortedCountries.value.findIndex(
|
|
28106
|
-
(c2) => c2.iso2 === activeCountryCode.value
|
|
28107
|
-
);
|
|
28108
|
-
open.value = false;
|
|
28109
|
-
}
|
|
28110
28156
|
function handleInput(e) {
|
|
28111
28157
|
const keyVal = e.key ?? "";
|
|
28112
28158
|
if (keyVal.length > 1 || e.metaKey) return;
|
|
@@ -28114,6 +28160,14 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28114
28160
|
if (!hasBadChars) return;
|
|
28115
28161
|
e.preventDefault();
|
|
28116
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);
|
|
28117
28171
|
return (_ctx, _cache) => {
|
|
28118
28172
|
return openBlock(), createElementBlock("div", {
|
|
28119
28173
|
class: normalizeClass(["bagel-input", { disabled: _ctx.disabled, [props2.class || ""]: true }])
|
|
@@ -28126,89 +28180,83 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28126
28180
|
tabindex: "-1",
|
|
28127
28181
|
"aria-label": "Country Code Selector",
|
|
28128
28182
|
"aria-haspopup": "listbox",
|
|
28129
|
-
"aria-expanded":
|
|
28183
|
+
"aria-expanded": open.value,
|
|
28130
28184
|
onKeydown: [
|
|
28131
28185
|
withKeys(reset, ["esc"]),
|
|
28132
28186
|
withKeys(reset, ["tab"])
|
|
28133
28187
|
]
|
|
28134
28188
|
}, [
|
|
28135
|
-
|
|
28136
|
-
|
|
28137
|
-
|
|
28138
|
-
ref: phoneDropdown,
|
|
28189
|
+
createVNode(unref(_sfc_main$V), {
|
|
28190
|
+
shown: open.value,
|
|
28191
|
+
"onUpdate:shown": _cache[1] || (_cache[1] = ($event) => open.value = $event),
|
|
28139
28192
|
placement: "bottom-start",
|
|
28140
|
-
disabled: computedDropDownOptions.
|
|
28141
|
-
onHide: _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = false : open = false)
|
|
28193
|
+
disabled: unref(computedDropDownOptions).disabled
|
|
28142
28194
|
}, {
|
|
28143
28195
|
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
|
-
}, [
|
|
28196
|
+
createElementVNode("span", _hoisted_2$e, [
|
|
28148
28197
|
createVNode(unref(Icon), {
|
|
28149
|
-
icon:
|
|
28198
|
+
icon: open.value ? "collapse_all" : "expand_all"
|
|
28150
28199
|
}, null, 8, ["icon"]),
|
|
28151
|
-
computedDropDownOptions.
|
|
28200
|
+
unref(computedDropDownOptions).showFlags && unref(activeCountryCode) ? (openBlock(), createBlock(unref(Flag), {
|
|
28152
28201
|
key: 0,
|
|
28153
28202
|
country: unref(activeCountryCode)
|
|
28154
28203
|
}, null, 8, ["country"])) : createCommentVNode("", true)
|
|
28155
28204
|
])
|
|
28156
28205
|
]),
|
|
28157
28206
|
default: withCtx(() => [
|
|
28158
|
-
createElementVNode("div",
|
|
28207
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
28159
28208
|
_ctx.searchable ? (openBlock(), createBlock(unref(TextInput), {
|
|
28160
28209
|
key: 0,
|
|
28161
|
-
modelValue: searchQuery
|
|
28162
|
-
"onUpdate:modelValue": _cache[
|
|
28210
|
+
modelValue: unref(searchQuery),
|
|
28211
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
28163
28212
|
"aria-label": "Search by country name or country code",
|
|
28164
28213
|
placeholder: "Search",
|
|
28165
28214
|
icon: "search"
|
|
28166
28215
|
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
28167
28216
|
createElementVNode("ul", {
|
|
28168
|
-
class: normalizeClass(["overflow-y p-0", dropdownOpenDirection.value]),
|
|
28169
|
-
style: { "max-height": "400px" },
|
|
28217
|
+
class: normalizeClass(["overflow-y p-0 max-h-300px", dropdownOpenDirection.value]),
|
|
28170
28218
|
role: "listbox"
|
|
28171
28219
|
}, [
|
|
28172
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(sortedCountries
|
|
28220
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(sortedCountries), (pb, index2) => {
|
|
28173
28221
|
return openBlock(), createElementBlock("li", {
|
|
28174
28222
|
key: pb.iso2 + isPreferred(pb),
|
|
28175
28223
|
role: "option",
|
|
28176
28224
|
class: "flex gap-075",
|
|
28177
28225
|
tabindex: "-1",
|
|
28178
28226
|
"aria-selected": unref(activeCountryCode) === pb.iso2 && !isPreferred(pb),
|
|
28179
|
-
onClick: ($event) => chooseCountry(pb.iso2),
|
|
28180
|
-
onMousemove: ($event) =>
|
|
28227
|
+
onClick: ($event) => unref(chooseCountry)(pb.iso2),
|
|
28228
|
+
onMousemove: ($event) => selectedIndex.value = index2
|
|
28181
28229
|
}, [
|
|
28182
|
-
computedDropDownOptions.
|
|
28230
|
+
unref(computedDropDownOptions).showFlags ? (openBlock(), createBlock(unref(Flag), {
|
|
28183
28231
|
key: 0,
|
|
28184
28232
|
country: pb.iso2
|
|
28185
28233
|
}, null, 8, ["country"])) : createCommentVNode("", true),
|
|
28186
|
-
createElementVNode("p",
|
|
28187
|
-
computedDropDownOptions.
|
|
28188
|
-
], 40,
|
|
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);
|
|
28189
28237
|
}), 128))
|
|
28190
28238
|
], 2)
|
|
28191
28239
|
])
|
|
28192
28240
|
]),
|
|
28193
28241
|
_: 1
|
|
28194
|
-
}, 8, ["
|
|
28242
|
+
}, 8, ["shown", "disabled"]),
|
|
28195
28243
|
withDirectives(createElementVNode("input", {
|
|
28196
28244
|
id: _ctx.id,
|
|
28197
|
-
"onUpdate:modelValue": _cache[
|
|
28245
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => phone.value = $event),
|
|
28198
28246
|
required: _ctx.required,
|
|
28199
28247
|
placeholder: props2.placeholder || "Enter a phone number",
|
|
28200
28248
|
disabled: _ctx.disabled,
|
|
28201
28249
|
type: "tel",
|
|
28202
28250
|
autocomplete: _ctx.autocomplete,
|
|
28203
28251
|
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.
|
|
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),
|
|
28212
28260
|
onBlur,
|
|
28213
28261
|
onFocus,
|
|
28214
28262
|
onKeyup: [
|
|
@@ -28216,7 +28264,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28216
28264
|
withKeys(onSpace, ["space"])
|
|
28217
28265
|
],
|
|
28218
28266
|
onKeydown: handleInput
|
|
28219
|
-
}, null, 44,
|
|
28267
|
+
}, null, 44, _hoisted_7$4), [
|
|
28220
28268
|
[vModelText, phone.value]
|
|
28221
28269
|
])
|
|
28222
28270
|
], 40, _hoisted_1$o)
|
|
@@ -28225,7 +28273,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
28225
28273
|
};
|
|
28226
28274
|
}
|
|
28227
28275
|
});
|
|
28228
|
-
const TelInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-
|
|
28276
|
+
const TelInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-a77caf64"]]);
|
|
28229
28277
|
const _hoisted_1$n = ["title"];
|
|
28230
28278
|
const _hoisted_2$d = ["for"];
|
|
28231
28279
|
const _hoisted_3$a = ["id", "title", "autocomplete", "type", "placeholder", "disabled", "required", "pattern"];
|
|
@@ -35429,7 +35477,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
35429
35477
|
};
|
|
35430
35478
|
}
|
|
35431
35479
|
});
|
|
35432
|
-
const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
35480
|
+
const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f204ab99"]]);
|
|
35433
35481
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
35434
35482
|
__name: "Title",
|
|
35435
35483
|
props: {
|
|
@@ -37267,6 +37315,37 @@ function timeAgo(date2, lang = "en") {
|
|
|
37267
37315
|
}
|
|
37268
37316
|
return selectedLang.justNow;
|
|
37269
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
|
+
}
|
|
37270
37349
|
export {
|
|
37271
37350
|
_sfc_main$1m as Accordion,
|
|
37272
37351
|
AccordionItem,
|
|
@@ -37286,7 +37365,7 @@ export {
|
|
|
37286
37365
|
CheckInput,
|
|
37287
37366
|
Checkbox,
|
|
37288
37367
|
CodeEditor,
|
|
37289
|
-
_sfc_main$N as
|
|
37368
|
+
_sfc_main$N as ColorInput,
|
|
37290
37369
|
DataPreview,
|
|
37291
37370
|
DataTable,
|
|
37292
37371
|
DateInput,
|
|
@@ -37357,6 +37436,7 @@ export {
|
|
|
37357
37436
|
copyText,
|
|
37358
37437
|
debounce,
|
|
37359
37438
|
denullify,
|
|
37439
|
+
formatDate,
|
|
37360
37440
|
formatString,
|
|
37361
37441
|
getFallbackSchema,
|
|
37362
37442
|
getNestedValue,
|