bitboss-ui 2.1.105 → 2.1.106
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/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +60 -14
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +10 -3
- package/dist/index.css +1 -1
- package/dist/index109.js +9 -9
- package/dist/index116.js +1 -1
- package/dist/index122.js +4 -4
- package/dist/index124.js +13 -13
- package/dist/index132.js +1 -1
- package/dist/index134.js +5 -5
- package/dist/index136.js +1 -1
- package/dist/index138.js +2 -2
- package/dist/index14.js +1 -1
- package/dist/index141.js +1 -1
- package/dist/index143.js +2 -2
- package/dist/index145.js +1 -1
- package/dist/index16.js +3 -3
- package/dist/index18.js +3 -3
- package/dist/index20.js +8 -8
- package/dist/index218.js +2 -138
- package/dist/index219.js +138 -2
- package/dist/index22.js +14 -14
- package/dist/index220.js +2 -2
- package/dist/index221.js +1 -1
- package/dist/index222.js +1 -1
- package/dist/index223.js +33 -6
- package/dist/index224.js +27 -15
- package/dist/index226.js +5 -5
- package/dist/index227.js +4 -4
- package/dist/index228.js +5 -5
- package/dist/index229.js +5 -3
- package/dist/index230.js +3 -2
- package/dist/index231.js +2 -6
- package/dist/index232.js +6 -8
- package/dist/index233.js +6 -266
- package/dist/index234.js +258 -42
- package/dist/index235.js +44 -44
- package/dist/index236.js +48 -28
- package/dist/index237.js +27 -55
- package/dist/index238.js +59 -12
- package/dist/index239.js +13 -3
- package/dist/index24.js +440 -378
- package/dist/index240.js +86 -33
- package/dist/index242.js +32 -0
- package/dist/index243.js +17 -2
- package/dist/index244.js +51 -2
- package/dist/index245.js +18 -3
- package/dist/index246.js +11 -8
- package/dist/index247.js +17 -12
- package/dist/index248.js +12 -134
- package/dist/index249.js +15 -0
- package/dist/index250.js +3 -23
- package/dist/index251.js +3 -3
- package/dist/index252.js +18 -21
- package/dist/index253.js +2 -33
- package/dist/index254.js +2 -2
- package/dist/index255.js +2 -67
- package/dist/index256.js +3 -2
- package/dist/index257.js +135 -4
- package/dist/index259.js +4 -34
- package/dist/index26.js +3 -3
- package/dist/index260.js +22 -85
- package/dist/index261.js +6 -0
- package/dist/index262.js +3 -30
- package/dist/index263.js +17 -16
- package/dist/index264.js +11 -50
- package/dist/index265.js +106 -18
- package/dist/index267.js +100 -18
- package/dist/index269.js +107 -11
- package/dist/index270.js +2 -5
- package/dist/index271.js +11 -13
- package/dist/index272.js +7 -9
- package/dist/index273.js +6 -373
- package/dist/index274.js +18 -0
- package/dist/index275.js +3 -25
- package/dist/index276.js +9 -4
- package/dist/index277.js +52 -8
- package/dist/index278.js +9 -52
- package/dist/index279.js +2 -187
- package/dist/index28.js +1 -1
- package/dist/index280.js +373 -3
- package/dist/index282.js +7 -16
- package/dist/index283.js +23 -12
- package/dist/index284.js +5 -106
- package/dist/index285.js +69 -0
- package/dist/index286.js +5 -100
- package/dist/index287.js +7 -0
- package/dist/index288.js +5 -107
- package/dist/index289.js +2 -5
- package/dist/index290.js +7 -5
- package/dist/index291.js +7 -5
- package/dist/index292.js +25 -2
- package/dist/index293.js +187 -6
- package/dist/index294.js +3 -7
- package/dist/index295.js +32 -19
- package/dist/index296.js +21 -7
- package/dist/index297.js +32 -9
- package/dist/index298.js +9 -3
- package/dist/index30.js +3 -3
- package/dist/index300.js +3 -7
- package/dist/index301.js +282 -0
- package/dist/index302.js +2 -3
- package/dist/index303.js +16 -3
- package/dist/index304.js +2 -17
- package/dist/index305.js +15 -27
- package/dist/index306.js +2 -719
- package/dist/index307.js +27 -366
- package/dist/index308.js +2 -57
- package/dist/index309.js +2 -5
- package/dist/index310.js +1 -1
- package/dist/index311.js +2 -280
- package/dist/index312.js +2 -2
- package/dist/index313.js +27 -15
- package/dist/index314.js +2 -2
- package/dist/index315.js +7 -16
- package/dist/index316.js +3 -2
- package/dist/index317.js +17 -27
- package/dist/index318.js +4 -2
- package/dist/index319.js +5 -2
- package/dist/index32.js +2 -2
- package/dist/index320.js +3 -2
- package/dist/index321.js +5 -2
- package/dist/index322.js +3 -2
- package/dist/index323.js +3 -2
- package/dist/index324.js +1 -1
- package/dist/index325.js +719 -3
- package/dist/index326.js +366 -4
- package/dist/index327.js +57 -3
- package/dist/index328.js +3 -4
- package/dist/index329.js +2 -3
- package/dist/index330.js +125 -3
- package/dist/index331.js +2 -2
- package/dist/index332.js +14 -5
- package/dist/index333.js +2 -125
- package/dist/index334.js +19 -2
- package/dist/index335.js +2 -15
- package/dist/index336.js +6 -2
- package/dist/index337.js +3 -18
- package/dist/index338.js +2 -2
- package/dist/index339.js +5 -228
- package/dist/index34.js +8 -8
- package/dist/index340.js +7 -67
- package/dist/index341.js +18 -66
- package/dist/index342.js +8 -92
- package/dist/index343.js +15 -5
- package/dist/index344.js +92 -6
- package/dist/index345.js +5 -17
- package/dist/index346.js +67 -9
- package/dist/index347.js +66 -14
- package/dist/index348.js +34 -6
- package/dist/index349.js +6 -35
- package/dist/index350.js +129 -6
- package/dist/index351.js +382 -113
- package/dist/index352.js +198 -396
- package/dist/index353.js +255 -18
- package/dist/index354.js +230 -0
- package/dist/index355.js +21 -133
- package/dist/index357.js +2 -259
- package/dist/index358.js +1 -1
- package/dist/index359.js +134 -2
- package/dist/index36.js +4 -4
- package/dist/index363.js +1 -1
- package/dist/index38.js +20 -20
- package/dist/index40.js +7 -7
- package/dist/index42.js +2 -2
- package/dist/index44.js +8 -8
- package/dist/index46.js +6 -6
- package/dist/index50.js +2 -2
- package/dist/index54.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index58.js +2 -2
- package/dist/index60.js +2 -2
- package/dist/index62.js +5 -5
- package/dist/index68.js +1 -1
- package/dist/index74.js +4 -4
- package/dist/index78.js +13 -11
- package/dist/index82.js +6 -6
- package/dist/index84.js +1 -1
- package/dist/index86.js +2 -2
- package/dist/index88.js +3 -3
- package/dist/index90.js +1 -1
- package/dist/index93.js +3 -3
- package/dist/index95.js +2 -2
- package/dist/index97.js +5 -5
- package/dist/index99.js +1 -1
- package/package.json +1 -1
- package/dist/index225.js +0 -7
- package/dist/index241.js +0 -30
- package/dist/index258.js +0 -22
- package/dist/index266.js +0 -14
- package/dist/index268.js +0 -5
- package/dist/index281.js +0 -5
- package/dist/index299.js +0 -7
- package/dist/index356.js +0 -202
package/dist/index24.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _config as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useMobile as
|
|
14
|
-
import
|
|
15
|
-
import He from "./index22.js";
|
|
1
|
+
import { defineComponent as Ke, watchEffect as Ue, ref as F, computed as _, watch as pe, onBeforeUnmount as Ge, createBlock as Je, openBlock as E, normalizeClass as O, withCtx as w, createElementVNode as V, createVNode as X, unref as x, createElementBlock as R, createCommentVNode as ee, toDisplayString as q, Fragment as ge, renderList as Ze, withModifiers as Qe, renderSlot as B, mergeProps as Xe } from "vue";
|
|
2
|
+
import { _config as be } from "./index4.js";
|
|
3
|
+
import b from "./index226.js";
|
|
4
|
+
import et from "./index286.js";
|
|
5
|
+
import ve from "./index287.js";
|
|
6
|
+
import tt from "./index227.js";
|
|
7
|
+
import at from "./index228.js";
|
|
8
|
+
import nt from "./index288.js";
|
|
9
|
+
import { isEmpty as rt } from "./index262.js";
|
|
10
|
+
import { useId as ot } from "./index8.js";
|
|
11
|
+
import { useLocale as it } from "./index239.js";
|
|
12
|
+
import { useLogger as lt } from "./index233.js";
|
|
13
|
+
import { useMobile as st } from "./index9.js";
|
|
14
|
+
import ut from "./index22.js";
|
|
16
15
|
/* empty css */
|
|
17
|
-
import
|
|
16
|
+
import dt from "./index138.js";
|
|
18
17
|
/* empty css */
|
|
19
|
-
import
|
|
20
|
-
import
|
|
18
|
+
import ct from "./index140.js";
|
|
19
|
+
import ft from "./index257.js";
|
|
21
20
|
/* empty css */
|
|
22
|
-
const
|
|
21
|
+
const mt = { class: "bb-base-date-picker-input__inner-wrapper" }, pt = ["id", "aria-invalid", "aria-label", "autocomplete", "autofocus", "disabled", "inputmode", "maxlength", "name", "readonly", "required", "tabindex", "value", "onBlur", "onFocus", "onInput", "onKeydown", "onPaste"], gt = ["onClick"], bt = ["aria-label", "aria-expanded", "disabled"], vt = ["inert"], D = "YYYY-MM-DD", xt = /* @__PURE__ */ Ke({
|
|
23
22
|
__name: "BaseDatePickerInput",
|
|
24
23
|
props: {
|
|
25
24
|
allowWriting: { type: [Boolean, String], default: !0 },
|
|
@@ -44,491 +43,554 @@ const ze = { class: "bb-base-date-picker-input__inner-wrapper" }, Ge = ["id", "a
|
|
|
44
43
|
readonly: { type: Boolean },
|
|
45
44
|
required: { type: Boolean },
|
|
46
45
|
selectable: {},
|
|
46
|
+
hidePopover: { type: [Boolean, String] },
|
|
47
47
|
transitionDuration: {}
|
|
48
48
|
},
|
|
49
49
|
emits: ["active", "error", "focus", "inactive", "update:modelValue"],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
setup(ye, { emit: he }) {
|
|
51
|
+
const ke = { it: nt, en: ve };
|
|
52
|
+
b.extend(et), b.extend(tt), b.extend(at), Ue(() => {
|
|
53
|
+
b.locale(ke[be.locale] ?? ve);
|
|
54
54
|
});
|
|
55
|
-
const n =
|
|
56
|
-
() => !!n.readonly ||
|
|
57
|
-
),
|
|
55
|
+
const n = ye, f = he, { t: S } = it(), C = lt(), te = F(null), j = F(null), ae = F(null), ne = F(null), A = n.id || `bdpi-${ot().id.value}`, re = `bdpi-description_${A}`, oe = `bdpi-calendar_${A}`, { isMobile: ie } = st(), le = _(() => n.allowWriting === "not-mobile" ? !ie.value : !!n.allowWriting), se = _(() => n.hidePopover === "not-mobile" ? !ie.value : !!n.hidePopover), De = _(
|
|
56
|
+
() => !!n.readonly || !le.value
|
|
57
|
+
), _e = _(() => le.value ? "numeric" : "none"), Ve = _(() => ({
|
|
58
58
|
"bb-base-date-picker-input": !0,
|
|
59
|
-
"bb-base-date-picker-input--active":
|
|
59
|
+
"bb-base-date-picker-input--active": T.value,
|
|
60
60
|
"bb-base-date-picker-input--errors": n.hasErrors,
|
|
61
61
|
"bb-base-date-picker-input--loading": n.loading,
|
|
62
62
|
"bb-base-date-picker-input--readonly": n.readonly,
|
|
63
63
|
"bb-base-date-picker-input--disabled": n.disabled,
|
|
64
|
-
"bb-base-date-picker-input--compact": n.compact
|
|
64
|
+
"bb-base-date-picker-input--compact": n.compact,
|
|
65
|
+
"bb-base-date-picker-input--range": n.range
|
|
65
66
|
}));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const a = c(e, K, !0);
|
|
73
|
-
return a.isValid() ? a : null;
|
|
74
|
-
}, me = {
|
|
75
|
-
onInput: (e) => {
|
|
76
|
-
if (n.range) return;
|
|
77
|
-
const a = e.target;
|
|
78
|
-
if (!(a instanceof HTMLInputElement)) return;
|
|
79
|
-
if (D.value = a.value, a.value === "") {
|
|
80
|
-
m("update:modelValue", null);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const t = ce(a.value);
|
|
84
|
-
if (t) {
|
|
85
|
-
if (Q(t)) {
|
|
86
|
-
a.value = "", D.value = "", m("update:modelValue", null), m("error", "invalid_date_typed");
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
m("update:modelValue", C(t));
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
onFocus: (e) => m("focus", e)
|
|
93
|
-
}, E = y(!1), fe = () => {
|
|
94
|
-
E.value || (m("active"), E.value = !0, document.addEventListener("focusin", $), document.addEventListener("click", $));
|
|
95
|
-
}, $ = (e) => {
|
|
96
|
-
const a = e.target;
|
|
97
|
-
a instanceof HTMLElement && B.value?.$el && (B.value.$el.contains(a) || z.value?.contains(a) || (De(), E.value = !1, m("inactive"), document.removeEventListener("focusin", $), document.removeEventListener("click", $)));
|
|
98
|
-
}, L = (e) => {
|
|
99
|
-
if (!e) return null;
|
|
100
|
-
if (Array.isArray(e)) {
|
|
101
|
-
const [t, r] = e, i = [t, r].filter(Re).map((u) => {
|
|
102
|
-
const d = S(u);
|
|
103
|
-
return d.isValid() ? d.format(K) : "";
|
|
104
|
-
}).filter(Boolean);
|
|
105
|
-
return i.length ? i.join(" - ") : null;
|
|
106
|
-
}
|
|
107
|
-
const a = S(e);
|
|
108
|
-
return a.isValid() ? a.format(K) : null;
|
|
109
|
-
}, ve = h(() => D.value !== null ? D.value : L(n.modelValue));
|
|
110
|
-
N(
|
|
111
|
-
() => n.modelValue,
|
|
112
|
-
(e) => {
|
|
113
|
-
D.value = L(e);
|
|
114
|
-
}
|
|
67
|
+
n.min && (b(n.min, D, !0).isValid() || C.throw("BaseDatePickerInput: min must be in the format YYYY-MM-DD")), n.max && (b(n.max, D, !0).isValid() || C.throw("BaseDatePickerInput: max must be in the format YYYY-MM-DD"));
|
|
68
|
+
const Se = n.allowWriting !== !1, Ye = n.hidePopover !== !0, we = n.allowWriting === !0, Me = n.hidePopover !== !0 && n.hidePopover !== "not-mobile";
|
|
69
|
+
!Se && !Ye && C.throw(
|
|
70
|
+
"BaseDatePickerInput: desktop users would have no interaction method — allowWriting:false and hidePopover:true cannot be combined."
|
|
71
|
+
), !we && !Me && C.throw(
|
|
72
|
+
'BaseDatePickerInput: mobile users would have no interaction method — combine allowWriting:"not-mobile" with hidePopover:"not-mobile" to allow the calendar in mobile while still hiding the virtual keyboard.'
|
|
115
73
|
);
|
|
116
|
-
const b =
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
74
|
+
const p = (e) => n.floating ? e.format(D) : e.toISOString(), z = (e) => n.floating ? b(e, D, !0) : b(e), T = F(!1), $e = () => {
|
|
75
|
+
T.value || (f("active"), T.value = !0, document.addEventListener("focusin", I), document.addEventListener("click", I));
|
|
76
|
+
}, I = (e) => {
|
|
77
|
+
const t = e.target;
|
|
78
|
+
t instanceof HTMLElement && j.value?.$el && (j.value.$el.contains(t) || te.value?.contains(t) || (ze(), T.value = !1, f("inactive"), document.removeEventListener("focusin", I), document.removeEventListener("click", I)));
|
|
79
|
+
}, Y = F(!1), K = (e) => {
|
|
80
|
+
const t = e.target;
|
|
81
|
+
t && t instanceof HTMLDialogElement && (Y.value = !1);
|
|
82
|
+
}, Fe = () => {
|
|
83
|
+
n.disabled || n.readonly || se.value || (Y.value = !0);
|
|
121
84
|
};
|
|
122
|
-
|
|
123
|
-
e ? document.addEventListener("click",
|
|
85
|
+
pe(Y, (e) => {
|
|
86
|
+
e ? document.addEventListener("click", K, { passive: !0 }) : (ne.value?.resetStatus(), document.removeEventListener("click", K));
|
|
124
87
|
});
|
|
125
|
-
const
|
|
88
|
+
const Ie = (e) => n.range ? Array.isArray(e) && e.length === 2 : !!e, Pe = {
|
|
126
89
|
"onUpdate:modelValue": (e) => {
|
|
127
|
-
|
|
90
|
+
f("update:modelValue", e), Ie(e) && (Y.value = !1);
|
|
128
91
|
}
|
|
129
|
-
},
|
|
92
|
+
}, Ee = _(() => {
|
|
130
93
|
if (n.range) {
|
|
131
|
-
const e = Array.isArray(n.modelValue) ? n.modelValue : [], [
|
|
132
|
-
if (!
|
|
133
|
-
const r =
|
|
134
|
-
return !r.isValid() || !i.isValid() ?
|
|
94
|
+
const e = Array.isArray(n.modelValue) ? n.modelValue : [], [t, a] = e;
|
|
95
|
+
if (!t || !a) return S("baseDatePickerInput.emptyRange").value;
|
|
96
|
+
const r = z(t), i = z(a);
|
|
97
|
+
return !r.isValid() || !i.isValid() ? S("baseDatePickerInput.emptyRange").value : S(
|
|
135
98
|
"baseDatePickerInput.changeSelectionRange",
|
|
136
99
|
r.format("D MMMM YYYY"),
|
|
137
100
|
i.format("D MMMM YYYY")
|
|
138
101
|
).value;
|
|
139
102
|
}
|
|
140
103
|
if (typeof n.modelValue == "string") {
|
|
141
|
-
const e =
|
|
142
|
-
return e.isValid() ?
|
|
104
|
+
const e = z(n.modelValue);
|
|
105
|
+
return e.isValid() ? S(
|
|
143
106
|
"baseDatePickerInput.changeSelection",
|
|
144
107
|
e.format("D MMMM YYYY")
|
|
145
|
-
).value :
|
|
108
|
+
).value : S("baseDatePickerInput.emptySelection").value;
|
|
146
109
|
}
|
|
147
|
-
return
|
|
148
|
-
}),
|
|
110
|
+
return S("baseDatePickerInput.emptySelection").value;
|
|
111
|
+
}), N = (e) => {
|
|
149
112
|
if (!e.isValid()) return !0;
|
|
150
|
-
let
|
|
113
|
+
let t = !0;
|
|
151
114
|
if (n.min) {
|
|
152
|
-
const
|
|
153
|
-
|
|
115
|
+
const a = b(n.min, D, !0);
|
|
116
|
+
t &&= e.isSameOrAfter(a);
|
|
154
117
|
}
|
|
155
118
|
if (n.max) {
|
|
156
|
-
const
|
|
157
|
-
|
|
119
|
+
const a = b(n.max, D, !0);
|
|
120
|
+
t &&= e.isSameOrBefore(a);
|
|
158
121
|
}
|
|
159
|
-
return typeof n.selectable == "function" && (
|
|
160
|
-
},
|
|
161
|
-
n.range ?
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
122
|
+
return typeof n.selectable == "function" && (t &&= n.selectable(p(e))), !t;
|
|
123
|
+
}, Be = () => {
|
|
124
|
+
n.range ? f("update:modelValue", []) : f("update:modelValue", null);
|
|
125
|
+
}, W = (e) => `${e.segment}.${e.field}`, Ce = _(() => be.locale === "en" ? ["month", "day", "year"] : ["day", "month", "year"]), u = _(() => {
|
|
126
|
+
const e = Ce.value, t = e.map((r) => ({
|
|
127
|
+
segment: "start",
|
|
128
|
+
field: r
|
|
129
|
+
}));
|
|
130
|
+
if (!n.range) return t;
|
|
131
|
+
const a = e.map((r) => ({
|
|
132
|
+
segment: "end",
|
|
133
|
+
field: r
|
|
134
|
+
}));
|
|
135
|
+
return [...t, ...a];
|
|
136
|
+
}), y = () => ({
|
|
167
137
|
day: "",
|
|
168
138
|
month: "",
|
|
169
139
|
year: ""
|
|
170
|
-
}),
|
|
171
|
-
|
|
172
|
-
|
|
140
|
+
}), l = F({
|
|
141
|
+
start: y(),
|
|
142
|
+
end: y()
|
|
143
|
+
}), L = {}, Ae = (e) => {
|
|
144
|
+
for (const t in L)
|
|
145
|
+
if (L[t] === e) return !0;
|
|
146
|
+
return !1;
|
|
147
|
+
}, Le = (e) => n.range ? `${A}-${e.segment}-${e.field}` : `${A}-${e.field}`, Oe = (e) => {
|
|
148
|
+
if (n.name)
|
|
149
|
+
return n.range ? `${n.name}-${e.segment}-${e.field}` : `${n.name}-${e.field}`;
|
|
150
|
+
}, xe = (e) => {
|
|
151
|
+
const t = {
|
|
152
|
+
day: "Day",
|
|
153
|
+
month: "Month",
|
|
154
|
+
year: "Year"
|
|
155
|
+
};
|
|
156
|
+
return n.range ? `${e.segment === "start" ? "Start" : "End"} ${t[e.field].toLowerCase()}` : t[e.field];
|
|
157
|
+
}, Re = _(() => n.placeholder ? n.placeholder : n.range ? "DD/MM/YYYY – DD/MM/YYYY" : "DD/MM/YYYY"), ue = _(() => {
|
|
158
|
+
const e = l.value.start, t = !e.day && !e.month && !e.year;
|
|
159
|
+
if (!n.range) return t;
|
|
160
|
+
const a = l.value.end, r = !a.day && !a.month && !a.year;
|
|
161
|
+
return t && r;
|
|
162
|
+
}), U = (e) => {
|
|
163
|
+
if (!e) return y();
|
|
164
|
+
const t = z(e);
|
|
165
|
+
return t.isValid() ? {
|
|
166
|
+
day: t.format("DD"),
|
|
167
|
+
month: t.format("MM"),
|
|
168
|
+
year: t.format("YYYY")
|
|
169
|
+
} : y();
|
|
170
|
+
}, H = (e) => {
|
|
171
|
+
if (!e) {
|
|
172
|
+
l.value = { start: y(), end: y() };
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
l.value = {
|
|
175
|
+
if (n.range) {
|
|
176
|
+
const t = Array.isArray(e) ? e : [], [a, r] = t;
|
|
177
|
+
l.value = {
|
|
178
|
+
start: U(a),
|
|
179
|
+
end: U(r)
|
|
180
|
+
};
|
|
178
181
|
return;
|
|
179
182
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
month: a.format("MM"),
|
|
183
|
-
year: a.format("YYYY")
|
|
184
|
-
};
|
|
185
|
-
}, De = () => {
|
|
186
|
-
if (n.range) {
|
|
187
|
-
D.value = L(n.modelValue);
|
|
183
|
+
if (Array.isArray(e)) {
|
|
184
|
+
l.value = { start: y(), end: y() };
|
|
188
185
|
return;
|
|
189
186
|
}
|
|
190
|
-
|
|
187
|
+
l.value = {
|
|
188
|
+
start: U(e),
|
|
189
|
+
end: y()
|
|
190
|
+
};
|
|
191
|
+
}, ze = () => {
|
|
192
|
+
H(n.modelValue);
|
|
191
193
|
};
|
|
192
|
-
|
|
194
|
+
H(n.modelValue), pe(
|
|
193
195
|
() => n.modelValue,
|
|
194
196
|
(e) => {
|
|
195
197
|
if (e === null || Array.isArray(e) && e.length === 0) {
|
|
196
|
-
|
|
198
|
+
H(e);
|
|
197
199
|
return;
|
|
198
200
|
}
|
|
199
|
-
document.activeElement
|
|
200
|
-
|
|
201
|
-
) || w(e);
|
|
201
|
+
const t = document.activeElement;
|
|
202
|
+
t && Ae(t) || H(e);
|
|
202
203
|
}
|
|
203
204
|
);
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
205
|
+
const $ = (e, t = {}) => {
|
|
206
|
+
const a = L[W(e)];
|
|
207
|
+
a && (a.focus(), t.select ? a.select() : t.caretToEnd ? a.setSelectionRange(a.value.length, a.value.length) : t.caretToStart && a.setSelectionRange(0, 0));
|
|
208
|
+
}, Te = () => {
|
|
209
|
+
$(u.value[0]);
|
|
210
|
+
}, P = (e) => u.value.findIndex(
|
|
211
|
+
(t) => t.segment === e.segment && t.field === e.field
|
|
212
|
+
), de = (e) => {
|
|
213
|
+
const t = P(e);
|
|
214
|
+
t < u.value.length - 1 && $(u.value[t + 1], { select: !0 });
|
|
215
|
+
}, ce = (e) => {
|
|
216
|
+
const t = P(e);
|
|
217
|
+
t > 0 && $(u.value[t - 1], { caretToEnd: !0 });
|
|
218
|
+
}, fe = (e) => {
|
|
219
|
+
const t = l.value[e];
|
|
220
|
+
return (t.day ? 1 : 0) + (t.month ? 1 : 0) + (t.year ? 1 : 0) === 0 ? "empty" : t.day && t.month && t.year && t.year.length === 4 ? "complete" : "partial";
|
|
221
|
+
}, G = (e) => {
|
|
222
|
+
const t = l.value[e];
|
|
223
|
+
if (!t.day || !t.month || !t.year) return null;
|
|
224
|
+
const a = parseInt(t.day, 10), r = parseInt(t.month, 10), i = parseInt(t.year, 10);
|
|
225
|
+
if (a < 1 || a > 31 || r < 1 || r > 12 || i < 1e3 || i > 9999)
|
|
226
|
+
return null;
|
|
227
|
+
const o = t.year.padStart(4, "0"), d = t.month.padStart(2, "0"), v = t.day.padStart(2, "0"), m = `${o}-${d}-${v}`;
|
|
228
|
+
let c = b(m, D, !0);
|
|
229
|
+
if (!c.isValid()) {
|
|
230
|
+
const M = b(
|
|
231
|
+
`${o}-${d}-01`,
|
|
232
|
+
D,
|
|
233
|
+
!0
|
|
234
|
+
).endOf("month").date(), s = Math.min(a, M), g = `${o}-${d}-${String(s).padStart(2, "0")}`;
|
|
235
|
+
c = b(g, D, !0), l.value[e].day = String(s).padStart(2, "0");
|
|
216
236
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
237
|
+
return c.isValid() ? c : null;
|
|
238
|
+
}, J = (e) => ({
|
|
239
|
+
day: e.format("DD"),
|
|
240
|
+
month: e.format("MM"),
|
|
241
|
+
year: e.format("YYYY")
|
|
242
|
+
}), Z = (e) => {
|
|
243
|
+
let t = e;
|
|
244
|
+
if (n.min) {
|
|
245
|
+
const a = b(n.min, D, !0);
|
|
246
|
+
t.isBefore(a, "day") && (t = a);
|
|
247
|
+
}
|
|
248
|
+
if (n.max) {
|
|
249
|
+
const a = b(n.max, D, !0);
|
|
250
|
+
t.isAfter(a, "day") && (t = a);
|
|
251
|
+
}
|
|
252
|
+
return t.isSame(e, "day") || N(t) ? null : t;
|
|
253
|
+
}, k = (e) => {
|
|
254
|
+
C.warn(
|
|
255
|
+
`[${e.code}] original: ${JSON.stringify(e.original)} → normalized: ${JSON.stringify(e.normalized)}`
|
|
256
|
+
), f("error", e);
|
|
257
|
+
}, Q = () => {
|
|
258
|
+
const e = fe("start");
|
|
259
|
+
if (!n.range) {
|
|
260
|
+
if (e === "empty") {
|
|
261
|
+
f("update:modelValue", null);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (e === "partial") return;
|
|
265
|
+
const s = G("start");
|
|
266
|
+
if (!s) return;
|
|
267
|
+
if (N(s)) {
|
|
268
|
+
const g = p(s), h = Z(s);
|
|
269
|
+
if (h) {
|
|
270
|
+
const me = p(h);
|
|
271
|
+
l.value.start = J(h), f("update:modelValue", me), k({ code: "disabled_date", original: g, normalized: me });
|
|
272
|
+
} else
|
|
273
|
+
l.value.start = y(), f("update:modelValue", null), k({ code: "disabled_date", original: g, normalized: null });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
f("update:modelValue", p(s));
|
|
221
277
|
return;
|
|
222
|
-
const d = `${t.padStart(4, "0")}-${a.padStart(2, "0")}-${e.padStart(2, "0")}`;
|
|
223
|
-
let M = c(d, k, !0);
|
|
224
|
-
if (!M.isValid()) {
|
|
225
|
-
const Se = c(
|
|
226
|
-
`${t.padStart(4, "0")}-${a.padStart(2, "0")}-01`,
|
|
227
|
-
k,
|
|
228
|
-
!0
|
|
229
|
-
).endOf("month").date(), ee = Math.min(r, Se), $e = `${t.padStart(4, "0")}-${a.padStart(2, "0")}-${String(ee).padStart(2, "0")}`;
|
|
230
|
-
M = c($e, k, !0), l.value.day = String(ee).padStart(2, "0");
|
|
231
278
|
}
|
|
232
|
-
|
|
233
|
-
|
|
279
|
+
const t = fe("end");
|
|
280
|
+
if (e === "empty" && t === "empty") {
|
|
281
|
+
f("update:modelValue", null);
|
|
234
282
|
return;
|
|
235
283
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
284
|
+
if (e === "partial" || t === "partial" || e === "empty") return;
|
|
285
|
+
const a = G("start");
|
|
286
|
+
if (!a) return;
|
|
287
|
+
const r = t !== "empty" ? G("end") : null, i = p(a), o = r ? p(r) : null;
|
|
288
|
+
let d = a, v = !1;
|
|
289
|
+
if (N(a)) {
|
|
290
|
+
const s = Z(a), g = o ? [i, o] : [i];
|
|
291
|
+
if (!s) {
|
|
292
|
+
l.value.start = y(), l.value.end = y(), f("update:modelValue", null), k({ code: "disabled_range_start", original: g, normalized: null });
|
|
293
|
+
return;
|
|
244
294
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
295
|
+
if (d = s, v = !0, l.value.start = J(s), !r) {
|
|
296
|
+
const h = [p(s)];
|
|
297
|
+
f("update:modelValue", h), k({ code: "disabled_range_start", original: g, normalized: h });
|
|
298
|
+
return;
|
|
249
299
|
}
|
|
250
|
-
} else e === "year" && (r = r.slice(0, 4));
|
|
251
|
-
l.value[e] = r, t.value = r;
|
|
252
|
-
const i = e === "year" ? 4 : 2;
|
|
253
|
-
let u = r.length === i;
|
|
254
|
-
if (!u && r.length === 1) {
|
|
255
|
-
const d = parseInt(r, 10);
|
|
256
|
-
(e === "day" && d >= 4 || e === "month" && d >= 2) && (r = r.padStart(2, "0"), l.value[e] = r, t.value = r, u = !0);
|
|
257
300
|
}
|
|
258
|
-
if (
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const M = o.value[d + 1];
|
|
262
|
-
s[M]?.focus(), s[M]?.select();
|
|
263
|
-
}
|
|
301
|
+
if (!r) {
|
|
302
|
+
f("update:modelValue", [p(d)]);
|
|
303
|
+
return;
|
|
264
304
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
305
|
+
let m = r, c = !1;
|
|
306
|
+
if (N(r)) {
|
|
307
|
+
const s = Z(r), g = [i, o];
|
|
308
|
+
if (!s) {
|
|
309
|
+
const h = [p(d)];
|
|
310
|
+
l.value.end = y(), f("update:modelValue", h), v && k({
|
|
311
|
+
code: "disabled_range_start",
|
|
312
|
+
original: g,
|
|
313
|
+
normalized: h
|
|
314
|
+
}), k({ code: "disabled_range_end", original: g, normalized: h });
|
|
315
|
+
return;
|
|
272
316
|
}
|
|
317
|
+
m = s, c = !0, l.value.end = J(s);
|
|
318
|
+
}
|
|
319
|
+
if (m.isBefore(d, "day")) {
|
|
320
|
+
const s = [
|
|
321
|
+
p(d),
|
|
322
|
+
p(m)
|
|
323
|
+
], g = [
|
|
324
|
+
p(m),
|
|
325
|
+
p(d)
|
|
326
|
+
], h = { ...l.value.start };
|
|
327
|
+
l.value.start = { ...l.value.end }, l.value.end = h, f("update:modelValue", g), v && k({
|
|
328
|
+
code: "disabled_range_start",
|
|
329
|
+
original: [i, o],
|
|
330
|
+
normalized: g
|
|
331
|
+
}), c && k({
|
|
332
|
+
code: "disabled_range_end",
|
|
333
|
+
original: [i, o],
|
|
334
|
+
normalized: g
|
|
335
|
+
}), k({ code: "end_before_start", original: s, normalized: g });
|
|
273
336
|
return;
|
|
274
337
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
338
|
+
const M = [
|
|
339
|
+
p(d),
|
|
340
|
+
p(m)
|
|
341
|
+
];
|
|
342
|
+
f("update:modelValue", M), v && k({
|
|
343
|
+
code: "disabled_range_start",
|
|
344
|
+
original: o ? [i, o] : [i],
|
|
345
|
+
normalized: M
|
|
346
|
+
}), c && k({
|
|
347
|
+
code: "disabled_range_end",
|
|
348
|
+
original: [i, o],
|
|
349
|
+
normalized: M
|
|
350
|
+
});
|
|
351
|
+
}, Ne = (e, t) => {
|
|
352
|
+
const { segment: a, field: r } = e, i = t.target;
|
|
353
|
+
let o = i.value.replace(/\D/g, "");
|
|
354
|
+
const d = l.value[a][r];
|
|
355
|
+
if (r === "day") {
|
|
356
|
+
if (o.length > 0) {
|
|
357
|
+
const c = parseInt(o, 10);
|
|
358
|
+
(o === "00" || c > 31) && (o = d);
|
|
359
|
+
}
|
|
360
|
+
} else if (r === "month") {
|
|
361
|
+
if (o.length > 0) {
|
|
362
|
+
const c = parseInt(o, 10);
|
|
363
|
+
(o === "00" || c > 12) && (o = d);
|
|
285
364
|
}
|
|
365
|
+
} else r === "year" && (o = o.slice(0, 4));
|
|
366
|
+
l.value[a][r] = o, i.value = o;
|
|
367
|
+
const v = r === "year" ? 4 : 2;
|
|
368
|
+
let m = o.length === v;
|
|
369
|
+
if (!m && o.length === 1) {
|
|
370
|
+
const c = parseInt(o, 10);
|
|
371
|
+
(r === "day" && c >= 4 || r === "month" && c >= 2) && (o = o.padStart(2, "0"), l.value[a][r] = o, i.value = o, m = !0);
|
|
372
|
+
}
|
|
373
|
+
m && de(e), Q();
|
|
374
|
+
}, We = (e, t) => {
|
|
375
|
+
const a = t.target;
|
|
376
|
+
if (t.key === "/" || t.key === "-" || t.key === " ") {
|
|
377
|
+
t.preventDefault();
|
|
378
|
+
const r = l.value[e.segment][e.field];
|
|
379
|
+
e.field !== "year" && r.length === 1 && (r === "0" ? l.value[e.segment][e.field] = "" : l.value[e.segment][e.field] = r.padStart(
|
|
380
|
+
2,
|
|
381
|
+
"0"
|
|
382
|
+
)), de(e);
|
|
286
383
|
return;
|
|
287
384
|
}
|
|
288
|
-
if (
|
|
289
|
-
|
|
290
|
-
a.preventDefault();
|
|
291
|
-
const i = o.value[r - 1];
|
|
292
|
-
s[i]?.focus();
|
|
293
|
-
const u = s[i];
|
|
294
|
-
u && u.setSelectionRange(
|
|
295
|
-
u.value.length,
|
|
296
|
-
u.value.length
|
|
297
|
-
);
|
|
298
|
-
}
|
|
385
|
+
if (t.key === "Backspace" && a.selectionStart === 0 && a.selectionEnd === 0) {
|
|
386
|
+
P(e) > 0 && (t.preventDefault(), ce(e));
|
|
299
387
|
return;
|
|
300
388
|
}
|
|
301
|
-
if (
|
|
302
|
-
|
|
303
|
-
a.preventDefault();
|
|
304
|
-
const i = o.value[r + 1];
|
|
305
|
-
s[i]?.focus(), s[i]?.setSelectionRange(0, 0);
|
|
306
|
-
}
|
|
389
|
+
if (t.key === "ArrowLeft" && a.selectionStart === 0) {
|
|
390
|
+
P(e) > 0 && (t.preventDefault(), ce(e));
|
|
307
391
|
return;
|
|
308
392
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
requestAnimationFrame(() => {
|
|
313
|
-
s[t]?.focus();
|
|
314
|
-
});
|
|
393
|
+
if (t.key === "ArrowRight" && a.selectionStart === a.value.length) {
|
|
394
|
+
const r = P(e);
|
|
395
|
+
r < u.value.length - 1 && (t.preventDefault(), $(u.value[r + 1], { caretToStart: !0 }));
|
|
315
396
|
return;
|
|
316
397
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
398
|
+
}, He = (e) => {
|
|
399
|
+
const t = u.value[0];
|
|
400
|
+
if (u.value.every(
|
|
401
|
+
(i) => !l.value[i.segment][i.field]
|
|
402
|
+
) && (e.segment !== t.segment || e.field !== t.field)) {
|
|
403
|
+
requestAnimationFrame(() => $(t));
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const r = L[W(e)];
|
|
407
|
+
r && r.value && requestAnimationFrame(() => r.select());
|
|
408
|
+
}, qe = (e) => {
|
|
409
|
+
const { segment: t, field: a } = e;
|
|
410
|
+
if (a === "day" || a === "month") {
|
|
411
|
+
const r = l.value[t][a];
|
|
412
|
+
r && r.length === 1 && (r === "0" ? l.value[t][a] = "" : l.value[t][a] = r.padStart(2, "0"));
|
|
413
|
+
}
|
|
414
|
+
Q();
|
|
415
|
+
}, je = (e, t) => {
|
|
416
|
+
const r = (t.clipboardData?.getData("text") ?? "").replace(/\D/g, "");
|
|
417
|
+
if (r.length < 2) return;
|
|
418
|
+
t.preventDefault();
|
|
419
|
+
const i = P(e);
|
|
420
|
+
let o = 0, d = null;
|
|
421
|
+
for (let v = i; v < u.value.length && o < r.length; v++) {
|
|
422
|
+
const m = u.value[v], c = m.field === "year" ? 4 : 2, M = r.slice(o, o + c);
|
|
423
|
+
if (!M) break;
|
|
424
|
+
l.value[m.segment][m.field] = M, d = m, o += c;
|
|
425
|
+
}
|
|
426
|
+
if (d) {
|
|
427
|
+
const v = d;
|
|
428
|
+
requestAnimationFrame(() => $(v, { caretToEnd: !0 }));
|
|
429
|
+
}
|
|
430
|
+
Q();
|
|
323
431
|
};
|
|
324
|
-
return
|
|
325
|
-
document.removeEventListener("focusin",
|
|
326
|
-
}), (e,
|
|
432
|
+
return Ge(() => {
|
|
433
|
+
document.removeEventListener("focusin", I), document.removeEventListener("click", I), document.removeEventListener("click", K);
|
|
434
|
+
}), (e, t) => (E(), Je(ct, {
|
|
327
435
|
ref_key: "outerContainer",
|
|
328
|
-
ref:
|
|
329
|
-
class:
|
|
330
|
-
onFocusin:
|
|
436
|
+
ref: j,
|
|
437
|
+
class: O(Ve.value),
|
|
438
|
+
onFocusin: $e
|
|
331
439
|
}, {
|
|
332
|
-
"prepend-outer":
|
|
333
|
-
|
|
440
|
+
"prepend-outer": w(() => [
|
|
441
|
+
B(e.$slots, "prepend-outer")
|
|
334
442
|
]),
|
|
335
|
-
"append-outer":
|
|
336
|
-
|
|
443
|
+
"append-outer": w(() => [
|
|
444
|
+
B(e.$slots, "append-outer")
|
|
337
445
|
]),
|
|
338
|
-
default:
|
|
339
|
-
|
|
340
|
-
|
|
446
|
+
default: w(() => [
|
|
447
|
+
V("div", mt, [
|
|
448
|
+
X(dt, {
|
|
341
449
|
ref_key: "innerContainer",
|
|
342
|
-
ref:
|
|
450
|
+
ref: ae,
|
|
343
451
|
"append:icon": n["append:icon"],
|
|
344
|
-
clearable: n.clearable && !
|
|
452
|
+
clearable: n.clearable && !x(rt)(e.modelValue),
|
|
345
453
|
"prepend:icon": n["prepend:icon"],
|
|
346
|
-
"onClick:clear":
|
|
454
|
+
"onClick:clear": Be
|
|
347
455
|
}, {
|
|
348
|
-
prepend:
|
|
349
|
-
|
|
456
|
+
prepend: w(() => [
|
|
457
|
+
B(e.$slots, "prepend")
|
|
350
458
|
]),
|
|
351
|
-
prefix:
|
|
352
|
-
|
|
459
|
+
prefix: w(() => [
|
|
460
|
+
B(e.$slots, "prefix")
|
|
353
461
|
]),
|
|
354
|
-
append:
|
|
355
|
-
|
|
462
|
+
append: w(() => [
|
|
463
|
+
B(e.$slots, "append")
|
|
356
464
|
]),
|
|
357
|
-
suffix:
|
|
358
|
-
|
|
465
|
+
suffix: w(() => [
|
|
466
|
+
B(e.$slots, "suffix")
|
|
359
467
|
]),
|
|
360
|
-
default:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
ref: ue,
|
|
366
|
-
"aria-describedby": I,
|
|
367
|
-
"aria-invalid": n.hasErrors ? "true" : void 0,
|
|
368
|
-
autocomplete: e.autocomplete,
|
|
369
|
-
autofocus: e.autofocus,
|
|
370
|
-
"data-maska": "##/##/#### - ##/##/####",
|
|
371
|
-
disabled: e.disabled,
|
|
372
|
-
inputmode: de.value,
|
|
373
|
-
name: e.name,
|
|
374
|
-
placeholder: e.placeholder,
|
|
375
|
-
readonly: F.value,
|
|
376
|
-
required: e.required
|
|
377
|
-
}, me, {
|
|
378
|
-
size: "1",
|
|
379
|
-
type: "text",
|
|
380
|
-
value: ve.value
|
|
381
|
-
}), null, 16, Je)), [
|
|
382
|
-
[f(_e)]
|
|
383
|
-
]) : (A(), W("div", {
|
|
384
|
-
key: 0,
|
|
385
|
-
class: _(["bb-base-date-picker-input__fields", {
|
|
386
|
-
"bb-base-date-picker-input__fields--empty": x.value
|
|
468
|
+
default: w(() => [
|
|
469
|
+
V("div", {
|
|
470
|
+
class: O(["bb-base-date-picker-input__fields", {
|
|
471
|
+
"bb-base-date-picker-input__fields--empty": ue.value,
|
|
472
|
+
"bb-base-date-picker-input__fields--range": e.range
|
|
387
473
|
}])
|
|
388
474
|
}, [
|
|
389
|
-
|
|
475
|
+
ue.value ? (E(), R("span", {
|
|
390
476
|
key: 0,
|
|
391
477
|
"aria-hidden": "true",
|
|
392
478
|
class: "bb-base-date-picker-input__placeholder",
|
|
393
|
-
onClick:
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
"
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
ref: (t) => s[o.value[2]] = t,
|
|
443
|
-
"aria-describedby": I,
|
|
444
|
-
"aria-invalid": n.hasErrors ? "true" : void 0,
|
|
445
|
-
"aria-label": P(o.value[2]),
|
|
446
|
-
autocomplete: e.autocomplete,
|
|
447
|
-
class: "bb-base-date-picker-input__field bb-base-date-picker-input__field--year",
|
|
448
|
-
disabled: e.disabled,
|
|
449
|
-
inputmode: "numeric",
|
|
450
|
-
maxlength: "4",
|
|
451
|
-
name: e.name ? `${e.name}-${o.value[2]}` : void 0,
|
|
452
|
-
readonly: F.value,
|
|
453
|
-
required: e.required,
|
|
454
|
-
type: "text",
|
|
455
|
-
value: l.value[o.value[2]],
|
|
456
|
-
onBlur: a[8] || (a[8] = (t) => j(o.value[2])),
|
|
457
|
-
onFocus: a[9] || (a[9] = (t) => T(o.value[2])),
|
|
458
|
-
onInput: a[10] || (a[10] = (t) => R(o.value[2], t)),
|
|
459
|
-
onKeydown: a[11] || (a[11] = (t) => q(o.value[2], t))
|
|
460
|
-
}, null, 40, Ze)
|
|
461
|
-
], 2)),
|
|
462
|
-
p("button", {
|
|
463
|
-
"aria-label": ke.value,
|
|
464
|
-
"aria-controls": Z,
|
|
465
|
-
"aria-expanded": b.value,
|
|
479
|
+
onClick: Te
|
|
480
|
+
}, q(Re.value), 1)) : ee("", !0),
|
|
481
|
+
(E(!0), R(ge, null, Ze(u.value, (a, r) => (E(), R(ge, {
|
|
482
|
+
key: W(a)
|
|
483
|
+
}, [
|
|
484
|
+
V("input", {
|
|
485
|
+
id: Le(a),
|
|
486
|
+
ref_for: !0,
|
|
487
|
+
ref: (i) => L[W(a)] = i,
|
|
488
|
+
"aria-describedby": re,
|
|
489
|
+
"aria-invalid": n.hasErrors ? "true" : void 0,
|
|
490
|
+
"aria-label": xe(a),
|
|
491
|
+
autocomplete: e.autocomplete,
|
|
492
|
+
autofocus: e.autofocus && r === 0,
|
|
493
|
+
class: O([
|
|
494
|
+
"bb-base-date-picker-input__field",
|
|
495
|
+
`bb-base-date-picker-input__field--${a.field}`,
|
|
496
|
+
`bb-base-date-picker-input__field--${a.segment}`
|
|
497
|
+
]),
|
|
498
|
+
disabled: e.disabled,
|
|
499
|
+
inputmode: _e.value,
|
|
500
|
+
maxlength: a.field === "year" ? 4 : 2,
|
|
501
|
+
name: Oe(a),
|
|
502
|
+
readonly: De.value,
|
|
503
|
+
required: e.required,
|
|
504
|
+
tabindex: r % 3 === 0 ? 0 : -1,
|
|
505
|
+
type: "text",
|
|
506
|
+
value: l.value[a.segment][a.field],
|
|
507
|
+
onBlur: (i) => qe(a),
|
|
508
|
+
onFocus: (i) => He(a),
|
|
509
|
+
onInput: (i) => Ne(a, i),
|
|
510
|
+
onKeydown: (i) => We(a, i),
|
|
511
|
+
onPaste: (i) => je(a, i)
|
|
512
|
+
}, null, 42, pt),
|
|
513
|
+
r < u.value.length - 1 ? (E(), R("span", {
|
|
514
|
+
key: 0,
|
|
515
|
+
"aria-hidden": "true",
|
|
516
|
+
class: O(["bb-base-date-picker-input__separator", {
|
|
517
|
+
"bb-base-date-picker-input__separator--range": u.value[r].segment !== u.value[r + 1].segment
|
|
518
|
+
}]),
|
|
519
|
+
onClick: (i) => $(u.value[r + 1], { select: !0 })
|
|
520
|
+
}, q(u.value[r].segment !== u.value[r + 1].segment ? "–" : "/"), 11, gt)) : ee("", !0)
|
|
521
|
+
], 64))), 128))
|
|
522
|
+
], 2),
|
|
523
|
+
se.value ? ee("", !0) : (E(), R("button", {
|
|
524
|
+
key: 0,
|
|
525
|
+
"aria-label": Ee.value,
|
|
526
|
+
"aria-controls": oe,
|
|
527
|
+
"aria-expanded": Y.value,
|
|
466
528
|
"aria-haspopup": "dialog",
|
|
467
529
|
class: "bb-base-date-picker-input__calendar-btn",
|
|
468
530
|
disabled: e.disabled || e.readonly,
|
|
469
531
|
type: "button",
|
|
470
|
-
onClick:
|
|
471
|
-
},
|
|
472
|
-
|
|
532
|
+
onClick: Qe(Fe, ["stop"])
|
|
533
|
+
}, t[1] || (t[1] = [
|
|
534
|
+
V("svg", {
|
|
473
535
|
fill: "none",
|
|
474
536
|
viewBox: "0 0 16 16",
|
|
475
537
|
xmlns: "http://www.w3.org/2000/svg"
|
|
476
538
|
}, [
|
|
477
|
-
|
|
539
|
+
V("path", {
|
|
478
540
|
d: "M12.6667 2.66667H3.33333C2.59695 2.66667 2 3.26363 2 4.00001V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4.00001C14 3.26363 13.403 2.66667 12.6667 2.66667Z",
|
|
479
541
|
stroke: "currentColor",
|
|
480
542
|
"stroke-linecap": "round",
|
|
481
543
|
"stroke-linejoin": "round"
|
|
482
544
|
}),
|
|
483
|
-
|
|
545
|
+
V("path", {
|
|
484
546
|
d: "M10.6667 1.33333V3.99999",
|
|
485
547
|
stroke: "currentColor",
|
|
486
548
|
"stroke-linecap": "round",
|
|
487
549
|
"stroke-linejoin": "round"
|
|
488
550
|
}),
|
|
489
|
-
|
|
551
|
+
V("path", {
|
|
490
552
|
d: "M5.33333 1.33333V3.99999",
|
|
491
553
|
stroke: "currentColor",
|
|
492
554
|
"stroke-linecap": "round",
|
|
493
555
|
"stroke-linejoin": "round"
|
|
494
556
|
}),
|
|
495
|
-
|
|
557
|
+
V("path", {
|
|
496
558
|
d: "M2 6.66667H14",
|
|
497
559
|
stroke: "currentColor",
|
|
498
560
|
"stroke-linecap": "round",
|
|
499
561
|
"stroke-linejoin": "round"
|
|
500
562
|
})
|
|
501
563
|
], -1)
|
|
502
|
-
]), 8,
|
|
503
|
-
|
|
504
|
-
id:
|
|
564
|
+
]), 8, bt)),
|
|
565
|
+
V("span", {
|
|
566
|
+
id: re,
|
|
505
567
|
class: "bb-base-date-picker-input__accessible-description sr-only"
|
|
506
|
-
},
|
|
568
|
+
}, q(x(S)("baseDatePickerInput.dateFormat")) + " " + q(n.range ? x(S)("baseDatePickerInput.dateFormatRange") : x(S)("baseDatePickerInput.dateFormatSingle")), 1)
|
|
507
569
|
]),
|
|
508
570
|
_: 3
|
|
509
571
|
}, 8, ["append:icon", "clearable", "prepend:icon"])
|
|
510
572
|
]),
|
|
511
|
-
|
|
512
|
-
modelValue:
|
|
513
|
-
"onUpdate:modelValue":
|
|
514
|
-
anchor:
|
|
573
|
+
X(ft, {
|
|
574
|
+
modelValue: Y.value,
|
|
575
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => Y.value = a),
|
|
576
|
+
anchor: ae.value,
|
|
515
577
|
dialog: "",
|
|
516
578
|
offset: 4,
|
|
517
579
|
"transition-duration": e.transitionDuration
|
|
518
580
|
}, {
|
|
519
|
-
default:
|
|
520
|
-
|
|
521
|
-
id:
|
|
581
|
+
default: w(() => [
|
|
582
|
+
V("div", {
|
|
583
|
+
id: oe,
|
|
522
584
|
ref_key: "calendar",
|
|
523
|
-
ref:
|
|
524
|
-
class:
|
|
525
|
-
"bb-base-date-picker-input__calendar--shown":
|
|
585
|
+
ref: te,
|
|
586
|
+
class: O(["bb-base-date-picker-input__calendar", {
|
|
587
|
+
"bb-base-date-picker-input__calendar--shown": Y.value
|
|
526
588
|
}]),
|
|
527
|
-
inert: !
|
|
589
|
+
inert: !Y.value
|
|
528
590
|
}, [
|
|
529
|
-
|
|
591
|
+
X(ut, Xe({ id: x(A) }, Pe, {
|
|
530
592
|
ref_key: "baseDatePicker",
|
|
531
|
-
ref:
|
|
593
|
+
ref: ne,
|
|
532
594
|
disabled: e.disabled,
|
|
533
595
|
"first-day-of-week": e.firstDayOfWeek,
|
|
534
596
|
floating: e.floating,
|
|
@@ -539,7 +601,7 @@ const ze = { class: "bb-base-date-picker-input__inner-wrapper" }, Ge = ["id", "a
|
|
|
539
601
|
readonly: e.readonly,
|
|
540
602
|
selectable: e.selectable
|
|
541
603
|
}), null, 16, ["id", "disabled", "first-day-of-week", "floating", "max", "min", "model-value", "range", "readonly", "selectable"])
|
|
542
|
-
], 10,
|
|
604
|
+
], 10, vt)
|
|
543
605
|
]),
|
|
544
606
|
_: 1
|
|
545
607
|
}, 8, ["modelValue", "anchor", "transition-duration"])
|
|
@@ -549,5 +611,5 @@ const ze = { class: "bb-base-date-picker-input__inner-wrapper" }, Ge = ["id", "a
|
|
|
549
611
|
}
|
|
550
612
|
});
|
|
551
613
|
export {
|
|
552
|
-
|
|
614
|
+
xt as default
|
|
553
615
|
};
|