@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,62 +1,57 @@
|
|
|
1
1
|
import "../constants/index.js";
|
|
2
|
-
import { useCallback as
|
|
3
|
-
var
|
|
4
|
-
const [
|
|
5
|
-
}),
|
|
2
|
+
import { useCallback as b, useEffect as u, useRef as y, useState as D } from "react";
|
|
3
|
+
var F = ({ canResize: o = !1, defaultWidth: g = 500, isOpen: n, maxWidth: l = 800, minWidth: a = 400, position: r = "right", onClose: w }) => {
|
|
4
|
+
const [I, h] = D(!1), [E, M] = D(!1), [T, c] = D(g), f = y(!1), i = y(() => {
|
|
5
|
+
}), d = y(() => {
|
|
6
6
|
});
|
|
7
|
-
|
|
7
|
+
u(() => {
|
|
8
8
|
let e;
|
|
9
|
-
return
|
|
9
|
+
return n ? (h(!0), e = setTimeout(() => M(!0), 10)) : (M(!1), e = setTimeout(() => h(!1), 300)), () => {
|
|
10
10
|
clearTimeout(e);
|
|
11
11
|
};
|
|
12
|
-
}, [
|
|
13
|
-
if (!
|
|
14
|
-
const e = new AbortController(),
|
|
15
|
-
|
|
12
|
+
}, [n]), u(() => {
|
|
13
|
+
if (!n) return;
|
|
14
|
+
const e = new AbortController(), t = (m) => {
|
|
15
|
+
m.code === "Escape" && w?.();
|
|
16
16
|
};
|
|
17
|
-
return window.addEventListener("keydown",
|
|
17
|
+
return window.addEventListener("keydown", t, { signal: e.signal }), () => {
|
|
18
18
|
e.abort();
|
|
19
19
|
};
|
|
20
|
-
}, [
|
|
21
|
-
const
|
|
22
|
-
document.removeEventListener("mousemove", i.current), document.removeEventListener("mouseup",
|
|
20
|
+
}, [n, w]);
|
|
21
|
+
const s = b(() => {
|
|
22
|
+
document.removeEventListener("mousemove", i.current), document.removeEventListener("mouseup", d.current), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
23
23
|
}, []);
|
|
24
|
-
|
|
24
|
+
u(() => {
|
|
25
25
|
i.current = (e) => {
|
|
26
|
-
if (!
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
26
|
+
if (!f.current || !o) return;
|
|
27
|
+
let t;
|
|
28
|
+
r === "right" ? t = window.innerWidth - e.clientX : t = e.clientX, t = Math.max(a, Math.min(l, t)), c(t);
|
|
29
|
+
}, d.current = () => {
|
|
30
|
+
f.current = !1, s();
|
|
31
31
|
};
|
|
32
32
|
}, [
|
|
33
|
-
|
|
33
|
+
r,
|
|
34
|
+
a,
|
|
34
35
|
l,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
o
|
|
36
|
+
o,
|
|
37
|
+
s
|
|
38
38
|
]);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
isVisible: T,
|
|
54
|
-
width: L,
|
|
55
|
-
translateClass: v(() => a ? "translate-x-0" : t === "left" ? "-translate-x-full" : "translate-x-full", [a, t]),
|
|
56
|
-
handleMouseDown: _,
|
|
57
|
-
handleKeyDown: b
|
|
39
|
+
const L = () => {
|
|
40
|
+
f.current = !0, document.addEventListener("mousemove", i.current), document.addEventListener("mouseup", d.current), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
41
|
+
}, _ = (e) => {
|
|
42
|
+
if (!o) return;
|
|
43
|
+
const t = r === "right" && e.key === "ArrowLeft" || r === "left" && e.key === "ArrowRight", m = r === "right" && e.key === "ArrowRight" || r === "left" && e.key === "ArrowLeft";
|
|
44
|
+
t ? (e.preventDefault(), c((A) => Math.min(l, A + 20))) : m && (e.preventDefault(), c((A) => Math.max(a, A - 20)));
|
|
45
|
+
};
|
|
46
|
+
return u(() => s, [s]), {
|
|
47
|
+
isAnimating: E,
|
|
48
|
+
isVisible: I,
|
|
49
|
+
width: T,
|
|
50
|
+
translateClass: E ? "translate-x-0" : r === "left" ? "-translate-x-full" : "translate-x-full",
|
|
51
|
+
handleMouseDown: L,
|
|
52
|
+
handleKeyDown: _
|
|
58
53
|
};
|
|
59
54
|
};
|
|
60
55
|
export {
|
|
61
|
-
|
|
56
|
+
F as useDrawer
|
|
62
57
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { FilterProvider as
|
|
4
|
-
import { filterVariants as
|
|
5
|
-
import { BadgeMultiSelect as
|
|
6
|
-
import { DateFilterDropdown as
|
|
7
|
-
import { DateRangeFilterDropdown as
|
|
8
|
-
import { ResetButton as
|
|
9
|
-
import { TextMultiSelect as
|
|
10
|
-
import { TimeFilterDropdown as
|
|
2
|
+
import { t as a } from "../../utils-Cx-WzRZF.js";
|
|
3
|
+
import { FilterProvider as p } from "./contexts/filter.provider.js";
|
|
4
|
+
import { filterVariants as n } from "./Filter.variants.js";
|
|
5
|
+
import { BadgeMultiSelect as d } from "./components/BadgeDropdown/BadgeMultiSelect.js";
|
|
6
|
+
import { DateFilterDropdown as f } from "./components/DateFilterDropdown/DateFilterDropdown.js";
|
|
7
|
+
import { DateRangeFilterDropdown as s } from "./components/DateRangeFilterDropdown/DateRangeFilterDropdown.js";
|
|
8
|
+
import { ResetButton as D } from "./components/ResetButton/ResetButton.js";
|
|
9
|
+
import { TextMultiSelect as c } from "./components/TextMultiSelect/TextMultiSelect.js";
|
|
10
|
+
import { TimeFilterDropdown as u } from "./components/TimeFilterDropdown/TimeFilterDropdown.js";
|
|
11
11
|
import { jsx as e } from "react/jsx-runtime";
|
|
12
|
-
var t = ({ className: o, theme: r
|
|
12
|
+
var t = ({ className: o, theme: r, children: i, closeOnApply: m = !0, resetScope: l }) => /* @__PURE__ */ e(p, {
|
|
13
13
|
closeOnApply: m,
|
|
14
|
+
resetScope: l,
|
|
14
15
|
theme: r,
|
|
15
16
|
children: /* @__PURE__ */ e("div", {
|
|
16
|
-
className:
|
|
17
|
+
className: a(n({ className: o })),
|
|
17
18
|
"data-theme": r,
|
|
18
19
|
children: i
|
|
19
20
|
})
|
|
20
21
|
});
|
|
21
22
|
t.displayName = "KonstructFilter";
|
|
22
|
-
t.BadgeMultiSelect =
|
|
23
|
-
t.TextMultiSelect =
|
|
24
|
-
t.DateFilterDropdown =
|
|
25
|
-
t.DateRangeFilterDropdown =
|
|
26
|
-
t.TimeFilterDropdown =
|
|
27
|
-
t.ResetButton =
|
|
23
|
+
t.BadgeMultiSelect = d;
|
|
24
|
+
t.TextMultiSelect = c;
|
|
25
|
+
t.DateFilterDropdown = f;
|
|
26
|
+
t.DateRangeFilterDropdown = s;
|
|
27
|
+
t.TimeFilterDropdown = u;
|
|
28
|
+
t.ResetButton = D;
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
d as BadgeMultiSelect,
|
|
31
|
+
f as DateFilterDropdown,
|
|
32
|
+
s as DateRangeFilterDropdown,
|
|
32
33
|
t as Filter,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
c as TextMultiSelect,
|
|
35
|
+
u as TimeFilterDropdown
|
|
35
36
|
};
|
|
@@ -1,66 +1,52 @@
|
|
|
1
|
-
import { useFilterContext as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
m(() => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}, [a]), f = d(() => r(!1), []), h = d((e, t) => {
|
|
19
|
-
i(t ? [...s, {
|
|
1
|
+
import { useFilterContext as F } from "../../contexts/filter.hook.js";
|
|
2
|
+
import { sendOpenFilterEvent as w } from "../../events/index.js";
|
|
3
|
+
import { useFilterDropdownSync as x } from "../../hooks/useFilterDropdownSync.js";
|
|
4
|
+
import { useCallback as a, useId as y, useMemo as f, useState as m } from "react";
|
|
5
|
+
var B = ({ onApply: o, options: d = [] }) => {
|
|
6
|
+
const { closeOnApply: p } = F(), c = y(), [u, n] = m(!1), [t, i] = m([]), O = a(() => n(!1), []), r = a(() => {
|
|
7
|
+
i([]), o?.([]);
|
|
8
|
+
}, [o]);
|
|
9
|
+
x({
|
|
10
|
+
id: c,
|
|
11
|
+
onClose: O,
|
|
12
|
+
onReset: r
|
|
13
|
+
});
|
|
14
|
+
const A = (e) => {
|
|
15
|
+
e && (w(c), i((s) => s.filter((l) => l.isApplied))), n(e);
|
|
16
|
+
}, h = (e, s) => {
|
|
17
|
+
i(s ? [...t, {
|
|
20
18
|
...e,
|
|
21
19
|
isApplied: !1
|
|
22
|
-
}] :
|
|
23
|
-
...
|
|
20
|
+
}] : t.map((l) => l.id === e.id ? {
|
|
21
|
+
...l,
|
|
24
22
|
isRemoved: !0
|
|
25
|
-
} :
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
const e =
|
|
30
|
-
...
|
|
23
|
+
} : l));
|
|
24
|
+
}, S = () => {
|
|
25
|
+
r(), p && n(!1);
|
|
26
|
+
}, v = () => {
|
|
27
|
+
const e = t?.filter((s) => !s.isRemoved).map((s) => ({
|
|
28
|
+
...s,
|
|
31
29
|
isApplied: !0
|
|
32
30
|
}));
|
|
33
|
-
i(e),
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, { signal: e.signal }), () => {
|
|
50
|
-
e.abort();
|
|
51
|
-
};
|
|
52
|
-
}, [f]), {
|
|
53
|
-
isOpen: O,
|
|
54
|
-
isAllSelected: R,
|
|
55
|
-
selectedCount: C,
|
|
56
|
-
selectedOptions: s,
|
|
57
|
-
handleApplyOptions: A,
|
|
58
|
-
handleOpenChange: g,
|
|
59
|
-
handleResetOptions: E,
|
|
60
|
-
handleSelectAll: S,
|
|
31
|
+
i(e), o?.(e.map(({ isApplied: s, isRemoved: l, ...g }) => g)), p && n(!1);
|
|
32
|
+
}, R = f(() => t.filter((e) => e.isApplied), [t]), C = f(() => d.length > 0 && d.every((e) => t.some((s) => s.id === e.id && !s.isRemoved)), [d, t]);
|
|
33
|
+
return {
|
|
34
|
+
isOpen: u,
|
|
35
|
+
isAllSelected: C,
|
|
36
|
+
selectedCount: R,
|
|
37
|
+
selectedOptions: t,
|
|
38
|
+
handleApplyOptions: v,
|
|
39
|
+
handleOpenChange: A,
|
|
40
|
+
handleResetOptions: S,
|
|
41
|
+
handleSelectAll: (e, s) => {
|
|
42
|
+
s && i(e.map((l) => ({
|
|
43
|
+
...l,
|
|
44
|
+
isApplied: !1
|
|
45
|
+
})));
|
|
46
|
+
},
|
|
61
47
|
handleSelectOption: h
|
|
62
48
|
};
|
|
63
49
|
};
|
|
64
50
|
export {
|
|
65
|
-
|
|
51
|
+
B as useBadgeMultiSelect
|
|
66
52
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as m } from "../../../../Checkbox-
|
|
1
|
+
import { t as m } from "../../../../Checkbox-B_ngk9Dj.js";
|
|
2
2
|
import { t as d } from "../../../../utils-Cx-WzRZF.js";
|
|
3
3
|
import { Button as h } from "../../../Button/Button.js";
|
|
4
4
|
import { t as O } from "../../../../chevron-down-DNP-OOAQ.js";
|
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
import { useFilterContext as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useFilterContext as O } from "../../contexts/filter.hook.js";
|
|
2
|
+
import { sendOpenFilterEvent as v } from "../../events/index.js";
|
|
3
|
+
import { useFilterDropdownSync as C } from "../../hooks/useFilterDropdownSync.js";
|
|
4
|
+
import { t as g } from "../../../../utils-B-BTGYA5.js";
|
|
5
|
+
import { useCallback as a, useId as w, useMemo as x, useState as l } from "react";
|
|
6
|
+
var A = ({ onApply: o, countryCode: r = "US" }) => {
|
|
7
|
+
const { closeOnApply: i } = O(), s = w(), [f, e] = l(!1), [n, c] = l(), [d, p] = l(), D = x(() => d?.toLocaleDateString(g(r), {
|
|
7
8
|
day: "numeric",
|
|
8
9
|
month: "short",
|
|
9
10
|
year: "numeric"
|
|
10
|
-
}), [
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
}, [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
i
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return document.addEventListener("visibilitychange", () => {
|
|
33
|
-
document.hidden && f();
|
|
34
|
-
}, { signal: e.signal }), () => {
|
|
35
|
-
e.abort();
|
|
36
|
-
};
|
|
37
|
-
}, [f]), {
|
|
38
|
-
id: n,
|
|
39
|
-
appliedDay: g,
|
|
40
|
-
isOpen: v,
|
|
41
|
-
selectedDay: i,
|
|
42
|
-
handleApply: D,
|
|
43
|
-
handleOpenChange: h,
|
|
44
|
-
handleSelect: E,
|
|
45
|
-
handleReset: b
|
|
11
|
+
}), [d, r]), u = (t) => {
|
|
12
|
+
t && v(s), e(t);
|
|
13
|
+
}, h = () => {
|
|
14
|
+
p(n), o?.(n), i && e(!1);
|
|
15
|
+
}, y = a((t) => c(t), []), S = a(() => e(!1), []), m = a(() => {
|
|
16
|
+
c(void 0), p(void 0), o?.();
|
|
17
|
+
}, [o]), F = () => {
|
|
18
|
+
m(), i && e(!1);
|
|
19
|
+
};
|
|
20
|
+
return C({
|
|
21
|
+
id: s,
|
|
22
|
+
onClose: S,
|
|
23
|
+
onReset: m
|
|
24
|
+
}), {
|
|
25
|
+
id: s,
|
|
26
|
+
appliedDay: D,
|
|
27
|
+
isOpen: f,
|
|
28
|
+
selectedDay: n,
|
|
29
|
+
handleApply: h,
|
|
30
|
+
handleOpenChange: u,
|
|
31
|
+
handleSelect: y,
|
|
32
|
+
handleReset: F
|
|
46
33
|
};
|
|
47
34
|
};
|
|
48
35
|
export {
|
|
49
|
-
|
|
36
|
+
A as useDateFilterDropdown
|
|
50
37
|
};
|
package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js
CHANGED
|
@@ -1,62 +1,49 @@
|
|
|
1
1
|
import { useFilterContext as F } from "../../contexts/filter.hook.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { sendOpenFilterEvent as O } from "../../events/index.js";
|
|
3
|
+
import { useFilterDropdownSync as w } from "../../hooks/useFilterDropdownSync.js";
|
|
4
|
+
import { t as x } from "../../../../utils-B-BTGYA5.js";
|
|
5
|
+
import { useCallback as a, useId as y, useMemo as I, useState as i } from "react";
|
|
6
|
+
var E = ({ defaultRange: d, onApply: n, countryCode: p = "US" }) => {
|
|
7
|
+
const { closeOnApply: l } = F(), r = y(), [g, o] = i(!1), [s, c] = i(d), [t, m] = i(), u = I(() => {
|
|
8
|
+
if (!t?.from) return;
|
|
9
|
+
const e = (D) => D.toLocaleDateString(x(p), {
|
|
9
10
|
day: "numeric",
|
|
10
11
|
month: "short"
|
|
11
12
|
});
|
|
12
|
-
return
|
|
13
|
-
}, [
|
|
14
|
-
e &&
|
|
15
|
-
},
|
|
13
|
+
return t.to ? `${e(t.from)} - ${e(t.to)}` : e(t.from);
|
|
14
|
+
}, [t]), h = (e) => {
|
|
15
|
+
e && O(r), o(e);
|
|
16
|
+
}, R = () => {
|
|
16
17
|
const e = {
|
|
17
|
-
from:
|
|
18
|
-
to:
|
|
18
|
+
from: s?.from,
|
|
19
|
+
to: s?.to
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
t,
|
|
24
|
-
i
|
|
25
|
-
]), b = a((e) => {
|
|
26
|
-
l({
|
|
21
|
+
m(e), n?.(e), l && o(!1);
|
|
22
|
+
}, C = a((e) => {
|
|
23
|
+
c({
|
|
27
24
|
from: e.from,
|
|
28
25
|
to: e.to
|
|
29
26
|
});
|
|
30
|
-
}, []),
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
}, [m]), {
|
|
50
|
-
id: o,
|
|
51
|
-
appliedRange: R,
|
|
52
|
-
isOpen: p,
|
|
53
|
-
selectedRange: i,
|
|
54
|
-
handleApply: C,
|
|
55
|
-
handleOpenChange: E,
|
|
56
|
-
handleRangeChange: b,
|
|
57
|
-
handleReset: O
|
|
27
|
+
}, []), S = a(() => o(!1), []), f = a(() => {
|
|
28
|
+
c(void 0), m(void 0), n?.();
|
|
29
|
+
}, [n]), v = () => {
|
|
30
|
+
f(), l && o(!1);
|
|
31
|
+
};
|
|
32
|
+
return w({
|
|
33
|
+
id: r,
|
|
34
|
+
onClose: S,
|
|
35
|
+
onReset: f
|
|
36
|
+
}), {
|
|
37
|
+
id: r,
|
|
38
|
+
appliedRange: u,
|
|
39
|
+
isOpen: g,
|
|
40
|
+
selectedRange: s,
|
|
41
|
+
handleApply: R,
|
|
42
|
+
handleOpenChange: h,
|
|
43
|
+
handleRangeChange: C,
|
|
44
|
+
handleReset: v
|
|
58
45
|
};
|
|
59
46
|
};
|
|
60
47
|
export {
|
|
61
|
-
|
|
48
|
+
E as useDateRangeFilterDropdown
|
|
62
49
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as l } from "../../../../utils-Cx-WzRZF.js";
|
|
2
2
|
import { useFilterContext as f } from "../../contexts/filter.hook.js";
|
|
3
|
-
import { i as p, n as c, r as h, t as g } from "../../../../dist-
|
|
3
|
+
import { i as p, n as c, r as h, t as g } from "../../../../dist-BaPW7qXd2.js";
|
|
4
4
|
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
var j = ({ isOpen: t, trigger: r, triggerClassName: o, position: a = "left", contentClassName: n, children: s, onOpenChange: i }) => {
|
|
6
6
|
const { theme: m } = f();
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { t as a } from "../../../../utils-Cx-WzRZF.js";
|
|
2
|
+
import { Button as i } from "../../../Button/Button.js";
|
|
3
|
+
import { useFilterContext as c } from "../../contexts/filter.hook.js";
|
|
3
4
|
import { resetEvent as m } from "../../events/index.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
6
|
+
var h = ({ disabled: t, className: e, onClick: r, ...o }) => {
|
|
7
|
+
const { resetScope: n } = c();
|
|
8
|
+
return /* @__PURE__ */ s(i, {
|
|
9
|
+
type: "button",
|
|
10
|
+
variant: "link",
|
|
11
|
+
appearance: "compact",
|
|
12
|
+
version: "alternate",
|
|
13
|
+
onClick: () => {
|
|
14
|
+
m(n), r?.();
|
|
15
|
+
},
|
|
16
|
+
disabled: t,
|
|
17
|
+
className: a("hover:no-underline", e),
|
|
18
|
+
...o,
|
|
19
|
+
children: "Reset"
|
|
20
|
+
});
|
|
21
|
+
};
|
|
19
22
|
export {
|
|
20
|
-
|
|
23
|
+
h as ResetButton
|
|
21
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as m } from "../../../../Checkbox-
|
|
1
|
+
import { t as m } from "../../../../Checkbox-B_ngk9Dj.js";
|
|
2
2
|
import { t as s } from "../../../../utils-Cx-WzRZF.js";
|
|
3
3
|
import { Button as o } from "../../../Button/Button.js";
|
|
4
4
|
import { t as y } from "../../../../chevron-down-DNP-OOAQ.js";
|
|
@@ -1,51 +1,37 @@
|
|
|
1
|
-
import { getFormattedTime as
|
|
2
|
-
import { useFilterContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
e.abort();
|
|
30
|
-
};
|
|
31
|
-
}, [n, t]), p(() => {
|
|
32
|
-
const e = new AbortController();
|
|
33
|
-
return document.addEventListener("visibilitychange", () => {
|
|
34
|
-
document.hidden && u();
|
|
35
|
-
}, { signal: e.signal }), () => {
|
|
36
|
-
e.abort();
|
|
37
|
-
};
|
|
38
|
-
}, [u]), {
|
|
39
|
-
id: n,
|
|
40
|
-
appliedLabel: L,
|
|
41
|
-
isOpen: h,
|
|
42
|
-
selectedTime: d,
|
|
1
|
+
import { getFormattedTime as g } from "../../../TimePicker/utils/index.js";
|
|
2
|
+
import { useFilterContext as w } from "../../contexts/filter.hook.js";
|
|
3
|
+
import { sendOpenFilterEvent as x } from "../../events/index.js";
|
|
4
|
+
import { useFilterDropdownSync as A } from "../../hooks/useFilterDropdownSync.js";
|
|
5
|
+
import { useCallback as d, useId as D, useState as t } from "react";
|
|
6
|
+
var j = ({ onApply: o, format: v = "24" }) => {
|
|
7
|
+
const { closeOnApply: c } = w(), l = D(), [b, s] = t(!1), [n, i] = t(), [r, p] = t(), [m, a] = t(), [h, f] = t(), S = h ?? (r ? g(r, v) : void 0), C = (e) => {
|
|
8
|
+
e && x(l), s(e);
|
|
9
|
+
}, T = (e) => {
|
|
10
|
+
i(e.value), a(e.label);
|
|
11
|
+
}, F = d((e) => {
|
|
12
|
+
i(e), a(void 0);
|
|
13
|
+
}, []), L = () => {
|
|
14
|
+
p(n), f(m), o?.(n), c && s(!1);
|
|
15
|
+
}, O = d(() => s(!1), []), u = d(() => {
|
|
16
|
+
i(void 0), p(void 0), a(void 0), f(void 0), o?.();
|
|
17
|
+
}, [o]), P = () => {
|
|
18
|
+
u(), c && s(!1);
|
|
19
|
+
};
|
|
20
|
+
return A({
|
|
21
|
+
id: l,
|
|
22
|
+
onClose: O,
|
|
23
|
+
onReset: u
|
|
24
|
+
}), {
|
|
25
|
+
id: l,
|
|
26
|
+
appliedLabel: S,
|
|
27
|
+
isOpen: b,
|
|
28
|
+
selectedTime: n,
|
|
43
29
|
selectedPresetLabel: m,
|
|
44
|
-
handleApply:
|
|
30
|
+
handleApply: L,
|
|
45
31
|
handleOpenChange: C,
|
|
46
32
|
handleSelectPreset: T,
|
|
47
|
-
handleSelectCustom:
|
|
48
|
-
handleReset:
|
|
33
|
+
handleSelectCustom: F,
|
|
34
|
+
handleReset: P
|
|
49
35
|
};
|
|
50
36
|
};
|
|
51
37
|
export {
|