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,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../media/Icon/Icon.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("./input-base.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=({children:e,intent:c=`default`,variant:l=`outline`,fullWidth:u=!1,width:d,className:f,disabled:p,leftIcon:m,leftIconColor:h,onLeftIconClick:g,leftIconAriaLabel:_,rightIcons:v=[],suffix:y,suffixId:b,allowClear:x,hasValue:S,onClear:C,clearAriaLabel:w,styles:T})=>{let{t:E}=t.useWimTranslation(n.commonNs),D=_??E(`a11y.left_icon_action`),O=w??E(`a11y.clear_input`),k=typeof d==`string`&&[`xs`,`sm`,`md`,`lg`,`xl`].includes(d),A=a.default.Children.map(e,e=>a.default.isValidElement(e)?a.default.cloneElement(e,{disabled:p?!0:e.props.disabled,className:(0,o.default)(e.props.className,i.default.inner,T?.inner)}):e),j=d!==void 0&&!k&&!u,M=k&&!u?d:void 0,N=e=>p?`disabled`:e||(c===`danger`?`danger`:c===`warning`?`warning`:c===`success`?`success`:`secondary`),P=[...v];x&&S&&!p&&P.push({name:`CloseIcon`,onClick:e=>{e.stopPropagation(),C?.()},ariaLabel:O});let F=M?i.default[`width${M.charAt(0).toUpperCase()}${M.slice(1)}`]:void 0;return(0,s.jsxs)(`div`,{className:(0,o.default)(`wim-input-base`,i.default.root,c&&i.default[c],p&&i.default.disabled,i.default[l],u&&i.default.fullWidth,j&&i.default.hasCustomWidth,F,m&&i.default.hasLeftIcon,(P.length>0||x)&&i.default.hasRightIcon,(P.length>=2||v.length>=1&&x)&&i.default.hasMultipleRightIcons,f,T?.root),style:j?{"--wim-input-width":typeof d==`number`?`${d}px`:d}:void 0,children:[m&&(0,s.jsx)(`div`,{className:(0,o.default)(i.default.icon,i.default.left,g&&i.default.clickable,T?.icon),children:g?(0,s.jsx)(`button`,{type:`button`,onClick:g,className:(0,o.default)(i.default.iconButton,T?.iconButton),"aria-label":D,disabled:p,children:(0,s.jsx)(r.Icon,{name:m,size:`md`,color:N(h)})}):(0,s.jsx)(r.Icon,{name:m,size:`md`,color:N(h)})}),A,y!=null&&y!==``&&(0,s.jsx)(`span`,{id:b,className:(0,o.default)(i.default.suffix,P.length>0&&i.default.suffixClearsIcons),"data-testid":`input-suffix`,children:y}),P.length>0&&(0,s.jsx)(`div`,{className:(0,o.default)(i.default.icons,i.default.right,T?.icons),children:P.map((e,t)=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.iconItem,e.onClick&&i.default.clickable,e.rotated&&i.default.rotated,e.className,T?.iconItem),children:e.onClick?(0,s.jsx)(`button`,{type:`button`,onClick:e.onClick,className:(0,o.default)(i.default.iconButton,T?.iconButton),disabled:p,tabIndex:e.decorative?-1:void 0,"aria-hidden":e.decorative||void 0,"aria-label":e.decorative?void 0:e.ariaLabel??E(`a11y.right_icon_action`),children:(0,s.jsx)(r.Icon,{name:e.name,size:`md`,color:N(e.color)})}):(0,s.jsx)(r.Icon,{name:e.name,size:`md`,color:N(e.color)})},`${e.name}-${t}`))})]})};exports.InputBase=c;
|
|
@@ -1,86 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import n from "
|
|
5
|
-
import r from "
|
|
6
|
-
import i from "
|
|
7
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { Icon as n } from "../../media/Icon/Icon.js";
|
|
5
|
+
import r from "./input-base.module.js";
|
|
6
|
+
import i from "react";
|
|
7
|
+
import a from "classnames";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/form/InputBase/InputBase.tsx
|
|
9
|
-
var
|
|
10
|
-
let { t:
|
|
10
|
+
var c = ({ children: c, intent: l = "default", variant: u = "outline", fullWidth: d = !1, width: f, className: p, disabled: m, leftIcon: h, leftIconColor: g, onLeftIconClick: _, leftIconAriaLabel: v, rightIcons: y = [], suffix: b, suffixId: x, allowClear: S, hasValue: C, onClear: w, clearAriaLabel: T, styles: E }) => {
|
|
11
|
+
let { t: D } = e(t), O = v ?? D("a11y.left_icon_action"), k = T ?? D("a11y.clear_input"), A = typeof f == "string" && [
|
|
11
12
|
"xs",
|
|
12
13
|
"sm",
|
|
13
14
|
"md",
|
|
14
15
|
"lg",
|
|
15
16
|
"xl"
|
|
16
|
-
].includes(
|
|
17
|
-
disabled:
|
|
18
|
-
className:
|
|
19
|
-
}) : e),
|
|
20
|
-
|
|
17
|
+
].includes(f), j = i.Children.map(c, (e) => i.isValidElement(e) ? i.cloneElement(e, {
|
|
18
|
+
disabled: m ? !0 : e.props.disabled,
|
|
19
|
+
className: a(e.props.className, r.inner, E?.inner)
|
|
20
|
+
}) : e), M = f !== void 0 && !A && !d, N = A && !d ? f : void 0, P = (e) => m ? "disabled" : e || (l === "danger" ? "danger" : l === "warning" ? "warning" : l === "success" ? "success" : "secondary"), F = [...y];
|
|
21
|
+
S && C && !m && F.push({
|
|
21
22
|
name: "CloseIcon",
|
|
22
23
|
onClick: (e) => {
|
|
23
|
-
e.stopPropagation(),
|
|
24
|
+
e.stopPropagation(), w?.();
|
|
24
25
|
},
|
|
25
|
-
ariaLabel:
|
|
26
|
+
ariaLabel: k
|
|
26
27
|
});
|
|
27
|
-
let
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
className:
|
|
30
|
-
style:
|
|
28
|
+
let I = N ? r[`width${N.charAt(0).toUpperCase()}${N.slice(1)}`] : void 0;
|
|
29
|
+
return /* @__PURE__ */ s("div", {
|
|
30
|
+
className: a("wim-input-base", r.root, l && r[l], m && r.disabled, r[u], d && r.fullWidth, M && r.hasCustomWidth, I, h && r.hasLeftIcon, (F.length > 0 || S) && r.hasRightIcon, (F.length >= 2 || y.length >= 1 && S) && r.hasMultipleRightIcons, p, E?.root),
|
|
31
|
+
style: M ? { "--wim-input-width": typeof f == "number" ? `${f}px` : f } : void 0,
|
|
31
32
|
children: [
|
|
32
|
-
|
|
33
|
-
className:
|
|
34
|
-
children:
|
|
33
|
+
h && /* @__PURE__ */ o("div", {
|
|
34
|
+
className: a(r.icon, r.left, _ && r.clickable, E?.icon),
|
|
35
|
+
children: _ ? /* @__PURE__ */ o("button", {
|
|
35
36
|
type: "button",
|
|
36
|
-
onClick:
|
|
37
|
-
className:
|
|
38
|
-
"aria-label":
|
|
39
|
-
disabled:
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
name:
|
|
37
|
+
onClick: _,
|
|
38
|
+
className: a(r.iconButton, E?.iconButton),
|
|
39
|
+
"aria-label": O,
|
|
40
|
+
disabled: m,
|
|
41
|
+
children: /* @__PURE__ */ o(n, {
|
|
42
|
+
name: h,
|
|
42
43
|
size: "md",
|
|
43
|
-
color:
|
|
44
|
+
color: P(g)
|
|
44
45
|
})
|
|
45
|
-
}) : /* @__PURE__ */
|
|
46
|
-
name:
|
|
46
|
+
}) : /* @__PURE__ */ o(n, {
|
|
47
|
+
name: h,
|
|
47
48
|
size: "md",
|
|
48
|
-
color:
|
|
49
|
+
color: P(g)
|
|
49
50
|
})
|
|
50
51
|
}),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
id:
|
|
54
|
-
className:
|
|
52
|
+
j,
|
|
53
|
+
b != null && b !== "" && /* @__PURE__ */ o("span", {
|
|
54
|
+
id: x,
|
|
55
|
+
className: a(r.suffix, F.length > 0 && r.suffixClearsIcons),
|
|
55
56
|
"data-testid": "input-suffix",
|
|
56
|
-
children:
|
|
57
|
+
children: b
|
|
57
58
|
}),
|
|
58
|
-
|
|
59
|
-
className:
|
|
60
|
-
children:
|
|
61
|
-
className:
|
|
62
|
-
children: e.onClick ? /* @__PURE__ */
|
|
59
|
+
F.length > 0 && /* @__PURE__ */ o("div", {
|
|
60
|
+
className: a(r.icons, r.right, E?.icons),
|
|
61
|
+
children: F.map((e, t) => /* @__PURE__ */ o("div", {
|
|
62
|
+
className: a(r.iconItem, e.onClick && r.clickable, e.rotated && r.rotated, e.className, E?.iconItem),
|
|
63
|
+
children: e.onClick ? /* @__PURE__ */ o("button", {
|
|
63
64
|
type: "button",
|
|
64
65
|
onClick: e.onClick,
|
|
65
|
-
className:
|
|
66
|
-
disabled:
|
|
66
|
+
className: a(r.iconButton, E?.iconButton),
|
|
67
|
+
disabled: m,
|
|
67
68
|
tabIndex: e.decorative ? -1 : void 0,
|
|
68
69
|
"aria-hidden": e.decorative || void 0,
|
|
69
|
-
"aria-label": e.decorative ? void 0 : e.ariaLabel ??
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
"aria-label": e.decorative ? void 0 : e.ariaLabel ?? D("a11y.right_icon_action"),
|
|
71
|
+
children: /* @__PURE__ */ o(n, {
|
|
71
72
|
name: e.name,
|
|
72
73
|
size: "md",
|
|
73
|
-
color:
|
|
74
|
+
color: P(e.color)
|
|
74
75
|
})
|
|
75
|
-
}) : /* @__PURE__ */
|
|
76
|
+
}) : /* @__PURE__ */ o(n, {
|
|
76
77
|
name: e.name,
|
|
77
78
|
size: "md",
|
|
78
|
-
color:
|
|
79
|
+
color: P(e.color)
|
|
79
80
|
})
|
|
80
|
-
}, `${e.name}-${
|
|
81
|
+
}, `${e.name}-${t}`))
|
|
81
82
|
})
|
|
82
83
|
]
|
|
83
84
|
});
|
|
84
85
|
};
|
|
85
86
|
//#endregion
|
|
86
|
-
export {
|
|
87
|
+
export { c as InputBase };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_8rd5b_36`,t=`_ghost_8rd5b_81`,n=`_disabled_8rd5b_85`,r=`_icon_8rd5b_94`,i=`_iconItem_8rd5b_94`,a=`_danger_8rd5b_7`,o=`_warning_8rd5b_110`,s=`_success_8rd5b_113`,c=`_hasLeftIcon_8rd5b_146`,l=`_hasRightIcon_8rd5b_149`,u=`_hasMultipleRightIcons_8rd5b_152`,d=`_widthXs_8rd5b_155`,f=`_widthSm_8rd5b_158`,p=`_widthMd_8rd5b_161`,m=`_widthLg_8rd5b_164`,h=`_widthXl_8rd5b_167`,g=`_hasCustomWidth_8rd5b_170`,_=`_fullWidth_8rd5b_175`,v=`_clickable_8rd5b_197`,y=`_left_8rd5b_200`,b=`_suffix_8rd5b_203`,x=`_suffixClearsIcons_8rd5b_211`,S=`_icons_8rd5b_214`,C=`_right_8rd5b_229`,w=`_rotated_8rd5b_241`,T=`_iconButton_8rd5b_244`,E=`_inner_8rd5b_270`,D={root:e,ghost:t,disabled:n,icon:r,iconItem:i,danger:a,warning:o,success:s,hasLeftIcon:c,hasRightIcon:l,hasMultipleRightIcons:u,widthXs:d,widthSm:f,widthMd:p,widthLg:m,widthXl:h,hasCustomWidth:g,fullWidth:_,clickable:v,left:y,suffix:b,suffixClearsIcons:x,icons:S,right:C,rotated:w,iconButton:T,inner:E};exports.clickable=v,exports.danger=a,exports.default=D,exports.disabled=n,exports.fullWidth=_,exports.ghost=t,exports.hasCustomWidth=g,exports.hasLeftIcon=c,exports.hasMultipleRightIcons=u,exports.hasRightIcon=l,exports.icon=r,exports.iconButton=T,exports.iconItem=i,exports.icons=S,exports.inner=E,exports.left=y,exports.right=C,exports.root=e,exports.rotated=w,exports.success=s,exports.suffix=b,exports.suffixClearsIcons=x,exports.warning=o,exports.widthLg=m,exports.widthMd=p,exports.widthSm=f,exports.widthXl=h,exports.widthXs=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/InputBase/input-base.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_8rd5b_36", t = "_ghost_8rd5b_81", n = "_disabled_8rd5b_85", r = "_icon_8rd5b_94", i = "_iconItem_8rd5b_94", a = "_danger_8rd5b_7", o = "_warning_8rd5b_110", s = "_success_8rd5b_113", c = "_hasLeftIcon_8rd5b_146", l = "_hasRightIcon_8rd5b_149", u = "_hasMultipleRightIcons_8rd5b_152", d = "_widthXs_8rd5b_155", f = "_widthSm_8rd5b_158", p = "_widthMd_8rd5b_161", m = "_widthLg_8rd5b_164", h = "_widthXl_8rd5b_167", g = "_hasCustomWidth_8rd5b_170", _ = "_fullWidth_8rd5b_175", v = "_clickable_8rd5b_197", y = "_left_8rd5b_200", b = "_suffix_8rd5b_203", x = "_suffixClearsIcons_8rd5b_211", S = "_icons_8rd5b_214", C = "_right_8rd5b_229", w = "_rotated_8rd5b_241", T = "_iconButton_8rd5b_244", E = "_inner_8rd5b_270", D = {
|
|
4
4
|
root: e,
|
|
5
5
|
ghost: t,
|
|
6
6
|
disabled: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_container_1y9ay_3`,t=`_list_1y9ay_7`,n={container:e,list:t};exports.container=e,exports.default=n,exports.list=t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_3chmk_23`,t=`_fullWidth_3chmk_30`,n=`_trigger_3chmk_34`,r=`_disabled_3chmk_55`,i=`_open_3chmk_76`,a=`_value_3chmk_84`,o=`_placeholder_3chmk_85`,s=`_icon_3chmk_88`,c=`_list_3chmk_108`,l=`_option_3chmk_122`,u=`_active_3chmk_122`,d=`_selected_3chmk_126`,f=`_clear_3chmk_137`,p={root:e,fullWidth:t,trigger:n,disabled:r,open:i,value:a,placeholder:o,icon:s,list:c,option:l,active:u,selected:d,clear:f};exports.active=u,exports.clear=f,exports.default=p,exports.disabled=r,exports.fullWidth=t,exports.icon=s,exports.list=c,exports.open=i,exports.option=l,exports.placeholder=o,exports.root=e,exports.selected=d,exports.trigger=n,exports.value=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/MultiSelect/multiselect.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_3chmk_23", t = "_fullWidth_3chmk_30", n = "_trigger_3chmk_34", r = "_disabled_3chmk_55", i = "_open_3chmk_76", a = "_value_3chmk_84", o = "_placeholder_3chmk_85", s = "_icon_3chmk_88", c = "_list_3chmk_108", l = "_option_3chmk_122", u = "_active_3chmk_122", d = "_selected_3chmk_126", f = "_clear_3chmk_137", p = {
|
|
4
4
|
root: e,
|
|
5
5
|
fullWidth: t,
|
|
6
6
|
trigger: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("./password-strength.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/form.cjs"),r=require("./password-strength.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=e=>{if(!e)return 0;let t=0;return e.length>=8&&t++,/[A-Z]/.test(e)&&t++,/[0-9]/.test(e)&&t++,/[^A-Za-z0-9]/.test(e)&&t++,t},c=i.default.forwardRef(({password:e=``,score:i,showLabel:c=!0,calculateLevel:l=s,className:u,...d},f)=>{let{t:p}=t.useWimTranslation(n.formNs),m=i===void 0?l(e):i,h=(e=>{switch(e){case 0:return{intent:`danger`,label:p(`password_strength.very_weak`)};case 1:return{intent:`danger`,label:p(`password_strength.weak`)};case 2:return{intent:`warning`,label:p(`password_strength.fair`)};case 3:case 4:return{intent:`success`,label:p(e===4?`password_strength.very_strong`:`password_strength.strong`)};default:return{intent:`danger`,label:``}}})(m);return(0,o.jsxs)(`div`,{ref:f,className:(0,a.default)(`wim-password-strength`,r.default.root,u),...d,children:[(0,o.jsx)(`div`,{className:r.default.meter,children:[1,2,3,4].map(e=>(0,o.jsx)(`div`,{className:(0,a.default)(r.default.segment,{[r.default.active]:e<=m,[r.default[h.intent]]:e<=m})},e))}),c&&(e||i!==void 0)&&(0,o.jsx)(`div`,{className:(0,a.default)(r.default.label,r.default[h.intent]),children:h.label})]})});c.displayName=`PasswordStrength`,exports.PasswordStrength=c;
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "
|
|
4
|
-
import n from "
|
|
5
|
-
import r from "
|
|
6
|
-
import
|
|
3
|
+
import { formNs as t } from "../../../i18n/generated/form.js";
|
|
4
|
+
import n from "./password-strength.module.js";
|
|
5
|
+
import r from "react";
|
|
6
|
+
import i from "classnames";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/form/PasswordStrength/PasswordStrength.tsx
|
|
8
|
-
var
|
|
9
|
+
var s = (e) => {
|
|
9
10
|
if (!e) return 0;
|
|
10
11
|
let t = 0;
|
|
11
12
|
return e.length >= 8 && t++, /[A-Z]/.test(e) && t++, /[0-9]/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, t;
|
|
12
|
-
},
|
|
13
|
-
let { t:
|
|
13
|
+
}, c = r.forwardRef(({ password: r = "", score: c, showLabel: l = !0, calculateLevel: u = s, className: d, ...f }, p) => {
|
|
14
|
+
let { t: m } = e(t), h = c === void 0 ? u(r) : c, g = ((e) => {
|
|
14
15
|
switch (e) {
|
|
15
16
|
case 0: return {
|
|
16
17
|
intent: "danger",
|
|
17
|
-
label:
|
|
18
|
+
label: m("password_strength.very_weak")
|
|
18
19
|
};
|
|
19
20
|
case 1: return {
|
|
20
21
|
intent: "danger",
|
|
21
|
-
label:
|
|
22
|
+
label: m("password_strength.weak")
|
|
22
23
|
};
|
|
23
24
|
case 2: return {
|
|
24
25
|
intent: "warning",
|
|
25
|
-
label:
|
|
26
|
+
label: m("password_strength.fair")
|
|
26
27
|
};
|
|
27
28
|
case 3:
|
|
28
29
|
case 4: return {
|
|
29
30
|
intent: "success",
|
|
30
|
-
label:
|
|
31
|
+
label: m(e === 4 ? "password_strength.very_strong" : "password_strength.strong")
|
|
31
32
|
};
|
|
32
33
|
default: return {
|
|
33
34
|
intent: "danger",
|
|
34
35
|
label: ""
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
})(
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
ref:
|
|
40
|
-
className:
|
|
41
|
-
...
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
-
className:
|
|
38
|
+
})(h);
|
|
39
|
+
return /* @__PURE__ */ o("div", {
|
|
40
|
+
ref: p,
|
|
41
|
+
className: i("wim-password-strength", n.root, d),
|
|
42
|
+
...f,
|
|
43
|
+
children: [/* @__PURE__ */ a("div", {
|
|
44
|
+
className: n.meter,
|
|
44
45
|
children: [
|
|
45
46
|
1,
|
|
46
47
|
2,
|
|
47
48
|
3,
|
|
48
49
|
4
|
|
49
|
-
].map((e) => /* @__PURE__ */
|
|
50
|
-
[
|
|
51
|
-
[
|
|
50
|
+
].map((e) => /* @__PURE__ */ a("div", { className: i(n.segment, {
|
|
51
|
+
[n.active]: e <= h,
|
|
52
|
+
[n[g.intent]]: e <= h
|
|
52
53
|
}) }, e))
|
|
53
|
-
}),
|
|
54
|
-
className:
|
|
55
|
-
children:
|
|
54
|
+
}), l && (r || c !== void 0) && /* @__PURE__ */ a("div", {
|
|
55
|
+
className: i(n.label, n[g.intent]),
|
|
56
|
+
children: g.label
|
|
56
57
|
})]
|
|
57
58
|
});
|
|
58
59
|
});
|
|
59
|
-
|
|
60
|
+
c.displayName = "PasswordStrength";
|
|
60
61
|
//#endregion
|
|
61
|
-
export {
|
|
62
|
+
export { c as PasswordStrength };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../layout/Transition/Transition.cjs"),r=require("../../../icon/chevron-down.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("../../../i18n/generated/form.cjs"),o=require("../FieldTemplate/FieldTemplate.cjs"),s=require("./phone-input.module.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");var d=[{code:`US`,dialCode:`1`,flag:`🇺🇸`},{code:`JP`,dialCode:`81`,flag:`🇯🇵`},{code:`GB`,dialCode:`44`,flag:`🇬🇧`},{code:`AU`,dialCode:`61`,flag:`🇦🇺`},{code:`DE`,dialCode:`49`,flag:`🇩🇪`},{code:`FR`,dialCode:`33`,flag:`🇫🇷`},{code:`CN`,dialCode:`86`,flag:`🇨🇳`},{code:`KR`,dialCode:`82`,flag:`🇰🇷`},{code:`IN`,dialCode:`91`,flag:`🇮🇳`},{code:`BR`,dialCode:`55`,flag:`🇧🇷`}],f=(0,c.forwardRef)(({value:e=``,onChange:f,countryCode:p=`US`,onCountryChange:m,placeholder:h=`000-0000-0000`,disabled:g=!1,error:_,required:v=!1,label:y,layout:b=`vertical`,className:x,fullWidth:S=!1,...C},w)=>{let T=`wim-phone-input-${(0,c.useId)()}`,E=y?`${T}-label`:void 0,{t:D}=t.useWimTranslation(a.formNs),O=D(`phone.select_country`),k=`${T}-countries`,A=e=>`${T}-country-${e}`,j=_?`${T}-error`:void 0,[M,N]=(0,c.useState)(!1),[P,F]=(0,c.useState)(-1),I=(0,c.useRef)(null),L=(0,c.useRef)(null),R=(0,c.useRef)({text:``,timer:null});(0,c.useEffect)(()=>{let e=e=>{I.current&&!I.current.contains(e.target)&&N(!1)};return M&&document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[M]);let z=d.find(e=>e.code===p)??d[0],B=e=>{f?.(e.target.value)},V=d.length-1,H=e=>{let t=d.findIndex(e=>e.code===z.code);F(e??Math.max(t,0)),N(!0)},U=e=>{let t=d[e];t&&(m?.(t.code),N(!1))},W=e=>D(`phone.countries.${e.code}`),G=e=>a.formNs.resources.en?.phone?.countries?.[e.code]??``,K=(e,t)=>{let n=e.toLowerCase().replace(/^\+/,``);if(n===``)return-1;let r=/^[0-9]+$/.test(n),i=!r&&n.length>1&&n.split(``).every(e=>e===n[0]),a=i?n[0]:n,o=i||n.length===1?t+1:t,s=r?[e=>e.dialCode]:[e=>W(e).toLowerCase(),e=>G(e).toLowerCase(),e=>e.code.toLowerCase()];for(let e of s)for(let t=0;t<d.length;t++){let n=(Math.max(o,0)+t)%d.length;if(e(d[n]).startsWith(a))return n}return-1},q=e=>{let t=R.current;t.timer&&clearTimeout(t.timer),t.text+=e,t.timer=setTimeout(()=>{t.text=``,t.timer=null},500);let n=K(t.text,M?P:-1);n<0||(M?F(n):H(n))},J=e=>{if(!g)switch(e.key){case`ArrowDown`:case`ArrowUp`:if(e.preventDefault(),!M)H();else{let t=e.key===`ArrowDown`?1:-1;F(e=>(e+t+d.length)%d.length)}break;case`Home`:case`End`:e.preventDefault(),M?F(e.key===`Home`?0:V):H(e.key===`Home`?0:V);break;case`Enter`:case` `:e.preventDefault(),e.key===` `&&R.current.text!==``?q(` `):M?U(P):H();break;case`Escape`:M&&(e.preventDefault(),N(!1));break;case`Tab`:N(!1);break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),q(e.key))}};return(0,c.useEffect)(()=>{let e=R.current;return()=>{e.timer&&clearTimeout(e.timer)}},[]),(0,c.useEffect)(()=>{M&&P>=0&&(L.current?.querySelectorAll(`[role="option"]`)?.[P])?.scrollIntoView?.({block:`nearest`})},[P,M]),(0,u.jsx)(o.FieldTemplate,{label:y,labelId:E,htmlFor:T,required:v,error:_,errorId:j,layout:b,className:x,children:(0,u.jsxs)(`div`,{ref:I,className:(0,l.default)(`wim-phone-input`,s.default.root,S&&s.default.fullWidth,g&&s.default.disabled,_&&s.default.danger),"data-testid":`phone-input-root`,...C,children:[(0,u.jsxs)(`div`,{className:s.default.countryWrapper,children:[(0,u.jsxs)(`button`,{type:`button`,role:`combobox`,className:s.default.countryTrigger,onClick:()=>{g||(M?N(!1):H())},onKeyDown:J,onKeyUp:e=>{e.key===` `&&e.preventDefault()},disabled:g,"aria-haspopup":`listbox`,"aria-expanded":M,"aria-controls":M?k:void 0,"aria-activedescendant":M&&P>=0?A(P):void 0,"aria-label":O,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,style:{fontSize:`1.2em`},children:z.flag}),(0,u.jsxs)(`span`,{children:[`+`,z.dialCode]}),(0,u.jsx)(i.Icon,{component:r.default,size:`sm`,className:(0,l.default)(s.default.chevron,M&&s.default.chevronOpen)})]}),(0,u.jsx)(n.Transition,{show:M,preset:`fade`,className:s.default.dropdown,children:(0,u.jsx)(`ul`,{ref:L,id:k,className:s.default.countryList,role:`listbox`,"aria-label":O,tabIndex:-1,onMouseDown:e=>e.preventDefault(),children:d.map((e,t)=>(0,u.jsxs)(`li`,{id:A(t),className:(0,l.default)(s.default.countryOption,t===P&&s.default.active,z.code===e.code&&s.default.selected),onMouseEnter:()=>F(t),onClick:()=>U(t),role:`option`,"aria-selected":z.code===e.code,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:e.flag}),(0,u.jsx)(`span`,{className:s.default.countryName,children:W(e)}),` `,(0,u.jsxs)(`span`,{className:s.default.countryCode,children:[`+`,e.dialCode]})]},e.code))})})]}),(0,u.jsx)(`div`,{className:s.default.divider,"aria-hidden":`true`}),(0,u.jsx)(`input`,{id:T,ref:w,type:`tel`,value:e,onChange:B,placeholder:h,disabled:g,className:s.default.number,"aria-invalid":!!_,"aria-describedby":j})]})})});f.displayName=`PhoneInput`,exports.PHONE_COUNTRIES=d,exports.PhoneInput=f;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import r from "
|
|
6
|
-
import {
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import { Transition as t } from "../../layout/Transition/Transition.js";
|
|
4
|
+
import n from "../../../icon/chevron-down.js";
|
|
5
|
+
import { Icon as r } from "../../media/Icon/Icon.js";
|
|
6
|
+
import { formNs as i } from "../../../i18n/generated/form.js";
|
|
7
7
|
import { FieldTemplate as a } from "../FieldTemplate/FieldTemplate.js";
|
|
8
8
|
import o from "./phone-input.module.js";
|
|
9
9
|
import { forwardRef as s, useEffect as c, useId as l, useRef as u, useState as d } from "react";
|
|
@@ -62,7 +62,7 @@ var h = [
|
|
|
62
62
|
flag: "🇧🇷"
|
|
63
63
|
}
|
|
64
64
|
], g = s(({ value: s = "", onChange: g, countryCode: _ = "US", onCountryChange: v, placeholder: y = "000-0000-0000", disabled: b = !1, error: x, required: S = !1, label: C, layout: w = "vertical", className: T, fullWidth: E = !1, ...D }, O) => {
|
|
65
|
-
let k = `wim-phone-input-${l()}`, A = C ? `${k}-label` : void 0, { t: j } =
|
|
65
|
+
let k = `wim-phone-input-${l()}`, A = C ? `${k}-label` : void 0, { t: j } = e(i), M = j("phone.select_country"), N = `${k}-countries`, P = (e) => `${k}-country-${e}`, F = x ? `${k}-error` : void 0, [I, L] = d(!1), [R, z] = d(-1), B = u(null), V = u(null), H = u({
|
|
66
66
|
text: "",
|
|
67
67
|
timer: null
|
|
68
68
|
});
|
|
@@ -82,7 +82,7 @@ var h = [
|
|
|
82
82
|
}, q = (e) => {
|
|
83
83
|
let t = h[e];
|
|
84
84
|
t && (v?.(t.code), L(!1));
|
|
85
|
-
}, J = (e) => j(`phone.countries.${e.code}`), Y = (
|
|
85
|
+
}, J = (e) => j(`phone.countries.${e.code}`), Y = (e) => i.resources.en?.phone?.countries?.[e.code] ?? "", X = (e, t) => {
|
|
86
86
|
let n = e.toLowerCase().replace(/^\+/, "");
|
|
87
87
|
if (n === "") return -1;
|
|
88
88
|
let r = /^[0-9]+$/.test(n), i = !r && n.length > 1 && n.split("").every((e) => e === n[0]), a = i ? n[0] : n, o = i || n.length === 1 ? t + 1 : t, s = r ? [(e) => e.dialCode] : [
|
|
@@ -177,13 +177,13 @@ var h = [
|
|
|
177
177
|
children: U.flag
|
|
178
178
|
}),
|
|
179
179
|
/* @__PURE__ */ m("span", { children: ["+", U.dialCode] }),
|
|
180
|
-
/* @__PURE__ */ p(
|
|
181
|
-
component:
|
|
180
|
+
/* @__PURE__ */ p(r, {
|
|
181
|
+
component: n,
|
|
182
182
|
size: "sm",
|
|
183
183
|
className: f(o.chevron, I && o.chevronOpen)
|
|
184
184
|
})
|
|
185
185
|
]
|
|
186
|
-
}), /* @__PURE__ */ p(
|
|
186
|
+
}), /* @__PURE__ */ p(t, {
|
|
187
187
|
show: I,
|
|
188
188
|
preset: "fade",
|
|
189
189
|
className: o.dropdown,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_ja1lq_37`,t=`_fullWidth_ja1lq_50`,n=`_disabled_ja1lq_53`,r=`_chevron_ja1lq_77`,i=`_countryCode_ja1lq_78`,a=`_number_ja1lq_79`,o=`_danger_ja1lq_8`,s=`_countryWrapper_ja1lq_91`,c=`_countryTrigger_ja1lq_98`,l=`_chevronOpen_ja1lq_140`,u=`_dropdown_ja1lq_143`,d=`_countryList_ja1lq_156`,f=`_countryOption_ja1lq_163`,p=`_active_ja1lq_173`,m=`_selected_ja1lq_176`,h=`_countryName_ja1lq_181`,g=`_divider_ja1lq_191`,_={root:e,fullWidth:t,disabled:n,chevron:r,countryCode:i,number:a,danger:o,countryWrapper:s,countryTrigger:c,chevronOpen:l,dropdown:u,countryList:d,countryOption:f,active:p,selected:m,countryName:h,divider:g};exports.active=p,exports.chevron=r,exports.chevronOpen=l,exports.countryCode=i,exports.countryList=d,exports.countryName=h,exports.countryOption=f,exports.countryTrigger=c,exports.countryWrapper=s,exports.danger=o,exports.default=_,exports.disabled=n,exports.divider=g,exports.dropdown=u,exports.fullWidth=t,exports.number=a,exports.root=e,exports.selected=m;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/PhoneInput/phone-input.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_ja1lq_37", t = "_fullWidth_ja1lq_50", n = "_disabled_ja1lq_53", r = "_chevron_ja1lq_77", i = "_countryCode_ja1lq_78", a = "_number_ja1lq_79", o = "_danger_ja1lq_8", s = "_countryWrapper_ja1lq_91", c = "_countryTrigger_ja1lq_98", l = "_chevronOpen_ja1lq_140", u = "_dropdown_ja1lq_143", d = "_countryList_ja1lq_156", f = "_countryOption_ja1lq_163", p = "_active_ja1lq_173", m = "_selected_ja1lq_176", h = "_countryName_ja1lq_181", g = "_divider_ja1lq_191", _ = {
|
|
4
4
|
root: e,
|
|
5
5
|
fullWidth: t,
|
|
6
6
|
disabled: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Button/Button.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/components.cjs"),r=require("../Button/Button.cjs"),i=require("../Input/Input.cjs"),a=require("../DatePicker/DatePicker.cjs"),o=require("../NumberInput/NumberInput.cjs"),s=require("../SegmentedControl/SegmentedControl.cjs"),c=require("../Select/Select.cjs"),l=require("../Switch/Switch.cjs"),u=require("../IconButton/IconButton.cjs"),d=require("./querybuilder.module.cjs"),f=require("./warn-unknown-operator.cjs");let p=require("react");p=e.__toESM(p,1);let m=require("classnames");m=e.__toESM(m,1);let h=require("react/jsx-runtime");var g=0,_=()=>typeof window<`u`&&window.__VRT__?(g+=1,`vrt-id-${g}`):Math.random().toString(36).substring(2,11),v={string:[{value:`=`,key:`equal`},{value:`!=`,key:`not_equal`},{value:`contains`,key:`contains`},{value:`starts_with`,key:`starts_with`},{value:`ends_with`,key:`ends_with`},{value:`is_null`,key:`is_null`},{value:`is_not_null`,key:`is_not_null`}],number:[{value:`=`,key:`equal`},{value:`!=`,key:`not_equal`},{value:`>`,key:`greater_than`},{value:`<`,key:`less_than`},{value:`>=`,key:`greater_than_or_equal`},{value:`<=`,key:`less_than_or_equal`},{value:`is_null`,key:`is_null`},{value:`is_not_null`,key:`is_not_null`}],date:[{value:`=`,key:`equal`},{value:`!=`,key:`not_equal`},{value:`>`,key:`after`},{value:`<`,key:`before`},{value:`>=`,key:`after_or_on`},{value:`<=`,key:`before_or_on`},{value:`is_null`,key:`is_null`},{value:`is_not_null`,key:`is_not_null`}],boolean:[{value:`=`,key:`equal`},{value:`!=`,key:`not_equal`},{value:`is_null`,key:`is_null`},{value:`is_not_null`,key:`is_not_null`}]},y=({fields:e,query:g,defaultQuery:y,onChange:b,maxDepth:x=3,className:S,id:C,labels:w={}})=>{let{t:T}=t.useWimTranslation(n.componentsNs),{ruleAdded:ee=T(`query.builder.rule_added`),groupAdded:E=T(`query.builder.group_added`),removed:D=T(`query.builder.removed`),ruleAriaLabel:O=T(`query.builder.rule`),fieldAriaLabel:k=T(`query.builder.field`),operatorAriaLabel:A=T(`query.builder.operator`),valueAriaLabel:j=T(`query.builder.value`),trueLabel:M=T(`query.builder.true`),falseLabel:N=T(`query.builder.false`),removeRuleAriaLabel:P=T(`query.builder.remove_rule`),removeGroupAriaLabel:F=T(`query.builder.remove_group`),addRuleLabel:I=T(`query.builder.add_rule`),addGroupLabel:L=T(`query.builder.add_group`),regionAriaLabel:R=T(`query.builder.region_label`),combinatorAriaLabel:z=T(`query.builder.combinator`),operators:B={}}=w,V=(0,p.useId)(),H=C||`wim-qb-${V}`,U=(0,p.useRef)(null),[W,G]=(0,p.useState)(y||{id:_(),combinator:`and`,not:!1,rules:[]}),K=g===void 0?W:g,q=(0,p.useCallback)(e=>{U.current&&(U.current.textContent=``,setTimeout(()=>{U.current&&(U.current.textContent=e)},50))},[]),J=(0,p.useCallback)(e=>{g===void 0&&G(e),b?.(e)},[g,b]),Y=(e,t)=>{let n=r=>r.id===e?{...r,...t}:{...r,rules:r.rules.map(r=>r.id===e?{...r,...t}:`rules`in r?n(r):r)};J(n(K))},X=t=>{let n=e[0],r={id:_(),field:n?.name||``,operator:`=`,value:n?.type!==`boolean`&&``},i=e=>e.id===t?{...e,rules:[...e.rules,r]}:{...e,rules:e.rules.map(e=>`rules`in e?i(e):e)};J(i(K)),q(ee)},Z=e=>{let t={id:_(),combinator:`and`,not:!1,rules:[]},n=r=>r.id===e?{...r,rules:[...r.rules,t]}:{...r,rules:r.rules.map(e=>`rules`in e?n(e):e)};J(n(K)),q(E)},Q=e=>{let t=n=>({...n,rules:n.rules.filter(t=>t.id!==e).map(e=>`rules`in e?t(e):e)});J(t(K)),q(D)},$=(e,t,n)=>{let i=`${e.combinator.toUpperCase()} group`;return(0,h.jsxs)(`div`,{role:`group`,"aria-label":i,className:(0,m.default)(d.default.group,t>0&&d.default.nested,n&&d.default.excluded),children:[(0,h.jsxs)(`div`,{className:d.default.groupHeader,children:[(0,h.jsxs)(`div`,{className:d.default.groupHeaderLeft,children:[(0,h.jsx)(s.SegmentedControl,{size:`md`,options:[{label:`AND`,value:`and`},{label:`OR`,value:`or`}],value:e.combinator,onChange:t=>Y(e.id,{combinator:t}),"aria-label":z,styles:{root:d.default.segmentedControl,item:d.default.segmentedControlItem,slider:d.default.segmentedControlSlider}}),(0,h.jsx)(l.Switch,{size:`md`,checked:e.not,onChange:t=>Y(e.id,{not:t.target.checked}),children:`NOT`})]}),t>0&&(0,h.jsx)(u.IconButton,{iconName:`TrashIcon`,"aria-label":F,variant:`ghost`,size:`md`,intent:`danger`,onClick:()=>Q(e.id),className:d.default.removeGroup})]}),(0,h.jsx)(`div`,{className:d.default.ruleList,children:e.rules.map(e=>`rules`in e?$(e,t+1,n):te(e))}),(0,h.jsxs)(`div`,{className:d.default.groupActions,children:[(0,h.jsx)(r.Button,{size:`md`,variant:`ghost`,icon:`PlusIcon`,onClick:()=>X(e.id),children:I}),t<x&&(0,h.jsx)(r.Button,{size:`md`,variant:`ghost`,icon:`PlusIcon`,onClick:()=>Z(e.id),children:L})]})]},e.id)},te=t=>{let n=e.find(e=>e.name===t.field)?.type||`string`,r=v[n].map(e=>({...e,label:B[e.key]||T(`query.builder.operators.${e.key}`)})),s=n=>{let r=e.find(e=>e.name===n);Y(t.id,{field:n,operator:`=`,value:r?.type!==`boolean`&&``})};r.some(e=>e.value===t.operator)||f.warnUnknownOperator(t.operator,n,r.map(e=>e.value));let l=t.operator===`is_null`||t.operator===`is_not_null`;return(0,h.jsx)(`div`,{className:d.default.rule,role:`group`,"aria-label":O,children:(0,h.jsxs)(`div`,{className:d.default.ruleFields,children:[(0,h.jsx)(c.Select,{className:d.default.field,options:e.map(e=>({label:e.label,value:e.name})),value:t.field,onChange:s,"aria-label":k,fullWidth:!0,styles:{root:d.default.select,trigger:d.default.selectTrigger,inputBase:{root:d.default.inputBase}}}),(0,h.jsx)(c.Select,{className:d.default.operator,options:r.map(e=>({label:e.label,value:e.value})),value:t.operator,onChange:e=>Y(t.id,{operator:e}),"aria-label":A,fullWidth:!0,styles:{root:d.default.select,trigger:d.default.selectTrigger,inputBase:{root:d.default.inputBase}}}),!l&&(0,h.jsx)(`div`,{className:d.default.value,children:n===`number`?(0,h.jsx)(o.NumberInput,{value:typeof t.value==`boolean`?void 0:t.value??void 0,onChange:e=>Y(t.id,{value:e.target.value}),"aria-label":j}):n===`date`?(0,h.jsx)(a.DatePicker,{value:typeof t.value==`string`||typeof t.value==`number`?new Date(t.value):void 0,onChange:e=>Y(t.id,{value:e?e.toISOString():``}),"aria-label":j}):n===`boolean`?(0,h.jsx)(c.Select,{options:[{label:M,value:`true`},{label:N,value:`false`}],value:String(t.value),onChange:e=>Y(t.id,{value:e===`true`}),"aria-label":j,fullWidth:!0,styles:{root:d.default.select,trigger:d.default.selectTrigger,inputBase:{root:d.default.inputBase}}}):(0,h.jsx)(i.Input,{value:typeof t.value==`boolean`?void 0:t.value??void 0,onChange:e=>Y(t.id,{value:e.target.value}),"aria-label":j,styles:{root:d.default.inputBase}})}),(0,h.jsx)(u.IconButton,{iconName:`TrashIcon`,"aria-label":P,variant:`ghost`,size:`md`,intent:`danger`,onClick:()=>Q(t.id),className:d.default.removeRule})]})},t.id)};return(0,h.jsxs)(`div`,{id:H,role:`region`,"aria-label":R,className:(0,m.default)(`wim-query-builder`,d.default.root,S),children:[(0,h.jsx)(`div`,{ref:U,"aria-live":`polite`,"aria-atomic":`true`,className:d.default.srOnly}),$(K,0,!1)]})};exports.QueryBuilder=y;
|