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.
Files changed (193) hide show
  1. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +60 -14
  2. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +10 -3
  3. package/dist/index.css +1 -1
  4. package/dist/index109.js +9 -9
  5. package/dist/index116.js +1 -1
  6. package/dist/index122.js +4 -4
  7. package/dist/index124.js +13 -13
  8. package/dist/index132.js +1 -1
  9. package/dist/index134.js +5 -5
  10. package/dist/index136.js +1 -1
  11. package/dist/index138.js +2 -2
  12. package/dist/index14.js +1 -1
  13. package/dist/index141.js +1 -1
  14. package/dist/index143.js +2 -2
  15. package/dist/index145.js +1 -1
  16. package/dist/index16.js +3 -3
  17. package/dist/index18.js +3 -3
  18. package/dist/index20.js +8 -8
  19. package/dist/index218.js +2 -138
  20. package/dist/index219.js +138 -2
  21. package/dist/index22.js +14 -14
  22. package/dist/index220.js +2 -2
  23. package/dist/index221.js +1 -1
  24. package/dist/index222.js +1 -1
  25. package/dist/index223.js +33 -6
  26. package/dist/index224.js +27 -15
  27. package/dist/index226.js +5 -5
  28. package/dist/index227.js +4 -4
  29. package/dist/index228.js +5 -5
  30. package/dist/index229.js +5 -3
  31. package/dist/index230.js +3 -2
  32. package/dist/index231.js +2 -6
  33. package/dist/index232.js +6 -8
  34. package/dist/index233.js +6 -266
  35. package/dist/index234.js +258 -42
  36. package/dist/index235.js +44 -44
  37. package/dist/index236.js +48 -28
  38. package/dist/index237.js +27 -55
  39. package/dist/index238.js +59 -12
  40. package/dist/index239.js +13 -3
  41. package/dist/index24.js +440 -378
  42. package/dist/index240.js +86 -33
  43. package/dist/index242.js +32 -0
  44. package/dist/index243.js +17 -2
  45. package/dist/index244.js +51 -2
  46. package/dist/index245.js +18 -3
  47. package/dist/index246.js +11 -8
  48. package/dist/index247.js +17 -12
  49. package/dist/index248.js +12 -134
  50. package/dist/index249.js +15 -0
  51. package/dist/index250.js +3 -23
  52. package/dist/index251.js +3 -3
  53. package/dist/index252.js +18 -21
  54. package/dist/index253.js +2 -33
  55. package/dist/index254.js +2 -2
  56. package/dist/index255.js +2 -67
  57. package/dist/index256.js +3 -2
  58. package/dist/index257.js +135 -4
  59. package/dist/index259.js +4 -34
  60. package/dist/index26.js +3 -3
  61. package/dist/index260.js +22 -85
  62. package/dist/index261.js +6 -0
  63. package/dist/index262.js +3 -30
  64. package/dist/index263.js +17 -16
  65. package/dist/index264.js +11 -50
  66. package/dist/index265.js +106 -18
  67. package/dist/index267.js +100 -18
  68. package/dist/index269.js +107 -11
  69. package/dist/index270.js +2 -5
  70. package/dist/index271.js +11 -13
  71. package/dist/index272.js +7 -9
  72. package/dist/index273.js +6 -373
  73. package/dist/index274.js +18 -0
  74. package/dist/index275.js +3 -25
  75. package/dist/index276.js +9 -4
  76. package/dist/index277.js +52 -8
  77. package/dist/index278.js +9 -52
  78. package/dist/index279.js +2 -187
  79. package/dist/index28.js +1 -1
  80. package/dist/index280.js +373 -3
  81. package/dist/index282.js +7 -16
  82. package/dist/index283.js +23 -12
  83. package/dist/index284.js +5 -106
  84. package/dist/index285.js +69 -0
  85. package/dist/index286.js +5 -100
  86. package/dist/index287.js +7 -0
  87. package/dist/index288.js +5 -107
  88. package/dist/index289.js +2 -5
  89. package/dist/index290.js +7 -5
  90. package/dist/index291.js +7 -5
  91. package/dist/index292.js +25 -2
  92. package/dist/index293.js +187 -6
  93. package/dist/index294.js +3 -7
  94. package/dist/index295.js +32 -19
  95. package/dist/index296.js +21 -7
  96. package/dist/index297.js +32 -9
  97. package/dist/index298.js +9 -3
  98. package/dist/index30.js +3 -3
  99. package/dist/index300.js +3 -7
  100. package/dist/index301.js +282 -0
  101. package/dist/index302.js +2 -3
  102. package/dist/index303.js +16 -3
  103. package/dist/index304.js +2 -17
  104. package/dist/index305.js +15 -27
  105. package/dist/index306.js +2 -719
  106. package/dist/index307.js +27 -366
  107. package/dist/index308.js +2 -57
  108. package/dist/index309.js +2 -5
  109. package/dist/index310.js +1 -1
  110. package/dist/index311.js +2 -280
  111. package/dist/index312.js +2 -2
  112. package/dist/index313.js +27 -15
  113. package/dist/index314.js +2 -2
  114. package/dist/index315.js +7 -16
  115. package/dist/index316.js +3 -2
  116. package/dist/index317.js +17 -27
  117. package/dist/index318.js +4 -2
  118. package/dist/index319.js +5 -2
  119. package/dist/index32.js +2 -2
  120. package/dist/index320.js +3 -2
  121. package/dist/index321.js +5 -2
  122. package/dist/index322.js +3 -2
  123. package/dist/index323.js +3 -2
  124. package/dist/index324.js +1 -1
  125. package/dist/index325.js +719 -3
  126. package/dist/index326.js +366 -4
  127. package/dist/index327.js +57 -3
  128. package/dist/index328.js +3 -4
  129. package/dist/index329.js +2 -3
  130. package/dist/index330.js +125 -3
  131. package/dist/index331.js +2 -2
  132. package/dist/index332.js +14 -5
  133. package/dist/index333.js +2 -125
  134. package/dist/index334.js +19 -2
  135. package/dist/index335.js +2 -15
  136. package/dist/index336.js +6 -2
  137. package/dist/index337.js +3 -18
  138. package/dist/index338.js +2 -2
  139. package/dist/index339.js +5 -228
  140. package/dist/index34.js +8 -8
  141. package/dist/index340.js +7 -67
  142. package/dist/index341.js +18 -66
  143. package/dist/index342.js +8 -92
  144. package/dist/index343.js +15 -5
  145. package/dist/index344.js +92 -6
  146. package/dist/index345.js +5 -17
  147. package/dist/index346.js +67 -9
  148. package/dist/index347.js +66 -14
  149. package/dist/index348.js +34 -6
  150. package/dist/index349.js +6 -35
  151. package/dist/index350.js +129 -6
  152. package/dist/index351.js +382 -113
  153. package/dist/index352.js +198 -396
  154. package/dist/index353.js +255 -18
  155. package/dist/index354.js +230 -0
  156. package/dist/index355.js +21 -133
  157. package/dist/index357.js +2 -259
  158. package/dist/index358.js +1 -1
  159. package/dist/index359.js +134 -2
  160. package/dist/index36.js +4 -4
  161. package/dist/index363.js +1 -1
  162. package/dist/index38.js +20 -20
  163. package/dist/index40.js +7 -7
  164. package/dist/index42.js +2 -2
  165. package/dist/index44.js +8 -8
  166. package/dist/index46.js +6 -6
  167. package/dist/index50.js +2 -2
  168. package/dist/index54.js +1 -1
  169. package/dist/index56.js +1 -1
  170. package/dist/index58.js +2 -2
  171. package/dist/index60.js +2 -2
  172. package/dist/index62.js +5 -5
  173. package/dist/index68.js +1 -1
  174. package/dist/index74.js +4 -4
  175. package/dist/index78.js +13 -11
  176. package/dist/index82.js +6 -6
  177. package/dist/index84.js +1 -1
  178. package/dist/index86.js +2 -2
  179. package/dist/index88.js +3 -3
  180. package/dist/index90.js +1 -1
  181. package/dist/index93.js +3 -3
  182. package/dist/index95.js +2 -2
  183. package/dist/index97.js +5 -5
  184. package/dist/index99.js +1 -1
  185. package/package.json +1 -1
  186. package/dist/index225.js +0 -7
  187. package/dist/index241.js +0 -30
  188. package/dist/index258.js +0 -22
  189. package/dist/index266.js +0 -14
  190. package/dist/index268.js +0 -5
  191. package/dist/index281.js +0 -5
  192. package/dist/index299.js +0 -7
  193. package/dist/index356.js +0 -202
