@vlrc-fe/components 2.2.0 → 2.3.0

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 (215) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/DataTable/DataTable.d.ts.map +1 -1
  3. package/dist/DataTable/components/DataTableTable.d.ts.map +1 -1
  4. package/dist/Form/Form.d.ts.map +1 -1
  5. package/dist/Form/FormDatePicker/FormDatePicker.d.ts.map +1 -1
  6. package/dist/Form/FormDatePicker/RangeDatePicker.d.ts.map +1 -1
  7. package/dist/Form/FormDatePicker/SingleDatePicker.d.ts +4 -3
  8. package/dist/Form/FormDatePicker/SingleDatePicker.d.ts.map +1 -1
  9. package/dist/Form/FormDatePicker/TimeInput.d.ts +3 -4
  10. package/dist/Form/FormDatePicker/TimeInput.d.ts.map +1 -1
  11. package/dist/Form/FormDatePicker/TimePicker.d.ts +3 -3
  12. package/dist/Form/FormDatePicker/TimePicker.d.ts.map +1 -1
  13. package/dist/Form/FormDatePicker/types.d.ts +1 -0
  14. package/dist/Form/FormDatePicker/types.d.ts.map +1 -1
  15. package/dist/Form/FormDatePicker/useFormDatePicker.d.ts +2 -2
  16. package/dist/Form/FormDatePicker/useFormDatePicker.d.ts.map +1 -1
  17. package/dist/Form/FormNumberInput/FormNumberInput.d.ts.map +1 -1
  18. package/dist/Form/FormNumberInput/StepperControls.d.ts.map +1 -1
  19. package/dist/Form/FormNumberInput/useFormNumberInput.d.ts.map +1 -1
  20. package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
  21. package/dist/MultiSelect/renderers.d.ts +2 -2
  22. package/dist/MultiSelect/renderers.d.ts.map +1 -1
  23. package/dist/assets/stylex.css +450 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +25 -25
  26. package/dist/index101.cjs +1 -1
  27. package/dist/index101.js +120 -91
  28. package/dist/index103.cjs +1 -1
  29. package/dist/index103.js +32 -15
  30. package/dist/index107.cjs +1 -1
  31. package/dist/index107.js +245 -132
  32. package/dist/index109.cjs +1 -1
  33. package/dist/index109.js +319 -138
  34. package/dist/index113.cjs +1 -1
  35. package/dist/index113.js +230 -95
  36. package/dist/index119.cjs +1 -1
  37. package/dist/index119.js +62 -35
  38. package/dist/index120.cjs +1 -1
  39. package/dist/index120.js +71 -32
  40. package/dist/index121.cjs +1 -1
  41. package/dist/index121.js +201 -79
  42. package/dist/index125.cjs +1 -1
  43. package/dist/index125.js +661 -288
  44. package/dist/index129.cjs +1 -1
  45. package/dist/index129.js +6 -5
  46. package/dist/index144.cjs +1 -1
  47. package/dist/index144.js +33 -22
  48. package/dist/index148.cjs +1 -1
  49. package/dist/index148.js +95 -92
  50. package/dist/index151.cjs +1 -1
  51. package/dist/index151.js +56 -56
  52. package/dist/index152.cjs +1 -1
  53. package/dist/index152.js +87 -3
  54. package/dist/index153.cjs +1 -1
  55. package/dist/index153.js +321 -85
  56. package/dist/index154.cjs +1 -1
  57. package/dist/index154.js +160 -287
  58. package/dist/index155.cjs +1 -1
  59. package/dist/index155.js +198 -162
  60. package/dist/index156.cjs +1 -1
  61. package/dist/index156.js +24 -125
  62. package/dist/index157.cjs +1 -1
  63. package/dist/index157.js +8 -25
  64. package/dist/index158.cjs +1 -1
  65. package/dist/index158.js +13 -5
  66. package/dist/index159.cjs +1 -1
  67. package/dist/index159.js +18 -13
  68. package/dist/index160.cjs +1 -1
  69. package/dist/index160.js +12 -16
  70. package/dist/index161.cjs +1 -1
  71. package/dist/index161.js +5 -17
  72. package/dist/index162.cjs +1 -1
  73. package/dist/index162.js +6 -5
  74. package/dist/index163.cjs +1 -1
  75. package/dist/index163.js +6 -5
  76. package/dist/index164.cjs +1 -1
  77. package/dist/index164.js +5 -6
  78. package/dist/index165.cjs +1 -1
  79. package/dist/index165.js +5 -5
  80. package/dist/index166.cjs +1 -1
  81. package/dist/index166.js +7 -5
  82. package/dist/index167.cjs +1 -1
  83. package/dist/index167.js +68 -8
  84. package/dist/index168.cjs +1 -1
  85. package/dist/index168.js +9 -67
  86. package/dist/index169.cjs +1 -1
  87. package/dist/index169.js +201 -10
  88. package/dist/index170.cjs +1 -1
  89. package/dist/index170.js +101 -179
  90. package/dist/index171.cjs +1 -1
  91. package/dist/index171.js +24 -116
  92. package/dist/index172.cjs +1 -1
  93. package/dist/index172.js +18 -30
  94. package/dist/index173.cjs +1 -1
  95. package/dist/index173.js +66 -17
  96. package/dist/index174.cjs +1 -1
  97. package/dist/index174.js +30 -67
  98. package/dist/index175.cjs +1 -1
  99. package/dist/index175.js +10 -31
  100. package/dist/index176.cjs +1 -1
  101. package/dist/index176.js +279 -10
  102. package/dist/index177.cjs +1 -1
  103. package/dist/index177.js +125 -248
  104. package/dist/index178.cjs +1 -1
  105. package/dist/index178.js +18 -155
  106. package/dist/index179.cjs +1 -1
  107. package/dist/index179.js +9 -19
  108. package/dist/index180.cjs +1 -1
  109. package/dist/index180.js +12 -8
  110. package/dist/index181.cjs +1 -1
  111. package/dist/index181.js +6 -12
  112. package/dist/index182.cjs +1 -1
  113. package/dist/index182.js +6 -6
  114. package/dist/index183.cjs +1 -1
  115. package/dist/index183.js +9 -6
  116. package/dist/index184.cjs +1 -1
  117. package/dist/index184.js +8 -9
  118. package/dist/index185.cjs +1 -1
  119. package/dist/index185.js +4 -8
  120. package/dist/index186.cjs +1 -1
  121. package/dist/index186.js +6 -4
  122. package/dist/index187.cjs +1 -1
  123. package/dist/index187.js +6 -6
  124. package/dist/index188.cjs +1 -1
  125. package/dist/index188.js +8 -6
  126. package/dist/index189.cjs +1 -1
  127. package/dist/index189.js +9 -8
  128. package/dist/index190.cjs +1 -1
  129. package/dist/index190.js +12 -8
  130. package/dist/index191.cjs +1 -1
  131. package/dist/index191.js +7 -11
  132. package/dist/index192.cjs +1 -1
  133. package/dist/index192.js +7 -7
  134. package/dist/index193.cjs +1 -1
  135. package/dist/index193.js +4 -9
  136. package/dist/index194.cjs +1 -1
  137. package/dist/index194.js +42 -5
  138. package/dist/index195.cjs +1 -1
  139. package/dist/index195.js +375 -29
  140. package/dist/index196.cjs +1 -1
  141. package/dist/index196.js +35 -386
  142. package/dist/index197.cjs +1 -1
  143. package/dist/index197.js +22 -37
  144. package/dist/index198.cjs +1 -1
  145. package/dist/index198.js +56 -20
  146. package/dist/index199.cjs +1 -1
  147. package/dist/index199.js +36 -54
  148. package/dist/index200.cjs +1 -1
  149. package/dist/index200.js +102 -54
  150. package/dist/index201.cjs +1 -1
  151. package/dist/index201.js +76 -54
  152. package/dist/index202.cjs +1 -1
  153. package/dist/index202.js +68 -66
  154. package/dist/index203.cjs +1 -1
  155. package/dist/index203.js +147 -63
  156. package/dist/index204.cjs +1 -1
  157. package/dist/index204.js +69 -91
  158. package/dist/index205.cjs +9 -1
  159. package/dist/index205.js +585 -62
  160. package/dist/index206.cjs +1 -9
  161. package/dist/index206.js +65 -586
  162. package/dist/index207.cjs +1 -1
  163. package/dist/index207.js +42 -41
  164. package/dist/index208.cjs +1 -1
  165. package/dist/index208.js +64 -46
  166. package/dist/index209.cjs +1 -1
  167. package/dist/index209.js +48 -64
  168. package/dist/index210.cjs +1 -1
  169. package/dist/index210.js +75 -47
  170. package/dist/index211.cjs +1 -1
  171. package/dist/index211.js +173 -69
  172. package/dist/index212.cjs +1 -1
  173. package/dist/index212.js +24 -180
  174. package/dist/index213.cjs +1 -1
  175. package/dist/index213.js +25 -24
  176. package/dist/index214.cjs +1 -1
  177. package/dist/index214.js +61 -24
  178. package/dist/index215.cjs +1 -1
  179. package/dist/index215.js +408 -49
  180. package/dist/index216.cjs +1 -1
  181. package/dist/index216.js +25 -422
  182. package/dist/index37.cjs +1 -1
  183. package/dist/index37.js +123 -65
  184. package/dist/index42.cjs +1 -1
  185. package/dist/index42.js +175 -88
  186. package/dist/index91.cjs +1 -1
  187. package/dist/index91.js +252 -124
  188. package/dist/ui/calendar.d.ts +5 -2
  189. package/dist/ui/calendar.d.ts.map +1 -1
  190. package/dist/ui/carousel.d.ts +19 -5
  191. package/dist/ui/carousel.d.ts.map +1 -1
  192. package/dist/ui/context-menu.d.ts +37 -12
  193. package/dist/ui/context-menu.d.ts.map +1 -1
  194. package/dist/ui/form.d.ts +15 -4
  195. package/dist/ui/form.d.ts.map +1 -1
  196. package/dist/ui/hover-card.d.ts +5 -1
  197. package/dist/ui/hover-card.d.ts.map +1 -1
  198. package/dist/ui/item.d.ts +43 -18
  199. package/dist/ui/item.d.ts.map +1 -1
  200. package/dist/ui/menubar.d.ts +45 -14
  201. package/dist/ui/menubar.d.ts.map +1 -1
  202. package/dist/ui/navigation-menu.d.ts +34 -10
  203. package/dist/ui/navigation-menu.d.ts.map +1 -1
  204. package/dist/ui/resizable.d.ts +9 -3
  205. package/dist/ui/resizable.d.ts.map +1 -1
  206. package/dist/ui/scroll-area.d.ts +9 -2
  207. package/dist/ui/scroll-area.d.ts.map +1 -1
  208. package/dist/ui/select.d.ts +19 -5
  209. package/dist/ui/select.d.ts.map +1 -1
  210. package/dist/ui/sidebar.d.ts +99 -37
  211. package/dist/ui/sidebar.d.ts.map +1 -1
  212. package/dist/ui/sonner.d.ts.map +1 -1
  213. package/package.json +1 -1
  214. package/dist/index217.cjs +0 -1
  215. package/dist/index217.js +0 -25
