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,20 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import l from "
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import h from "
|
|
15
|
-
import
|
|
3
|
+
import { componentsNs as t } from "../../../i18n/generated/components.js";
|
|
4
|
+
import { Button as n } from "../Button/Button.js";
|
|
5
|
+
import { Input as r } from "../Input/Input.js";
|
|
6
|
+
import { DatePicker as i } from "../DatePicker/DatePicker.js";
|
|
7
|
+
import { NumberInput as a } from "../NumberInput/NumberInput.js";
|
|
8
|
+
import { SegmentedControl as o } from "../SegmentedControl/SegmentedControl.js";
|
|
9
|
+
import { Select as s } from "../Select/Select.js";
|
|
10
|
+
import { Switch as c } from "../Switch/Switch.js";
|
|
11
|
+
import { IconButton as l } from "../IconButton/IconButton.js";
|
|
12
|
+
import u from "./querybuilder.module.js";
|
|
13
|
+
import { warnUnknownOperator as d } from "./warn-unknown-operator.js";
|
|
14
|
+
import { useCallback as f, useId as p, useRef as m, useState as h } from "react";
|
|
15
|
+
import g from "classnames";
|
|
16
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
16
17
|
//#region src/components/form/QueryBuilder/QueryBuilder.tsx
|
|
17
|
-
var
|
|
18
|
+
var y = 0, b = () => typeof window < "u" && window.__VRT__ ? (y += 1, `vrt-id-${y}`) : Math.random().toString(36).substring(2, 11), x = {
|
|
18
19
|
string: [
|
|
19
20
|
{
|
|
20
21
|
value: "=",
|
|
@@ -131,19 +132,19 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
131
132
|
key: "is_not_null"
|
|
132
133
|
}
|
|
133
134
|
]
|
|
134
|
-
},
|
|
135
|
-
let { t: E } = e(
|
|
136
|
-
id:
|
|
135
|
+
}, S = ({ fields: y, query: S, defaultQuery: C, onChange: w, maxDepth: ee = 3, className: te, id: ne, labels: T = {} }) => {
|
|
136
|
+
let { t: E } = e(t), { ruleAdded: D = E("query.builder.rule_added"), groupAdded: O = E("query.builder.group_added"), removed: k = E("query.builder.removed"), ruleAriaLabel: A = E("query.builder.rule"), fieldAriaLabel: j = E("query.builder.field"), operatorAriaLabel: M = E("query.builder.operator"), valueAriaLabel: N = E("query.builder.value"), trueLabel: P = E("query.builder.true"), falseLabel: F = E("query.builder.false"), removeRuleAriaLabel: I = E("query.builder.remove_rule"), removeGroupAriaLabel: L = E("query.builder.remove_group"), addRuleLabel: R = E("query.builder.add_rule"), addGroupLabel: z = E("query.builder.add_group"), regionAriaLabel: B = E("query.builder.region_label"), combinatorAriaLabel: V = E("query.builder.combinator"), operators: H = {} } = T, U = p(), W = ne || `wim-qb-${U}`, G = m(null), [K, q] = h(C || {
|
|
137
|
+
id: b(),
|
|
137
138
|
combinator: "and",
|
|
138
139
|
not: !1,
|
|
139
140
|
rules: []
|
|
140
|
-
}), J =
|
|
141
|
+
}), J = S === void 0 ? K : S, Y = f((e) => {
|
|
141
142
|
G.current && (G.current.textContent = "", setTimeout(() => {
|
|
142
143
|
G.current && (G.current.textContent = e);
|
|
143
144
|
}, 50));
|
|
144
|
-
}, []), X =
|
|
145
|
-
|
|
146
|
-
}, [
|
|
145
|
+
}, []), X = f((e) => {
|
|
146
|
+
S === void 0 && q(e), w?.(e);
|
|
147
|
+
}, [S, w]), Z = (e, t) => {
|
|
147
148
|
let n = (r) => r.id === e ? {
|
|
148
149
|
...r,
|
|
149
150
|
...t
|
|
@@ -155,9 +156,9 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
155
156
|
} : "rules" in r ? n(r) : r)
|
|
156
157
|
};
|
|
157
158
|
X(n(J));
|
|
158
|
-
},
|
|
159
|
-
let t =
|
|
160
|
-
id:
|
|
159
|
+
}, re = (e) => {
|
|
160
|
+
let t = y[0], n = {
|
|
161
|
+
id: b(),
|
|
161
162
|
field: t?.name || "",
|
|
162
163
|
operator: "=",
|
|
163
164
|
value: t?.type !== "boolean" && ""
|
|
@@ -169,9 +170,9 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
169
170
|
rules: t.rules.map((e) => "rules" in e ? r(e) : e)
|
|
170
171
|
};
|
|
171
172
|
X(r(J)), Y(D);
|
|
172
|
-
},
|
|
173
|
+
}, ie = (e) => {
|
|
173
174
|
let t = {
|
|
174
|
-
id:
|
|
175
|
+
id: b(),
|
|
175
176
|
combinator: "and",
|
|
176
177
|
not: !1,
|
|
177
178
|
rules: []
|
|
@@ -189,18 +190,18 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
189
190
|
rules: n.rules.filter((t) => t.id !== e).map((e) => "rules" in e ? t(e) : e)
|
|
190
191
|
});
|
|
191
192
|
X(t(J)), Y(k);
|
|
192
|
-
}, $ = (e,
|
|
193
|
+
}, $ = (e, t, r) => {
|
|
193
194
|
let i = `${e.combinator.toUpperCase()} group`;
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ v("div", {
|
|
195
196
|
role: "group",
|
|
196
197
|
"aria-label": i,
|
|
197
|
-
className:
|
|
198
|
+
className: g(u.group, t > 0 && u.nested, r && u.excluded),
|
|
198
199
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
className:
|
|
201
|
-
children: [/* @__PURE__ */
|
|
202
|
-
className:
|
|
203
|
-
children: [/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ v("div", {
|
|
201
|
+
className: u.groupHeader,
|
|
202
|
+
children: [/* @__PURE__ */ v("div", {
|
|
203
|
+
className: u.groupHeaderLeft,
|
|
204
|
+
children: [/* @__PURE__ */ _(o, {
|
|
204
205
|
size: "md",
|
|
205
206
|
options: [{
|
|
206
207
|
label: "AND",
|
|
@@ -213,88 +214,88 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
213
214
|
onChange: (t) => Z(e.id, { combinator: t }),
|
|
214
215
|
"aria-label": V,
|
|
215
216
|
styles: {
|
|
216
|
-
root:
|
|
217
|
-
item:
|
|
218
|
-
slider:
|
|
217
|
+
root: u.segmentedControl,
|
|
218
|
+
item: u.segmentedControlItem,
|
|
219
|
+
slider: u.segmentedControlSlider
|
|
219
220
|
}
|
|
220
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ _(c, {
|
|
221
222
|
size: "md",
|
|
222
223
|
checked: e.not,
|
|
223
224
|
onChange: (t) => Z(e.id, { not: t.target.checked }),
|
|
224
225
|
children: "NOT"
|
|
225
226
|
})]
|
|
226
|
-
}),
|
|
227
|
+
}), t > 0 && /* @__PURE__ */ _(l, {
|
|
227
228
|
iconName: "TrashIcon",
|
|
228
229
|
"aria-label": L,
|
|
229
230
|
variant: "ghost",
|
|
230
231
|
size: "md",
|
|
231
232
|
intent: "danger",
|
|
232
233
|
onClick: () => Q(e.id),
|
|
233
|
-
className:
|
|
234
|
+
className: u.removeGroup
|
|
234
235
|
})]
|
|
235
236
|
}),
|
|
236
|
-
/* @__PURE__ */ g("div", {
|
|
237
|
-
className: l.ruleList,
|
|
238
|
-
children: e.rules.map((e) => "rules" in e ? $(e, n + 1, r) : ie(e))
|
|
239
|
-
}),
|
|
240
237
|
/* @__PURE__ */ _("div", {
|
|
241
|
-
className:
|
|
242
|
-
children:
|
|
238
|
+
className: u.ruleList,
|
|
239
|
+
children: e.rules.map((e) => "rules" in e ? $(e, t + 1, r) : ae(e))
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ v("div", {
|
|
242
|
+
className: u.groupActions,
|
|
243
|
+
children: [/* @__PURE__ */ _(n, {
|
|
243
244
|
size: "md",
|
|
244
245
|
variant: "ghost",
|
|
245
246
|
icon: "PlusIcon",
|
|
246
|
-
onClick: () =>
|
|
247
|
+
onClick: () => re(e.id),
|
|
247
248
|
children: R
|
|
248
|
-
}),
|
|
249
|
+
}), t < ee && /* @__PURE__ */ _(n, {
|
|
249
250
|
size: "md",
|
|
250
251
|
variant: "ghost",
|
|
251
252
|
icon: "PlusIcon",
|
|
252
|
-
onClick: () =>
|
|
253
|
+
onClick: () => ie(e.id),
|
|
253
254
|
children: z
|
|
254
255
|
})]
|
|
255
256
|
})
|
|
256
257
|
]
|
|
257
258
|
}, e.id);
|
|
258
|
-
},
|
|
259
|
-
let t =
|
|
259
|
+
}, ae = (e) => {
|
|
260
|
+
let t = y.find((t) => t.name === e.field)?.type || "string", n = x[t].map((e) => ({
|
|
260
261
|
...e,
|
|
261
262
|
label: H[e.key] || E(`query.builder.operators.${e.key}`)
|
|
262
|
-
})),
|
|
263
|
-
let n =
|
|
263
|
+
})), o = (t) => {
|
|
264
|
+
let n = y.find((e) => e.name === t);
|
|
264
265
|
Z(e.id, {
|
|
265
266
|
field: t,
|
|
266
267
|
operator: "=",
|
|
267
268
|
value: n?.type !== "boolean" && ""
|
|
268
269
|
});
|
|
269
270
|
};
|
|
270
|
-
|
|
271
|
-
let
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
className:
|
|
271
|
+
n.some((t) => t.value === e.operator) || d(e.operator, t, n.map((e) => e.value));
|
|
272
|
+
let c = e.operator === "is_null" || e.operator === "is_not_null";
|
|
273
|
+
return /* @__PURE__ */ _("div", {
|
|
274
|
+
className: u.rule,
|
|
274
275
|
role: "group",
|
|
275
276
|
"aria-label": A,
|
|
276
|
-
children: /* @__PURE__ */
|
|
277
|
-
className:
|
|
277
|
+
children: /* @__PURE__ */ v("div", {
|
|
278
|
+
className: u.ruleFields,
|
|
278
279
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
className:
|
|
281
|
-
options:
|
|
280
|
+
/* @__PURE__ */ _(s, {
|
|
281
|
+
className: u.field,
|
|
282
|
+
options: y.map((e) => ({
|
|
282
283
|
label: e.label,
|
|
283
284
|
value: e.name
|
|
284
285
|
})),
|
|
285
286
|
value: e.field,
|
|
286
|
-
onChange:
|
|
287
|
+
onChange: o,
|
|
287
288
|
"aria-label": j,
|
|
288
289
|
fullWidth: !0,
|
|
289
290
|
styles: {
|
|
290
|
-
root:
|
|
291
|
-
trigger:
|
|
292
|
-
inputBase: { root:
|
|
291
|
+
root: u.select,
|
|
292
|
+
trigger: u.selectTrigger,
|
|
293
|
+
inputBase: { root: u.inputBase }
|
|
293
294
|
}
|
|
294
295
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
className:
|
|
297
|
-
options:
|
|
296
|
+
/* @__PURE__ */ _(s, {
|
|
297
|
+
className: u.operator,
|
|
298
|
+
options: n.map((e) => ({
|
|
298
299
|
label: e.label,
|
|
299
300
|
value: e.value
|
|
300
301
|
})),
|
|
@@ -303,22 +304,22 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
303
304
|
"aria-label": M,
|
|
304
305
|
fullWidth: !0,
|
|
305
306
|
styles: {
|
|
306
|
-
root:
|
|
307
|
-
trigger:
|
|
308
|
-
inputBase: { root:
|
|
307
|
+
root: u.select,
|
|
308
|
+
trigger: u.selectTrigger,
|
|
309
|
+
inputBase: { root: u.inputBase }
|
|
309
310
|
}
|
|
310
311
|
}),
|
|
311
|
-
!
|
|
312
|
-
className:
|
|
313
|
-
children: t === "number" ? /* @__PURE__ */
|
|
312
|
+
!c && /* @__PURE__ */ _("div", {
|
|
313
|
+
className: u.value,
|
|
314
|
+
children: t === "number" ? /* @__PURE__ */ _(a, {
|
|
314
315
|
value: typeof e.value == "boolean" ? void 0 : e.value ?? void 0,
|
|
315
316
|
onChange: (t) => Z(e.id, { value: t.target.value }),
|
|
316
317
|
"aria-label": N
|
|
317
|
-
}) : t === "date" ? /* @__PURE__ */
|
|
318
|
+
}) : t === "date" ? /* @__PURE__ */ _(i, {
|
|
318
319
|
value: typeof e.value == "string" || typeof e.value == "number" ? new Date(e.value) : void 0,
|
|
319
320
|
onChange: (t) => Z(e.id, { value: t ? t.toISOString() : "" }),
|
|
320
321
|
"aria-label": N
|
|
321
|
-
}) : t === "boolean" ? /* @__PURE__ */
|
|
322
|
+
}) : t === "boolean" ? /* @__PURE__ */ _(s, {
|
|
322
323
|
options: [{
|
|
323
324
|
label: P,
|
|
324
325
|
value: "true"
|
|
@@ -331,42 +332,42 @@ var v = 0, y = () => typeof window < "u" && window.__VRT__ ? (v += 1, `vrt-id-${
|
|
|
331
332
|
"aria-label": N,
|
|
332
333
|
fullWidth: !0,
|
|
333
334
|
styles: {
|
|
334
|
-
root:
|
|
335
|
-
trigger:
|
|
336
|
-
inputBase: { root:
|
|
335
|
+
root: u.select,
|
|
336
|
+
trigger: u.selectTrigger,
|
|
337
|
+
inputBase: { root: u.inputBase }
|
|
337
338
|
}
|
|
338
|
-
}) : /* @__PURE__ */
|
|
339
|
+
}) : /* @__PURE__ */ _(r, {
|
|
339
340
|
value: typeof e.value == "boolean" ? void 0 : e.value ?? void 0,
|
|
340
341
|
onChange: (t) => Z(e.id, { value: t.target.value }),
|
|
341
342
|
"aria-label": N,
|
|
342
|
-
styles: { root:
|
|
343
|
+
styles: { root: u.inputBase }
|
|
343
344
|
})
|
|
344
345
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ _(l, {
|
|
346
347
|
iconName: "TrashIcon",
|
|
347
348
|
"aria-label": I,
|
|
348
349
|
variant: "ghost",
|
|
349
350
|
size: "md",
|
|
350
351
|
intent: "danger",
|
|
351
352
|
onClick: () => Q(e.id),
|
|
352
|
-
className:
|
|
353
|
+
className: u.removeRule
|
|
353
354
|
})
|
|
354
355
|
]
|
|
355
356
|
})
|
|
356
357
|
}, e.id);
|
|
357
358
|
};
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ v("div", {
|
|
359
360
|
id: W,
|
|
360
361
|
role: "region",
|
|
361
362
|
"aria-label": B,
|
|
362
|
-
className:
|
|
363
|
-
children: [/* @__PURE__ */
|
|
363
|
+
className: g("wim-query-builder", u.root, te),
|
|
364
|
+
children: [/* @__PURE__ */ _("div", {
|
|
364
365
|
ref: G,
|
|
365
366
|
"aria-live": "polite",
|
|
366
367
|
"aria-atomic": "true",
|
|
367
|
-
className:
|
|
368
|
+
className: u.srOnly
|
|
368
369
|
}), $(J, 0, !1)]
|
|
369
370
|
});
|
|
370
371
|
};
|
|
371
372
|
//#endregion
|
|
372
|
-
export {
|
|
373
|
+
export { S as QueryBuilder };
|
|
@@ -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("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../i18n/generated/common.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("../../../utilities/slider-utils.cjs"),o=require("./range-slider.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=({value:e,defaultValue:u=[20,80],min:d=0,max:f=100,step:p=1,allowCross:m=!1,disabled:h=!1,onChange:g,onAfterChange:_,className:v,name:y,label:b,error:x,required:ee,layout:te=`vertical`,id:ne,"aria-label":S,"aria-labelledby":C,asChild:re=!1,children:ie,...ae})=>{let{t:w}=n.useWimTranslation(r.commonNs),T=e!==void 0,oe=(0,s.useId)(),E=ne||oe,D=`wim-range-slider-label-${E}`,O=`wim-range-slider-error-${E}`,{clamp:k,calculateValue:A}=a.useSliderCommon(d,f,p),j=[k(u[0],d,f),k(u[1],d,f)];j[0]>j[1]&&j.sort((e,t)=>e-t);let[M,N]=(0,s.useState)(j),P=T?e:M,F=(0,s.useRef)(null),I=(0,s.useRef)(null),L=(0,s.useRef)(null),R=(0,s.useRef)(null),z=(0,s.useRef)(null),B=(0,s.useRef)(null),[V,H]=(0,s.useState)(null),U=(0,s.useRef)(null),W=(0,s.useRef)([...P]),G=(0,s.useCallback)(e=>(e-d)/(f-d)*100,[d,f]),K=(0,s.useCallback)(e=>{let t=G(e[0]),n=G(e[1]);I.current&&(I.current.style.left=`${t}%`,I.current.setAttribute(`aria-valuenow`,String(e[0])),I.current.setAttribute(`aria-valuemax`,String(e[1]))),L.current&&(L.current.style.left=`${n}%`,L.current.setAttribute(`aria-valuenow`,String(e[1])),L.current.setAttribute(`aria-valuemin`,String(e[0]))),R.current&&(R.current.style.left=`${t}%`,R.current.style.width=`${n-t}%`),z.current&&(z.current.value=String(e[0])),B.current&&(B.current.value=String(e[1]))},[G]);(0,s.useEffect)(()=>{V||K(P)},[P,V,K]);let q=(e,t)=>{h||(W.current=[...P],U.current=t,H(t),e.stopPropagation(),e.preventDefault())},J=e=>{if(h)return;let t=`touches`in e?e.touches[0].clientX:e.clientX,n=A(t,F.current),r=Math.abs(P[0]-n),i=Math.abs(P[1]-n),a;a=r<i?`min`:i<r?`max`:n<P[0]?`min`:`max`,U.current=a,H(a);let o=[...W.current];a===`min`?o[0]=Math.min(n,m?f:o[1]):o[1]=Math.max(n,m?d:o[0]),W.current=o,K(o),g?.(o)},Y=(0,s.useCallback)(e=>{if(!U.current||h)return;let t=`touches`in e?e.touches[0].clientX:e.clientX,n=A(t,F.current),r=[...W.current];U.current===`min`?r[0]=Math.min(n,m?f:r[1]):r[1]=Math.max(n,m?d:r[0]),W.current=r,K(r),g?.(r)},[h,g,m,A,d,f,K]),X=(0,s.useCallback)(()=>{if(U.current){U.current=null,H(null);let e=W.current;T||N([...e]),_?.(e)}},[T,_]);(0,s.useEffect)(()=>(document.addEventListener(`mousemove`,Y),document.addEventListener(`mouseup`,X),document.addEventListener(`touchmove`,Y,{passive:!1}),document.addEventListener(`touchend`,X),()=>{document.removeEventListener(`mousemove`,Y),document.removeEventListener(`mouseup`,X),document.removeEventListener(`touchmove`,Y),document.removeEventListener(`touchend`,X)}),[Y,X]);let Z=(e,t)=>{if(h)return;let n=[...P],r=t===`min`?n[0]:n[1],i;if(e.key===`ArrowLeft`||e.key===`ArrowDown`)i=Math.max(d,r-p);else if(e.key===`ArrowRight`||e.key===`ArrowUp`)i=Math.min(f,r+p);else if(e.key===`Home`)i=d;else if(e.key===`End`)i=f;else return;if(t===`min`){let e=m?f:n[1];n[0]=Math.min(i,e)}else{let e=m?d:n[0];n[1]=Math.max(i,e)}T||N(n),g?.(n),e.preventDefault()},Q=G(P[0]),$=G(P[1]);return(0,l.jsx)(i.FieldTemplate,{label:b,error:x,required:ee,layout:te,labelId:D,errorId:O,className:v,children:(0,l.jsxs)(re?t.Root:`div`,{role:`presentation`,"data-testid":`range-slider-root`,className:(0,c.default)(`wim-range-slider`,o.default.root,h&&o.default.disabled,x&&o.default.danger),onMouseDown:J,onTouchStart:J,...ae,children:[(0,l.jsxs)(`div`,{className:o.default.trackContainer,ref:F,children:[(0,l.jsx)(`div`,{ref:R,className:o.default.track,style:{left:`${Q}%`,width:`${$-Q}%`}}),(0,l.jsx)(`div`,{ref:I,className:(0,c.default)(o.default.thumb,V===`min`&&o.default.active),style:{left:`${Q}%`},role:`slider`,"aria-valuemin":d,"aria-valuemax":P[1],"aria-valuenow":P[0],"aria-disabled":h,"aria-labelledby":b?D:C,"aria-label":b?w(`rangeSlider.start_of`,{label:b}):S||w(`rangeSlider.start`),"aria-describedby":x?O:void 0,"aria-invalid":x?!0:void 0,tabIndex:h?-1:0,onMouseDown:e=>q(e,`min`),onTouchStart:e=>q(e,`min`),onKeyDown:e=>Z(e,`min`)}),(0,l.jsx)(`div`,{ref:L,className:(0,c.default)(o.default.thumb,V===`max`&&o.default.active),style:{left:`${$}%`},role:`slider`,"aria-valuemin":P[0],"aria-valuemax":f,"aria-valuenow":P[1],"aria-disabled":h,"aria-labelledby":b?D:C,"aria-label":b?w(`rangeSlider.end_of`,{label:b}):S||w(`rangeSlider.end`),"aria-describedby":x?O:void 0,"aria-invalid":x?!0:void 0,tabIndex:h?-1:0,onMouseDown:e=>q(e,`max`),onTouchStart:e=>q(e,`max`),onKeyDown:e=>Z(e,`max`)})]}),(0,l.jsx)(`input`,{ref:z,type:`hidden`,name:y?`${y}-min`:``,value:P[0]}),(0,l.jsx)(`input`,{ref:B,type:`hidden`,name:y?`${y}-max`:``,value:P[1]}),(0,l.jsx)(t.Slottable,{children:ie})]})})};u.displayName=`RangeSlider`,exports.RangeSlider=u;
|