bitboss-ui 2.0.105 → 2.0.107

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 (175) hide show
  1. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +0 -1
  2. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +1 -7
  3. package/dist/components/BbAlert/BbAlert.vue.d.ts +0 -1
  4. package/dist/components/BbChip/BbChip.vue.d.ts +0 -1
  5. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +0 -1
  6. package/dist/components/BbPopover/BbPopover.vue.d.ts +1 -1
  7. package/dist/components/BbRows/BbRows.vue.d.ts +1 -0
  8. package/dist/components/BbTable/BbTable.vue.d.ts +2 -7
  9. package/dist/components/BbTable/types.d.ts +13 -0
  10. package/dist/components/ListBox.vue.d.ts +0 -2
  11. package/dist/composables/useLocale.d.ts +1 -1
  12. package/dist/i18n/en.d.ts +45 -0
  13. package/dist/i18n/it.d.ts +45 -0
  14. package/dist/index100.js +46 -45
  15. package/dist/index111.js +223 -205
  16. package/dist/index119.js +2 -2
  17. package/dist/index121.js +55 -54
  18. package/dist/index123.js +1 -1
  19. package/dist/index125.js +14 -13
  20. package/dist/index127.js +1 -1
  21. package/dist/index128.js +1 -1
  22. package/dist/index129.js +1 -1
  23. package/dist/index13.js +2 -2
  24. package/dist/index133.js +2 -2
  25. package/dist/index15.js +36 -35
  26. package/dist/index17.js +3 -3
  27. package/dist/index19.js +63 -64
  28. package/dist/index207.js +8 -2
  29. package/dist/index208.js +3 -4
  30. package/dist/index209.js +53 -2
  31. package/dist/index21.js +110 -103
  32. package/dist/index211.js +13 -16
  33. package/dist/index212.js +3 -16
  34. package/dist/index213.js +40 -18
  35. package/dist/index214.js +6 -19
  36. package/dist/index215.js +7 -27
  37. package/dist/index216.js +12 -3
  38. package/dist/index217.js +13 -2
  39. package/dist/index218.js +2 -8
  40. package/dist/index219.js +4 -250
  41. package/dist/index220.js +2 -52
  42. package/dist/index221.js +3 -44
  43. package/dist/index222.js +20 -5
  44. package/dist/index223.js +4 -60
  45. package/dist/index224.js +281 -84
  46. package/dist/index225.js +18 -0
  47. package/dist/index226.js +16 -8
  48. package/dist/index227.js +18 -24
  49. package/dist/index228.js +14 -16
  50. package/dist/index229.js +18 -47
  51. package/dist/index23.js +127 -119
  52. package/dist/index230.js +27 -15
  53. package/dist/index231.js +2 -12
  54. package/dist/index232.js +250 -16
  55. package/dist/index233.js +52 -3
  56. package/dist/index234.js +44 -41
  57. package/dist/index235.js +5 -6
  58. package/dist/index236.js +60 -7
  59. package/dist/index237.js +126 -12
  60. package/dist/index238.js +124 -52
  61. package/dist/index239.js +4 -0
  62. package/dist/index240.js +4 -12
  63. package/dist/index241.js +369 -3
  64. package/dist/index242.js +85 -125
  65. package/dist/index244.js +25 -2
  66. package/dist/index245.js +16 -19
  67. package/dist/index246.js +48 -5
  68. package/dist/index247.js +12 -366
  69. package/dist/index248.js +12 -4
  70. package/dist/index249.js +16 -2
  71. package/dist/index25.js +44 -41
  72. package/dist/index250.js +2 -2
  73. package/dist/index251.js +18 -2
  74. package/dist/index252.js +105 -17
  75. package/dist/{index255.js → index254.js} +2 -2
  76. package/dist/index256.js +14 -0
  77. package/dist/index257.js +2 -12
  78. package/dist/index258.js +2 -10
  79. package/dist/index259.js +9 -2
  80. package/dist/index260.js +3 -6
  81. package/dist/index261.js +8 -15
  82. package/dist/index262.js +23 -9
  83. package/dist/index263.js +88 -8
  84. package/dist/index265.js +6 -89
  85. package/dist/index266.js +18 -0
  86. package/dist/index267.js +9 -4
  87. package/dist/index268.js +9 -6
  88. package/dist/index269.js +8 -2
  89. package/dist/index27.js +1 -1
  90. package/dist/index270.js +28 -2
  91. package/dist/index271.js +3 -2
  92. package/dist/index273.js +7 -2
  93. package/dist/index274.js +431 -2
  94. package/dist/index275.js +1 -1
  95. package/dist/index276.js +89 -2
  96. package/dist/index277.js +7 -2
  97. package/dist/index278.js +11 -2
  98. package/dist/index279.js +4 -28
  99. package/dist/index280.js +224 -22
  100. package/dist/index281.js +202 -0
  101. package/dist/index282.js +175 -6
  102. package/dist/index283.js +6 -3
  103. package/dist/index284.js +2 -7
  104. package/dist/index285.js +2 -11
  105. package/dist/index286.js +2 -17
  106. package/dist/index287.js +2 -9
  107. package/dist/index288.js +2 -431
  108. package/dist/index289.js +2 -2
  109. package/dist/index29.js +2 -2
  110. package/dist/index290.js +2 -89
  111. package/dist/index291.js +2 -3
  112. package/dist/index292.js +4 -0
  113. package/dist/index293.js +2 -224
  114. package/dist/index294.js +2 -200
  115. package/dist/index295.js +22 -2
  116. package/dist/index297.js +2 -176
  117. package/dist/index298.js +125 -21
  118. package/dist/index299.js +24 -0
  119. package/dist/index301.js +3 -436
  120. package/dist/index302.js +16 -126
  121. package/dist/index303.js +436 -3
  122. package/dist/index304.js +127 -3
  123. package/dist/index305.js +3 -213
  124. package/dist/index306.js +3 -3
  125. package/dist/index307.js +214 -3
  126. package/dist/index308.js +3 -58
  127. package/dist/index309.js +3 -7
  128. package/dist/index31.js +2 -2
  129. package/dist/index310.js +3 -19
  130. package/dist/index311.js +56 -64
  131. package/dist/index312.js +2 -7
  132. package/dist/index313.js +67 -2
  133. package/dist/index314.js +5 -5
  134. package/dist/index315.js +32 -7
  135. package/dist/index316.js +7 -8
  136. package/dist/index317.js +18 -7
  137. package/dist/index318.js +53 -5
  138. package/dist/index319.js +53 -3
  139. package/dist/index320.js +46 -3
  140. package/dist/index321.js +6 -32
  141. package/dist/index322.js +4 -46
  142. package/dist/index323.js +8 -2
  143. package/dist/index324.js +2 -2
  144. package/dist/index325.js +6 -0
  145. package/dist/index326.js +2 -424
  146. package/dist/index328.js +424 -2
  147. package/dist/index33.js +45 -45
  148. package/dist/index35.js +56 -55
  149. package/dist/index37.js +166 -165
  150. package/dist/index39.js +4 -4
  151. package/dist/index41.js +2 -2
  152. package/dist/index43.js +70 -71
  153. package/dist/index45.js +7 -7
  154. package/dist/index47.js +2 -2
  155. package/dist/index49.js +2 -2
  156. package/dist/index53.js +28 -27
  157. package/dist/index55.js +1 -1
  158. package/dist/index57.js +2 -2
  159. package/dist/index61.js +32 -31
  160. package/dist/index75.js +3 -3
  161. package/dist/index77.js +87 -86
  162. package/dist/index79.js +2 -2
  163. package/dist/index81.js +1 -1
  164. package/dist/index84.js +45 -44
  165. package/dist/index86.js +67 -66
  166. package/dist/index88.js +69 -67
  167. package/package.json +1 -1
  168. package/dist/index210.js +0 -283
  169. package/dist/index243.js +0 -127
  170. package/dist/index253.js +0 -108
  171. package/dist/index264.js +0 -25
  172. package/dist/index296.js +0 -128
  173. package/dist/index300.js +0 -10
  174. /package/dist/{index327.js → index329.js} +0 -0
  175. /package/dist/{index272.js → index330.js} +0 -0