package/dist/index206.js CHANGED
@@ -1,588 +1,67 @@
1
- import e, { useEffect as t, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
2
- // ../../node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.js
3
- function o(e, t) {
4
- var n = {};
5
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
6
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
7
- return n;
8
- }
9
- var s;
10
- (function(e) {
11
- e.event = "event", e.props = "prop";
12
- })(s ||= {});
13
- function c() {}
14
- function l(e) {
15
- var t, n = void 0;
16
- return function() {
17
- for (var r = [], i = arguments.length; i--;) r[i] = arguments[i];
18
- return t && r.length === t.length && r.every(function(e, n) {
19
- return e === t[n];
20
- }) || (t = r, n = e.apply(void 0, r)), n;
21
- };
22
- }
23
- function u(e) {
24
- return !!(e || "").match(/\d/);
25
- }
26
- function d(e) {
27
- return e == null;
28
- }
29
- function f(e) {
30
- return typeof e == "number" && isNaN(e);
31
- }
32
- function p(e) {
33
- return d(e) || f(e) || typeof e == "number" && !isFinite(e);
34
- }
35
- function m(e) {
36
- return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
37
- }
38
- function h(e) {
39
- switch (e) {
40
- case "lakh": return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
41
- case "wan": return /(\d)(?=(\d{4})+(?!\d))/g;
42
- default: return /(\d)(?=(\d{3})+(?!\d))/g;
43
- }
44
- }
45
- function g(e, t, n) {
46
- var r = h(n), i = e.search(/[1-9]/);
47
- return i = i === -1 ? e.length : i, e.substring(0, i) + e.substring(i, e.length).replace(r, "$1" + t);
48
- }
49
- function _(e) {
50
- var t = i(e);
51
- return t.current = e, i(function() {
52
- for (var e = [], n = arguments.length; n--;) e[n] = arguments[n];
53
- return t.current.apply(t, e);
54
- }).current;
55
- }
56
- function v(e, t) {
57
- t === void 0 && (t = !0);
58
- var n = e[0] === "-", r = n && t;
59
- e = e.replace("-", "");
60
- var i = e.split(".");
61
- return {
62
- beforeDecimal: i[0],
63
- afterDecimal: i[1] || "",
64
- hasNegation: n,
65
- addNegation: r
66
- };
67
- }
68
- function y(e) {
69
- if (!e) return e;
70
- var t = e[0] === "-";
71
- t && (e = e.substring(1, e.length));
72
- var n = e.split("."), r = n[0].replace(/^0+/, "") || "0", i = n[1] || "";
73
- return (t ? "-" : "") + r + (i ? "." + i : "");
74
- }
75
- function b(e, t, n) {
76
- for (var r = "", i = n ? "0" : "", a = 0; a <= t - 1; a++) r += e[a] || i;
77
- return r;
78
- }
79
- function x(e, t) {
80
- return Array(t + 1).join(e);
81
- }
82
- function S(e) {
83
- var t = e + "", n = t[0] === "-" ? "-" : "";
84
- n && (t = t.substring(1));
85
- var r = t.split(/[eE]/g), i = r[0], a = r[1];
86
- if (a = Number(a), !a) return n + i;
87
- i = i.replace(".", "");
88
- var o = 1 + a, s = i.length;
89
- return o < 0 ? i = "0." + x("0", Math.abs(o)) + i : o >= s ? i += x("0", o - s) : i = (i.substring(0, o) || "0") + "." + i.substring(o), n + i;
90
- }
91
- function C(e, t, n) {
92
- if (["", "-"].indexOf(e) !== -1) return e;
93
- var r = (e.indexOf(".") !== -1 || n) && t, i = v(e), a = i.beforeDecimal, o = i.afterDecimal, s = i.hasNegation, c = parseFloat("0." + (o || "0")), l = (o.length <= t ? "0." + o : c.toFixed(t)).split("."), u = a;
94
- a && Number(l[0]) && (u = a.split("").reverse().reduce(function(e, t, n) {
95
- return e.length > n ? (Number(e[0]) + Number(t)).toString() + e.substring(1, e.length) : t + e;
96
- }, l[0]));
97
- var d = b(l[1] || "", t, n), f = s ? "-" : "", p = r ? "." : "";
98
- return "" + f + u + p + d;
99
- }
100
- function w(e, t) {
101
- if (e.value = e.value, e !== null) {
102
- if (e.createTextRange) {
103
- var n = e.createTextRange();
104
- return n.move("character", t), n.select(), !0;
105
- }
106
- return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
1
+ import { Button as e } from "./index25.js";
2
+ import "@stylexjs/stylex";
3
+ import { ChevronDown as t, ChevronUp as n } from "lucide-react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { c as a } from "react/compiler-runtime";
6
+ import { useTranslation as o } from "react-i18next";
7
+ // src/Form/FormNumberInput/StepperControls.tsx
8
+ var s = {
9
+ btnUp: {
10
+ kg3NbH: "x97vtpp",
11
+ kZKoxP: "xaylbqo",
12
+ kIxVMA: "x1ia1hqs",
13
+ kqGeR4: "xfrllxf",
14
+ kYm2EN: "xjppbhk",
15
+ kZ1KPB: "xyj58a3",
16
+ kt9PQ7: "x1co6499",
17
+ kVAM5u: "xsyin8q",
18
+ $$css: !0
19
+ },
20
+ btnDown: {
21
+ kg3NbH: "x97vtpp",
22
+ kZKoxP: "xaylbqo",
23
+ kIxVMA: "x1ia1hqs",
24
+ kqGeR4: "xfrllxf",
25
+ ksF3WI: "x1a2w583",
26
+ kZ1KPB: "xyj58a3",
27
+ kEafiO: "xt8cgyo",
28
+ kVAM5u: "xsyin8q",
29
+ $$css: !0
107
30
  }
108
- }
109
- var T = l(function(e, t) {
110
- for (var n = 0, r = 0, i = e.length, a = t.length; e[n] === t[n] && n < i;) n++;
111
- for (; e[i - 1 - r] === t[a - 1 - r] && a - r > n && i - r > n;) r++;
112
- return {
113
- from: {
114
- start: n,
115
- end: i - r
116
- },
117
- to: {
118
- start: n,
119
- end: a - r
120
- }
121
- };
122
- }), E = function(e, t) {
123
- var n = Math.min(e.selectionStart, t);
124
- return {
125
- from: {
126
- start: n,
127
- end: e.selectionEnd
128
- },
129
- to: {
130
- start: n,
131
- end: t
132
- }
133
- };
134
31
  };
135
- function D(e, t, n) {
136
- return Math.min(Math.max(e, t), n);
137
- }
138
- function O(e) {
139
- return Math.max(e.selectionStart, e.selectionEnd);
140
- }
141
- function k() {
142
- return typeof navigator < "u" && !(navigator.platform && /iPhone|iPod/.test(navigator.platform));
143
- }
144
- function A(e) {
145
- return {
146
- from: {
147
- start: 0,
148
- end: 0
149
- },
150
- to: {
151
- start: 0,
152
- end: e.length
153
- },
154
- lastValue: ""
155
- };
156
- }
157
- function j(e) {
158
- var t = e.currentValue, n = e.formattedValue, r = e.currentValueIndex, i = e.formattedValueIndex;
159
- return t[r] === n[i];
160
- }
161
- function M(e, t, n, r, i, a, o) {
162
- o === void 0 && (o = j);
163
- var s = i.findIndex(function(e) {
164
- return e;
165
- }), c = e.slice(0, s);
166
- !t && !n.startsWith(c) && (t = c, n = c + n, r += c.length);
167
- for (var l = n.length, u = e.length, d = {}, f = Array(l), p = 0; p < l; p++) {
168
- f[p] = -1;
169
- for (var m = 0, h = u; m < h; m++) if (o({
170
- currentValue: n,
171
- lastValue: t,
172
- formattedValue: e,
173
- currentValueIndex: p,
174
- formattedValueIndex: m
175
- }) && d[m] !== !0) {
176
- f[p] = m, d[m] = !0;
177
- break;
178
- }
179
- }
180
- for (var g = r; g < l && (f[g] === -1 || !a(n[g]));) g++;
181
- var _ = g === l || f[g] === -1 ? u : f[g];
182
- for (g = r - 1; g > 0 && f[g] === -1;) g--;
183
- var v = g === -1 || f[g] === -1 ? 0 : f[g] + 1;
184
- return v > _ ? _ : r - v < _ - r ? v : _;
185
- }
186
- function N(e, t, n, r) {
187
- var i = e.length;
188
- if (t = D(t, 0, i), r === "left") {
189
- for (; t >= 0 && !n[t];) t--;
190
- t === -1 && (t = n.indexOf(!0));
191
- } else {
192
- for (; t <= i && !n[t];) t++;
193
- t > i && (t = n.lastIndexOf(!0));
194
- }
195
- return t === -1 && (t = i), t;
196
- }
197
- function P(e) {
198
- for (var t = Array.from({ length: e.length + 1 }).map(function() {
199
- return !0;
200
- }), n = 0, r = t.length; n < r; n++) t[n] = !!(u(e[n]) || u(e[n - 1]));
201
- return t;
202
- }
203
- function F(e, n, i, o, l, u) {
204
- u === void 0 && (u = c);
205
- var f = _(function(e, t) {
206
- var n, r;
207
- return p(e) ? (r = "", n = "") : typeof e == "number" || t ? (r = typeof e == "number" ? S(e) : e, n = o(r)) : (r = l(e, void 0), n = o(r)), {
208
- formattedValue: n,
209
- numAsString: r
210
- };
211
- }), m = a(function() {
212
- return f(d(e) ? n : e, i);
213
- }), h = m[0], g = m[1], v = _(function(e, t) {
214
- e.formattedValue !== h.formattedValue && g({
215
- formattedValue: e.formattedValue,
216
- numAsString: e.value
217
- }), u(e, t);
218
- }), y = e, b = i;
219
- d(e) && (y = h.numAsString, b = !0);
220
- var x = f(y, b);
221
- return r(function() {
222
- g(x);
223
- }, [x.formattedValue]), t(function() {
224
- if (!d(n) && d(e) && h.formattedValue !== "") {
225
- var t = parseFloat(h.numAsString);
226
- v({
227
- formattedValue: h.formattedValue,
228
- value: h.numAsString,
229
- floatValue: isNaN(t) ? void 0 : t
230
- }, {
231
- event: void 0,
232
- source: s.props
233
- });
234
- }
235
- }, []), [h, v];
236
- }
237
- function I(e) {
238
- return e.replace(/[^0-9]/g, "");
239
- }
240
- function L(e) {
241
- return e;
242
- }
243
- function R(r) {
244
- var l = r.type;
245
- l === void 0 && (l = "text");
246
- var d = r.displayType;
247
- d === void 0 && (d = "input");
248
- var f = r.customInput, p = r.renderText, m = r.getInputRef, h = r.format;
249
- h === void 0 && (h = L);
250
- var g = r.removeFormatting;
251
- g === void 0 && (g = I);
252
- var _ = r.defaultValue, v = r.valueIsNumericString, y = r.onValueChange, b = r.isAllowed, x = r.onChange;
253
- x === void 0 && (x = c);
254
- var S = r.onKeyDown;
255
- S === void 0 && (S = c);
256
- var C = r.onMouseUp;
257
- C === void 0 && (C = c);
258
- var D = r.onFocus;
259
- D === void 0 && (D = c);
260
- var A = r.onBlur;
261
- A === void 0 && (A = c);
262
- var j = r.value, R = r.getCaretBoundary;
263
- R === void 0 && (R = P);
264
- var z = r.isValidInputCharacter;
265
- z === void 0 && (z = u);
266
- var B = r.isCharacterSame, V = o(r, [
267
- "type",
268
- "displayType",
269
- "customInput",
270
- "renderText",
271
- "getInputRef",
272
- "format",
273
- "removeFormatting",
274
- "defaultValue",
275
- "valueIsNumericString",
276
- "onValueChange",
277
- "isAllowed",
278
- "onChange",
279
- "onKeyDown",
280
- "onMouseUp",
281
- "onFocus",
282
- "onBlur",
283
- "value",
284
- "getCaretBoundary",
285
- "isValidInputCharacter",
286
- "isCharacterSame"
287
- ]), H = F(j, _, !!v, h, g, y), U = H[0], W = U.formattedValue, G = U.numAsString, ee = H[1], K = i(), q = i({
288
- formattedValue: W,
289
- numAsString: G
290
- }), te = function(e, t) {
291
- q.current = {
292
- formattedValue: e.formattedValue,
293
- numAsString: e.value
294
- }, ee(e, t);
295
- }, ne = a(!1), re = ne[0], ie = ne[1], J = i(null), Y = i({
296
- setCaretTimeout: null,
297
- focusTimeout: null
298
- });
299
- t(function() {
300
- return ie(!0), function() {
301
- clearTimeout(Y.current.setCaretTimeout), clearTimeout(Y.current.focusTimeout);
302
- };
303
- }, []);
304
- var ae = h, X = function(e, t) {
305
- var n = parseFloat(t);
306
- return {
307
- formattedValue: e,
308
- value: t,
309
- floatValue: isNaN(n) ? void 0 : n
310
- };
311
- }, Z = function(e, t, n) {
312
- (e.selectionStart !== 0 || e.selectionEnd !== e.value.length) && (w(e, t), Y.current.setCaretTimeout = setTimeout(function() {
313
- e.value === n && e.selectionStart !== t && w(e, t);
314
- }, 0));
315
- }, Q = function(e, t, n) {
316
- return N(e, t, R(e), n);
317
- }, $ = function(e, t, n) {
318
- var r = R(t), i = M(t, W, e, n, r, z, B);
319
- return i = N(t, i, r), i;
320
- }, oe = function(e) {
321
- var t = e.formattedValue;
322
- t === void 0 && (t = "");
323
- var n = e.input, r = e.source, i = e.event, a = e.numAsString, o;
324
- if (n) {
325
- var s = e.inputValue || n.value, c = O(n);
326
- n.value = t, o = $(s, t, c), o !== void 0 && Z(n, o, t);
327
- }
328
- t !== W && te(X(t, a), {
329
- event: i,
330
- source: r
331
- });
332
- };
333
- t(function() {
334
- var e = q.current, t = e.formattedValue, n = e.numAsString;
335
- (W !== t || G !== n) && te(X(W, G), {
336
- event: void 0,
337
- source: s.props
338
- });
339
- }, [W, G]);
340
- var se = J.current ? O(J.current) : void 0;
341
- (typeof window < "u" ? n : t)(function() {
342
- var e = J.current;
343
- if (W !== q.current.formattedValue && e) {
344
- var t = $(q.current.formattedValue, W, se);
345
- e.value = W, Z(e, t, W);
346
- }
347
- }, [W]);
348
- var ce = function(e, t, n) {
349
- var r = t.target, i = K.current ? E(K.current, r.selectionEnd) : T(W, e), a = Object.assign(Object.assign({}, i), { lastValue: W }), o = g(e, a), s = ae(o);
350
- if (o = g(s, void 0), b && !b(X(s, o))) {
351
- var c = t.target, l = $(e, W, O(c));
352
- return c.value = W, Z(c, l, W), !1;
353
- }
354
- return oe({
355
- formattedValue: s,
356
- numAsString: o,
357
- inputValue: e,
358
- event: t,
359
- source: n,
360
- input: t.target
361
- }), !0;
362
- }, le = function(e, t) {
363
- t === void 0 && (t = 0), K.current = {
364
- selectionStart: e.selectionStart,
365
- selectionEnd: e.selectionEnd + t
366
- };
367
- }, ue = function(e) {
368
- var t = e.target.value;
369
- ce(t, e, s.event) && x(e), K.current = void 0;
370
- }, de = function(e) {
371
- var t = e.target, n = e.key, r = t.selectionStart, i = t.selectionEnd, a = t.value;
372
- a === void 0 && (a = "");
373
- var o;
374
- n === "ArrowLeft" || n === "Backspace" ? o = Math.max(r - 1, 0) : n === "ArrowRight" ? o = Math.min(r + 1, a.length) : n === "Delete" && (o = r);
375
- var s = 0;
376
- n === "Delete" && r === i && (s = 1);
377
- var c = n === "ArrowLeft" || n === "ArrowRight";
378
- if (o === void 0 || r !== i && !c) S(e), le(t, s);
379
- else {
380
- var l = o;
381
- c ? (l = Q(a, o, n === "ArrowLeft" ? "left" : "right"), l !== o && e.preventDefault()) : n === "Delete" && !z(a[o]) ? l = Q(a, o, "right") : n === "Backspace" && !z(a[o]) && (l = Q(a, o, "left")), l !== o && Z(t, l, a), S(e), le(t, s);
382
- }
383
- }, fe = function(e) {
384
- var t = e.target, n = function() {
385
- var e = t.selectionStart, n = t.selectionEnd, r = t.value;
386
- if (r === void 0 && (r = ""), e === n) {
387
- var i = Q(r, e);
388
- i !== e && Z(t, i, r);
389
- }
390
- };
391
- n(), requestAnimationFrame(function() {
392
- n();
393
- }), C(e), le(t);
394
- }, pe = function(e) {
395
- e.persist && e.persist();
396
- var t = e.target, n = e.currentTarget;
397
- J.current = t, Y.current.focusTimeout = setTimeout(function() {
398
- var r = t.selectionStart, i = t.selectionEnd, a = t.value;
399
- a === void 0 && (a = "");
400
- var o = Q(a, r);
401
- o !== r && (r !== 0 || i !== a.length) && Z(t, o, a), D(Object.assign(Object.assign({}, e), { currentTarget: n }));
402
- }, 0);
403
- }, me = function(e) {
404
- J.current = null, clearTimeout(Y.current.focusTimeout), clearTimeout(Y.current.setCaretTimeout), A(e);
405
- }, he = re && k() ? "numeric" : void 0, ge = Object.assign({ inputMode: he }, V, {
406
- type: l,
407
- value: W,
408
- onChange: ue,
409
- onKeyDown: de,
410
- onMouseUp: fe,
411
- onFocus: pe,
412
- onBlur: me
413
- });
414
- if (d === "text") return p ? e.createElement(e.Fragment, null, p(W, V) || null) : e.createElement("span", Object.assign({}, V, { ref: m }), W);
415
- if (f) {
416
- var _e = f;
417
- return e.createElement(_e, Object.assign({}, ge, { ref: m }));
418
- }
419
- return e.createElement("input", Object.assign({}, ge, { ref: m }));
420
- }
421
- function z(e, t) {
422
- var n = t.decimalScale, r = t.fixedDecimalScale, i = t.prefix;
423
- i === void 0 && (i = "");
424
- var a = t.suffix;
425
- a === void 0 && (a = "");
426
- var o = t.allowNegative, s = t.thousandsGroupStyle;
427
- if (s === void 0 && (s = "thousand"), e === "" || e === "-") return e;
428
- var c = B(t), l = c.thousandSeparator, u = c.decimalSeparator, d = n !== 0 && e.indexOf(".") !== -1 || n && r, f = v(e, o), p = f.beforeDecimal, m = f.afterDecimal, h = f.addNegation;
429
- return n !== void 0 && (m = b(m, n, !!r)), l && (p = g(p, l, s)), i && (p = i + p), a && (m += a), h && (p = "-" + p), e = p + (d && u || "") + m, e;
430
- }
431
- function B(e) {
432
- var t = e.decimalSeparator;
433
- t === void 0 && (t = ".");
434
- var n = e.thousandSeparator, r = e.allowedDecimalSeparators;
435
- return n === !0 && (n = ","), r ||= [t, "."], {
436
- decimalSeparator: t,
437
- thousandSeparator: n,
438
- allowedDecimalSeparators: r
439
- };
440
- }
441
- function V(e, t) {
442
- e === void 0 && (e = "");
443
- var n = /* @__PURE__ */ RegExp("(-)"), r = /* @__PURE__ */ RegExp("(-)(.)*(-)"), i = n.test(e), a = r.test(e);
444
- return e = e.replace(/-/g, ""), i && !a && t && (e = "-" + e), e;
445
- }
446
- function H(e, t) {
447
- return RegExp("(^-)|[0-9]|" + m(e), t ? "g" : void 0);
448
- }
449
- function U(e, t, n) {
450
- return e === "" || !t?.match(/\d/) && !n?.match(/\d/) && typeof e == "string" && !isNaN(Number(e));
451
- }
452
- function W(e, t, n) {
453
- var r;
454
- t === void 0 && (t = A(e));
455
- var i = n.allowNegative, a = n.prefix;
456
- a === void 0 && (a = "");
457
- var o = n.suffix;
458
- o === void 0 && (o = "");
459
- var s = n.decimalScale, c = t.from, l = t.to, d = l.start, f = l.end, p = B(n), h = p.allowedDecimalSeparators, g = p.decimalSeparator, _ = e[f] === g;
460
- if (u(e) && (e === a || e === o) && t.lastValue === "") return e;
461
- if (f - d === 1 && h.indexOf(e[d]) !== -1) {
462
- var y = s === 0 ? "" : g;
463
- e = e.substring(0, d) + y + e.substring(d + 1, e.length);
464
- }
465
- var b = function(e, t, n) {
466
- var r = !1, i = !1;
467
- a.startsWith("-") ? r = !1 : e.startsWith("--") ? (r = !1, i = !0) : o.startsWith("-") && e.length === o.length ? r = !1 : e[0] === "-" && (r = !0);
468
- var s = +!!r;
469
- return i && (s = 2), s && (e = e.substring(s), t -= s, n -= s), {
470
- value: e,
471
- start: t,
472
- end: n,
473
- hasNegation: r
474
- };
475
- }, x = b(e, d, f), S = x.hasNegation;
476
- r = x, e = r.value, d = r.start, f = r.end;
477
- var C = b(t.lastValue, c.start, c.end), w = C.start, T = C.end, E = C.value, D = e.substring(d, f);
478
- e.length && E.length && (w > E.length - o.length || T < a.length) && !(D && o.startsWith(D)) && (e = E);
479
- var O = 0;
480
- e.startsWith(a) ? O += a.length : d < a.length && (O = d), e = e.substring(O), f -= O;
481
- var k = e.length, j = e.length - o.length;
482
- e.endsWith(o) ? k = j : (f > j || f > e.length - o.length) && (k = f), e = e.substring(0, k), e = V(S ? "-" + e : e, i), e = (e.match(H(g, !0)) || []).join("");
483
- var M = e.indexOf(g);
484
- e = e.replace(new RegExp(m(g), "g"), function(e, t) {
485
- return t === M ? "." : "";
486
- });
487
- var N = v(e, i), P = N.beforeDecimal, F = N.afterDecimal, I = N.addNegation;
488
- return l.end - l.start < c.end - c.start && P === "" && _ && !parseFloat(F) && (e = I ? "-" : ""), e;
489
- }
490
- function G(e, t) {
491
- var n = t.prefix;
492
- n === void 0 && (n = "");
493
- var r = t.suffix;
494
- r === void 0 && (r = "");
495
- var i = Array.from({ length: e.length + 1 }).map(function() {
496
- return !0;
497
- }), a = e[0] === "-";
498
- i.fill(!1, 0, Math.min(n.length + +!!a, e.length));
499
- var o = e.length;
500
- return i.fill(!1, o - r.length + 1, o + 1), i;
501
- }
502
- function ee(e) {
503
- var t = B(e), n = t.thousandSeparator, r = t.decimalSeparator, i = e.prefix;
504
- i === void 0 && (i = "");
505
- var a = e.allowNegative;
506
- if (a === void 0 && (a = !0), n === r) throw Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: " + n + " (thousandSeparator = {true} is same as thousandSeparator = \",\")\n decimalSeparator: " + r + " (default value for decimalSeparator is .)\n ");
507
- return i.startsWith("-") && a && (console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: " + i + "\n allowNegative: " + a + "\n "), a = !1), Object.assign(Object.assign({}, e), { allowNegative: a });
508
- }
509
- function K(e) {
510
- e = ee(e), e.decimalSeparator, e.allowedDecimalSeparators, e.thousandsGroupStyle;
511
- var t = e.suffix, n = e.allowNegative, r = e.allowLeadingZeros, i = e.onKeyDown;
512
- i === void 0 && (i = c);
513
- var a = e.onBlur;
514
- a === void 0 && (a = c);
515
- var l = e.thousandSeparator, f = e.decimalScale, m = e.fixedDecimalScale, h = e.prefix;
516
- h === void 0 && (h = "");
517
- var g = e.defaultValue, _ = e.value, v = e.valueIsNumericString, b = e.onValueChange, x = o(e, [
518
- "decimalSeparator",
519
- "allowedDecimalSeparators",
520
- "thousandsGroupStyle",
521
- "suffix",
522
- "allowNegative",
523
- "allowLeadingZeros",
524
- "onKeyDown",
525
- "onBlur",
526
- "thousandSeparator",
527
- "decimalScale",
528
- "fixedDecimalScale",
529
- "prefix",
530
- "defaultValue",
531
- "value",
532
- "valueIsNumericString",
533
- "onValueChange"
534
- ]), E = B(e), D = E.decimalSeparator, O = E.allowedDecimalSeparators, k = function(t) {
535
- return z(t, e);
536
- }, A = function(t, n) {
537
- return W(t, n, e);
538
- }, j = d(_) ? g : _, M = v ?? U(j, h, t);
539
- d(_) ? d(g) || (M ||= typeof g == "number") : M ||= typeof _ == "number";
540
- var N = function(e) {
541
- return p(e) ? e : (typeof e == "number" && (e = S(e)), M && typeof f == "number" ? C(e, f, !!m) : e);
542
- }, P = F(N(_), N(g), !!M, k, A, b), I = P[0], L = I.numAsString, R = I.formattedValue, V = P[1];
543
- return Object.assign(Object.assign({}, x), {
544
- value: R,
545
- valueIsNumericString: !1,
546
- isValidInputCharacter: function(e) {
547
- return e === D || u(e);
548
- },
549
- isCharacterSame: function(e) {
550
- var t = e.currentValue, n = e.lastValue, r = e.formattedValue, i = e.currentValueIndex, a = e.formattedValueIndex, o = t[i], s = r[a], c = T(n, t).to, l = function(e) {
551
- return A(e).indexOf(".") + h.length;
552
- };
553
- return _ === 0 && m && f && t[c.start] === D && l(t) < i && l(r) > a ? !1 : i >= c.start && i < c.end && O && O.includes(o) && s === D ? !0 : o === s;
554
- },
555
- onValueChange: V,
556
- format: k,
557
- removeFormatting: A,
558
- getCaretBoundary: function(t) {
559
- return G(t, e);
560
- },
561
- onKeyDown: function(e) {
562
- var t = e.target, r = e.key, a = t.selectionStart, o = t.selectionEnd, s = t.value;
563
- if (s === void 0 && (s = ""), (r === "Backspace" || r === "Delete") && o < h.length && s !== "-") e.preventDefault();
564
- else if (a !== o) i(e);
565
- else {
566
- r === "Backspace" && s[0] === "-" && a === h.length + 1 && n && w(t, 1), f && m && (r === "Backspace" && s[a - 1] === D ? (w(t, a - 1), e.preventDefault()) : r === "Delete" && s[a] === D && e.preventDefault()), O?.includes(r) && s[a] === D && w(t, a + 1);
567
- var c = l === !0 ? "," : l;
568
- r === "Backspace" && s[a - 1] === c && w(t, a - 1), r === "Delete" && s[a] === c && w(t, a + 1), i(e);
569
- }
570
- },
571
- onBlur: function(t) {
572
- var n = L;
573
- n.match(/\d/g) || (n = ""), r || (n = y(n)), m && f && (n = C(n, f, m)), n !== L && V({
574
- formattedValue: z(n, e),
575
- value: n,
576
- floatValue: parseFloat(n)
577
- }, {
578
- event: t,
579
- source: s.event
580
- }), a(t);
581
- }
582
- });
583
- }
584
- function q(t) {
585
- var n = K(t);
586
- return e.createElement(R, Object.assign({}, n));
587
- }
588
- export { R as NumberFormatBase, q as NumericFormat, G as getNumericCaretBoundary, z as numericFormatter, W as removeNumericFormat, K as useNumericFormat };
32
+ function c(c) {
33
+ let l = a(17), { onIncrement: u, onDecrement: d, disableIncrement: f, disableDecrement: p } = c, { t: m } = o(), h;
34
+ l[0] === m ? h = l[1] : (h = m("form_increase_value"), l[0] = m, l[1] = h);
35
+ let g;
36
+ l[2] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ r(n, { size: 15 }), l[2] = g) : g = l[2];
37
+ let _;
38
+ l[3] !== f || l[4] !== u || l[5] !== h ? (_ = /* @__PURE__ */ r(e, {
39
+ "aria-label": h,
40
+ sx: s.btnUp,
41
+ variant: "outline",
42
+ onClick: u,
43
+ disabled: f,
44
+ type: "button",
45
+ children: g
46
+ }), l[3] = f, l[4] = u, l[5] = h, l[6] = _) : _ = l[6];
47
+ let v;
48
+ l[7] === m ? v = l[8] : (v = m("form_decrease_value"), l[7] = m, l[8] = v);
49
+ let y;
50
+ l[9] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ r(t, { size: 15 }), l[9] = y) : y = l[9];
51
+ let b;
52
+ l[10] !== p || l[11] !== d || l[12] !== v ? (b = /* @__PURE__ */ r(e, {
53
+ "aria-label": v,
54
+ sx: s.btnDown,
55
+ variant: "outline",
56
+ onClick: d,
57
+ disabled: p,
58
+ type: "button",
59
+ children: y
60
+ }), l[10] = p, l[11] = d, l[12] = v, l[13] = b) : b = l[13];
61
+ let x;
62
+ return l[14] !== _ || l[15] !== b ? (x = /* @__PURE__ */ i("div", {
63
+ className: "x78zum5 xdt5ytf x4aigyd",
64
+ children: [_, b]
65
+ }), l[14] = _, l[15] = b, l[16] = x) : x = l[16], x;
66
+ }
67
+ export { c as StepperControls };
package/dist/index207.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index25.cjs");let t=require("lucide-react"),n=require("react/jsx-runtime"),r=require("react/compiler-runtime"),i=require("react-i18next");function a(a){let o=(0,r.c)(17),{onIncrement:s,onDecrement:c,disableIncrement:l,disableDecrement:u}=a,{t:d}=(0,i.useTranslation)(),f;o[0]===d?f=o[1]:(f=d(`form_increase_value`),o[0]=d,o[1]=f);let p;o[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,n.jsx)(t.ChevronUp,{size:15}),o[2]=p):p=o[2];let m;o[3]!==l||o[4]!==s||o[5]!==f?(m=(0,n.jsx)(e.Button,{"aria-label":f,className:`px-2 h-5 rounded-l-none rounded-br-none border-input border-l-0 border-b-[0.5px] focus-visible:relative`,variant:`outline`,onClick:s,disabled:l,type:`button`,children:p}),o[3]=l,o[4]=s,o[5]=f,o[6]=m):m=o[6];let h;o[7]===d?h=o[8]:(h=d(`form_decrease_value`),o[7]=d,o[8]=h);let g;o[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,n.jsx)(t.ChevronDown,{size:15}),o[9]=g):g=o[9];let _;o[10]!==u||o[11]!==c||o[12]!==h?(_=(0,n.jsx)(e.Button,{"aria-label":h,className:`px-2 h-5 rounded-l-none rounded-tr-none border-input border-l-0 border-t-[0.5px] focus-visible:relative`,variant:`outline`,onClick:c,disabled:u,type:`button`,children:g}),o[10]=u,o[11]=c,o[12]=h,o[13]=_):_=o[13];let v;return o[14]!==m||o[15]!==_?(v=(0,n.jsxs)(`div`,{className:`flex flex-col ml-1`,children:[m,_]}),o[14]=m,o[15]=_,o[16]=v):v=o[16],v}exports.StepperControls=a;
1
+ const e=require("./index36.cjs");var t=[];function n({rules:n,inputClassName:r,stepper:i,min:a,max:o,onChange:s,passthroughProps:c}){let l=n?.required!==void 0&&n.required!==!1;return{isRequired:l,enhancedRules:(()=>{if(!n)return n;let e={...n};return l&&typeof e.required!=`string`&&typeof e.required!=`object`?e.required=`This field is required`:typeof e.required==`object`&&!e.required.message&&(e.required={...e.required,message:`This field is required`}),e})(),numericClass:e.cn(t,r),getHandlers:({currentValue:e,field:t})=>{let n=()=>{let n=Math.min((e??0)+i,o);t.onChange(n),s?.(n)},r=()=>{let n=Math.max((e??0)-i,a);t.onChange(n),s?.(n)};return{handleIncrement:n,handleDecrement:r,handleKeyDown:e=>{e.key===`ArrowUp`?(e.preventDefault(),n()):e.key===`ArrowDown`&&(e.preventDefault(),r()),c.onKeyDown&&c.onKeyDown(e)},handleBlur:()=>{let n=e;n!==void 0&&(n<a?(t.onChange(a),s?.(a)):n>o&&(t.onChange(o),s?.(o))),t.onBlur(),c.onBlur&&c.onBlur()},numericOnValueChange:e=>{let n=e.floatValue===void 0?void 0:e.floatValue;t.onChange(n),s?.(n)}}}}}exports.useFormNumberInput=n;