@konstructio/ui 0.1.2-alpha.103 → 0.1.2-alpha.104
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-BhqUVI1G.js +171 -0
- package/dist/Wrapper-CVJSuYWx.js +114 -0
- package/dist/{Wrapper-XeeD3av7.js → Wrapper-DP6Sxngx.js} +185 -180
- 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 +39 -38
- 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 -1
- 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,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { Typography as
|
|
1
|
+
import { t as N } from "./utils-Cx-WzRZF.js";
|
|
2
|
+
import { Typography as W } from "./components/Typography/Typography.js";
|
|
3
3
|
import { usePhoneNumberContext as K } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
4
4
|
import { TruncateText as $ } from "./components/PhoneNumberInput/components/TruncateText/TruncateText.js";
|
|
5
5
|
import * as M from "react";
|
|
@@ -10,23 +10,23 @@ function G(l, t, e) {
|
|
|
10
10
|
const s = new Array(l);
|
|
11
11
|
return new Proxy(s, { get(i, n, o) {
|
|
12
12
|
if (typeof n == "string") {
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
if (Number.isInteger(
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
index:
|
|
22
|
-
key: e(
|
|
23
|
-
start:
|
|
24
|
-
size: t[
|
|
25
|
-
end:
|
|
13
|
+
const h = n.charCodeAt(0);
|
|
14
|
+
if (h >= 48 && h <= 57) {
|
|
15
|
+
const a = +n;
|
|
16
|
+
if (Number.isInteger(a) && a >= 0 && a < l) {
|
|
17
|
+
let d = i[a];
|
|
18
|
+
if (!d) {
|
|
19
|
+
const c = t[a * 2];
|
|
20
|
+
d = i[a] = {
|
|
21
|
+
index: a,
|
|
22
|
+
key: e(a),
|
|
23
|
+
start: c,
|
|
24
|
+
size: t[a * 2 + 1],
|
|
25
|
+
end: c + t[a * 2 + 1],
|
|
26
26
|
lane: 0
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return d;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
if (n === "length") return l;
|
|
@@ -37,31 +37,31 @@ function G(l, t, e) {
|
|
|
37
37
|
function I(l, t, e) {
|
|
38
38
|
let s = e.initialDeps ?? [], i, n = !0;
|
|
39
39
|
function o() {
|
|
40
|
-
var
|
|
41
|
-
const
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
if (!(
|
|
46
|
-
s =
|
|
47
|
-
let
|
|
48
|
-
if (
|
|
49
|
-
const f = Math.round((Date.now() -
|
|
50
|
-
for (
|
|
51
|
-
return
|
|
40
|
+
var h;
|
|
41
|
+
const a = process.env.NODE_ENV !== "production" && !!e.key && !!((h = e.debug) != null && h.call(e));
|
|
42
|
+
let d = 0;
|
|
43
|
+
a && (d = Date.now());
|
|
44
|
+
const c = l();
|
|
45
|
+
if (!(c.length !== s.length || c.some((f, m) => s[m] !== f))) return i;
|
|
46
|
+
s = c;
|
|
47
|
+
let r = 0;
|
|
48
|
+
if (a && (r = Date.now()), i = t(...c), a) {
|
|
49
|
+
const f = Math.round((Date.now() - d) * 100) / 100, m = Math.round((Date.now() - r) * 100) / 100, S = m / 16, p = (u, g) => {
|
|
50
|
+
for (u = String(u); u.length < g; ) u = " " + u;
|
|
51
|
+
return u;
|
|
52
52
|
};
|
|
53
|
-
console.info(`%c⏱ ${
|
|
53
|
+
console.info(`%c⏱ ${p(m, 5)} /${p(f, 5)} ms`, `
|
|
54
54
|
font-size: .6rem;
|
|
55
55
|
font-weight: bold;
|
|
56
|
-
color: hsl(${Math.max(0, Math.min(120 - 120 *
|
|
56
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * S, 120))}deg 100% 31%);`, e?.key);
|
|
57
57
|
}
|
|
58
58
|
return e?.onChange && !(n && e.skipInitialOnChange) && e.onChange(i), n = !1, i;
|
|
59
59
|
}
|
|
60
|
-
return o.updateDeps = (
|
|
61
|
-
s =
|
|
60
|
+
return o.updateDeps = (h) => {
|
|
61
|
+
s = h;
|
|
62
62
|
}, o;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function L(l, t) {
|
|
65
65
|
if (l === void 0) throw new Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
66
66
|
return l;
|
|
67
67
|
}
|
|
@@ -76,7 +76,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
76
76
|
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return T = !0;
|
|
77
77
|
const l = navigator.maxTouchPoints;
|
|
78
78
|
return T = navigator.platform === "MacIntel" && l !== void 0 && l > 0;
|
|
79
|
-
},
|
|
79
|
+
}, V = (l) => {
|
|
80
80
|
const { offsetWidth: t, offsetHeight: e } = l;
|
|
81
81
|
return {
|
|
82
82
|
width: t,
|
|
@@ -92,30 +92,30 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
92
92
|
const s = l.targetWindow;
|
|
93
93
|
if (!s) return;
|
|
94
94
|
const i = (o) => {
|
|
95
|
-
const { width:
|
|
95
|
+
const { width: h, height: a } = o;
|
|
96
96
|
t({
|
|
97
|
-
width: Math.round(
|
|
98
|
-
height: Math.round(
|
|
97
|
+
width: Math.round(h),
|
|
98
|
+
height: Math.round(a)
|
|
99
99
|
});
|
|
100
100
|
};
|
|
101
|
-
if (i(
|
|
101
|
+
if (i(V(e)), !s.ResizeObserver) return () => {
|
|
102
102
|
};
|
|
103
103
|
const n = new s.ResizeObserver((o) => {
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
104
|
+
const h = () => {
|
|
105
|
+
const a = o[0];
|
|
106
|
+
if (a?.borderBoxSize) {
|
|
107
|
+
const d = a.borderBoxSize[0];
|
|
108
|
+
if (d) {
|
|
109
109
|
i({
|
|
110
|
-
width:
|
|
111
|
-
height:
|
|
110
|
+
width: d.inlineSize,
|
|
111
|
+
height: d.blockSize
|
|
112
112
|
});
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
i(
|
|
116
|
+
i(V(e));
|
|
117
117
|
};
|
|
118
|
-
l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(
|
|
118
|
+
l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(h) : h();
|
|
119
119
|
});
|
|
120
120
|
return n.observe(e, { box: "border-box" }), () => {
|
|
121
121
|
n.unobserve(e);
|
|
@@ -127,11 +127,11 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
127
127
|
if (!i) return;
|
|
128
128
|
const n = l.options.useScrollendEvent && et;
|
|
129
129
|
let o = 0;
|
|
130
|
-
const
|
|
131
|
-
o = e(s),
|
|
132
|
-
},
|
|
133
|
-
return s.addEventListener("scroll",
|
|
134
|
-
s.removeEventListener("scroll",
|
|
130
|
+
const h = n ? null : X(i, () => t(o, !1), l.options.isScrollingResetDelay), a = (r) => () => {
|
|
131
|
+
o = e(s), h?.(), t(o, r);
|
|
132
|
+
}, d = a(!0), c = a(!1);
|
|
133
|
+
return s.addEventListener("scroll", d, C), n && s.addEventListener("scrollend", c, C), () => {
|
|
134
|
+
s.removeEventListener("scroll", d), n && s.removeEventListener("scrollend", c);
|
|
135
135
|
};
|
|
136
136
|
}, it = (l, t) => st(l, t, (e) => {
|
|
137
137
|
const { horizontal: s, isRtl: i } = l.options;
|
|
@@ -166,16 +166,16 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
166
166
|
const e = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
|
|
167
167
|
s.forEach((i) => {
|
|
168
168
|
const n = () => {
|
|
169
|
-
const o = i.target,
|
|
169
|
+
const o = i.target, h = this.indexFromElement(o);
|
|
170
170
|
if (!o.isConnected) {
|
|
171
171
|
this.observer.unobserve(o);
|
|
172
|
-
for (const [
|
|
173
|
-
this.elementsCache.delete(
|
|
172
|
+
for (const [a, d] of this.elementsCache) if (d === o) {
|
|
173
|
+
this.elementsCache.delete(a);
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
this.shouldMeasureDuringScroll(
|
|
178
|
+
this.shouldMeasureDuringScroll(h) && this.resizeItem(h, this.options.measureElement(o, i, this));
|
|
179
179
|
};
|
|
180
180
|
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
|
|
181
181
|
});
|
|
@@ -230,41 +230,41 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
230
230
|
laneAssignmentMode: "estimate",
|
|
231
231
|
useCachedMeasurements: !1
|
|
232
232
|
};
|
|
233
|
-
for (const
|
|
234
|
-
const f = t[
|
|
235
|
-
f !== void 0 && (i[
|
|
233
|
+
for (const r in t) {
|
|
234
|
+
const f = t[r];
|
|
235
|
+
f !== void 0 && (i[r] = f);
|
|
236
236
|
}
|
|
237
237
|
const n = this.options;
|
|
238
|
-
let o = null,
|
|
238
|
+
let o = null, h = null, a = !1;
|
|
239
239
|
if (n !== void 0 && n.enabled && i.enabled && i.anchorTo === "end" && this.scrollElement !== null) {
|
|
240
|
-
const
|
|
241
|
-
if (f !==
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
|
|
240
|
+
const r = n.count, f = i.count, m = this.getMeasurements(), S = r > 0 ? ((e = m[0]) == null ? void 0 : e.key) ?? n.getItemKey(0) : null, p = r > 0 ? ((s = m[r - 1]) == null ? void 0 : s.key) ?? n.getItemKey(r - 1) : null;
|
|
241
|
+
if (f !== r || r > 0 && f > 0 && (i.getItemKey(0) !== S || i.getItemKey(f - 1) !== p)) {
|
|
242
|
+
a = !0;
|
|
243
|
+
const u = r > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? m[0] : null;
|
|
244
|
+
u && (o = [u.key, this.getScrollOffset() - u.start]);
|
|
245
|
+
const g = i.followOnAppend === !0 ? "auto" : i.followOnAppend || null;
|
|
246
|
+
g && f > r && this.isAtEnd(n.scrollEndThreshold) && (r === 0 || i.getItemKey(f - 1) !== p) && (h = g);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
this.options = i,
|
|
250
|
-
let
|
|
249
|
+
this.options = i, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
|
|
250
|
+
let d = !1, c = 0;
|
|
251
251
|
if (o && this.scrollOffset !== null) {
|
|
252
|
-
const [
|
|
253
|
-
let
|
|
254
|
-
for (;
|
|
255
|
-
if (
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
const E = Math.max(0,
|
|
259
|
-
E !== this.scrollOffset && (
|
|
252
|
+
const [r, f] = o, m = this.getMeasurements(), { count: S, getItemKey: p } = this.options;
|
|
253
|
+
let u = 0;
|
|
254
|
+
for (; u < S && p(u) !== r; ) u++;
|
|
255
|
+
if (u < S) {
|
|
256
|
+
const g = m[u];
|
|
257
|
+
if (g) {
|
|
258
|
+
const E = Math.max(0, g.start + f);
|
|
259
|
+
E !== this.scrollOffset && (c = E - this.scrollOffset, this.scrollOffset = E, d = !0);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
(d || h) && (this.pendingScrollAnchor = [
|
|
264
|
+
d ? o[0] : null,
|
|
265
|
+
d ? o[1] : 0,
|
|
266
|
+
h,
|
|
267
|
+
c
|
|
268
268
|
]);
|
|
269
269
|
}, this.notify = (t) => {
|
|
270
270
|
var e, s;
|
|
@@ -323,8 +323,8 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
323
323
|
}
|
|
324
324
|
const s = this.pendingScrollAnchor;
|
|
325
325
|
if (this.pendingScrollAnchor = null, s && this.scrollElement && this.options.enabled) {
|
|
326
|
-
const [i, n, o,
|
|
327
|
-
i !== null && !o && (D() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ?
|
|
326
|
+
const [i, n, o, h] = s;
|
|
327
|
+
i !== null && !o && (D() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? h !== 0 && (this._iosDeferredAdjustment += h) : this._scrollToOffset(this.getScrollOffset(), {
|
|
328
328
|
adjustments: void 0,
|
|
329
329
|
behavior: void 0
|
|
330
330
|
})), o && this.scrollToEnd({ behavior: o });
|
|
@@ -351,77 +351,77 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
351
351
|
this.options.lanes,
|
|
352
352
|
this.options.laneAssignmentMode,
|
|
353
353
|
this.options.gap
|
|
354
|
-
], (t, e, s, i, n, o,
|
|
354
|
+
], (t, e, s, i, n, o, h, a) => (this.prevLanes !== void 0 && this.prevLanes !== o && (this.lanesChangedFlag = !0), this.prevLanes = o, this.pendingMin = null, {
|
|
355
355
|
count: t,
|
|
356
356
|
paddingStart: e,
|
|
357
357
|
scrollMargin: s,
|
|
358
358
|
getItemKey: i,
|
|
359
359
|
enabled: n,
|
|
360
360
|
lanes: o,
|
|
361
|
-
laneAssignmentMode:
|
|
362
|
-
gap:
|
|
363
|
-
}), { key: !1 }), this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode:
|
|
364
|
-
const
|
|
361
|
+
laneAssignmentMode: h,
|
|
362
|
+
gap: a
|
|
363
|
+
}), { key: !1 }), this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode: h, gap: a }, d) => {
|
|
364
|
+
const c = this.itemSizeCache;
|
|
365
365
|
if (!n)
|
|
366
366
|
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
367
367
|
if (this.laneAssignments.size > t)
|
|
368
|
-
for (const
|
|
369
|
-
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
|
370
|
-
this.itemSizeCache.set(
|
|
368
|
+
for (const u of this.laneAssignments.keys()) u >= t && this.laneAssignments.delete(u);
|
|
369
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
|
|
370
|
+
this.itemSizeCache.set(u.key, u.size);
|
|
371
371
|
}));
|
|
372
|
-
const
|
|
372
|
+
const r = this.lanesSettling ? 0 : this.pendingMin ?? 0;
|
|
373
373
|
if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1), o === 1) {
|
|
374
|
-
const
|
|
375
|
-
let
|
|
376
|
-
if (!
|
|
377
|
-
const b = new Float64Array(
|
|
378
|
-
|
|
374
|
+
const u = t * 2;
|
|
375
|
+
let g = this._flatMeasurements;
|
|
376
|
+
if (!g || g.length < u) {
|
|
377
|
+
const b = new Float64Array(u);
|
|
378
|
+
g && r > 0 && b.set(g.subarray(0, r * 2)), g = b, this._flatMeasurements = g;
|
|
379
379
|
}
|
|
380
380
|
let E;
|
|
381
|
-
if (
|
|
381
|
+
if (r === 0) E = e + s;
|
|
382
382
|
else {
|
|
383
|
-
const b =
|
|
384
|
-
E =
|
|
383
|
+
const b = r - 1;
|
|
384
|
+
E = g[b * 2] + g[b * 2 + 1] + a;
|
|
385
385
|
}
|
|
386
|
-
for (let b =
|
|
387
|
-
const A = i(b),
|
|
388
|
-
|
|
386
|
+
for (let b = r; b < t; b++) {
|
|
387
|
+
const A = i(b), z = c.get(A), w = typeof z == "number" ? z : this.options.estimateSize(b);
|
|
388
|
+
g[b * 2] = E, g[b * 2 + 1] = w, E += w + a;
|
|
389
389
|
}
|
|
390
|
-
const
|
|
391
|
-
return this.measurementsCache =
|
|
390
|
+
const v = G(t, g, i);
|
|
391
|
+
return this.measurementsCache = v, v;
|
|
392
392
|
}
|
|
393
|
-
const f = this.measurementsCache.slice(0,
|
|
394
|
-
let
|
|
395
|
-
for (let
|
|
396
|
-
const
|
|
397
|
-
|
|
393
|
+
const f = this.measurementsCache.slice(0, r), m = new Array(o).fill(void 0), S = new Float64Array(o);
|
|
394
|
+
let p = 0;
|
|
395
|
+
for (let u = 0; u < r; u++) {
|
|
396
|
+
const g = f[u];
|
|
397
|
+
g && (m[g.lane] === void 0 && p++, m[g.lane] = u, S[g.lane] = g.end);
|
|
398
398
|
}
|
|
399
|
-
for (let
|
|
400
|
-
const
|
|
401
|
-
let
|
|
402
|
-
const A =
|
|
399
|
+
for (let u = r; u < t; u++) {
|
|
400
|
+
const g = i(u), E = this.laneAssignments.get(u);
|
|
401
|
+
let v, b;
|
|
402
|
+
const A = h === "estimate" || c.has(g);
|
|
403
403
|
if (E !== void 0 && this.options.lanes > 1) {
|
|
404
|
-
|
|
405
|
-
const _ =
|
|
406
|
-
b = y ? y.end +
|
|
407
|
-
} else if (
|
|
408
|
-
let _ = 0, y =
|
|
404
|
+
v = E;
|
|
405
|
+
const _ = m[v], y = _ !== void 0 ? f[_] : void 0;
|
|
406
|
+
b = y ? y.end + a : e + s;
|
|
407
|
+
} else if (p === o) {
|
|
408
|
+
let _ = 0, y = S[0], j = m[0];
|
|
409
409
|
for (let O = 1; O < o; O++) {
|
|
410
|
-
const R =
|
|
411
|
-
(R < y || R === y &&
|
|
410
|
+
const R = S[O];
|
|
411
|
+
(R < y || R === y && m[O] < j) && (_ = O, y = R, j = m[O]);
|
|
412
412
|
}
|
|
413
|
-
|
|
413
|
+
v = _, b = y + a, A && this.laneAssignments.set(u, v);
|
|
414
414
|
} else
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
f[
|
|
418
|
-
index:
|
|
415
|
+
v = u % this.options.lanes, b = e + s, A && this.laneAssignments.set(u, v);
|
|
416
|
+
const z = c.get(g), w = typeof z == "number" ? z : this.options.estimateSize(u), k = b + w;
|
|
417
|
+
f[u] = {
|
|
418
|
+
index: u,
|
|
419
419
|
start: b,
|
|
420
|
-
size:
|
|
420
|
+
size: w,
|
|
421
421
|
end: k,
|
|
422
|
-
key:
|
|
423
|
-
lane:
|
|
424
|
-
},
|
|
422
|
+
key: g,
|
|
423
|
+
lane: v
|
|
424
|
+
}, m[v] === void 0 && p++, m[v] = u, S[v] = k;
|
|
425
425
|
}
|
|
426
426
|
return this.measurementsCache = f, f;
|
|
427
427
|
}, {
|
|
@@ -481,26 +481,26 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
481
481
|
}, this.resizeItem = (t, e) => {
|
|
482
482
|
var s, i;
|
|
483
483
|
if (t < 0 || t >= this.options.count) return;
|
|
484
|
-
let n, o,
|
|
485
|
-
const
|
|
486
|
-
if (this.options.lanes === 1 &&
|
|
487
|
-
|
|
484
|
+
let n, o, h;
|
|
485
|
+
const a = this._flatMeasurements;
|
|
486
|
+
if (this.options.lanes === 1 && a !== null)
|
|
487
|
+
h = this.options.getItemKey(t), o = a[t * 2], n = a[t * 2 + 1];
|
|
488
488
|
else {
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
491
|
-
|
|
489
|
+
const r = this.measurementsCache[t];
|
|
490
|
+
if (!r) return;
|
|
491
|
+
h = r.key, o = r.start, n = r.size;
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
const
|
|
493
|
+
const d = this.itemSizeCache.get(h) ?? n, c = e - d;
|
|
494
|
+
if (c !== 0) {
|
|
495
|
+
const r = this.options.anchorTo === "end" && ((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, f = r ? this.getTotalSize() : 0, m = this.getScrollOffset() + this.scrollAdjustments, S = this.itemSizeCache.has(h) ? o + d <= m && this.scrollDirection !== "backward" : o < m, p = ((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t] ?? {
|
|
496
496
|
index: t,
|
|
497
|
-
key:
|
|
497
|
+
key: h,
|
|
498
498
|
start: o,
|
|
499
499
|
size: n,
|
|
500
500
|
end: o + n,
|
|
501
501
|
lane: 0
|
|
502
|
-
},
|
|
503
|
-
(this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(
|
|
502
|
+
}, c, this) : S);
|
|
503
|
+
(this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(h, e), this.itemSizeCacheVersion++, r ? this.applyScrollAdjustment(this.getTotalSize() - f) : p && this.applyScrollAdjustment(c), this.notify(!1);
|
|
504
504
|
}
|
|
505
505
|
}, this.getVirtualItems = I(() => [this.getVirtualIndexes(), this.getMeasurements()], (t, e) => {
|
|
506
506
|
const s = [];
|
|
@@ -516,7 +516,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
516
516
|
const e = this.getMeasurements();
|
|
517
517
|
if (e.length === 0) return;
|
|
518
518
|
const s = this._flatMeasurements, i = this.options.lanes === 1 && s != null;
|
|
519
|
-
return
|
|
519
|
+
return L(e[P(0, e.length - 1, i ? (n) => s[n * 2] : (n) => L(e[n]).start, t)]);
|
|
520
520
|
}, this.getMaxScrollOffset = () => {
|
|
521
521
|
if (!this.scrollElement) return 0;
|
|
522
522
|
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
@@ -558,12 +558,12 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
558
558
|
this._iosDeferredAdjustment = 0, t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
559
559
|
const i = this.getOffsetForIndex(t, e);
|
|
560
560
|
if (!i) return;
|
|
561
|
-
const [n, o] = i,
|
|
561
|
+
const [n, o] = i, h = this.now();
|
|
562
562
|
this.scrollState = {
|
|
563
563
|
index: t,
|
|
564
564
|
align: o,
|
|
565
565
|
behavior: s,
|
|
566
|
-
startedAt:
|
|
566
|
+
startedAt: h,
|
|
567
567
|
lastTargetOffset: n,
|
|
568
568
|
stableFrames: 0
|
|
569
569
|
}, this._scrollToOffset(n, {
|
|
@@ -697,38 +697,38 @@ function ht(l, t, e, s, i) {
|
|
|
697
697
|
endIndex: n
|
|
698
698
|
};
|
|
699
699
|
if (s === 1 && i !== null) {
|
|
700
|
-
const
|
|
701
|
-
let
|
|
702
|
-
const
|
|
703
|
-
for (;
|
|
700
|
+
const d = at(i, n, e);
|
|
701
|
+
let c = d;
|
|
702
|
+
const r = e + t;
|
|
703
|
+
for (; c < n && i[c * 2] + i[c * 2 + 1] < r; ) c++;
|
|
704
704
|
return {
|
|
705
|
-
startIndex:
|
|
706
|
-
endIndex:
|
|
705
|
+
startIndex: d,
|
|
706
|
+
endIndex: c
|
|
707
707
|
};
|
|
708
708
|
}
|
|
709
|
-
let
|
|
710
|
-
if (s === 1) for (;
|
|
709
|
+
let h = P(0, n, (d) => l[d].start, e), a = h;
|
|
710
|
+
if (s === 1) for (; a < n && l[a].end < e + t; ) a++;
|
|
711
711
|
else if (s > 1) {
|
|
712
|
-
const
|
|
713
|
-
for (;
|
|
714
|
-
const
|
|
715
|
-
|
|
712
|
+
const d = Array(s).fill(0);
|
|
713
|
+
for (; a < n && d.some((r) => r < e + t); ) {
|
|
714
|
+
const r = l[a];
|
|
715
|
+
d[r.lane] = r.end, a++;
|
|
716
716
|
}
|
|
717
|
-
const
|
|
718
|
-
for (;
|
|
719
|
-
const
|
|
720
|
-
|
|
717
|
+
const c = Array(s).fill(e + t);
|
|
718
|
+
for (; h >= 0 && c.some((r) => r >= e); ) {
|
|
719
|
+
const r = l[h];
|
|
720
|
+
c[r.lane] = r.start, h--;
|
|
721
721
|
}
|
|
722
|
-
|
|
722
|
+
h = Math.max(0, h - h % s), a = Math.min(n, a + (s - 1 - a % s));
|
|
723
723
|
}
|
|
724
724
|
return {
|
|
725
|
-
startIndex:
|
|
726
|
-
endIndex:
|
|
725
|
+
startIndex: h,
|
|
726
|
+
endIndex: a
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
729
|
var F = typeof document < "u" ? M.useLayoutEffect : M.useEffect;
|
|
730
730
|
function ct({ useFlushSync: l = !0, directDomUpdates: t = !1, directDomUpdatesMode: e = "transform", ...s }) {
|
|
731
|
-
const i = M.useReducer((
|
|
731
|
+
const i = M.useReducer((c) => c + 1, 0)[1], n = M.useRef({
|
|
732
732
|
enabled: t,
|
|
733
733
|
mode: e,
|
|
734
734
|
container: null,
|
|
@@ -737,52 +737,56 @@ function ct({ useFlushSync: l = !0, directDomUpdates: t = !1, directDomUpdatesMo
|
|
|
737
737
|
prevRange: null
|
|
738
738
|
});
|
|
739
739
|
n.current.enabled = t, n.current.mode = e;
|
|
740
|
-
const o = (
|
|
741
|
-
const
|
|
742
|
-
if (!
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
|
|
746
|
-
const m =
|
|
747
|
-
|
|
740
|
+
const o = (c) => {
|
|
741
|
+
const r = n.current;
|
|
742
|
+
if (!r.enabled || !r.container) return;
|
|
743
|
+
const f = c.getTotalSize();
|
|
744
|
+
if (f !== r.lastSize) {
|
|
745
|
+
r.lastSize = f;
|
|
746
|
+
const m = c.options.horizontal ? "width" : "height";
|
|
747
|
+
r.container.style[m] = `${f}px`;
|
|
748
748
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
749
|
+
}, h = (c) => {
|
|
750
|
+
const r = n.current;
|
|
751
|
+
if (!r.enabled || !r.container) return;
|
|
752
|
+
o(c);
|
|
753
|
+
const f = !!c.options.horizontal, m = r.mode === "transform", S = f ? "left" : "top", p = c.options.scrollMargin, u = c.getVirtualItems();
|
|
754
|
+
for (const g of u) {
|
|
755
|
+
const E = g.start - p, v = c.elementsCache.get(g.key);
|
|
756
|
+
v && r.lastPositions.get(v) !== E && (r.lastPositions.set(v, E), m ? v.style.transform = f ? `translate3d(${E}px, 0, 0)` : `translate3d(0, ${E}px, 0)` : v.style[S] = `${E}px`);
|
|
753
757
|
}
|
|
754
|
-
},
|
|
758
|
+
}, a = {
|
|
755
759
|
...s,
|
|
756
|
-
onChange: (
|
|
757
|
-
var
|
|
758
|
-
const
|
|
759
|
-
let
|
|
760
|
-
if (
|
|
761
|
-
|
|
762
|
-
const p =
|
|
763
|
-
|
|
760
|
+
onChange: (c, r) => {
|
|
761
|
+
var f;
|
|
762
|
+
const m = n.current;
|
|
763
|
+
let S = !0;
|
|
764
|
+
if (m.enabled) {
|
|
765
|
+
h(c);
|
|
766
|
+
const p = c.range, u = m.prevRange;
|
|
767
|
+
S = !u || u.isScrolling !== c.isScrolling || u.startIndex !== p?.startIndex || u.endIndex !== p?.endIndex, S && (m.prevRange = p ? {
|
|
764
768
|
startIndex: p.startIndex,
|
|
765
769
|
endIndex: p.endIndex,
|
|
766
|
-
isScrolling:
|
|
770
|
+
isScrolling: c.isScrolling
|
|
767
771
|
} : null);
|
|
768
772
|
}
|
|
769
|
-
|
|
773
|
+
S && (l && r ? q(i) : i()), (f = s.onChange) == null || f.call(s, c, r);
|
|
770
774
|
}
|
|
771
|
-
}, [
|
|
772
|
-
const
|
|
773
|
-
return Object.assign(
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
|
|
775
|
+
}, [d] = M.useState(() => {
|
|
776
|
+
const c = new rt(a);
|
|
777
|
+
return Object.assign(c, { containerRef: (r) => {
|
|
778
|
+
const f = n.current;
|
|
779
|
+
if (f.container = r, f.lastSize = null, r && f.enabled) {
|
|
780
|
+
const m = c.getTotalSize();
|
|
781
|
+
f.lastSize = m;
|
|
782
|
+
const S = c.options.horizontal ? "width" : "height";
|
|
783
|
+
r.style[S] = `${m}px`;
|
|
780
784
|
}
|
|
781
785
|
} });
|
|
782
786
|
});
|
|
783
|
-
return
|
|
784
|
-
|
|
785
|
-
}),
|
|
787
|
+
return d.setOptions(a), F(() => d._didMount(), []), F(() => (o(d), d._willUpdate())), F(() => {
|
|
788
|
+
h(d);
|
|
789
|
+
}), d;
|
|
786
790
|
}
|
|
787
791
|
function ut(l) {
|
|
788
792
|
return ct({
|
|
@@ -793,21 +797,21 @@ function ut(l) {
|
|
|
793
797
|
});
|
|
794
798
|
}
|
|
795
799
|
var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
|
|
796
|
-
const e = J(null), { termOfSearch: s, countries: i, handleSelectCountry: n } = K(), o = H(() => i.filter((
|
|
800
|
+
const e = J(null), { termOfSearch: s, countries: i, handleSelectCountry: n } = K(), o = H(() => i.filter((a) => a.name.toLocaleLowerCase().includes(s.toLowerCase())), [s]), h = ut({
|
|
797
801
|
count: o.length,
|
|
798
802
|
overscan: 5,
|
|
799
803
|
getScrollElement: () => e.current,
|
|
800
804
|
estimateSize: () => 40
|
|
801
805
|
});
|
|
802
806
|
return B(() => {
|
|
803
|
-
o.length > 0 &&
|
|
804
|
-
}, [s,
|
|
807
|
+
o.length > 0 && h.scrollToIndex(0);
|
|
808
|
+
}, [s, h]), o.length === 0 ? /* @__PURE__ */ x("div", {
|
|
805
809
|
className: "overflow-y-auto max-h-60 snap-y snap-mandatory",
|
|
806
810
|
children: /* @__PURE__ */ x("ul", {
|
|
807
811
|
className: "relative",
|
|
808
812
|
children: /* @__PURE__ */ x("li", {
|
|
809
813
|
className: "w-full flex items-center h-10 select-none px-6",
|
|
810
|
-
children: /* @__PURE__ */ x(
|
|
814
|
+
children: /* @__PURE__ */ x(W, {
|
|
811
815
|
variant: "body2",
|
|
812
816
|
component: "span",
|
|
813
817
|
className: "flex gap-2 items-center text-left",
|
|
@@ -820,29 +824,29 @@ var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
|
|
|
820
824
|
className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar",
|
|
821
825
|
children: /* @__PURE__ */ x("ul", {
|
|
822
826
|
className: "relative",
|
|
823
|
-
style: { height:
|
|
824
|
-
children:
|
|
825
|
-
const
|
|
827
|
+
style: { height: h.getTotalSize() },
|
|
828
|
+
children: h.getVirtualItems().map((a) => {
|
|
829
|
+
const d = o[a.index], { flag: c, name: r, prefix: f } = d;
|
|
826
830
|
return /* @__PURE__ */ x("li", {
|
|
827
|
-
className:
|
|
831
|
+
className: N("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"),
|
|
828
832
|
style: {
|
|
829
|
-
top:
|
|
830
|
-
height:
|
|
833
|
+
top: a.start,
|
|
834
|
+
height: a.size
|
|
831
835
|
},
|
|
832
836
|
children: /* @__PURE__ */ x("button", {
|
|
833
|
-
className:
|
|
834
|
-
onClick: () => n(
|
|
835
|
-
children: /* @__PURE__ */ U(
|
|
837
|
+
className: N("w-full", "h-full", "cursor-pointer", "px-6", "hover:bg-gray-50", "transition-colors", "duration-150", "focus-visible:outline-0", "hover:outline-gray-100", "focus:bg-gray-50", "dark:hover:bg-metal-700"),
|
|
838
|
+
onClick: () => n(d),
|
|
839
|
+
children: /* @__PURE__ */ U(W, {
|
|
836
840
|
variant: "body2",
|
|
837
841
|
component: "span",
|
|
838
842
|
className: "flex gap-2 items-center text-left",
|
|
839
|
-
children: [l && /* @__PURE__ */ x(
|
|
840
|
-
text:
|
|
843
|
+
children: [l && /* @__PURE__ */ x(c, {}), t && /* @__PURE__ */ x($, {
|
|
844
|
+
text: r,
|
|
841
845
|
prefix: f
|
|
842
846
|
})]
|
|
843
847
|
})
|
|
844
848
|
})
|
|
845
|
-
},
|
|
849
|
+
}, a.key);
|
|
846
850
|
})
|
|
847
851
|
})
|
|
848
852
|
});
|