bitboss-ui 2.0.171 → 2.0.173

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 (192) hide show
  1. package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +97 -7
  2. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +2 -2
  3. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +28 -8
  4. package/dist/components/BbPopover/BbPopover.vue.d.ts +30 -10
  5. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +28 -8
  6. package/dist/components/CommonPopover.vue.d.ts +8 -4
  7. package/dist/index.css +1 -1
  8. package/dist/index106.js +8 -8
  9. package/dist/index111.js +1 -1
  10. package/dist/index113.js +1 -1
  11. package/dist/index121.js +10 -10
  12. package/dist/index129.js +2 -2
  13. package/dist/index13.js +1 -1
  14. package/dist/index131.js +40 -39
  15. package/dist/index133.js +1 -1
  16. package/dist/index139.js +2 -2
  17. package/dist/index15.js +130 -142
  18. package/dist/index17.js +3 -3
  19. package/dist/index19.js +8 -8
  20. package/dist/index209.js +5 -2
  21. package/dist/index21.js +16 -16
  22. package/dist/index210.js +5 -4
  23. package/dist/index211.js +5 -2
  24. package/dist/index212.js +5 -18
  25. package/dist/index213.js +5 -128
  26. package/dist/index214.js +5 -106
  27. package/dist/index215.js +7 -0
  28. package/dist/index216.js +3 -100
  29. package/dist/index217.js +4 -0
  30. package/dist/index218.js +6 -64
  31. package/dist/index219.js +252 -0
  32. package/dist/index220.js +52 -13
  33. package/dist/index221.js +43 -5
  34. package/dist/index222.js +5 -15
  35. package/dist/index223.js +60 -29
  36. package/dist/index224.js +13 -16
  37. package/dist/index225.js +2 -12
  38. package/dist/index226.js +2 -51
  39. package/dist/index227.js +2 -17
  40. package/dist/index228.js +66 -15
  41. package/dist/index23.js +140 -174
  42. package/dist/index230.js +13 -12
  43. package/dist/index231.js +177 -13
  44. package/dist/index232.js +41 -2
  45. package/dist/index233.js +5 -227
  46. package/dist/index234.js +7 -368
  47. package/dist/index235.js +15 -2
  48. package/dist/index236.js +86 -5
  49. package/dist/index238.js +29 -5
  50. package/dist/index239.js +16 -5
  51. package/dist/index240.js +17 -5
  52. package/dist/index241.js +51 -5
  53. package/dist/index242.js +15 -5
  54. package/dist/index243.js +12 -8
  55. package/dist/index244.js +30 -246
  56. package/dist/index245.js +3 -52
  57. package/dist/index246.js +5 -44
  58. package/dist/index247.js +2 -5
  59. package/dist/index248.js +11 -60
  60. package/dist/index249.js +20 -5
  61. package/dist/index25.js +5 -5
  62. package/dist/index250.js +120 -2
  63. package/dist/index252.js +4 -20
  64. package/dist/index253.js +4 -94
  65. package/dist/index254.js +202 -0
  66. package/dist/index256.js +18 -4
  67. package/dist/index257.js +12 -200
  68. package/dist/index258.js +108 -0
  69. package/dist/index260.js +95 -81
  70. package/dist/index262.js +224 -30
  71. package/dist/index265.js +10 -3
  72. package/dist/index266.js +2 -176
  73. package/dist/index267.js +6 -10
  74. package/dist/index268.js +16 -3
  75. package/dist/index269.js +3 -6
  76. package/dist/index27.js +1 -1
  77. package/dist/index270.js +2 -16
  78. package/dist/index271.js +9 -11
  79. package/dist/index272.js +8 -100
  80. package/dist/index273.js +25 -0
  81. package/dist/index274.js +9 -3
  82. package/dist/index275.js +8 -9
  83. package/dist/index276.js +67 -23
  84. package/dist/index277.js +5 -2
  85. package/dist/index278.js +280 -9
  86. package/dist/index279.js +2 -8
  87. package/dist/index280.js +16 -5
  88. package/dist/index281.js +2 -67
  89. package/dist/index282.js +15 -4
  90. package/dist/index283.js +2 -8
  91. package/dist/index284.js +19 -4
  92. package/dist/index285.js +2 -4
  93. package/dist/index286.js +14 -128
  94. package/dist/index287.js +2 -3
  95. package/dist/index288.js +19 -3
  96. package/dist/index289.js +2 -3
  97. package/dist/index29.js +2 -2
  98. package/dist/index290.js +29 -0
  99. package/dist/index291.js +2 -7
  100. package/dist/index292.js +1 -1
  101. package/dist/index293.js +1 -1
  102. package/dist/index294.js +2 -17
  103. package/dist/index295.js +2 -28
  104. package/dist/index296.js +28 -7
  105. package/dist/index297.js +22 -11
  106. package/dist/index299.js +7 -2
  107. package/dist/index300.js +7 -16
  108. package/dist/index301.js +11 -2
  109. package/dist/index302.js +5 -15
  110. package/dist/index303.js +3 -2
  111. package/dist/index305.js +2 -2
  112. package/dist/index306.js +3 -15
  113. package/dist/index307.js +17 -2
  114. package/dist/index308.js +469 -17
  115. package/dist/index309.js +2 -2
  116. package/dist/index31.js +2 -2
  117. package/dist/index310.js +199 -26
  118. package/dist/index311.js +5 -2
  119. package/dist/index312.js +4 -2
  120. package/dist/index313.js +125 -2
  121. package/dist/index314.js +2 -2
  122. package/dist/index315.js +3 -2
  123. package/dist/index316.js +3 -22
  124. package/dist/{index353.js → index317.js} +1 -1
  125. package/dist/index318.js +3 -125
  126. package/dist/index319.js +2 -2
  127. package/dist/index320.js +4 -470
  128. package/dist/index321.js +8 -3
  129. package/dist/index322.js +5 -3
  130. package/dist/index323.js +3 -381
  131. package/dist/index324.js +700 -125
  132. package/dist/index325.js +354 -2
  133. package/dist/index326.js +58 -3
  134. package/dist/index327.js +2 -6
  135. package/dist/index328.js +32 -199
  136. package/dist/index329.js +28 -5
  137. package/dist/index33.js +8 -8
  138. package/dist/index331.js +7 -354
  139. package/dist/index332.js +17 -56
  140. package/dist/index333.js +58 -3
  141. package/dist/index334.js +58 -5
  142. package/dist/index335.js +6 -46
  143. package/dist/index336.js +47 -2
  144. package/dist/index337.js +128 -32
  145. package/dist/index338.js +369 -28
  146. package/dist/index339.js +10 -0
  147. package/dist/index340.js +6 -58
  148. package/dist/index341.js +7 -57
  149. package/dist/index342.js +227 -6
  150. package/dist/index343.js +92 -7
  151. package/dist/index345.js +3 -8
  152. package/dist/index346.js +482 -5
  153. package/dist/index347.js +128 -6
  154. package/dist/index348.js +46 -18
  155. package/dist/index349.js +431 -223
  156. package/dist/index35.js +4 -4
  157. package/dist/index350.js +125 -91
  158. package/dist/index37.js +230 -240
  159. package/dist/index39.js +2 -2
  160. package/dist/index41.js +2 -2
  161. package/dist/index43.js +8 -8
  162. package/dist/index45.js +8 -8
  163. package/dist/index47.js +2 -2
  164. package/dist/index49.js +3 -3
  165. package/dist/index53.js +1 -1
  166. package/dist/index55.js +1 -1
  167. package/dist/index57.js +1 -1
  168. package/dist/index61.js +3 -3
  169. package/dist/index67.js +1 -1
  170. package/dist/index79.js +106 -112
  171. package/dist/index81.js +1 -1
  172. package/dist/index83.js +2 -2
  173. package/dist/index85.js +1 -1
  174. package/dist/index87.js +1 -1
  175. package/dist/index90.js +4 -4
  176. package/dist/index92.js +2 -2
  177. package/dist/index94.js +56 -56
  178. package/package.json +2 -2
  179. package/dist/components/CommonFloating.vue.d.ts +0 -38
  180. package/dist/index229.js +0 -5
  181. package/dist/index237.js +0 -7
  182. package/dist/index251.js +0 -43
  183. package/dist/index255.js +0 -11
  184. package/dist/index259.js +0 -9
  185. package/dist/index298.js +0 -282
  186. package/dist/index304.js +0 -21
  187. package/dist/index330.js +0 -703
  188. package/dist/index344.js +0 -8
  189. package/dist/index351.js +0 -484
  190. package/dist/index354.js +0 -49
  191. package/dist/index355.js +0 -483
  192. package/dist/index356.js +0 -4
