haze-ui 1.31.0 → 1.33.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 +87 -1178
- package/dist/coi-serviceworker.LICENSE +21 -0
- package/dist/coi-serviceworker.js +118 -0
- 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/Countdown/Countdown.js +49 -0
- package/dist/components/Countdown/index.js +3 -0
- 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/HoverCard/HoverCard.js +63 -43
- package/dist/components/ImageCrop/ImageCrop.js +188 -0
- package/dist/components/ImageCrop/image-crop-geometry.js +81 -0
- package/dist/components/ImageCrop/index.js +3 -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/LoadingOverlay/LoadingOverlay.js +30 -0
- package/dist/components/LoadingOverlay/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +10 -0
- package/dist/components/LocaleProvider/de-de.js +10 -0
- package/dist/components/LocaleProvider/es-es.js +10 -0
- package/dist/components/LocaleProvider/fr-fr.js +10 -0
- package/dist/components/LocaleProvider/it-it.js +10 -0
- package/dist/components/LocaleProvider/ja-jp.js +10 -0
- package/dist/components/LocaleProvider/ko-kr.js +10 -0
- package/dist/components/LocaleProvider/locale.js +10 -0
- package/dist/components/LocaleProvider/pt-br.js +10 -0
- package/dist/components/LocaleProvider/ru-ru.js +10 -0
- package/dist/components/LocaleProvider/zh-cn.js +10 -0
- 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 +6 -6
- package/dist/components/PasswordInput/PasswordInputCore.js +27 -26
- package/dist/components/Rating/RatingCore.js +18 -18
- package/dist/components/Resizable/index.js +1 -1
- 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/Splitter/Splitter.js +199 -0
- package/dist/components/Splitter/index.js +3 -0
- package/dist/components/Spoiler/Spoiler.js +36 -0
- package/dist/components/Spoiler/index.js +3 -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/TagInputCore.js +10 -10
- package/dist/components/TimePicker/TimePickerPanel.js +3 -3
- package/dist/components/Toast/ToastContainer.js +4 -4
- package/dist/components/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/VisuallyHidden/VisuallyHidden.js +15 -0
- package/dist/components/VisuallyHidden/index.js +2 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/activity-rail.css +2 -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 +2 -0
- 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 +2 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/css/confirm-dialog.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/context-menu.css +2 -0
- package/dist/css/conversation-list.css +2 -0
- package/dist/css/count-up.css +2 -0
- package/dist/css/countdown.css +4 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-range-picker.css +2 -0
- 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 +2 -0
- package/dist/css/dropdown-menu.css +2 -0
- 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 +2 -0
- package/dist/css/icon.css +2 -0
- package/dist/css/image-crop.css +4 -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 +2 -0
- 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 +3 -1
- 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 +2 -0
- 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 +2 -0
- package/dist/css/rating.css +2 -0
- package/dist/css/resizable.css +2 -0
- package/dist/css/result.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/segmented.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/sidebar.css +2 -0
- package/dist/css/signature.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +2 -0
- package/dist/css/sources.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/spinner.css +2 -0
- package/dist/css/splitter.css +4 -0
- package/dist/css/spoiler.css +4 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/status-bar.css +2 -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 +2 -0
- package/dist/css/tab-bar.css +2 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +2 -0
- package/dist/css/tag-group.css +2 -0
- package/dist/css/tag-input.css +2 -0
- package/dist/css/tag.css +2 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/css-manifest.json +190 -4
- package/dist/haze-ui.css +417 -5
- package/dist/headless/index.js +18 -17
- package/dist/hooks/useBusyPressable.js +10 -0
- package/dist/hooks/useHotkeys.js +78 -24
- package/dist/index.js +277 -264
- package/dist/mcp-docs.json +728 -32
- package/dist/registry.json +212 -14
- package/dist/robots.txt +4 -0
- package/dist/sitemap.xml +160 -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 +22 -1
- 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/Countdown/Countdown.d.ts +30 -0
- package/dist/types/components/Countdown/index.d.ts +2 -0
- 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/HoverCard/HoverCard.d.ts +18 -1
- package/dist/types/components/ImageCrop/ImageCrop.d.ts +67 -0
- package/dist/types/components/ImageCrop/image-crop-geometry.d.ts +65 -0
- package/dist/types/components/ImageCrop/index.d.ts +3 -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/LoadingOverlay/LoadingOverlay.d.ts +25 -0
- package/dist/types/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +10 -0
- 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/index.d.ts +0 -2
- 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/Splitter/Splitter.d.ts +33 -0
- package/dist/types/components/Splitter/index.d.ts +2 -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/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/VisuallyHidden/VisuallyHidden.d.ts +4 -0
- package/dist/types/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/types/headless/index.d.ts +16 -6
- 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/useHotkeys.d.ts +16 -4
- 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 +31 -8
- package/package.json +24 -5
|
@@ -1,24 +1,24 @@
|
|
|
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 te from "
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { filterSelectEntries as
|
|
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 { mergeRefs as ee } from "../../utils/refs.js";
|
|
8
|
+
import { FloatingPanel as te, useFloating as ne } from "../../utils/floating.js";
|
|
9
|
+
import re from "../Chip/Chip.js";
|
|
10
|
+
import ie from "../VirtualList/VirtualList.js";
|
|
11
|
+
import { filterSelectEntries as ae, flattenSelectEntries as i, selectOptionText as oe } from "./select-options.js";
|
|
12
12
|
/* empty css */
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { useControl as
|
|
13
|
+
import { useCallback as se, useEffect as a, useId as ce, useRef as o, useState as s } from "react";
|
|
14
|
+
import { Fragment as le, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
15
|
+
import { useControl as ue } from "react-use-control";
|
|
16
16
|
//#region src/lib/components/Select/SelectFloating.tsx
|
|
17
|
-
var
|
|
17
|
+
var de = "haze-SelectFloating__wrapper", fe = "haze-SelectFloating__trigger", pe = {
|
|
18
18
|
sm: "haze-SelectFloating__sm",
|
|
19
19
|
md: "haze-SelectFloating__md",
|
|
20
20
|
lg: "haze-SelectFloating__lg"
|
|
21
|
-
},
|
|
21
|
+
}, u = "haze-SelectFloating__placeholderText", me = "haze-SelectFloating__triggerLabel", he = "haze-SelectFloating__chipItem", ge = "haze-SelectFloating__chipRemove", _e = "haze-SelectFloating__overflowBadge", ve = "haze-SelectFloating__clearBtn", ye = "haze-SelectFloating__caret", be = "haze-SelectFloating__listbox", xe = "haze-SelectFloating__listboxVirtual", Se = "haze-SelectFloating__panelSearch", Ce = "haze-SelectFloating__listboxInner", we = "haze-SelectFloating__searchInput", Te = "haze-SelectFloating__loadingBlock", Ee = "haze-SelectFloating__emptyBlock", d = "haze-SelectFloating__groupLabelText", De = "haze-SelectFloating__groupLabelRow", Oe = 200, ke = 29, Ae = "haze-SelectFloating__virtualRow", je = "haze-SelectFloating__optionRow", Me = "haze-SelectFloating__optionActive", Ne = "haze-SelectFloating__optionSelected", Pe = "haze-SelectFloating__checkboxVisual", Fe = "haze-SelectFloating__checkboxChecked", Ie = () => /* @__PURE__ */ c("svg", {
|
|
22
22
|
viewBox: "0 0 12 12",
|
|
23
23
|
width: "12",
|
|
24
24
|
height: "12",
|
|
@@ -29,244 +29,248 @@ var ue = "haze-SelectFloating__wrapper", de = "haze-SelectFloating__trigger", fe
|
|
|
29
29
|
strokeLinejoin: "round",
|
|
30
30
|
"aria-hidden": "true",
|
|
31
31
|
focusable: "false",
|
|
32
|
-
children:
|
|
32
|
+
children: c("path", { d: "M2 4l4 4 4-4" })
|
|
33
33
|
});
|
|
34
|
-
function f({ value: f, onChange: p, entries: m, multiple: h, placeholder: g, searchable: _ = !1, clearable: v = !1, loading: y = !1, onSearch: b, maxTagCount: x, size: Le = "md", virtualized: S, className: Re,
|
|
35
|
-
let
|
|
36
|
-
open:
|
|
37
|
-
setOpen:
|
|
38
|
-
triggerRef:
|
|
39
|
-
panelRef:
|
|
34
|
+
function f({ value: f, onChange: p, entries: m, multiple: h, placeholder: g, searchable: _ = !1, clearable: v = !1, loading: y = !1, onSearch: b, maxTagCount: x, size: Le = "md", virtualized: S, className: Re, classNames: C, ref: w, ...ze }) {
|
|
35
|
+
let T = n("select"), E = h && Array.isArray(f) ? f : [], D = !h && typeof f == "string" ? f : "", [O, k] = ue(void 0, !1), [A, j] = s(-1), [M, N] = s(""), [Be, Ve] = s(M), P = ce(), F = o(null), He = se((e) => ee(F, w)(e), [F, w]), I = o(null), Ue = o(null), We = o(null), Ge = o(null), L = S !== void 0 && S !== !1, Ke = typeof S == "object" ? S : void 0, R = Ke?.itemHeight ?? ke, qe = Ke?.overscan, z = ne({
|
|
36
|
+
open: O,
|
|
37
|
+
setOpen: k,
|
|
38
|
+
triggerRef: F,
|
|
39
|
+
panelRef: I,
|
|
40
40
|
animated: !0
|
|
41
|
-
}),
|
|
41
|
+
}), Je = i(m), B = y ? [] : b ? m : ae(m, M), V = i(B), H = B.reduce((e, t) => ({
|
|
42
42
|
offsets: [...e.offsets, e.flat],
|
|
43
43
|
flat: e.flat + (t.kind === "group" ? t.options.length : 1)
|
|
44
44
|
}), {
|
|
45
45
|
offsets: [],
|
|
46
46
|
flat: 0
|
|
47
|
-
}).offsets,
|
|
48
|
-
|
|
49
|
-
if (!
|
|
50
|
-
if (
|
|
51
|
-
|
|
47
|
+
}).offsets, U = (e) => `${P}-option-${e}`, W = O && V[A] ? U(A) : void 0, G = `${P}-listbox`;
|
|
48
|
+
a(() => {
|
|
49
|
+
if (!z.shown || A < 0) return;
|
|
50
|
+
if (L) {
|
|
51
|
+
Ge.current?.scrollToIndex(A, "auto");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
let e =
|
|
54
|
+
let e = We.current;
|
|
55
55
|
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
56
56
|
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
]),
|
|
61
|
-
_ &&
|
|
57
|
+
z.shown,
|
|
58
|
+
A,
|
|
59
|
+
L
|
|
60
|
+
]), a(() => {
|
|
61
|
+
_ && O && z.shown && Ue.current?.focus();
|
|
62
62
|
}, [
|
|
63
63
|
_,
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
O,
|
|
65
|
+
z.shown
|
|
66
66
|
]);
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
let K = o(b);
|
|
68
|
+
a(() => {
|
|
69
|
+
K.current = b;
|
|
70
70
|
}, [b]);
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
let
|
|
76
|
-
p(
|
|
77
|
-
},
|
|
78
|
-
p(
|
|
79
|
-
},
|
|
71
|
+
let q = o(M);
|
|
72
|
+
a(() => {
|
|
73
|
+
q.current !== M && (q.current = M, K.current?.(M));
|
|
74
|
+
}, [M]), !O && M !== "" && N(""), M !== Be && (Ve(M), j(V.length > 0 ? 0 : -1));
|
|
75
|
+
let Ye = (e) => {
|
|
76
|
+
p(E.includes(e) ? E.filter((t) => t !== e) : [...E, e]);
|
|
77
|
+
}, Xe = (e) => {
|
|
78
|
+
p(E.filter((t) => t !== e));
|
|
79
|
+
}, J = (e) => Je.find((t) => t.value === e)?.label ?? e, Y = () => {
|
|
80
80
|
p(h ? [] : "");
|
|
81
81
|
}, X = (e) => {
|
|
82
82
|
if (h) {
|
|
83
|
-
|
|
83
|
+
Ye(e);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
p(e),
|
|
87
|
-
},
|
|
88
|
-
|
|
86
|
+
p(e), k(!1), F.current?.focus();
|
|
87
|
+
}, Z = (e) => {
|
|
88
|
+
j((t) => e === 1 ? Math.min(t + 1, V.length - 1) : Math.max(t - 1, 0));
|
|
89
89
|
}, Ze = (e) => {
|
|
90
|
-
|
|
90
|
+
j(V.length === 0 ? -1 : e === "Home" ? 0 : V.length - 1);
|
|
91
91
|
}, Qe = (e) => {
|
|
92
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
92
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), k(!0), Z(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), k(!0), Ze(e.key)) : (e.key === "Enter" || e.key === " " || e.key === "Space") && O && V[A] ? (e.preventDefault(), X(V[A].value)) : e.key === "Escape" ? k(!1) : e.key === "Backspace" && (h && E.length > 0 ? (e.preventDefault(), p(E.slice(0, -1))) : !h && v && D !== "" && (e.preventDefault(), Y()));
|
|
93
93
|
}, $e = (e) => {
|
|
94
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
95
|
-
},
|
|
96
|
-
let r = h ?
|
|
97
|
-
return /* @__PURE__ */
|
|
94
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), Z(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Ze(e.key)) : e.key === "Enter" ? (e.preventDefault(), V[A] && X(V[A].value)) : e.key === "Escape" && (e.preventDefault(), k(!1), F.current?.focus());
|
|
95
|
+
}, Q = (t, n) => {
|
|
96
|
+
let r = h ? E.includes(t.value) : t.value === D;
|
|
97
|
+
return /* @__PURE__ */ l("div", {
|
|
98
98
|
"data-slot": "option",
|
|
99
|
-
ref: n ===
|
|
99
|
+
ref: n === A ? We : void 0,
|
|
100
100
|
role: "option",
|
|
101
|
-
id:
|
|
101
|
+
id: U(n),
|
|
102
102
|
"aria-selected": r,
|
|
103
|
-
"aria-setsize":
|
|
103
|
+
"aria-setsize": V.length,
|
|
104
104
|
"aria-posinset": n + 1,
|
|
105
105
|
onClick: () => X(t.value),
|
|
106
106
|
className: e([
|
|
107
107
|
je,
|
|
108
|
-
n ===
|
|
108
|
+
n === A && Me,
|
|
109
109
|
!h && r && Ne,
|
|
110
|
-
|
|
110
|
+
L && Ae,
|
|
111
|
+
C?.option
|
|
111
112
|
]),
|
|
112
|
-
children: [h && /* @__PURE__ */
|
|
113
|
+
children: [h && /* @__PURE__ */ c("span", {
|
|
113
114
|
"aria-hidden": "true",
|
|
114
115
|
"data-slot": "indicator",
|
|
115
116
|
className: e([Pe, r && Fe])
|
|
116
117
|
}), t.label]
|
|
117
118
|
}, t.value);
|
|
118
|
-
}, et = v && (h ?
|
|
119
|
+
}, et = v && (h ? E.length > 0 : D !== "") ? /* @__PURE__ */ c("span", {
|
|
119
120
|
"aria-hidden": "true",
|
|
120
121
|
"data-slot": "clear-button",
|
|
121
|
-
title:
|
|
122
|
+
title: T.clear,
|
|
122
123
|
onClick: (e) => {
|
|
123
|
-
e.stopPropagation(),
|
|
124
|
+
e.stopPropagation(), Y(), F.current?.focus();
|
|
124
125
|
},
|
|
125
|
-
className: e(
|
|
126
|
+
className: e([ve, C?.clearButton]),
|
|
126
127
|
children: "×"
|
|
127
|
-
}) : void 0, tt = h ?
|
|
128
|
+
}) : void 0, tt = h ? E.length === 0 ? /* @__PURE__ */ c("span", {
|
|
128
129
|
"data-slot": "placeholder",
|
|
129
|
-
className: e(
|
|
130
|
-
children: g ??
|
|
131
|
-
}) : /* @__PURE__ */
|
|
130
|
+
className: e(u),
|
|
131
|
+
children: g ?? T.placeholder
|
|
132
|
+
}) : /* @__PURE__ */ l(le, { children: [(x === void 0 ? E : E.slice(0, Math.max(x, 0))).map((t) => /* @__PURE__ */ l("span", {
|
|
132
133
|
"data-slot": "item",
|
|
133
|
-
className: e(
|
|
134
|
-
children: [/* @__PURE__ */
|
|
134
|
+
className: e([he, C?.item]),
|
|
135
|
+
children: [/* @__PURE__ */ c(re, {
|
|
135
136
|
color: "primary",
|
|
136
|
-
children:
|
|
137
|
-
}), /* @__PURE__ */
|
|
137
|
+
children: J(t)
|
|
138
|
+
}), /* @__PURE__ */ c("span", {
|
|
138
139
|
"aria-hidden": "true",
|
|
139
140
|
"data-slot": "item-remove",
|
|
140
141
|
onClick: (e) => {
|
|
141
|
-
e.stopPropagation(),
|
|
142
|
+
e.stopPropagation(), Xe(t);
|
|
142
143
|
},
|
|
143
|
-
className: e(
|
|
144
|
+
className: e(ge),
|
|
144
145
|
children: "×"
|
|
145
146
|
})]
|
|
146
|
-
}, t)), x !== void 0 &&
|
|
147
|
+
}, t)), x !== void 0 && E.length > Math.max(x, 0) && /* @__PURE__ */ c("span", {
|
|
147
148
|
"data-slot": "overflow-badge",
|
|
148
|
-
title:
|
|
149
|
-
className: e(
|
|
150
|
-
children:
|
|
151
|
-
})] }) :
|
|
149
|
+
title: E.slice(Math.max(x, 0)).map((e) => oe(J(e))).join(", "),
|
|
150
|
+
className: e(_e),
|
|
151
|
+
children: t(T.moreTags, { count: E.length - Math.max(x, 0) })
|
|
152
|
+
})] }) : D === "" ? /* @__PURE__ */ c("span", {
|
|
152
153
|
"data-slot": "placeholder",
|
|
153
|
-
className: e(
|
|
154
|
-
children: g ??
|
|
155
|
-
}) : /* @__PURE__ */
|
|
154
|
+
className: e(u),
|
|
155
|
+
children: g ?? T.placeholder
|
|
156
|
+
}) : /* @__PURE__ */ c("span", {
|
|
156
157
|
"data-slot": "value",
|
|
157
|
-
className: e(
|
|
158
|
-
children:
|
|
159
|
-
}),
|
|
160
|
-
ref:
|
|
158
|
+
className: e(me),
|
|
159
|
+
children: J(D)
|
|
160
|
+
}), $ = !y && V.length > 0, nt = L ? /* @__PURE__ */ c(ie, {
|
|
161
|
+
ref: Ge,
|
|
161
162
|
"data-virtualized": !0,
|
|
162
|
-
items:
|
|
163
|
-
groups:
|
|
164
|
-
startIndex:
|
|
165
|
-
key: `group-${t.label}-${
|
|
166
|
-
render: () => /* @__PURE__ */
|
|
163
|
+
items: V,
|
|
164
|
+
groups: B.some((e) => e.kind === "group") ? B.flatMap((t, n) => t.kind === "group" ? [{
|
|
165
|
+
startIndex: H[n] ?? 0,
|
|
166
|
+
key: `group-${t.label}-${H[n] ?? 0}`,
|
|
167
|
+
render: () => /* @__PURE__ */ c("div", {
|
|
167
168
|
"data-slot": "group-label",
|
|
168
|
-
className: e(
|
|
169
|
+
className: e(d),
|
|
169
170
|
children: t.label
|
|
170
171
|
})
|
|
171
172
|
}] : []) : void 0,
|
|
172
|
-
height: Math.min(Oe,
|
|
173
|
-
itemHeight:
|
|
174
|
-
overscan:
|
|
175
|
-
renderItem:
|
|
176
|
-
}) :
|
|
177
|
-
let r =
|
|
178
|
-
return t.kind === "option" ?
|
|
173
|
+
height: Math.min(Oe, V.length * R),
|
|
174
|
+
itemHeight: R,
|
|
175
|
+
overscan: qe,
|
|
176
|
+
renderItem: Q
|
|
177
|
+
}) : B.map((t, n) => {
|
|
178
|
+
let r = H[n] ?? 0;
|
|
179
|
+
return t.kind === "option" ? Q(t.option, r) : /* @__PURE__ */ l("div", {
|
|
179
180
|
"data-slot": "group",
|
|
180
181
|
role: "group",
|
|
181
182
|
"aria-label": t.label,
|
|
182
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ c("div", {
|
|
183
184
|
"data-slot": "group-label",
|
|
184
|
-
className: e([De,
|
|
185
|
+
className: e([De, d]),
|
|
185
186
|
children: t.label
|
|
186
|
-
}), t.options.map((e, t) =>
|
|
187
|
+
}), t.options.map((e, t) => Q(e, r + t))]
|
|
187
188
|
}, `group-${t.label}`);
|
|
188
|
-
}),
|
|
189
|
+
}), rt = y ? /* @__PURE__ */ l("div", {
|
|
189
190
|
"data-slot": "loading",
|
|
190
|
-
className: e(we),
|
|
191
|
-
children: [/* @__PURE__ */ l(ne, { size: "sm" }), /* @__PURE__ */ l("span", { children: w.loading })]
|
|
192
|
-
}) : /* @__PURE__ */ l("div", {
|
|
193
|
-
"data-slot": "empty",
|
|
194
191
|
className: e(Te),
|
|
195
|
-
children:
|
|
192
|
+
children: [/* @__PURE__ */ c(r, { size: "sm" }), /* @__PURE__ */ c("span", { children: T.loading })]
|
|
193
|
+
}) : /* @__PURE__ */ c("div", {
|
|
194
|
+
"data-slot": "empty",
|
|
195
|
+
className: e(Ee),
|
|
196
|
+
children: T.noMatch
|
|
196
197
|
});
|
|
197
|
-
return /* @__PURE__ */
|
|
198
|
-
className: e(
|
|
199
|
-
children: [/* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ l("div", {
|
|
199
|
+
className: e(de),
|
|
200
|
+
children: [/* @__PURE__ */ l("button", {
|
|
200
201
|
...ze,
|
|
201
202
|
ref: He,
|
|
202
203
|
"data-slot": "trigger",
|
|
203
204
|
type: "button",
|
|
204
|
-
style:
|
|
205
|
+
style: z.triggerStyle,
|
|
205
206
|
role: "combobox",
|
|
206
207
|
"aria-haspopup": "listbox",
|
|
207
|
-
"aria-expanded":
|
|
208
|
-
"aria-controls": _ ?
|
|
209
|
-
"aria-activedescendant":
|
|
208
|
+
"aria-expanded": O,
|
|
209
|
+
"aria-controls": _ ? G : P,
|
|
210
|
+
"aria-activedescendant": W,
|
|
210
211
|
"data-clearable": v || void 0,
|
|
211
|
-
onPointerDown:
|
|
212
|
-
onClick:
|
|
212
|
+
onPointerDown: z.onTriggerPointerDown,
|
|
213
|
+
onClick: z.onTriggerClick,
|
|
213
214
|
onKeyDown: Qe,
|
|
214
215
|
className: e([
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
Re
|
|
216
|
+
fe,
|
|
217
|
+
pe[Le],
|
|
218
|
+
Re,
|
|
219
|
+
C?.trigger
|
|
218
220
|
]),
|
|
219
221
|
children: [
|
|
220
222
|
tt,
|
|
221
223
|
et,
|
|
222
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ c("span", {
|
|
223
225
|
"data-slot": "icon",
|
|
224
226
|
"aria-hidden": "true",
|
|
225
|
-
className: e(
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
+
className: e(ye),
|
|
228
|
+
children: /* @__PURE__ */ c(Ie, {})
|
|
227
229
|
})
|
|
228
230
|
]
|
|
229
|
-
}), _ ? /* @__PURE__ */
|
|
230
|
-
ref:
|
|
231
|
-
behavior:
|
|
231
|
+
}), _ ? /* @__PURE__ */ l(te, {
|
|
232
|
+
ref: I,
|
|
233
|
+
behavior: z,
|
|
232
234
|
placement: "bottom-span",
|
|
233
235
|
"aria-busy": y || void 0,
|
|
234
|
-
visualClass:
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
visualClass: Se,
|
|
237
|
+
className: C?.content,
|
|
238
|
+
children: [/* @__PURE__ */ c("input", {
|
|
239
|
+
ref: Ue,
|
|
237
240
|
"data-slot": "input",
|
|
238
241
|
type: "text",
|
|
239
|
-
"aria-label":
|
|
240
|
-
placeholder:
|
|
241
|
-
|
|
242
|
-
"aria-controls":
|
|
242
|
+
"aria-label": T.searchLabel,
|
|
243
|
+
placeholder: T.searchPlaceholder,
|
|
244
|
+
...$ && {
|
|
245
|
+
"aria-controls": G,
|
|
243
246
|
"aria-autocomplete": "list"
|
|
244
247
|
},
|
|
245
|
-
"aria-activedescendant":
|
|
246
|
-
value:
|
|
247
|
-
onChange: (e) =>
|
|
248
|
+
"aria-activedescendant": W,
|
|
249
|
+
value: M,
|
|
250
|
+
onChange: (e) => N(e.target.value),
|
|
248
251
|
onKeyDown: $e,
|
|
249
|
-
className: e(
|
|
250
|
-
}),
|
|
251
|
-
id:
|
|
252
|
+
className: e([we, C?.searchInput])
|
|
253
|
+
}), $ ? /* @__PURE__ */ c("div", {
|
|
254
|
+
id: G,
|
|
252
255
|
"data-slot": "list",
|
|
253
256
|
role: "listbox",
|
|
254
257
|
"aria-multiselectable": h || void 0,
|
|
255
|
-
"aria-label":
|
|
256
|
-
className: e(
|
|
258
|
+
"aria-label": T.listboxLabel,
|
|
259
|
+
className: e(L ? void 0 : Ce),
|
|
257
260
|
children: nt
|
|
258
|
-
}) :
|
|
259
|
-
}) : /* @__PURE__ */
|
|
260
|
-
ref:
|
|
261
|
-
behavior:
|
|
261
|
+
}) : rt]
|
|
262
|
+
}) : /* @__PURE__ */ c(te, {
|
|
263
|
+
ref: I,
|
|
264
|
+
behavior: z,
|
|
262
265
|
placement: "bottom-span",
|
|
263
|
-
id:
|
|
264
|
-
role:
|
|
265
|
-
"aria-multiselectable":
|
|
266
|
-
"aria-label":
|
|
266
|
+
id: P,
|
|
267
|
+
role: $ ? "listbox" : void 0,
|
|
268
|
+
"aria-multiselectable": $ && h ? "true" : void 0,
|
|
269
|
+
"aria-label": T.listboxLabel,
|
|
267
270
|
"aria-busy": y || void 0,
|
|
268
|
-
visualClass:
|
|
269
|
-
|
|
271
|
+
visualClass: L ? xe : be,
|
|
272
|
+
className: C?.content,
|
|
273
|
+
children: $ ? nt : rt
|
|
270
274
|
})]
|
|
271
275
|
});
|
|
272
276
|
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { getDirection as t } from "../../utils/direction.js";
|
|
5
|
+
import { useStrings as n } from "../LocaleProvider/useStrings.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { Children as r, cloneElement as i, createContext as a, isValidElement as o, useContext as s, useRef as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { isControl as d, useControl as ee, useThru as f, watch as p } from "react-use-control";
|
|
10
|
+
//#region src/lib/components/Splitter/Splitter.tsx
|
|
11
|
+
var m = a(null);
|
|
12
|
+
function h() {
|
|
13
|
+
if (s(m) === null) throw Error("SplitterPane must be used within <Splitter>");
|
|
14
|
+
}
|
|
15
|
+
var g = 5, _ = 2 ** 53 - 1, v = (e) => Math.round(e * 100) / 100;
|
|
16
|
+
function y(e, t, n) {
|
|
17
|
+
return Math.min(Math.max(e, t), n);
|
|
18
|
+
}
|
|
19
|
+
function b(e, t, n) {
|
|
20
|
+
return {
|
|
21
|
+
lo: Math.max(e.min, n - t.max),
|
|
22
|
+
hi: Math.min(e.max, n - t.min)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var te = "haze-Splitter__splitterBase", ne = "haze-Splitter__splitterHorizontal", x = "haze-Splitter__splitterVertical";
|
|
26
|
+
function S({ orientation: a = "horizontal", sizes: s, onSizesChange: h, children: S, className: C, ...N }) {
|
|
27
|
+
let P = r.toArray(S).filter(o).map((e) => {
|
|
28
|
+
if (e.type !== w) throw Error("Splitter children must be <SplitterPane> elements");
|
|
29
|
+
return e;
|
|
30
|
+
}), F = P.length, I = () => Array.from({ length: F }, () => 100 / F), L = d(s), [R, ae] = ee(f(L ? s : void 0, p((e) => h?.(e))), L ? I : s ?? I), z = (e) => {
|
|
31
|
+
let t = R[e];
|
|
32
|
+
return t === void 0 ? 100 / F : t;
|
|
33
|
+
}, B = (e) => {
|
|
34
|
+
let t = P[e]?.props;
|
|
35
|
+
return {
|
|
36
|
+
min: t?.min ?? 0,
|
|
37
|
+
max: t?.max ?? Infinity
|
|
38
|
+
};
|
|
39
|
+
}, V = c(null), H = c(null), U = n("splitter"), W = c(/* @__PURE__ */ new Map()), G = (e) => P[e]?.props.collapsible === !0, K = (e) => z(e) === 0, q = (e) => {
|
|
40
|
+
let t = B(e);
|
|
41
|
+
return K(e) ? {
|
|
42
|
+
...t,
|
|
43
|
+
min: 0
|
|
44
|
+
} : t;
|
|
45
|
+
}, J = (e, t) => {
|
|
46
|
+
let n = Math.min(e, t), r = z(n) + z(n + 1);
|
|
47
|
+
if (K(e)) {
|
|
48
|
+
let { lo: i, hi: a } = b(B(e), B(t), r), o = y(W.current.get(e) ?? r / 2, i, a);
|
|
49
|
+
W.current.delete(e);
|
|
50
|
+
let s = e === n ? o : r - o;
|
|
51
|
+
X(n, s, r);
|
|
52
|
+
} else W.current.set(e, z(e)), X(n, e === n ? 0 : r, r);
|
|
53
|
+
}, Y = () => a === "horizontal" && t(V.current) === "rtl", X = (e, t, n) => {
|
|
54
|
+
let r = v(t), i = v(n - r);
|
|
55
|
+
ae((t) => {
|
|
56
|
+
if (e + 1 >= t.length || t[e] === r) return t;
|
|
57
|
+
let n = t.slice();
|
|
58
|
+
return n[e] = r, n[e + 1] = i, n;
|
|
59
|
+
});
|
|
60
|
+
}, Z = (e) => a === "horizontal" ? e.clientX : e.clientY, oe = () => {
|
|
61
|
+
let e = V.current;
|
|
62
|
+
if (e === null) return 0;
|
|
63
|
+
let t = 0;
|
|
64
|
+
for (let n of e.querySelectorAll("[data-slot='pane']")) {
|
|
65
|
+
let e = n.getBoundingClientRect();
|
|
66
|
+
t += a === "horizontal" ? e.width : e.height;
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}, se = (e, t) => {
|
|
70
|
+
if (t.button !== 0) return;
|
|
71
|
+
let n = oe();
|
|
72
|
+
if (!(n > 0)) return;
|
|
73
|
+
let r = z(e) + z(e + 1), { lo: i, hi: a } = b(q(e), q(e + 1), r);
|
|
74
|
+
t.preventDefault();
|
|
75
|
+
let o = t.currentTarget;
|
|
76
|
+
if (H.current = {
|
|
77
|
+
pointerId: t.pointerId,
|
|
78
|
+
origin: Z(t),
|
|
79
|
+
extent: n,
|
|
80
|
+
leadIndex: e,
|
|
81
|
+
startLead: z(e),
|
|
82
|
+
pairSum: r,
|
|
83
|
+
lo: i,
|
|
84
|
+
hi: a,
|
|
85
|
+
lastLead: z(e)
|
|
86
|
+
}, typeof o.setPointerCapture == "function") try {
|
|
87
|
+
o.setPointerCapture(t.pointerId);
|
|
88
|
+
} catch {}
|
|
89
|
+
}, ce = (e) => {
|
|
90
|
+
let t = H.current;
|
|
91
|
+
if (t?.pointerId !== e.pointerId) return;
|
|
92
|
+
K(t.leadIndex) && W.current.delete(t.leadIndex), K(t.leadIndex + 1) && W.current.delete(t.leadIndex + 1);
|
|
93
|
+
let n = Z(e) - t.origin, r = (Y() ? -n : n) / t.extent * 100, i = y(t.startLead + r, t.lo, t.hi);
|
|
94
|
+
v(i) !== v(t.lastLead) && (t.lastLead = i, X(t.leadIndex, i, t.pairSum));
|
|
95
|
+
}, Q = (e) => {
|
|
96
|
+
if (H.current?.pointerId !== e.pointerId) return;
|
|
97
|
+
H.current = null;
|
|
98
|
+
let t = e.currentTarget;
|
|
99
|
+
if (typeof t.releasePointerCapture == "function") try {
|
|
100
|
+
t.releasePointerCapture(e.pointerId);
|
|
101
|
+
} catch {}
|
|
102
|
+
}, le = (e, t) => {
|
|
103
|
+
let n = a === "horizontal" ? "ArrowRight" : "ArrowDown", r = a === "horizontal" ? "ArrowLeft" : "ArrowUp", { key: i } = t;
|
|
104
|
+
if (i !== n && i !== r && i !== "Home" && i !== "End") return;
|
|
105
|
+
let o = z(e) + z(e + 1), { lo: s, hi: c } = b(q(e), q(e + 1), o), l = z(e);
|
|
106
|
+
t.preventDefault();
|
|
107
|
+
let u = Y(), d = y(l + (i === n ? u ? -5 : g : i === r ? u ? g : -5 : i === "Home" ? -_ : _), s, c);
|
|
108
|
+
d !== l && X(e, d, o);
|
|
109
|
+
}, $ = [];
|
|
110
|
+
return P.forEach((t, n) => {
|
|
111
|
+
if (n > 0) {
|
|
112
|
+
let t = n - 1, r = z(t) + z(n), { lo: i, hi: o } = b(q(t), q(n), r);
|
|
113
|
+
$.push(/* @__PURE__ */ u("div", {
|
|
114
|
+
"data-slot": "divider",
|
|
115
|
+
className: e([T, a === "horizontal" ? re : E]),
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ l("div", {
|
|
118
|
+
"data-slot": "divider-handle",
|
|
119
|
+
role: "separator",
|
|
120
|
+
"aria-orientation": a === "horizontal" ? "vertical" : "horizontal",
|
|
121
|
+
tabIndex: 0,
|
|
122
|
+
"aria-valuenow": Math.round(z(t)),
|
|
123
|
+
"aria-valuemin": Math.round(i),
|
|
124
|
+
"aria-valuemax": Math.round(o),
|
|
125
|
+
onKeyDown: (e) => le(t, e),
|
|
126
|
+
onPointerDown: (e) => se(t, e),
|
|
127
|
+
onPointerMove: ce,
|
|
128
|
+
onPointerUp: Q,
|
|
129
|
+
onPointerCancel: Q,
|
|
130
|
+
className: e([ie])
|
|
131
|
+
}),
|
|
132
|
+
G(t) && /* @__PURE__ */ l("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
"data-slot": "divider-collapse",
|
|
135
|
+
"data-side": "lead",
|
|
136
|
+
"aria-expanded": !K(t),
|
|
137
|
+
"aria-label": K(t) ? U.expandLead : U.collapseLead,
|
|
138
|
+
onClick: () => J(t, n),
|
|
139
|
+
className: e([O, a === "horizontal" ? k : j]),
|
|
140
|
+
children: D
|
|
141
|
+
}, `splitter-collapse-lead-${n}`),
|
|
142
|
+
G(n) && /* @__PURE__ */ l("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
"data-slot": "divider-collapse",
|
|
145
|
+
"data-side": "trail",
|
|
146
|
+
"aria-expanded": !K(n),
|
|
147
|
+
"aria-label": K(n) ? U.expandTrail : U.collapseTrail,
|
|
148
|
+
onClick: () => J(n, t),
|
|
149
|
+
className: e([O, a === "horizontal" ? A : M]),
|
|
150
|
+
children: D
|
|
151
|
+
}, `splitter-collapse-trail-${n}`)
|
|
152
|
+
]
|
|
153
|
+
}, `splitter-divider-${n}`));
|
|
154
|
+
}
|
|
155
|
+
$.push(i(t, { style: {
|
|
156
|
+
...t.props.style,
|
|
157
|
+
flexGrow: z(n)
|
|
158
|
+
} }));
|
|
159
|
+
}), /* @__PURE__ */ l(m.Provider, {
|
|
160
|
+
value: !0,
|
|
161
|
+
children: l("div", {
|
|
162
|
+
ref: V,
|
|
163
|
+
"data-slot": "splitter",
|
|
164
|
+
...N,
|
|
165
|
+
className: e([
|
|
166
|
+
te,
|
|
167
|
+
a === "horizontal" ? ne : x,
|
|
168
|
+
C
|
|
169
|
+
]),
|
|
170
|
+
children: $
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
var C = "haze-Splitter__paneBase";
|
|
175
|
+
function w({ min: t, max: n, collapsible: r, children: i, className: a, ...o }) {
|
|
176
|
+
return h(), /* @__PURE__ */ l("div", {
|
|
177
|
+
"data-slot": "pane",
|
|
178
|
+
...o,
|
|
179
|
+
className: e([C, a]),
|
|
180
|
+
children: i
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
var T = "haze-Splitter__dividerBase", re = "haze-Splitter__dividerHorizontal", E = "haze-Splitter__dividerVertical", ie = "haze-Splitter__dividerHandle", D = /* @__PURE__ */ l("svg", {
|
|
184
|
+
width: "12",
|
|
185
|
+
height: "12",
|
|
186
|
+
viewBox: "0 0 16 16",
|
|
187
|
+
fill: "none",
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
focusable: "false",
|
|
190
|
+
children: l("path", {
|
|
191
|
+
d: "M10.5 3 5.5 8l5 5",
|
|
192
|
+
stroke: "currentColor",
|
|
193
|
+
strokeWidth: "1.75",
|
|
194
|
+
strokeLinecap: "round",
|
|
195
|
+
strokeLinejoin: "round"
|
|
196
|
+
})
|
|
197
|
+
}), O = "haze-Splitter__collapseButtonBase", k = "haze-Splitter__collapseLeadHorizontal", A = "haze-Splitter__collapseTrailHorizontal", j = "haze-Splitter__collapseLeadVertical", M = "haze-Splitter__collapseTrailVertical";
|
|
198
|
+
//#endregion
|
|
199
|
+
export { S as Splitter, w as SplitterPane };
|