package/dist/index24.js CHANGED
@@ -1,25 +1,24 @@
1
- import { defineComponent as Ye, watchEffect as Ie, ref as y, computed as h, watch as N, onBeforeUnmount as Fe, createBlock as Ee, openBlock as A, normalizeClass as _, withCtx as g, createElementVNode as p, createVNode as H, unref as f, createElementBlock as W, withDirectives as we, createCommentVNode as Ae, toDisplayString as U, mergeProps as ae, withModifiers as Be, renderSlot as Y } from "vue";
2
- import { _config as te } from "./index4.js";
3
- import c from "./index225.js";
4
- import Ce from "./index289.js";
5
- import ne from "./index290.js";
6
- import Le from "./index226.js";
7
- import Oe from "./index227.js";
8
- import Pe from "./index291.js";
9
- import { identity as Re } from "./index256.js";
10
- import { isEmpty as qe } from "./index281.js";
11
- import { useId as Te } from "./index8.js";
12
- import { useLocale as je } from "./index238.js";
13
- import { useMobile as Ne } from "./index9.js";
14
- import { vMaska as _e } from "./index258.js";
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 We from "./index138.js";
16
+ import dt from "./index138.js";
18
17
  /* empty css */
19
- import Ue from "./index140.js";
20
- import Ke from "./index248.js";
18
+ import ct from "./index140.js";
19
+ import ft from "./index257.js";
21
20
  /* empty css */