package/dist/index23.js CHANGED
@@ -1,31 +1,27 @@
1
- import { defineComponent as ee, watchEffect as te, ref as r, computed as D, watch as ae, createBlock as B, openBlock as O, normalizeClass as $, withCtx as n, createVNode as _, createCommentVNode as re, unref as l, withDirectives as oe, createElementVNode as i, mergeProps as P, withModifiers as ne, toDisplayString as E, renderSlot as p } from "vue";
2
- import o from "./index236.js";
3
- import le from "./index249.js";
4
- import ie from "./index237.js";
5
- import se from "./index238.js";
6
- import ue from "./index239.js";
7
- import de from "./index240.js";
8
- import { identity as ce } from "./index250.js";
9
- import { last as pe } from "./index211.js";
10
- import { useFocusTrap as me } from "./index251.js";
11
- import { useId as fe } from "./index8.js";
12
- import { useIntersectionObserver as be } from "./index137.js";
13
- import { useLocale as ve } from "./index231.js";
14
- import { useMobile as ke } from "./index9.js";
15
- import { vMaska as ge } from "./index252.js";
16
- import { wait as ye } from "./index135.js";
17
- import { waitFor as he } from "./index221.js";
18
- import De from "./index21.js";
1
+ import { defineComponent as K, watchEffect as Q, ref as l, computed as k, watch as D, createBlock as C, openBlock as Y, normalizeClass as w, withCtx as i, createVNode as B, unref as r, createCommentVNode as X, withDirectives as x, createElementVNode as s, mergeProps as S, withModifiers as ee, toDisplayString as E, renderSlot as c } from "vue";
2
+ import { _config as te } from "./index4.js";
3
+ import o from "./index209.js";
4
+ import ae from "./index246.js";
5
+ import oe from "./index213.js";
6
+ import re from "./index210.js";
7
+ import ne from "./index211.js";
8
+ import le from "./index212.js";
9
+ import { identity as ie } from "./index226.js";
10
+ import { isEmpty as se } from "./index247.js";
11
+ import { last as de } from "./index217.js";
12
+ import { useId as ue } from "./index8.js";
13
+ import { useLocale as pe } from "./index224.js";
14
+ import { useMobile as ce } from "./index9.js";
15
+ import { useUntil as me } from "./index248.js";
16
+ import { vMaska as fe } from "./index249.js";
17
+ import be from "./index21.js";
19
18
  /* empty css */
