haze-ui 1.30.0 → 1.32.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/README.md +67 -1
- package/dist/components/ActivityRail/ActivityRail.js +76 -0
- package/dist/components/ActivityRail/index.js +3 -0
- package/dist/components/BottomSheet/BottomSheet.js +12 -26
- package/dist/components/Button/Button.js +33 -15
- package/dist/components/Button/ButtonLink.js +12 -21
- package/dist/components/Button/styles.js +2 -2
- package/dist/components/Cascader/Cascader.js +11 -11
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/Combobox/Combobox.js +128 -119
- package/dist/components/Command/Command.js +9 -9
- package/dist/components/ConfigProvider/ConfigContext.js +16 -0
- package/dist/components/ConfirmDialog/confirm.js +41 -0
- package/dist/components/ConfirmDialog/index.js +2 -1
- package/dist/components/ConversationList/ConversationList.js +16 -7
- package/dist/components/DataTable/DataTable.js +24 -24
- package/dist/components/DateTimePicker/DateTimePicker.js +25 -0
- package/dist/components/DateTimePicker/index.js +3 -0
- package/dist/components/Datepicker/Datepicker.js +8 -7
- package/dist/components/Datepicker/DatepickerCore.js +60 -59
- package/dist/components/Drawer/Drawer.js +45 -40
- package/dist/components/Fieldset/Fieldset.js +25 -0
- package/dist/components/Fieldset/index.js +2 -0
- package/dist/components/Highlight/Highlight.js +19 -0
- package/dist/components/Highlight/index.js +2 -0
- package/dist/components/Indicator/Indicator.js +37 -0
- package/dist/components/Indicator/index.js +2 -0
- package/dist/components/InlineCompletion/InlineCompletion.js +4 -4
- package/dist/components/Input/Input.js +9 -7
- package/dist/components/Input/InputCore.js +32 -13
- package/dist/components/List/List.js +14 -10
- package/dist/components/LoadingOverlay/LoadingOverlay.js +30 -0
- package/dist/components/LoadingOverlay/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +11 -0
- package/dist/components/LocaleProvider/de-de.js +11 -0
- package/dist/components/LocaleProvider/es-es.js +11 -0
- package/dist/components/LocaleProvider/fr-fr.js +11 -0
- package/dist/components/LocaleProvider/it-it.js +11 -0
- package/dist/components/LocaleProvider/ja-jp.js +11 -0
- package/dist/components/LocaleProvider/ko-kr.js +11 -0
- package/dist/components/LocaleProvider/locale.js +11 -0
- package/dist/components/LocaleProvider/pt-br.js +11 -0
- package/dist/components/LocaleProvider/ru-ru.js +11 -0
- package/dist/components/LocaleProvider/zh-cn.js +11 -0
- package/dist/components/LogViewer/LogViewer.js +45 -38
- package/dist/components/Mark/Mark.js +20 -0
- package/dist/components/Mark/index.js +2 -0
- package/dist/components/Mentions/MentionsCore.js +3 -3
- package/dist/components/Menu/MenuItem.js +6 -4
- package/dist/components/NumberFormatter/NumberFormatter.js +16 -0
- package/dist/components/NumberFormatter/index.js +2 -0
- package/dist/components/OTPInput/OTPInputCore.js +7 -6
- package/dist/components/PasswordInput/PasswordInputCore.js +27 -26
- package/dist/components/Rating/RatingCore.js +18 -18
- package/dist/components/Resizable/Resizable.js +266 -36
- package/dist/components/Select/Select.js +28 -23
- package/dist/components/Select/SelectCore.js +26 -23
- package/dist/components/Select/SelectFloating.js +157 -153
- package/dist/components/Sparkline/Sparkline.js +45 -0
- package/dist/components/Sparkline/index.js +3 -0
- package/dist/components/Sparkline/sparkline-styles.js +18 -0
- package/dist/components/Spoiler/Spoiler.js +36 -0
- package/dist/components/Spoiler/index.js +3 -0
- package/dist/components/StatusBar/StatusBar.js +47 -0
- package/dist/components/StatusBar/index.js +3 -0
- package/dist/components/TabBar/TabBar.js +60 -0
- package/dist/components/TabBar/index.js +3 -0
- package/dist/components/Tabs/SortableTabList.js +116 -0
- package/dist/components/Tabs/Tab.js +83 -16
- package/dist/components/Tabs/TabList.js +94 -38
- package/dist/components/Tabs/edge-scroll.js +6 -0
- package/dist/components/Tabs/index.js +4 -3
- package/dist/components/Tabs/tab-metas.js +24 -0
- package/dist/components/TagGroup/SortableTagGroup.js +32 -20
- package/dist/components/TagGroup/TagGroup.js +23 -9
- package/dist/components/TagGroup/TagGroupItem.js +21 -15
- package/dist/components/TagInput/SortableTagInputCore.js +11 -11
- package/dist/components/TagInput/TagInputCore.js +10 -10
- package/dist/components/TimePicker/TimePickerPanel.js +3 -3
- package/dist/components/Toast/ToastContainer.js +5 -5
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/{toast2.js → toast-channel.js} +1 -1
- package/dist/components/Toast/useToast.js +1 -1
- package/dist/components/Tree/SortableTree.js +39 -39
- package/dist/components/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/VirtualList/VirtualList.js +133 -121
- package/dist/components/VisuallyHidden/VisuallyHidden.js +15 -0
- package/dist/components/VisuallyHidden/index.js +2 -0
- package/dist/components/Workbench/Workbench.js +144 -0
- package/dist/components/Workbench/index.js +3 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/activity-rail.css +4 -0
- package/dist/css/affix.css +2 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/app-shell.css +3 -1
- package/dist/css/approval-card.css +2 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/async-section.css +2 -0
- package/dist/css/avatar-group.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/back-to-top.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/banner.css +2 -0
- package/dist/css/bottom-sheet.css +2 -0
- package/dist/css/breadcrumb.css +3 -1
- package/dist/css/button.css +3 -2
- package/dist/css/calendar.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/cascader.css +2 -0
- package/dist/css/chart.css +2 -0
- package/dist/css/chat-container.css +2 -0
- package/dist/css/chat-input.css +2 -0
- package/dist/css/chat-message.css +2 -0
- package/dist/css/checkbox.css +3 -1
- package/dist/css/chip.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/collapsible.css +2 -0
- package/dist/css/color-picker.css +2 -0
- package/dist/css/combobox.css +2 -0
- package/dist/css/command.css +3 -1
- package/dist/css/confirm-dialog.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/context-menu.css +3 -1
- package/dist/css/conversation-list.css +2 -0
- package/dist/css/count-up.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-range-picker.css +3 -1
- package/dist/css/datepicker.css +2 -0
- package/dist/css/descriptions.css +2 -0
- package/dist/css/dialog.css +2 -0
- package/dist/css/diff-viewer.css +2 -0
- package/dist/css/disclosure.css +2 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +3 -1
- package/dist/css/dropdown-menu.css +4 -2
- package/dist/css/ellipsis.css +2 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/fieldset.css +4 -0
- package/dist/css/file-input.css +2 -0
- package/dist/css/file-preview.css +2 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/float-button.css +2 -0
- package/dist/css/form.css +2 -0
- package/dist/css/grid.css +2 -0
- package/dist/css/hover-card.css +3 -1
- package/dist/css/icon.css +2 -0
- package/dist/css/image.css +2 -0
- package/dist/css/indicator.css +4 -0
- package/dist/css/inline-completion.css +2 -0
- package/dist/css/inline-edit.css +2 -0
- package/dist/css/input.css +3 -1
- package/dist/css/json-view.css +2 -0
- package/dist/css/kbd.css +2 -0
- package/dist/css/list.css +3 -1
- package/dist/css/loading-overlay.css +4 -0
- package/dist/css/log-viewer.css +2 -0
- package/dist/css/mark.css +4 -0
- package/dist/css/markdown-renderer.css +2 -0
- package/dist/css/masonry.css +2 -0
- package/dist/css/mentions.css +2 -0
- package/dist/css/menu.css +5 -3
- package/dist/css/model-picker.css +2 -0
- package/dist/css/navigation-bar.css +2 -0
- package/dist/css/number-input.css +2 -0
- package/dist/css/otp-input.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/password-input.css +3 -1
- package/dist/css/popover.css +3 -1
- package/dist/css/progress.css +2 -0
- package/dist/css/prompt-input.css +2 -0
- package/dist/css/qr-code.css +2 -0
- package/dist/css/radio.css +3 -1
- package/dist/css/rating.css +2 -0
- package/dist/css/resizable.css +3 -1
- package/dist/css/result.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/segmented.css +3 -1
- package/dist/css/select.css +2 -0
- package/dist/css/sidebar.css +3 -1
- package/dist/css/signature.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +3 -1
- package/dist/css/sources.css +2 -0
- package/dist/css/sparkline.css +4 -0
- package/dist/css/spinner.css +2 -0
- package/dist/css/spoiler.css +4 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/status-bar.css +4 -0
- package/dist/css/step-timeline.css +2 -0
- package/dist/css/stepper.css +2 -0
- package/dist/css/streaming-text.css +2 -0
- package/dist/css/swipe-action.css +2 -0
- package/dist/css/switch.css +3 -1
- package/dist/css/tab-bar.css +4 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +5 -2
- package/dist/css/tag-group.css +2 -0
- package/dist/css/tag-input.css +2 -0
- package/dist/css/tag.css +3 -1
- package/dist/css/textarea.css +2 -0
- package/dist/css/thinking-indicator.css +2 -0
- package/dist/css/time-picker.css +2 -0
- package/dist/css/timeline.css +2 -0
- package/dist/css/toast.css +2 -0
- package/dist/css/toggle.css +2 -0
- package/dist/css/token-counter.css +2 -0
- package/dist/css/tokens.css +2 -0
- package/dist/css/tool-call-card.css +2 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/transfer.css +2 -0
- package/dist/css/tree-select.css +2 -0
- package/dist/css/tree.css +3 -1
- package/dist/css/typography.css +2 -0
- package/dist/css/upload.css +2 -0
- package/dist/css/virtual-list.css +2 -0
- package/dist/css/visually-hidden.css +4 -0
- package/dist/css/watermark.css +2 -0
- package/dist/css/workbench.css +4 -0
- package/dist/css-manifest.json +202 -1
- package/dist/dates/adapter.js +9 -1
- package/dist/dates/buddhist.js +43 -0
- package/dist/dates/ethiopic.js +67 -0
- package/dist/dates/hebrew.js +95 -0
- package/dist/dates/japanese.js +41 -0
- package/dist/dates/persian.js +121 -0
- package/dist/dates/registry.js +14 -4
- package/dist/haze-ui.css +435 -29
- package/dist/headless/index.js +18 -17
- package/dist/hooks/useBusyPressable.js +10 -0
- package/dist/index.js +263 -241
- package/dist/mcp-docs.json +1073 -33
- package/dist/registry.json +256 -14
- package/dist/types/components/ActivityRail/ActivityRail.d.ts +30 -0
- package/dist/types/components/ActivityRail/index.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +50 -5
- package/dist/types/components/Button/ButtonLink.d.ts +27 -15
- package/dist/types/components/Button/styles.d.ts +34 -0
- package/dist/types/components/Combobox/Combobox.d.ts +20 -2
- package/dist/types/components/Combobox/index.d.ts +1 -1
- package/dist/types/components/ConfigProvider/ConfigContext.d.ts +20 -0
- package/dist/types/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/dist/types/components/ConfirmDialog/confirm.d.ts +33 -0
- package/dist/types/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/types/components/ConversationList/ConversationList.d.ts +10 -1
- package/dist/types/components/DateTimePicker/DateTimePicker.d.ts +36 -0
- package/dist/types/components/DateTimePicker/index.d.ts +2 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +3 -3
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +3 -3
- package/dist/types/components/Drawer/Drawer.d.ts +15 -2
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Fieldset/Fieldset.d.ts +16 -0
- package/dist/types/components/Fieldset/index.d.ts +2 -0
- package/dist/types/components/Highlight/Highlight.d.ts +27 -0
- package/dist/types/components/Highlight/index.d.ts +2 -0
- package/dist/types/components/Indicator/Indicator.d.ts +24 -0
- package/dist/types/components/Indicator/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +8 -2
- package/dist/types/components/Input/InputCore.d.ts +11 -2
- package/dist/types/components/List/List.d.ts +10 -1
- package/dist/types/components/LoadingOverlay/LoadingOverlay.d.ts +25 -0
- package/dist/types/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +11 -0
- package/dist/types/components/LogViewer/LogViewer.d.ts +10 -1
- package/dist/types/components/Mark/Mark.d.ts +12 -0
- package/dist/types/components/Mark/index.d.ts +2 -0
- package/dist/types/components/Menu/MenuItem.d.ts +15 -4
- package/dist/types/components/NumberFormatter/NumberFormatter.d.ts +23 -0
- package/dist/types/components/NumberFormatter/index.d.ts +2 -0
- package/dist/types/components/Resizable/Resizable.d.ts +24 -7
- package/dist/types/components/Resizable/index.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +23 -2
- package/dist/types/components/Select/SelectCore.d.ts +4 -1
- package/dist/types/components/Select/SelectFloating.d.ts +6 -1
- package/dist/types/components/Select/index.d.ts +1 -1
- package/dist/types/components/Sparkline/Sparkline.d.ts +31 -0
- package/dist/types/components/Sparkline/index.d.ts +3 -0
- package/dist/types/components/Sparkline/sparkline-styles.d.ts +26 -0
- package/dist/types/components/Spoiler/Spoiler.d.ts +20 -0
- package/dist/types/components/Spoiler/index.d.ts +2 -0
- package/dist/types/components/StatusBar/StatusBar.d.ts +18 -0
- package/dist/types/components/StatusBar/index.d.ts +3 -0
- package/dist/types/components/TabBar/TabBar.d.ts +23 -0
- package/dist/types/components/TabBar/index.d.ts +4 -0
- package/dist/types/components/Tabs/SortableTabList.d.ts +46 -0
- package/dist/types/components/Tabs/Tab.d.ts +54 -3
- package/dist/types/components/Tabs/TabList.d.ts +26 -2
- package/dist/types/components/Tabs/edge-scroll.d.ts +17 -0
- package/dist/types/components/Tabs/index.d.ts +3 -1
- package/dist/types/components/Tabs/tab-metas.d.ts +20 -0
- package/dist/types/components/TagGroup/SortableTagGroup.d.ts +5 -1
- package/dist/types/components/TagGroup/TagGroup.d.ts +24 -2
- package/dist/types/components/TagGroup/index.d.ts +1 -1
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Toast/useToast.d.ts +1 -1
- package/dist/types/components/VirtualList/VirtualList.d.ts +20 -1
- package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +4 -0
- package/dist/types/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/types/components/Workbench/Workbench.d.ts +50 -0
- package/dist/types/components/Workbench/index.d.ts +2 -0
- package/dist/types/dates/adapter.d.ts +33 -6
- package/dist/types/dates/buddhist.d.ts +14 -0
- package/dist/types/dates/ethiopic.d.ts +15 -0
- package/dist/types/dates/hebrew.d.ts +19 -0
- package/dist/types/dates/index.d.ts +5 -0
- package/dist/types/dates/japanese.d.ts +16 -0
- package/dist/types/dates/persian.d.ts +18 -0
- package/dist/types/dates/registry.d.ts +1 -1
- package/dist/types/headless/index.d.ts +9 -0
- package/dist/types/hooks/index.d.ts +13 -0
- package/dist/types/hooks/useBusyPressable.d.ts +33 -0
- package/dist/types/hooks/useElementSize.d.ts +38 -0
- package/dist/types/hooks/useIdle.d.ts +45 -0
- package/dist/types/hooks/useMutationObserver.d.ts +35 -0
- package/dist/types/hooks/useNetwork.d.ts +31 -0
- package/dist/types/hooks/useOrientation.d.ts +23 -0
- package/dist/types/hooks/useResizeObserver.d.ts +48 -0
- package/dist/types/index.d.ts +37 -9
- package/dist/types/utils/sortable.d.ts +8 -1
- package/dist/types/utils/use-end-reached.d.ts +56 -0
- package/dist/types/utils/viewport.d.ts +12 -0
- package/dist/utils/sortable-shared.js +3 -3
- package/dist/utils/sortable.js +15 -14
- package/dist/utils/use-end-reached.js +46 -0
- package/dist/utils/viewport.js +20 -0
- package/package.json +13 -5
- /package/dist/types/components/Toast/{toast.d.ts → toast-channel.d.ts} +0 -0
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import re from "
|
|
10
|
-
import ie from "../
|
|
11
|
-
import ae from "
|
|
12
|
-
import oe from "./
|
|
4
|
+
import { formatString as t } from "../LocaleProvider/locale.js";
|
|
5
|
+
import { useStrings as n } from "../LocaleProvider/useStrings.js";
|
|
6
|
+
import r from "../Spinner/Spinner.js";
|
|
7
|
+
import { useConfigDefaults as ee } from "../ConfigProvider/useConfigDefaults.js";
|
|
8
|
+
import { mergeRefs as te } from "../../utils/refs.js";
|
|
9
|
+
import { FloatingPanel as ne, useFloating as re } from "../../utils/floating.js";
|
|
10
|
+
import ie from "../Chip/Chip.js";
|
|
11
|
+
import ae from "../VirtualList/VirtualList.js";
|
|
12
|
+
import oe from "./ComboboxGroup.js";
|
|
13
|
+
import se from "./ComboboxOption.js";
|
|
13
14
|
/* empty css */
|
|
14
|
-
import { useCallback as
|
|
15
|
+
import { useCallback as ce, useEffect as i, useId as le, useMemo as ue, useRef as a, useState as o } from "react";
|
|
15
16
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
16
17
|
import { useControl as u } from "react-use-control";
|
|
17
18
|
//#region src/lib/components/Combobox/Combobox.tsx
|
|
18
|
-
var
|
|
19
|
-
function
|
|
19
|
+
var de = "haze-Combobox__wrapper", fe = "haze-Combobox__input", pe = "haze-Combobox__multiBox", me = "haze-Combobox__multiInput", d = "haze-Combobox__matchMark", f = "haze-Combobox__stateRow", he = "haze-Combobox__groupHeadingText", ge = "haze-Combobox__listbox", _e = "haze-Combobox__listboxVirtual", ve = 200, ye = 37, be = "haze-Combobox__virtualRow";
|
|
20
|
+
function xe(t, n) {
|
|
20
21
|
if (n === "") return t;
|
|
21
22
|
let r = t.toLowerCase().indexOf(n.toLowerCase());
|
|
22
23
|
return r < 0 ? t : /* @__PURE__ */ l(s, { children: [
|
|
@@ -29,28 +30,31 @@ function be(t, n) {
|
|
|
29
30
|
t.slice(r + n.length)
|
|
30
31
|
] });
|
|
31
32
|
}
|
|
32
|
-
function p({ value: s, open: d, options: p, multiple: m = !1, onValuesChange: h, creatable:
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
function p({ value: s, open: d, options: p, multiple: m = !1, onValuesChange: h, creatable: Se = !1, onCreate: Ce, onSearch: g, loading: _ = !1, empty: we, highlightMatches: Te = !1, maxHeight: v, placeholder: Ee, virtualThreshold: y = 100, virtualized: b, className: De, classNames: x, ref: S }) {
|
|
34
|
+
let C = ee("Combobox"), w = C.classNames ? {
|
|
35
|
+
...C.classNames,
|
|
36
|
+
...x
|
|
37
|
+
} : x, T = n("combobox"), [E, D] = u(s, m ? [] : ""), [O, Oe] = o([]), [k, A] = o(""), [j, M] = u(d, !1), [N, P] = o(-1), [ke, Ae] = o(k), F = le(), I = a(null), je = ce((e) => te(I, S)(e), [I, S]), L = a(null), R = a(null), Me = a(null), z = a(null), B = re({
|
|
38
|
+
open: j,
|
|
39
|
+
setOpen: M,
|
|
40
|
+
triggerRef: m ? L : I,
|
|
41
|
+
panelRef: R,
|
|
38
42
|
animated: !0
|
|
39
|
-
}),
|
|
40
|
-
if (
|
|
41
|
-
let e = new Set(p.map((e) => e.value)), t =
|
|
43
|
+
}), V = Array.isArray(E) ? E : [], H = ue(() => {
|
|
44
|
+
if (O.length === 0) return p;
|
|
45
|
+
let e = new Set(p.map((e) => e.value)), t = O.filter((t) => !e.has(t)).map((e) => ({
|
|
42
46
|
value: e,
|
|
43
47
|
label: e
|
|
44
48
|
}));
|
|
45
49
|
return t.length > 0 ? [...p, ...t] : p;
|
|
46
|
-
}, [p,
|
|
47
|
-
value:
|
|
48
|
-
label:
|
|
49
|
-
}, ...
|
|
50
|
-
for (let e = 0; e <
|
|
51
|
-
let t =
|
|
50
|
+
}, [p, O]), U = g ? H : H.filter((e) => e.label.toLowerCase().includes(k.toLowerCase())), W = Se && !_ && k.trim() !== "" && U.length === 0, G = k.trim(), Ne = t(T.create, { query: G }), K = W ? [{
|
|
51
|
+
value: G,
|
|
52
|
+
label: G
|
|
53
|
+
}, ...U] : U, q = typeof b == "object" ? b : void 0, J = (b === void 0 ? void 0 : !!b) ?? (y > 0 && K.length > y), Y = q?.itemHeight ?? ye, Pe = q?.overscan, X = (e) => `${F}-option-${e}`, Fe = j && K[N] ? X(N) : void 0, Z = [];
|
|
54
|
+
for (let e = 0; e < K.length; e++) {
|
|
55
|
+
let t = K[e];
|
|
52
56
|
if (t === void 0) continue;
|
|
53
|
-
let n =
|
|
57
|
+
let n = Z[Z.length - 1];
|
|
54
58
|
if (t.group !== void 0 && n?.label === t.group) {
|
|
55
59
|
n.rows.push({
|
|
56
60
|
option: t,
|
|
@@ -58,7 +62,7 @@ function p({ value: s, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
58
62
|
});
|
|
59
63
|
continue;
|
|
60
64
|
}
|
|
61
|
-
|
|
65
|
+
Z.push(t.group === void 0 ? {
|
|
62
66
|
key: `row-${t.value}`,
|
|
63
67
|
label: void 0,
|
|
64
68
|
rows: [{
|
|
@@ -74,150 +78,155 @@ function p({ value: s, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
74
78
|
}]
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
|
-
let
|
|
81
|
+
let Ie = Z.some((e) => e.label !== void 0);
|
|
78
82
|
i(() => {
|
|
79
|
-
if (!
|
|
80
|
-
if (
|
|
81
|
-
|
|
83
|
+
if (!B.shown || N < 0) return;
|
|
84
|
+
if (J) {
|
|
85
|
+
Me.current?.scrollToIndex(N, "auto");
|
|
82
86
|
return;
|
|
83
87
|
}
|
|
84
|
-
let e =
|
|
88
|
+
let e = z.current;
|
|
85
89
|
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
86
90
|
}, [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
J,
|
|
92
|
+
B.shown,
|
|
93
|
+
N
|
|
90
94
|
]);
|
|
91
|
-
let
|
|
95
|
+
let Q = a(g);
|
|
92
96
|
i(() => {
|
|
93
|
-
|
|
97
|
+
Q.current = g;
|
|
94
98
|
}, [g]);
|
|
95
|
-
let
|
|
99
|
+
let Le = a(k);
|
|
96
100
|
i(() => {
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
let
|
|
100
|
-
let n = t ??
|
|
101
|
+
Le.current !== k && (Le.current = k, Q.current?.(k));
|
|
102
|
+
}, [k]), k !== ke && (Ae(k), P(-1));
|
|
103
|
+
let Re = (e) => m ? V.includes(e) : E === e, ze = (e) => H.find((t) => t.value === e)?.label ?? e, Be = (e, t) => {
|
|
104
|
+
let n = t ?? H.find((t) => t.value === e)?.label ?? e;
|
|
101
105
|
if (m) {
|
|
102
|
-
let t =
|
|
103
|
-
|
|
104
|
-
} else
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
if (
|
|
110
|
-
|
|
106
|
+
let t = V.includes(e) ? V.filter((t) => t !== e) : [...V, e];
|
|
107
|
+
D(t), h?.(t), A("");
|
|
108
|
+
} else D(e), h?.(e), A(n), M(!1);
|
|
109
|
+
I.current?.focus();
|
|
110
|
+
}, Ve = () => {
|
|
111
|
+
Ce?.(G), Oe((e) => e.includes(G) ? e : [...e, G]), Be(G, G);
|
|
112
|
+
}, He = (e) => {
|
|
113
|
+
if (W && e === G) {
|
|
114
|
+
Ve();
|
|
111
115
|
return;
|
|
112
116
|
}
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
116
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
117
|
-
else if (e.key === "Enter" &&
|
|
118
|
-
else if (e.key === "Escape")
|
|
119
|
-
else if (e.key === "Backspace" && m &&
|
|
117
|
+
Be(e);
|
|
118
|
+
}, Ue = (e) => {
|
|
119
|
+
if (e.key === "ArrowDown") e.preventDefault(), M(!0), P((e) => Math.min(e + 1, K.length - 1));
|
|
120
|
+
else if (e.key === "ArrowUp") e.preventDefault(), M(!0), P((e) => Math.max(e - 1, 0));
|
|
121
|
+
else if (e.key === "Enter" && N >= 0 && K[N]) e.preventDefault(), He(K[N].value);
|
|
122
|
+
else if (e.key === "Escape") M(!1);
|
|
123
|
+
else if (e.key === "Backspace" && m && k === "" && V.length > 0) {
|
|
120
124
|
e.preventDefault();
|
|
121
|
-
let t =
|
|
122
|
-
|
|
125
|
+
let t = V.slice(0, -1);
|
|
126
|
+
D(t), h?.(t);
|
|
123
127
|
}
|
|
124
|
-
},
|
|
125
|
-
ref: !
|
|
126
|
-
value:
|
|
127
|
-
id:
|
|
128
|
-
setSize:
|
|
129
|
-
posInSet:
|
|
130
|
-
highlighted:
|
|
131
|
-
selected:
|
|
132
|
-
onSelect:
|
|
133
|
-
className:
|
|
134
|
-
children:
|
|
135
|
-
},
|
|
136
|
-
ref:
|
|
128
|
+
}, $ = (t, n, r) => /* @__PURE__ */ c(se, {
|
|
129
|
+
ref: !r && n === N ? z : void 0,
|
|
130
|
+
value: t.value,
|
|
131
|
+
id: X(n),
|
|
132
|
+
setSize: K.length,
|
|
133
|
+
posInSet: n + 1,
|
|
134
|
+
highlighted: n === N,
|
|
135
|
+
selected: Re(t.value),
|
|
136
|
+
onSelect: He,
|
|
137
|
+
className: e([r && be, w?.item]),
|
|
138
|
+
children: W && n === 0 ? Ne : Te ? xe(t.label, k) : t.label
|
|
139
|
+
}, t.value), We = /* @__PURE__ */ c("input", {
|
|
140
|
+
ref: je,
|
|
137
141
|
"data-slot": "input",
|
|
138
142
|
role: "combobox",
|
|
139
|
-
style: m ? void 0 :
|
|
140
|
-
"aria-expanded":
|
|
141
|
-
"aria-controls":
|
|
143
|
+
style: m ? void 0 : B.triggerStyle,
|
|
144
|
+
"aria-expanded": j,
|
|
145
|
+
"aria-controls": F,
|
|
142
146
|
"aria-autocomplete": "list",
|
|
143
|
-
"aria-activedescendant":
|
|
147
|
+
"aria-activedescendant": Fe,
|
|
144
148
|
"aria-busy": _ || void 0,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
placeholder: Te,
|
|
149
|
+
value: k,
|
|
150
|
+
placeholder: Ee,
|
|
148
151
|
onChange: (e) => {
|
|
149
|
-
|
|
152
|
+
A(e.target.value), M(!0);
|
|
150
153
|
},
|
|
151
|
-
onPointerDown: m ? void 0 :
|
|
152
|
-
onClick: m ? void 0 :
|
|
153
|
-
onKeyDown:
|
|
154
|
+
onPointerDown: m ? void 0 : B.onTriggerPointerDown,
|
|
155
|
+
onClick: m ? void 0 : B.onTriggerClick,
|
|
156
|
+
onKeyDown: Ue,
|
|
157
|
+
className: e([m ? me : fe, w?.input])
|
|
154
158
|
});
|
|
155
159
|
return /* @__PURE__ */ l("div", {
|
|
156
|
-
|
|
160
|
+
"data-slot": "combobox",
|
|
161
|
+
className: e([
|
|
162
|
+
de,
|
|
163
|
+
De,
|
|
164
|
+
w?.root
|
|
165
|
+
]),
|
|
157
166
|
children: [m ? /* @__PURE__ */ l("div", {
|
|
158
|
-
ref:
|
|
167
|
+
ref: L,
|
|
159
168
|
"data-slot": "trigger",
|
|
160
|
-
style:
|
|
161
|
-
onPointerDown:
|
|
169
|
+
style: B.triggerStyle,
|
|
170
|
+
onPointerDown: B.onTriggerPointerDown,
|
|
162
171
|
onClick: () => {
|
|
163
|
-
|
|
172
|
+
B.onTriggerClick(), I.current?.focus();
|
|
164
173
|
},
|
|
165
|
-
className: e(
|
|
166
|
-
children: [
|
|
174
|
+
className: e(pe),
|
|
175
|
+
children: [V.map((e) => /* @__PURE__ */ c("span", {
|
|
167
176
|
"data-slot": "item",
|
|
168
177
|
onClick: (e) => e.stopPropagation(),
|
|
169
|
-
children: /* @__PURE__ */ c(
|
|
178
|
+
children: /* @__PURE__ */ c(ie, {
|
|
170
179
|
color: "primary",
|
|
171
180
|
onClose: () => {
|
|
172
|
-
let t =
|
|
173
|
-
|
|
181
|
+
let t = V.filter((t) => t !== e);
|
|
182
|
+
D(t), h?.(t);
|
|
174
183
|
},
|
|
175
|
-
children:
|
|
184
|
+
children: ze(e)
|
|
176
185
|
})
|
|
177
|
-
}, e)),
|
|
178
|
-
}) :
|
|
179
|
-
ref:
|
|
180
|
-
behavior:
|
|
186
|
+
}, e)), We]
|
|
187
|
+
}) : We, /* @__PURE__ */ c(ne, {
|
|
188
|
+
ref: R,
|
|
189
|
+
behavior: B,
|
|
181
190
|
placement: "bottom-span",
|
|
182
|
-
id:
|
|
191
|
+
id: F,
|
|
183
192
|
role: "listbox",
|
|
184
193
|
"aria-multiselectable": m ? "true" : void 0,
|
|
185
|
-
visualClass:
|
|
186
|
-
style: v !== void 0 && !
|
|
194
|
+
visualClass: J ? _e : ge,
|
|
195
|
+
style: v !== void 0 && !J ? { maxHeight: `${v}px` } : void 0,
|
|
187
196
|
children: _ ? /* @__PURE__ */ c("div", {
|
|
188
197
|
role: "option",
|
|
189
198
|
"data-slot": "loading",
|
|
190
199
|
"aria-selected": !1,
|
|
191
200
|
"aria-disabled": "true",
|
|
192
201
|
className: e([f]),
|
|
193
|
-
children: /* @__PURE__ */ c(
|
|
194
|
-
}) :
|
|
202
|
+
children: /* @__PURE__ */ c(r, { size: "sm" })
|
|
203
|
+
}) : K.length === 0 ? /* @__PURE__ */ c("div", {
|
|
195
204
|
role: "option",
|
|
196
205
|
"data-slot": "empty",
|
|
197
206
|
"aria-selected": !1,
|
|
198
207
|
"aria-disabled": "true",
|
|
199
|
-
className: e([f]),
|
|
200
|
-
children:
|
|
201
|
-
}) :
|
|
202
|
-
ref:
|
|
208
|
+
className: e([f, w?.empty]),
|
|
209
|
+
children: we ?? T.noResults
|
|
210
|
+
}) : J ? /* @__PURE__ */ c(ae, {
|
|
211
|
+
ref: Me,
|
|
203
212
|
"data-virtualized": !0,
|
|
204
|
-
items:
|
|
205
|
-
height: Math.min(v ??
|
|
206
|
-
itemHeight:
|
|
207
|
-
overscan:
|
|
208
|
-
groups:
|
|
213
|
+
items: K,
|
|
214
|
+
height: Math.min(v ?? ve, K.length * Y),
|
|
215
|
+
itemHeight: Y,
|
|
216
|
+
overscan: Pe,
|
|
217
|
+
groups: Ie ? Z.filter((e) => e.label !== void 0).map((t) => ({
|
|
209
218
|
startIndex: t.rows[0]?.index ?? 0,
|
|
210
219
|
key: t.key,
|
|
211
220
|
render: () => /* @__PURE__ */ c("div", {
|
|
212
221
|
"data-slot": "group-label",
|
|
213
|
-
className: e([
|
|
222
|
+
className: e([he]),
|
|
214
223
|
children: t.label
|
|
215
224
|
})
|
|
216
225
|
})) : void 0,
|
|
217
|
-
renderItem: (e, t) =>
|
|
218
|
-
}) :
|
|
226
|
+
renderItem: (e, t) => $(e, t, !0)
|
|
227
|
+
}) : Z.flatMap((e) => e.label === void 0 ? e.rows.map(({ option: e, index: t }) => $(e, t, !1)) : [/* @__PURE__ */ c(oe, {
|
|
219
228
|
label: e.label,
|
|
220
|
-
children: e.rows.map(({ option: e, index: t }) =>
|
|
229
|
+
children: e.rows.map(({ option: e, index: t }) => $(e, t, !1))
|
|
221
230
|
}, e.key)])
|
|
222
231
|
})]
|
|
223
232
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
|
+
import { mergeRefs as n } from "../../utils/refs.js";
|
|
6
6
|
import { getEnabledMenuItems as r, useMenuKeyboard as i, useRovingTabindex as a } from "../../utils/menuKeyboard.js";
|
|
7
7
|
import o from "../Kbd/Kbd.js";
|
|
8
8
|
import { collectCommandItems as s, commandItemMatches as c } from "./command-filter.js";
|
|
@@ -47,13 +47,13 @@ function S({ query: t, shouldFilter: n = !0, onItemSelect: r, children: i, class
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
var C = "haze-Command__inputStyle";
|
|
50
|
-
function w({ placeholder:
|
|
50
|
+
function w({ placeholder: t, className: i, ref: a }) {
|
|
51
51
|
let { query: o, setQuery: s, inputRef: c, listRef: l } = b();
|
|
52
52
|
return /* @__PURE__ */ h("input", {
|
|
53
|
-
ref:
|
|
53
|
+
ref: n(c, a),
|
|
54
54
|
"data-slot": "input",
|
|
55
55
|
type: "text",
|
|
56
|
-
placeholder:
|
|
56
|
+
placeholder: t,
|
|
57
57
|
value: o,
|
|
58
58
|
onChange: (e) => s(e.target.value),
|
|
59
59
|
onKeyDown: (e) => {
|
|
@@ -66,8 +66,8 @@ function w({ placeholder: n, className: i, ref: a }) {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
var T = "haze-Command__listStyle", E = "haze-Command__emptyStyle";
|
|
69
|
-
function D({ children:
|
|
70
|
-
let { inputRef: l, listRef: u, listId: d, shouldFilter: f, query: p } = b(), m =
|
|
69
|
+
function D({ children: n, empty: r, className: o }) {
|
|
70
|
+
let { inputRef: l, listRef: u, listId: d, shouldFilter: f, query: p } = b(), m = t("command");
|
|
71
71
|
a({
|
|
72
72
|
menuRef: u,
|
|
73
73
|
active: !0,
|
|
@@ -77,7 +77,7 @@ function D({ children: t, empty: r, className: o }) {
|
|
|
77
77
|
menuRef: u,
|
|
78
78
|
selector: v,
|
|
79
79
|
onClose: () => l.current?.focus()
|
|
80
|
-
}), y = s(
|
|
80
|
+
}), y = s(n, M), x = f && y.length > 0 && !y.some((e) => c(e.props, p));
|
|
81
81
|
return /* @__PURE__ */ g("div", {
|
|
82
82
|
ref: u,
|
|
83
83
|
"data-slot": "list",
|
|
@@ -85,7 +85,7 @@ function D({ children: t, empty: r, className: o }) {
|
|
|
85
85
|
id: d,
|
|
86
86
|
onKeyDown: _,
|
|
87
87
|
className: e([T, o]),
|
|
88
|
-
children: [
|
|
88
|
+
children: [n, x && /* @__PURE__ */ h("div", {
|
|
89
89
|
"data-slot": "empty",
|
|
90
90
|
role: "option",
|
|
91
91
|
"aria-selected": !1,
|
|
@@ -23,6 +23,22 @@ function n(e, t) {
|
|
|
23
23
|
HoverCard: {
|
|
24
24
|
...e.HoverCard ?? {},
|
|
25
25
|
...t.HoverCard ?? {}
|
|
26
|
+
},
|
|
27
|
+
Drawer: {
|
|
28
|
+
...e.Drawer ?? {},
|
|
29
|
+
...t.Drawer ?? {}
|
|
30
|
+
},
|
|
31
|
+
Select: {
|
|
32
|
+
...e.Select ?? {},
|
|
33
|
+
...t.Select ?? {}
|
|
34
|
+
},
|
|
35
|
+
Combobox: {
|
|
36
|
+
...e.Combobox ?? {},
|
|
37
|
+
...t.Combobox ?? {}
|
|
38
|
+
},
|
|
39
|
+
TagGroup: {
|
|
40
|
+
...e.TagGroup ?? {},
|
|
41
|
+
...t.TagGroup ?? {}
|
|
26
42
|
}
|
|
27
43
|
};
|
|
28
44
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "./ConfirmDialog.js";
|
|
3
|
+
import { createElement as t } from "react";
|
|
4
|
+
import { flushSync as n } from "react-dom";
|
|
5
|
+
import { createRoot as r } from "react-dom/client";
|
|
6
|
+
//#region src/lib/components/ConfirmDialog/confirm.ts
|
|
7
|
+
function i(i) {
|
|
8
|
+
let { onConfirm: a, onCancel: o, children: s, ...c } = i;
|
|
9
|
+
return typeof document > "u" ? Promise.resolve(!1) : new Promise((i) => {
|
|
10
|
+
let l = document.createElement("div");
|
|
11
|
+
l.setAttribute("data-haze-confirm-host", ""), document.body.appendChild(l);
|
|
12
|
+
let u = r(l), d = !1, f = () => {
|
|
13
|
+
queueMicrotask(() => {
|
|
14
|
+
u.unmount(), l.remove();
|
|
15
|
+
});
|
|
16
|
+
}, p = (r, a) => {
|
|
17
|
+
d || (d = !0, a?.(), n(() => {
|
|
18
|
+
u.render(t(e, {
|
|
19
|
+
...c,
|
|
20
|
+
children: s,
|
|
21
|
+
open: !1,
|
|
22
|
+
onConfirm: () => void 0,
|
|
23
|
+
onCancel: () => void 0,
|
|
24
|
+
onClose: () => void 0
|
|
25
|
+
}));
|
|
26
|
+
}), f(), i(r));
|
|
27
|
+
};
|
|
28
|
+
n(() => {
|
|
29
|
+
u.render(t(e, {
|
|
30
|
+
...c,
|
|
31
|
+
children: s,
|
|
32
|
+
open: !0,
|
|
33
|
+
onConfirm: () => p(!0, a),
|
|
34
|
+
onCancel: () => p(!1, o),
|
|
35
|
+
onClose: () => p(!1, o)
|
|
36
|
+
}));
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { i as confirm };
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useEndReached as t } from "../../utils/use-end-reached.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
+
import { Children as n, useRef as r } from "react";
|
|
7
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
8
|
//#region src/lib/components/ConversationList/ConversationList.tsx
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
|
|
9
|
+
var a = "haze-ConversationList__list";
|
|
10
|
+
function o({ children: o, onLoadMore: s, className: c }) {
|
|
11
|
+
let l = r(null);
|
|
12
|
+
return t({
|
|
13
|
+
ref: l,
|
|
14
|
+
onEndReached: s,
|
|
15
|
+
threshold: 200,
|
|
16
|
+
contentUnits: n.count(o)
|
|
17
|
+
}), /* @__PURE__ */ i("div", {
|
|
18
|
+
ref: l,
|
|
10
19
|
"data-slot": "conversation-list",
|
|
11
|
-
className: e([
|
|
12
|
-
children:
|
|
20
|
+
className: e([a, c]),
|
|
21
|
+
children: o
|
|
13
22
|
});
|
|
14
23
|
}
|
|
15
24
|
//#endregion
|
|
16
|
-
export {
|
|
25
|
+
export { o as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import t from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
4
|
+
import { getDirection as t, useDirection as n } from "../../utils/direction.js";
|
|
5
|
+
import { useStrings as r } from "../LocaleProvider/useStrings.js";
|
|
6
|
+
import i from "../Input/Input.js";
|
|
7
7
|
import a from "../VirtualList/VirtualList.js";
|
|
8
8
|
import o from "../Checkbox/CheckboxCore.js";
|
|
9
9
|
import s from "../Skeleton/Skeleton.js";
|
|
@@ -59,7 +59,7 @@ function h(e) {
|
|
|
59
59
|
}
|
|
60
60
|
var xe = "calc(var(--haze-space-3) * 2 + var(--haze-space-5))", Se = "(var(--haze-space-3) * 2 + var(--haze-space-5))", Ce = 34, we = "haze-DataTable__root", Te = "haze-DataTable__scrollArea", Ee = "haze-DataTable__stickyScrollArea", De = "haze-DataTable__virtualArea", g = "haze-DataTable__fixedLayout", Oe = "haze-DataTable__virtualRowTable", _ = "haze-DataTable__tableBase", ke = "haze-DataTable__stickyHead", Ae = "haze-DataTable__sortButton", je = "haze-DataTable__sortIcon", Me = "haze-DataTable__rowHover", Ne = "haze-DataTable__rowSelected", Pe = "haze-DataTable__clickableRow", Fe = "haze-DataTable__checkCell", Ie = "haze-DataTable__checkCellCol", v = "haze-DataTable__fixedCell", y = "haze-DataTable__fixedCellSelected", b = "haze-DataTable__fixedHeadCell", x = "haze-DataTable__fixedLeftEdge", Le = "haze-DataTable__fixedRightEdge", Re = "haze-DataTable__emptyCell", ze = "haze-DataTable__footer", Be = "haze-DataTable__toolbar", Ve = "haze-DataTable__footerMenu", He = "haze-DataTable__columnsTrigger", Ue = "haze-DataTable__toggleRow", We = "haze-DataTable__resizableHead", Ge = "haze-DataTable__resizeHandle", Ke = "haze-DataTable__expander", qe = "haze-DataTable__expanderIcon", Je = "haze-DataTable__panelCell", Ye = "haze-DataTable__treeIndent", Xe = "haze-DataTable__summaryFoot", Ze = "haze-DataTable__stickyFoot", Qe = "haze-DataTable__editableCell";
|
|
61
61
|
function S({ columns: S, data: C, sortable: $e = !1, selectable: w = !1, rowSelection: et, sorting: T, pageSize: E, page: D, manual: O = !1, pageCount: tt, onPageChange: nt, onSortChange: rt, loading: k = !1, stickyHeader: it = !1, virtualized: A, getRowId: at, onRowClick: j, empty: ot, resizable: M = !1, expanded: st, getRowCanExpand: N, renderExpandedRow: P, subRowsKey: ct = "subRows", columnVisibility: lt, columnToggle: ut = !1, filterable: F = !1, summary: dt, stickyFooter: ft = !1, editable: pt = !1, onCellEdit: mt, className: ht, ...gt }) {
|
|
62
|
-
let _t = me(T), [vt, yt] = p(he(_t ? T : void 0, ge((e) => rt?.(e))), _t ? [] : T ?? []), [bt, xt] = p(et, {}), St = me(D), [Ct, wt, Tt] = p(he(St ? D : void 0, ge((e) => nt?.(e))), St ? 1 : D ?? 1), [Et, Dt] = p(st, {}), [Ot, kt] = p(lt, {}), [I, L] = fe(null), At =
|
|
62
|
+
let _t = me(T), [vt, yt] = p(he(_t ? T : void 0, ge((e) => rt?.(e))), _t ? [] : T ?? []), [bt, xt] = p(et, {}), St = me(D), [Ct, wt, Tt] = p(he(St ? D : void 0, ge((e) => nt?.(e))), St ? 1 : D ?? 1), [Et, Dt] = p(st, {}), [Ot, kt] = p(lt, {}), [I, L] = fe(null), At = n(), jt = le(), Mt = r("dataTable"), R = A === !0 || typeof A == "object", z = typeof A == "object" ? A.rowHeight : Ce, Nt = typeof A == "object" ? A.overscan : void 0, Pt = E ?? Infinity, Ft = N !== void 0 || P !== void 0, It = N === void 0 && P === void 0 && C.some((e) => {
|
|
63
63
|
let t = e[ct];
|
|
64
64
|
return Array.isArray(t) && t.length > 0;
|
|
65
65
|
}), Lt = ue(() => S.map((e) => ve(e, {
|
|
@@ -176,7 +176,7 @@ function S({ columns: S, data: C, sortable: $e = !1, selectable: w = !1, rowSele
|
|
|
176
176
|
t.target instanceof Element && t.target.closest("button, input, select, textarea, a") || j(e, t);
|
|
177
177
|
} : void 0, Jt = /* @__PURE__ */ d(c, {
|
|
178
178
|
className: it ? ke : void 0,
|
|
179
|
-
children: V.map((
|
|
179
|
+
children: V.map((n, r) => /* @__PURE__ */ f("tr", {
|
|
180
180
|
"data-slot": "row",
|
|
181
181
|
children: [w && r === 0 && /* @__PURE__ */ d(u, {
|
|
182
182
|
as: "th",
|
|
@@ -196,19 +196,19 @@ function S({ columns: S, data: C, sortable: $e = !1, selectable: w = !1, rowSele
|
|
|
196
196
|
"aria-label": Mt.selectAll
|
|
197
197
|
})
|
|
198
198
|
})
|
|
199
|
-
}),
|
|
200
|
-
if (
|
|
201
|
-
if (
|
|
199
|
+
}), n.headers.map((n) => {
|
|
200
|
+
if (n.rowSpan === 0) return null;
|
|
201
|
+
if (n.isPlaceholder) return /* @__PURE__ */ d(u, {
|
|
202
202
|
as: "th",
|
|
203
203
|
"data-slot": "cell",
|
|
204
204
|
children: null
|
|
205
|
-
},
|
|
206
|
-
let r =
|
|
205
|
+
}, n.placeholderId ?? n.id);
|
|
206
|
+
let r = n.column.getIsSorted(), i = n.subHeaders.length === 0 ? q.get(n.column.id) : void 0, a = M && n.subHeaders.length === 0 && n.column.getCanResize();
|
|
207
207
|
return /* @__PURE__ */ f(u, {
|
|
208
208
|
as: "th",
|
|
209
209
|
"data-slot": "cell",
|
|
210
|
-
colSpan:
|
|
211
|
-
rowSpan:
|
|
210
|
+
colSpan: n.colSpan > 1 ? n.colSpan : void 0,
|
|
211
|
+
rowSpan: n.rowSpan > 1 ? n.rowSpan : void 0,
|
|
212
212
|
style: h(i),
|
|
213
213
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : void 0,
|
|
214
214
|
className: e([
|
|
@@ -216,38 +216,38 @@ function S({ columns: S, data: C, sortable: $e = !1, selectable: w = !1, rowSele
|
|
|
216
216
|
i && b,
|
|
217
217
|
a && We
|
|
218
218
|
]),
|
|
219
|
-
children: [
|
|
219
|
+
children: [n.column.getCanSort() ? /* @__PURE__ */ f("button", {
|
|
220
220
|
type: "button",
|
|
221
221
|
"data-slot": "sort-button",
|
|
222
|
-
onClick:
|
|
222
|
+
onClick: n.column.getToggleSortingHandler(),
|
|
223
223
|
className: e([Ae]),
|
|
224
|
-
children: [/* @__PURE__ */ d(B.FlexRender, { header:
|
|
224
|
+
children: [/* @__PURE__ */ d(B.FlexRender, { header: n }), /* @__PURE__ */ d("span", {
|
|
225
225
|
"data-slot": "icon",
|
|
226
226
|
"aria-hidden": "true",
|
|
227
227
|
className: e([je]),
|
|
228
228
|
children: r === "asc" ? "↑" : r === "desc" ? "↓" : "↕"
|
|
229
229
|
})]
|
|
230
|
-
}) : /* @__PURE__ */ d(B.FlexRender, { header:
|
|
230
|
+
}) : /* @__PURE__ */ d(B.FlexRender, { header: n }), a && /* @__PURE__ */ d("div", {
|
|
231
231
|
role: "separator",
|
|
232
232
|
"data-slot": "resize-handle",
|
|
233
233
|
"aria-orientation": "vertical",
|
|
234
|
-
"aria-label": `Resize ${m(
|
|
234
|
+
"aria-label": `Resize ${m(n.column)}`,
|
|
235
235
|
tabIndex: 0,
|
|
236
236
|
onMouseDown: (e) => {
|
|
237
|
-
e.preventDefault(),
|
|
237
|
+
e.preventDefault(), n.getResizeHandler()(e);
|
|
238
238
|
},
|
|
239
|
-
onDoubleClick: () =>
|
|
239
|
+
onDoubleClick: () => n.column.resetSize(),
|
|
240
240
|
onKeyDown: (e) => {
|
|
241
241
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
242
242
|
e.preventDefault();
|
|
243
|
-
let r =
|
|
244
|
-
Kt(
|
|
243
|
+
let r = t(e.currentTarget) === "rtl", i = e.key === "ArrowRight" !== r;
|
|
244
|
+
Kt(n, i ? 5 : -5);
|
|
245
245
|
},
|
|
246
246
|
className: e([Ge])
|
|
247
247
|
})]
|
|
248
|
-
},
|
|
248
|
+
}, n.id);
|
|
249
249
|
})]
|
|
250
|
-
},
|
|
250
|
+
}, n.id))
|
|
251
251
|
}), Yt = (e) => `${jt}-${e.replace(/\s+/g, "-")}-panel`, X = (t) => /* @__PURE__ */ f(se, { children: [/* @__PURE__ */ f("tr", {
|
|
252
252
|
"data-slot": "row",
|
|
253
253
|
onClick: qt ? (e) => qt(t.original, e) : void 0,
|
|
@@ -377,7 +377,7 @@ function S({ columns: S, data: C, sortable: $e = !1, selectable: w = !1, rowSele
|
|
|
377
377
|
children: null
|
|
378
378
|
}), H.map((e) => /* @__PURE__ */ d(u, {
|
|
379
379
|
"data-slot": "cell",
|
|
380
|
-
children: e.column.getCanFilter() ? /* @__PURE__ */ d(
|
|
380
|
+
children: e.column.getCanFilter() ? /* @__PURE__ */ d(i, {
|
|
381
381
|
size: "sm",
|
|
382
382
|
"aria-label": `Filter ${m(e.column)}`,
|
|
383
383
|
placeholder: Mt.filterPlaceholder,
|