22
- const ze = { class: "bb-base-date-picker-input__inner-wrapper" }, Ge = ["id", "aria-invalid", "aria-label", "autocomplete", "autofocus", "disabled", "name", "readonly", "required", "value"], Xe = ["id", "aria-invalid", "aria-label", "autocomplete", "disabled", "name", "readonly", "required", "value"], Ze = ["id", "aria-invalid", "aria-label", "autocomplete", "disabled", "name", "readonly", "required", "value"], Je = ["id", "aria-invalid", "autocomplete", "autofocus", "disabled", "inputmode", "name", "placeholder", "readonly", "required", "value"], Qe = ["aria-label", "aria-expanded", "disabled"], xe = ["inert"], K = "DD/MM/YYYY", k = "YYYY-MM-DD", Da = /* @__PURE__ */ Ye({
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(re, { emit: oe }) {
51
- const le = { it: Pe, en: ne };
52
- c.extend(Ce), c.extend(Le), c.extend(Oe), Ie(() => {
53
- c.locale(le[te.locale] ?? ne);
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 = re, m = oe, { t: v } = je(), ie = /^\d{2}\/\d{2}\/\d{4}$/, z = y(null), B = y(null), G = y(null), ue = y(null), D = y(null), X = y(null), V = n.id || `bdpi-${Te().id.value}`, I = `bdpi-description_${V}`, Z = `bdpi-calendar_${V}`, { isMobile: se } = Ne(), J = h(() => n.range ? !1 : n.allowWriting === "not-mobile" ? !se.value : !!n.allowWriting), F = h(
56
- () => !!n.readonly || !!n.range || !J.value
57
- ), de = h(() => J.value ? "numeric" : "none"), pe = h(() => ({
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": E.value,
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
- if (n.min && !c(n.min, k, !0).isValid())
67
- throw new Error("Min must be in the format YYYY-MM-DD");
68
- if (n.max && !c(n.max, k, !0).isValid())
69
- throw new Error("Max must be in the format YYYY-MM-DD");
70
- const C = (e) => n.floating ? e.format(k) : e.toISOString(), S = (e) => n.floating ? c(e, k, !0) : c(e), ce = (e) => {
71
- if (!ie.test(e)) return null;
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 = y(!1), O = (e) => {
117
- const a = e.target;
118
- a && a instanceof HTMLDialogElement && (b.value = !1);
119
- }, be = () => {
120
- n.disabled || n.readonly || (b.value = !0);
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
- N(b, (e) => {
123
- e ? document.addEventListener("click", O, { passive: !0 }) : (X.value?.resetStatus(), document.removeEventListener("click", O));
85
+ pe(Y, (e) => {
86
+ e ? document.addEventListener("click", K, { passive: !0 }) : (ne.value?.resetStatus(), document.removeEventListener("click", K));
124
87
  });
125
- const ye = (e) => n.range ? Array.isArray(e) && e.length === 2 : !!e, ge = {
88
+ const Ie = (e) => n.range ? Array.isArray(e) && e.length === 2 : !!e, Pe = {
126
89
  "onUpdate:modelValue": (e) => {
127
- m("update:modelValue", e), ye(e) && (b.value = !1);
90
+ f("update:modelValue", e), Ie(e) && (Y.value = !1);
128
91
  }
129
- }, ke = h(() => {
92
+ }, Ee = _(() => {
130
93
  if (n.range) {
131
- const e = Array.isArray(n.modelValue) ? n.modelValue : [], [a, t] = e;
132
- if (!a || !t) return v("baseDatePickerInput.emptyRange").value;
133
- const r = S(a), i = S(t);
134
- return !r.isValid() || !i.isValid() ? v("baseDatePickerInput.emptyRange").value : v(
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 = S(n.modelValue);
142
- return e.isValid() ? v(
104
+ const e = z(n.modelValue);
105
+ return e.isValid() ? S(
143
106
  "baseDatePickerInput.changeSelection",
144
107
  e.format("D MMMM YYYY")
145
- ).value : v("baseDatePickerInput.emptySelection").value;
108
+ ).value : S("baseDatePickerInput.emptySelection").value;
146
109
  }
147
- return v("baseDatePickerInput.emptySelection").value;
148
- }), Q = (e) => {
110
+ return S("baseDatePickerInput.emptySelection").value;
111
+ }), N = (e) => {
149
112
  if (!e.isValid()) return !0;
150
- let a = !0;
113
+ let t = !0;
151
114
  if (n.min) {
152
- const t = c(n.min, k, !0);
153
- a &&= e.isSameOrAfter(t);
115
+ const a = b(n.min, D, !0);
116
+ t &&= e.isSameOrAfter(a);
154
117
  }
155
118
  if (n.max) {
156
- const t = c(n.max, k, !0);
157
- a &&= e.isSameOrBefore(t);
119
+ const a = b(n.max, D, !0);
120
+ t &&= e.isSameOrBefore(a);
158
121
  }
159
- return typeof n.selectable == "function" && (a &&= n.selectable(C(e))), !a;
160
- }, he = () => {
161
- n.range ? m("update:modelValue", []) : m("update:modelValue", null);
162
- }, s = {
163
- day: null,
164
- month: null,
165
- year: null
166
- }, o = h(() => te.locale === "en" ? ["month", "day", "year"] : ["day", "month", "year"]), l = y({
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
- }), w = (e) => {
171
- if (!e || Array.isArray(e)) {
172
- l.value = { day: "", month: "", year: "" };
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
- const a = S(e);
176
- if (!a.isValid()) {
177
- l.value = { day: "", month: "", year: "" };
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
- l.value = {
181
- day: a.format("DD"),
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
- w(n.modelValue);
187
+ l.value = {
188
+ start: U(e),
189
+ end: y()
190
+ };
191
+ }, ze = () => {
192
+ H(n.modelValue);
191
193
  };
192
- w(n.modelValue), N(
194
+ H(n.modelValue), pe(
193
195
  () => n.modelValue,
194
196
  (e) => {
195
197
  if (e === null || Array.isArray(e) && e.length === 0) {
196
- w(e), D.value = null;
198
+ H(e);
197
199
  return;
198
200
  }
199
- document.activeElement && Object.values(s).includes(
200
- document.activeElement
201
- ) || w(e);
201
+ const t = document.activeElement;
202
+ t && Ae(t) || H(e);
202
203
  }
203
204
  );
204
- const P = (e) => ({
205
- day: "Day",
206
- month: "Month",
207
- year: "Year"
208
- })[e], x = h(() => !l.value.day && !l.value.month && !l.value.year), Ve = () => {
209
- const e = o.value[0];
210
- s[e]?.focus();
211
- }, Me = () => {
212
- const { day: e, month: a, year: t } = l.value;
213
- if (!e && !a && !t) {
214
- m("update:modelValue", null);
215
- return;
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
- if (!e || !a || !t)
218
- return;
219
- const r = parseInt(e, 10), i = parseInt(a, 10), u = parseInt(t, 10);
220
- if (r < 1 || r > 31 || i < 1 || i > 12 || u < 1e3 || u > 9999)
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
- if (Q(M)) {
233
- m("error", "invalid_date_typed");
279
+ const t = fe("end");
280
+ if (e === "empty" && t === "empty") {
281
+ f("update:modelValue", null);
234
282
  return;
235
283
  }
236
- m("update:modelValue", C(M));
237
- }, R = (e, a) => {
238
- const t = a.target;
239
- let r = t.value.replace(/\D/g, "");
240
- if (e === "day") {
241
- if (r.length > 0) {
242
- const d = parseInt(r, 10);
243
- r === "00" || d > 31 ? r = l.value.day : d > 31 && (r = "31");
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
- } else if (e === "month") {
246
- if (r.length > 0) {
247
- const d = parseInt(r, 10);
248
- r === "00" || d > 12 ? r = l.value.month : d > 12 && (r = "12");
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 (u) {
259
- const d = o.value.indexOf(e);
260
- if (d < 2) {
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
- Me();
266
- }, q = (e, a) => {
267
- const t = a.target, r = o.value.indexOf(e);
268
- if (a.key === "/") {
269
- if (a.preventDefault(), r < 2) {
270
- const i = o.value[r + 1];
271
- s[i]?.focus(), s[i]?.select();
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
- if (a.key === "Backspace" && t.selectionStart === 0 && t.selectionEnd === 0) {
276
- if (r > 0) {
277
- a.preventDefault();
278
- const i = o.value[r - 1];
279
- s[i]?.focus();
280
- const u = s[i];
281
- u && u.setSelectionRange(
282
- u.value.length,
283
- u.value.length
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 (a.key === "ArrowLeft" && t.selectionStart === 0) {
289
- if (r > 0) {
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 (a.key === "ArrowRight" && t.selectionStart === t.value.length) {
302
- if (r < 2) {
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
- }, T = (e) => {
310
- const a = !l.value.day && !l.value.month && !l.value.year, t = o.value[0];
311
- if (a && e !== t) {
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
- const r = s[e];
318
- r && r.value && requestAnimationFrame(() => {
319
- r.select();
320
- });
321
- }, j = (e) => {
322
- l.value.day && l.value.day.length === 1 && (l.value.day === "0" ? l.value.day = "" : l.value.day = l.value.day.padStart(2, "0")), l.value.month && l.value.month.length === 1 && (l.value.month === "0" ? l.value.month = "" : l.value.month = l.value.month.padStart(2, "0"));
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 Fe(() => {
325
- document.removeEventListener("focusin", $), document.removeEventListener("click", $), document.removeEventListener("click", O);
326
- }), (e, a) => (A(), Ee(Ue, {
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: B,
329
- class: _(pe.value),
330
- onFocusin: fe
436
+ ref: j,
437
+ class: O(Ve.value),
438
+ onFocusin: $e
331
439
  }, {
332
- "prepend-outer": g(() => [
333
- Y(e.$slots, "prepend-outer")
440
+ "prepend-outer": w(() => [
441
+ B(e.$slots, "prepend-outer")
334
442
  ]),
335
- "append-outer": g(() => [
336
- Y(e.$slots, "append-outer")
443
+ "append-outer": w(() => [
444
+ B(e.$slots, "append-outer")
337
445
  ]),
338
- default: g(() => [
339
- p("div", ze, [
340
- H(We, {
446
+ default: w(() => [
447
+ V("div", mt, [
448
+ X(dt, {
341
449
  ref_key: "innerContainer",
342
- ref: G,
450
+ ref: ae,
343
451
  "append:icon": n["append:icon"],
344
- clearable: n.clearable && !f(qe)(e.modelValue),
452
+ clearable: n.clearable && !x(rt)(e.modelValue),
345
453
  "prepend:icon": n["prepend:icon"],
346
- "onClick:clear": he
454
+ "onClick:clear": Be
347
455
  }, {
348
- prepend: g(() => [
349
- Y(e.$slots, "prepend")
456
+ prepend: w(() => [
457
+ B(e.$slots, "prepend")
350
458
  ]),
351
- prefix: g(() => [
352
- Y(e.$slots, "prefix")
459
+ prefix: w(() => [
460
+ B(e.$slots, "prefix")
353
461
  ]),
354
- append: g(() => [
355
- Y(e.$slots, "append")
462
+ append: w(() => [
463
+ B(e.$slots, "append")
356
464
  ]),
357
- suffix: g(() => [
358
- Y(e.$slots, "suffix")
465
+ suffix: w(() => [
466
+ B(e.$slots, "suffix")
359
467
  ]),
360
- default: g(() => [
361
- n.range ? we((A(), W("input", ae({
362
- key: 1,
363
- id: f(V),
364
- ref_key: "input",
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
- x.value ? (A(), W("span", {
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: Ve
394
- }, U(e.placeholder || "DD/MM/YYYY"), 1)) : Ae("", !0),
395
- p("input", {
396
- id: `${f(V)}-${o.value[0]}`,
397
- ref: (t) => s[o.value[0]] = t,
398
- "aria-describedby": I,
399
- "aria-invalid": n.hasErrors ? "true" : void 0,
400
- "aria-label": P(o.value[0]),
401
- autocomplete: e.autocomplete,
402
- autofocus: e.autofocus,
403
- class: "bb-base-date-picker-input__field bb-base-date-picker-input__field--day",
404
- disabled: e.disabled,
405
- inputmode: "numeric",
406
- maxlength: "2",
407
- name: e.name ? `${e.name}-${o.value[0]}` : void 0,
408
- readonly: F.value,
409
- required: e.required,
410
- type: "text",
411
- value: l.value[o.value[0]],
412
- onBlur: a[0] || (a[0] = (t) => j(o.value[0])),
413
- onFocus: a[1] || (a[1] = (t) => T(o.value[0])),
414
- onInput: a[2] || (a[2] = (t) => R(o.value[0], t)),
415
- onKeydown: a[3] || (a[3] = (t) => q(o.value[0], t))
416
- }, null, 40, Ge),
417
- a[13] || (a[13] = p("span", { class: "bb-base-date-picker-input__separator" }, "/", -1)),
418
- p("input", {
419
- id: `${f(V)}-${o.value[1]}`,
420
- ref: (t) => s[o.value[1]] = t,
421
- "aria-describedby": I,
422
- "aria-invalid": n.hasErrors ? "true" : void 0,
423
- "aria-label": P(o.value[1]),
424
- autocomplete: e.autocomplete,
425
- class: "bb-base-date-picker-input__field bb-base-date-picker-input__field--month",
426
- disabled: e.disabled,
427
- inputmode: "numeric",
428
- maxlength: "2",
429
- name: e.name ? `${e.name}-${o.value[1]}` : void 0,
430
- readonly: F.value,
431
- required: e.required,
432
- type: "text",
433
- value: l.value[o.value[1]],
434
- onBlur: a[4] || (a[4] = (t) => j(o.value[1])),
435
- onFocus: a[5] || (a[5] = (t) => T(o.value[1])),
436
- onInput: a[6] || (a[6] = (t) => R(o.value[1], t)),
437
- onKeydown: a[7] || (a[7] = (t) => q(o.value[1], t))
438
- }, null, 40, Xe),
439
- a[14] || (a[14] = p("span", { class: "bb-base-date-picker-input__separator" }, "/", -1)),
440
- p("input", {
441
- id: `${f(V)}-${o.value[2]}`,
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: Be(be, ["stop"])
471
- }, a[15] || (a[15] = [
472
- p("svg", {
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
- p("path", {
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
- p("path", {
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
- p("path", {
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
- p("path", {
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, Qe),
503
- p("span", {
504
- id: I,
564
+ ]), 8, bt)),
565
+ V("span", {
566
+ id: re,
505
567
  class: "bb-base-date-picker-input__accessible-description sr-only"
506
- }, U(f(v)("baseDatePickerInput.dateFormat")) + " " + U(n.range ? f(v)("baseDatePickerInput.dateFormatRange") : f(v)("baseDatePickerInput.dateFormatSingle")), 1)
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
- H(Ke, {
512
- modelValue: b.value,
513
- "onUpdate:modelValue": a[12] || (a[12] = (t) => b.value = t),
514
- anchor: G.value,
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: g(() => [
520
- p("div", {
521
- id: Z,
581
+ default: w(() => [
582
+ V("div", {
583
+ id: oe,
522
584
  ref_key: "calendar",
523
- ref: z,
524
- class: _(["bb-base-date-picker-input__calendar", {
525
- "bb-base-date-picker-input__calendar--shown": b.value
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: !b.value
589
+ inert: !Y.value
528
590
  }, [
529
- H(He, ae({ id: f(V) }, ge, {
591
+ X(ut, Xe({ id: x(A) }, Pe, {
530
592
  ref_key: "baseDatePicker",
531
- ref: X,
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, xe)
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
- Da as default
614
+ xt as default
553
615
  };