20
- import Me from "./index253.js";
19
+ import ge from "./index228.js";
21
20
  /* empty css */
22
- import Ve from "./index218.js";
21
+ import ke from "./index230.js";
22
+ import ye from "./index250.js";
23
23
  /* empty css */
24
- import we from "./index220.js";
25
- import { _config as Ce } from "./index4.js";
26
- import { isEmpty as Ye } from "./index232.js";
27
- import { debounce as Se } from "./index255.js";
28
- const Ie = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska", "disabled", "inputmode", "name", "placeholder", "readonly", "required", "value"], Be = ["aria-label", "disabled"], Oe = ["id"], $e = ["inert"], nt = /* @__PURE__ */ ee({
24
+ const ve = ["inert"], Ve = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska", "disabled", "inputmode", "name", "placeholder", "readonly", "required", "value"], Me = ["aria-label", "disabled"], he = ["id"], ze = /* @__PURE__ */ K({
29
25
  __name: "BaseDatePickerInput",
30
26
  props: {
31
27
  allowWriting: { type: [Boolean, String], default: !0 },
@@ -52,93 +48,64 @@ const Ie = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska",
52
48
  teleportTarget: {}
53
49
  },
54
50
  emits: ["active", "error", "focus", "inactive", "update:modelValue"],