package/dist/index19.js CHANGED
@@ -1,17 +1,16 @@
1
- import { defineComponent as z, ref as B, toRef as d, openBlock as G, createBlock as R, unref as u, withCtx as s, renderSlot as l, normalizeProps as b, guardReactiveProps as v, createVNode as W, mergeProps as w } from "vue";
2
- import K from "./index17.js";
1
+ import { defineComponent as j, ref as k, toRef as d, openBlock as z, createBlock as G, unref as B, withCtx as s, renderSlot as l, normalizeProps as h, guardReactiveProps as b, createVNode as R, mergeProps as T } from "vue";
2
+ import W from "./index17.js";
3
3
  /* empty css */
4
- import N from "./index224.js";
4
+ import K from "./index242.js";
5
5
  /* empty css */
6
- import { useLocale as U } from "./index226.js";
7
- import { useItemsGetter as q } from "./index227.js";
8
- import { useIndexById as C } from "./index228.js";
9
- import { useBaseOptions as J } from "./index229.js";
10
- import { useCoherence as Q } from "./index230.js";
11
- import { hash as X } from "./index216.js";
12
- import { useHashedWatcher as E } from "./index231.js";
13
- import { usePrefill as Y } from "./index232.js";
14
- const me = /* @__PURE__ */ z({
6
+ import { useItemsGetter as N } from "./index244.js";
7
+ import { useIndexById as w } from "./index245.js";
8
+ import { useBaseOptions as U } from "./index246.js";
9
+ import { useCoherence as q } from "./index247.js";
10
+ import { hash as J } from "./index208.js";
11
+ import { useHashedWatcher as C } from "./index248.js";
12
+ import { usePrefill as Q } from "./index249.js";
13
+ const de = /* @__PURE__ */ j({
15
14
  __name: "BaseCheckboxGroup",
16
15
  props: {
17
16
  ariaDescribedby: {},
@@ -37,98 +36,98 @@ const me = /* @__PURE__ */ z({
37
36
  readonly: { type: Boolean }
38
37
  },
39
38
  emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
40
- setup(L, { emit: D }) {
41
- const o = L, a = D;
39
+ setup(E, { emit: L }) {
40
+ const o = E, a = L;
42
41
  if (!Array.isArray(o.modelValue))
43
42
  throw new Error("Model value must be an array in checkbox group.");
44
- const { t: y } = U(), g = B(), i = B(!1), {
45
- getter: c,
46
- items: I,
47
- loading: $
48
- } = q({
43
+ const v = k(), i = k(!1), {
44
+ getter: u,
45
+ items: D,
46
+ loading: I
47
+ } = N({
49
48
  items: d(o, "items"),
50
49
  debounce: 0
51
- }), m = () => {
52
- o.enforceCoherence && !T.value && a("update:modelValue", F.value.coherent);
53
- }, { hasPrefilled: x } = Y({
50
+ }), c = () => {
51
+ o.enforceCoherence && !V.value && a("update:modelValue", P.value.coherent);
52
+ }, { hasPrefilled: $ } = Q({
54
53
  onStart: !0,
55
54
  currentValue: o.modelValue,
56
55
  multiple: !0,
57
56
  fn: async ({ prefill: e }) => {
58
- await c(e, o.modelValue), m();
57
+ await u(e, o.modelValue), c();
59
58
  }
60
- }), { data: V } = C({
59
+ }), { data: y } = w({
61
60
  items: d(o, "modelValue")
62
- }), { options: k } = J({
61
+ }), { options: g } = U({
63
62
  disabled: d(o, "disabled"),
64
- items: I,
63
+ items: D,
65
64
  itemText: o.itemText,
66
65
  itemValue: o.itemValue,
67
66
  max: o.max,
68
67
  selectable: !0,
69
- selectedIndexedByHash: V
68
+ selectedIndexedByHash: y
70
69
  }), H = async (e) => {
71
70
  a("update:modelValue", o.modelValue.concat(e.value));
72
- }, M = async (e) => {
73
- const t = { ...V.value };
71
+ }, x = async (e) => {
72
+ const t = { ...y.value };
74
73
  delete t[e.valueHash], a("update:modelValue", Object.values(t));
75
- }, { data: P } = C({
76
- items: k,
74
+ }, { data: M } = w({
75
+ items: g,
77
76
  key: "valueHash"
78
- }), { coherent: T, status: F } = Q({
77
+ }), { coherent: V, status: P } = q({
79
78
  modelValue: d(o, "modelValue"),
80
79
  multiple: !0,
81
- iteratee: (e) => !!P.value[X(e)]
80
+ iteratee: (e) => !!M.value[J(e)]
82
81
  });
83
82
  let r = 0;
84
- E(
83
+ C(
85
84
  () => o.modelValue,
86
85
  async () => {
87
- r++, T.value || (await c(!1, o.modelValue), m()), r--;
86
+ r++, V.value || (await u(!1, o.modelValue), c()), r--;
88
87
  },
89
88
  {
90
89
  debounce: o.modelValueDebounceTime
91
90
  }
92
- ), E(
91
+ ), C(
93
92
  () => [o.dependencies, o.items],
94
93
  async () => {
95
- x.value && (r++, await c(!1, o.modelValue), r === 1 && m(), r--);
94
+ $.value && (r++, await u(!1, o.modelValue), r === 1 && c(), r--);
96
95
  },
97
96
  {
98
97
  debounce: o.depsDebounceTime
99
98
  }
100
99
  );
101
- const O = (e) => {
100
+ const F = (e) => {
102
101
  if (o.id)
103
102
  return [o.id, e.valueHash].filter(Boolean).join("-");
104
- }, S = (e, t) => {
105
- a("change", e), t.selected ? M(t) : H(t);
106
- }, A = {
103
+ }, O = (e, t) => {
104
+ a("change", e), t.selected ? x(t) : H(t);
105
+ }, S = {
107
106
  onBlur: (e) => a("blur", e),
108
107
  onClick: (e) => a("click", e),
109
108
  onFocus: (e) => {
110
- a("focus", e), i.value || (document.addEventListener("focusin", p, { passive: !0 }), document.addEventListener("click", f, { passive: !0 }), i.value = !0);
109
+ a("focus", e), i.value || (document.addEventListener("focusin", m, { passive: !0 }), document.addEventListener("click", p, { passive: !0 }), i.value = !0);
111
110
  },
112
111
  onInput: (e) => a("input", e),
113
112
  onKeydown: (e) => a("keydown", e),
114
113
  onMousedown: (e) => a("mousedown", e),
115
114
  onMouseup: (e) => a("mouseup", e)
116
- }, p = (e) => {
115
+ }, m = (e) => {
117
116
  var t;
118
- e.target instanceof HTMLElement && ((t = g.value) != null && t.contains(e.target) || (a("inactive"), i.value = !1, document.removeEventListener("focusin", p), document.removeEventListener("click", f)));
119
- }, f = (e) => {
117
+ e.target instanceof HTMLElement && ((t = v.value) != null && t.contains(e.target) || (a("inactive"), i.value = !1, document.removeEventListener("focusin", m), document.removeEventListener("click", p)));
118
+ }, p = (e) => {
120
119
  var t;
121
- e.target instanceof HTMLElement && ((t = g.value) != null && t.contains(e.target) || (a("inactive"), i.value = !1, document.removeEventListener("focusin", p), document.removeEventListener("click", f)));
120
+ e.target instanceof HTMLElement && ((t = v.value) != null && t.contains(e.target) || (a("inactive"), i.value = !1, document.removeEventListener("focusin", m), document.removeEventListener("click", p)));
122
121
  };
123
- return (e, t) => (G(), R(N, {
122
+ return (e, t) => (z(), G(K, {
124
123
  class: "bb-base-checkbox-group",
125
124
  direction: e.direction,
126
125
  "has-errors": e.hasErrors,
127
126
  "hide-label": e.hideLabel,
128
- loading: !!u($),
129
- "loading-text": e.loadingText || u(y)("common.loadingText"),
130
- "no-data-text": e.noDataText || u(y)("common.noDataText"),
131
- options: u(k)
127
+ loading: !!B(I),
128
+ "loading-text": e.loadingText,
129
+ "no-data-text": e.noDataText,
130
+ options: B(g)
132
131
  }, {
133
132
  prepend: s(() => [
134
133
  l(e.$slots, "prepend")
@@ -140,16 +139,16 @@ const me = /* @__PURE__ */ z({
140
139
  l(e.$slots, "no-data")
141
140
  ]),
142
141
  label: s((n) => [
143
- l(e.$slots, "label", b(v(n)))
142
+ l(e.$slots, "label", h(b(n)))
144
143
  ]),
145
144
  "option:prepend": s((n) => [
146
- l(e.$slots, "option:prepend", b(v(n)))
145
+ l(e.$slots, "option:prepend", h(b(n)))
147
146
  ]),
148
- input: s(({ option: n, index: j }) => [
149
- W(K, w({
150
- id: O(n),
147
+ input: s(({ option: n, index: A }) => [
148
+ R(W, T({
149
+ id: F(n),
151
150
  "aria-describedby": e.ariaDescribedby,
152
- autofocus: e.autofocus && !j,
151
+ autofocus: e.autofocus && !A,
153
152
  checked: n.selected,
154
153
  color: e.color,
155
154
  disabled: n.disabled,
@@ -157,20 +156,20 @@ const me = /* @__PURE__ */ z({
157
156
  name: e.name,
158
157
  readonly: e.readonly,
159
158
  "true-value": n.value
160
- }, A, {
161
- onChange: (h) => S(h, n)
159
+ }, S, {
160
+ onChange: (f) => O(f, n)
162
161
  }), {
163
- icon: s((h) => [
164
- l(e.$slots, "icon", w({
162
+ icon: s((f) => [
163
+ l(e.$slots, "icon", T({
165
164
  item: n.item,
166
165
  text: n.text
167
- }, h))
166
+ }, f))
168
167
  ]),
169
168
  _: 2
170
169
  }, 1040, ["id", "aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "name", "readonly", "true-value", "onChange"])
171
170
  ]),
172
171
  "option:append": s((n) => [
173
- l(e.$slots, "option:append", b(v(n)))
172
+ l(e.$slots, "option:append", h(b(n)))
174
173
  ]),
175
174
  append: s(() => [
176
175
  l(e.$slots, "append")
@@ -180,5 +179,5 @@ const me = /* @__PURE__ */ z({
180
179
  }
181
180
  });
182
181
  export {
183
- me as default
182
+ de as default
184
183
  };
package/dist/index207.js CHANGED
@@ -1,4 +1,10 @@
1
- const s = (r) => !!r && !!r.match(/^(#|var\(--|(rgb|hsl)a?\()/);
1
+ const o = "bitboss-ui | ", e = () => ({
2
+ warn: (r) => console.warn(`${o}${r}`),
3
+ error: (r) => console.error(`${o}${r}`),
4
+ throw: (r) => {
5
+ throw new Error(`${o}${r}`);
6
+ }
7
+ });
2
8
  export {
3
- s as isCssColor
9
+ e as useLogger
4
10
  };
package/dist/index208.js CHANGED
@@ -1,6 +1,5 @@
1
- import { curry as e } from "./index267.js";
2
- const t = (n, o, r) => n(r) ? o(r) : r, s = e(t);
1
+ import { hash as o } from "./index270.js";
2
+ const t = (r, h = "bb") => `${h}${o(r)}`;
3
3
  export {
4
- t as baseWhen,
5
- s as when
4
+ t as hash
6
5
  };
package/dist/index209.js CHANGED
@@ -1,4 +1,55 @@
1
- const o = (e) => typeof e == "boolean" ? e : e === "true";
1
+ import { defineComponent as f, ref as d, openBlock as r, createElementBlock as _, renderSlot as e, createElementVNode as t, createBlock as s, unref as p, createCommentVNode as i, createVNode as c } from "vue";
2
+ /* empty css */
3
+ /* empty css */
4
+ import a from "./index127.js";
5
+ /* empty css */
6
+ import $ from "./index129.js";
7
+ /* empty css */
8
+ import b from "./index315.js";
9
+ const y = { class: "bb-common-input-inner-container__prefix" }, k = { class: "bb-common-input-inner-container__suffix" }, S = /* @__PURE__ */ f({
10
+ __name: "CommonInputInnerContainer",
11
+ props: {
12
+ "append:icon": {},
13
+ "prepend:icon": {},
14
+ preventFocus: { type: Boolean }
15
+ },
16
+ setup(m) {
17
+ const u = m, o = d(), l = () => {
18
+ var n;
19
+ !o.value || u.preventFocus || (n = o.value.querySelector("input")) == null || n.focus();
20
+ };
21
+ return (n, C) => (r(), _("span", {
22
+ ref_key: "container",
23
+ ref: o,
24
+ class: "bb-common-input-inner-container",
25
+ onClick: l
26
+ }, [
27
+ e(n.$slots, "prepend", {}, () => [
28
+ t("span", y, [
29
+ e(n.$slots, "prefix")
30
+ ])
31
+ ]),
32
+ n.$props["prepend:icon"] ? (r(), s(p(a), {
33
+ key: 0,
34
+ class: "bb-common-input-inner-container__prepend-icon",
35
+ type: n.$props["prepend:icon"]
36
+ }, null, 8, ["type"])) : i("", !0),
37
+ e(n.$slots, "default"),
38
+ n.$props["append:icon"] ? (r(), s(p(a), {
39
+ key: 1,
40
+ class: "bb-common-input-inner-container__append-icon",
41
+ type: n.$props["append:icon"]
42
+ }, null, 8, ["type"])) : i("", !0),
43
+ c(p($)),
44
+ c(b),
45
+ e(n.$slots, "append", {}, () => [
46
+ t("span", k, [
47
+ e(n.$slots, "suffix")
48
+ ])
49
+ ])
50
+ ], 512));
51
+ }
52
+ });
2
53
  export {
3
- o as booleanishToBoolean
54
+ S as default
4
55
  };
package/dist/index21.js CHANGED
@@ -1,29 +1,32 @@
1
- import { defineComponent as z, ref as b, watch as U, openBlock as m, createElementBlock as k, createVNode as i, createElementVNode as r, unref as u, withCtx as n, createTextVNode as P, toDisplayString as W, createSlots as x, renderList as E, renderSlot as I, normalizeProps as T, guardReactiveProps as j, createBlock as w, createCommentVNode as V } from "vue";
1
+ import { defineComponent as E, watchPostEffect as W, ref as v, watch as I, openBlock as c, createElementBlock as w, createVNode as n, createElementVNode as r, unref as i, withCtx as u, createTextVNode as T, toDisplayString as m, createSlots as j, renderList as H, renderSlot as R, normalizeProps as Z, guardReactiveProps as q, createBlock as _, createCommentVNode as V } from "vue";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import { useId as H } from "./index8.js";
5
- import p from "./index13.js";
4
+ import { _config as C } from "./index4.js";
5
+ import { useId as F } from "./index8.js";
6
+ import f from "./index13.js";
6
7
  /* empty css */
7
- import s from "./index210.js";
8
- import R from "./index211.js";
9
- import Z from "./index212.js";
10
- import q from "./index213.js";
11
- import F from "./index214.js";
12
- import G from "./index215.js";
13
- import { hash as h } from "./index216.js";
14
- import { last as J } from "./index217.js";
15
- import { useLogger as K } from "./index218.js";
16
- import Q from "./index219.js";
17
- import X from "./index220.js";
18
- import ee from "./index221.js";
19
- import C from "./index222.js";
20
- import ae from "./index223.js";
21
- const le = { class: "bb-base-date-picker" }, te = { class: "bb-base-date-picker__body" }, oe = { class: "bb-base-date-picker__controls" }, re = {
8
+ import s from "./index224.js";
9
+ import G from "./index225.js";
10
+ import J from "./index226.js";
11
+ import K from "./index227.js";
12
+ import Q from "./index228.js";
13
+ import X from "./index229.js";
14
+ import ee from "./index230.js";
15
+ import { hash as M } from "./index208.js";
16
+ import { last as ae } from "./index231.js";
17
+ import { useLogger as te } from "./index207.js";
18
+ import oe from "./index232.js";
19
+ import le from "./index233.js";
20
+ import re from "./index234.js";
21
+ import B from "./index235.js";
22
+ import se from "./index236.js";
23
+ import { useLocale as de } from "./index217.js";
24
+ const ie = { class: "bb-base-date-picker" }, ne = { class: "bb-base-date-picker__body" }, ue = { class: "bb-base-date-picker__controls" }, me = { class: "sr-only" }, pe = { class: "sr-only" }, ce = { class: "sr-only" }, fe = {
22
25
  style: { transform: "rotate(180deg)" },
23
26
  viewBox: "0 0 24 24",
24
27
  width: "24px",
25
28
  xmlns: "http://www.w3.org/2000/svg"
26
- }, se = { class: "bb-base-date-picker__content" }, Se = /* @__PURE__ */ z({
29
+ }, be = { class: "sr-only" }, ve = { class: "bb-base-date-picker__content" }, Ie = /* @__PURE__ */ E({
27
30
  __name: "BaseDatePicker",
28
31
  props: {
29
32
  disabled: { type: Boolean },
@@ -39,79 +42,83 @@ const le = { class: "bb-base-date-picker" }, te = { class: "bb-base-date-picker_
39
42
  selectable: {}
40
43
  },
41
44
  emits: ["update:modelValue"],
42
- setup(B, { expose: _, emit: M }) {
43
- s.extend(G), s.extend(F), s.extend(R), s.extend(Z), s.locale(q);
44
- const O = M, t = B;
45
+ setup(L, { expose: O, emit: S }) {
46
+ s.extend(ee), s.extend(X), s.extend(G), s.extend(J);
47
+ const $ = { it: K, en: Q };
48
+ W(() => {
49
+ s.locale($[C.locale]);
50
+ });
51
+ const P = S, o = L, { t: p } = de();
45
52
  s.updateLocale("it", {
46
- weekStart: t.firstDayOfWeek
53
+ weekStart: o.firstDayOfWeek
47
54
  });
48
- const S = t.id || H().id, c = K();
49
- t.multiple && t.range && c.throw("Date picker cannot be both multiple and range."), (t.multiple || t.range) && (Array.isArray(t.modelValue) || c.throw(
55
+ const A = o.id || F().id, y = te();
56
+ o.multiple && o.range && y.throw("Date picker cannot be both multiple and range."), (o.multiple || o.range) && (Array.isArray(o.modelValue) || y.throw(
50
57
  "Date picker is set to select multiple dates but modelValue is not an array."
51
58
  ));
52
- const l = b(s()), v = (e) => {
59
+ const a = v(s()), k = (e) => {
53
60
  if (e)
54
61
  if (Array.isArray(e)) {
55
62
  if (e.length) {
56
- if (e.map((d) => s(d).valueOf()).includes(l.value.valueOf()))
63
+ if (e.map((d) => s(d).valueOf()).includes(a.value.valueOf()))
57
64
  return;
58
- l.value = s(J(e)).startOf("day");
65
+ a.value = s(ae(e)).startOf("day");
59
66
  return;
60
67
  }
61
68
  } else
62
- l.value = s(e).startOf("day");
69
+ a.value = s(e).startOf("day");
63
70
  else
64
- l.value = s().startOf("day");
71
+ a.value = s().startOf("day");
65
72
  };
66
- v(t.modelValue);
67
- const o = b("day"), y = (e) => {
68
- o.value === e ? o.value = "day" : o.value = e;
69
- }, $ = (e) => {
70
- l.value = l.value.set("month", e);
71
- }, L = () => {
72
- l.value = l.value.add(1, "month");
73
- }, A = () => {
74
- l.value = l.value.subtract(1, "month");
73
+ k(o.modelValue);
74
+ const l = v("day"), h = (e) => {
75
+ l.value === e ? l.value = "day" : l.value = e;
75
76
  }, D = (e) => {
76
- l.value = l.value.set("year", e);
77
- }, f = b(t.modelValue), N = (e) => {
78
- f.value = e, O("update:modelValue", e);
77
+ a.value = a.value.set("month", e);
78
+ }, N = () => {
79
+ a.value = a.value.add(1, "month");
80
+ }, Y = () => {
81
+ a.value = a.value.subtract(1, "month");
82
+ }, U = (e) => {
83
+ a.value = a.value.set("year", e);
84
+ }, b = v(o.modelValue), x = (e) => {
85
+ b.value = e, P("update:modelValue", e);
79
86
  };
80
- return U(
81
- () => t.modelValue,
87
+ return I(
88
+ () => o.modelValue,
82
89
  () => {
83
- h(t.modelValue) !== h(f.value) && (f.value = t.modelValue, v(t.modelValue));
90
+ M(o.modelValue) !== M(b.value) && (b.value = o.modelValue, k(o.modelValue));
84
91
  }
85
- ), _({
92
+ ), O({
86
93
  resetStatus: () => {
87
- o.value = "day";
94
+ l.value = "day";
88
95
  }
89
- }), (e, a) => (m(), k("div", le, [
90
- i(X, {
91
- cursor: l.value,
96
+ }), (e, t) => (c(), w("div", ie, [
97
+ n(le, {
98
+ cursor: a.value,
92
99
  disabled: !!e.disabled,
93
100
  hidden: !e.header
94
101
  }, null, 8, ["cursor", "disabled", "hidden"]),
95
- r("div", te, [
96
- r("div", oe, [
97
- i(u(p), {
102
+ r("div", ne, [
103
+ r("div", ue, [
104
+ n(i(f), {
98
105
  class: "bb-base-date-picker__control bb-base-date-picker__month-control",
99
106
  disabled: e.disabled,
100
- onClick: a[0] || (a[0] = (d) => y("month"))
107
+ onClick: t[0] || (t[0] = (d) => h("month"))
101
108
  }, {
102
- default: n(() => [
103
- P(W(l.value.format("MMMM YYYY")) + " ", 1),
104
- a[5] || (a[5] = r("span", { class: "sr-only" }, "Seleziona un mese", -1))
109
+ default: u(() => [
110
+ T(m(a.value.locale(i(C).locale).format("MMMM YYYY")) + " ", 1),
111
+ r("span", me, m(i(p)("datePicker.monthLabel")), 1)
105
112
  ]),
106
113
  _: 1
107
114
  }, 8, ["disabled"]),
108
- i(u(p), {
115
+ n(i(f), {
109
116
  class: "bb-base-date-picker__control bb-base-date-picker__year-control",
110
117
  disabled: e.disabled,
111
- onClick: a[1] || (a[1] = (d) => y("year"))
118
+ onClick: t[1] || (t[1] = (d) => h("year"))
112
119
  }, {
113
- default: n(() => a[6] || (a[6] = [
114
- r("svg", {
120
+ default: u(() => [
121
+ t[5] || (t[5] = r("svg", {
115
122
  fill: "none",
116
123
  height: "6",
117
124
  viewBox: "0 0 10 6",
@@ -122,18 +129,18 @@ const le = { class: "bb-base-date-picker" }, te = { class: "bb-base-date-picker_
122
129
  d: "M5.24124 5.81871L9.52771 1.39839C9.79517 1.12257 9.63305 0.595276 9.28077 0.595276H0.707839C0.355562 0.595276 0.193433 1.12257 0.460901 1.39839L4.74736 5.81871C4.88946 5.96524 5.09914 5.96524 5.24124 5.81871Z",
123
130
  fill: "currentColor"
124
131
  })
125
- ], -1),
126
- r("span", { class: "sr-only" }, "Seleziona anno", -1)
127
- ])),
132
+ ], -1)),
133
+ r("span", pe, m(i(p)("datePicker.yearLabel")), 1)
134
+ ]),
128
135
  _: 1
129
136
  }, 8, ["disabled"]),
130
- i(u(p), {
137
+ n(i(f), {
131
138
  class: "bb-base-date-picker__control",
132
- disabled: e.disabled || o.value !== "day",
133
- onClick: A
139
+ disabled: e.disabled || l.value !== "day",
140
+ onClick: Y
134
141
  }, {
135
- default: n(() => a[7] || (a[7] = [
136
- r("svg", {
142
+ default: u(() => [
143
+ t[6] || (t[6] = r("svg", {
137
144
  viewBox: "0 0 24 24",
138
145
  width: "24px",
139
146
  xmlns: "http://www.w3.org/2000/svg"
@@ -142,36 +149,36 @@ const le = { class: "bb-base-date-picker" }, te = { class: "bb-base-date-picker_
142
149
  d: "M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z",
143
150
  fill: "currentColor"
144
151
  })
145
- ], -1),
146
- r("span", { class: "sr-only" }, "Vai indietro di un mese", -1)
147
- ])),
152
+ ], -1)),
153
+ r("span", ce, m(i(p)("datePicker.previousMonthLabel")), 1)
154
+ ]),
148
155
  _: 1
149
156
  }, 8, ["disabled"]),
150
- i(u(p), {
157
+ n(i(f), {
151
158
  class: "bb-base-date-picker__control",
152
- disabled: e.disabled || o.value !== "day",
153
- onClick: L
159
+ disabled: e.disabled || l.value !== "day",
160
+ onClick: N
154
161
  }, {
155
- default: n(() => [
156
- (m(), k("svg", re, a[8] || (a[8] = [
162
+ default: u(() => [
163
+ (c(), w("svg", fe, t[7] || (t[7] = [
157
164
  r("path", {
158
165
  d: "M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z",
159
166
  fill: "currentColor"
160
167
  }, null, -1)
161
168
  ]))),
162
- a[9] || (a[9] = r("span", { class: "sr-only" }, "Vai avanti di un mese", -1))
169
+ r("span", be, m(i(p)("datePicker.nextMonthLabel")), 1)
163
170
  ]),
164
171
  _: 1
165
172
  }, 8, ["disabled"])
166
173
  ]),
167
- r("div", se, [
168
- i(Q, {
169
- id: u(S),
170
- current: o.value === "day",
171
- cursor: l.value,
174
+ r("div", ve, [
175
+ n(oe, {
176
+ id: i(A),
177
+ current: l.value === "day",
178
+ cursor: a.value,
172
179
  disabled: !!e.disabled,
173
180
  "first-day-of-week": e.firstDayOfWeek,
174
- inert: o.value !== "day",
181
+ inert: l.value !== "day",
175
182
  max: e.max,
176
183
  min: e.min,
177
184
  "model-value": e.modelValue,
@@ -179,45 +186,45 @@ const le = { class: "bb-base-date-picker" }, te = { class: "bb-base-date-picker_
179
186
  range: e.range,
180
187
  readonly: e.readonly,
181
188
  selectable: e.selectable,
182
- "onUpdate:cursor": a[2] || (a[2] = (d) => l.value = d),
183
- "onUpdate:modelValue": N
184
- }, x({ _: 2 }, [
185
- E(e.$slots, (d, g) => ({
189
+ "onUpdate:cursor": t[2] || (t[2] = (d) => a.value = d),
190
+ "onUpdate:modelValue": x
191
+ }, j({ _: 2 }, [
192
+ H(e.$slots, (d, g) => ({
186
193
  name: g,
187
- fn: n((Y) => [
188
- I(e.$slots, g, T(j(Y)))
194
+ fn: u((z) => [
195
+ R(e.$slots, g, Z(q(z)))
189
196
  ])
190
197
  }))
191
198
  ]), 1032, ["id", "current", "cursor", "disabled", "first-day-of-week", "inert", "max", "min", "model-value", "multiple", "range", "readonly", "selectable"]),
192
- i(C, {
199
+ n(B, {
193
200
  direction: "right",
194
201
  duration: 500,
195
202
  gap: 30
196
203
  }, {
197
- default: n(() => [
198
- o.value === "month" ? (m(), w(ee, {
204
+ default: u(() => [
205
+ l.value === "month" ? (c(), _(re, {
199
206
  key: 0,
200
- cursor: l.value,
207
+ cursor: a.value,
201
208
  disabled: !!e.disabled,
202
- "onUpdate:month": a[3] || (a[3] = (d) => {
203
- $(d), o.value = "day";
209
+ "onUpdate:month": t[3] || (t[3] = (d) => {
210
+ D(d), l.value = "day";
204
211
  })
205
212
  }, null, 8, ["cursor", "disabled"])) : V("", !0)
206
213
  ]),
207
214
  _: 1
208
215
  }),
209
- i(C, {
216
+ n(B, {
210
217
  direction: "top",
211
218
  duration: 500,
212
219
  gap: 30
213
220
  }, {
214
- default: n(() => [
215
- o.value === "year" ? (m(), w(ae, {
221
+ default: u(() => [
222
+ l.value === "year" ? (c(), _(se, {
216
223
  key: 0,
217
- cursor: l.value,
224
+ cursor: a.value,
218
225
  disabled: !!e.disabled,
219
- "onUpdate:year": a[4] || (a[4] = (d) => {
220
- D(d), o.value = "day";
226
+ "onUpdate:year": t[4] || (t[4] = (d) => {
227
+ U(d), l.value = "day";
221
228
  })
222
229
  }, null, 8, ["cursor", "disabled"])) : V("", !0)
223
230
  ]),
@@ -229,5 +236,5 @@ const le = { class: "bb-base-date-picker" }, te = { class: "bb-base-date-picker_
229
236
  }
230
237
  });
231
238
  export {
232
- Se as default
239
+ Ie as default
233
240
  };