@memobit/libs 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.css +1 -0
- package/dist/components/Accordion/Accordion2.js +79 -0
- package/dist/components/AlertDialog/AlertDialog.css +1 -0
- package/dist/components/AlertDialog/AlertDialog2.js +26 -0
- package/dist/components/AnalogClock/AnalogClock.css +1 -0
- package/dist/components/AnalogClock/AnalogClock2.js +293 -0
- package/dist/components/AngleSlider/AngleSlider.css +1 -0
- package/dist/components/AngleSlider/AngleSlider2.js +135 -0
- package/dist/components/AppHeader/AppHeader.css +1 -0
- package/dist/components/AppHeader/AppHeader2.js +44 -0
- package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal.css +1 -0
- package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +138 -0
- package/dist/components/Auth/Login/Login.css +1 -0
- package/dist/components/Auth/Login/Login2.js +155 -0
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal.css +1 -0
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +327 -0
- package/dist/components/AvatarInitials/AvatarInitials.css +1 -0
- package/dist/components/AvatarInitials/AvatarInitials2.js +73 -0
- package/dist/components/BMI/BMI.css +1 -0
- package/dist/components/BMI/BMI2.js +53 -0
- package/dist/components/BMI/bmiUtils.js +265 -0
- package/dist/components/Badge/Badge.css +1 -0
- package/dist/components/Badge/Badge2.js +30 -0
- package/dist/components/Banner/Banner.css +1 -0
- package/dist/components/Banner/Banner2.js +57 -0
- package/dist/components/Blockquote/Blockquote.css +1 -0
- package/dist/components/Blockquote/Blockquote2.js +55 -0
- package/dist/components/Breadcrumb/Breadcrumb.css +1 -0
- package/dist/components/Breadcrumb/Breadcrumb2.js +36 -0
- package/dist/components/BulkActionBar/BulkActionBar.css +1 -0
- package/dist/components/BulkActionBar/BulkActionBar2.js +39 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button2.js +32 -0
- package/dist/components/Calendar/Calendar.css +1 -0
- package/dist/components/Calendar/Calendar2.js +279 -0
- package/dist/components/CalendarHeatmap/CalendarHeatmap.css +1 -0
- package/dist/components/CalendarHeatmap/CalendarHeatmap2.js +91 -0
- package/dist/components/Card/Card.css +1 -0
- package/dist/components/Card/Card2.js +47 -0
- package/dist/components/Checkbox/Checkbox.css +1 -0
- package/dist/components/Checkbox/Checkbox2.js +35 -0
- package/dist/components/Chip/Chip.css +1 -0
- package/dist/components/Chip/Chip2.js +31 -0
- package/dist/components/CollapsibleSection/CollapsibleSection.css +1 -0
- package/dist/components/CollapsibleSection/CollapsibleSection2.js +68 -0
- package/dist/components/ColorPicker/ColorPicker.css +1 -0
- package/dist/components/ColorPicker/ColorPicker2.js +257 -0
- package/dist/components/CommandPalette/CommandPalette.css +1 -0
- package/dist/components/CommandPalette/CommandPalette2.js +97 -0
- package/dist/components/Confetti/Confetti.css +1 -0
- package/dist/components/Confetti/Confetti2.js +175 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.css +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog2.js +37 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.css +1 -0
- package/dist/components/ConfirmPopover/ConfirmPopover2.js +55 -0
- package/dist/components/ContextMenu/ContextMenu.css +1 -0
- package/dist/components/ContextMenu/ContextMenu2.js +53 -0
- package/dist/components/ContextToast/ContextToast.css +1 -0
- package/dist/components/ContextToast/ContextToast2.js +96 -0
- package/dist/components/ControlPanel/ControlPanel.css +1 -0
- package/dist/components/ControlPanel/ControlPanel.types.js +21 -0
- package/dist/components/ControlPanel/ControlPanel2.js +137 -0
- package/dist/components/ControlPanel/ControlPanelContext.js +31 -0
- package/dist/components/ControlPanel/ControlPanelFilter.js +386 -0
- package/dist/components/ControlPanel/ControlPanelNav.js +74 -0
- package/dist/components/ControlPanel/ControlPanelOptions.js +197 -0
- package/dist/components/CopyButton/CopyButton.css +1 -0
- package/dist/components/CopyButton/CopyButton2.js +48 -0
- package/dist/components/CountryWithFlag/CountryWithFlag.css +1 -0
- package/dist/components/CountryWithFlag/CountryWithFlag2.js +21 -0
- package/dist/components/DataView/DataView.CardView.js +189 -0
- package/dist/components/DataView/DataView.ColumnSelector.js +51 -0
- package/dist/components/DataView/DataView.MiniSort.js +25 -0
- package/dist/components/DataView/DataView.css +1 -0
- package/dist/components/DataView/DataView2.js +433 -0
- package/dist/components/DatePicker/DatePicker.css +1 -0
- package/dist/components/DatePicker/DatePicker2.js +151 -0
- package/dist/components/DateRangePicker/DateRangePicker.css +1 -0
- package/dist/components/DateRangePicker/DateRangePicker2.js +223 -0
- package/dist/components/DayAgenda/DayAgenda.css +1 -0
- package/dist/components/DayAgenda/DayAgenda2.js +120 -0
- package/dist/components/DiffViewer/DiffViewer.css +1 -0
- package/dist/components/DiffViewer/DiffViewer2.js +270 -0
- package/dist/components/Drawer/Drawer.css +1 -0
- package/dist/components/Drawer/Drawer2.js +119 -0
- package/dist/components/Dropdown/Dropdown.css +1 -0
- package/dist/components/Dropdown/Dropdown2.js +413 -0
- package/dist/components/EmojiPicker/EmojiPicker.css +1 -0
- package/dist/components/EmojiPicker/EmojiPicker2.js +789 -0
- package/dist/components/EmojiPicker/emojiKeywords/activities.js +508 -0
- package/dist/components/EmojiPicker/emojiKeywords/animals.js +501 -0
- package/dist/components/EmojiPicker/emojiKeywords/food.js +540 -0
- package/dist/components/EmojiPicker/emojiKeywords/index.js +21 -0
- package/dist/components/EmojiPicker/emojiKeywords/objects.js +652 -0
- package/dist/components/EmojiPicker/emojiKeywords/people.js +488 -0
- package/dist/components/EmojiPicker/emojiKeywords/smileys.js +538 -0
- package/dist/components/EmojiPicker/emojiKeywords/symbols.js +597 -0
- package/dist/components/EmojiPicker/emojiKeywords/travel.js +507 -0
- package/dist/components/EmptyState/EmptyState.css +1 -0
- package/dist/components/EmptyState/EmptyState2.js +47 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.css +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary2.js +37 -0
- package/dist/components/EventCalendar/EventCalendar.Chip.js +45 -0
- package/dist/components/EventCalendar/EventCalendar.Month.js +118 -0
- package/dist/components/EventCalendar/EventCalendar.Week.js +131 -0
- package/dist/components/EventCalendar/EventCalendar.css +1 -0
- package/dist/components/EventCalendar/EventCalendar.helpers.js +72 -0
- package/dist/components/EventCalendar/EventCalendar2.js +157 -0
- package/dist/components/FileDropzone/FileDropzone.css +1 -0
- package/dist/components/FileDropzone/FileDropzone2.js +71 -0
- package/dist/components/Flag/Flag.css +1 -0
- package/dist/components/Flag/Flag2.js +36 -0
- package/dist/components/FloatButton/FloatButton.css +1 -0
- package/dist/components/FloatButton/FloatButton2.js +68 -0
- package/dist/components/FloatingWindow/FloatingWindow.css +1 -0
- package/dist/components/FloatingWindow/FloatingWindow2.js +203 -0
- package/dist/components/FolderBrowserModal/FolderBrowserModal.css +1 -0
- package/dist/components/FolderBrowserModal/FolderBrowserModal2.js +144 -0
- package/dist/components/Grid/Col.js +17 -0
- package/dist/components/Grid/Grid.css +1 -0
- package/dist/components/Grid/Grid2.js +28 -0
- package/dist/components/Icon/Icon.css +1 -0
- package/dist/components/Icon/Icon2.js +23 -0
- package/dist/components/IconPicker/IconPicker.css +1 -0
- package/dist/components/IconPicker/IconPicker2.js +51 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.css +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll2.js +66 -0
- package/dist/components/InputDate/InputDate.css +1 -0
- package/dist/components/InputDate/InputDate2.js +87 -0
- package/dist/components/InputEmail/InputEmail.css +1 -0
- package/dist/components/InputEmail/InputEmail2.js +73 -0
- package/dist/components/InputFile/InputFile.css +1 -0
- package/dist/components/InputFile/InputFile2.js +41 -0
- package/dist/components/InputMask/InputMask.css +1 -0
- package/dist/components/InputMask/InputMask2.js +163 -0
- package/dist/components/InputNumber/InputNumber.css +1 -0
- package/dist/components/InputNumber/InputNumber2.js +60 -0
- package/dist/components/InputPIN/InputPIN.css +1 -0
- package/dist/components/InputPIN/InputPIN2.js +121 -0
- package/dist/components/InputPassword/InputPassword.css +1 -0
- package/dist/components/InputPassword/InputPassword2.js +47 -0
- package/dist/components/InputPhone/InputPhone.css +1 -0
- package/dist/components/InputPhone/InputPhone2.js +82 -0
- package/dist/components/InputSearch/InputSearch.css +1 -0
- package/dist/components/InputSearch/InputSearch2.js +53 -0
- package/dist/components/InputText/InputText.css +1 -0
- package/dist/components/InputText/InputText2.js +47 -0
- package/dist/components/InputTextarea/InputTextarea.css +1 -0
- package/dist/components/InputTextarea/InputTextarea2.js +46 -0
- package/dist/components/InputTime/InputTime.css +1 -0
- package/dist/components/InputTime/InputTime2.js +85 -0
- package/dist/components/InputUrl/InputUrl.css +1 -0
- package/dist/components/InputUrl/InputUrl2.js +65 -0
- package/dist/components/JourneyWizard/JourneyWizard.css +1 -0
- package/dist/components/JourneyWizard/JourneyWizard2.js +147 -0
- package/dist/components/List/List.css +1 -0
- package/dist/components/List/List2.js +28 -0
- package/dist/components/Loading/Loading.css +1 -0
- package/dist/components/Loading/Loading2.js +11 -0
- package/dist/components/MenuHamburger/MenuHamburger.css +1 -0
- package/dist/components/MenuHamburger/MenuHamburger2.js +65 -0
- package/dist/components/MiniSort/MiniSort.css +1 -0
- package/dist/components/MiniSort/MiniSort2.js +52 -0
- package/dist/components/MiniStatsCard/MiniStatsCard.css +1 -0
- package/dist/components/MiniStatsCard/MiniStatsCard2.js +67 -0
- package/dist/components/Minimap/Minimap.css +1 -0
- package/dist/components/Minimap/Minimap2.js +62 -0
- package/dist/components/Modal/Modal.css +1 -0
- package/dist/components/Modal/Modal2.js +87 -0
- package/dist/components/NavBar/NavBar.css +1 -0
- package/dist/components/NavBar/NavBar2.js +64 -0
- package/dist/components/NotificationPanel/NotificationPanel.css +1 -0
- package/dist/components/NotificationPanel/NotificationPanel2.js +66 -0
- package/dist/components/Pagination/Pagination.css +1 -0
- package/dist/components/Pagination/Pagination2.js +92 -0
- package/dist/components/PieChart/PieChart.css +1 -0
- package/dist/components/PieChart/PieChart2.js +142 -0
- package/dist/components/Popover/Popover.css +1 -0
- package/dist/components/Popover/Popover2.js +109 -0
- package/dist/components/Popover/hooks/Popover.hook.js +33 -0
- package/dist/components/ProgressBar/ProgressBar.css +1 -0
- package/dist/components/ProgressBar/ProgressBar2.js +48 -0
- package/dist/components/ProgressRing/ProgressRing.css +1 -0
- package/dist/components/ProgressRing/ProgressRing2.js +54 -0
- package/dist/components/QuantitySelector/QuantitySelector.css +1 -0
- package/dist/components/QuantitySelector/QuantitySelector2.js +94 -0
- package/dist/components/QuickAdd/QuickAdd.css +1 -0
- package/dist/components/QuickAdd/QuickAdd2.js +56 -0
- package/dist/components/QuickNumberUpdate/QuickNumberUpdate.css +1 -0
- package/dist/components/QuickNumberUpdate/QuickNumberUpdate2.js +52 -0
- package/dist/components/QuickOptionUpdate/QuickOptionUpdate.css +1 -0
- package/dist/components/QuickOptionUpdate/QuickOptionUpdate2.js +67 -0
- package/dist/components/Radio/Radio.css +1 -0
- package/dist/components/Radio/Radio2.js +36 -0
- package/dist/components/RangeSlider/RangeSlider.css +1 -0
- package/dist/components/RangeSlider/RangeSlider2.js +157 -0
- package/dist/components/Rating/Rating.css +1 -0
- package/dist/components/Rating/Rating2.js +148 -0
- package/dist/components/Rating/RatingIcon.js +102 -0
- package/dist/components/RichTextEditor/RichTextEditor.css +1 -0
- package/dist/components/RichTextEditor/RichTextEditor2.js +212 -0
- package/dist/components/RichTextEditor/RteLinkPrompt.js +42 -0
- package/dist/components/RichTextEditor/RteTableToolbar.js +95 -0
- package/dist/components/RichTextEditor/RteToolbar.js +106 -0
- package/dist/components/RichTextEditor/helpers.js +73 -0
- package/dist/components/RichTextEditor/hooks/useEditorHistory.js +39 -0
- package/dist/components/RichTextEditor/hooks/useLinkPrompt.js +61 -0
- package/dist/components/RichTextEditor/hooks/useTableOps.js +134 -0
- package/dist/components/RollingNumber/RollingNumber.css +1 -0
- package/dist/components/RollingNumber/RollingNumber2.js +71 -0
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -0
- package/dist/components/ScrollToTop/ScrollToTop2.js +40 -0
- package/dist/components/Separator/Separator.css +1 -0
- package/dist/components/Separator/Separator2.js +39 -0
- package/dist/components/Sidebar/Sidebar.css +1 -0
- package/dist/components/Sidebar/Sidebar2.js +115 -0
- package/dist/components/Sidebar/SidebarContext.js +31 -0
- package/dist/components/SignalStrength/SignalStrength.css +1 -0
- package/dist/components/SignalStrength/SignalStrength2.js +56 -0
- package/dist/components/Skeleton/Skeleton.css +1 -0
- package/dist/components/Skeleton/Skeleton2.js +50 -0
- package/dist/components/Slider/Slider.css +1 -0
- package/dist/components/Slider/Slider2.js +39 -0
- package/dist/components/SplitPanel/SplitPanel.css +1 -0
- package/dist/components/SplitPanel/SplitPanel2.js +69 -0
- package/dist/components/Splitter/Splitter.css +1 -0
- package/dist/components/Splitter/Splitter2.js +89 -0
- package/dist/components/StackedBar/StackedBar.css +1 -0
- package/dist/components/StackedBar/StackedBar2.js +50 -0
- package/dist/components/Stats/Stats.css +1 -0
- package/dist/components/Stats/Stats2.js +26 -0
- package/dist/components/StickyBar/StickyBar.css +1 -0
- package/dist/components/StickyBar/StickyBar2.js +29 -0
- package/dist/components/SuggestionsList/SuggestionsList.css +1 -0
- package/dist/components/SuggestionsList/SuggestionsList2.js +121 -0
- package/dist/components/ThemeSettings/ThemeContext.js +138 -0
- package/dist/components/ThemeSettings/ThemeContextValue.js +5 -0
- package/dist/components/ThemeSettings/ThemeSettings.css +1 -0
- package/dist/components/ThemeSettings/ThemeSettings2.js +245 -0
- package/dist/components/ThemeSettings/themeConfig.js +7 -0
- package/dist/components/ThemeSettings/useTheme.js +10 -0
- package/dist/components/TimePicker/TimePicker.css +1 -0
- package/dist/components/TimePicker/TimePicker2.js +118 -0
- package/dist/components/TimePicker/TimeSpinner.js +59 -0
- package/dist/components/Timeline/Timeline.css +1 -0
- package/dist/components/Timeline/Timeline2.js +57 -0
- package/dist/components/TimelineMarkers/TimelineMarkers.css +1 -0
- package/dist/components/TimelineMarkers/TimelineMarkers2.js +73 -0
- package/dist/components/TipsOfTheDay/TipsOfTheDay.css +1 -0
- package/dist/components/TipsOfTheDay/TipsOfTheDay2.js +24 -0
- package/dist/components/Toast/Toast.css +1 -0
- package/dist/components/Toast/Toast2.js +39 -0
- package/dist/components/ToggleButtons/ToggleButtons.css +1 -0
- package/dist/components/ToggleButtons/ToggleButtons2.js +47 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.css +1 -0
- package/dist/components/ToggleSwitch/ToggleSwitch2.js +27 -0
- package/dist/components/Toolbar/Toolbar.css +1 -0
- package/dist/components/Toolbar/Toolbar2.js +129 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip2.js +93 -0
- package/dist/components/TourHud/TourHud.css +1 -0
- package/dist/components/TourHud/TourHud2.js +70 -0
- package/dist/components/Transition/Transition.css +1 -0
- package/dist/components/Transition/Transition2.js +68 -0
- package/dist/components/Tree/Tree.css +1 -0
- package/dist/components/Tree/Tree2.js +95 -0
- package/dist/components/VirtualList/VirtualList.css +1 -0
- package/dist/components/VirtualList/VirtualList2.js +64 -0
- package/dist/components/WHtR/WHtR.css +1 -0
- package/dist/components/WHtR/WHtR2.js +115 -0
- package/dist/contexts/AuthContext/AuthContext.js +113 -0
- package/dist/helpers/AppPersistenceStorage.js +50 -0
- package/dist/helpers/Datetime.js +114 -0
- package/dist/helpers/Format.js +21 -0
- package/dist/helpers/Highlight.js +36 -0
- package/dist/helpers/HtmlContent.js +118 -0
- package/dist/helpers/LogicalOperators.js +15 -0
- package/dist/helpers/Numbers.js +15 -0
- package/dist/helpers/Pagination.js +7 -0
- package/dist/helpers/Search.js +15 -0
- package/dist/helpers/Strings.js +10 -0
- package/dist/helpers/Urls.js +68 -0
- package/dist/helpers/VersionInfo.js +36 -0
- package/dist/hooks/useAppPersistence.js +51 -0
- package/dist/hooks/useAuth/useAuth.js +10 -0
- package/dist/hooks/useBodyScrollLock.js +31 -0
- package/dist/hooks/useBreakpoint.js +65 -0
- package/dist/hooks/useComponentEffect.js +8 -0
- package/dist/hooks/useSwipe.js +45 -0
- package/dist/index.css +1 -2
- package/dist/index.esm.js +1 -17211
- package/dist/index.js +348 -0
- package/dist/mfa.js +4 -0
- package/dist/node_modules/qrcode.react/lib/esm/index.js +979 -0
- package/dist/validators/Vin.js +69 -0
- package/dist/version.js +8 -0
- package/dist/version.json +4 -4
- package/package.json +8 -7
- package/dist/mfa.esm.js +0 -1293
- package/dist/useAuth-BBqdDG2z.js +0 -467
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { Icon as g } from "../Icon/Icon2.js";
|
|
2
|
+
import { Button as C } from "../Button/Button2.js";
|
|
3
|
+
import { Chip as A } from "../Chip/Chip2.js";
|
|
4
|
+
import { InputNumber as b } from "../InputNumber/InputNumber2.js";
|
|
5
|
+
import { InputText as k } from "../InputText/InputText2.js";
|
|
6
|
+
import { DatePicker as w } from "../DatePicker/DatePicker2.js";
|
|
7
|
+
import { Dropdown as R } from "../Dropdown/Dropdown2.js";
|
|
8
|
+
import { InputDate as E } from "../InputDate/InputDate2.js";
|
|
9
|
+
import { InputSearch as I } from "../InputSearch/InputSearch2.js";
|
|
10
|
+
import { Rating as L } from "../Rating/Rating2.js";
|
|
11
|
+
import { DEFAULT_DATE_RANGE_PRESETS as M } from "./ControlPanel.types.js";
|
|
12
|
+
import { useEffect as P, useRef as T, useState as N } from "react";
|
|
13
|
+
import { jsx as n, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], S = (e) => e.every((r) => typeof r == "number") ? e : e.map(String), x = 2, j = (e) => {
|
|
15
|
+
const r = e.options ?? [];
|
|
16
|
+
return D(e.value).map((o) => r.find((t) => t.value === o)?.label ?? String(o));
|
|
17
|
+
}, H = (e) => {
|
|
18
|
+
const { type: r, value: o } = e;
|
|
19
|
+
if (o == null || o === "") return;
|
|
20
|
+
if (r === "checkbox") return o === !0 ? "On" : void 0;
|
|
21
|
+
if (r === "range") {
|
|
22
|
+
const [s, d] = Array.isArray(o) ? o : [];
|
|
23
|
+
return s === void 0 && d === void 0 ? void 0 : s === void 0 ? `≤ ${d}` : d === void 0 ? `≥ ${s}` : `${s} – ${d}`;
|
|
24
|
+
}
|
|
25
|
+
if (r === "date-range") {
|
|
26
|
+
const [s, d] = Array.isArray(o) ? o : [];
|
|
27
|
+
return !s && !d ? void 0 : s ? d ? `${s} → ${d}` : `from ${s}` : `until ${d}`;
|
|
28
|
+
}
|
|
29
|
+
if (r === "rating") return typeof o == "number" && o > 0 ? String(o) : void 0;
|
|
30
|
+
if (r === "text" || r === "search" || r === "date" || r === "number") return String(o);
|
|
31
|
+
const t = j(e);
|
|
32
|
+
if (t.length !== 0)
|
|
33
|
+
return t.length <= x ? t.join(", ") : `${t.slice(0, x).join(", ")} +${t.length - x}`;
|
|
34
|
+
}, ne = ({ filter: e, collapsible: r = !1, onChange: o }) => {
|
|
35
|
+
const t = r && e.type !== "checkbox", [s, d] = N(e.defaultExpanded ?? !1), a = e.summary ?? H(e), i = /* @__PURE__ */ _("span", {
|
|
36
|
+
className: `control-panel__filter-title${e.isActive ? " control-panel__filter-title--active" : ""}`,
|
|
37
|
+
children: [
|
|
38
|
+
e.isActive && /* @__PURE__ */ n("span", { className: "control-panel__filter-active-dot" }),
|
|
39
|
+
e.icon && /* @__PURE__ */ n(g, { name: e.icon }),
|
|
40
|
+
e.label
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ _("div", {
|
|
44
|
+
className: [
|
|
45
|
+
"control-panel__filter",
|
|
46
|
+
e.type === "checkbox" ? "control-panel__filter--checkbox" : "",
|
|
47
|
+
t ? "control-panel__filter--collapsible" : "",
|
|
48
|
+
t && !s ? "control-panel__filter--collapsed" : ""
|
|
49
|
+
].filter(Boolean).join(" "),
|
|
50
|
+
children: [t ? /* @__PURE__ */ _("button", {
|
|
51
|
+
className: "control-panel__filter-toggle",
|
|
52
|
+
type: "button",
|
|
53
|
+
onClick: () => d((l) => !l),
|
|
54
|
+
children: [
|
|
55
|
+
i,
|
|
56
|
+
!s && a && /* @__PURE__ */ n("span", {
|
|
57
|
+
className: "control-panel__filter-summary",
|
|
58
|
+
children: a
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ n("span", {
|
|
61
|
+
className: "control-panel__filter-caret",
|
|
62
|
+
children: /* @__PURE__ */ n(g, { name: s ? "caret-up" : "caret-down" })
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}) : e.type !== "checkbox" && i, (!t || s) && /* @__PURE__ */ n(B, {
|
|
66
|
+
filter: e,
|
|
67
|
+
onChange: o
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}, U = ({ placeholder: e, value: r, onChange: o }) => {
|
|
71
|
+
const [t, s] = N(r), d = T(r);
|
|
72
|
+
return P(() => {
|
|
73
|
+
r !== d.current && (d.current = r, s(r));
|
|
74
|
+
}, [r]), /* @__PURE__ */ n(I, {
|
|
75
|
+
className: "control-panel__filter-search",
|
|
76
|
+
onChange: (a) => {
|
|
77
|
+
d.current = a, s(a), o(a);
|
|
78
|
+
},
|
|
79
|
+
placeholder: e,
|
|
80
|
+
value: t
|
|
81
|
+
});
|
|
82
|
+
}, B = ({ filter: e, onChange: r }) => {
|
|
83
|
+
const o = D(e.value), t = e.options ?? [], [s, d] = N("");
|
|
84
|
+
if (e.type === "checkbox") return /* @__PURE__ */ n(A, {
|
|
85
|
+
count: e.count,
|
|
86
|
+
selected: e.value === !0,
|
|
87
|
+
onClick: () => r({
|
|
88
|
+
filterId: e.id,
|
|
89
|
+
type: e.type,
|
|
90
|
+
value: e.value !== !0
|
|
91
|
+
}),
|
|
92
|
+
children: e.label
|
|
93
|
+
});
|
|
94
|
+
if (e.type === "date") return /* @__PURE__ */ n(E, {
|
|
95
|
+
min: e.minDate,
|
|
96
|
+
max: e.maxDate,
|
|
97
|
+
value: typeof e.value == "string" ? e.value : "",
|
|
98
|
+
onChange: (a) => r({
|
|
99
|
+
filterId: e.id,
|
|
100
|
+
type: e.type,
|
|
101
|
+
value: a ?? null
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
if (e.type === "text") return /* @__PURE__ */ n("div", {
|
|
105
|
+
className: "control-panel__filter-text",
|
|
106
|
+
children: /* @__PURE__ */ n(k, {
|
|
107
|
+
onChange: (a) => r({
|
|
108
|
+
filterId: e.id,
|
|
109
|
+
type: e.type,
|
|
110
|
+
value: a
|
|
111
|
+
}),
|
|
112
|
+
placeholder: e.placeholder,
|
|
113
|
+
value: typeof e.value == "string" ? e.value : ""
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
if (e.type === "search") return /* @__PURE__ */ n(U, {
|
|
117
|
+
placeholder: e.placeholder,
|
|
118
|
+
value: typeof e.value == "string" ? e.value : "",
|
|
119
|
+
onChange: (a) => r({
|
|
120
|
+
filterId: e.id,
|
|
121
|
+
type: e.type,
|
|
122
|
+
value: a
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
if (e.type === "number") return /* @__PURE__ */ n("div", {
|
|
126
|
+
className: "control-panel__filter-number",
|
|
127
|
+
children: /* @__PURE__ */ n(b, {
|
|
128
|
+
min: e.min,
|
|
129
|
+
max: e.max,
|
|
130
|
+
step: e.step,
|
|
131
|
+
placeholder: e.placeholder,
|
|
132
|
+
value: typeof e.value == "number" ? e.value : void 0,
|
|
133
|
+
onChange: (a) => r({
|
|
134
|
+
filterId: e.id,
|
|
135
|
+
type: e.type,
|
|
136
|
+
value: a ?? null
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
if (e.type === "rating") return /* @__PURE__ */ n(L, {
|
|
141
|
+
selectable: !0,
|
|
142
|
+
icon: e.ratingIcon ?? "star",
|
|
143
|
+
maxRate: e.maxRate ?? 10,
|
|
144
|
+
rating: typeof e.value == "number" ? e.value : 0,
|
|
145
|
+
variant: e.ratingVariant ?? "warning",
|
|
146
|
+
onSelect: (a) => r({
|
|
147
|
+
filterId: e.id,
|
|
148
|
+
type: e.type,
|
|
149
|
+
value: a
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
if (e.type === "range") {
|
|
153
|
+
const a = Array.isArray(e.value) ? e.value : [], i = a[0], l = a[1], m = i !== void 0 && l !== void 0 && i > l, p = (u, v) => r({
|
|
154
|
+
filterId: e.id,
|
|
155
|
+
type: e.type,
|
|
156
|
+
value: [u, v]
|
|
157
|
+
});
|
|
158
|
+
return /* @__PURE__ */ _("div", {
|
|
159
|
+
className: "control-panel__filter-range",
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ n(b, {
|
|
162
|
+
min: e.min,
|
|
163
|
+
max: e.max,
|
|
164
|
+
step: e.step,
|
|
165
|
+
placeholder: "Min",
|
|
166
|
+
value: i,
|
|
167
|
+
error: m ? "Min exceeds max" : void 0,
|
|
168
|
+
onChange: (u) => p(u, l)
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ n("span", {
|
|
171
|
+
className: "control-panel__filter-range-sep",
|
|
172
|
+
children: "—"
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ n(b, {
|
|
175
|
+
min: e.min,
|
|
176
|
+
max: e.max,
|
|
177
|
+
step: e.step,
|
|
178
|
+
placeholder: "Max",
|
|
179
|
+
value: l,
|
|
180
|
+
error: m ? "Max is below min" : void 0,
|
|
181
|
+
onChange: (u) => p(i, u)
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (e.type === "date-range") {
|
|
187
|
+
const a = Array.isArray(e.value) ? e.value : [], i = a[0] || void 0, l = a[1] || void 0, m = e.presets ?? M, p = (c) => {
|
|
188
|
+
if (!c) return;
|
|
189
|
+
const [h, y, $] = c.split("-").map(Number);
|
|
190
|
+
return new Date(h, y - 1, $);
|
|
191
|
+
}, u = (c) => `${c.getFullYear()}-${String(c.getMonth() + 1).padStart(2, "0")}-${String(c.getDate()).padStart(2, "0")}`, v = (c, h) => r({
|
|
192
|
+
filterId: e.id,
|
|
193
|
+
type: e.type,
|
|
194
|
+
value: [c ?? "", h ?? ""]
|
|
195
|
+
}), f = (c) => {
|
|
196
|
+
const h = e.maxDate ? p(e.maxDate) : /* @__PURE__ */ new Date();
|
|
197
|
+
if (!h) return;
|
|
198
|
+
const y = new Date(h);
|
|
199
|
+
y.setDate(y.getDate() - c), v(u(y), u(h));
|
|
200
|
+
};
|
|
201
|
+
return /* @__PURE__ */ _("div", {
|
|
202
|
+
className: "control-panel__filter-date-range",
|
|
203
|
+
children: [m.length > 0 && /* @__PURE__ */ n("div", {
|
|
204
|
+
className: "control-panel__filter-date-presets",
|
|
205
|
+
children: m.map((c) => /* @__PURE__ */ n(C, {
|
|
206
|
+
size: "small",
|
|
207
|
+
variant: "default",
|
|
208
|
+
onClick: () => f(c.days),
|
|
209
|
+
children: c.label
|
|
210
|
+
}, c.days))
|
|
211
|
+
}), /* @__PURE__ */ n(w, {
|
|
212
|
+
mode: "range",
|
|
213
|
+
minDate: p(e.minDate),
|
|
214
|
+
maxDate: p(e.maxDate),
|
|
215
|
+
placeholder: e.placeholder ?? "Select range",
|
|
216
|
+
value: i && l ? {
|
|
217
|
+
start: p(i),
|
|
218
|
+
end: p(l)
|
|
219
|
+
} : void 0,
|
|
220
|
+
onChange: (c) => {
|
|
221
|
+
if (c && typeof c == "object" && !Array.isArray(c) && "start" in c) {
|
|
222
|
+
v(u(c.start), u(c.end));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
v(void 0, void 0);
|
|
226
|
+
}
|
|
227
|
+
})]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (e.type === "dropdown")
|
|
231
|
+
return !e.multiple && t.length > 0 && t.length <= V ? /* @__PURE__ */ n("div", {
|
|
232
|
+
className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
|
|
233
|
+
children: t.map((a) => {
|
|
234
|
+
const i = e.value === a.value;
|
|
235
|
+
return /* @__PURE__ */ n("div", {
|
|
236
|
+
className: `control-panel__filter-radio ${i ? "control-panel__filter-radio--selected" : ""}`,
|
|
237
|
+
children: /* @__PURE__ */ _("label", {
|
|
238
|
+
className: "control-panel__filter-radio-label",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ n("input", {
|
|
241
|
+
checked: i,
|
|
242
|
+
className: "control-panel__filter-radio-input",
|
|
243
|
+
name: e.id,
|
|
244
|
+
onChange: () => r({
|
|
245
|
+
filterId: e.id,
|
|
246
|
+
type: e.type,
|
|
247
|
+
value: a.value,
|
|
248
|
+
option: a,
|
|
249
|
+
options: [a]
|
|
250
|
+
}),
|
|
251
|
+
type: "radio",
|
|
252
|
+
value: a.value
|
|
253
|
+
}),
|
|
254
|
+
a.color && /* @__PURE__ */ n("span", {
|
|
255
|
+
className: "control-panel__filter-swatch",
|
|
256
|
+
style: { backgroundColor: a.color }
|
|
257
|
+
}),
|
|
258
|
+
a.icon && /* @__PURE__ */ n(g, { name: a.icon }),
|
|
259
|
+
/* @__PURE__ */ n("span", {
|
|
260
|
+
className: "control-panel__filter-label",
|
|
261
|
+
children: a.label
|
|
262
|
+
}),
|
|
263
|
+
a.count !== void 0 && /* @__PURE__ */ n("span", {
|
|
264
|
+
className: "control-panel__filter-count",
|
|
265
|
+
children: a.count
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
})
|
|
269
|
+
}, a.value);
|
|
270
|
+
})
|
|
271
|
+
}) : /* @__PURE__ */ n(R, {
|
|
272
|
+
className: "control-panel__filter-dropdown",
|
|
273
|
+
multiple: e.multiple,
|
|
274
|
+
name: e.id,
|
|
275
|
+
onChange: (a) => {
|
|
276
|
+
const i = Array.isArray(a) ? a : a ? [a] : [];
|
|
277
|
+
r({
|
|
278
|
+
filterId: e.id,
|
|
279
|
+
type: e.type,
|
|
280
|
+
value: Array.isArray(a) ? S(a.map((l) => l.value)) : a?.value ?? null,
|
|
281
|
+
option: Array.isArray(a) ? null : a,
|
|
282
|
+
options: i
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
options: t,
|
|
286
|
+
placeholder: e.placeholder,
|
|
287
|
+
searchable: e.searchable ?? !1,
|
|
288
|
+
selectedCountDisplay: "inline",
|
|
289
|
+
usePortal: !1,
|
|
290
|
+
value: typeof e.value == "boolean" ? null : e.value
|
|
291
|
+
});
|
|
292
|
+
if (e.type === "chips") {
|
|
293
|
+
const a = s.trim().toLowerCase(), i = e.searchable && a ? t.filter((l) => l.label.toLowerCase().includes(a)) : t;
|
|
294
|
+
return /* @__PURE__ */ _("div", {
|
|
295
|
+
className: "control-panel__filter-chips-wrap",
|
|
296
|
+
children: [e.searchable && t.length > 0 && /* @__PURE__ */ n(I, {
|
|
297
|
+
className: "control-panel__filter-chip-search",
|
|
298
|
+
value: s,
|
|
299
|
+
onChange: d,
|
|
300
|
+
placeholder: e.placeholder ?? "Filter..."
|
|
301
|
+
}), /* @__PURE__ */ n("div", {
|
|
302
|
+
className: "control-panel__filter-chips",
|
|
303
|
+
style: e.maxHeight !== void 0 ? {
|
|
304
|
+
maxHeight: typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight,
|
|
305
|
+
overflowY: "auto"
|
|
306
|
+
} : void 0,
|
|
307
|
+
children: i.map((l) => {
|
|
308
|
+
const m = o.includes(l.value);
|
|
309
|
+
return /* @__PURE__ */ _(A, {
|
|
310
|
+
color: l.color,
|
|
311
|
+
count: l.count,
|
|
312
|
+
disabled: l.disabled,
|
|
313
|
+
icon: l.icon,
|
|
314
|
+
title: l.tooltip,
|
|
315
|
+
selected: m,
|
|
316
|
+
onClick: () => {
|
|
317
|
+
if (l.disabled) return;
|
|
318
|
+
const p = e.multiple === !1, u = p ? m ? [] : [l.value] : m ? o.filter((v) => v !== l.value) : [...o, l.value];
|
|
319
|
+
r({
|
|
320
|
+
filterId: e.id,
|
|
321
|
+
type: e.type,
|
|
322
|
+
value: p ? u[0] ?? null : S(u),
|
|
323
|
+
option: l,
|
|
324
|
+
options: t.filter((v) => u.includes(v.value))
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
children: [l.imageUrl && /* @__PURE__ */ n("img", {
|
|
328
|
+
className: "control-panel__filter-chip-avatar",
|
|
329
|
+
src: l.imageUrl,
|
|
330
|
+
alt: ""
|
|
331
|
+
}), l.label]
|
|
332
|
+
}, l.value);
|
|
333
|
+
})
|
|
334
|
+
})]
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
return /* @__PURE__ */ n("div", {
|
|
338
|
+
className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
|
|
339
|
+
children: t.map((a) => {
|
|
340
|
+
const i = e.value === a.value;
|
|
341
|
+
return /* @__PURE__ */ n("div", {
|
|
342
|
+
className: `control-panel__filter-radio ${i ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
|
|
343
|
+
title: a.tooltip,
|
|
344
|
+
children: /* @__PURE__ */ _("label", {
|
|
345
|
+
className: "control-panel__filter-radio-label",
|
|
346
|
+
children: [
|
|
347
|
+
/* @__PURE__ */ n("input", {
|
|
348
|
+
checked: i,
|
|
349
|
+
className: "control-panel__filter-radio-input",
|
|
350
|
+
disabled: a.disabled,
|
|
351
|
+
name: e.id,
|
|
352
|
+
onChange: () => r({
|
|
353
|
+
filterId: e.id,
|
|
354
|
+
type: e.type,
|
|
355
|
+
value: a.value,
|
|
356
|
+
option: a,
|
|
357
|
+
options: [a]
|
|
358
|
+
}),
|
|
359
|
+
type: "radio",
|
|
360
|
+
value: a.value
|
|
361
|
+
}),
|
|
362
|
+
a.color && /* @__PURE__ */ n("span", {
|
|
363
|
+
className: "control-panel__filter-swatch",
|
|
364
|
+
style: { backgroundColor: a.color }
|
|
365
|
+
}),
|
|
366
|
+
a.icon && /* @__PURE__ */ n(g, {
|
|
367
|
+
className: "control-panel__filter-icon",
|
|
368
|
+
name: a.icon
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ n("span", {
|
|
371
|
+
className: "control-panel__filter-label",
|
|
372
|
+
children: a.label
|
|
373
|
+
}),
|
|
374
|
+
a.count !== void 0 && /* @__PURE__ */ n("span", {
|
|
375
|
+
className: "control-panel__filter-count",
|
|
376
|
+
children: a.count
|
|
377
|
+
})
|
|
378
|
+
]
|
|
379
|
+
})
|
|
380
|
+
}, a.value);
|
|
381
|
+
})
|
|
382
|
+
});
|
|
383
|
+
};
|
|
384
|
+
export {
|
|
385
|
+
ne as ControlPanelFilterItem
|
|
386
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Icon as d } from "../Icon/Icon2.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as l, jsxs as t } from "react/jsx-runtime";
|
|
4
|
+
var C = ({ navigation: n, onNavigate: e }) => {
|
|
5
|
+
const c = n.some((a) => (a.children?.length ?? 0) > 0);
|
|
6
|
+
return /* @__PURE__ */ l("nav", {
|
|
7
|
+
className: "control-panel__nav",
|
|
8
|
+
children: n.map((a) => _(a, c, e))
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
function _(n, e, c, a = 0) {
|
|
12
|
+
const p = n.children ?? [], r = p.length > 0, s = n.isOpen ?? !1, h = [
|
|
13
|
+
"control-panel__nav-item",
|
|
14
|
+
n.isActive ? "control-panel__nav-item--active" : "",
|
|
15
|
+
n.dimmed ? "control-panel__nav-item--dimmed" : "",
|
|
16
|
+
r ? "control-panel__nav-item--has-children" : ""
|
|
17
|
+
].filter(Boolean).join(" ");
|
|
18
|
+
return /* @__PURE__ */ t("div", {
|
|
19
|
+
className: "control-panel__nav-node",
|
|
20
|
+
children: [/* @__PURE__ */ t("div", {
|
|
21
|
+
className: "control-panel__nav-row",
|
|
22
|
+
style: { "--control-panel-nav-depth": a },
|
|
23
|
+
children: [e && (r ? /* @__PURE__ */ l("button", {
|
|
24
|
+
className: `control-panel__nav-toggle${s ? " control-panel__nav-toggle--open" : ""}`,
|
|
25
|
+
onClick: (o) => {
|
|
26
|
+
o.stopPropagation(), n.onOpenChange?.(!s, n);
|
|
27
|
+
},
|
|
28
|
+
type: "button",
|
|
29
|
+
children: /* @__PURE__ */ l(d, { name: "caret-right" })
|
|
30
|
+
}) : /* @__PURE__ */ l("span", { className: "control-panel__nav-toggle-placeholder" })), /* @__PURE__ */ t("button", {
|
|
31
|
+
className: h,
|
|
32
|
+
onClick: () => {
|
|
33
|
+
if (n.onClick) {
|
|
34
|
+
n.onClick(), c?.();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
r && n.onOpenChange?.(!s, n);
|
|
38
|
+
},
|
|
39
|
+
type: "button",
|
|
40
|
+
children: [
|
|
41
|
+
n.icon ? /* @__PURE__ */ l("span", {
|
|
42
|
+
className: "control-panel__nav-icon",
|
|
43
|
+
style: n.color ? { color: n.color } : void 0,
|
|
44
|
+
children: /* @__PURE__ */ l(d, { name: n.icon })
|
|
45
|
+
}) : n.color && /* @__PURE__ */ l("span", {
|
|
46
|
+
className: "control-panel__nav-dot",
|
|
47
|
+
style: { backgroundColor: n.color }
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ l("span", {
|
|
50
|
+
className: "control-panel__nav-label",
|
|
51
|
+
children: n.label
|
|
52
|
+
}),
|
|
53
|
+
n.count !== void 0 && /* @__PURE__ */ l("span", {
|
|
54
|
+
className: "control-panel__nav-count",
|
|
55
|
+
children: n.count
|
|
56
|
+
}),
|
|
57
|
+
n.badges && n.badges.length > 0 && /* @__PURE__ */ l("span", {
|
|
58
|
+
className: "control-panel__nav-badges",
|
|
59
|
+
children: n.badges.map((o, i) => /* @__PURE__ */ l("span", {
|
|
60
|
+
className: `control-panel__nav-badge control-panel__nav-badge--${o.variant}`,
|
|
61
|
+
children: o.count
|
|
62
|
+
}, i))
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
})]
|
|
66
|
+
}), r && /* @__PURE__ */ l("div", {
|
|
67
|
+
className: `control-panel__nav-children${s ? " control-panel__nav-children--open" : ""}`,
|
|
68
|
+
children: p.map((o) => _(o, e, c, a + 1))
|
|
69
|
+
})]
|
|
70
|
+
}, n.id);
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
C as ControlPanelNav
|
|
74
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Icon as p } from "../Icon/Icon2.js";
|
|
2
|
+
import { Button as y } from "../Button/Button2.js";
|
|
3
|
+
import { Tooltip as I } from "../Tooltip/Tooltip2.js";
|
|
4
|
+
import { Separator as u } from "../Separator/Separator2.js";
|
|
5
|
+
import { Chip as f } from "../Chip/Chip2.js";
|
|
6
|
+
import { Slider as G } from "../Slider/Slider2.js";
|
|
7
|
+
import k from "react";
|
|
8
|
+
import { Fragment as _, jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
var $ = [{
|
|
10
|
+
value: "cards",
|
|
11
|
+
label: "Grid",
|
|
12
|
+
icon: "grid"
|
|
13
|
+
}, {
|
|
14
|
+
value: "table",
|
|
15
|
+
label: "Table",
|
|
16
|
+
icon: "table"
|
|
17
|
+
}], C = {
|
|
18
|
+
value: "gallery",
|
|
19
|
+
label: "Gallery",
|
|
20
|
+
icon: "gallery"
|
|
21
|
+
}, W = ({ normalizedOptionGroups: b, onOptionChange: m, viewToggle: r, onViewToggleComplete: S, groupBy: s, visibleColumns: i }) => /* @__PURE__ */ c("div", {
|
|
22
|
+
className: "control-panel__options",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e("div", {
|
|
25
|
+
className: "control-panel__options-header",
|
|
26
|
+
children: /* @__PURE__ */ e("span", {
|
|
27
|
+
className: "control-panel__options-heading",
|
|
28
|
+
children: "Options"
|
|
29
|
+
})
|
|
30
|
+
}),
|
|
31
|
+
r && /* @__PURE__ */ e("div", {
|
|
32
|
+
className: "control-panel__option control-panel__option--view-toggle",
|
|
33
|
+
children: /* @__PURE__ */ e("div", {
|
|
34
|
+
className: "control-panel__option-view-toggle",
|
|
35
|
+
children: (r.options ?? [...$, ...r.showGallery ? [C] : []]).map((n) => /* @__PURE__ */ e(y, {
|
|
36
|
+
icon: n.icon,
|
|
37
|
+
size: "small",
|
|
38
|
+
variant: r.value === n.value ? "info" : "default",
|
|
39
|
+
onClick: () => {
|
|
40
|
+
r.onChange(n.value), S?.();
|
|
41
|
+
},
|
|
42
|
+
children: n.label
|
|
43
|
+
}, n.value))
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
s && s.options.length > 0 && /* @__PURE__ */ c(_, { children: [r && /* @__PURE__ */ e(u, { spacing: 0 }), /* @__PURE__ */ c("div", {
|
|
47
|
+
className: "control-panel__option control-panel__option--group-by",
|
|
48
|
+
children: [/* @__PURE__ */ e("span", {
|
|
49
|
+
className: "control-panel__filter-title",
|
|
50
|
+
children: "Group by"
|
|
51
|
+
}), /* @__PURE__ */ e("div", {
|
|
52
|
+
className: "control-panel__filter-chips",
|
|
53
|
+
children: s.options.map((n) => {
|
|
54
|
+
const t = s.value === n.value;
|
|
55
|
+
return /* @__PURE__ */ e(f, {
|
|
56
|
+
selected: t,
|
|
57
|
+
onClick: () => s.onChange(t ? null : n.value),
|
|
58
|
+
children: n.label
|
|
59
|
+
}, n.value);
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
})] }),
|
|
63
|
+
i && /* @__PURE__ */ c(_, { children: [(r || s && s.options.length > 0) && /* @__PURE__ */ e(u, { spacing: 0 }), /* @__PURE__ */ c("div", {
|
|
64
|
+
className: "control-panel__option control-panel__option--chips",
|
|
65
|
+
children: [/* @__PURE__ */ e("span", {
|
|
66
|
+
className: "control-panel__filter-title",
|
|
67
|
+
children: "Visible columns"
|
|
68
|
+
}), /* @__PURE__ */ e("div", {
|
|
69
|
+
className: "control-panel__filter-chips",
|
|
70
|
+
children: i.options.map((n) => {
|
|
71
|
+
const t = i.value.includes(n.value);
|
|
72
|
+
return /* @__PURE__ */ e(f, {
|
|
73
|
+
selected: t,
|
|
74
|
+
onClick: () => {
|
|
75
|
+
const l = t ? i.value.filter((o) => o !== n.value) : [...i.value, n.value];
|
|
76
|
+
i.onChange(l);
|
|
77
|
+
},
|
|
78
|
+
children: n.label
|
|
79
|
+
}, n.value);
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
})] }),
|
|
83
|
+
b.length > 0 && (r || s || i) && /* @__PURE__ */ e(u, { spacing: 0 }),
|
|
84
|
+
b.map((n, t) => /* @__PURE__ */ c("div", {
|
|
85
|
+
className: "control-panel__option-group",
|
|
86
|
+
children: [n.label && /* @__PURE__ */ e("span", {
|
|
87
|
+
className: "control-panel__option-group-label",
|
|
88
|
+
children: n.label
|
|
89
|
+
}), n.options.map((l, o) => {
|
|
90
|
+
const N = o > 0 ? n.options[o - 1] : void 0, x = !!N && N.type !== l.type;
|
|
91
|
+
return /* @__PURE__ */ c(k.Fragment, { children: [x && /* @__PURE__ */ e(u, { spacing: 0 }), /* @__PURE__ */ c("div", {
|
|
92
|
+
className: `control-panel__option control-panel__option--${l.type}`,
|
|
93
|
+
children: [
|
|
94
|
+
l.type === "checkbox" && /* @__PURE__ */ e(f, {
|
|
95
|
+
icon: l.icon,
|
|
96
|
+
selected: l.value ?? !1,
|
|
97
|
+
onClick: () => m?.({
|
|
98
|
+
optionId: l.id,
|
|
99
|
+
value: !(l.value ?? !1)
|
|
100
|
+
}),
|
|
101
|
+
children: l.label
|
|
102
|
+
}),
|
|
103
|
+
l.type === "radio" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ e("span", {
|
|
104
|
+
className: "control-panel__filter-title",
|
|
105
|
+
children: l.label
|
|
106
|
+
}), /* @__PURE__ */ e("div", {
|
|
107
|
+
className: `control-panel__filter-list ${l.inline ? "control-panel__filter-list--inline" : ""}`,
|
|
108
|
+
children: l.options.map((a) => {
|
|
109
|
+
const d = l.value === a.value, h = () => m?.({
|
|
110
|
+
optionId: l.id,
|
|
111
|
+
value: a.value
|
|
112
|
+
}), v = /* @__PURE__ */ e("div", {
|
|
113
|
+
className: `control-panel__filter-radio ${d ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
|
|
114
|
+
children: /* @__PURE__ */ c("label", {
|
|
115
|
+
className: "control-panel__filter-radio-label",
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ e("input", {
|
|
118
|
+
checked: d,
|
|
119
|
+
className: "control-panel__filter-radio-input",
|
|
120
|
+
disabled: a.disabled,
|
|
121
|
+
name: `control-panel-option-${l.id}`,
|
|
122
|
+
onChange: h,
|
|
123
|
+
onClick: () => {
|
|
124
|
+
a.disabled || d && h();
|
|
125
|
+
},
|
|
126
|
+
type: "radio",
|
|
127
|
+
value: a.value
|
|
128
|
+
}),
|
|
129
|
+
a.icon && /* @__PURE__ */ e(p, { name: a.icon }),
|
|
130
|
+
/* @__PURE__ */ e("span", {
|
|
131
|
+
className: "control-panel__filter-label",
|
|
132
|
+
children: a.label
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
return a.title ? /* @__PURE__ */ e(I, {
|
|
138
|
+
title: a.title,
|
|
139
|
+
children: v
|
|
140
|
+
}, a.value) : /* @__PURE__ */ e(k.Fragment, { children: v }, a.value);
|
|
141
|
+
})
|
|
142
|
+
})] }),
|
|
143
|
+
l.type === "slider" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ c("span", {
|
|
144
|
+
className: "control-panel__filter-title",
|
|
145
|
+
children: [
|
|
146
|
+
l.icon && /* @__PURE__ */ e(p, { name: l.icon }),
|
|
147
|
+
l.label,
|
|
148
|
+
l.showValue !== !1 && /* @__PURE__ */ c("span", {
|
|
149
|
+
className: "control-panel__option-slider-value",
|
|
150
|
+
children: [l.value, l.unit ?? ""]
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
}), /* @__PURE__ */ e(G, {
|
|
154
|
+
min: l.min,
|
|
155
|
+
max: l.max,
|
|
156
|
+
step: l.step,
|
|
157
|
+
value: l.value,
|
|
158
|
+
onChange: (a) => m?.({
|
|
159
|
+
optionId: l.id,
|
|
160
|
+
value: a
|
|
161
|
+
}),
|
|
162
|
+
showValues: !1,
|
|
163
|
+
thin: !0
|
|
164
|
+
})] }),
|
|
165
|
+
l.type === "chips" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ e("span", {
|
|
166
|
+
className: "control-panel__filter-title",
|
|
167
|
+
children: l.label
|
|
168
|
+
}), /* @__PURE__ */ e("div", {
|
|
169
|
+
className: "control-panel__filter-chips",
|
|
170
|
+
children: l.options.map((a) => {
|
|
171
|
+
const d = l.value.includes(a.value);
|
|
172
|
+
return /* @__PURE__ */ e(f, {
|
|
173
|
+
disabled: a.disabled,
|
|
174
|
+
icon: a.icon,
|
|
175
|
+
title: a.title,
|
|
176
|
+
selected: d,
|
|
177
|
+
onClick: () => {
|
|
178
|
+
if (a.disabled) return;
|
|
179
|
+
const h = d ? l.value.filter((v) => v !== a.value) : [...l.value, a.value];
|
|
180
|
+
m?.({
|
|
181
|
+
optionId: l.id,
|
|
182
|
+
value: h
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
children: a.label
|
|
186
|
+
}, a.value);
|
|
187
|
+
})
|
|
188
|
+
})] })
|
|
189
|
+
]
|
|
190
|
+
})] }, l.id);
|
|
191
|
+
})]
|
|
192
|
+
}, n.id ?? n.label ?? t))
|
|
193
|
+
]
|
|
194
|
+
});
|
|
195
|
+
export {
|
|
196
|
+
W as ControlPanelOptions
|
|
197
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.copy-button--icon-only{aspect-ratio:1;justify-content:center}
|