55
- setup(L, { emit: A }) {
56
- const F = { it: ue, en: de };
57
- o.extend(le), o.extend(ie), o.extend(se), te(() => {
58
- o.locale(F[Ce.locale]);
51
+ setup(I, { emit: $ }) {
52
+ const L = { it: le, en: oe };
53
+ o.extend(ae), o.extend(re), o.extend(ne), Q(() => {
54
+ o.locale(L[te.locale]);
59
55
  });
60
- const t = L, s = A, { t: u } = ve(), m = r(null), M = r(null), f = r(null), j = r(null), v = r(null), C = r(), k = t.id || `bdpi-${fe().id.value}`, { isMobile: q } = ke(), W = D(
61
- () => t.allowWriting === "not-mobile" && q.value ? "none" : "numeric"
62
- ), V = r(!0);
63
- be(
64
- // @ts-expect-error wrong inferred type
65
- f,
66
- Se(([{ intersectionRatio: e }]) => {
67
- e === 1 ? V.value = !0 : (V.value = !1, d.value && (I(), f.value && f.value.$el.querySelector(
68
- ".bb-base-date-picker-input__calendar-btn"
69
- ).focus({ preventScroll: !0 }), h()));
70
- }, 100),
71
- { threshold: [0, 1] }
72
- );
73
- const H = D(() => ({
56
+ const t = I, d = $, { t: u } = pe(), v = l(null), y = l(null), O = l(null), _ = l(null), m = l(null), V = l(), f = t.id || `bdpi-${ue().id.value}`, { isMobile: P } = ce(), F = k(
57
+ () => t.allowWriting === "not-mobile" && P.value ? "none" : "numeric"
58
+ ), j = k(() => ({
74
59
  "bb-base-date-picker-input": !0,
75
- "bb-base-date-picker-input--active": g.value,
60
+ "bb-base-date-picker-input--active": b.value,
76
61
  "bb-base-date-picker-input--errors": t.hasErrors,
77
62
  "bb-base-date-picker-input--loading": t.loading,
78
63
  "bb-base-date-picker-input--readonly": t.readonly,
79
64
  "bb-base-date-picker-input--disabled": t.disabled,
80
65
  "bb-base-date-picker-input--compact": t.compact
81
- })), T = {
66
+ })), A = {
82
67
  onInput: (e) => {
83
68
  if (!t.range && e.target instanceof HTMLInputElement)
84
- if (v.value = e.target.value, /\d{2}\/\d{2}\/\d{4}/.test(e.target.value)) {
69
+ if (m.value = e.target.value, /\d{2}\/\d{2}\/\d{4}/.test(e.target.value)) {
85
70
  const a = o(e.target.value, "DD/MM/YYYY");
86
- Q(a) ? (e.target.value = "", s("update:modelValue", null), s("error", "invalid_date_typed")) : s("update:modelValue", a.toISOString());
87
- } else e.target.value === "" && s("update:modelValue", null);
71
+ Z(a) ? (e.target.value = "", d("update:modelValue", null), d("error", "invalid_date_typed")) : d("update:modelValue", a.toISOString());
72
+ } else e.target.value === "" && d("update:modelValue", null);
88
73
  }
89
- }, g = r(!1), R = () => {
90
- g.value || (s("active"), g.value = !0, document.addEventListener("focusin", y), document.addEventListener("click", y));
91
- }, y = (e) => {
92
- var a, c;
93
- b.value || e.target instanceof HTMLElement && (a = M.value) != null && a.$el && !M.value.$el.contains(e.target) && !((c = m.value) != null && c.contains(e.target)) && (g.value = !1, s("inactive"), document.removeEventListener("focusin", y), document.removeEventListener("click", y));
94
- }, Y = (e) => {
74
+ }, b = l(!1), H = () => {
75
+ b.value || (d("active"), b.value = !0, document.addEventListener("focusin", g), document.addEventListener("click", g));
76
+ }, g = (e) => {
77
+ var a, p;
78
+ e.target instanceof HTMLElement && (a = y.value) != null && a.$el && !y.value.$el.contains(e.target) && !((p = v.value) != null && p.contains(e.target)) && (b.value = !1, d("inactive"), document.removeEventListener("focusin", g), document.removeEventListener("click", g));
79
+ }, M = (e) => {
95
80
  if (e)
96
81
  if (Array.isArray(e)) {
97
- let a, c;
98
- return e.length && (a = e[0]), e.length > 1 && (c = pe(e)), [a, c].filter(ce).map((x) => o(x).format("DD/MM/YYYY")).join(" - ");
82
+ let a, p;
83
+ return e.length && (a = e[0]), e.length > 1 && (p = de(e)), [a, p].filter(ie).map((J) => o(J).format("DD/MM/YYYY")).join(" - ");
99
84
  } else
100
85
  return o(e).format("DD/MM/YYYY");
101
86
  return null;
102
- }, N = D(() => v.value ? v.value : Y(t.modelValue));
103
- ae(
87
+ }, W = k(() => m.value ? m.value : M(t.modelValue));
88
+ D(
104
89
  () => t.modelValue,
105
90
  (e) => {
106
- v.value = Y(e);
91
+ m.value = M(e);
107
92
  }
108
93
  );
109
- const d = r(!1), z = async () => {
110
- d.value = !0;
111
- }, h = async () => {
112
- var e;
113
- d.value = !1, (e = C.value) == null || e.resetStatus();
114
- }, S = r(!1), U = async () => {
115
- b.value || (S.value = !0, await he(() => !!m.value), await z(), Z());
116
- }, b = r(!1), { activate: Z, deactivate: I } = me(m, {
117
- onActivate: () => b.value = !0,
118
- // On post activation focus on current date
119
- onPostActivate: () => {
120
- var e;
121
- (e = m.value.querySelector(
122
- ".bb-base-date-picker-date--current button"
123
- )) == null || e.focus();
124
- },
125
- onPostDeactivate: async () => {
126
- await ye(200), b.value = !1;
127
- },
128
- /* On esc deactivate the trap, return focus and then close the modal */
129
- escapeDeactivates: () => (w.value = !1, h(), !0),
130
- clickOutsideDeactivates: () => (w.value = !1, h(), !0),
131
- allowOutsideClick: !0,
132
- preventScroll: !0
133
- }), w = r(!t.allowWriting || t.range), G = (e) => t.range && Array.isArray(e) && e.length === 2 || !t.range && !!e, J = {
94
+ const n = l(!1), q = me(n), h = (e) => {
95
+ const a = e.target;
96
+ a && a instanceof HTMLDialogElement && (n.value = !1);
97
+ }, R = async () => {
98
+ t.disabled || t.readonly || (n.value = !0);
99
+ };
100
+ D(n, (e) => {
101
+ var a;
102
+ e ? document.addEventListener("click", h, { passive: !0 }) : ((a = V.value) == null || a.resetStatus(), document.removeEventListener("click", h));
103
+ });
104
+ const T = l(!t.allowWriting || t.range), N = (e) => t.range && Array.isArray(e) && e.length === 2 || !t.range && !!e, U = {
134
105
  "onUpdate:modelValue": (e) => {
135
- s("update:modelValue", e), G(e) && (w.value = !1, I({
136
- onPostDeactivate: () => {
137
- b.value = !1, h();
138
- }
139
- }));
106
+ d("update:modelValue", e), N(e) && (T.value = !1, n.value = !1);
140
107
  }
141
- }, K = D(() => {
108
+ }, z = k(() => {
142
109
  if (t.range) {
143
110
  if (!t.modelValue || t.modelValue.length < 2)
144
111
  return u("baseDatePickerInput.emptyRange").value;
@@ -150,152 +117,151 @@ const Ie = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska",
150
117
  return u("baseDatePickerInput.changeSelection", e).value;
151
118
  }
152
119
  return u("baseDatePickerInput.emptySelection").value;
153
- }), Q = (e) => {
120
+ }), Z = (e) => {
154
121
  let a = !0;
155
122
  return t.min && a && (a = e.isSameOrAfter(o(t.min).startOf("day"))), t.max && a && (a = e.isSameOrBefore(o(t.max).startOf("day"))), typeof t.selectable == "function" && a && (a = t.selectable(e.toDate())), !a;
156
- }, X = () => {
123
+ }, G = () => {
157
124
  let e = null;
158
- t.range && (e = []), s("update:modelValue", e);
125
+ t.range && (e = []), d("update:modelValue", e);
159
126
  };
160
- return (e, a) => (O(), B(we, {
127
+ return (e, a) => (Y(), C(ke, {
161
128
  ref_key: "outerContainer",
162
- ref: M,
163
- class: $(H.value),
164
- onFocusin: R
129
+ ref: y,
130
+ class: w(j.value),
131
+ onFocusin: H
165
132
  }, {
166
- "prepend-outer": n(() => [
167
- p(e.$slots, "prepend-outer")
133
+ "prepend-outer": i(() => [
134
+ c(e.$slots, "prepend-outer")
168
135
  ]),
169
- "append-outer": n(() => [
170
- p(e.$slots, "append-outer")
136
+ "append-outer": i(() => [
137
+ c(e.$slots, "append-outer")
171
138
  ]),
172
- default: n(() => [
173
- _(Ve, {
139
+ default: i(() => [
140
+ B(ge, {
174
141
  ref_key: "innerContainer",
175
- ref: f,
142
+ ref: O,
176
143
  "append:icon": t["append:icon"],
177
- clearable: t.clearable && !l(Ye)(e.modelValue),
144
+ clearable: t.clearable && !r(se)(e.modelValue),
178
145
  "prepend:icon": t["prepend:icon"],
179
- "onClick:clear": X
146
+ "onClick:clear": G
180
147
  }, {
181
- prepend: n(() => [
182
- p(e.$slots, "prepend")
148
+ prepend: i(() => [
149
+ c(e.$slots, "prepend")
183
150
  ]),
184
- prefix: n(() => [
185
- p(e.$slots, "prefix")
151
+ prefix: i(() => [
152
+ c(e.$slots, "prefix")
186
153
  ]),
187
- append: n(() => [
188
- p(e.$slots, "append")
154
+ append: i(() => [
155
+ c(e.$slots, "append")
189
156
  ]),
190
- suffix: n(() => [
191
- p(e.$slots, "suffix")
157
+ suffix: i(() => [
158
+ c(e.$slots, "suffix")
192
159
  ]),
193
- default: n(() => [
194
- oe(i("input", P({
195
- id: l(k),
160
+ default: i(() => [
161
+ r(q) ? (Y(), C(ye, {
162
+ key: 0,
163
+ modelValue: n.value,
164
+ "onUpdate:modelValue": a[0] || (a[0] = (p) => n.value = p),
165
+ block: !0,
166
+ dialog: "",
167
+ offset: 4
168
+ }, {
169
+ default: i(() => [
170
+ s("div", {
171
+ ref_key: "calendar",
172
+ ref: v,
173
+ class: w(["bb-base-date-picker-input__calendar", {
174
+ "bb-base-date-picker-input__calendar--shown": n.value
175
+ }]),
176
+ inert: !n.value
177
+ }, [
178
+ B(be, S({ id: r(f) }, U, {
179
+ ref_key: "basedatepicker",
180
+ ref: V,
181
+ disabled: e.disabled,
182
+ "first-day-of-week": e.firstDayOfWeek,
183
+ max: e.max,
184
+ min: e.min,
185
+ "model-value": e.modelValue,
186
+ range: e.range,
187
+ readonly: e.readonly,
188
+ selectable: e.selectable
189
+ }), null, 16, ["id", "disabled", "first-day-of-week", "max", "min", "model-value", "range", "readonly", "selectable"])
190
+ ], 10, ve)
191
+ ]),
192
+ _: 1
193
+ }, 8, ["modelValue"])) : X("", !0),
194
+ x(s("input", S({
195
+ id: r(f),
196
196
  ref_key: "input",
197
- ref: j,
198
- "aria-describedby": `bdpi-description_${l(k)}`,
197
+ ref: _,
198
+ "aria-describedby": `bdpi-description_${r(f)}`,
199
199
  autocomplete: e.autocomplete,
200
200
  autofocus: e.autofocus,
201
201
  "data-maska": t.range ? "##/##/#### - ##/##/####" : "##/##/####",
202
202
  disabled: e.disabled,
203
- inputmode: W.value,
203
+ inputmode: F.value,
204
204
  name: e.name,
205
205
  placeholder: e.placeholder,
206
206
  readonly: e.readonly || e.range || !e.allowWriting,
207
207
  required: e.required
208
- }, T, {
208
+ }, A, {
209
209
  size: "1",
210
210
  type: "text",
211
- value: N.value
212
- }), null, 16, Ie), [
213
- [l(ge)]
211
+ value: W.value
212
+ }), null, 16, Ve), [
213
+ [r(fe)]
214
214
  ]),
215
- i("button", {
216
- "aria-label": K.value,
215
+ s("button", {
216
+ "aria-label": z.value,
217
217
  class: "bb-base-date-picker-input__calendar-btn",
218
- disabled: e.disabled || e.readonly || !V.value,
218
+ disabled: e.disabled || e.readonly,
219
219
  type: "button",
220
- onClick: ne(U, ["stop"])
221
- }, a[0] || (a[0] = [
222
- i("svg", {
220
+ onClick: ee(R, ["stop"])
221
+ }, a[1] || (a[1] = [
222
+ s("svg", {
223
223
  fill: "none",
224
224
  viewBox: "0 0 16 16",
225
225
  xmlns: "http://www.w3.org/2000/svg"
226
226
  }, [
227
- i("path", {
227
+ s("path", {
228
228
  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",
229
229
  stroke: "currentColor",
230
230
  "stroke-linecap": "round",
231
231
  "stroke-linejoin": "round"
232
232
  }),
233
- i("path", {
233
+ s("path", {
234
234
  d: "M10.6667 1.33333V3.99999",
235
235
  stroke: "currentColor",
236
236
  "stroke-linecap": "round",
237
237
  "stroke-linejoin": "round"
238
238
  }),
239
- i("path", {
239
+ s("path", {
240
240
  d: "M5.33333 1.33333V3.99999",
241
241
  stroke: "currentColor",
242
242
  "stroke-linecap": "round",
243
243
  "stroke-linejoin": "round"
244
244
  }),
245
- i("path", {
245
+ s("path", {
246
246
  d: "M2 6.66667H14",
247
247
  stroke: "currentColor",
248
248
  "stroke-linecap": "round",
249
249
  "stroke-linejoin": "round"
250
250
  })
251
251
  ], -1)
252
- ]), 8, Be),
253
- i("span", {
254
- id: `bdpi-description_${l(k)}`,
252
+ ]), 8, Me),
253
+ s("span", {
254
+ id: `bdpi-description_${r(f)}`,
255
255
  class: "bb-base-date-picker-input__accessible-description sr-only"
256
- }, E(l(u)("baseDatePickerInput.dateFormat")) + " " + E(t.range ? l(u)("baseDatePickerInput.dateFormatRange") : l(u)("baseDatePickerInput.dateFormatSingle")), 9, Oe)
256
+ }, E(r(u)("baseDatePickerInput.dateFormat")) + " " + E(t.range ? r(u)("baseDatePickerInput.dateFormatRange") : r(u)("baseDatePickerInput.dateFormatSingle")), 9, he)
257
257
  ]),
258
258
  _: 3
259
- }, 8, ["append:icon", "clearable", "prepend:icon"]),
260
- S.value ? (O(), B(Me, {
261
- key: 0,
262
- "base-class": "bb-base-date-picker-input",
263
- offset: 4,
264
- open: d.value,
265
- "teleport-target": e.teleportTarget,
266
- "transition-duration": 300,
267
- wrapper: f.value
268
- }, {
269
- default: n(() => [
270
- i("div", {
271
- ref_key: "calendar",
272
- ref: m,
273
- class: $(["bb-base-date-picker-input__calendar", {
274
- "bb-base-date-picker-input__calendar--shown": d.value
275
- }]),
276
- inert: !d.value
277
- }, [
278
- _(De, P({ id: l(k) }, J, {
279
- ref_key: "basedatepicker",
280
- ref: C,
281
- disabled: e.disabled,
282
- "first-day-of-week": e.firstDayOfWeek,
283
- max: e.max,
284
- min: e.min,
285
- "model-value": e.modelValue,
286
- range: e.range,
287
- readonly: e.readonly,
288
- selectable: e.selectable
289
- }), null, 16, ["id", "disabled", "first-day-of-week", "max", "min", "model-value", "range", "readonly", "selectable"])
290
- ], 10, $e)
291
- ]),
292
- _: 1
293
- }, 8, ["open", "teleport-target", "wrapper"])) : re("", !0)
259
+ }, 8, ["append:icon", "clearable", "prepend:icon"])
294
260
  ]),
295
261
  _: 3
296
262
  }, 8, ["class"]));
297
263
  }
298
264
  });
299
265
  export {
300
- nt as default
266
+ ze as default
301
267
  };
package/dist/index230.js CHANGED
@@ -1,14 +1,15 @@
1
- import { hash as e } from "./index229.js";
2
- import { debouncedWatch as s } from "./index206.js";
3
- const n = (o, c, h) => {
4
- s(
5
- o,
6
- (r, t) => {
7
- e(r) !== e(t) && c(r, t);
8
- },
9
- h
10
- );
11
- };
1
+ import { createElementBlock as t, openBlock as n, renderSlot as e } from "vue";
2
+ /* empty css */
3
+ import r from "./index299.js";
4
+ const s = {}, c = { class: "bb-common-input-outer-container" };
5
+ function p(o, a) {
6
+ return n(), t("span", c, [
7
+ e(o.$slots, "prepend-outer"),
8
+ e(o.$slots, "default"),
9
+ e(o.$slots, "append-outer")
10
+ ]);
11
+ }
12
+ const i = /* @__PURE__ */ r(s, [["render", p]]);
12
13
  export {
13
- n as useHashedWatcher
14
+ i as default
14
15
  };
package/dist/index231.js CHANGED
@@ -1,15 +1,179 @@
1
- import { locales as t } from "./index296.js";
2
- import { _config as m } from "./index4.js";
3
- import { get as c } from "./index297.js";
4
- import { readonly as l, computed as n } from "vue";
5
- const p = (o, ...r) => l(
6
- n(() => c(t[m.locale], o).replace(
7
- /\{(\d+)\}/g,
8
- (a, e) => r[e]
9
- ))
10
- ), d = () => ({
11
- t: p
12
- });
1
+ var w = Object.defineProperty, C = (a, t, e) => t in a ? w(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, A = (a, t, e) => C(a, typeof t != "symbol" ? t + "" : t, e);
2
+ const R = {
3
+ "#": { pattern: /[0-9]/ },
4
+ "@": { pattern: /[a-zA-Z]/ },
5
+ "*": { pattern: /[a-zA-Z0-9]/ }
6
+ }, N = (a, t, e) => a.replaceAll(t, "").replace(e, ".").replace("..", ".").replace(/[^.\d]/g, ""), I = (a, t, e) => {
7
+ var s;
8
+ return new Intl.NumberFormat(((s = e.number) == null ? void 0 : s.locale) ?? "en", {
9
+ minimumFractionDigits: a,
10
+ maximumFractionDigits: t,
11
+ roundingMode: "trunc"
12
+ });
13
+ }, P = (a, t = !0, e) => {
14
+ var s, r, n, h;
15
+ const u = ((s = e.number) == null ? void 0 : s.unsigned) !== !0 && a.startsWith("-") ? "-" : "", l = ((r = e.number) == null ? void 0 : r.fraction) ?? 0;
16
+ let o = I(0, l, e);
17
+ const k = o.formatToParts(1000.12), c = ((n = k.find((i) => i.type === "group")) == null ? void 0 : n.value) ?? " ", b = ((h = k.find((i) => i.type === "decimal")) == null ? void 0 : h.value) ?? ".", f = N(a, c, b);
18
+ if (Number.isNaN(parseFloat(f))) return u;
19
+ const g = f.split(".");
20
+ if (g[1] != null && g[1].length >= 1) {
21
+ const i = g[1].length <= l ? g[1].length : l;
22
+ o = I(i, l, e);
23
+ }
24
+ let m = o.format(parseFloat(f));
25
+ return t ? l > 0 && f.endsWith(".") && !f.slice(0, -1).includes(".") && (m += b) : m = N(m, c, b), u + m;
26
+ };
27
+ class T {
28
+ constructor(t = {}) {
29
+ A(this, "opts", {}), A(this, "memo", /* @__PURE__ */ new Map());
30
+ const e = { ...t };
31
+ if (e.tokens != null) {
32
+ e.tokens = e.tokensReplace ? { ...e.tokens } : { ...R, ...e.tokens };
33
+ for (const s of Object.values(e.tokens))
34
+ typeof s.pattern == "string" && (s.pattern = new RegExp(s.pattern));
35
+ } else
36
+ e.tokens = R;
37
+ Array.isArray(e.mask) && (e.mask.length > 1 ? e.mask = [...e.mask].sort((s, r) => s.length - r.length) : e.mask = e.mask[0] ?? ""), e.mask === "" && (e.mask = null), this.opts = e;
38
+ }
39
+ masked(t) {
40
+ return this.process(String(t), this.findMask(String(t)));
41
+ }
42
+ unmasked(t) {
43
+ return this.process(String(t), this.findMask(String(t)), !1);
44
+ }
45
+ isEager() {
46
+ return this.opts.eager === !0;
47
+ }
48
+ isReversed() {
49
+ return this.opts.reversed === !0;
50
+ }
51
+ completed(t) {
52
+ const e = this.findMask(String(t));
53
+ if (this.opts.mask == null || e == null) return !1;
54
+ const s = this.process(String(t), e).length;
55
+ return typeof this.opts.mask == "string" ? s >= this.opts.mask.length : s >= e.length;
56
+ }
57
+ findMask(t) {
58
+ const e = this.opts.mask;
59
+ if (e == null)
60
+ return null;
61
+ if (typeof e == "string")
62
+ return e;
63
+ if (typeof e == "function")
64
+ return e(t);
65
+ const s = this.process(t, e.slice(-1).pop() ?? "", !1);
66
+ return e.find((r) => this.process(t, r, !1).length >= s.length) ?? "";
67
+ }
68
+ escapeMask(t) {
69
+ const e = [], s = [];
70
+ return t.split("").forEach((r, n) => {
71
+ r === "!" && t[n - 1] !== "!" ? s.push(n - s.length) : e.push(r);
72
+ }), { mask: e.join(""), escaped: s };
73
+ }
74
+ process(t, e, s = !0) {
75
+ if (this.opts.number != null) return P(t, s, this.opts);
76
+ if (e == null) return t;
77
+ const r = `v=${t},mr=${e},m=${s ? 1 : 0}`;
78
+ if (this.memo.has(r)) return this.memo.get(r);
79
+ const { mask: n, escaped: h } = this.escapeMask(e), u = [], l = this.opts.tokens != null ? this.opts.tokens : {}, o = this.isReversed() ? -1 : 1, k = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : n.length - 1, b = this.isReversed() ? () => i > -1 && p > -1 : () => i < n.length && p < t.length, f = (v) => !this.isReversed() && v <= c || this.isReversed() && v >= c;
80
+ let g, m = -1, i = this.isReversed() ? n.length - 1 : 0, p = this.isReversed() ? t.length - 1 : 0, M = !1;
81
+ for (; b(); ) {
82
+ const v = n.charAt(i), d = l[v], y = (d == null ? void 0 : d.transform) != null ? d.transform(t.charAt(p)) : t.charAt(p);
83
+ if (!h.includes(i) && d != null ? (y.match(d.pattern) != null ? (u[k](y), d.repeated ? (m === -1 ? m = i : i === c && i !== m && (i = m - o), c === m && (i -= o)) : d.multiple && (M = !0, i -= o), i += o) : d.multiple ? M && (i += o, p -= o, M = !1) : y === g ? g = void 0 : d.optional && (i += o, p -= o), p += o) : (s && !this.isEager() && u[k](v), y === v && !this.isEager() ? p += o : g = v, this.isEager() || (i += o)), this.isEager())
84
+ for (; f(i) && (l[n.charAt(i)] == null || h.includes(i)); ) {
85
+ if (s) {
86
+ if (u[k](n.charAt(i)), t.charAt(p) === n.charAt(i)) {
87
+ i += o, p += o;
88
+ continue;
89
+ }
90
+ } else n.charAt(i) === t.charAt(p) && (p += o);
91
+ i += o;
92
+ }
93
+ }
94
+ return this.memo.set(r, u.join("")), this.memo.get(r);
95
+ }
96
+ }
97
+ const S = (a) => JSON.parse(a.replaceAll("'", '"')), F = (a, t = {}) => {
98
+ const e = { ...t };
99
+ a.dataset.maska != null && a.dataset.maska !== "" && (e.mask = W(a.dataset.maska)), a.dataset.maskaEager != null && (e.eager = E(a.dataset.maskaEager)), a.dataset.maskaReversed != null && (e.reversed = E(a.dataset.maskaReversed)), a.dataset.maskaTokensReplace != null && (e.tokensReplace = E(a.dataset.maskaTokensReplace)), a.dataset.maskaTokens != null && (e.tokens = x(a.dataset.maskaTokens));
100
+ const s = {};
101
+ return a.dataset.maskaNumberLocale != null && (s.locale = a.dataset.maskaNumberLocale), a.dataset.maskaNumberFraction != null && (s.fraction = parseInt(a.dataset.maskaNumberFraction)), a.dataset.maskaNumberUnsigned != null && (s.unsigned = E(a.dataset.maskaNumberUnsigned)), (a.dataset.maskaNumber != null || Object.values(s).length > 0) && (e.number = s), e;
102
+ }, E = (a) => a !== "" ? !!JSON.parse(a) : !0, W = (a) => a.startsWith("[") && a.endsWith("]") ? S(a) : a, x = (a) => {
103
+ if (a.startsWith("{") && a.endsWith("}"))
104
+ return S(a);
105
+ const t = {};
106
+ return a.split("|").forEach((e) => {
107
+ const s = e.split(":");
108
+ t[s[0]] = {
109
+ pattern: new RegExp(s[1]),
110
+ optional: s[2] === "optional",
111
+ multiple: s[2] === "multiple",
112
+ repeated: s[2] === "repeated"
113
+ };
114
+ }), t;
115
+ };
116
+ class O {
117
+ constructor(t, e = {}) {
118
+ A(this, "items", /* @__PURE__ */ new Map()), A(this, "eventAbortController"), A(this, "onInput", (s) => {
119
+ if (s instanceof CustomEvent && s.type === "input" && !s.isTrusted && !s.bubbles)
120
+ return;
121
+ const r = s.target, n = this.items.get(r), h = "inputType" in s && s.inputType.startsWith("delete"), u = n.isEager(), l = h && u && n.unmasked(r.value) === "" ? "" : r.value;
122
+ this.fixCursor(r, h, () => this.setValue(r, l));
123
+ }), this.options = e, this.eventAbortController = new AbortController(), this.init(this.getInputs(t));
124
+ }
125
+ update(t = {}) {
126
+ this.options = { ...t }, this.init(Array.from(this.items.keys()));
127
+ }
128
+ updateValue(t) {
129
+ t.value !== "" && t.value !== this.processInput(t).masked && this.setValue(t, t.value);
130
+ }
131
+ destroy() {
132
+ this.eventAbortController.abort(), this.items.clear();
133
+ }
134
+ init(t) {
135
+ const e = this.getOptions(this.options);
136
+ for (const s of t) {
137
+ if (!this.items.has(s)) {
138
+ const { signal: n } = this.eventAbortController;
139
+ s.addEventListener("input", this.onInput, { capture: !0, signal: n });
140
+ }
141
+ const r = new T(F(s, e));
142
+ this.items.set(s, r), queueMicrotask(() => this.updateValue(s)), s.selectionStart === null && r.isEager() && console.warn("Maska: input of `%s` type is not supported", s.type);
143
+ }
144
+ }
145
+ getInputs(t) {
146
+ return typeof t == "string" ? Array.from(document.querySelectorAll(t)) : "length" in t ? Array.from(t) : [t];
147
+ }
148
+ getOptions(t) {
149
+ const { onMaska: e, preProcess: s, postProcess: r, ...n } = t;
150
+ return n;
151
+ }
152
+ fixCursor(t, e, s) {
153
+ const r = t.selectionStart, n = t.value;
154
+ if (s(), r === null || r === n.length && !e) return;
155
+ const h = t.value, u = n.slice(0, r), l = h.slice(0, r), o = this.processInput(t, u).unmasked, k = this.processInput(t, l).unmasked;
156
+ let c = r;
157
+ u !== l && (c += e ? h.length - n.length : o.length - k.length), t.setSelectionRange(c, c);
158
+ }
159
+ setValue(t, e) {
160
+ const s = this.processInput(t, e);
161
+ t.value = s.masked, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((r) => r(s)) : this.options.onMaska(s)), t.dispatchEvent(new CustomEvent("maska", { detail: s })), t.dispatchEvent(new CustomEvent("input", { detail: s.masked }));
162
+ }
163
+ processInput(t, e) {
164
+ const s = this.items.get(t);
165
+ let r = e ?? t.value;
166
+ this.options.preProcess != null && (r = this.options.preProcess(r));
167
+ let n = s.masked(r);
168
+ return this.options.postProcess != null && (n = this.options.postProcess(n)), {
169
+ masked: n,
170
+ unmasked: s.unmasked(r),
171
+ completed: s.completed(r)
172
+ };
173
+ }
174
+ }
13
175
  export {
14
- d as useLocale
176
+ T as Mask,
177
+ O as MaskInput,
178
+ R as tokens
15
179
  };