wimui 0.51.1 → 0.52.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/_internal/FeedbackCloseButton.cjs +1 -1
- package/dist/components/_internal/FeedbackCloseButton.js +14 -13
- package/dist/components/_internal/FieldLabelContent.cjs +1 -1
- package/dist/components/_internal/FieldLabelContent.js +18 -17
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.js +46 -45
- package/dist/components/ai/AgentStatus/AgentStatus.cjs +1 -1
- package/dist/components/ai/AgentStatus/AgentStatus.js +24 -23
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.cjs +1 -1
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.js +47 -45
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +82 -81
- package/dist/components/ai/CodeBlock/CodeBlock.cjs +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.js +53 -52
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.cjs +1 -1
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.js +60 -59
- package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
- package/dist/components/ai/ModelSelector/ModelSelector.js +122 -120
- package/dist/components/ai/ModelSelector/model-selector.module.cjs +1 -1
- package/dist/components/ai/ModelSelector/model-selector.module.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.cjs +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +76 -75
- package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
- package/dist/components/ai/SourceCitation/SourceCitation.js +39 -38
- package/dist/components/ai/Terminal/Terminal.cjs +2 -2
- package/dist/components/ai/Terminal/Terminal.js +65 -64
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +64 -62
- package/dist/components/data-display/Accordion/accordion.module.cjs +1 -1
- package/dist/components/data-display/Accordion/accordion.module.js +1 -1
- package/dist/components/data-display/Barcode/Barcode.cjs +1 -1
- package/dist/components/data-display/Barcode/Barcode.js +76 -75
- package/dist/components/data-display/Calendar/Calendar.cjs +1 -1
- package/dist/components/data-display/Calendar/Calendar.js +75 -74
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.js +54 -52
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +24 -23
- package/dist/components/data-display/Chip/Chip.cjs +1 -1
- package/dist/components/data-display/Chip/Chip.js +36 -35
- package/dist/components/data-display/Comment/Comment.cjs +1 -1
- package/dist/components/data-display/Comment/Comment.js +58 -57
- package/dist/components/data-display/Countdown/Countdown.cjs +1 -1
- package/dist/components/data-display/Countdown/Countdown.js +56 -55
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +128 -127
- package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/data-display/JsonViewer/JsonViewer.js +153 -152
- package/dist/components/data-display/Kanban/Kanban.cjs +1 -1
- package/dist/components/data-display/Kanban/Kanban.js +95 -94
- package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
- package/dist/components/data-display/NodeGraph/NodeGraph.js +67 -66
- package/dist/components/data-display/PivotTable/PivotTable.cjs +1 -1
- package/dist/components/data-display/PivotTable/PivotTable.js +153 -152
- package/dist/components/data-display/Presence/Presence.cjs +1 -1
- package/dist/components/data-display/Presence/Presence.js +28 -27
- package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.js +73 -72
- package/dist/components/data-display/Reaction/Reaction.cjs +1 -1
- package/dist/components/data-display/Reaction/Reaction.js +31 -30
- package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
- package/dist/components/data-display/ScheduleView/ScheduleView.js +52 -50
- package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
- package/dist/components/data-display/SortableList/SortableList.js +44 -43
- package/dist/components/data-display/Tag/Tag.cjs +1 -1
- package/dist/components/data-display/Tag/Tag.js +29 -28
- package/dist/components/data-display/TreeDiagram/TreeDiagram.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/TreeDiagram.js +85 -84
- package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
- package/dist/components/data-display/TreeView/TreeView.js +123 -122
- package/dist/components/feedback/Autosave/Autosave.cjs +1 -1
- package/dist/components/feedback/Autosave/Autosave.js +32 -31
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
- package/dist/components/feedback/ScrollProgress/ScrollProgress.cjs +1 -1
- package/dist/components/feedback/ScrollProgress/ScrollProgress.js +21 -20
- package/dist/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +127 -101
- package/dist/components/form/Button/Button.cjs +1 -1
- package/dist/components/form/Button/Button.js +55 -54
- package/dist/components/form/ColorInput/ColorInput.cjs +1 -1
- package/dist/components/form/ColorInput/ColorInput.js +30 -29
- package/dist/components/form/ColorPicker/color-picker.module.cjs +1 -1
- package/dist/components/form/ColorPicker/color-picker.module.js +1 -1
- package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
- package/dist/components/form/CopyButton/CopyButton.js +27 -26
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +47 -46
- package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/form/DateRangePicker/DateRangePicker.js +36 -35
- package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
- package/dist/components/form/Dropzone/Dropzone.js +56 -55
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.js +47 -46
- package/dist/components/form/FloatButton/FloatButton.cjs +1 -1
- package/dist/components/form/FloatButton/FloatButton.d.ts +4 -1
- package/dist/components/form/FloatButton/FloatButton.js +6 -6
- package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
- package/dist/components/form/ImageCropper/ImageCropper.js +101 -99
- package/dist/components/form/InlineEdit/InlineEdit.cjs +1 -1
- package/dist/components/form/InlineEdit/InlineEdit.js +66 -65
- package/dist/components/form/Input/Input.cjs +1 -1
- package/dist/components/form/Input/Input.js +45 -44
- package/dist/components/form/InputBase/InputBase.cjs +1 -1
- package/dist/components/form/InputBase/InputBase.js +51 -50
- package/dist/components/form/InputBase/input-base.module.cjs +1 -1
- package/dist/components/form/InputBase/input-base.module.js +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.cjs +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.js +1 -1
- package/dist/components/form/OtpInput/otp-input.module.cjs +1 -1
- package/dist/components/form/OtpInput/otp-input.module.js +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.cjs +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.js +27 -26
- package/dist/components/form/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/form/PhoneInput/PhoneInput.js +10 -10
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +90 -89
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +121 -119
- package/dist/components/form/RangeSlider/range-slider.module.cjs +1 -1
- package/dist/components/form/RangeSlider/range-slider.module.js +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.cjs +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.js +223 -222
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +112 -111
- package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
- package/dist/components/form/SignaturePad/SignaturePad.js +86 -79
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +63 -62
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +68 -67
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +69 -67
- package/dist/components/form/ThemeToggle/theme-toggle.module.cjs +1 -1
- package/dist/components/form/ThemeToggle/theme-toggle.module.js +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.js +6 -6
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.d.ts +1 -1
- package/dist/components/form/Transfer/Transfer.js +155 -154
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/form/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +90 -89
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.d.ts +1 -1
- package/dist/components/layout/Navbar/Navbar.js +1 -1
- package/dist/components/layout/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/layout/Splitter/Splitter.cjs +1 -1
- package/dist/components/layout/Splitter/Splitter.js +40 -39
- package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/layout/Toolbar/Toolbar.js +66 -39
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +91 -90
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +116 -114
- package/dist/components/media/Gallery/Gallery.cjs +1 -1
- package/dist/components/media/Gallery/Gallery.js +132 -131
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +75 -73
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.js +128 -127
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +73 -71
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +140 -138
- package/dist/components/media/Video/components/VideoControls.cjs +1 -1
- package/dist/components/media/Video/components/VideoControls.js +103 -102
- package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
- package/dist/components/navigation/BackTop/BackTop.js +37 -36
- package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js +41 -40
- package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.js +100 -99
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.d.ts +6 -0
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.js +32 -22
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +39 -38
- package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/navigation/SpeedDial/SpeedDial.js +44 -43
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +63 -62
- package/dist/components/typography/Spoiler/Spoiler.cjs +1 -1
- package/dist/components/typography/Spoiler/Spoiler.js +38 -37
- package/dist/i18n/generated/common.cjs +2 -0
- package/dist/i18n/generated/common.d.ts +3 -0
- package/dist/i18n/generated/common.js +570 -0
- package/dist/i18n/generated/components.cjs +2 -0
- package/dist/i18n/generated/components.d.ts +3 -0
- package/dist/i18n/generated/components.js +399 -0
- package/dist/i18n/generated/data-display.cjs +2 -0
- package/dist/i18n/generated/data-display.d.ts +3 -0
- package/dist/i18n/generated/data-display.js +12 -0
- package/dist/i18n/generated/form.cjs +2 -0
- package/dist/i18n/generated/form.d.ts +3 -0
- package/dist/i18n/generated/form.js +321 -0
- package/dist/i18n/generated/keys.d.ts +5 -1
- package/dist/i18n/generated/locales.cjs +2 -0
- package/dist/i18n/generated/locales.d.ts +1 -0
- package/dist/i18n/generated/locales.js +9 -0
- package/dist/i18n/instance.cjs +1 -1
- package/dist/i18n/instance.d.ts +18 -3
- package/dist/i18n/instance.js +24 -26
- package/dist/i18n/useWimTranslation.cjs +1 -1
- package/dist/i18n/useWimTranslation.d.ts +7 -8
- package/dist/i18n/useWimTranslation.js +6 -5
- package/dist/llms-full.txt +10 -6
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +53 -4
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/common.json +53 -4
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/common.json +53 -4
- package/dist/locales/pt/components.json +3 -1
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +10 -10
- package/dist/i18n/generated/resources.cjs +0 -2
- package/dist/i18n/generated/resources.d.ts +0 -4
- package/dist/i18n/generated/resources.js +0 -1103
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { useWimTranslation as n } from "../../../i18n/useWimTranslation.js";
|
|
4
|
-
import r from "../../../
|
|
5
|
-
import i from "../../../icon/chevron-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { commonNs as r } from "../../../i18n/generated/common.js";
|
|
5
|
+
import i from "../../../icon/chevron-left.js";
|
|
6
|
+
import a from "../../../icon/chevron-right.js";
|
|
7
|
+
import { Icon as o } from "../../media/Icon/Icon.js";
|
|
8
|
+
import { Button as s } from "../../form/Button/Button.js";
|
|
9
|
+
import { Input as c } from "../../form/Input/Input.js";
|
|
10
|
+
import { Select as ee } from "../../form/Select/Select.js";
|
|
10
11
|
import l from "./pagination.module.js";
|
|
11
12
|
import u, { useMemo as d, useState as f } from "react";
|
|
12
13
|
import p from "classnames";
|
|
@@ -21,17 +22,17 @@ var g = u.forwardRef(({ asChild: n = !1, className: r, children: i, page: a, isA
|
|
|
21
22
|
children: n ? /* @__PURE__ */ m(t, { children: i }) : i
|
|
22
23
|
}));
|
|
23
24
|
g.displayName = "PaginationPage";
|
|
24
|
-
var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, onPageSizeChange:
|
|
25
|
+
var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, onPageSizeChange: te, siblingCount: x = 1, className: S, asChild: C = !1, children: w, renderPage: T, hideOnSinglePage: E = !1, simple: D = !1, showSizeChanger: O = !1, pageSizeOptions: k = [
|
|
25
26
|
10,
|
|
26
27
|
20,
|
|
27
28
|
50,
|
|
28
29
|
100
|
|
29
30
|
], showTotal: A, showQuickJumper: j = !1, labels: M = {} }) => {
|
|
30
|
-
let { t: N } = n(
|
|
31
|
-
if (
|
|
32
|
-
let e = Math.max(y -
|
|
31
|
+
let { t: N } = n(r), { prevPage: P = N("a11y.go_to_prev_page"), nextPage: F = N("a11y.go_to_next_page"), pageAriaLabel: I = (e) => N("a11y.go_to_page", { page: String(e) }), itemsPerPage: L = N("pagination.items_per_page"), goTo: R = N("pagination.go_to"), go: z = N("pagination.go"), pageSizeAriaLabel: B = N("a11y.items_per_page"), jumpToPageAriaLabel: V = N("a11y.jump_to_page"), navAriaLabel: H = N("a11y.pagination_nav") } = M, [U, W] = f(v), [G, K] = f(""), q = U, J = Math.ceil(u / q), Y = d(() => {
|
|
32
|
+
if (x + 5 >= J) return Array.from({ length: J }, (e, t) => t + 1);
|
|
33
|
+
let e = Math.max(y - x, 1), t = Math.min(y + x, J), n = e > 2, r = t < J - 2, i = J;
|
|
33
34
|
if (!n && r) {
|
|
34
|
-
let e = 3 + 2 *
|
|
35
|
+
let e = 3 + 2 * x;
|
|
35
36
|
return [
|
|
36
37
|
...Array.from({ length: e }, (e, t) => t + 1),
|
|
37
38
|
_,
|
|
@@ -39,7 +40,7 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
39
40
|
];
|
|
40
41
|
}
|
|
41
42
|
if (n && !r) {
|
|
42
|
-
let e = 3 + 2 *
|
|
43
|
+
let e = 3 + 2 * x;
|
|
43
44
|
return [
|
|
44
45
|
1,
|
|
45
46
|
_,
|
|
@@ -55,35 +56,35 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
55
56
|
] : [];
|
|
56
57
|
}, [
|
|
57
58
|
J,
|
|
58
|
-
|
|
59
|
+
x,
|
|
59
60
|
y
|
|
60
61
|
]);
|
|
61
|
-
if (
|
|
62
|
+
if (E && J <= 1) return null;
|
|
62
63
|
let X = (e) => {
|
|
63
64
|
e < 1 || e > J || e === y || b?.(e, q);
|
|
64
65
|
}, Z = (e) => {
|
|
65
|
-
W(e),
|
|
66
|
+
W(e), te?.(e), b?.(1, e);
|
|
66
67
|
}, Q = () => {
|
|
67
68
|
let e = parseInt(G);
|
|
68
69
|
!isNaN(e) && e >= 1 && e <= J && (X(e), K(""));
|
|
69
|
-
},
|
|
70
|
+
}, ne = (e) => {
|
|
70
71
|
e.key === "Enter" && Q();
|
|
71
|
-
},
|
|
72
|
+
}, re = (y - 1) * q + 1, ie = Math.min(y * q, u), $ = C ? e : "nav", ae = (e) => {
|
|
72
73
|
let t = {
|
|
73
74
|
page: e,
|
|
74
75
|
isActive: e === y,
|
|
75
76
|
onClick: () => X(e),
|
|
76
77
|
"aria-label": I(e)
|
|
77
78
|
};
|
|
78
|
-
return
|
|
79
|
+
return T ? T(e, t) : /* @__PURE__ */ m(g, {
|
|
79
80
|
...t,
|
|
80
81
|
children: e
|
|
81
82
|
});
|
|
82
83
|
};
|
|
83
|
-
return
|
|
84
|
-
className: p("wim-pagination", l.root, l.simple,
|
|
84
|
+
return D ? /* @__PURE__ */ h($, {
|
|
85
|
+
className: p("wim-pagination", l.root, l.simple, S),
|
|
85
86
|
"aria-label": H,
|
|
86
|
-
children: [/* @__PURE__ */ m(t, { children:
|
|
87
|
+
children: [/* @__PURE__ */ m(t, { children: w }), /* @__PURE__ */ h("ul", {
|
|
87
88
|
className: l.root,
|
|
88
89
|
children: [
|
|
89
90
|
/* @__PURE__ */ m("li", {
|
|
@@ -93,8 +94,8 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
93
94
|
onClick: () => X(y - 1),
|
|
94
95
|
disabled: y === 1,
|
|
95
96
|
"aria-label": P,
|
|
96
|
-
children: /* @__PURE__ */ m(
|
|
97
|
-
component:
|
|
97
|
+
children: /* @__PURE__ */ m(o, {
|
|
98
|
+
component: i,
|
|
98
99
|
size: "sm"
|
|
99
100
|
})
|
|
100
101
|
})
|
|
@@ -114,8 +115,8 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
114
115
|
onClick: () => X(y + 1),
|
|
115
116
|
disabled: y === J,
|
|
116
117
|
"aria-label": F,
|
|
117
|
-
children: /* @__PURE__ */ m(
|
|
118
|
-
component:
|
|
118
|
+
children: /* @__PURE__ */ m(o, {
|
|
119
|
+
component: a,
|
|
119
120
|
size: "sm"
|
|
120
121
|
})
|
|
121
122
|
})
|
|
@@ -123,18 +124,18 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
123
124
|
]
|
|
124
125
|
})]
|
|
125
126
|
}) : /* @__PURE__ */ m("div", {
|
|
126
|
-
className: p("wim-pagination", l.container,
|
|
127
|
+
className: p("wim-pagination", l.container, S),
|
|
127
128
|
children: /* @__PURE__ */ h("div", {
|
|
128
129
|
className: l.wrapper,
|
|
129
130
|
children: [
|
|
130
131
|
A && /* @__PURE__ */ m("div", {
|
|
131
132
|
className: l.total,
|
|
132
|
-
children: A(u, [
|
|
133
|
+
children: A(u, [re, ie])
|
|
133
134
|
}),
|
|
134
135
|
/* @__PURE__ */ h($, {
|
|
135
136
|
className: l.root,
|
|
136
137
|
"aria-label": H,
|
|
137
|
-
children: [/* @__PURE__ */ m(t, { children:
|
|
138
|
+
children: [/* @__PURE__ */ m(t, { children: w }), /* @__PURE__ */ h("ul", {
|
|
138
139
|
className: l.root,
|
|
139
140
|
children: [
|
|
140
141
|
/* @__PURE__ */ m("li", {
|
|
@@ -144,8 +145,8 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
144
145
|
onClick: () => X(y - 1),
|
|
145
146
|
disabled: y === 1,
|
|
146
147
|
"aria-label": P,
|
|
147
|
-
children: /* @__PURE__ */ m(
|
|
148
|
-
component:
|
|
148
|
+
children: /* @__PURE__ */ m(o, {
|
|
149
|
+
component: i,
|
|
149
150
|
size: "sm"
|
|
150
151
|
})
|
|
151
152
|
})
|
|
@@ -164,7 +165,7 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
164
165
|
children: _
|
|
165
166
|
}, `ellipsis-${t}`) : /* @__PURE__ */ m("li", {
|
|
166
167
|
className: p(l.item, l.number, e === y && l.active),
|
|
167
|
-
children:
|
|
168
|
+
children: ae(e)
|
|
168
169
|
}, e)),
|
|
169
170
|
/* @__PURE__ */ m("li", {
|
|
170
171
|
className: p(l.item, y === J && l.disabled),
|
|
@@ -173,8 +174,8 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
173
174
|
onClick: () => X(y + 1),
|
|
174
175
|
disabled: y === J,
|
|
175
176
|
"aria-label": F,
|
|
176
|
-
children: /* @__PURE__ */ m(
|
|
177
|
-
component:
|
|
177
|
+
children: /* @__PURE__ */ m(o, {
|
|
178
|
+
component: a,
|
|
178
179
|
size: "sm"
|
|
179
180
|
})
|
|
180
181
|
})
|
|
@@ -182,9 +183,9 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
182
183
|
]
|
|
183
184
|
})]
|
|
184
185
|
}),
|
|
185
|
-
|
|
186
|
+
O && /* @__PURE__ */ m("div", {
|
|
186
187
|
className: l.sizeChanger,
|
|
187
|
-
children: /* @__PURE__ */ m(
|
|
188
|
+
children: /* @__PURE__ */ m(ee, {
|
|
188
189
|
value: String(q),
|
|
189
190
|
onChange: (e) => Z(Number(e)),
|
|
190
191
|
options: k.map((e) => ({
|
|
@@ -199,17 +200,17 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
199
200
|
className: l.quickJumper,
|
|
200
201
|
children: [
|
|
201
202
|
/* @__PURE__ */ m("span", { children: R }),
|
|
202
|
-
/* @__PURE__ */ m(
|
|
203
|
+
/* @__PURE__ */ m(c, {
|
|
203
204
|
type: "number",
|
|
204
205
|
min: 1,
|
|
205
206
|
max: J,
|
|
206
207
|
value: G,
|
|
207
208
|
onChange: (e) => K(e.target.value),
|
|
208
|
-
onKeyDown:
|
|
209
|
+
onKeyDown: ne,
|
|
209
210
|
width: "60px",
|
|
210
211
|
"aria-label": V
|
|
211
212
|
}),
|
|
212
|
-
/* @__PURE__ */ m(
|
|
213
|
+
/* @__PURE__ */ m(s, {
|
|
213
214
|
size: "sm",
|
|
214
215
|
variant: "outline",
|
|
215
216
|
onClick: Q,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../form/FloatButton/FloatButton.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../form/FloatButton/FloatButton.cjs"),i=require("./speed-dial.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=a.default.forwardRef(({actions:e,icon:c=`PlusIcon`,activeIcon:l=`CloseIcon`,direction:u=`up`,trigger:d=`hover`,open:f,onOpenChange:p,className:m,"aria-label":h,...g},_)=>{let{t:v}=t.useWimTranslation(n.commonNs),[y,b]=(0,a.useState)(!1),x=f??y,S=(0,a.useRef)(null),C=(0,a.useRef)(!1),w=e=>{b(e),p?.(e)},T=()=>{d===`hover`&&w(!0)},E=()=>{d===`hover`&&w(!1)},D=()=>{d===`click`&&w(!x)},O=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),C.current=!x,w(!x))};return(0,a.useEffect)(()=>{x&&C.current&&S.current?.querySelector(`button`)?.focus()},[x]),(0,s.jsxs)(`div`,{ref:_,className:(0,o.default)(`wim-speed-dial`,i.default.root,i.default[u],x&&i.default.open,m),onMouseEnter:T,onMouseLeave:E,onKeyDown:e=>{e.key===`Escape`&&x&&(e.preventDefault(),C.current=!1,w(!1),e.currentTarget.querySelector(`[aria-haspopup]`)?.focus())},onBlur:e=>{C.current&&(e.currentTarget.contains(e.relatedTarget)||(C.current=!1,w(!1)))},...g,children:[(0,s.jsx)(`div`,{ref:S,className:i.default.actions,inert:!x,children:e.map((e,t)=>(0,s.jsx)(`div`,{className:i.default.actionWrapper,style:{transitionDelay:x?`${t*50}ms`:`0ms`},children:(0,s.jsx)(r.FloatButton,{iconName:e.icon,label:e.label,size:`sm`,intent:e.intent,className:e.className,onClick:()=>{e.onClick?.(),d===`click`&&w(!1)},position:`inline`})},t))}),(0,s.jsx)(r.FloatButton,{iconName:x?l:c,onClick:D,className:i.default.trigger,position:`inline`,"aria-expanded":x,"aria-haspopup":`true`,"aria-label":h??v(x?`a11y.close_menu`:`a11y.open_menu`),onKeyDown:O})]})});c.displayName=`SpeedDial`,exports.SpeedDial=c;
|
|
@@ -1,68 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import n from "
|
|
5
|
-
import r
|
|
6
|
-
import s from "
|
|
7
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { FloatButton as n } from "../../form/FloatButton/FloatButton.js";
|
|
5
|
+
import r from "./speed-dial.module.js";
|
|
6
|
+
import i, { useEffect as a, useRef as o, useState as s } from "react";
|
|
7
|
+
import c from "classnames";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/navigation/SpeedDial/SpeedDial.tsx
|
|
9
|
-
var
|
|
10
|
-
let { t:
|
|
11
|
-
|
|
12
|
-
}, D = () => {
|
|
13
|
-
p === "hover" && E(!0);
|
|
10
|
+
var d = i.forwardRef(({ actions: i, icon: d = "PlusIcon", activeIcon: f = "CloseIcon", direction: p = "up", trigger: m = "hover", open: h, onOpenChange: g, className: _, "aria-label": v, ...y }, b) => {
|
|
11
|
+
let { t: x } = e(t), [S, C] = s(!1), w = h ?? S, T = o(null), E = o(!1), D = (e) => {
|
|
12
|
+
C(e), g?.(e);
|
|
14
13
|
}, O = () => {
|
|
15
|
-
|
|
14
|
+
m === "hover" && D(!0);
|
|
16
15
|
}, k = () => {
|
|
17
|
-
|
|
18
|
-
}, A = (
|
|
19
|
-
|
|
16
|
+
m === "hover" && D(!1);
|
|
17
|
+
}, A = () => {
|
|
18
|
+
m === "click" && D(!w);
|
|
19
|
+
}, j = (e) => {
|
|
20
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), E.current = !w, D(!w));
|
|
20
21
|
};
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
ref:
|
|
25
|
-
className:
|
|
26
|
-
onMouseEnter:
|
|
27
|
-
onMouseLeave:
|
|
22
|
+
return a(() => {
|
|
23
|
+
w && E.current && T.current?.querySelector("button")?.focus();
|
|
24
|
+
}, [w]), /* @__PURE__ */ u("div", {
|
|
25
|
+
ref: b,
|
|
26
|
+
className: c("wim-speed-dial", r.root, r[p], w && r.open, _),
|
|
27
|
+
onMouseEnter: O,
|
|
28
|
+
onMouseLeave: k,
|
|
28
29
|
onKeyDown: (e) => {
|
|
29
|
-
e.key === "Escape" &&
|
|
30
|
+
e.key === "Escape" && w && (e.preventDefault(), E.current = !1, D(!1), e.currentTarget.querySelector("[aria-haspopup]")?.focus());
|
|
30
31
|
},
|
|
31
32
|
onBlur: (e) => {
|
|
32
|
-
|
|
33
|
+
E.current && (e.currentTarget.contains(e.relatedTarget) || (E.current = !1, D(!1)));
|
|
33
34
|
},
|
|
34
|
-
...
|
|
35
|
-
children: [/* @__PURE__ */
|
|
36
|
-
ref:
|
|
37
|
-
className:
|
|
38
|
-
inert: !
|
|
39
|
-
children:
|
|
40
|
-
className:
|
|
41
|
-
style: { transitionDelay:
|
|
42
|
-
children: /* @__PURE__ */
|
|
35
|
+
...y,
|
|
36
|
+
children: [/* @__PURE__ */ l("div", {
|
|
37
|
+
ref: T,
|
|
38
|
+
className: r.actions,
|
|
39
|
+
inert: !w,
|
|
40
|
+
children: i.map((e, t) => /* @__PURE__ */ l("div", {
|
|
41
|
+
className: r.actionWrapper,
|
|
42
|
+
style: { transitionDelay: w ? `${t * 50}ms` : "0ms" },
|
|
43
|
+
children: /* @__PURE__ */ l(n, {
|
|
43
44
|
iconName: e.icon,
|
|
44
45
|
label: e.label,
|
|
45
46
|
size: "sm",
|
|
46
47
|
intent: e.intent,
|
|
47
48
|
className: e.className,
|
|
48
49
|
onClick: () => {
|
|
49
|
-
e.onClick?.(),
|
|
50
|
+
e.onClick?.(), m === "click" && D(!1);
|
|
50
51
|
},
|
|
51
52
|
position: "inline"
|
|
52
53
|
})
|
|
53
|
-
},
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
-
iconName:
|
|
56
|
-
onClick:
|
|
57
|
-
className:
|
|
54
|
+
}, t))
|
|
55
|
+
}), /* @__PURE__ */ l(n, {
|
|
56
|
+
iconName: w ? f : d,
|
|
57
|
+
onClick: A,
|
|
58
|
+
className: r.trigger,
|
|
58
59
|
position: "inline",
|
|
59
|
-
"aria-expanded":
|
|
60
|
+
"aria-expanded": w,
|
|
60
61
|
"aria-haspopup": "true",
|
|
61
|
-
"aria-label":
|
|
62
|
-
onKeyDown:
|
|
62
|
+
"aria-label": v ?? x(w ? "a11y.close_menu" : "a11y.open_menu"),
|
|
63
|
+
onKeyDown: j
|
|
63
64
|
})]
|
|
64
65
|
});
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
d.displayName = "SpeedDial";
|
|
67
68
|
//#endregion
|
|
68
|
-
export {
|
|
69
|
+
export { d as SpeedDial };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_container_1rl5y_30`,t=`_root_1rl5y_44`,n=`_vertical_1rl5y_53`,r=`_list_1rl5y_61`,i=`_trigger_1rl5y_80`,a=`_active_1rl5y_102`,o=`_content_1rl5y_106`,s=`_dragging_1rl5y_134`,c=`_ready_1rl5y_138`,l=`_slider_1rl5y_138`,u={container:e,root:t,vertical:n,list:r,trigger:i,active:a,content:o,dragging:s,ready:c,slider:l};exports.active=a,exports.container=e,exports.content=o,exports.default=u,exports.dragging=s,exports.list=r,exports.ready=c,exports.root=t,exports.slider=l,exports.trigger=i,exports.vertical=n;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/navigation/Tabs/tabs.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_container_1rl5y_30", t = "_root_1rl5y_44", n = "_vertical_1rl5y_53", r = "_list_1rl5y_61", i = "_trigger_1rl5y_80", a = "_active_1rl5y_102", o = "_content_1rl5y_106", s = "_dragging_1rl5y_134", c = "_ready_1rl5y_138", l = "_slider_1rl5y_138", u = {
|
|
4
4
|
container: e,
|
|
5
5
|
root: t,
|
|
6
6
|
vertical: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../_internal/BaseListItem/BaseListItem.cjs"),a=require("./context-menu.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime"),l=require("@floating-ui/react");var u=o.default.createContext(null),d=({children:e,menu:i,className:d,disabled:f=!1,asChild:p=!1})=>{let[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(null),[v,y]=(0,o.useState)(!1),b=(0,o.useRef)([]),x=(0,o.useRef)(null),S=n.useMergedRef(x),{refs:C,floatingStyles:w,context:T}=(0,l.useFloating)({open:m,onOpenChange:e=>{h(e),e||(_(null),y(!1))},strategy:`fixed`,middleware:[(0,l.flip)(),(0,l.shift)({padding:10})],whileElementsMounted:l.autoUpdate}),E=(0,l.useDismiss)(T),D=(0,l.useRole)(T,{role:`menu`}),O=(0,l.useListNavigation)(T,{listRef:b,activeIndex:g,onNavigate:_,loop:!0}),{getFloatingProps:k,getItemProps:A}=(0,l.useInteractions)([E,D,O]),j=(e,t,n)=>{C.setReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,top:t,left:e,right:e,bottom:t}}}),y(n),h(!0),_(0)},M=e=>{if(e.preventDefault(),f)return;let t=e.clientX===0&&e.clientY===0;j(e.clientX,e.clientY,t)},N=e=>{if(!f&&(e.key===`Enter`||e.key===` `)){e.preventDefault();let t=x.current?.getBoundingClientRect();t&&j(t.left+t.width/2,t.top+t.height/2,!0)}},P=()=>{h(!1)};return(0,c.jsxs)(p?t.Root:`div`,{ref:S,className:(0,s.default)(`wim-context-menu`,!p&&a.default.container,f&&a.default.disabled,d),onContextMenu:M,onKeyDown:N,tabIndex:f?-1:0,"data-testid":`context-menu-trigger`,children:[(0,c.jsx)(t.Slottable,{children:e}),(0,c.jsx)(l.FloatingPortal,{preserveTabOrder:!1,children:(0,c.jsx)(r.Transition,{show:m,preset:`fade`,children:(0,c.jsx)(l.FloatingFocusManager,{context:T,modal:!1,guards:!1,initialFocus:v?g??0:-1,children:(0,c.jsx)(`div`,{ref:C.setFloating,className:a.default.menu,style:w,...k({onClick:P,onKeyDown(e){e.key===`Escape`&&P(),e.key===`Tab`&&(e.preventDefault(),P())}}),"aria-labelledby":void 0,children:(0,c.jsx)(u.Provider,{value:{activeIndex:g,getItemProps:A},children:(0,c.jsx)(l.FloatingList,{elementsRef:b,children:i})})})})})})]})},f=({children:e,onClick:t,disabled:n=!1,className:r,icon:d,danger:f=!1,asChild:p=!1})=>{let{ref:m,index:h}=(0,l.useListItem)(),g=(0,o.useContext)(u),_=()=>{n||t&&t()},v=g?g.getItemProps({index:h,onClick:()=>_(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_())}}):{},y={ref:m,className:(0,s.default)(a.default.item,r),disabled:n,danger:f,icon:d,role:`menuitem`,tabIndex:g?.activeIndex===h?0:-1,...v};return p?(0,c.jsx)(`li`,{role:`none`,children:(0,c.jsx)(i.BaseListItem,{asChild:!0,...y,children:e})}):(0,c.jsx)(i.BaseListItem,{...y,children:e})},p=({className:e})=>(0,c.jsx)(`div`,{className:(0,s.default)(a.default.divider,e),role:`separator`}),m=({children:e,title:t,className:n})=>{let r=o.default.useId();return(0,c.jsxs)(`div`,{role:`group`,"aria-labelledby":t?r:void 0,className:n,"data-testid":`context-menu-group`,children:[t&&(0,c.jsx)(`div`,{id:r,className:a.default.groupTitle,"data-testid":`context-menu-group-title`,"aria-hidden":`true`,children:t}),e]})},h=e=>(0,c.jsx)(d,{...e});h.displayName=`ContextMenu`,h.Item=f,h.Divider=p,h.Group=m,exports.ContextMenu=h,exports.default=h,exports.ContextMenuDivider=p,exports.ContextMenuGroup=m,exports.ContextMenuItem=f;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useMergedRef as n } from "../../../hooks/useMergedRef.js";
|
|
4
|
+
import { Transition as r } from "../../layout/Transition/Transition.js";
|
|
5
5
|
import { BaseListItem as i } from "../../_internal/BaseListItem/BaseListItem.js";
|
|
6
6
|
import a from "./context-menu.module.js";
|
|
7
7
|
import o, { useContext as s, useRef as c, useState as l } from "react";
|
|
@@ -10,7 +10,7 @@ import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
|
10
10
|
import { FloatingFocusManager as p, FloatingList as m, FloatingPortal as h, autoUpdate as g, flip as _, shift as v, useDismiss as y, useFloating as b, useInteractions as x, useListItem as S, useListNavigation as C, useRole as w } from "@floating-ui/react";
|
|
11
11
|
//#region src/components/overlay/ContextMenu/ContextMenu.tsx
|
|
12
12
|
var T = o.createContext(null), E = ({ children: i, menu: o, className: s, disabled: S = !1, asChild: E = !1 }) => {
|
|
13
|
-
let [D, O] = l(!1), [k, A] = l(null), [j, M] = l(!1), N = c([]), P = c(null), F =
|
|
13
|
+
let [D, O] = l(!1), [k, A] = l(null), [j, M] = l(!1), N = c([]), P = c(null), F = n(P), { refs: I, floatingStyles: L, context: R } = b({
|
|
14
14
|
open: D,
|
|
15
15
|
onOpenChange: (e) => {
|
|
16
16
|
O(e), e || (A(null), M(!1));
|
|
@@ -62,7 +62,7 @@ var T = o.createContext(null), E = ({ children: i, menu: o, className: s, disabl
|
|
|
62
62
|
"data-testid": "context-menu-trigger",
|
|
63
63
|
children: [/* @__PURE__ */ d(t, { children: i }), /* @__PURE__ */ d(h, {
|
|
64
64
|
preserveTabOrder: !1,
|
|
65
|
-
children: /* @__PURE__ */ d(
|
|
65
|
+
children: /* @__PURE__ */ d(r, {
|
|
66
66
|
show: D,
|
|
67
67
|
preset: "fade",
|
|
68
68
|
children: /* @__PURE__ */ d(p, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../layout/Transition/Transition.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../../icon/close.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./popover.module.cjs"),s=require("../../_internal/useFloatingElement.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),d=require("@floating-ui/react");var f=c.default.createContext(null),p=({children:e,className:t,defaultOpen:n=!1,open:r,onOpenChange:i,placement:a=`bottom-start`,variant:d=`default`})=>{let{isOpen:p,setOpen:m,refs:h,floatingStyles:g,context:_,getReferenceProps:v,getFloatingProps:y}=s.useFloatingElement({placement:a,open:r,defaultOpen:n,onOpenChange:i,trigger:`click`}),b=()=>m(!1),x=c.default.useId(),[S,C]=c.default.useState(`wim-popover-trigger-${x}`);return(0,u.jsx)(f.Provider,{value:{open:p,onOpenChange:m,refs:h,floatingStyles:g,context:_,getReferenceProps:v,getFloatingProps:y,close:b,variant:d,triggerId:S,setTriggerId:C},children:(0,u.jsx)(`div`,{className:(0,l.default)(`wim-popover`,o.default.root,t),children:e})})},m=c.default.forwardRef(({children:e,className:t,asChild:n,...r},i)=>{let a=c.default.useContext(f);if(a==null)throw Error(`Popover components must be wrapped in <Popover />`);let s=e.ref,p=(0,d.useMergeRefs)([a.refs.setReference,i,s??null]),m=n&&c.default.isValidElement(e)?e.props.id:void 0,h=r.id??m??a.triggerId,{setTriggerId:g}=a;if(c.default.useLayoutEffect(()=>{g(h)},[h,g]),n&&c.default.isValidElement(e)){let n=e.props,i=a.getReferenceProps({ref:p,...r,...n,id:h,className:(0,l.default)(t,n.className)});return c.default.cloneElement(e,{...i,"data-state":a.open?`open`:`closed`})}return(0,u.jsx)(`button`,{ref:p,type:`button`,className:(0,l.default)(o.default.trigger,t),"data-state":a.open?`open`:`closed`,...a.getReferenceProps({...r,id:h}),children:e})});m.displayName=`PopoverTrigger`;var h=c.default.forwardRef(({children:e,className:t,align:n,side:i,style:a,modal:s=!1,...p},m)=>{let h=c.default.useContext(f);if(h==null)throw Error(`Popover components must be wrapped in <Popover />`);let{open:g,refs:_,floatingStyles:v,getFloatingProps:y,context:b,triggerId:x}=h,S=p[`aria-label`]!=null||p[`aria-labelledby`]!=null?p[`aria-labelledby`]:x,C=(0,d.useMergeRefs)([_.setFloating,m]);return(0,u.jsx)(d.FloatingPortal,{children:(0,u.jsx)(r.Transition,{show:g,preset:`fade`,children:(0,u.jsx)(d.FloatingFocusManager,{context:b,modal:s,children:(0,u.jsx)(`div`,{ref:C,style:{...v,...a},className:(0,l.default)(o.default.content,o.default[h.variant],t),role:`dialog`,...y(p),"aria-labelledby":S,children:e})})})})});h.displayName=`PopoverContent`;var g=({children:e,className:r,asChild:s,ariaLabel:d,...p})=>{let{t:m}=t.useWimTranslation(n.commonNs),h=d??m(`a11y.close`),g=c.default.useContext(f);if(!g)return null;let{close:_}=g,v=e=>{_(),p.onClick?.(e)};return s&&c.default.isValidElement(e)?c.default.cloneElement(e,{onClick:t=>{e.props.onClick?.(t),v(t)},className:(0,l.default)(r,e.props.className)}):(0,u.jsx)(`button`,{type:`button`,className:(0,l.default)(o.default.close,r),onClick:v,"aria-label":h,...p,children:e||(0,u.jsx)(a.Icon,{component:i.default,size:`sm`})})};exports.Popover=p,exports.PopoverClose=g,exports.PopoverContent=h,exports.PopoverTrigger=m;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import n from "
|
|
5
|
-
import
|
|
6
|
-
import i from "
|
|
7
|
-
import
|
|
8
|
-
import o from "
|
|
9
|
-
import s from "
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { Transition as n } from "../../layout/Transition/Transition.js";
|
|
5
|
+
import r from "../../../icon/close.js";
|
|
6
|
+
import { Icon as i } from "../../media/Icon/Icon.js";
|
|
7
|
+
import a from "./popover.module.js";
|
|
8
|
+
import { useFloatingElement as o } from "../../_internal/useFloatingElement.js";
|
|
9
|
+
import s from "react";
|
|
10
|
+
import c from "classnames";
|
|
11
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
12
|
+
import { FloatingFocusManager as u, FloatingPortal as d, useMergeRefs as f } from "@floating-ui/react";
|
|
12
13
|
//#region src/components/overlay/Popover/Popover.tsx
|
|
13
|
-
var
|
|
14
|
-
let { isOpen:
|
|
14
|
+
var p = s.createContext(null), m = ({ children: e, className: t, defaultOpen: n = !1, open: r, onOpenChange: i, placement: u = "bottom-start", variant: d = "default" }) => {
|
|
15
|
+
let { isOpen: f, setOpen: m, refs: h, floatingStyles: g, context: _, getReferenceProps: v, getFloatingProps: y } = o({
|
|
15
16
|
placement: u,
|
|
16
17
|
open: r,
|
|
17
18
|
defaultOpen: n,
|
|
18
|
-
onOpenChange:
|
|
19
|
+
onOpenChange: i,
|
|
19
20
|
trigger: "click"
|
|
20
|
-
}), b = () => m(!1), x =
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
}), b = () => m(!1), x = s.useId(), [S, C] = s.useState(`wim-popover-trigger-${x}`);
|
|
22
|
+
return /* @__PURE__ */ l(p.Provider, {
|
|
22
23
|
value: {
|
|
23
|
-
open:
|
|
24
|
+
open: f,
|
|
24
25
|
onOpenChange: m,
|
|
25
26
|
refs: h,
|
|
26
27
|
floatingStyles: g,
|
|
@@ -32,64 +33,64 @@ var f = o.createContext(null), p = ({ children: e, className: t, defaultOpen: n
|
|
|
32
33
|
triggerId: S,
|
|
33
34
|
setTriggerId: C
|
|
34
35
|
},
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
-
className:
|
|
36
|
+
children: /* @__PURE__ */ l("div", {
|
|
37
|
+
className: c("wim-popover", a.root, t),
|
|
37
38
|
children: e
|
|
38
39
|
})
|
|
39
40
|
});
|
|
40
|
-
},
|
|
41
|
-
let
|
|
42
|
-
if (
|
|
43
|
-
let u = e.ref,
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
}, h = s.forwardRef(({ children: e, className: t, asChild: n, ...r }, i) => {
|
|
42
|
+
let o = s.useContext(p);
|
|
43
|
+
if (o == null) throw Error("Popover components must be wrapped in <Popover />");
|
|
44
|
+
let u = e.ref, d = f([
|
|
45
|
+
o.refs.setReference,
|
|
46
|
+
i,
|
|
46
47
|
u ?? null
|
|
47
|
-
]), m = n &&
|
|
48
|
-
if (
|
|
48
|
+
]), m = n && s.isValidElement(e) ? e.props.id : void 0, h = r.id ?? m ?? o.triggerId, { setTriggerId: g } = o;
|
|
49
|
+
if (s.useLayoutEffect(() => {
|
|
49
50
|
g(h);
|
|
50
|
-
}, [h, g]), n &&
|
|
51
|
-
let n = e.props, i =
|
|
52
|
-
ref:
|
|
51
|
+
}, [h, g]), n && s.isValidElement(e)) {
|
|
52
|
+
let n = e.props, i = o.getReferenceProps({
|
|
53
|
+
ref: d,
|
|
53
54
|
...r,
|
|
54
55
|
...n,
|
|
55
56
|
id: h,
|
|
56
|
-
className:
|
|
57
|
+
className: c(t, n.className)
|
|
57
58
|
});
|
|
58
|
-
return
|
|
59
|
+
return s.cloneElement(e, {
|
|
59
60
|
...i,
|
|
60
|
-
"data-state":
|
|
61
|
+
"data-state": o.open ? "open" : "closed"
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
ref:
|
|
64
|
+
return /* @__PURE__ */ l("button", {
|
|
65
|
+
ref: d,
|
|
65
66
|
type: "button",
|
|
66
|
-
className:
|
|
67
|
-
"data-state":
|
|
68
|
-
...
|
|
67
|
+
className: c(a.trigger, t),
|
|
68
|
+
"data-state": o.open ? "open" : "closed",
|
|
69
|
+
...o.getReferenceProps({
|
|
69
70
|
...r,
|
|
70
71
|
id: h
|
|
71
72
|
}),
|
|
72
73
|
children: e
|
|
73
74
|
});
|
|
74
75
|
});
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
let _ =
|
|
76
|
+
h.displayName = "PopoverTrigger";
|
|
77
|
+
var g = s.forwardRef(({ children: e, className: t, align: r, side: i, style: o, modal: m = !1, ...h }, g) => {
|
|
78
|
+
let _ = s.useContext(p);
|
|
78
79
|
if (_ == null) throw Error("Popover components must be wrapped in <Popover />");
|
|
79
|
-
let { open: v, refs: y, floatingStyles: b, getFloatingProps: x, context: S, triggerId: C } = _, w = h["aria-label"] != null || h["aria-labelledby"] != null ? h["aria-labelledby"] : C, T =
|
|
80
|
-
return /* @__PURE__ */
|
|
80
|
+
let { open: v, refs: y, floatingStyles: b, getFloatingProps: x, context: S, triggerId: C } = _, w = h["aria-label"] != null || h["aria-labelledby"] != null ? h["aria-labelledby"] : C, T = f([y.setFloating, g]);
|
|
81
|
+
return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(n, {
|
|
81
82
|
show: v,
|
|
82
83
|
preset: "fade",
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ l(u, {
|
|
84
85
|
context: S,
|
|
85
86
|
modal: m,
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ l("div", {
|
|
87
88
|
ref: T,
|
|
88
89
|
style: {
|
|
89
90
|
...b,
|
|
90
|
-
...
|
|
91
|
+
...o
|
|
91
92
|
},
|
|
92
|
-
className:
|
|
93
|
+
className: c(a.content, a[_.variant], t),
|
|
93
94
|
role: "dialog",
|
|
94
95
|
...x(h),
|
|
95
96
|
"aria-labelledby": w,
|
|
@@ -98,29 +99,29 @@ var h = o.forwardRef(({ children: e, className: n, align: r, side: a, style: p,
|
|
|
98
99
|
})
|
|
99
100
|
}) });
|
|
100
101
|
});
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
let { t:
|
|
104
|
-
if (!
|
|
105
|
-
let { close:
|
|
106
|
-
|
|
102
|
+
g.displayName = "PopoverContent";
|
|
103
|
+
var _ = ({ children: n, className: o, asChild: u, ariaLabel: d, ...f }) => {
|
|
104
|
+
let { t: m } = e(t), h = d ?? m("a11y.close"), g = s.useContext(p);
|
|
105
|
+
if (!g) return null;
|
|
106
|
+
let { close: _ } = g, v = (e) => {
|
|
107
|
+
_(), f.onClick?.(e);
|
|
107
108
|
};
|
|
108
|
-
return
|
|
109
|
+
return u && s.isValidElement(n) ? s.cloneElement(n, {
|
|
109
110
|
onClick: (e) => {
|
|
110
|
-
|
|
111
|
+
n.props.onClick?.(e), v(e);
|
|
111
112
|
},
|
|
112
|
-
className:
|
|
113
|
-
}) : /* @__PURE__ */
|
|
113
|
+
className: c(o, n.props.className)
|
|
114
|
+
}) : /* @__PURE__ */ l("button", {
|
|
114
115
|
type: "button",
|
|
115
|
-
className:
|
|
116
|
-
onClick:
|
|
117
|
-
"aria-label":
|
|
118
|
-
...
|
|
119
|
-
children:
|
|
120
|
-
component:
|
|
116
|
+
className: c(a.close, o),
|
|
117
|
+
onClick: v,
|
|
118
|
+
"aria-label": h,
|
|
119
|
+
...f,
|
|
120
|
+
children: n || /* @__PURE__ */ l(i, {
|
|
121
|
+
component: r,
|
|
121
122
|
size: "sm"
|
|
122
123
|
})
|
|
123
124
|
});
|
|
124
125
|
};
|
|
125
126
|
//#endregion
|
|
126
|
-
export {
|
|
127
|
+
export { m as Popover, _ as PopoverClose, g as PopoverContent, h as PopoverTrigger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("./spoiler.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/components.cjs"),r=require("./spoiler.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({lines:e=3,expanded:s,defaultExpanded:c=!1,onExpandedChange:l,showLabel:u,hideLabel:d,className:f,style:p,children:m,...h},g)=>{let{t:_}=t.useWimTranslation(n.componentsNs),v=i.default.useId(),y=s!==void 0,[b,x]=i.default.useState(c),S=y?s:b,C=i.default.useRef(null),w=i.default.useRef(null),[T,E]=i.default.useState(!1);i.default.useLayoutEffect(()=>{if(S)return;let e=C.current,t=w.current;if(!e||!t)return;let n=()=>{E(t.scrollHeight>e.clientHeight+1)};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[S,e]);let D=()=>{let e=!S;y||x(e),l?.(e)},O=T||S;return(0,o.jsxs)(`div`,{ref:g,className:(0,a.default)(`wim-spoiler`,r.default.root,f),style:{...p,"--wim-spoiler-lines":e},...h,children:[(0,o.jsx)(`div`,{ref:C,id:v,className:(0,a.default)(r.default.content,!S&&r.default.collapsed),children:(0,o.jsx)(`div`,{ref:w,className:r.default.inner,children:m})}),O&&(0,o.jsx)(`button`,{type:`button`,className:r.default.toggle,"aria-expanded":S,"aria-controls":v,onClick:D,children:S?d??_(`spoiler.show_less`):u??_(`spoiler.show_more`)})]})});s.displayName=`Spoiler`,exports.Spoiler=s;
|