wimui 0.51.2 → 0.52.2
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/AIResponseFeedback/airesponse-feedback.module.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/airesponse-feedback.module.js +1 -1
- 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/CodeBlock/code-block.module.cjs +1 -1
- package/dist/components/ai/CodeBlock/code-block.module.js +1 -1
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- 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 +83 -82
- 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/Terminal/terminal.module.cjs +1 -1
- package/dist/components/ai/Terminal/terminal.module.js +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.cjs +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.js +4 -4
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +58 -57
- package/dist/components/ai/ThreadList/thread-list.module.cjs +1 -1
- package/dist/components/ai/ThreadList/thread-list.module.js +1 -1
- 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/Calendar/calendar.module.cjs +1 -1
- package/dist/components/data-display/Calendar/calendar.module.js +1 -1
- 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 +62 -61
- package/dist/components/data-display/Carousel/carousel.module.cjs +1 -1
- package/dist/components/data-display/Carousel/carousel.module.js +1 -1
- 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/Comment/comment.module.cjs +1 -1
- package/dist/components/data-display/Comment/comment.module.js +1 -1
- 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/JsonViewer/json-viewer.module.cjs +1 -1
- package/dist/components/data-display/JsonViewer/json-viewer.module.js +3 -3
- 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 +62 -61
- package/dist/components/data-display/NodeGraph/node-graph.module.cjs +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.js +1 -1
- 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/PivotTable/pivot-table.module.cjs +1 -1
- package/dist/components/data-display/PivotTable/pivot-table.module.js +1 -1
- 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 +49 -48
- 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/Tag/tag.module.cjs +1 -1
- package/dist/components/data-display/Tag/tag.module.js +1 -1
- 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/TreeDiagram/tree-diagram.module.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/tree-diagram.module.js +1 -1
- 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/Banner/banner.module.cjs +1 -1
- package/dist/components/feedback/Banner/banner.module.js +2 -2
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
- package/dist/components/feedback/Notification/notification.module.cjs +1 -1
- package/dist/components/feedback/Notification/notification.module.js +2 -2
- 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 +98 -97
- 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/Combobox/combobox.module.cjs +1 -1
- package/dist/components/form/Combobox/combobox.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/DatePicker/date-picker.module.cjs +1 -1
- package/dist/components/form/DatePicker/date-picker.module.js +1 -1
- 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/InlineEdit/inline-edit.module.cjs +1 -1
- package/dist/components/form/InlineEdit/inline-edit.module.js +1 -1
- 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/Mentions/mentions.module.cjs +1 -1
- package/dist/components/form/Mentions/mentions.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/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/PhoneInput/phone-input.module.cjs +1 -1
- package/dist/components/form/PhoneInput/phone-input.module.js +1 -1
- 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 +30 -29
- package/dist/components/form/Rating/rating.module.cjs +1 -1
- package/dist/components/form/Rating/rating.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/RichTextEditor/rich-text-editor.module.cjs +1 -1
- package/dist/components/form/RichTextEditor/rich-text-editor.module.js +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
- package/dist/components/form/SegmentedControl/segmented-control.module.cjs +1 -1
- package/dist/components/form/SegmentedControl/segmented-control.module.js +1 -1
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +112 -111
- package/dist/components/form/Select/select.module.cjs +1 -1
- package/dist/components/form/Select/select.module.js +1 -1
- 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 +68 -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/ToggleGroup/toggle-group.module.cjs +1 -1
- package/dist/components/form/ToggleGroup/toggle-group.module.js +1 -1
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.js +127 -126
- 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 +90 -89
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +115 -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 +72 -71
- 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 +56 -55
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +136 -135
- 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/CommandPalette/command-palette.module.cjs +1 -1
- package/dist/components/navigation/CommandPalette/command-palette.module.js +1 -1
- 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/HamburgerMenu/hamburger-menu.module.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/hamburger-menu.module.js +1 -1
- package/dist/components/navigation/Menubar/menubar.module.cjs +1 -1
- package/dist/components/navigation/Menubar/menubar.module.js +1 -1
- 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 +50 -47
- package/dist/components/navigation/TabBar/tab-bar.module.cjs +1 -1
- package/dist/components/navigation/TabBar/tab-bar.module.js +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.cjs +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.js +1 -1
- 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/components/typography/Spoiler/spoiler.module.cjs +1 -1
- package/dist/components/typography/Spoiler/spoiler.module.js +1 -1
- 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 +7 -3
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +1 -1
- package/dist/locales/ja/common.json +1 -1
- package/dist/locales/pt/common.json +1 -1
- package/dist/styles.css +1 -1
- 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 -1283
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "../../../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import a from "
|
|
8
|
-
import
|
|
9
|
-
import
|
|
3
|
+
import { componentsNs as t } from "../../../i18n/generated/components.js";
|
|
4
|
+
import n from "../../../icon/chevron-right.js";
|
|
5
|
+
import { Icon as r } from "../../media/Icon/Icon.js";
|
|
6
|
+
import { BaseListItem as i } from "../../_internal/BaseListItem/BaseListItem.js";
|
|
7
|
+
import { VirtualList as a } from "../VirtualList/VirtualList.js";
|
|
8
|
+
import o from "./tree-view.module.js";
|
|
9
|
+
import { useTreeViewItemExpansion as s } from "./useTreeViewItemExpansion.js";
|
|
10
|
+
import c, { createContext as l, useCallback as u, useContext as d, useEffect as ee, useMemo as f, useState as p } from "react";
|
|
10
11
|
import m from "classnames";
|
|
11
12
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/data-display/TreeView/TreeView.tsx
|
|
13
|
-
var _ =
|
|
14
|
-
let e =
|
|
14
|
+
var _ = l(null), v = () => {
|
|
15
|
+
let e = d(_);
|
|
15
16
|
if (!e) throw Error("TreeView components must be used within a TreeView");
|
|
16
17
|
return e;
|
|
17
|
-
},
|
|
18
|
+
}, te = 40, y = 100;
|
|
18
19
|
function b(e) {
|
|
19
20
|
return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
|
|
20
21
|
}
|
|
@@ -74,50 +75,50 @@ function T(e, t) {
|
|
|
74
75
|
effectiveCheckedSet: r
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
var E = ({ children:
|
|
78
|
-
let { t:
|
|
78
|
+
var E = ({ children: s, nodes: l, className: d, multiSelect: v = !1, checkable: S = !1, checkStrategy: E = "cascade", searchable: D = !1, defaultExpandedValues: O = [], defaultSelectedValues: k = [], defaultCheckedValues: ne = [], onCheckedChange: A, onSelectedChange: j, width: re, virtualThreshold: M = y, labels: N = {}, labelId: P, styles: F }) => {
|
|
79
|
+
let { t: I } = e(t), { searchPlaceholder: L, searchAriaLabel: R = I("treeview.search_aria"), expandLabel: z = (e) => I("treeview.expand", { label: e }), collapseLabel: B = (e) => I("treeview.collapse", { label: e }) } = N, [V, ie] = p(O), [H, ae] = p(k), [U, oe] = p(ne), [W, se] = p(""), [G, K] = p(k[0] || null), q = c.useRef(null), { indeterminateValues: J, effectiveCheckedSet: ce } = f(() => !l || E !== "cascade" ? {
|
|
79
80
|
indeterminateValues: [],
|
|
80
81
|
effectiveCheckedSet: new Set(U)
|
|
81
|
-
} : T(
|
|
82
|
-
|
|
82
|
+
} : T(l, new Set(U)), [
|
|
83
|
+
l,
|
|
83
84
|
E,
|
|
84
85
|
U
|
|
85
|
-
]), Y =
|
|
86
|
-
|
|
87
|
-
}, []), X =
|
|
88
|
-
if (v)
|
|
86
|
+
]), Y = u((e) => {
|
|
87
|
+
ie((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
88
|
+
}, []), X = u((e) => {
|
|
89
|
+
if (v) ae((t) => {
|
|
89
90
|
let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
|
|
90
|
-
return
|
|
91
|
+
return j?.(n), n;
|
|
91
92
|
});
|
|
92
93
|
else {
|
|
93
94
|
let t = [e];
|
|
94
|
-
|
|
95
|
+
ae(t), j?.(t);
|
|
95
96
|
}
|
|
96
|
-
}, [v,
|
|
97
|
-
|
|
97
|
+
}, [v, j]), Z = u((e) => {
|
|
98
|
+
oe((t) => {
|
|
98
99
|
let n;
|
|
99
|
-
if (!
|
|
100
|
+
if (!l) return n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e], A?.(n), n;
|
|
100
101
|
if (E === "cascade") {
|
|
101
|
-
let { indeterminateValues: r } = T(
|
|
102
|
+
let { indeterminateValues: r } = T(l, new Set(t)), i = t.includes(e) && !r.includes(e), a = [e, ...C(l, e) ?? []];
|
|
102
103
|
n = i ? t.filter((e) => !a.includes(e)) : [...t, ...a.filter((e) => !t.includes(e))];
|
|
103
|
-
let { indeterminateValues: o, effectiveCheckedSet: s } = T(
|
|
104
|
-
|
|
104
|
+
let { indeterminateValues: o, effectiveCheckedSet: s } = T(l, new Set(n));
|
|
105
|
+
A?.([...s].filter((e) => !o.includes(e)));
|
|
105
106
|
} else {
|
|
106
107
|
if (t.includes(e)) n = t.filter((t) => t !== e);
|
|
107
108
|
else {
|
|
108
|
-
let r = w(
|
|
109
|
+
let r = w(l, e) ?? [], i = C(l, e) ?? [], a = /* @__PURE__ */ new Set([...r, ...i]);
|
|
109
110
|
n = [...t.filter((e) => !a.has(e)), e];
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
A?.(n);
|
|
112
113
|
}
|
|
113
114
|
return n;
|
|
114
115
|
});
|
|
115
116
|
}, [
|
|
116
117
|
E,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
]),
|
|
120
|
-
expandedValues:
|
|
118
|
+
l,
|
|
119
|
+
A
|
|
120
|
+
]), le = f(() => ({
|
|
121
|
+
expandedValues: V,
|
|
121
122
|
selectedValues: H,
|
|
122
123
|
checkedValues: U,
|
|
123
124
|
indeterminateValues: J,
|
|
@@ -132,11 +133,11 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
132
133
|
checkStrategy: E,
|
|
133
134
|
searchQuery: W,
|
|
134
135
|
labels: {
|
|
135
|
-
expandLabel:
|
|
136
|
-
collapseLabel:
|
|
136
|
+
expandLabel: z,
|
|
137
|
+
collapseLabel: B
|
|
137
138
|
}
|
|
138
139
|
}), [
|
|
139
|
-
|
|
140
|
+
V,
|
|
140
141
|
H,
|
|
141
142
|
U,
|
|
142
143
|
J,
|
|
@@ -148,28 +149,28 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
148
149
|
S,
|
|
149
150
|
E,
|
|
150
151
|
W,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
]), Q = f(() =>
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
z,
|
|
153
|
+
B
|
|
154
|
+
]), Q = f(() => l ? x(l, V, W) : [], [
|
|
155
|
+
l,
|
|
156
|
+
V,
|
|
156
157
|
W
|
|
157
|
-
]),
|
|
158
|
+
]), ue = !!l && Q.length >= M, $ = u((e) => {
|
|
158
159
|
let t = q.current;
|
|
159
160
|
if (!t || !e) return;
|
|
160
161
|
let n = Array.from(t.querySelectorAll("[role=\"treeitem\"]")).find((t) => t.getAttribute("data-value") === e);
|
|
161
162
|
n && n !== document.activeElement && n.focus();
|
|
162
163
|
}, []);
|
|
163
|
-
|
|
164
|
-
if (!
|
|
164
|
+
ee(() => {
|
|
165
|
+
if (!l || !G) return;
|
|
165
166
|
let e = q.current, t = document.activeElement;
|
|
166
167
|
e && t && e.contains(t) && (t instanceof HTMLInputElement || $(G));
|
|
167
168
|
}, [
|
|
168
|
-
|
|
169
|
+
l,
|
|
169
170
|
G,
|
|
170
171
|
$
|
|
171
172
|
]);
|
|
172
|
-
let
|
|
173
|
+
let de = u((e, t, n) => {
|
|
173
174
|
switch (e.key) {
|
|
174
175
|
case "Enter":
|
|
175
176
|
case " ":
|
|
@@ -188,9 +189,9 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
188
189
|
e.preventDefault(), Q.length > 0 && K(Q[Q.length - 1].value);
|
|
189
190
|
break;
|
|
190
191
|
case "ArrowRight":
|
|
191
|
-
e.preventDefault(), t.hasChildren && !
|
|
192
|
+
e.preventDefault(), t.hasChildren && !V.includes(t.value) ? Y(t.value) : t.hasChildren && n < Q.length - 1 && K(Q[n + 1].value);
|
|
192
193
|
break;
|
|
193
|
-
case "ArrowLeft": if (e.preventDefault(), t.hasChildren &&
|
|
194
|
+
case "ArrowLeft": if (e.preventDefault(), t.hasChildren && V.includes(t.value)) Y(t.value);
|
|
194
195
|
else for (let e = n - 1; e >= 0; e--) if (Q[e].depth < t.depth) {
|
|
195
196
|
K(Q[e].value);
|
|
196
197
|
break;
|
|
@@ -198,58 +199,58 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
198
199
|
}
|
|
199
200
|
}, [
|
|
200
201
|
Q,
|
|
201
|
-
|
|
202
|
+
V,
|
|
202
203
|
X,
|
|
203
204
|
S,
|
|
204
205
|
Z,
|
|
205
206
|
Y
|
|
206
|
-
]),
|
|
207
|
-
let
|
|
207
|
+
]), fe = u((e, t) => {
|
|
208
|
+
let a = H.includes(e.value), s = ce.has(e.value), c = J.includes(e.value), l = V.includes(e.value), u = G === e.value, d = b(e.label);
|
|
208
209
|
return /* @__PURE__ */ h("div", {
|
|
209
|
-
className: m(
|
|
210
|
+
className: m(o.item, a && o.selected, e.disabled && o.disabled, F?.item),
|
|
210
211
|
role: "treeitem",
|
|
211
212
|
"aria-expanded": e.hasChildren ? l : void 0,
|
|
212
|
-
"aria-selected":
|
|
213
|
+
"aria-selected": a,
|
|
213
214
|
"aria-disabled": e.disabled,
|
|
214
215
|
"aria-setsize": Q.length,
|
|
215
|
-
"aria-posinset":
|
|
216
|
+
"aria-posinset": t + 1,
|
|
216
217
|
"aria-level": e.depth + 1,
|
|
217
218
|
"data-value": e.value,
|
|
218
219
|
tabIndex: u ? 0 : -1,
|
|
219
220
|
onClick: (t) => {
|
|
220
221
|
t.stopPropagation(), K(e.value), e.disabled || (v && S ? Z(e.value) : X(e.value));
|
|
221
222
|
},
|
|
222
|
-
onKeyDown: (
|
|
223
|
-
|
|
223
|
+
onKeyDown: (n) => {
|
|
224
|
+
n.key !== "Tab" && n.key !== "Escape" && n.stopPropagation(), de(n, e, t);
|
|
224
225
|
},
|
|
225
226
|
onFocus: (t) => {
|
|
226
227
|
t.stopPropagation(), K(e.value);
|
|
227
228
|
},
|
|
228
229
|
style: { paddingLeft: e.depth * 20 },
|
|
229
|
-
children: /* @__PURE__ */ h(
|
|
230
|
-
className: m(
|
|
231
|
-
active:
|
|
230
|
+
children: /* @__PURE__ */ h(i, {
|
|
231
|
+
className: m(o.labelContainer, F?.labelContainer),
|
|
232
|
+
active: a,
|
|
232
233
|
disabled: e.disabled,
|
|
233
234
|
icon: /* @__PURE__ */ g("div", {
|
|
234
|
-
className: m(
|
|
235
|
+
className: m(o.iconWrapper, F?.iconWrapper),
|
|
235
236
|
children: [
|
|
236
237
|
e.hasChildren ? /* @__PURE__ */ h("button", {
|
|
237
238
|
type: "button",
|
|
238
|
-
className: m(
|
|
239
|
+
className: m(o.expandBtn, l && o.expanded, F?.expandBtn),
|
|
239
240
|
onClick: (t) => {
|
|
240
241
|
t.stopPropagation(), e.disabled || Y(e.value);
|
|
241
242
|
},
|
|
242
243
|
disabled: e.disabled,
|
|
243
|
-
"aria-label": l ?
|
|
244
|
+
"aria-label": l ? B(d) : z(d),
|
|
244
245
|
tabIndex: -1,
|
|
245
|
-
children: /* @__PURE__ */ h(
|
|
246
|
-
component:
|
|
246
|
+
children: /* @__PURE__ */ h(r, {
|
|
247
|
+
component: n,
|
|
247
248
|
size: "sm"
|
|
248
249
|
})
|
|
249
|
-
}) : /* @__PURE__ */ h("span", { className:
|
|
250
|
+
}) : /* @__PURE__ */ h("span", { className: o.spacer }),
|
|
250
251
|
S && /* @__PURE__ */ h("input", {
|
|
251
252
|
type: "checkbox",
|
|
252
|
-
className: m(
|
|
253
|
+
className: m(o.checkbox, F?.checkbox),
|
|
253
254
|
checked: s && !c,
|
|
254
255
|
ref: (e) => {
|
|
255
256
|
e && (e.indeterminate = c);
|
|
@@ -263,7 +264,7 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
263
264
|
tabIndex: -1
|
|
264
265
|
}),
|
|
265
266
|
e.icon && /* @__PURE__ */ h("span", {
|
|
266
|
-
className: m(
|
|
267
|
+
className: m(o.icon, F?.icon),
|
|
267
268
|
children: e.icon
|
|
268
269
|
})
|
|
269
270
|
]
|
|
@@ -273,9 +274,9 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
273
274
|
}, e.value);
|
|
274
275
|
}, [
|
|
275
276
|
H,
|
|
276
|
-
|
|
277
|
+
ce,
|
|
277
278
|
J,
|
|
278
|
-
|
|
279
|
+
V,
|
|
279
280
|
G,
|
|
280
281
|
Q.length,
|
|
281
282
|
v,
|
|
@@ -283,77 +284,77 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
283
284
|
X,
|
|
284
285
|
Z,
|
|
285
286
|
Y,
|
|
286
|
-
|
|
287
|
-
R,
|
|
287
|
+
de,
|
|
288
288
|
z,
|
|
289
|
-
|
|
289
|
+
B,
|
|
290
|
+
F
|
|
290
291
|
]);
|
|
291
292
|
return /* @__PURE__ */ h(_.Provider, {
|
|
292
|
-
value:
|
|
293
|
+
value: le,
|
|
293
294
|
children: /* @__PURE__ */ g("div", {
|
|
294
295
|
ref: q,
|
|
295
296
|
"data-testid": "tree-view-root",
|
|
296
|
-
className: m("wim-tree-view",
|
|
297
|
+
className: m("wim-tree-view", o.root, !!l && o.dataDriven, d, F?.root),
|
|
297
298
|
role: "tree",
|
|
298
299
|
"aria-label": N.treeAriaLabel,
|
|
299
|
-
"aria-labelledby": N.treeAriaLabel ? void 0 :
|
|
300
|
+
"aria-labelledby": N.treeAriaLabel ? void 0 : P,
|
|
300
301
|
style: {
|
|
301
|
-
width:
|
|
302
|
+
width: re,
|
|
302
303
|
maxWidth: "100%"
|
|
303
304
|
},
|
|
304
305
|
tabIndex: G ? -1 : 0,
|
|
305
306
|
onFocus: (e) => {
|
|
306
|
-
e.target === q.current && (
|
|
307
|
+
e.target === q.current && (l ? G ? $(G) : Q.length > 0 && (K(Q[0].value), $(Q[0].value)) : G ? (q.current?.querySelector(`[role="treeitem"][data-value="${G}"]`))?.focus() : (q.current?.querySelector("[role=\"treeitem\"]"))?.focus());
|
|
307
308
|
},
|
|
308
309
|
children: [D && /* @__PURE__ */ h("div", {
|
|
309
|
-
className: m(
|
|
310
|
+
className: m(o.search, F?.search),
|
|
310
311
|
children: /* @__PURE__ */ h("input", {
|
|
311
312
|
type: "text",
|
|
312
313
|
"data-testid": "tree-view-search-input",
|
|
313
|
-
className: m(
|
|
314
|
-
placeholder:
|
|
314
|
+
className: m(o.searchInput, F?.searchInput),
|
|
315
|
+
placeholder: L,
|
|
315
316
|
value: W,
|
|
316
|
-
onChange: (e) =>
|
|
317
|
-
"aria-label":
|
|
317
|
+
onChange: (e) => se(e.target.value),
|
|
318
|
+
"aria-label": R
|
|
318
319
|
})
|
|
319
|
-
}),
|
|
320
|
+
}), l ? ue ? /* @__PURE__ */ h(a, {
|
|
320
321
|
items: Q,
|
|
321
|
-
itemHeight:
|
|
322
|
+
itemHeight: te,
|
|
322
323
|
height: 400,
|
|
323
|
-
renderItem:
|
|
324
|
+
renderItem: fe,
|
|
324
325
|
itemRole: "none",
|
|
325
326
|
role: "presentation"
|
|
326
|
-
}) : Q.map((e, t) =>
|
|
327
|
+
}) : Q.map((e, t) => fe(e, t)) : s]
|
|
327
328
|
})
|
|
328
329
|
});
|
|
329
|
-
}, D = ({ value: e, label:
|
|
330
|
-
let { expandedValues:
|
|
331
|
-
if (!
|
|
332
|
-
let e = (t) =>
|
|
333
|
-
if (!
|
|
330
|
+
}, D = ({ value: e, label: t, icon: a, children: l, className: u, disabled: d = !1 }) => {
|
|
331
|
+
let { expandedValues: ee, selectedValues: f, checkedValues: p, indeterminateValues: _, focusedValue: te, toggleExpand: y, select: x, toggleCheck: S, setFocusedValue: C, containerRef: w, multiSelect: T, checkable: E, searchQuery: O } = v(), k = c.useId(), ne = `wim-tree-view-item-checkbox-${k}`, A = `wim-tree-view-item-label-${k}`, j = b(t), re = !O || j.toLowerCase().includes(O.toLowerCase()), M = c.useMemo(() => {
|
|
332
|
+
if (!O || !l) return !1;
|
|
333
|
+
let e = (t) => c.Children.toArray(t).some((t) => {
|
|
334
|
+
if (!c.isValidElement(t) || t.type !== D) return !1;
|
|
334
335
|
let n = t.props, r = n.label;
|
|
335
|
-
return b(r).toLowerCase().includes(
|
|
336
|
+
return b(r).toLowerCase().includes(O.toLowerCase()) ? !0 : n.children ? e(n.children) : !1;
|
|
336
337
|
});
|
|
337
338
|
return e(l);
|
|
338
|
-
}, [l,
|
|
339
|
-
return
|
|
340
|
-
className: m(
|
|
339
|
+
}, [l, O]), N = !!O && M, P = ee.includes(e) || N, F = f.includes(e), I = p.includes(e), L = _.includes(e), R = !!c.Children.count(l), { shouldRender: z, isVisualExpanded: B, handleTransitionEnd: V } = s(P);
|
|
340
|
+
return O && !re && !M ? null : /* @__PURE__ */ g("div", {
|
|
341
|
+
className: m(o.item, F && o.selected, d && o.disabled, u),
|
|
341
342
|
role: "treeitem",
|
|
342
343
|
"aria-expanded": R ? P : void 0,
|
|
343
344
|
"aria-selected": F,
|
|
344
345
|
"aria-disabled": d,
|
|
345
346
|
"data-value": e,
|
|
346
347
|
onClick: (t) => {
|
|
347
|
-
t.stopPropagation(),
|
|
348
|
+
t.stopPropagation(), C(e), d || (T && E ? S(e) : x(e));
|
|
348
349
|
},
|
|
349
350
|
onKeyDown: (t) => {
|
|
350
351
|
if (d) return;
|
|
351
352
|
t.key !== "Tab" && t.key !== "Escape" && t.stopPropagation();
|
|
352
|
-
let n = Array.from(
|
|
353
|
+
let n = Array.from(w.current?.querySelectorAll("[role=\"treeitem\"]:not([aria-disabled=\"true\"])") || []), r = n.indexOf(t.currentTarget);
|
|
353
354
|
switch (t.key) {
|
|
354
355
|
case "Enter":
|
|
355
356
|
case " ":
|
|
356
|
-
t.preventDefault(),
|
|
357
|
+
t.preventDefault(), x(e), E && S(e);
|
|
357
358
|
break;
|
|
358
359
|
case "ArrowDown":
|
|
359
360
|
t.preventDefault(), r < n.length - 1 && n[r + 1].focus();
|
|
@@ -368,9 +369,9 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
368
369
|
t.preventDefault(), n.length > 0 && n[n.length - 1].focus();
|
|
369
370
|
break;
|
|
370
371
|
case "ArrowRight":
|
|
371
|
-
R && (P ? (t.preventDefault(), r < n.length - 1 && n[r + 1].focus()) : (t.preventDefault(),
|
|
372
|
+
R && (P ? (t.preventDefault(), r < n.length - 1 && n[r + 1].focus()) : (t.preventDefault(), y(e)));
|
|
372
373
|
break;
|
|
373
|
-
case "ArrowLeft": if (R && P) t.preventDefault(),
|
|
374
|
+
case "ArrowLeft": if (R && P) t.preventDefault(), y(e);
|
|
374
375
|
else {
|
|
375
376
|
t.preventDefault();
|
|
376
377
|
let e = t.currentTarget.parentElement?.closest("[role=\"treeitem\"]");
|
|
@@ -379,61 +380,61 @@ var E = ({ children: o, nodes: c, className: u, multiSelect: v = !1, checkable:
|
|
|
379
380
|
}
|
|
380
381
|
},
|
|
381
382
|
onFocus: (t) => {
|
|
382
|
-
t.stopPropagation(),
|
|
383
|
+
t.stopPropagation(), C(e);
|
|
383
384
|
},
|
|
384
|
-
tabIndex:
|
|
385
|
-
children: [/* @__PURE__ */ h(
|
|
386
|
-
id:
|
|
387
|
-
className:
|
|
385
|
+
tabIndex: te === e ? 0 : -1,
|
|
386
|
+
children: [/* @__PURE__ */ h(i, {
|
|
387
|
+
id: A,
|
|
388
|
+
className: o.labelContainer,
|
|
388
389
|
active: F,
|
|
389
390
|
disabled: d,
|
|
390
391
|
icon: /* @__PURE__ */ g("div", {
|
|
391
|
-
className:
|
|
392
|
+
className: o.iconWrapper,
|
|
392
393
|
children: [
|
|
393
394
|
R && /* @__PURE__ */ h("button", {
|
|
394
395
|
type: "button",
|
|
395
|
-
className: m(
|
|
396
|
+
className: m(o.expandBtn, P && o.expanded),
|
|
396
397
|
onClick: (t) => {
|
|
397
|
-
t.stopPropagation(), !d && R &&
|
|
398
|
+
t.stopPropagation(), !d && R && y(e);
|
|
398
399
|
},
|
|
399
400
|
disabled: d,
|
|
400
|
-
"aria-label": P ? `Collapse ${typeof
|
|
401
|
+
"aria-label": P ? `Collapse ${typeof t == "string" ? t : ""}` : `Expand ${typeof t == "string" ? t : ""}`,
|
|
401
402
|
tabIndex: -1,
|
|
402
|
-
children: /* @__PURE__ */ h(
|
|
403
|
-
component:
|
|
403
|
+
children: /* @__PURE__ */ h(r, {
|
|
404
|
+
component: n,
|
|
404
405
|
size: "sm"
|
|
405
406
|
})
|
|
406
407
|
}),
|
|
407
|
-
!R && /* @__PURE__ */ h("span", { className:
|
|
408
|
-
|
|
409
|
-
id:
|
|
408
|
+
!R && /* @__PURE__ */ h("span", { className: o.spacer }),
|
|
409
|
+
E && /* @__PURE__ */ h("input", {
|
|
410
|
+
id: ne,
|
|
410
411
|
type: "checkbox",
|
|
411
|
-
className:
|
|
412
|
+
className: o.checkbox,
|
|
412
413
|
checked: I && !L,
|
|
413
414
|
ref: (e) => {
|
|
414
415
|
e && (e.indeterminate = L);
|
|
415
416
|
},
|
|
416
417
|
onChange: (t) => {
|
|
417
|
-
t.stopPropagation(), d ||
|
|
418
|
+
t.stopPropagation(), d || S(e);
|
|
418
419
|
},
|
|
419
420
|
disabled: d,
|
|
420
421
|
onClick: (e) => e.stopPropagation(),
|
|
421
|
-
"aria-labelledby":
|
|
422
|
+
"aria-labelledby": A,
|
|
422
423
|
tabIndex: -1
|
|
423
424
|
}),
|
|
424
|
-
|
|
425
|
-
className:
|
|
426
|
-
children:
|
|
425
|
+
a && /* @__PURE__ */ h("span", {
|
|
426
|
+
className: o.icon,
|
|
427
|
+
children: a
|
|
427
428
|
})
|
|
428
429
|
]
|
|
429
430
|
}),
|
|
430
|
-
children:
|
|
431
|
+
children: t
|
|
431
432
|
}), R && z && /* @__PURE__ */ h("div", {
|
|
432
|
-
className: m(
|
|
433
|
+
className: m(o.children, B && o.expanded),
|
|
433
434
|
onTransitionEnd: V,
|
|
434
435
|
style: { gridTemplateRows: B ? "1fr" : "0fr" },
|
|
435
436
|
children: /* @__PURE__ */ h("div", {
|
|
436
|
-
className:
|
|
437
|
+
className: o.childrenInner,
|
|
437
438
|
role: "group",
|
|
438
439
|
children: l
|
|
439
440
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/alert-circle.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../../icon/alert-circle.cjs"),i=require("../../../icon/check-circle.cjs"),a=require("../../../icon/spinner.cjs"),o=require("./autosave.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.forwardRef(({status:e,savedAt:s,errorMessage:u,className:d,...f},p)=>{let{t:m}=t.useWimTranslation(n.commonNs);if(e===`idle`)return null;let h=(()=>{switch(e){case`saving`:return m(`autosave.saving`);case`saved`:return s?m(`autosave.saved_at`,{time:s.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}):m(`autosave.saved`);case`error`:return u??m(`autosave.error`)}})();return(0,l.jsxs)(`div`,{ref:p,role:`status`,"aria-live":`polite`,"aria-label":m(`autosave.aria_label`),className:(0,c.default)(`wim-autosave`,o.default.root,o.default[e],d),...f,children:[(0,l.jsxs)(`span`,{className:o.default.icon,"aria-hidden":`true`,children:[e===`saving`&&(0,l.jsx)(a.default,{className:o.default.spinner}),e===`saved`&&(0,l.jsx)(i.default,{}),e===`error`&&(0,l.jsx)(r.default,{})]}),(0,l.jsx)(`span`,{className:o.default.label,children:h})]})});u.displayName=`Autosave`,exports.Autosave=u;
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "../../../
|
|
4
|
-
import n from "../../../icon/
|
|
5
|
-
import r from "../../../icon/
|
|
6
|
-
import i from "
|
|
7
|
-
import a from "
|
|
8
|
-
import o from "
|
|
9
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import n from "../../../icon/alert-circle.js";
|
|
5
|
+
import r from "../../../icon/check-circle.js";
|
|
6
|
+
import i from "../../../icon/spinner.js";
|
|
7
|
+
import a from "./autosave.module.js";
|
|
8
|
+
import o from "react";
|
|
9
|
+
import s from "classnames";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/feedback/Autosave/Autosave.tsx
|
|
11
|
-
var
|
|
12
|
-
let { t:
|
|
13
|
-
if (
|
|
14
|
-
let
|
|
15
|
-
switch (
|
|
16
|
-
case "saving": return
|
|
17
|
-
case "saved": return
|
|
12
|
+
var u = o.forwardRef(({ status: o, savedAt: u, errorMessage: d, className: f, ...p }, m) => {
|
|
13
|
+
let { t: h } = e(t);
|
|
14
|
+
if (o === "idle") return null;
|
|
15
|
+
let g = (() => {
|
|
16
|
+
switch (o) {
|
|
17
|
+
case "saving": return h("autosave.saving");
|
|
18
|
+
case "saved": return u ? h("autosave.saved_at", { time: u.toLocaleTimeString(void 0, {
|
|
18
19
|
hour: "2-digit",
|
|
19
20
|
minute: "2-digit"
|
|
20
|
-
}) }) :
|
|
21
|
-
case "error": return
|
|
21
|
+
}) }) : h("autosave.saved");
|
|
22
|
+
case "error": return d ?? h("autosave.error");
|
|
22
23
|
}
|
|
23
24
|
})();
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
ref:
|
|
25
|
+
return /* @__PURE__ */ l("div", {
|
|
26
|
+
ref: m,
|
|
26
27
|
role: "status",
|
|
27
28
|
"aria-live": "polite",
|
|
28
|
-
"aria-label":
|
|
29
|
-
className:
|
|
30
|
-
...
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
-
className:
|
|
29
|
+
"aria-label": h("autosave.aria_label"),
|
|
30
|
+
className: s("wim-autosave", a.root, a[o], f),
|
|
31
|
+
...p,
|
|
32
|
+
children: [/* @__PURE__ */ l("span", {
|
|
33
|
+
className: a.icon,
|
|
33
34
|
"aria-hidden": "true",
|
|
34
35
|
children: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
o === "saving" && /* @__PURE__ */ c(i, { className: a.spinner }),
|
|
37
|
+
o === "saved" && /* @__PURE__ */ c(r, {}),
|
|
38
|
+
o === "error" && /* @__PURE__ */ c(n, {})
|
|
38
39
|
]
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children:
|
|
40
|
+
}), /* @__PURE__ */ c("span", {
|
|
41
|
+
className: a.label,
|
|
42
|
+
children: g
|
|
42
43
|
})]
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
+
u.displayName = "Autosave";
|
|
46
47
|
//#endregion
|
|
47
|
-
export {
|
|
48
|
+
export { u as Autosave };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_lw698_23`,t=`_container_lw698_42`,n=`_content_lw698_51`,r=`_icon_lw698_58`,i=`_text_lw698_66`,a=`_title_lw698_71`,o=`_separator_lw698_74`,s=`_description_lw698_84`,c=`_actions_lw698_87`,l=`_close_lw698_93`,u=`_info_lw698_143`,d=`_success_lw698_151`,f=`_warning_lw698_159`,p=`_danger_lw698_167`,m={root:e,container:t,content:n,icon:r,text:i,title:a,separator:o,description:s,actions:c,close:l,default:`_default_lw698_136`,info:u,success:d,warning:f,danger:p};exports.actions=c,exports.close=l,exports.container=t,exports.content=n,exports.danger=p,exports.default=m,exports.description=s,exports.icon=r,exports.info=u,exports.root=e,exports.separator=o,exports.success=d,exports.text=i,exports.title=a,exports.warning=f;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Banner/banner.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_lw698_23", t = "_container_lw698_42", n = "_content_lw698_51", r = "_icon_lw698_58", i = "_text_lw698_66", a = "_title_lw698_71", o = "_separator_lw698_74", s = "_description_lw698_84", c = "_actions_lw698_87", l = "_close_lw698_93", u = "_info_lw698_143", d = "_success_lw698_151", f = "_warning_lw698_159", p = "_danger_lw698_167", m = {
|
|
4
4
|
root: e,
|
|
5
5
|
container: t,
|
|
6
6
|
content: n,
|
|
@@ -11,7 +11,7 @@ var e = "_root_1gv69_23", t = "_container_1gv69_42", n = "_content_1gv69_51", r
|
|
|
11
11
|
description: s,
|
|
12
12
|
actions: c,
|
|
13
13
|
close: l,
|
|
14
|
-
default: "
|
|
14
|
+
default: "_default_lw698_136",
|
|
15
15
|
info: u,
|
|
16
16
|
success: d,
|
|
17
17
|
warning: f,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/Box/Box.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../layout/Stack/Stack.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/Box/Box.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../i18n/generated/common.cjs"),i=require("../../layout/Stack/Stack.cjs"),a=require("../../form/Button/Button.cjs"),o=require("../Alert/Alert.cjs"),s=require("./errorboundary.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=({error:e,errorInfo:u,reset:d,labels:f})=>{let{t:p}=n.useWimTranslation(r.commonNs),[m,h]=(0,c.useState)(!1),g={title:f?.title??p(`error.boundary_title`),retry:f?.retry??p(`error.boundary_retry`),showDetails:f?.showDetails??p(`error.boundary_show_details`),hideDetails:f?.hideDetails??p(`error.boundary_hide_details`)};return(0,l.jsx)(t.Box,{p:`lg`,radius:`md`,bg:`var(--wim-color-danger-subtle)`,className:`wim-error-boundary ${s.default.fallback}`,children:(0,l.jsxs)(i.Stack,{gap:`md`,children:[(0,l.jsx)(o.Alert,{intent:`danger`,title:g.title,description:e.message}),(0,l.jsxs)(i.Stack,{direction:`row`,gap:`sm`,wrap:!0,children:[(0,l.jsx)(a.Button,{onClick:d,variant:`solid`,children:g.retry}),(0,l.jsx)(a.Button,{onClick:()=>h(!m),variant:`outline`,children:m?g.hideDetails:g.showDetails})]}),m&&(0,l.jsx)(t.Box,{p:`md`,bg:`surface-inset`,radius:`component`,className:s.default.details,children:(0,l.jsxs)(`code`,{children:[e.toString(),(0,l.jsx)(`br`,{}),u?.componentStack]})})]})})},d=class extends c.Component{state={hasError:!1,error:null,errorInfo:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({errorInfo:t}),this.props.onError?.(e,t)}reset=()=>{this.setState({hasError:!1,error:null,errorInfo:null}),this.props.onReset?.()};render(){let{hasError:e,error:t,errorInfo:n}=this.state,{children:r,fallback:i,labels:a}=this.props;return e&&t?typeof i==`function`?i(t,n,this.reset):i||(0,l.jsx)(u,{error:t,errorInfo:n,reset:this.reset,labels:a}):r}};exports.ErrorBoundary=d;
|