@konstructio/ui 0.1.2-alpha.103 → 0.1.2-alpha.105
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/README.md +15 -21
- package/dist/{AdditionalOptions-Cj29eeMF.js → AdditionalOptions-D0BAS2HG.js} +1 -1
- package/dist/{AlertDialogTrigger-CgcsW_ta.js → AlertDialogTrigger-BGo_acd5.js} +3 -3
- package/dist/{Checkbox-DzAx7n67.js → Checkbox-B_ngk9Dj.js} +56 -56
- package/dist/{Combination-cjXRJS03.js → Combination-CnMM05mt.js} +51 -45
- package/dist/{CommandInput-BnvRMfLI.js → CommandInput-BLq69pOT.js} +1 -1
- package/dist/Counter-BV680M5r.js +195 -0
- package/dist/DropdownButton-DfNojmCW.js +493 -0
- package/dist/{FlagSelectorList-BoYG-_It.js → FlagSelectorList-CkTR3j6O.js} +222 -218
- package/dist/{HamburgerTrigger-1vOTrm8-.js → HamburgerTrigger-DRylBL2d.js} +1 -1
- package/dist/{ImageUpload-DZTm4SBB.js → ImageUpload-DiwymQcU.js} +1 -1
- package/dist/{Input-CW0VwW2T.js → Input-Cf44DzfE.js} +18 -18
- package/dist/{Loading-fD0Xiyeq.js → Loading-DUh9PMJN.js} +3 -1
- package/dist/Modal-Dyn088X7.js +81 -0
- package/dist/Sidebar.css +1 -1
- package/dist/{Spinner-Lw9mZYhg.js → Spinner-CUwE2bLm.js} +1 -1
- package/dist/{Switch-WBRr8uOJ.js → Switch-aPhL5rNG.js} +4 -4
- package/dist/{Toast-ByH-l4XK.js → Toast-3NEz7LLa.js} +149 -148
- package/dist/Wrapper-CVJSuYWx.js +114 -0
- package/dist/{Wrapper-XeeD3av7.js → Wrapper-DP6Sxngx.js} +185 -180
- package/dist/Wrapper-R8fik3ah.js +182 -0
- package/dist/components/Alert/Alert.js +21 -21
- 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/AlertDialog/hooks/useAlertDialog.js +14 -10
- package/dist/components/Autocomplete/components/List/List.js +22 -26
- package/dist/components/Autocomplete/components/List/List.variants.js +7 -19
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +39 -38
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -1
- package/dist/components/Badge/Badge.js +37 -36
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +6 -6
- 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 +2 -2
- 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/Command/contexts/Command.provider.js +16 -12
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +57 -58
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +42 -43
- 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 +42 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +61 -79
- 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/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +89 -122
- package/dist/components/Datepicker/DatePicker.js +13 -13
- package/dist/components/Drawer/Drawer.js +54 -49
- package/dist/components/Drawer/hooks/useDrawer.js +39 -44
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +23 -22
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +42 -56
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +30 -43
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +36 -49
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +1 -1
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -18
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +31 -45
- package/dist/components/Filter/contexts/filter.provider.js +15 -10
- package/dist/components/Filter/events/index.js +26 -5
- package/dist/components/Filter/hooks/index.js +4 -0
- package/dist/components/Filter/hooks/useFilterDropdownSync.js +26 -0
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.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/Modal/contexts/Modal.provider.js +26 -19
- 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 +14 -13
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +6 -4
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +16 -16
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PieChart/PieChart.js +33 -32
- package/dist/components/ProgressBar/ProgressBar.js +26 -20
- package/dist/components/Radio/Radio.js +28 -30
- package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +24 -24
- package/dist/components/Range/Range.js +15 -13
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/List/List.js +2 -2
- package/dist/components/Select/components/ListItem/ListItem.js +30 -30
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useSelect.js +28 -39
- package/dist/components/Sidebar/Sidebar.js +21 -18
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +30 -0
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +20 -0
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +14 -10
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +14 -4
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +41 -37
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +4 -5
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +75 -68
- package/dist/components/Sidebar/components/index.js +17 -15
- package/dist/components/Sidebar/contexts/SidebarContext.js +8 -5
- package/dist/components/Slider/Slider.js +17 -15
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.variants.js +6 -6
- package/dist/components/Stepper/hooks/useStepItemLogic.js +12 -17
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.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/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +17 -17
- 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 +12 -11
- package/dist/components/TimePicker/components/HoursList/HoursList.js +34 -38
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +25 -29
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +33 -33
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +91 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +29 -30
- package/dist/components/TimePicker/contexts/time-picker.provider.js +10 -10
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.variants.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +32 -29
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +0 -2
- package/dist/components/VirtualizedTable/components/Body/Body.js +5 -5
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +55 -53
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/events/filters/filters.js +7 -0
- package/dist/components/VirtualizedTable/events/index.js +10 -25
- package/dist/components/VirtualizedTable/events/refresh/refresh.js +7 -0
- package/dist/components/VirtualizedTable/events/row/row.js +22 -0
- package/dist/components/VirtualizedTable/utils/get-table-id.js +4 -0
- package/dist/components/VirtualizedTable/utils/index.js +4 -2
- package/dist/components/index.js +95 -89
- package/dist/{components-BIHlj4yH.js → components-Cf345jTv.js} +45 -41
- package/dist/constants-CxJJRVK3.js +31 -0
- package/dist/{dist-DISvWx7U.js → dist-BUocnzkM.js} +1 -1
- package/dist/{dist-Dse3gSmZ.js → dist-BZNE2Tnx.js} +4 -4
- package/dist/{dist-2bGlmy8N2.js → dist-BaPW7qXd2.js} +27 -26
- package/dist/dist-BdobXn93.js +192 -0
- package/dist/dist-BlPTJNIm.js +118 -0
- package/dist/{dist-BiJrNvNo.js → dist-C3YVLapk.js} +29 -28
- package/dist/dist-C4j75TwZ.js +20 -0
- package/dist/dist-CCdbu9GU.js +46 -0
- package/dist/dist-CzKqHuqJ2.js +427 -0
- package/dist/dist-D-yS0HN8.js +228 -0
- package/dist/dist-D5XYRjmR.js +15 -0
- package/dist/dist-DDck_2lb.js +451 -0
- package/dist/{dist-C2aTw0m62.js → dist-DFCz63oC2.js} +5 -5
- package/dist/dist-DGOjiAnB2.js +14 -0
- package/dist/dist-DKryKPmP.js +193 -0
- package/dist/{dist-CTvBzxW8.js → dist-DX0sBG3Q.js} +1 -1
- package/dist/dist-DYIabsrY.js +17 -0
- package/dist/dist-pWlMx4Fi2.js +36 -0
- package/dist/{dist-CVDFmWf2.js → dist-tGUUcv8n.js} +17 -16
- package/dist/dist-xCbHbMLA.js +116 -0
- package/dist/{es2015-BWf6xQHm.js → es2015-CoHq2g4y.js} +95 -86
- package/dist/es2015-DigR3dar.js +795 -0
- package/dist/events.types-BG1Uh8i6.js +6 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.js +146 -138
- package/dist/lib/components/Autocomplete/components/List/List.variants.d.ts +0 -1
- package/dist/lib/components/DropdownButton/DropdownButton.d.ts +5 -6
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +2 -0
- package/dist/lib/components/Filter/Filter.types.d.ts +2 -0
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
- package/dist/lib/components/Filter/events/index.d.ts +10 -2
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.d.ts +2 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.types.d.ts +5 -0
- package/dist/lib/components/PieChart/PieChart.types.d.ts +4 -4
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +2 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -3
- package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +6 -5
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.d.ts +1 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.types.d.ts +8 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -1
- package/dist/lib/components/Sidebar/components/index.d.ts +2 -0
- package/dist/lib/components/Sidebar/contexts/SidebarContext.d.ts +12 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/events.types.d.ts +11 -0
- package/dist/lib/components/VirtualizedTable/events/filters/filters.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/index.d.ts +4 -14
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.types.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/events/row/row.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/utils/get-table-id.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useClickOutside.d.ts +2 -0
- package/dist/package.json +24 -24
- package/dist/styles.css +1 -1
- package/dist/{table.provider-2sAkE7z_.js → table.provider-B0BafHuU.js} +395 -381
- package/dist/ui/civo-theme.css +4 -0
- package/dist/ui/kubefirst-theme.css +4 -0
- package/package.json +24 -24
- package/dist/Counter-CY0xGnVM.js +0 -208
- package/dist/DropdownButton-DnlwdPmb.js +0 -92
- package/dist/Modal-Bfzggwlr.js +0 -76
- package/dist/Wrapper-ClJ_Mham.js +0 -110
- package/dist/Wrapper-DNEn4fef.js +0 -161
- package/dist/constants-DXrF9vV4.js +0 -31
- package/dist/dist-B-Aoze_D.js +0 -10
- package/dist/dist-BuFiu480.js +0 -13
- package/dist/dist-C2s4VX-42.js +0 -31
- package/dist/dist-CT6d9xe7.js +0 -441
- package/dist/dist-CVy-ulDZ.js +0 -42
- package/dist/dist-D4FePjTS.js +0 -194
- package/dist/dist-Db6UeFo4.js +0 -291
- package/dist/dist-DqKFpce5.js +0 -98
- package/dist/dist-j7FOUrFU.js +0 -206
- package/dist/dist-l-aDnQZC.js +0 -62
- package/dist/dist-ppXKUlVt.js +0 -10
- /package/dist/{x-a_LpoXzG.js → x-a_LpoXzG2.js} +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { o as
|
|
1
|
+
import { o as Ne } from "./rolldown-runtime-Ck3dxwZt.js";
|
|
2
2
|
import { t as X } from "./utils-Cx-WzRZF.js";
|
|
3
|
+
import { useClickOutside as Be } from "./hooks/useClickOutside.js";
|
|
3
4
|
import { Typography as ee } from "./components/Typography/Typography.js";
|
|
4
|
-
import { n as
|
|
5
|
-
import { usePhoneNumberContext as
|
|
6
|
-
import { labelVariants as
|
|
7
|
-
import { getPhoneMask as
|
|
8
|
-
import { FlagContent as
|
|
9
|
-
import { FlagSelectorWrapper as
|
|
10
|
-
import { forwardRef as
|
|
5
|
+
import { n as Re } from "./phone-number.provider-BxQCTxp8.js";
|
|
6
|
+
import { usePhoneNumberContext as Ge } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
7
|
+
import { labelVariants as Le, phoneNumberInputVariants as Ve } from "./components/PhoneNumberInput/PhoneNumberInput.variants.js";
|
|
8
|
+
import { getPhoneMask as xe } from "./components/PhoneNumberInput/utils/index.js";
|
|
9
|
+
import { FlagContent as Ke } from "./components/PhoneNumberInput/components/FlagContent/FlagContent.js";
|
|
10
|
+
import { FlagSelectorWrapper as De } from "./components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js";
|
|
11
|
+
import { forwardRef as Fe, useCallback as pe, useEffect as fe, useId as Ue, useImperativeHandle as _e, useMemo as $e, useRef as te } from "react";
|
|
11
12
|
import { jsx as B, jsxs as Z } from "react/jsx-runtime";
|
|
12
13
|
function de(e, n) {
|
|
13
14
|
(n == null || n > e.length) && (n = e.length);
|
|
14
15
|
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
|
|
15
16
|
return r;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function ze(e, n, t) {
|
|
18
19
|
return n = Y(n), (function(r, o) {
|
|
19
20
|
if (o && (typeof o == "object" || typeof o == "function")) return o;
|
|
20
21
|
if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -22,15 +23,15 @@ function $e(e, n, t) {
|
|
|
22
23
|
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
23
24
|
return a;
|
|
24
25
|
})(r);
|
|
25
|
-
})(e,
|
|
26
|
+
})(e, ke() ? Reflect.construct(n, t || [], Y(e).constructor) : n.apply(e, t));
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function He(e, n) {
|
|
28
29
|
if (!(e instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function We(e, n, t) {
|
|
31
32
|
return Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function Se(e, n) {
|
|
34
35
|
var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
35
36
|
if (!t) {
|
|
36
37
|
if (Array.isArray(e) || (t = (function(i, u) {
|
|
@@ -81,7 +82,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function we(e, n, t) {
|
|
85
86
|
return (n = (function(r) {
|
|
86
87
|
var o = (function(a, l) {
|
|
87
88
|
if (typeof a != "object" || !a) return a;
|
|
@@ -106,7 +107,7 @@ function Y(e) {
|
|
|
106
107
|
return n.__proto__ || Object.getPrototypeOf(n);
|
|
107
108
|
}, Y(e);
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function Ze(e, n) {
|
|
110
111
|
if (typeof n != "function" && n !== null) throw new TypeError("Super expression must either be null or a function");
|
|
111
112
|
e.prototype = Object.create(n && n.prototype, { constructor: {
|
|
112
113
|
value: e,
|
|
@@ -114,17 +115,17 @@ function We(e, n) {
|
|
|
114
115
|
configurable: !0
|
|
115
116
|
} }), Object.defineProperty(e, "prototype", { writable: !1 }), n && re(e, n);
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function ke() {
|
|
118
119
|
try {
|
|
119
120
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {
|
|
120
121
|
})));
|
|
121
122
|
} catch {
|
|
122
123
|
}
|
|
123
|
-
return (
|
|
124
|
+
return (ke = function() {
|
|
124
125
|
return !!e;
|
|
125
126
|
})();
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function me(e, n) {
|
|
128
129
|
var t = Object.keys(e);
|
|
129
130
|
if (Object.getOwnPropertySymbols) {
|
|
130
131
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -137,15 +138,15 @@ function fe(e, n) {
|
|
|
137
138
|
function J(e) {
|
|
138
139
|
for (var n = 1; n < arguments.length; n++) {
|
|
139
140
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
140
|
-
n % 2 ?
|
|
141
|
-
|
|
142
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
141
|
+
n % 2 ? me(Object(t), !0).forEach((function(r) {
|
|
142
|
+
we(e, r, t[r]);
|
|
143
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : me(Object(t)).forEach((function(r) {
|
|
143
144
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
144
145
|
}));
|
|
145
146
|
}
|
|
146
147
|
return e;
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function Je(e, n) {
|
|
149
150
|
if (e == null) return {};
|
|
150
151
|
var t, r, o = (function(l, c) {
|
|
151
152
|
if (l == null) return {};
|
|
@@ -168,39 +169,39 @@ function re(e, n) {
|
|
|
168
169
|
}, re(e, n);
|
|
169
170
|
}
|
|
170
171
|
function U(e, n) {
|
|
171
|
-
var t, r = n.replacementChars, o = n.replacement, a = n.separate, l = r, c = "", i =
|
|
172
|
+
var t, r = n.replacementChars, o = n.replacement, a = n.separate, l = r, c = "", i = Se(e);
|
|
172
173
|
try {
|
|
173
174
|
for (i.s(); !(t = i.n()).done; ) {
|
|
174
|
-
var u, s = t.value,
|
|
175
|
-
(a && s === l[0] ||
|
|
175
|
+
var u, s = t.value, f = !Object.prototype.hasOwnProperty.call(o, s) && ((u = o[l[0]]) === null || u === void 0 ? void 0 : u.test(s));
|
|
176
|
+
(a && s === l[0] || f) && (l = l.slice(1), c += s);
|
|
176
177
|
}
|
|
177
|
-
} catch (
|
|
178
|
-
i.e(
|
|
178
|
+
} catch (O) {
|
|
179
|
+
i.e(O);
|
|
179
180
|
} finally {
|
|
180
181
|
i.f();
|
|
181
182
|
}
|
|
182
183
|
return c;
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
var t, r = n.mask, o = n.replacement, a = n.separate, l = n.showMask, c = 0, i = "", u =
|
|
185
|
+
function Me(e, n) {
|
|
186
|
+
var t, r = n.mask, o = n.replacement, a = n.separate, l = n.showMask, c = 0, i = "", u = Se(r);
|
|
186
187
|
try {
|
|
187
188
|
for (u.s(); !(t = u.n()).done; ) {
|
|
188
189
|
var s = t.value;
|
|
189
190
|
if (!l && e[c] === void 0) break;
|
|
190
191
|
Object.prototype.hasOwnProperty.call(o, s) && e[c] !== void 0 ? i += e[c++] : i += s;
|
|
191
192
|
}
|
|
192
|
-
} catch (
|
|
193
|
-
u.e(
|
|
193
|
+
} catch (O) {
|
|
194
|
+
u.e(O);
|
|
194
195
|
} finally {
|
|
195
196
|
u.f();
|
|
196
197
|
}
|
|
197
198
|
if (a && !l) {
|
|
198
|
-
for (var
|
|
199
|
-
i = i.slice(0,
|
|
199
|
+
for (var f = r.length - 1; f >= 0 && i[f] === r[f]; f--) ;
|
|
200
|
+
i = i.slice(0, f + 1);
|
|
200
201
|
}
|
|
201
202
|
return i;
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function Pe(e, n) {
|
|
204
205
|
for (var t = n.mask, r = n.replacement, o = [], a = 0; a < t.length; a++) {
|
|
205
206
|
var l, c = (l = e[a]) !== null && l !== void 0 ? l : t[a], i = Object.prototype.hasOwnProperty.call(r, c) ? "replacement" : e[a] !== void 0 && e[a] !== t[a] ? "input" : "mask";
|
|
206
207
|
o.push({
|
|
@@ -212,18 +213,18 @@ function Me(e, n) {
|
|
|
212
213
|
return o;
|
|
213
214
|
}
|
|
214
215
|
function K(e) {
|
|
215
|
-
return e.length > 0 ?
|
|
216
|
+
return e.length > 0 ? we({}, e, /./) : {};
|
|
216
217
|
}
|
|
217
218
|
function ae(e, n) {
|
|
218
|
-
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 = "",
|
|
219
|
-
var
|
|
220
|
-
|
|
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 = "", f = 0; f < u.length; f++) {
|
|
220
|
+
var O = Object.prototype.hasOwnProperty.call(l, u[f]);
|
|
221
|
+
O && i[f] !== void 0 && i[f] !== u[f] ? s += i[f] : O && c && (s += u[f]);
|
|
221
222
|
}
|
|
222
223
|
return s;
|
|
223
224
|
}
|
|
224
|
-
function
|
|
225
|
+
function Ee(e, n) {
|
|
225
226
|
var t = n.mask, r = n.replacement, o = typeof r == "string" ? K(r) : r, a = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
226
|
-
return
|
|
227
|
+
return Me(U(e, {
|
|
227
228
|
replacementChars: t.replace(a, ""),
|
|
228
229
|
replacement: o,
|
|
229
230
|
separate: !1
|
|
@@ -234,7 +235,7 @@ function Pe(e, n) {
|
|
|
234
235
|
showMask: !1
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
|
-
function
|
|
238
|
+
function Ye(e, n) {
|
|
238
239
|
var t = n.mask, r = n.replacement, o = typeof r == "string" ? K(r) : r, a = ae(e, {
|
|
239
240
|
mask: t,
|
|
240
241
|
replacement: o,
|
|
@@ -246,9 +247,9 @@ function Je(e, n) {
|
|
|
246
247
|
separate: !1
|
|
247
248
|
});
|
|
248
249
|
}
|
|
249
|
-
function
|
|
250
|
+
function Qe(e, n) {
|
|
250
251
|
var t = n.mask, r = n.replacement, o = typeof r == "string" ? K(r) : r;
|
|
251
|
-
return
|
|
252
|
+
return Pe(Ee(e, {
|
|
252
253
|
mask: t,
|
|
253
254
|
replacement: o
|
|
254
255
|
}), {
|
|
@@ -256,7 +257,7 @@ function Ye(e, n) {
|
|
|
256
257
|
replacement: o
|
|
257
258
|
});
|
|
258
259
|
}
|
|
259
|
-
var
|
|
260
|
+
var qe = [
|
|
260
261
|
"[",
|
|
261
262
|
"]",
|
|
262
263
|
"\\",
|
|
@@ -273,22 +274,22 @@ var Qe = [
|
|
|
273
274
|
"{",
|
|
274
275
|
"}"
|
|
275
276
|
];
|
|
276
|
-
function
|
|
277
|
-
return
|
|
277
|
+
function ve(e) {
|
|
278
|
+
return qe.includes(e) ? "\\".concat(e) : e;
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
+
function Xe(e, n) {
|
|
280
281
|
for (var t = n.mask, r = n.replacement, o = typeof r == "string" ? K(r) : r, a = e === "partial" || e === "partial-inexact", l = e === "full" || e === "partial", c = "", i = 0; i < t.length; i++) {
|
|
281
282
|
var u = t[i];
|
|
282
|
-
i === 0 && (c = "^"), a && (c += "("), c += Object.prototype.hasOwnProperty.call(o, u) ? "".concat(l ? "(?!".concat(
|
|
283
|
+
i === 0 && (c = "^"), a && (c += "("), c += Object.prototype.hasOwnProperty.call(o, u) ? "".concat(l ? "(?!".concat(ve(u), ")") : "", "(").concat(o[u].source, ")") : ve(u), i === t.length - 1 && (a && (c += ")?".repeat(t.length)), c += "$");
|
|
283
284
|
}
|
|
284
285
|
return c;
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
+
function en(e, n) {
|
|
287
288
|
return new Proxy(e, { set: function(t, r, o) {
|
|
288
289
|
return r === "current" && (o !== e.current && (e.current !== null && n.unregister(e.current), o !== null && n.register(o)), t[r] = o, !0);
|
|
289
290
|
} });
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
+
function nn(e, n, t) {
|
|
292
293
|
return n = $(n), (function(r, o) {
|
|
293
294
|
if (o && (typeof o == "object" || typeof o == "function")) return o;
|
|
294
295
|
if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -298,13 +299,13 @@ function en(e, n, t) {
|
|
|
298
299
|
})(r);
|
|
299
300
|
})(e, ie() ? Reflect.construct(n, t || [], $(e).constructor) : n.apply(e, t));
|
|
300
301
|
}
|
|
301
|
-
function
|
|
302
|
+
function Ce(e, n) {
|
|
302
303
|
if (!(e instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function je(e, n, t) {
|
|
305
306
|
return Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
306
307
|
}
|
|
307
|
-
function
|
|
308
|
+
function tn(e, n, t) {
|
|
308
309
|
return (n = (function(r) {
|
|
309
310
|
var o = (function(a, l) {
|
|
310
311
|
if (typeof a != "object" || !a) return a;
|
|
@@ -329,7 +330,7 @@ function $(e) {
|
|
|
329
330
|
return n.__proto__ || Object.getPrototypeOf(n);
|
|
330
331
|
}, $(e);
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
+
function rn(e, n) {
|
|
333
334
|
if (typeof n != "function" && n !== null) throw new TypeError("Super expression must either be null or a function");
|
|
334
335
|
e.prototype = Object.create(n && n.prototype, { constructor: {
|
|
335
336
|
value: e,
|
|
@@ -347,7 +348,7 @@ function ie() {
|
|
|
347
348
|
return !!e;
|
|
348
349
|
})();
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
+
function he(e, n) {
|
|
351
352
|
var t = Object.keys(e);
|
|
352
353
|
if (Object.getOwnPropertySymbols) {
|
|
353
354
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -357,18 +358,18 @@ function ve(e, n) {
|
|
|
357
358
|
}
|
|
358
359
|
return t;
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function ye(e) {
|
|
361
362
|
for (var n = 1; n < arguments.length; n++) {
|
|
362
363
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
363
|
-
n % 2 ?
|
|
364
|
-
|
|
365
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
364
|
+
n % 2 ? he(Object(t), !0).forEach((function(r) {
|
|
365
|
+
tn(e, r, t[r]);
|
|
366
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : he(Object(t)).forEach((function(r) {
|
|
366
367
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
367
368
|
}));
|
|
368
369
|
}
|
|
369
370
|
return e;
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
+
function an(e, n) {
|
|
372
373
|
if (e == null) return {};
|
|
373
374
|
var t, r, o = (function(l, c) {
|
|
374
375
|
if (l == null) return {};
|
|
@@ -425,29 +426,29 @@ function oe(e) {
|
|
|
425
426
|
var _ = (function(e) {
|
|
426
427
|
function n(t) {
|
|
427
428
|
var r;
|
|
428
|
-
return
|
|
429
|
+
return Ce(this, n), (r = nn(this, n, [t])).name = "SyntheticChangeError", r;
|
|
429
430
|
}
|
|
430
|
-
return
|
|
431
|
-
})(oe(Error)),
|
|
431
|
+
return rn(n, e), je(n);
|
|
432
|
+
})(oe(Error)), ge, on = ["options"], be = [
|
|
432
433
|
"text",
|
|
433
434
|
"email",
|
|
434
435
|
"tel",
|
|
435
436
|
"search",
|
|
436
437
|
"url"
|
|
437
|
-
],
|
|
438
|
+
], Te = je((function e(n) {
|
|
438
439
|
var t = n.init, r = n.tracking;
|
|
439
|
-
|
|
440
|
+
Ce(this, e);
|
|
440
441
|
var o = /* @__PURE__ */ new WeakMap();
|
|
441
442
|
this.register = function(a) {
|
|
442
443
|
var l;
|
|
443
|
-
if (
|
|
444
|
-
var c = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = c.initialValue, u = i === void 0 ? "" : i, s = c.controlled,
|
|
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, f = s !== void 0 && s, O = t({
|
|
445
446
|
initialValue: a.value || u,
|
|
446
|
-
controlled:
|
|
447
|
-
}), P =
|
|
447
|
+
controlled: f
|
|
448
|
+
}), P = O.value, j = O.options, y = {
|
|
448
449
|
value: P,
|
|
449
|
-
options:
|
|
450
|
-
fallbackOptions:
|
|
450
|
+
options: j,
|
|
451
|
+
fallbackOptions: j
|
|
451
452
|
}, m = {
|
|
452
453
|
id: -1,
|
|
453
454
|
cachedId: -1
|
|
@@ -455,63 +456,63 @@ var _ = (function(e) {
|
|
|
455
456
|
value: "",
|
|
456
457
|
selectionStart: 0,
|
|
457
458
|
selectionEnd: 0
|
|
458
|
-
},
|
|
459
|
-
Object.defineProperty(a, "value",
|
|
460
|
-
var
|
|
461
|
-
p.value = h,
|
|
459
|
+
}, S = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
|
|
460
|
+
Object.defineProperty(a, "value", ye(ye({}, S), {}, { set: function(h) {
|
|
461
|
+
var d;
|
|
462
|
+
p.value = h, S == null || (d = S.set) === null || d === void 0 || d.call(a, h);
|
|
462
463
|
} })), a.value = P;
|
|
463
|
-
var
|
|
464
|
+
var w = function() {
|
|
464
465
|
var h = function() {
|
|
465
|
-
var
|
|
466
|
-
p.selectionStart = (
|
|
466
|
+
var d, k;
|
|
467
|
+
p.selectionStart = (d = a.selectionStart) !== null && d !== void 0 ? d : 0, p.selectionEnd = (k = a.selectionEnd) !== null && k !== void 0 ? k : 0, m.id = window.setTimeout(h);
|
|
467
468
|
};
|
|
468
469
|
m.id = window.setTimeout(h);
|
|
469
470
|
}, E = function() {
|
|
470
471
|
window.clearTimeout(m.id), m.id = -1, m.cachedId = -1;
|
|
471
472
|
}, v = function(h) {
|
|
472
473
|
try {
|
|
473
|
-
var
|
|
474
|
+
var d, k;
|
|
474
475
|
if (m.cachedId === m.id) throw new _("The input selection has not been updated.");
|
|
475
476
|
m.cachedId = m.id;
|
|
476
|
-
var M = a.value,
|
|
477
|
-
if (
|
|
478
|
-
var
|
|
479
|
-
if (h.inputType === void 0 && (p.selectionStart = 0, p.selectionEnd =
|
|
480
|
-
var T = "",
|
|
481
|
-
if (
|
|
477
|
+
var M = a.value, g = a.selectionStart, A = a.selectionEnd;
|
|
478
|
+
if (g === null || A === null) throw new _("The selection attributes have not been initialized.");
|
|
479
|
+
var C, b = p.value;
|
|
480
|
+
if (h.inputType === void 0 && (p.selectionStart = 0, p.selectionEnd = b.length), g > p.selectionStart ? C = "insert" : g <= p.selectionStart && g < p.selectionEnd ? C = "deleteBackward" : g === p.selectionEnd && M.length < b.length && (C = "deleteForward"), C === void 0 || (C === "deleteBackward" || C === "deleteForward") && M.length > b.length) throw new _("Input type detection error.");
|
|
481
|
+
var T = "", N = p.selectionStart, R = p.selectionEnd;
|
|
482
|
+
if (C === "insert") T = M.slice(p.selectionStart, g);
|
|
482
483
|
else {
|
|
483
|
-
var D =
|
|
484
|
-
|
|
484
|
+
var D = b.length - M.length;
|
|
485
|
+
N = g, R = g + D;
|
|
485
486
|
}
|
|
486
|
-
y.value !==
|
|
487
|
+
y.value !== b ? y.options = y.fallbackOptions : y.fallbackOptions = y.options;
|
|
487
488
|
var F = y.options, G = r({
|
|
488
|
-
inputType:
|
|
489
|
-
previousValue:
|
|
489
|
+
inputType: C,
|
|
490
|
+
previousValue: b,
|
|
490
491
|
previousOptions: F,
|
|
491
492
|
value: M,
|
|
492
493
|
addedValue: T,
|
|
493
|
-
changeStart:
|
|
494
|
+
changeStart: N,
|
|
494
495
|
changeEnd: R,
|
|
495
|
-
selectionStart:
|
|
496
|
-
selectionEnd:
|
|
497
|
-
}), H = G.options,
|
|
498
|
-
a.value =
|
|
496
|
+
selectionStart: g,
|
|
497
|
+
selectionEnd: A
|
|
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, (d = a._valueTracker) === null || d === void 0 || (k = d.setValue) === null || k === void 0 || k.call(d, b);
|
|
499
500
|
} catch (W) {
|
|
500
501
|
if (a.value = p.value, a.setSelectionRange(p.selectionStart, p.selectionEnd), h.preventDefault(), h.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
|
|
501
502
|
}
|
|
502
503
|
};
|
|
503
|
-
document.activeElement === a &&
|
|
504
|
-
onFocus:
|
|
504
|
+
document.activeElement === a && w(), a.addEventListener("focus", w), a.addEventListener("blur", E), a.addEventListener("input", v), o.set(a, {
|
|
505
|
+
onFocus: w,
|
|
505
506
|
onBlur: E,
|
|
506
507
|
onInput: v
|
|
507
508
|
});
|
|
508
|
-
} else process.env.NODE_ENV !== "production" && console.warn("Warn: The input element type does not match one of the types: ".concat(
|
|
509
|
+
} else process.env.NODE_ENV !== "production" && console.warn("Warn: The input element type does not match one of the types: ".concat(be.join(", "), "."));
|
|
509
510
|
}, this.unregister = function(a) {
|
|
510
511
|
var l = o.get(a);
|
|
511
512
|
l !== void 0 && (a.removeEventListener("focus", l.onFocus), a.removeEventListener("blur", l.onBlur), a.removeEventListener("input", l.onInput), o.delete(a));
|
|
512
513
|
};
|
|
513
514
|
}));
|
|
514
|
-
|
|
515
|
+
ge = Te, Object.defineProperty(ge.prototype, Symbol.toStringTag, {
|
|
515
516
|
writable: !1,
|
|
516
517
|
enumerable: !1,
|
|
517
518
|
configurable: !0,
|
|
@@ -525,7 +526,7 @@ var ne = function(e) {
|
|
|
525
526
|
`), `
|
|
526
527
|
`));
|
|
527
528
|
};
|
|
528
|
-
},
|
|
529
|
+
}, Oe, ln = ["track", "modify"];
|
|
529
530
|
function x(e) {
|
|
530
531
|
var n, t, r, o;
|
|
531
532
|
return {
|
|
@@ -537,27 +538,27 @@ function x(e) {
|
|
|
537
538
|
modify: e.modify
|
|
538
539
|
};
|
|
539
540
|
}
|
|
540
|
-
var
|
|
541
|
+
var Ie = (function(e) {
|
|
541
542
|
function n() {
|
|
542
543
|
var t, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
543
|
-
return
|
|
544
|
+
return He(this, n), (t = ze(this, n, [{
|
|
544
545
|
init: function(o) {
|
|
545
|
-
var a = o.initialValue, l = o.controlled, c = x(r), i = c.mask, u = c.replacement, s = c.separate,
|
|
546
|
-
return a = l || a ? a :
|
|
547
|
-
var P =
|
|
548
|
-
P.length >
|
|
546
|
+
var a = o.initialValue, l = o.controlled, c = x(r), i = c.mask, u = c.replacement, s = c.separate, f = c.showMask;
|
|
547
|
+
return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && (function(O) {
|
|
548
|
+
var P = O.initialValue, j = O.mask, y = O.replacement;
|
|
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."));
|
|
549
550
|
var m = Object.keys(y).filter((function(v) {
|
|
550
551
|
return v.length > 1;
|
|
551
552
|
}));
|
|
552
553
|
m.length > 0 && console.error(ne(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(m.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
553
|
-
for (var p =
|
|
554
|
-
var E = Object.prototype.hasOwnProperty.call(y, p[
|
|
555
|
-
if (!(p[
|
|
556
|
-
|
|
554
|
+
for (var p = j.slice(0, P.length), S = -1, w = 0; w < p.length; w++) {
|
|
555
|
+
var E = Object.prototype.hasOwnProperty.call(y, p[w]);
|
|
556
|
+
if (!(p[w] === P[w] || E && y[p[w]].test(P[w]))) {
|
|
557
|
+
S = w;
|
|
557
558
|
break;
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
|
-
|
|
561
|
+
S !== -1 && console.error(ne(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(S, "). 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."));
|
|
561
562
|
})({
|
|
562
563
|
initialValue: a,
|
|
563
564
|
mask: i,
|
|
@@ -572,7 +573,7 @@ var Te = (function(e) {
|
|
|
572
573
|
};
|
|
573
574
|
},
|
|
574
575
|
tracking: function(o) {
|
|
575
|
-
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, f = x(r), O = f.track, P = f.modify, j = Je(f, ln), y = j.mask, m = j.replacement, p = j.showMask, S = j.separate, w = J(J({}, a === "insert" ? {
|
|
576
577
|
inputType: a,
|
|
577
578
|
data: i
|
|
578
579
|
} : {
|
|
@@ -582,43 +583,43 @@ var Te = (function(e) {
|
|
|
582
583
|
value: l,
|
|
583
584
|
selectionStart: u,
|
|
584
585
|
selectionEnd: s
|
|
585
|
-
}), E =
|
|
586
|
+
}), E = O?.(w);
|
|
586
587
|
if (E === !1) throw new _("Custom tracking stop.");
|
|
587
588
|
E === null ? i = "" : E !== !0 && E !== void 0 && (i = E);
|
|
588
|
-
var v = P?.(
|
|
589
|
-
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 && (
|
|
590
|
-
var h = ae(l, J({ end: u }, c)),
|
|
589
|
+
var v = P?.(w);
|
|
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)), d = ae(l, J({ start: s }, c)), k = RegExp("[^".concat(Object.keys(m).join(""), "]"), "g"), M = y.replace(k, "");
|
|
591
592
|
if (h && (h = U(h, {
|
|
592
593
|
replacementChars: M,
|
|
593
594
|
replacement: m,
|
|
594
|
-
separate:
|
|
595
|
+
separate: S
|
|
595
596
|
}), M = M.slice(h.length)), i && (i = U(i, {
|
|
596
597
|
replacementChars: M,
|
|
597
598
|
replacement: m,
|
|
598
599
|
separate: !1
|
|
599
600
|
}), M = M.slice(i.length)), a === "insert" && i === "") throw new _("The character does not match the key value of the `replacement` object.");
|
|
600
|
-
if (
|
|
601
|
-
var
|
|
602
|
-
|
|
601
|
+
if (S) {
|
|
602
|
+
var g = y.slice(u, s).replace(k, ""), A = g.length - i.length;
|
|
603
|
+
A < 0 ? d = d.slice(-A) : A > 0 && (d = g.slice(-A) + d);
|
|
603
604
|
}
|
|
604
|
-
|
|
605
|
+
d && (d = U(d, {
|
|
605
606
|
replacementChars: M,
|
|
606
607
|
replacement: m,
|
|
607
|
-
separate:
|
|
608
|
+
separate: S
|
|
608
609
|
}));
|
|
609
|
-
var
|
|
610
|
+
var C = Me(h + i + d, {
|
|
610
611
|
mask: y,
|
|
611
612
|
replacement: m,
|
|
612
|
-
separate:
|
|
613
|
+
separate: S,
|
|
613
614
|
showMask: p
|
|
614
|
-
}),
|
|
615
|
-
var
|
|
615
|
+
}), b = (function(T) {
|
|
616
|
+
var N, R, D, F = T.inputType, G = T.value, H = T.addedValue, I = T.beforeChangeValue, W = T.mask, le = T.replacement, Ae = T.separate, Q = Pe(G, {
|
|
616
617
|
mask: W,
|
|
617
618
|
replacement: le
|
|
618
619
|
}).filter((function(q) {
|
|
619
620
|
var se = q.type;
|
|
620
|
-
return se === "input" ||
|
|
621
|
-
})), ce = (
|
|
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 = (R = Q[I.length - 1]) === null || R === void 0 ? void 0 : R.index, V = (D = Q[I.length + H.length]) === null || D === void 0 ? void 0 : D.index;
|
|
622
623
|
if (F === "insert") {
|
|
623
624
|
if (ce !== void 0) return ce + 1;
|
|
624
625
|
if (V !== void 0) return V;
|
|
@@ -638,43 +639,43 @@ var Te = (function(e) {
|
|
|
638
639
|
return ue !== -1 ? ue : G.length;
|
|
639
640
|
})({
|
|
640
641
|
inputType: a,
|
|
641
|
-
value:
|
|
642
|
+
value: C,
|
|
642
643
|
addedValue: i,
|
|
643
644
|
beforeChangeValue: h,
|
|
644
645
|
mask: y,
|
|
645
646
|
replacement: m,
|
|
646
|
-
separate:
|
|
647
|
+
separate: S
|
|
647
648
|
});
|
|
648
649
|
return {
|
|
649
|
-
value:
|
|
650
|
-
selectionStart:
|
|
651
|
-
selectionEnd:
|
|
650
|
+
value: C,
|
|
651
|
+
selectionStart: b,
|
|
652
|
+
selectionEnd: b,
|
|
652
653
|
options: {
|
|
653
654
|
mask: y,
|
|
654
655
|
replacement: m,
|
|
655
|
-
separate:
|
|
656
|
+
separate: S
|
|
656
657
|
}
|
|
657
658
|
};
|
|
658
659
|
}
|
|
659
660
|
}])).format = function(o) {
|
|
660
|
-
return
|
|
661
|
+
return Ee(o, x(r));
|
|
661
662
|
}, t.formatToParts = function(o) {
|
|
662
|
-
return
|
|
663
|
+
return Qe(o, x(r));
|
|
663
664
|
}, t.unformat = function(o) {
|
|
664
|
-
return
|
|
665
|
+
return Ye(o, x(r));
|
|
665
666
|
}, t.generatePattern = function(o) {
|
|
666
|
-
return
|
|
667
|
+
return Xe(o, x(r));
|
|
667
668
|
}, t;
|
|
668
669
|
}
|
|
669
|
-
return
|
|
670
|
+
return Ze(n, Te), We(n);
|
|
670
671
|
})();
|
|
671
|
-
|
|
672
|
+
Oe = Ie, Object.defineProperty(Oe.prototype, Symbol.toStringTag, {
|
|
672
673
|
writable: !1,
|
|
673
674
|
enumerable: !1,
|
|
674
675
|
configurable: !0,
|
|
675
676
|
value: "Mask"
|
|
676
677
|
});
|
|
677
|
-
function
|
|
678
|
+
function cn() {
|
|
678
679
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.mask, t = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, c = te(null), i = te({
|
|
679
680
|
mask: n,
|
|
680
681
|
replacement: t,
|
|
@@ -683,12 +684,12 @@ function ln() {
|
|
|
683
684
|
track: a,
|
|
684
685
|
modify: l
|
|
685
686
|
});
|
|
686
|
-
return i.current.mask = n, i.current.replacement = t, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l,
|
|
687
|
-
return
|
|
687
|
+
return i.current.mask = n, i.current.replacement = t, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l, $e((function() {
|
|
688
|
+
return en(c, new Ie(i.current));
|
|
688
689
|
}), []);
|
|
689
690
|
}
|
|
690
|
-
var
|
|
691
|
-
var
|
|
691
|
+
var un = /* @__PURE__ */ Ne(Re(), 1);
|
|
692
|
+
var sn = {
|
|
692
693
|
AF: "Afghanistan",
|
|
693
694
|
AL: "Albania",
|
|
694
695
|
DZ: "Algeria",
|
|
@@ -966,42 +967,46 @@ var un = {
|
|
|
966
967
|
SX: "Sint Maarten (Dutch part)",
|
|
967
968
|
SS: "South Sudan",
|
|
968
969
|
XK: "Kosovo"
|
|
969
|
-
},
|
|
970
|
+
}, pn = {
|
|
970
971
|
locale: "en",
|
|
971
|
-
countries:
|
|
972
|
+
countries: sn
|
|
972
973
|
};
|
|
973
|
-
|
|
974
|
-
var
|
|
975
|
-
const p =
|
|
976
|
-
mask:
|
|
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: f = !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: d, handleOpenSelector: k } = Ge(), M = typeof n == "string" && n.length >= 0, g = cn({
|
|
977
|
+
mask: xe(h),
|
|
977
978
|
replacement: { _: /\d/ }
|
|
978
979
|
});
|
|
979
|
-
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
980
|
+
_e(m, () => g.current, [g]);
|
|
981
|
+
const A = (b) => {
|
|
982
|
+
b.target.value.startsWith(h.prefix) ? d(b.target.value) : d(`${h.prefix} `);
|
|
983
|
+
};
|
|
984
|
+
Be(w, pe(() => {
|
|
985
|
+
k(!1);
|
|
986
|
+
}, [k])), fe(() => {
|
|
987
|
+
const b = new AbortController(), T = (N) => {
|
|
988
|
+
N.key === "Escape" && k(!1);
|
|
988
989
|
};
|
|
989
|
-
return document.addEventListener("keydown",
|
|
990
|
+
return document.addEventListener("keydown", T, { signal: b.signal }), document.addEventListener("visibilitychange", () => {
|
|
990
991
|
document.hidden && k(!1);
|
|
991
|
-
}, { signal:
|
|
992
|
-
|
|
992
|
+
}, { signal: b.signal }), () => {
|
|
993
|
+
b.abort();
|
|
993
994
|
};
|
|
994
|
-
}, [k
|
|
995
|
-
|
|
996
|
-
}, [h.code])
|
|
995
|
+
}, [k]), fe(() => {
|
|
996
|
+
g.current && (g.current.value = h.prefix + " ");
|
|
997
|
+
}, [h.code]);
|
|
998
|
+
const C = pe((b) => {
|
|
999
|
+
b === null && g.current?.blur(), g.current = b;
|
|
1000
|
+
}, [g]);
|
|
1001
|
+
return /* @__PURE__ */ Z("div", {
|
|
997
1002
|
className: "w-full flex flex-col gap-2",
|
|
998
1003
|
children: [
|
|
999
1004
|
a ? /* @__PURE__ */ B("div", {
|
|
1000
1005
|
className: X(c),
|
|
1001
1006
|
children: /* @__PURE__ */ Z("label", {
|
|
1002
|
-
|
|
1003
|
-
className:
|
|
1004
|
-
onClick: () => !e &&
|
|
1007
|
+
htmlFor: S,
|
|
1008
|
+
className: Le({ className: l }),
|
|
1009
|
+
onClick: () => !e && g.current?.focus(),
|
|
1005
1010
|
children: [a, o && /* @__PURE__ */ B(ee, {
|
|
1006
1011
|
component: "span",
|
|
1007
1012
|
className: "text-red-600 dark:text-red-500 ml-1",
|
|
@@ -1010,33 +1015,33 @@ var wn = Ke(({ disabled: e = !1, error: n, helperText: t, helperTextClassName: r
|
|
|
1010
1015
|
})
|
|
1011
1016
|
}) : null,
|
|
1012
1017
|
/* @__PURE__ */ Z("div", {
|
|
1013
|
-
ref:
|
|
1018
|
+
ref: w,
|
|
1014
1019
|
"data-state": E ? "open" : "closed",
|
|
1015
|
-
className:
|
|
1020
|
+
className: Ve({
|
|
1016
1021
|
className: P,
|
|
1017
1022
|
variant: M ? "error" : "default"
|
|
1018
1023
|
}),
|
|
1019
1024
|
children: [/* @__PURE__ */ Z("div", {
|
|
1020
1025
|
className: "p-2 flex items-center gap-2.5",
|
|
1021
|
-
children: [/* @__PURE__ */ B(
|
|
1022
|
-
id: a ?
|
|
1023
|
-
ref:
|
|
1026
|
+
children: [/* @__PURE__ */ B(Ke, {}), /* @__PURE__ */ B("input", {
|
|
1027
|
+
id: a ? S : void 0,
|
|
1028
|
+
ref: C,
|
|
1024
1029
|
name: i,
|
|
1025
1030
|
autoComplete: "off",
|
|
1026
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"),
|
|
1027
1032
|
type: "tel",
|
|
1028
1033
|
inputMode: "tel",
|
|
1029
1034
|
value: v,
|
|
1030
|
-
onChange:
|
|
1035
|
+
onChange: A,
|
|
1031
1036
|
disabled: e,
|
|
1032
1037
|
...y
|
|
1033
1038
|
})]
|
|
1034
|
-
}), E && /* @__PURE__ */ B(
|
|
1039
|
+
}), E && /* @__PURE__ */ B(De, {
|
|
1035
1040
|
placeholder: u,
|
|
1036
1041
|
showFlagOnSearch: s,
|
|
1037
|
-
showInputFilter:
|
|
1038
|
-
showNameOnSearch:
|
|
1039
|
-
showPlaceHolder:
|
|
1042
|
+
showInputFilter: f,
|
|
1043
|
+
showNameOnSearch: O,
|
|
1044
|
+
showPlaceHolder: j
|
|
1040
1045
|
})]
|
|
1041
1046
|
}),
|
|
1042
1047
|
n ? /* @__PURE__ */ B(ee, {
|
|
@@ -1053,5 +1058,5 @@ var wn = Ke(({ disabled: e = !1, error: n, helperText: t, helperTextClassName: r
|
|
|
1053
1058
|
});
|
|
1054
1059
|
});
|
|
1055
1060
|
export {
|
|
1056
|
-
|
|
1061
|
+
Mn as t
|
|
1057
1062
|
};
|