@konstructio/ui 0.1.2-alpha.104 → 0.1.2-alpha.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AlertDialogTrigger-BGo_acd5.js → AlertDialogTrigger-BOrb536P.js} +39 -39
- package/dist/{Breadcrumb-Cp3abB2w.js → Breadcrumb-DVBxqgW_.js} +2 -2
- package/dist/Checkbox-B20uoUKD.js +249 -0
- package/dist/{CommandInput-BLq69pOT.js → CommandInput-BWt6-vUK.js} +3 -3
- package/dist/{Counter-BV680M5r.js → Counter-DiQb-he2.js} +2 -2
- package/dist/{DayPicker-kweJz134.js → DayPicker-C22j0Y-u.js} +539 -518
- package/dist/{DropdownButton-DfNojmCW.js → DropdownButton-hCVYZ1LA.js} +5 -5
- package/dist/{FlagSelectorList-CkTR3j6O.js → FlagSelectorList-CnJjnsp6.js} +11 -8
- package/dist/{HamburgerTrigger-DRylBL2d.js → HamburgerTrigger-BT2yUUJ-.js} +2 -2
- package/dist/{ImageUpload-DiwymQcU.js → ImageUpload-DgCBCa5X.js} +1 -1
- package/dist/{Input-Cf44DzfE.js → Input-wp-rsCmX.js} +2 -2
- package/dist/{Modal-Dyn088X7.js → Modal-CkAf9UY7.js} +3 -3
- package/dist/{Switch-aPhL5rNG.js → Switch-CyJXptgc.js} +80 -77
- package/dist/{Toast-3NEz7LLa.js → Toast-DLJDExxw.js} +7 -6
- package/dist/{Wrapper-DP6Sxngx.js → Wrapper-B8Ja3k4j.js} +63 -63
- package/dist/{Wrapper-CVJSuYWx.js → Wrapper-CvDRHgN4.js} +3 -3
- package/dist/Wrapper-R8fik3ah.js +182 -0
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +27 -25
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -3
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/BackButton/BackButton.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +1 -1
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +1 -1
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +30 -28
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +23 -21
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.js +27 -25
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +51 -36
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +40 -38
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +1 -1
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +1 -1
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +1 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +42 -40
- package/dist/components/Filter/utils/index.js +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +11 -11
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +2 -2
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +3 -3
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/PieChart/PieChart.js +30 -27
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/Select.js +36 -33
- package/dist/components/Select/components/List/List.js +31 -31
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +1 -1
- package/dist/components/Select/hooks/useNavigationList.js +2 -3
- package/dist/components/Select/hooks/useSelect.js +29 -41
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.variants.js +15 -7
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +11 -11
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +16 -16
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +19 -16
- package/dist/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/dist/components/VirtualizedTable/components/Body/Body.js +1 -1
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +3 -3
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +2 -2
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/index.js +10 -10
- package/dist/{components-Cf345jTv.js → components-MnxnhLqM.js} +1 -1
- package/dist/{constants-CxJJRVK3.js → constants-CSsr7_YV.js} +1 -1
- package/dist/{debounce-C5Ycjilj.js → debounce-BdyZeJQk.js} +2 -2
- package/dist/{dist-BaPW7qXd2.js → dist-B6ExqXM_2.js} +1 -1
- package/dist/{dist-BZNE2Tnx.js → dist-BbX4Nrk2.js} +1 -1
- package/dist/{dist-BdobXn93.js → dist-C87gsBDM.js} +1 -1
- package/dist/{dist-DDck_2lb.js → dist-CqNOgbfR.js} +117 -116
- package/dist/{dist-C3YVLapk.js → dist-DO3apbIh.js} +24 -24
- package/dist/{dist-CzKqHuqJ2.js → dist-DwxO2RoR2.js} +38 -38
- package/dist/{dist-DFCz63oC2.js → dist-Z0F27ATp2.js} +157 -158
- package/dist/{dist-AihTpWdF.js → dist-iUAHw-3y.js} +272 -272
- package/dist/{dist-tGUUcv8n.js → dist-oJzmvhAb.js} +114 -115
- package/dist/{dist-BlPTJNIm.js → dist-ut_BEHii.js} +1 -1
- package/dist/es2015-B_07N-UL.js +796 -0
- package/dist/index.js +10 -10
- package/dist/{isObject-BeFFiVJK.js → isObject-pLoSfdr0.js} +1 -1
- package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/lib/components/Checkbox/Checkbox.types.d.ts +2 -1
- package/dist/lib/components/Select/hooks/useSelect.d.ts +1 -3
- package/dist/lib/components/Switch/Switch.variants.d.ts +3 -1
- package/dist/{libphonenumber-hGupNnJu.js → libphonenumber-BMq3Thej.js} +356 -347
- package/dist/package.json +21 -21
- package/dist/{phone-number.provider-BxQCTxp8.js → phone-number.provider-Dkq_p1Gi.js} +2 -2
- package/dist/{prop-types-CfEYxTbR.js → prop-types-BCUW56rg.js} +1 -1
- package/dist/{react-CvUtBTMg.js → react-B6Nc0Fib.js} +835 -827
- package/dist/{rolldown-runtime-Ck3dxwZt.js → rolldown-runtime-Dw9YIBcH.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table.provider-B0BafHuU.js → table.provider-DfZ74xMZ.js} +95 -95
- package/dist/{useBreadcrumb-DYfZL_2p.js → useBreadcrumb-Ds_9BeFz.js} +7 -6
- package/dist/{utils-B-BTGYA5.js → utils-DVYdP0CJ.js} +2 -3
- package/dist/{x-BI9jmc7e.js → x-Ierxf0uI.js} +2 -2
- package/package.json +21 -21
- package/dist/Checkbox-B_ngk9Dj.js +0 -249
- package/dist/Wrapper-BhqUVI1G.js +0 -171
- package/dist/es2015-DigR3dar.js +0 -795
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { o as Ne } from "./rolldown-runtime-
|
|
1
|
+
import { o as Ne } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
2
|
import { t as X } from "./utils-Cx-WzRZF.js";
|
|
3
3
|
import { useClickOutside as Be } from "./hooks/useClickOutside.js";
|
|
4
4
|
import { Typography as ee } from "./components/Typography/Typography.js";
|
|
5
|
-
import { n as Re } from "./phone-number.provider-
|
|
5
|
+
import { n as Re } from "./phone-number.provider-Dkq_p1Gi.js";
|
|
6
6
|
import { usePhoneNumberContext as Ge } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
7
7
|
import { labelVariants as Le, phoneNumberInputVariants as Ve } from "./components/PhoneNumberInput/PhoneNumberInput.variants.js";
|
|
8
8
|
import { getPhoneMask as xe } from "./components/PhoneNumberInput/utils/index.js";
|
|
9
9
|
import { FlagContent as Ke } from "./components/PhoneNumberInput/components/FlagContent/FlagContent.js";
|
|
10
10
|
import { FlagSelectorWrapper as De } from "./components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js";
|
|
11
|
-
import { forwardRef as Fe, useCallback as pe, useEffect as
|
|
12
|
-
import { jsx as
|
|
13
|
-
function
|
|
11
|
+
import { forwardRef as Fe, useCallback as pe, useEffect as de, useId as Ue, useImperativeHandle as _e, useMemo as $e, useRef as te } from "react";
|
|
12
|
+
import { jsx as R, jsxs as Z } from "react/jsx-runtime";
|
|
13
|
+
function fe(e, n) {
|
|
14
14
|
(n == null || n > e.length) && (n = e.length);
|
|
15
15
|
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
|
|
16
16
|
return r;
|
|
@@ -36,9 +36,9 @@ function Se(e, n) {
|
|
|
36
36
|
if (!t) {
|
|
37
37
|
if (Array.isArray(e) || (t = (function(i, u) {
|
|
38
38
|
if (i) {
|
|
39
|
-
if (typeof i == "string") return
|
|
39
|
+
if (typeof i == "string") return fe(i, u);
|
|
40
40
|
var s = {}.toString.call(i).slice(8, -1);
|
|
41
|
-
return s === "Object" && i.constructor && (s = i.constructor.name), s === "Map" || s === "Set" ? Array.from(i) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ?
|
|
41
|
+
return s === "Object" && i.constructor && (s = i.constructor.name), s === "Map" || s === "Set" ? Array.from(i) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? fe(i, u) : void 0;
|
|
42
42
|
}
|
|
43
43
|
})(e)) || n) {
|
|
44
44
|
t && (e = t);
|
|
@@ -172,8 +172,8 @@ function U(e, n) {
|
|
|
172
172
|
var t, r = n.replacementChars, o = n.replacement, a = n.separate, l = r, c = "", i = Se(e);
|
|
173
173
|
try {
|
|
174
174
|
for (i.s(); !(t = i.n()).done; ) {
|
|
175
|
-
var u, s = t.value,
|
|
176
|
-
(a && s === l[0] ||
|
|
175
|
+
var u, s = t.value, d = !Object.prototype.hasOwnProperty.call(o, s) && ((u = o[l[0]]) === null || u === void 0 ? void 0 : u.test(s));
|
|
176
|
+
(a && s === l[0] || d) && (l = l.slice(1), c += s);
|
|
177
177
|
}
|
|
178
178
|
} catch (O) {
|
|
179
179
|
i.e(O);
|
|
@@ -196,8 +196,8 @@ function Me(e, n) {
|
|
|
196
196
|
u.f();
|
|
197
197
|
}
|
|
198
198
|
if (a && !l) {
|
|
199
|
-
for (var
|
|
200
|
-
i = i.slice(0,
|
|
199
|
+
for (var d = r.length - 1; d >= 0 && i[d] === r[d]; d--) ;
|
|
200
|
+
i = i.slice(0, d + 1);
|
|
201
201
|
}
|
|
202
202
|
return i;
|
|
203
203
|
}
|
|
@@ -216,9 +216,9 @@ function K(e) {
|
|
|
216
216
|
return e.length > 0 ? we({}, e, /./) : {};
|
|
217
217
|
}
|
|
218
218
|
function ae(e, n) {
|
|
219
|
-
for (var t = n.start, r = t === void 0 ? 0 : t, o = n.end, a = n.mask, l = n.replacement, c = n.separate, i = e.slice(r, o), u = a.slice(r, o), s = "",
|
|
220
|
-
var O = Object.prototype.hasOwnProperty.call(l, u[
|
|
221
|
-
O && i[
|
|
219
|
+
for (var t = n.start, r = t === void 0 ? 0 : t, o = n.end, a = n.mask, l = n.replacement, c = n.separate, i = e.slice(r, o), u = a.slice(r, o), s = "", d = 0; d < u.length; d++) {
|
|
220
|
+
var O = Object.prototype.hasOwnProperty.call(l, u[d]);
|
|
221
|
+
O && i[d] !== void 0 && i[d] !== u[d] ? s += i[d] : O && c && (s += u[d]);
|
|
222
222
|
}
|
|
223
223
|
return s;
|
|
224
224
|
}
|
|
@@ -442,9 +442,9 @@ var _ = (function(e) {
|
|
|
442
442
|
this.register = function(a) {
|
|
443
443
|
var l;
|
|
444
444
|
if (be.includes(a.type)) {
|
|
445
|
-
var c = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = c.initialValue, u = i === void 0 ? "" : i, s = c.controlled,
|
|
445
|
+
var c = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = c.initialValue, u = i === void 0 ? "" : i, s = c.controlled, d = s !== void 0 && s, O = t({
|
|
446
446
|
initialValue: a.value || u,
|
|
447
|
-
controlled:
|
|
447
|
+
controlled: d
|
|
448
448
|
}), P = O.value, j = O.options, y = {
|
|
449
449
|
value: P,
|
|
450
450
|
options: j,
|
|
@@ -458,45 +458,45 @@ var _ = (function(e) {
|
|
|
458
458
|
selectionEnd: 0
|
|
459
459
|
}, S = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
|
|
460
460
|
Object.defineProperty(a, "value", ye(ye({}, S), {}, { set: function(h) {
|
|
461
|
-
var
|
|
462
|
-
p.value = h, S == null || (
|
|
461
|
+
var f;
|
|
462
|
+
p.value = h, S == null || (f = S.set) === null || f === void 0 || f.call(a, h);
|
|
463
463
|
} })), a.value = P;
|
|
464
464
|
var w = function() {
|
|
465
465
|
var h = function() {
|
|
466
|
-
var
|
|
467
|
-
p.selectionStart = (
|
|
466
|
+
var f, k;
|
|
467
|
+
p.selectionStart = (f = a.selectionStart) !== null && f !== void 0 ? f : 0, p.selectionEnd = (k = a.selectionEnd) !== null && k !== void 0 ? k : 0, m.id = window.setTimeout(h);
|
|
468
468
|
};
|
|
469
469
|
m.id = window.setTimeout(h);
|
|
470
470
|
}, E = function() {
|
|
471
471
|
window.clearTimeout(m.id), m.id = -1, m.cachedId = -1;
|
|
472
472
|
}, v = function(h) {
|
|
473
473
|
try {
|
|
474
|
-
var
|
|
474
|
+
var f, k;
|
|
475
475
|
if (m.cachedId === m.id) throw new _("The input selection has not been updated.");
|
|
476
476
|
m.cachedId = m.id;
|
|
477
477
|
var M = a.value, g = a.selectionStart, A = a.selectionEnd;
|
|
478
478
|
if (g === null || A === null) throw new _("The selection attributes have not been initialized.");
|
|
479
|
-
var C,
|
|
480
|
-
if (h.inputType === void 0 && (p.selectionStart = 0, p.selectionEnd =
|
|
481
|
-
var
|
|
482
|
-
if (C === "insert")
|
|
479
|
+
var C, T = p.value;
|
|
480
|
+
if (h.inputType === void 0 && (p.selectionStart = 0, p.selectionEnd = T.length), g > p.selectionStart ? C = "insert" : g <= p.selectionStart && g < p.selectionEnd ? C = "deleteBackward" : g === p.selectionEnd && M.length < T.length && (C = "deleteForward"), C === void 0 || (C === "deleteBackward" || C === "deleteForward") && M.length > T.length) throw new _("Input type detection error.");
|
|
481
|
+
var b = "", N = p.selectionStart, B = p.selectionEnd;
|
|
482
|
+
if (C === "insert") b = M.slice(p.selectionStart, g);
|
|
483
483
|
else {
|
|
484
|
-
var D =
|
|
485
|
-
N = g,
|
|
484
|
+
var D = T.length - M.length;
|
|
485
|
+
N = g, B = g + D;
|
|
486
486
|
}
|
|
487
|
-
y.value !==
|
|
487
|
+
y.value !== T ? y.options = y.fallbackOptions : y.fallbackOptions = y.options;
|
|
488
488
|
var F = y.options, G = r({
|
|
489
489
|
inputType: C,
|
|
490
|
-
previousValue:
|
|
490
|
+
previousValue: T,
|
|
491
491
|
previousOptions: F,
|
|
492
492
|
value: M,
|
|
493
|
-
addedValue:
|
|
493
|
+
addedValue: b,
|
|
494
494
|
changeStart: N,
|
|
495
|
-
changeEnd:
|
|
495
|
+
changeEnd: B,
|
|
496
496
|
selectionStart: g,
|
|
497
497
|
selectionEnd: A
|
|
498
498
|
}), H = G.options, I = an(G, on);
|
|
499
|
-
a.value = I.value, a.setSelectionRange(I.selectionStart, I.selectionEnd), y.value = I.value, y.options = H, p.selectionStart = I.selectionStart, p.selectionEnd = I.selectionEnd, (
|
|
499
|
+
a.value = I.value, a.setSelectionRange(I.selectionStart, I.selectionEnd), y.value = I.value, y.options = H, p.selectionStart = I.selectionStart, p.selectionEnd = I.selectionEnd, (f = a._valueTracker) === null || f === void 0 || (k = f.setValue) === null || k === void 0 || k.call(f, T);
|
|
500
500
|
} catch (W) {
|
|
501
501
|
if (a.value = p.value, a.setSelectionRange(p.selectionStart, p.selectionEnd), h.preventDefault(), h.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
|
|
502
502
|
}
|
|
@@ -543,8 +543,8 @@ var Ie = (function(e) {
|
|
|
543
543
|
var t, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
544
544
|
return He(this, n), (t = ze(this, n, [{
|
|
545
545
|
init: function(o) {
|
|
546
|
-
var a = o.initialValue, l = o.controlled, c = x(r), i = c.mask, u = c.replacement, s = c.separate,
|
|
547
|
-
return a = l || a ? a :
|
|
546
|
+
var a = o.initialValue, l = o.controlled, c = x(r), i = c.mask, u = c.replacement, s = c.separate, d = c.showMask;
|
|
547
|
+
return a = l || a ? a : d ? i : "", process.env.NODE_ENV !== "production" && (function(O) {
|
|
548
548
|
var P = O.initialValue, j = O.mask, y = O.replacement;
|
|
549
549
|
P.length > j.length && console.error(ne(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(P, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
550
550
|
var m = Object.keys(y).filter((function(v) {
|
|
@@ -573,7 +573,7 @@ var Ie = (function(e) {
|
|
|
573
573
|
};
|
|
574
574
|
},
|
|
575
575
|
tracking: function(o) {
|
|
576
|
-
var a = o.inputType, l = o.previousValue, c = o.previousOptions, i = o.addedValue, u = o.changeStart, s = o.changeEnd,
|
|
576
|
+
var a = o.inputType, l = o.previousValue, c = o.previousOptions, i = o.addedValue, u = o.changeStart, s = o.changeEnd, d = x(r), O = d.track, P = d.modify, j = Je(d, ln), y = j.mask, m = j.replacement, p = j.showMask, S = j.separate, w = J(J({}, a === "insert" ? {
|
|
577
577
|
inputType: a,
|
|
578
578
|
data: i
|
|
579
579
|
} : {
|
|
@@ -588,7 +588,7 @@ var Ie = (function(e) {
|
|
|
588
588
|
E === null ? i = "" : E !== !0 && E !== void 0 && (i = E);
|
|
589
589
|
var v = P?.(w);
|
|
590
590
|
v?.mask !== void 0 && (y = v.mask), v?.replacement !== void 0 && (m = typeof v?.replacement == "string" ? K(v?.replacement) : v.replacement), v?.showMask !== void 0 && (p = v.showMask), v?.separate !== void 0 && (S = v.separate);
|
|
591
|
-
var h = ae(l, J({ end: u }, c)),
|
|
591
|
+
var h = ae(l, J({ end: u }, c)), f = ae(l, J({ start: s }, c)), k = RegExp("[^".concat(Object.keys(m).join(""), "]"), "g"), M = y.replace(k, "");
|
|
592
592
|
if (h && (h = U(h, {
|
|
593
593
|
replacementChars: M,
|
|
594
594
|
replacement: m,
|
|
@@ -600,26 +600,26 @@ var Ie = (function(e) {
|
|
|
600
600
|
}), M = M.slice(i.length)), a === "insert" && i === "") throw new _("The character does not match the key value of the `replacement` object.");
|
|
601
601
|
if (S) {
|
|
602
602
|
var g = y.slice(u, s).replace(k, ""), A = g.length - i.length;
|
|
603
|
-
A < 0 ?
|
|
603
|
+
A < 0 ? f = f.slice(-A) : A > 0 && (f = g.slice(-A) + f);
|
|
604
604
|
}
|
|
605
|
-
|
|
605
|
+
f && (f = U(f, {
|
|
606
606
|
replacementChars: M,
|
|
607
607
|
replacement: m,
|
|
608
608
|
separate: S
|
|
609
609
|
}));
|
|
610
|
-
var C = Me(h + i +
|
|
610
|
+
var C = Me(h + i + f, {
|
|
611
611
|
mask: y,
|
|
612
612
|
replacement: m,
|
|
613
613
|
separate: S,
|
|
614
614
|
showMask: p
|
|
615
|
-
}),
|
|
616
|
-
var N,
|
|
615
|
+
}), T = (function(b) {
|
|
616
|
+
var N, B, D, F = b.inputType, G = b.value, H = b.addedValue, I = b.beforeChangeValue, W = b.mask, le = b.replacement, Ae = b.separate, Q = Pe(G, {
|
|
617
617
|
mask: W,
|
|
618
618
|
replacement: le
|
|
619
619
|
}).filter((function(q) {
|
|
620
620
|
var se = q.type;
|
|
621
621
|
return se === "input" || Ae && se === "replacement";
|
|
622
|
-
})), ce = (N = Q[I.length + H.length - 1]) === null || N === void 0 ? void 0 : N.index, L = (
|
|
622
|
+
})), ce = (N = Q[I.length + H.length - 1]) === null || N === void 0 ? void 0 : N.index, L = (B = Q[I.length - 1]) === null || B === void 0 ? void 0 : B.index, V = (D = Q[I.length + H.length]) === null || D === void 0 ? void 0 : D.index;
|
|
623
623
|
if (F === "insert") {
|
|
624
624
|
if (ce !== void 0) return ce + 1;
|
|
625
625
|
if (V !== void 0) return V;
|
|
@@ -648,8 +648,8 @@ var Ie = (function(e) {
|
|
|
648
648
|
});
|
|
649
649
|
return {
|
|
650
650
|
value: C,
|
|
651
|
-
selectionStart:
|
|
652
|
-
selectionEnd:
|
|
651
|
+
selectionStart: T,
|
|
652
|
+
selectionEnd: T,
|
|
653
653
|
options: {
|
|
654
654
|
mask: y,
|
|
655
655
|
replacement: m,
|
|
@@ -972,42 +972,42 @@ var sn = {
|
|
|
972
972
|
countries: sn
|
|
973
973
|
};
|
|
974
974
|
un.registerLocale(pn);
|
|
975
|
-
var Mn = Fe(({ disabled: e = !1, error: n, helperText: t, helperTextClassName: r, isRequired: o, label: a, labelClassName: l, labelWrapperClassName: c, name: i, placeholder: u, showFlagOnSearch: s = !0, showInputFilter:
|
|
976
|
-
const p = Ue(), S = i ?? p, w = te(null), { isOpenSelector: E, value: v, selectedCountry: h, onChangeValue:
|
|
975
|
+
var Mn = Fe(({ disabled: e = !1, error: n, helperText: t, helperTextClassName: r, isRequired: o, label: a, labelClassName: l, labelWrapperClassName: c, name: i, placeholder: u, showFlagOnSearch: s = !0, showInputFilter: d = !0, showNameOnSearch: O = !0, wrapperClassName: P, showPlaceHolder: j, ...y }, m) => {
|
|
976
|
+
const p = Ue(), S = i ?? p, w = te(null), { isOpenSelector: E, value: v, selectedCountry: h, onChangeValue: f, handleOpenSelector: k } = Ge(), M = typeof n == "string" && n.length >= 0, g = cn({
|
|
977
977
|
mask: xe(h),
|
|
978
978
|
replacement: { _: /\d/ }
|
|
979
979
|
});
|
|
980
980
|
_e(m, () => g.current, [g]);
|
|
981
981
|
const A = (b) => {
|
|
982
|
-
b.target.value.startsWith(h.prefix) ?
|
|
983
|
-
}
|
|
984
|
-
Be(w, pe(() => {
|
|
982
|
+
b.target.value.startsWith(h.prefix) ? f(b.target.value) : f(`${h.prefix} `);
|
|
983
|
+
}, C = pe(() => {
|
|
985
984
|
k(!1);
|
|
986
|
-
}, [k])
|
|
987
|
-
|
|
988
|
-
|
|
985
|
+
}, [k]);
|
|
986
|
+
Be(w, C), de(() => {
|
|
987
|
+
const b = new AbortController(), N = (B) => {
|
|
988
|
+
B.key === "Escape" && k(!1);
|
|
989
989
|
};
|
|
990
|
-
return document.addEventListener("keydown",
|
|
990
|
+
return document.addEventListener("keydown", N, { signal: b.signal }), document.addEventListener("visibilitychange", () => {
|
|
991
991
|
document.hidden && k(!1);
|
|
992
992
|
}, { signal: b.signal }), () => {
|
|
993
993
|
b.abort();
|
|
994
994
|
};
|
|
995
|
-
}, [k]),
|
|
995
|
+
}, [k]), de(() => {
|
|
996
996
|
g.current && (g.current.value = h.prefix + " ");
|
|
997
997
|
}, [h.code]);
|
|
998
|
-
const
|
|
998
|
+
const T = pe((b) => {
|
|
999
999
|
b === null && g.current?.blur(), g.current = b;
|
|
1000
1000
|
}, [g]);
|
|
1001
1001
|
return /* @__PURE__ */ Z("div", {
|
|
1002
1002
|
className: "w-full flex flex-col gap-2",
|
|
1003
1003
|
children: [
|
|
1004
|
-
a ? /* @__PURE__ */
|
|
1004
|
+
a ? /* @__PURE__ */ R("div", {
|
|
1005
1005
|
className: X(c),
|
|
1006
1006
|
children: /* @__PURE__ */ Z("label", {
|
|
1007
1007
|
htmlFor: S,
|
|
1008
1008
|
className: Le({ className: l }),
|
|
1009
1009
|
onClick: () => !e && g.current?.focus(),
|
|
1010
|
-
children: [a, o && /* @__PURE__ */
|
|
1010
|
+
children: [a, o && /* @__PURE__ */ R(ee, {
|
|
1011
1011
|
component: "span",
|
|
1012
1012
|
className: "text-red-600 dark:text-red-500 ml-1",
|
|
1013
1013
|
children: "*"
|
|
@@ -1023,9 +1023,9 @@ var Mn = Fe(({ disabled: e = !1, error: n, helperText: t, helperTextClassName: r
|
|
|
1023
1023
|
}),
|
|
1024
1024
|
children: [/* @__PURE__ */ Z("div", {
|
|
1025
1025
|
className: "p-2 flex items-center gap-2.5",
|
|
1026
|
-
children: [/* @__PURE__ */
|
|
1026
|
+
children: [/* @__PURE__ */ R(Ke, {}), /* @__PURE__ */ R("input", {
|
|
1027
1027
|
id: a ? S : void 0,
|
|
1028
|
-
ref:
|
|
1028
|
+
ref: T,
|
|
1029
1029
|
name: i,
|
|
1030
1030
|
autoComplete: "off",
|
|
1031
1031
|
className: X("outline-0", "w-full", "caret-slate-800", "text-slate-800", "bg-transparent", "dark:caret-metal-50", "dark:text-metal-50", "disabled:cursor-not-allowed", "disabled:opacity-50"),
|
|
@@ -1036,20 +1036,20 @@ var Mn = Fe(({ disabled: e = !1, error: n, helperText: t, helperTextClassName: r
|
|
|
1036
1036
|
disabled: e,
|
|
1037
1037
|
...y
|
|
1038
1038
|
})]
|
|
1039
|
-
}), E && /* @__PURE__ */
|
|
1039
|
+
}), E && /* @__PURE__ */ R(De, {
|
|
1040
1040
|
placeholder: u,
|
|
1041
1041
|
showFlagOnSearch: s,
|
|
1042
|
-
showInputFilter:
|
|
1042
|
+
showInputFilter: d,
|
|
1043
1043
|
showNameOnSearch: O,
|
|
1044
1044
|
showPlaceHolder: j
|
|
1045
1045
|
})]
|
|
1046
1046
|
}),
|
|
1047
|
-
n ? /* @__PURE__ */
|
|
1047
|
+
n ? /* @__PURE__ */ R(ee, {
|
|
1048
1048
|
component: "span",
|
|
1049
1049
|
className: "text-xs text-red-700 dark:text-red-500",
|
|
1050
1050
|
children: n
|
|
1051
1051
|
}) : null,
|
|
1052
|
-
!n && t ? /* @__PURE__ */
|
|
1052
|
+
!n && t ? /* @__PURE__ */ R(ee, {
|
|
1053
1053
|
component: "span",
|
|
1054
1054
|
className: X("text-xs kubefirst-dark:text-slate-200", r),
|
|
1055
1055
|
children: t
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as k } from "./rolldown-runtime-
|
|
2
|
-
import { t as _ } from "./prop-types-
|
|
3
|
-
import { t as T } from "./x-
|
|
1
|
+
import { o as k } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
|
+
import { t as _ } from "./prop-types-BCUW56rg.js";
|
|
3
|
+
import { t as T } from "./x-Ierxf0uI.js";
|
|
4
4
|
import { t as l } from "./utils-Cx-WzRZF.js";
|
|
5
5
|
import { Tag as S } from "./components/Tag/Tag.js";
|
|
6
6
|
import { useTagSelect as C } from "./components/TagSelect/contexts/TagSelect.hook.js";
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { t as r } from "./utils-Cx-WzRZF.js";
|
|
2
|
+
import { LoaderIcon as oe } from "./assets/icons/components/Loader.js";
|
|
3
|
+
import { t as se } from "./createLucideIcon-MbzNWCaI.js";
|
|
4
|
+
import { t as ie } from "./chevron-up-Bjpvg6ui.js";
|
|
5
|
+
import { Typography as ce } from "./components/Typography/Typography.js";
|
|
6
|
+
import { useSelectContext as ue } from "./components/Select/contexts/select.hook.js";
|
|
7
|
+
import { List as me } from "./components/Select/components/List/List.js";
|
|
8
|
+
import { inputVariants as fe, labelVariants as pe, selectVariants as de } from "./components/Select/Select.variants.js";
|
|
9
|
+
import { useSelect as xe } from "./components/Select/hooks/useSelect.js";
|
|
10
|
+
import { forwardRef as he, useEffect as we, useId as Ne, useImperativeHandle as ge, useMemo as ve, useRef as h } from "react";
|
|
11
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
12
|
+
var ye = [["path", {
|
|
13
|
+
d: "m21 21-4.34-4.34",
|
|
14
|
+
key: "14j7rj"
|
|
15
|
+
}], ["circle", {
|
|
16
|
+
cx: "11",
|
|
17
|
+
cy: "11",
|
|
18
|
+
r: "8",
|
|
19
|
+
key: "4ej97u"
|
|
20
|
+
}]], ke = se("search", ye), Se = he(({ additionalOptions: R, className: D, defaultValue: w, disabled: a = !1, error: p, groupedOptions: T, iconClassName: S, inputClassName: E, isInfiniteScrollEnabled: F = !1, isLoading: k, isRequired: N, label: g, labelAction: K, labelClassName: M, labelWrapperClassName: W, listClassName: _, listItemClassName: $, listItemSecondRowClassName: q, name: d, noOptionsText: A, placeholder: v, searchable: C = !1, showSearchIcon: y, theme: H, visibleItems: P, wrapperClassName: U, onFetchMoreOptions: B, onBlur: G, onSearchChange: J, ...I }, Q) => {
|
|
21
|
+
const j = Ne(), c = h(null), L = h(null), O = h(null), X = h(0), { isOpen: o, options: l, searchTerm: Y, value: s, setCanFilter: Z, setSearchTerm: ee, setValue: u, toggleOpen: te } = ue(), t = ve(() => l.find(({ value: e }) => e === s), [l, s]), { wrapperRef: ae, wrapperInputRef: V, handleOpen: x } = xe({
|
|
22
|
+
inputRef: c,
|
|
23
|
+
searchInputRef: L,
|
|
24
|
+
internalValue: t,
|
|
25
|
+
onBlur: G
|
|
26
|
+
}), b = () => {
|
|
27
|
+
if (!a) {
|
|
28
|
+
if (o) {
|
|
29
|
+
te(!1);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
x();
|
|
33
|
+
}
|
|
34
|
+
}, re = (e) => {
|
|
35
|
+
if (!a) {
|
|
36
|
+
if (e.key === "ArrowDown") {
|
|
37
|
+
if (e.preventDefault(), !o) {
|
|
38
|
+
x();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
O.current?.querySelector("li")?.focus();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), b());
|
|
45
|
+
}
|
|
46
|
+
}, m = d ? `${j}-${d}` : j;
|
|
47
|
+
ge(Q, () => c.current, [c]), we(() => {
|
|
48
|
+
if (w && !s) {
|
|
49
|
+
const e = l && l.find((f) => f.value === w);
|
|
50
|
+
e && u(e.value);
|
|
51
|
+
}
|
|
52
|
+
}, [
|
|
53
|
+
w,
|
|
54
|
+
l,
|
|
55
|
+
u,
|
|
56
|
+
s
|
|
57
|
+
]);
|
|
58
|
+
const ne = (e) => {
|
|
59
|
+
const f = e.target.value;
|
|
60
|
+
Z(!0), u(""), ee(f ?? ""), J?.(f);
|
|
61
|
+
const z = l.find((le) => le.value.toLocaleLowerCase() === f.toLocaleLowerCase());
|
|
62
|
+
u(z ? z.value : t?.value ?? "");
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ i("div", {
|
|
65
|
+
ref: ae,
|
|
66
|
+
className: r("flex flex-col gap-2 w-full relative", U),
|
|
67
|
+
"data-theme": H,
|
|
68
|
+
children: [
|
|
69
|
+
g ? /* @__PURE__ */ i("div", {
|
|
70
|
+
className: r("flex items-center justify-between", W),
|
|
71
|
+
children: [/* @__PURE__ */ i("label", {
|
|
72
|
+
id: m,
|
|
73
|
+
className: r(pe({ className: M })),
|
|
74
|
+
htmlFor: m,
|
|
75
|
+
onClick: () => !a && x(),
|
|
76
|
+
children: [g, N && /* @__PURE__ */ n("span", {
|
|
77
|
+
className: "text-red-600 dark:text-red-500 ml-1",
|
|
78
|
+
children: "*"
|
|
79
|
+
})]
|
|
80
|
+
}), K]
|
|
81
|
+
}) : null,
|
|
82
|
+
/* @__PURE__ */ i("div", {
|
|
83
|
+
ref: V,
|
|
84
|
+
id: m,
|
|
85
|
+
className: r(de({
|
|
86
|
+
className: D,
|
|
87
|
+
hasError: !!p,
|
|
88
|
+
disabled: a
|
|
89
|
+
})),
|
|
90
|
+
role: "combobox",
|
|
91
|
+
onClick: b,
|
|
92
|
+
onKeyDown: re,
|
|
93
|
+
"aria-expanded": o,
|
|
94
|
+
tabIndex: X.current,
|
|
95
|
+
"aria-labelledby": m,
|
|
96
|
+
children: [/* @__PURE__ */ i("div", {
|
|
97
|
+
className: "flex gap-2.5 items-center flex-1",
|
|
98
|
+
children: [
|
|
99
|
+
t?.leftIcon && !y && /* @__PURE__ */ n("span", {
|
|
100
|
+
className: "w-4 h-4 flex justify-center items-center dark:text-metal-50",
|
|
101
|
+
children: t.leftIcon
|
|
102
|
+
}),
|
|
103
|
+
y && /* @__PURE__ */ n(ke, { className: r("w-4", "h-4", "text-zinc-500", "select-none", "transition-colors", "duration-300", "dark:text-metal-300", "dark:group-focus-within:text-metal-50") }),
|
|
104
|
+
C ? /* @__PURE__ */ n("input", {
|
|
105
|
+
ref: L,
|
|
106
|
+
type: "text",
|
|
107
|
+
value: o ? Y : t?.label ?? s ?? "",
|
|
108
|
+
onChange: ne,
|
|
109
|
+
placeholder: v,
|
|
110
|
+
className: r(fe({ className: E }), { "text-red-700 placeholder:text-red-700": !!p }),
|
|
111
|
+
onClick: (e) => {
|
|
112
|
+
e.stopPropagation(), a || x();
|
|
113
|
+
},
|
|
114
|
+
"aria-label": g || v,
|
|
115
|
+
"aria-labelledby": m,
|
|
116
|
+
required: N,
|
|
117
|
+
autoComplete: "off",
|
|
118
|
+
autoCapitalize: "words",
|
|
119
|
+
disabled: a,
|
|
120
|
+
tabIndex: -1,
|
|
121
|
+
...I
|
|
122
|
+
}) : /* @__PURE__ */ i(ce, {
|
|
123
|
+
variant: "body2",
|
|
124
|
+
className: r("flex-1 text-zinc-400 text-sm dark:text-metal-400 flex gap-2 items-center", {
|
|
125
|
+
"text-red-700": !!p,
|
|
126
|
+
"select-none": !t,
|
|
127
|
+
"text-metal-800 dark:text-metal-50": t,
|
|
128
|
+
"text-metal-400/50 dark:text-metal-50/50": a
|
|
129
|
+
}, t?.wrapperClassNameOnSelectedValue),
|
|
130
|
+
children: [
|
|
131
|
+
t?.label || v,
|
|
132
|
+
" ",
|
|
133
|
+
t?.showRightComponentOnselectedValue ? t?.rightComponent : null
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}), k ? /* @__PURE__ */ n(oe, {
|
|
138
|
+
size: 16,
|
|
139
|
+
className: "text-metal-400 animate-spin select-none"
|
|
140
|
+
}) : !y && /* @__PURE__ */ n(ie, {
|
|
141
|
+
"data-state": o ? "open" : "closed",
|
|
142
|
+
className: r("w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-metal-50", S, {
|
|
143
|
+
"text-red-700": !!p,
|
|
144
|
+
"text-metal-400/50 dark:group-focus-within:text-zinc-500": a
|
|
145
|
+
})
|
|
146
|
+
})]
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ n("input", {
|
|
149
|
+
ref: c,
|
|
150
|
+
type: "text",
|
|
151
|
+
name: d,
|
|
152
|
+
className: "hidden",
|
|
153
|
+
"aria-hidden": "true",
|
|
154
|
+
required: N,
|
|
155
|
+
inert: !0,
|
|
156
|
+
defaultValue: t?.value ?? s ?? void 0,
|
|
157
|
+
...I
|
|
158
|
+
}),
|
|
159
|
+
o && /* @__PURE__ */ n(me, {
|
|
160
|
+
ref: O,
|
|
161
|
+
additionalOptions: R,
|
|
162
|
+
className: _,
|
|
163
|
+
groupedOptions: T,
|
|
164
|
+
itemClassName: $,
|
|
165
|
+
name: d,
|
|
166
|
+
wrapperInputRef: V,
|
|
167
|
+
inputRef: c,
|
|
168
|
+
options: l,
|
|
169
|
+
isLoading: !!k,
|
|
170
|
+
searchable: C,
|
|
171
|
+
listItemSecondRowClassName: q,
|
|
172
|
+
isInfiniteScrollEnabled: F,
|
|
173
|
+
onFetchMoreOptions: B,
|
|
174
|
+
noOptionsText: A,
|
|
175
|
+
visibleItems: P
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
export {
|
|
181
|
+
Se as t
|
|
182
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as h } from "../../x-
|
|
2
|
+
import { t as h } from "../../x-Ierxf0uI.js";
|
|
3
3
|
import { n as C } from "../../dist-DX0sBG3Q.js";
|
|
4
4
|
import { t as n } from "../../utils-Cx-WzRZF.js";
|
|
5
5
|
import { CheckCircleFilledIcon as v } from "../../assets/icons/components/CheckCircleFilled.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as n } from "../../utils-Cx-WzRZF.js";
|
|
3
|
-
import { a as T, c as z, i as B, l as E, n as P, o as S, r as q, s as F, t as G } from "../../AlertDialogTrigger-
|
|
3
|
+
import { a as T, c as z, i as B, l as E, n as P, o as S, r as q, s as F, t as G } from "../../AlertDialogTrigger-BOrb536P.js";
|
|
4
4
|
import { Button as i } from "../Button/Button.js";
|
|
5
5
|
import { useAlertDialog as H } from "./hooks/useAlertDialog.js";
|
|
6
6
|
import { useEffect as I, useRef as J, useState as L } from "react";
|
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { useClickOutside as
|
|
3
|
-
import { useCallback as E, useEffect as
|
|
4
|
-
var
|
|
5
|
-
const [
|
|
6
|
-
|
|
1
|
+
import { n as O } from "../../../utils-Cx-WzRZF.js";
|
|
2
|
+
import { useClickOutside as k } from "../../../hooks/useClickOutside.js";
|
|
3
|
+
import { useCallback as E, useEffect as c, useState as i } from "react";
|
|
4
|
+
var v = ({ options: l, inputRef: t, wrapperRef: r, onChange: u }) => {
|
|
5
|
+
const [m, d] = i(() => l ?? []), [b, n] = i(!1), [f, g] = i("");
|
|
6
|
+
c(() => {
|
|
7
7
|
const e = new AbortController();
|
|
8
8
|
return t.current?.addEventListener("focus", () => n(!0), { signal: e.signal }), () => {
|
|
9
9
|
e.abort();
|
|
10
10
|
};
|
|
11
|
-
}, [t])
|
|
11
|
+
}, [t]);
|
|
12
|
+
const C = E(() => {
|
|
12
13
|
n(!1);
|
|
13
|
-
}, [])
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
}, []);
|
|
15
|
+
k(r, C), c(() => {
|
|
16
|
+
const e = new AbortController(), o = (s) => {
|
|
17
|
+
s.key === "Escape" && (n(!1), t.current?.blur());
|
|
16
18
|
};
|
|
17
|
-
return document.addEventListener("keydown",
|
|
19
|
+
return document.addEventListener("keydown", o, { signal: e.signal }), () => {
|
|
18
20
|
e.abort();
|
|
19
21
|
};
|
|
20
|
-
}, [t]),
|
|
22
|
+
}, [t]), c(() => {
|
|
21
23
|
const e = new AbortController();
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
+
return r.current?.addEventListener("focusout", (o) => {
|
|
25
|
+
r.current?.contains(o.relatedTarget) || n(!1);
|
|
24
26
|
}, { signal: e.signal }), () => {
|
|
25
27
|
e.abort();
|
|
26
28
|
};
|
|
27
|
-
}, [
|
|
28
|
-
const
|
|
29
|
-
if (e.length === 0)
|
|
29
|
+
}, [r]);
|
|
30
|
+
const h = (e) => {
|
|
31
|
+
if (e.length === 0) d(l);
|
|
30
32
|
else {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
+
const o = l.map(({ value: a }) => a), s = O(o, e).map((a) => ({ value: a }));
|
|
34
|
+
d(s);
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
37
|
return {
|
|
36
38
|
inputRef: t,
|
|
37
|
-
newOptions:
|
|
38
|
-
showOptions:
|
|
39
|
-
value:
|
|
39
|
+
newOptions: m,
|
|
40
|
+
showOptions: b,
|
|
41
|
+
value: f,
|
|
40
42
|
handleChange: (e) => {
|
|
41
|
-
|
|
43
|
+
g(e.target.value), h(e.target.value), u?.(e.target.value);
|
|
42
44
|
},
|
|
43
45
|
handleSelectValue: (e) => {
|
|
44
|
-
|
|
46
|
+
g(e), h(e), u?.(e), n(!1);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
};
|
|
48
50
|
export {
|
|
49
|
-
|
|
51
|
+
v as useAutocomplete
|
|
50
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as l, useRef as b } from "react";
|
|
2
|
-
var
|
|
2
|
+
var w = ({ ulRef: t, inputRef: c, wrapperRef: u, options: a }) => {
|
|
3
3
|
const r = b(0);
|
|
4
4
|
l(() => {
|
|
5
5
|
const e = t.current?.querySelectorAll("li") ?? [], n = new AbortController(), o = () => {
|
|
@@ -21,7 +21,6 @@ var k = ({ ulRef: t, inputRef: c, wrapperRef: u, options: a }) => {
|
|
|
21
21
|
case "Enter":
|
|
22
22
|
case " ":
|
|
23
23
|
e[r.current].click();
|
|
24
|
-
break;
|
|
25
24
|
}
|
|
26
25
|
}, { signal: n.signal }), () => {
|
|
27
26
|
n.abort();
|
|
@@ -55,5 +54,5 @@ var k = ({ ulRef: t, inputRef: c, wrapperRef: u, options: a }) => {
|
|
|
55
54
|
}, [t, u]);
|
|
56
55
|
};
|
|
57
56
|
export {
|
|
58
|
-
|
|
57
|
+
w as useNavigationUlList
|
|
59
58
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as o } from "../../../../utils-Cx-WzRZF.js";
|
|
2
2
|
import { ArrowBackIcon as h } from "../../../../assets/icons/components/ArrowBack.js";
|
|
3
|
-
import { n as k, t as b } from "../../../../useBreadcrumb-
|
|
3
|
+
import { n as k, t as b } from "../../../../useBreadcrumb-Ds_9BeFz.js";
|
|
4
4
|
import { backButtonVariants as c } from "./BackButton.variants.js";
|
|
5
5
|
import { jsx as e } from "react/jsx-runtime";
|
|
6
6
|
var C = ({ icon: d, onClick: s, to: a, target: m, label: t = "Go back", theme: n, component: f = "a" }) => {
|