@weni/unnnic-system 3.31.1-alpha.2 → 3.32.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/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +1 -1
- package/package.json +8 -9
- package/public/doris.png +0 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +0 -0
- package/src/assets/emoji/u1F600.png +0 -0
- package/src/assets/emoji/u1F601.png +0 -0
- package/src/assets/emoji/u1F602.png +0 -0
- package/src/assets/emoji/u1F603.png +0 -0
- package/src/assets/emoji/u1F604.png +0 -0
- package/src/assets/emoji/u1F605.png +0 -0
- package/src/assets/emoji/u1F606.png +0 -0
- package/src/assets/emoji/u1F607.png +0 -0
- package/src/assets/emoji/u1F608.png +0 -0
- package/src/assets/emoji/u1F609.png +0 -0
- package/src/assets/emoji/u1F610.png +0 -0
- package/src/assets/emoji/u1F611.png +0 -0
- package/src/assets/emoji/u1F612.png +0 -0
- package/src/assets/emoji/u1F613.png +0 -0
- package/src/assets/emoji/u1F614.png +0 -0
- package/src/assets/emoji/u1F615.png +0 -0
- package/src/assets/emoji/u1F616.png +0 -0
- package/src/assets/emoji/u1F617.png +0 -0
- package/src/assets/emoji/u1F618.png +0 -0
- package/src/assets/emoji/u1F619.png +0 -0
- package/src/assets/emoji/u1F620.png +0 -0
- package/src/assets/emoji/u1F621.png +0 -0
- package/src/assets/emoji/u1F622.png +0 -0
- package/src/assets/emoji/u1F623.png +0 -0
- package/src/assets/emoji/u1F624.png +0 -0
- package/src/assets/emoji/u1F625.png +0 -0
- package/src/assets/emoji/u1F626.png +0 -0
- package/src/assets/emoji/u1F627.png +0 -0
- package/src/assets/emoji/u1F628.png +0 -0
- package/src/assets/emoji/u1F629.png +0 -0
- package/src/assets/emoji/u1F630.png +0 -0
- package/src/assets/emoji/u1F631.png +0 -0
- package/src/assets/emoji/u1F632.png +0 -0
- package/src/assets/emoji/u1F633.png +0 -0
- package/src/assets/emoji/u1F634.png +0 -0
- package/src/assets/emoji/u1F635.png +0 -0
- package/src/assets/emoji/u1F636.png +0 -0
- package/src/assets/emoji/u1F637.png +0 -0
- package/src/assets/emoji/u1F638.png +0 -0
- package/src/assets/emoji/u1F639.png +0 -0
- package/src/assets/emoji/u1F640.png +0 -0
- package/src/assets/emoji/u1F641.png +0 -0
- package/src/assets/emoji/u1F642.png +0 -0
- package/src/assets/emoji/u1F643.png +0 -0
- package/src/assets/emoji/u1F644.png +0 -0
- package/src/assets/emoji/u1F645.png +0 -0
- package/src/assets/fonts/material-symbols-rounded.woff2 +0 -0
- package/src/assets/icons/Brazil.vue +74 -0
- package/src/assets/icons/CheckboxDefault.vue +19 -0
- package/src/assets/icons/CheckboxDisable.vue +19 -0
- package/src/assets/icons/CheckboxLess.vue +23 -0
- package/src/assets/icons/CheckboxSelect.vue +25 -0
- package/src/assets/icons/FitnessBiceps1.vue +15 -0
- package/src/assets/icons/Indicator.vue +18 -0
- package/src/assets/icons/Messages.vue +18 -0
- package/src/assets/icons/NavigationMenuVertical1.vue +25 -0
- package/src/assets/icons/Pin.vue +33 -0
- package/src/assets/icons/RadioDefault.vue +17 -0
- package/src/assets/icons/RadioDisable.vue +17 -0
- package/src/assets/icons/RadioSelected.vue +23 -0
- package/src/assets/icons/SingleNeutral2.vue +20 -0
- package/src/assets/icons/SingleNeutralActions1.vue +20 -0
- package/src/assets/icons/SocialInstagram1.vue +15 -0
- package/src/assets/icons/SocialMediaFacebook1.vue +15 -0
- package/src/assets/icons/SortAsc.vue +19 -0
- package/src/assets/icons/SortDefault.vue +20 -0
- package/src/assets/icons/SortDesc.vue +19 -0
- package/src/assets/icons/Spain.vue +1846 -0
- package/src/assets/icons/SwitchDefault.vue +31 -0
- package/src/assets/icons/SwitchDefaultDisabled.vue +25 -0
- package/src/assets/icons/SwitchSelected.vue +31 -0
- package/src/assets/icons/SwitchSelectedDisabled.vue +23 -0
- package/src/assets/icons/TransferMessage.vue +24 -0
- package/src/assets/icons/USA.vue +192 -0
- package/src/assets/icons/Unpin.vue +33 -0
- package/src/assets/icons/checkbox-checked-disabled.svg +3 -0
- package/src/assets/icons/checkbox-checked.svg +3 -0
- package/src/assets/icons/checkbox-less-disabled.svg +3 -0
- package/src/assets/icons/checkbox-less.svg +3 -0
- package/src/assets/icons/radio-checked.svg +3 -0
- package/src/assets/icons/switch-checked-disabled.svg +3 -0
- package/src/assets/icons/switch-checked.svg +3 -0
- package/src/assets/icons/weni-loading.svg +2 -0
- package/src/assets/img/flag/en.svg +28 -0
- package/src/assets/img/flag/pt-br.svg +21 -0
- package/src/assets/img/previews/doc-preview.png +0 -0
- package/src/assets/img/previews/image-preview.png +0 -0
- package/src/assets/img/previews/video-preview.png +0 -0
- package/src/assets/tokens/colors-primitives.json +155 -0
- package/src/assets/tokens/colors-semantic-dark.json +55 -0
- package/src/assets/tokens/colors-semantic.json +55 -0
- package/src/assets/tokens/fonts.json +70 -0
- package/src/assets/tokens/icon-sizes.json +22 -0
- package/src/assets/tokens/radii.json +28 -0
- package/src/assets/tokens/shadows.json +10 -0
- package/src/assets/tokens/spaces.json +46 -0
- package/src/components/Accordion/Accordion.vue +149 -0
- package/src/components/Alert/Alert.vue +62 -0
- package/src/components/Alert/Version1dot1.vue +231 -0
- package/src/components/Alert/__tests__/Alert.spec.js +41 -0
- package/src/components/Alert/__tests__/Version1dot1.spec.js +101 -0
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +15 -0
- package/src/components/Alert/__tests__/__snapshots__/AlertBanner.spec.js.snap +10 -0
- package/src/components/Alert/__tests__/__snapshots__/AlertCaller.spec.js.snap +3 -0
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +13 -0
- package/src/components/AudioRecorder/AudioHandler.vue +121 -0
- package/src/components/AudioRecorder/AudioPlayer.vue +403 -0
- package/src/components/AudioRecorder/AudioRecorder.vue +475 -0
- package/src/components/AudioRecorder/AudioTranscriptionButton.vue +73 -0
- package/src/components/AvatarIcon/AvatarIcon.vue +107 -0
- package/src/components/AvatarIcon/__tests__/AvatarIcon.spec.js +84 -0
- package/src/components/AvatarIcon/__tests__/__snapshots__/AvatarIcon.spec.js.snap +7 -0
- package/src/components/Banner/Banner.vue +79 -0
- package/src/components/Banner/InfoBanner.vue +158 -0
- package/src/components/Breadcrumb/Breadcrumb.vue +82 -0
- package/src/components/Breadcrumb/__tests__/Breadcrumb.spec.js +68 -0
- package/src/components/Button/Button.vue +371 -0
- package/src/components/Button/__tests__/Button.spec.js +188 -0
- package/src/components/Button/types.ts +22 -0
- package/src/components/Card/AccountCard.vue +94 -0
- package/src/components/Card/BlankCard.vue +85 -0
- package/src/components/Card/Card.vue +218 -0
- package/src/components/Card/CardCompany.vue +189 -0
- package/src/components/Card/CardData.vue +123 -0
- package/src/components/Card/CardStatusesContainer.vue +255 -0
- package/src/components/Card/ContentCard.vue +145 -0
- package/src/components/Card/DashCard.vue +144 -0
- package/src/components/Card/DefaultCard.vue +87 -0
- package/src/components/Card/MarketplaceCard.vue +187 -0
- package/src/components/Card/SimpleCard.vue +166 -0
- package/src/components/Card/StatusCard.vue +113 -0
- package/src/components/Card/TitleCard.vue +100 -0
- package/src/components/CardImage/CardImage.vue +172 -0
- package/src/components/CardInformation/CardInformation.vue +65 -0
- package/src/components/CardNumber/CardNumber.vue +61 -0
- package/src/components/CardProject/CardProject.vue +320 -0
- package/src/components/CardProject/__tests__/CardProject.spec.js +161 -0
- package/src/components/ChartBar/ChartBar.vue +428 -0
- package/src/components/ChartFunnel/ChartFunnel.vue +70 -0
- package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +200 -0
- package/src/components/ChartFunnel/DefaultFunnel/__tests__/ChartDefaultFunnelBase.unit.spec.js +123 -0
- package/src/components/ChartFunnel/DefaultFunnel/__tests__/__snapshots__/ChartDefaultFunnelBase.unit.spec.js.snap +66 -0
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelBaseRow.vue +79 -0
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelFiveRows.vue +101 -0
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelFourRows.vue +89 -0
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelThreeRows.vue +77 -0
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +64 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/ChartFunnelBaseRow.unit.spec.js +192 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/ChartFunnelFiveRows.unit.spec.js +126 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/ChartFunnelFourRows.unit.spec.js +122 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/ChartFunnelThreeRow.unit.spec.js +120 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/__snapshots__/ChartFunnelBaseRow.unit.spec.js.snap +15 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/__snapshots__/ChartFunnelFiveRows.unit.spec.js.snap +3 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/__snapshots__/ChartFunnelFourRows.unit.spec.js.snap +3 -0
- package/src/components/ChartFunnel/SvgFunnel/__tests__/__snapshots__/ChartFunnelThreeRow.unit.spec.js.snap +3 -0
- package/src/components/ChartFunnel/__tests__/ChartFunnel.unit.spec.js +161 -0
- package/src/components/ChartFunnel/__tests__/__snapshots__/ChartFunnel.unit.spec.js.snap +3 -0
- package/src/components/ChartLine/ChartLine.vue +322 -0
- package/src/components/ChartLine/__tests__/ChartLine.spec.js +170 -0
- package/src/components/ChartMultiLine/ChartMultiLine.vue +326 -0
- package/src/components/ChartMultiLine/Line/Line.vue +170 -0
- package/src/components/ChartRainbow/ChartRainbow.vue +201 -0
- package/src/components/ChatsUserAvatar/ChatsUserAvatar.vue +158 -0
- package/src/components/Checkbox/Checkbox.vue +192 -0
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +65 -0
- package/src/components/CheckboxGroup/CheckboxGroup.vue +88 -0
- package/src/components/CheckboxGroup/__tests__/CheckboxGroup.spec.js +62 -0
- package/src/components/Chip/Chip.vue +125 -0
- package/src/components/Chip/__tests__/Chip.spec.js +164 -0
- package/src/components/Chip/types.ts +8 -0
- package/src/components/Collapse/Collapse.vue +142 -0
- package/src/components/Collapse/__tests__/Collapse.spec.js +117 -0
- package/src/components/Collapse/__tests__/__snapshots__/Collapse.spec.js.snap +8 -0
- package/src/components/Comment/Comment.vue +99 -0
- package/src/components/DataArea/DataArea.vue +99 -0
- package/src/components/DataTable/index.vue +555 -0
- package/src/components/DateFilter/DateFilter.vue +82 -0
- package/src/components/DatePicker/DatePicker.vue +1148 -0
- package/src/components/DatePicker/__tests__/DatePicker.spec.js +591 -0
- package/src/components/DatePicker/translations.js +148 -0
- package/src/components/Disclaimer/Disclaimer.vue +179 -0
- package/src/components/Disclaimer/__tests__/Disclaimer.spec.js +165 -0
- package/src/components/Disclaimer/types.ts +16 -0
- package/src/components/Drawer/Drawer.vue +248 -0
- package/src/components/Drawer/__tests__/Drawer.spec.js +280 -0
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +22 -0
- package/src/components/DropArea/DropArea.vue +373 -0
- package/src/components/DropArea/__tests__/DropArea.spec.js +333 -0
- package/src/components/Dropdown/Dropdown.vue +142 -0
- package/src/components/Dropdown/DropdownItem.vue +32 -0
- package/src/components/Dropdown/DropdownSkeleton.vue +180 -0
- package/src/components/Dropdown/LanguageSelect.vue +296 -0
- package/src/components/Dropdown/__tests__/Dropdown.spec.js +155 -0
- package/src/components/Dropdown/__tests__/DropdownItem.spec.js +25 -0
- package/src/components/Dropdown/__tests__/DropdownSkeleton.spec.js +147 -0
- package/src/components/EmojiPicker/EmojiPicker.vue +244 -0
- package/src/components/EmojiPicker/__tests__/EmojiPicker.spec.js +236 -0
- package/src/components/Flag.vue +40 -0
- package/src/components/FormElement/FormElement.vue +139 -0
- package/src/components/Icon/OldIconsMap.json +111 -0
- package/src/components/Icon/types.ts +26 -0
- package/src/components/Icon.vue +198 -0
- package/src/components/IconLoading/IconLoading.vue +107 -0
- package/src/components/ImportCard/ImportCard.vue +245 -0
- package/src/components/Input/BaseInput.vue +156 -0
- package/src/components/Input/Input.scss +43 -0
- package/src/components/Input/Input.vue +191 -0
- package/src/components/Input/TextInput.vue +233 -0
- package/src/components/Input/__test__/BaseInput.spec.js +107 -0
- package/src/components/Input/__test__/Input.spec.js +103 -0
- package/src/components/Input/__test__/TextInput.spec.js +209 -0
- package/src/components/Input/__test__/__snapshots__/BaseInput.spec.js.snap +3 -0
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +22 -0
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +9 -0
- package/src/components/InputDatePicker/InputDatePicker.vue +253 -0
- package/src/components/InputDatePicker/__test__/InputDatePicker.spec.js +208 -0
- package/src/components/Label/Label.vue +62 -0
- package/src/components/Label/__tests__/Label.spec.js +30 -0
- package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +3 -0
- package/src/components/Modal/CallModal.vue +23 -0
- package/src/components/Modal/Modal.vue +377 -0
- package/src/components/ModalDialog/ModalDialog.vue +245 -0
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +159 -0
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +3 -0
- package/src/components/ModalNext/ModalNext.vue +437 -0
- package/src/components/MultiSelect/MultiSelectOption.vue +49 -0
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +655 -0
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +229 -0
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +91 -0
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +51 -0
- package/src/components/MultiSelect/index.vue +240 -0
- package/src/components/Navigator/__tests__/Navigator.spec.js +55 -0
- package/src/components/Navigator/index.vue +100 -0
- package/src/components/PageHeader/PageHeader.vue +151 -0
- package/src/components/PageHeader/__tests__/PageHeader.spec.js +97 -0
- package/src/components/PageHeader/index.ts +2 -0
- package/src/components/PageHeader/types.ts +11 -0
- package/src/components/Pagination/Pagination.vue +190 -0
- package/src/components/Pagination/__tests__/Pagination.spec.js +307 -0
- package/src/components/ProgressBar/ProgressBar.vue +245 -0
- package/src/components/Radio/Radio.vue +168 -0
- package/src/components/Radio/__test__/Radio.spec.js +145 -0
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +8 -0
- package/src/components/RadioGroup/RadioGroup.vue +128 -0
- package/src/components/RadioGroup/__tests__/RadioGroup.spec.js +100 -0
- package/src/components/Select/SelectItem.vue +85 -0
- package/src/components/Select/__tests__/Select.spec.js +626 -0
- package/src/components/Select/__tests__/SelectItem.spec.js +330 -0
- package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +91 -0
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +15 -0
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +25 -0
- package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +8 -0
- package/src/components/Select/_select-shared.scss +25 -0
- package/src/components/Select/index.vue +459 -0
- package/src/components/Select/types.ts +37 -0
- package/src/components/SelectSmart/SelectSmart.vue +873 -0
- package/src/components/SelectSmart/SelectSmartMultipleHeader.vue +144 -0
- package/src/components/SelectSmart/SelectSmartOption.vue +178 -0
- package/src/components/SelectSmart/__tests__/SelectSmart.spec.js +527 -0
- package/src/components/SelectSmart/__tests__/SelectSmartMultipleHeader.spec.js +86 -0
- package/src/components/SelectSmart/__tests__/SelectSmartOption.spec.js +139 -0
- package/src/components/SelectSmart/__tests__/__snapshots__/SelectSmartMultipleHeader.spec.js.snap +8 -0
- package/src/components/SelectSmart/__tests__/__snapshots__/SelectSmartOption.spec.js.snap +10 -0
- package/src/components/SelectTime/index.vue +220 -0
- package/src/components/Sidebar/SidebarItem.vue +224 -0
- package/src/components/Sidebar/__tests__/SidebarItem.spec.js +105 -0
- package/src/components/Sidebar/__tests__/Siderbar.spec.js +92 -0
- package/src/components/Sidebar/index.vue +126 -0
- package/src/components/Sidebar/propsValidator.js +24 -0
- package/src/components/SkeletonLoading/SkeletonLoading.vue +156 -0
- package/src/components/SkeletonLoading/__tests__/SkeletonLoading.spec.js +128 -0
- package/src/components/SkeletonLoading/skeletonTheme.vue +66 -0
- package/src/components/Switch/Switch.vue +185 -0
- package/src/components/Switch/__tests__/Switch.spec.js +55 -0
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +10 -0
- package/src/components/Tab/Tab.vue +203 -0
- package/src/components/Tab/__test__/Tab.spec.js +152 -0
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +23 -0
- package/src/components/Table/Table.vue +143 -0
- package/src/components/Table/TableRow.vue +101 -0
- package/src/components/TableNext/TableBodyCell.vue +47 -0
- package/src/components/TableNext/TableNext.vue +428 -0
- package/src/components/TableNext/TablePagination.vue +98 -0
- package/src/components/TableNext/__test__/TableBodyCell.spec.js +65 -0
- package/src/components/TableNext/__test__/TableNext.spec.js +197 -0
- package/src/components/TableNext/__test__/TablePagination.spec.js +65 -0
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +59 -0
- package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +41 -0
- package/src/components/TableNext/__test__/validation.unit.test.js +90 -0
- package/src/components/TableNext/validation.js +66 -0
- package/src/components/TabsExpanded/TabsExpanded.vue +156 -0
- package/src/components/TabsExpanded/__tests__/TabsExpanded.spec.js +78 -0
- package/src/components/Tag/DefaultTag.vue +87 -0
- package/src/components/Tag/Tag.vue +43 -0
- package/src/components/Tag/__tests__/DefaultTag.spec.js +51 -0
- package/src/components/Tag/__tests__/Tag.spec.js +82 -0
- package/src/components/Tag/types.ts +19 -0
- package/src/components/TemplatePreview/TemplatePreview.vue +252 -0
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +51 -0
- package/src/components/TemplatePreview/types.d.ts +16 -0
- package/src/components/TextArea/TextArea.vue +138 -0
- package/src/components/TextArea/__test__/TextArea.spec.js +218 -0
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +17 -0
- package/src/components/Toast/Toast.vue +252 -0
- package/src/components/Toast/ToastManager.ts +113 -0
- package/src/components/Toast/__tests__/Toast.spec.js +291 -0
- package/src/components/Toast/__tests__/ToastManager.spec.js +298 -0
- package/src/components/Toast/types.ts +57 -0
- package/src/components/ToolTip/ToolTip.vue +99 -0
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +451 -0
- package/src/components/Tour/Tour.vue +138 -0
- package/src/components/Tour/TourMask.vue +135 -0
- package/src/components/Tour/TourPopover.vue +236 -0
- package/src/components/Tour/propsValidation.js +82 -0
- package/src/components/UploadArea/UploadArea.vue +141 -0
- package/src/components/__tests__/Icon.spec.js +94 -0
- package/src/components/config.js +1 -0
- package/src/components/grid/Grid.vue +50 -0
- package/src/components/icons/IconCommunity.vue +12 -0
- package/src/components/icons/IconDocumentation.vue +12 -0
- package/src/components/icons/IconEcosystem.vue +12 -0
- package/src/components/icons/IconSupport.vue +12 -0
- package/src/components/icons/IconTooling.vue +19 -0
- package/src/components/icons/iconArrowsDefault.vue +16 -0
- package/src/components/index.ts +468 -0
- package/src/components/ui/dialog/Dialog.vue +51 -0
- package/src/components/ui/dialog/DialogClose.vue +29 -0
- package/src/components/ui/dialog/DialogContent.vue +141 -0
- package/src/components/ui/dialog/DialogFooter.vue +46 -0
- package/src/components/ui/dialog/DialogHeader.vue +83 -0
- package/src/components/ui/dialog/DialogTitle.vue +38 -0
- package/src/components/ui/dialog/DialogTrigger.vue +16 -0
- package/src/components/ui/dialog/index.ts +7 -0
- package/src/components/ui/drawer/Drawer.vue +80 -0
- package/src/components/ui/drawer/DrawerClose.vue +31 -0
- package/src/components/ui/drawer/DrawerContent.vue +114 -0
- package/src/components/ui/drawer/DrawerDescription.vue +40 -0
- package/src/components/ui/drawer/DrawerFooter.vue +34 -0
- package/src/components/ui/drawer/DrawerHeader.vue +57 -0
- package/src/components/ui/drawer/DrawerOverlay.vue +33 -0
- package/src/components/ui/drawer/DrawerTitle.vue +37 -0
- package/src/components/ui/drawer/DrawerTrigger.vue +31 -0
- package/src/components/ui/drawer/index.ts +10 -0
- package/src/components/ui/popover/Popover.vue +19 -0
- package/src/components/ui/popover/PopoverContent.vue +113 -0
- package/src/components/ui/popover/PopoverFooter.vue +47 -0
- package/src/components/ui/popover/PopoverOption.vue +130 -0
- package/src/components/ui/popover/PopoverTrigger.vue +27 -0
- package/src/components/ui/popover/__tests__/PopoverFooter.spec.js +116 -0
- package/src/components/ui/popover/context.ts +4 -0
- package/src/components/ui/popover/index.ts +6 -0
- package/src/components/ui/segmented-control/SegmentedControlList.vue +51 -0
- package/src/components/ui/segmented-control/SegmentedControlTrigger.vue +81 -0
- package/src/components/ui/segmented-control/index.ts +4 -0
- package/src/components/ui/table/Table.vue +29 -0
- package/src/components/ui/table/TableBody.vue +14 -0
- package/src/components/ui/table/TableCell.vue +28 -0
- package/src/components/ui/table/TableHead.vue +27 -0
- package/src/components/ui/table/TableHeader.vue +24 -0
- package/src/components/ui/table/TableRow.vue +51 -0
- package/src/components/ui/table/index.ts +6 -0
- package/src/components/ui/tabs/Tabs.vue +19 -0
- package/src/components/ui/tabs/TabsContent.vue +22 -0
- package/src/components/ui/tabs/TabsList.vue +40 -0
- package/src/components/ui/tabs/TabsTrigger.vue +63 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/components/ui/tooltip/Tooltip.vue +21 -0
- package/src/components/ui/tooltip/TooltipContent.vue +84 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +24 -0
- package/src/components/ui/tooltip/index.ts +3 -0
- package/src/composables/useDelayedUnmount.ts +48 -0
- package/src/composables/useSelectBase.ts +119 -0
- package/src/composables/useSelectKeyboard.ts +91 -0
- package/src/composables/useTheme.ts +67 -0
- package/src/index.ts +29 -0
- package/src/lib/__tests__/teleport-target.spec.ts +73 -0
- package/src/lib/layer-manager.ts +64 -0
- package/src/lib/teleport-target.ts +46 -0
- package/src/lib/utils.ts +7 -0
- package/src/locales/en.json +50 -0
- package/src/locales/es.json +50 -0
- package/src/locales/pt_br.json +50 -0
- package/src/main.ts +9 -0
- package/src/mixins/i18n.js +74 -0
- package/src/stories/Accordion.stories.js +54 -0
- package/src/stories/Alert.stories.js +157 -0
- package/src/stories/AudioRecorder.stories.js +52 -0
- package/src/stories/AvatarIcon.stories.js +57 -0
- package/src/stories/Banner.stories.js +54 -0
- package/src/stories/Breadcrumb.stories.js +30 -0
- package/src/stories/Button.stories.js +183 -0
- package/src/stories/Card.stories.js +154 -0
- package/src/stories/CardCompany.stories.js +64 -0
- package/src/stories/CardData.stories.js +25 -0
- package/src/stories/CardImage.stories.js +58 -0
- package/src/stories/CardInformation.stories.js +44 -0
- package/src/stories/CardNumber.stories.js +15 -0
- package/src/stories/CardProject.stories.js +70 -0
- package/src/stories/CardSimple.stories.js +73 -0
- package/src/stories/ChartBar.stories.js +123 -0
- package/src/stories/ChartFunnel.stories.js +127 -0
- package/src/stories/ChartLine.stories.js +55 -0
- package/src/stories/ChartMultiLine.stories.js +50 -0
- package/src/stories/ChartRainbow.stories.js +18 -0
- package/src/stories/ChatsUserAvatar.stories.js +36 -0
- package/src/stories/Checkbox.stories.js +79 -0
- package/src/stories/CheckboxGroup.stories.js +105 -0
- package/src/stories/Chip.stories.js +194 -0
- package/src/stories/Collapse.stories.js +81 -0
- package/src/stories/Colors.mdx +13 -0
- package/src/stories/Colors.stories.js +132 -0
- package/src/stories/Comment.stories.js +66 -0
- package/src/stories/DataArea.stories.js +78 -0
- package/src/stories/DataTable.stories.js +588 -0
- package/src/stories/DateFilter.stories.js +18 -0
- package/src/stories/DatePicker.stories.js +114 -0
- package/src/stories/Dialog.stories.js +851 -0
- package/src/stories/Disclaimer.stories.js +93 -0
- package/src/stories/Drawer.stories.js +242 -0
- package/src/stories/DrawerNext.stories.js +631 -0
- package/src/stories/DropArea.mdx +66 -0
- package/src/stories/DropArea.stories.js +74 -0
- package/src/stories/Dropdown.stories.js +35 -0
- package/src/stories/EmojiPicker.stories.js +93 -0
- package/src/stories/FormElement.stories.js +35 -0
- package/src/stories/Grid.stories.js +19 -0
- package/src/stories/Icon.stories.js +144 -0
- package/src/stories/IconLoading.stories.js +63 -0
- package/src/stories/Iconography.mdx +7 -0
- package/src/stories/ImportCard.stories.js +33 -0
- package/src/stories/Input.mdx +79 -0
- package/src/stories/Input.stories.js +157 -0
- package/src/stories/InputDatePicker.stories.js +155 -0
- package/src/stories/Label.stories.js +30 -0
- package/src/stories/LanguageSelect.stories.js +26 -0
- package/src/stories/LayerManager.docs.mdx +40 -0
- package/src/stories/LayerManager.stories.js +407 -0
- package/src/stories/Modal.stories.js +101 -0
- package/src/stories/ModalDialog.mdx +89 -0
- package/src/stories/ModalDialog.stories.js +448 -0
- package/src/stories/ModalNext.stories.js +191 -0
- package/src/stories/MultiSelect.stories.js +169 -0
- package/src/stories/Navigator.stories.js +26 -0
- package/src/stories/PageHeader.stories.js +364 -0
- package/src/stories/Pagination.stories.js +37 -0
- package/src/stories/Popover.stories.js +457 -0
- package/src/stories/PopoverOption.stories.js +128 -0
- package/src/stories/ProgressBar.stories.js +38 -0
- package/src/stories/Radio.stories.js +104 -0
- package/src/stories/RadioGroup.stories.js +145 -0
- package/src/stories/SegmentedControl.stories.js +253 -0
- package/src/stories/Select.stories.js +375 -0
- package/src/stories/SelectSmart.mdx +152 -0
- package/src/stories/SelectSmart.stories.js +594 -0
- package/src/stories/SelectTime.stories.js +25 -0
- package/src/stories/Sidebar.stories.js +157 -0
- package/src/stories/SkeletonLoading.stories.js +28 -0
- package/src/stories/Switch.stories.js +46 -0
- package/src/stories/Tab.stories.js +56 -0
- package/src/stories/Table.stories.js +218 -0
- package/src/stories/TableNext.stories.js +176 -0
- package/src/stories/Tabs.stories.js +169 -0
- package/src/stories/TabsExpanded.stories.js +69 -0
- package/src/stories/Tag.stories.js +59 -0
- package/src/stories/TemplatePreview.stories.js +94 -0
- package/src/stories/TemplatePreviewModal.stories.js +110 -0
- package/src/stories/TextArea.mdx +68 -0
- package/src/stories/TextArea.stories.js +117 -0
- package/src/stories/Toast.mdx +123 -0
- package/src/stories/Toast.stories.js +126 -0
- package/src/stories/ToolTip.stories.js +71 -0
- package/src/stories/Tour.stories.js +216 -0
- package/src/stories/Typography.mdx +83 -0
- package/src/stories/Typography.stories.js +66 -0
- package/src/stories/UploadArea.stories.js +42 -0
- package/src/stories/assets/audios/audio-recorder-sample.mp3 +0 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/images/un.png +0 -0
- package/src/stories/assets/images/unnnic.png +0 -0
- package/src/stories/assets/images/unnnicPortrait.png +0 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/assets/videos/weni.mp4 +0 -0
- package/src/types/index.d.ts +53 -0
- package/src/types/scheme-colors.d.ts +209 -0
- package/src/types/unnnic-utils.d.ts +88 -0
- package/src/types/vue-shims.d.ts +5 -0
- package/src/types/vueuse-overrides.d.ts +7 -0
- package/src/utils/call.js +81 -0
- package/src/utils/colorTokens.js +2 -0
- package/src/utils/colorsList.js +89 -0
- package/src/utils/emojiList.js +47 -0
- package/src/utils/hours.js +100 -0
- package/src/utils/iconList.js +108 -0
- package/src/utils/icons.js +59 -0
- package/src/utils/plugins/i18n.js +20 -0
- package/src/utils/sanitize.js +75 -0
- /package/{dist → src/assets}/scss/colors-hsl.scss +0 -0
- /package/{dist → src/assets}/scss/colors.scss +0 -0
- /package/{dist → src/assets}/scss/deprecated/colors.scss +0 -0
- /package/{dist → src/assets}/scss/deprecated/fonts.scss +0 -0
- /package/{dist → src/assets}/scss/deprecated/grid.scss +0 -0
- /package/{dist → src/assets}/scss/deprecated/spacing.scss +0 -0
- /package/{dist → src/assets}/scss/fonts.scss +0 -0
- /package/{dist → src/assets}/scss/icon-sizes.scss +0 -0
- /package/{dist → src/assets}/scss/radii.scss +0 -0
- /package/{dist → src/assets}/scss/scheme-colors.scss +0 -0
- /package/{dist → src/assets}/scss/semantic-colors.scss +0 -0
- /package/{dist → src/assets}/scss/semantic-text-utilities.scss +0 -0
- /package/{dist → src/assets}/scss/shadows.scss +0 -0
- /package/{dist → src/assets}/scss/spaces.scss +0 -0
- /package/{dist → src/assets}/scss/tailwind.scss +0 -0
- /package/{dist → src/assets}/scss/theme.scss +0 -0
- /package/{dist → src/assets}/scss/unnnic.scss +0 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import UnnnicSelect from '../components/Select/index.vue';
|
|
2
|
+
import UnnnicTag from '../components/Tag/Tag.vue';
|
|
3
|
+
|
|
4
|
+
const options = [
|
|
5
|
+
{ label: 'Option 1', value: 'option1', altValue: 'alt_value_option1' },
|
|
6
|
+
{ label: 'Option 2', value: 'option2', altValue: 'alt_value_option2' },
|
|
7
|
+
{ label: 'Option 3', value: 'option3', altValue: 'alt_value_option3' },
|
|
8
|
+
{ label: 'Option 4', value: 'option4', altValue: 'alt_value_option4' },
|
|
9
|
+
{ label: 'Option 5', value: 'option5', altValue: 'alt_value_option5' },
|
|
10
|
+
{ label: 'Option 6', value: 'option6', altValue: 'alt_value_option6' },
|
|
11
|
+
{ label: 'Option 7', value: 'option7', altValue: 'alt_value_option7' },
|
|
12
|
+
{ label: 'Option 8', value: 'option8', altValue: 'alt_value_option8' },
|
|
13
|
+
{ label: 'Option 9', value: 'option9', altValue: 'alt_value_option9' },
|
|
14
|
+
{ label: 'Option 10', value: 'option10', disabled: true },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
title: 'Form/Select',
|
|
19
|
+
component: UnnnicSelect,
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
parameters: {
|
|
22
|
+
docs: {
|
|
23
|
+
description: {
|
|
24
|
+
component:
|
|
25
|
+
'Select is designed to solve common problems related to option selection.',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
argTypes: {
|
|
30
|
+
options: {
|
|
31
|
+
description:
|
|
32
|
+
'List of items to be displayed in the options. If an item has a `disabled` key set to `true`, that item will be disabled. By default, the component looks for the `label` and `value` keys to display and update the model, but these are not required if you wish to customize them using the `itemLabel` and `itemValue` props, respectively.',
|
|
33
|
+
},
|
|
34
|
+
placeholder: {
|
|
35
|
+
description: 'Text to be displayed in the placeholder.',
|
|
36
|
+
},
|
|
37
|
+
label: {
|
|
38
|
+
description: 'Text to be displayed in the label.',
|
|
39
|
+
},
|
|
40
|
+
modelValue: {
|
|
41
|
+
description:
|
|
42
|
+
'Model variable. Its type will always match the return type of the key specified by `itemValue`, or the entire options object when `returnObject` prop is set to `true`.',
|
|
43
|
+
},
|
|
44
|
+
returnObject: {
|
|
45
|
+
description:
|
|
46
|
+
'Prop to indicate that the full option object should be returned in the v-model.',
|
|
47
|
+
},
|
|
48
|
+
itemLabel: {
|
|
49
|
+
description:
|
|
50
|
+
'Field of the option item that should be used to render the option label.',
|
|
51
|
+
},
|
|
52
|
+
itemValue: {
|
|
53
|
+
description:
|
|
54
|
+
'Field of the option item that should be used to return value to v-model.',
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
description: 'Select state type',
|
|
58
|
+
},
|
|
59
|
+
errors: {
|
|
60
|
+
description:
|
|
61
|
+
"Error message or messages. When it's an array, the messages will be separated by commas.",
|
|
62
|
+
},
|
|
63
|
+
message: {
|
|
64
|
+
description: 'Help or hint message.',
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
description: 'Select size',
|
|
68
|
+
},
|
|
69
|
+
optionsLines: {
|
|
70
|
+
description:
|
|
71
|
+
'Number of options to display at most; if exceeded, scrolling will be enabled.',
|
|
72
|
+
},
|
|
73
|
+
enableSearch: {
|
|
74
|
+
description:
|
|
75
|
+
'If true, enables a search field displayed inside the options popover. The `update:search` event is emitted on each input.',
|
|
76
|
+
},
|
|
77
|
+
search: {
|
|
78
|
+
description: 'Search value.',
|
|
79
|
+
},
|
|
80
|
+
locale: {
|
|
81
|
+
description: 'Locale for i18n translations.',
|
|
82
|
+
},
|
|
83
|
+
disabled: {
|
|
84
|
+
description: 'Disable the select.',
|
|
85
|
+
},
|
|
86
|
+
infiniteScroll: {
|
|
87
|
+
description:
|
|
88
|
+
'Enable infinite scroll functionality. When enabled, the component will emit a `scroll-end` event when the user scrolls near the bottom of the options list.',
|
|
89
|
+
},
|
|
90
|
+
infiniteScrollDistance: {
|
|
91
|
+
description:
|
|
92
|
+
'Distance in pixels from the bottom of the scroll area to trigger the `scroll-end` event. Default is 10.',
|
|
93
|
+
},
|
|
94
|
+
infiniteScrollCanLoadMore: {
|
|
95
|
+
description:
|
|
96
|
+
'Function that returns a boolean indicating whether more items can be loaded. Used to prevent unnecessary scroll-end events.',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
render: (args) => ({
|
|
100
|
+
components: { UnnnicSelect },
|
|
101
|
+
setup() {
|
|
102
|
+
const handleSearch = (value) => {
|
|
103
|
+
args.search = value;
|
|
104
|
+
};
|
|
105
|
+
return { args, handleSearch };
|
|
106
|
+
},
|
|
107
|
+
data() {
|
|
108
|
+
return {
|
|
109
|
+
exampleValue: null,
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
template: `
|
|
113
|
+
<div style="width: 300px;">
|
|
114
|
+
<p>modelValue: {{ exampleValue }}</p>
|
|
115
|
+
<unnnic-select v-model="exampleValue" v-bind="args" @update:search="handleSearch" />
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
`,
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const Default = {
|
|
123
|
+
args: {
|
|
124
|
+
placeholder: 'Placeholder',
|
|
125
|
+
label: 'Label',
|
|
126
|
+
options,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const ReturnObject = {
|
|
131
|
+
args: {
|
|
132
|
+
returnObject: true,
|
|
133
|
+
placeholder: 'Placeholder',
|
|
134
|
+
label: 'Label',
|
|
135
|
+
options,
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const AlternativeValueKey = {
|
|
140
|
+
args: {
|
|
141
|
+
itemValue: 'altValue',
|
|
142
|
+
placeholder: 'Placeholder',
|
|
143
|
+
label: 'Label',
|
|
144
|
+
options,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const AlternativeValueLabel = {
|
|
149
|
+
args: {
|
|
150
|
+
itemLabel: 'altValue',
|
|
151
|
+
placeholder: 'Placeholder',
|
|
152
|
+
label: 'Label',
|
|
153
|
+
options,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const Clearable = {
|
|
158
|
+
args: {
|
|
159
|
+
placeholder: 'Placeholder',
|
|
160
|
+
label: 'Label',
|
|
161
|
+
options,
|
|
162
|
+
clearable: true,
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const Disabled = {
|
|
167
|
+
args: {
|
|
168
|
+
placeholder: 'Placeholder',
|
|
169
|
+
label: 'Label',
|
|
170
|
+
options,
|
|
171
|
+
disabled: true,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const WithSearch = {
|
|
176
|
+
args: {
|
|
177
|
+
placeholder: 'Placeholder',
|
|
178
|
+
label: 'Label',
|
|
179
|
+
options,
|
|
180
|
+
enableSearch: true,
|
|
181
|
+
search: '',
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const WithStatus = {
|
|
186
|
+
parameters: {
|
|
187
|
+
docs: {
|
|
188
|
+
description: {
|
|
189
|
+
story:
|
|
190
|
+
'Customizes option and selected content through the `#option` and `#selected` scoped slots. The status tag lives entirely in the consumer, keeping the Select decoupled from the concept of status.',
|
|
191
|
+
},
|
|
192
|
+
source: {
|
|
193
|
+
code: `<UnnnicSelect
|
|
194
|
+
v-model="selected"
|
|
195
|
+
:options="options"
|
|
196
|
+
label="Representative"
|
|
197
|
+
placeholder="Select a representative"
|
|
198
|
+
clearable
|
|
199
|
+
>
|
|
200
|
+
<template #option="{ label, option }">
|
|
201
|
+
<span class="select-status__label">{{ label }}</span>
|
|
202
|
+
<UnnnicTag
|
|
203
|
+
type="default"
|
|
204
|
+
size="small"
|
|
205
|
+
:scheme="statusConfig[option.status].scheme"
|
|
206
|
+
:text="statusConfig[option.status].text"
|
|
207
|
+
/>
|
|
208
|
+
</template>
|
|
209
|
+
|
|
210
|
+
<template #selected="{ label, option }">
|
|
211
|
+
<span class="select-status__label">{{ label }}</span>
|
|
212
|
+
<UnnnicTag
|
|
213
|
+
type="default"
|
|
214
|
+
size="small"
|
|
215
|
+
:scheme="statusConfig[option.status].scheme"
|
|
216
|
+
:text="statusConfig[option.status].text"
|
|
217
|
+
/>
|
|
218
|
+
</template>
|
|
219
|
+
</UnnnicSelect>`,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
render: () => ({
|
|
224
|
+
components: { UnnnicSelect, UnnnicTag },
|
|
225
|
+
data() {
|
|
226
|
+
return {
|
|
227
|
+
emptyValue: null,
|
|
228
|
+
selectedValue: 'anna',
|
|
229
|
+
statusOptions: [
|
|
230
|
+
{ label: 'Ana', value: 'ana', status: 'online' },
|
|
231
|
+
{ label: 'Anna', value: 'anna', status: 'online' },
|
|
232
|
+
{ label: 'Davi', value: 'davi', status: 'lunch' },
|
|
233
|
+
{ label: 'João', value: 'joao', status: 'offline' },
|
|
234
|
+
{ label: 'Ricardo', value: 'ricardo', status: 'offline' },
|
|
235
|
+
],
|
|
236
|
+
statusConfig: {
|
|
237
|
+
online: { scheme: 'green', text: 'Online' },
|
|
238
|
+
lunch: { scheme: 'orange', text: 'Lunch' },
|
|
239
|
+
offline: { scheme: 'gray', text: 'Offline' },
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
template: `
|
|
244
|
+
<div style="width: 512px; display: flex; flex-direction: column; gap: 32px;">
|
|
245
|
+
<unnnic-select
|
|
246
|
+
v-model="emptyValue"
|
|
247
|
+
:options="statusOptions"
|
|
248
|
+
label="Representative"
|
|
249
|
+
placeholder="Select a representative"
|
|
250
|
+
clearable
|
|
251
|
+
>
|
|
252
|
+
<template #option="{ label, option }">
|
|
253
|
+
<span style="flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ label }}</span>
|
|
254
|
+
<unnnic-tag
|
|
255
|
+
type="default"
|
|
256
|
+
size="small"
|
|
257
|
+
:scheme="statusConfig[option.status].scheme"
|
|
258
|
+
:text="statusConfig[option.status].text"
|
|
259
|
+
/>
|
|
260
|
+
</template>
|
|
261
|
+
<template #selected="{ label, option }">
|
|
262
|
+
<span style="flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ label }}</span>
|
|
263
|
+
<unnnic-tag
|
|
264
|
+
type="default"
|
|
265
|
+
size="small"
|
|
266
|
+
:scheme="statusConfig[option.status].scheme"
|
|
267
|
+
:text="statusConfig[option.status].text"
|
|
268
|
+
/>
|
|
269
|
+
</template>
|
|
270
|
+
</unnnic-select>
|
|
271
|
+
|
|
272
|
+
<unnnic-select
|
|
273
|
+
v-model="selectedValue"
|
|
274
|
+
:options="statusOptions"
|
|
275
|
+
label="Representative"
|
|
276
|
+
placeholder="Select a representative"
|
|
277
|
+
clearable
|
|
278
|
+
>
|
|
279
|
+
<template #option="{ label, option }">
|
|
280
|
+
<span style="flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ label }}</span>
|
|
281
|
+
<unnnic-tag
|
|
282
|
+
type="default"
|
|
283
|
+
size="small"
|
|
284
|
+
:scheme="statusConfig[option.status].scheme"
|
|
285
|
+
:text="statusConfig[option.status].text"
|
|
286
|
+
/>
|
|
287
|
+
</template>
|
|
288
|
+
<template #selected="{ label, option }">
|
|
289
|
+
<span style="flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ label }}</span>
|
|
290
|
+
<unnnic-tag
|
|
291
|
+
type="default"
|
|
292
|
+
size="small"
|
|
293
|
+
:scheme="statusConfig[option.status].scheme"
|
|
294
|
+
:text="statusConfig[option.status].text"
|
|
295
|
+
/>
|
|
296
|
+
</template>
|
|
297
|
+
</unnnic-select>
|
|
298
|
+
</div>
|
|
299
|
+
`,
|
|
300
|
+
}),
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
export const WithInfiniteScroll = {
|
|
304
|
+
render: () => ({
|
|
305
|
+
components: { UnnnicSelect },
|
|
306
|
+
data() {
|
|
307
|
+
return {
|
|
308
|
+
selectedValue: null,
|
|
309
|
+
loadedOptions: [],
|
|
310
|
+
currentPage: 1,
|
|
311
|
+
totalPages: 10,
|
|
312
|
+
isLoading: false,
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
mounted() {
|
|
316
|
+
this.loadInitialOptions();
|
|
317
|
+
},
|
|
318
|
+
methods: {
|
|
319
|
+
loadInitialOptions() {
|
|
320
|
+
this.loadedOptions = this.generateOptions(1);
|
|
321
|
+
},
|
|
322
|
+
generateOptions(page) {
|
|
323
|
+
const startIndex = (page - 1) * 10 + 1;
|
|
324
|
+
return Array.from({ length: 10 }, (_, i) => ({
|
|
325
|
+
label: `Option ${startIndex + i}`,
|
|
326
|
+
value: `option${startIndex + i}`,
|
|
327
|
+
}));
|
|
328
|
+
},
|
|
329
|
+
async handleScrollEnd() {
|
|
330
|
+
if (this.currentPage >= this.totalPages || this.isLoading) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
this.isLoading = true;
|
|
335
|
+
|
|
336
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
337
|
+
|
|
338
|
+
this.currentPage++;
|
|
339
|
+
const newOptions = this.generateOptions(this.currentPage);
|
|
340
|
+
this.loadedOptions = [...this.loadedOptions, ...newOptions];
|
|
341
|
+
|
|
342
|
+
this.isLoading = false;
|
|
343
|
+
|
|
344
|
+
this.$refs.selectRef.finishInfiniteScroll();
|
|
345
|
+
},
|
|
346
|
+
canLoadMore() {
|
|
347
|
+
return this.currentPage < this.totalPages && !this.isLoading;
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
template: `
|
|
351
|
+
<div style="width: 300px;">
|
|
352
|
+
<h3>Infinite Scroll Example</h3>
|
|
353
|
+
<p style="color: #666; font-size: 14px;">
|
|
354
|
+
Scroll down in the options list to load more items.
|
|
355
|
+
<br />
|
|
356
|
+
Page: {{ currentPage }} / {{ totalPages }}
|
|
357
|
+
<br />
|
|
358
|
+
Total options: {{ loadedOptions.length }}
|
|
359
|
+
</p>
|
|
360
|
+
<p>Selected: {{ selectedValue }}</p>
|
|
361
|
+
<unnnic-select
|
|
362
|
+
ref="selectRef"
|
|
363
|
+
v-model="selectedValue"
|
|
364
|
+
:options="loadedOptions"
|
|
365
|
+
placeholder="Select an option"
|
|
366
|
+
label="Infinite Scroll Select"
|
|
367
|
+
:infinite-scroll="true"
|
|
368
|
+
:infinite-scroll-distance="10"
|
|
369
|
+
:infinite-scroll-can-load-more="canLoadMore"
|
|
370
|
+
@scroll-end="handleScrollEnd"
|
|
371
|
+
/>
|
|
372
|
+
</div>
|
|
373
|
+
`,
|
|
374
|
+
}),
|
|
375
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Meta, Source, Story } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
import * as SelectSmartStories from "./SelectSmart.stories";
|
|
4
|
+
|
|
5
|
+
<Meta of={SelectSmartStories} />
|
|
6
|
+
|
|
7
|
+
# SelectSmart
|
|
8
|
+
|
|
9
|
+
SelectSmart is designed to solve common problems related to option selection.
|
|
10
|
+
It combines three elements: Select, Autocomplete, and AutocompleteSelect, which
|
|
11
|
+
originally didn't follow a consistent pattern and had some bugs. With SelectSmart,
|
|
12
|
+
these components have been unified and improved and it also brings a new design.
|
|
13
|
+
|
|
14
|
+
> It is a _self-closing_ component, which means it does not support child elements.
|
|
15
|
+
|
|
16
|
+
> Available in small and medium versions, which can be toggled through the
|
|
17
|
+
> `size` property, accepting the strings "sm" or "md".
|
|
18
|
+
|
|
19
|
+
<Source
|
|
20
|
+
language="html"
|
|
21
|
+
dark
|
|
22
|
+
code={`
|
|
23
|
+
<UnnnicSelectSmart v-model="exampleValue" :options="exampleArray" />
|
|
24
|
+
`}
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
#### **IMPORTANT:**
|
|
30
|
+
|
|
31
|
+
To ensure proper functioning of the component, it is fundamental to provide the `v-model`
|
|
32
|
+
(or `value` and `@input`), even if it is empty (`[]`), since it is through this property
|
|
33
|
+
that the selected options are controlled.
|
|
34
|
+
|
|
35
|
+
The other one required property is `options`, which requires an array of objects in the following format:
|
|
36
|
+
|
|
37
|
+
| Key | Description | Type |
|
|
38
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
39
|
+
| value | **Required.**<br/>Sets the option value. If it is empty, the _label_ of this object will be used as the _placeholder_ of the SelectSmart. | string |
|
|
40
|
+
| label | **Required.**<br/>Provides user-friendly text that represents the option to the user. | string |
|
|
41
|
+
| description | _Not required._<br/>Provides an additional description for the option. | string |
|
|
42
|
+
|
|
43
|
+
<Source
|
|
44
|
+
language="json"
|
|
45
|
+
dark
|
|
46
|
+
code={`[
|
|
47
|
+
{
|
|
48
|
+
"value": "",
|
|
49
|
+
"label": "Select some option" <---- Since the value of this object is empty, this will be the placeholder
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"value": "1",
|
|
53
|
+
"label": "Option 1",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"value": "2",
|
|
57
|
+
"label": "Option 2",
|
|
58
|
+
"description": "This is the first option"
|
|
59
|
+
},
|
|
60
|
+
]`}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
> The options will be presented in alphabetical order, following the value of each `label`,
|
|
64
|
+
> regardless of the sequence in which the objects are supplied to the `:options` property.
|
|
65
|
+
> However, if the `orderedByIndex` property is included, the options will be sorted
|
|
66
|
+
> according to the arrangement given to `:options`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
<br />
|
|
71
|
+
|
|
72
|
+
## Default
|
|
73
|
+
|
|
74
|
+
Allows you to choose from a list.
|
|
75
|
+
|
|
76
|
+
<Story of={SelectSmartStories.Default} />
|
|
77
|
+
|
|
78
|
+
## Loading
|
|
79
|
+
|
|
80
|
+
Variation that signals data loading. Use `isLoading` prop.
|
|
81
|
+
|
|
82
|
+
<Story of={SelectSmartStories.Loading} />
|
|
83
|
+
|
|
84
|
+
## Default option selected
|
|
85
|
+
|
|
86
|
+
For the first option to be selected by default, it is essential that
|
|
87
|
+
there is no object with its `value` field empty.
|
|
88
|
+
|
|
89
|
+
If your intention is to set a specific option as the default, you can
|
|
90
|
+
accomplish this using the `value` (or `v-model`) property. Make sure that this
|
|
91
|
+
value is passed as an array, and that the object is structured according to the
|
|
92
|
+
pattern of the other options.
|
|
93
|
+
|
|
94
|
+
<Story of={SelectSmartStories.FirstSelected} />
|
|
95
|
+
|
|
96
|
+
## Ordered by index
|
|
97
|
+
|
|
98
|
+
If the `orderedByIndex` property is included, the options will
|
|
99
|
+
be ordered according to the arrangement given to `:options`.
|
|
100
|
+
|
|
101
|
+
<Story of={SelectSmartStories.OrderedByIndex} />
|
|
102
|
+
|
|
103
|
+
## Disabled
|
|
104
|
+
|
|
105
|
+
SelectSmart will respond to the value passed to the `disabled` property,
|
|
106
|
+
becoming disabled when set to _true_ and remaining enabled when set to _false_.
|
|
107
|
+
|
|
108
|
+
<Story of={SelectSmartStories.Disabled} />
|
|
109
|
+
|
|
110
|
+
## With descriptions
|
|
111
|
+
|
|
112
|
+
If you want a more detailed description for your options, you can include the
|
|
113
|
+
`description` key inside the object corresponding to each option.
|
|
114
|
+
|
|
115
|
+
<Story of={SelectSmartStories.WithDescriptions} />
|
|
116
|
+
|
|
117
|
+
## Autocomplete
|
|
118
|
+
|
|
119
|
+
To activate the search functionality, just include the `autocomplete` property.
|
|
120
|
+
The search takes place based on the text of the `label`, without distinction
|
|
121
|
+
between uppercase and lowercase, spaces and accents.
|
|
122
|
+
|
|
123
|
+
If you want the search bar to be emptied when focusing on the component, use
|
|
124
|
+
the `autocompleteClearOnFocus` property.
|
|
125
|
+
|
|
126
|
+
Furthermore, it is possible to incorporate the magnifying glass icon on the side (left) of
|
|
127
|
+
the search bar by using the `autocompleteIconLeft` property.
|
|
128
|
+
|
|
129
|
+
<Story of={SelectSmartStories.Autocomplete} />
|
|
130
|
+
|
|
131
|
+
## Enable Search By Value
|
|
132
|
+
|
|
133
|
+
To activate the search by value functionality, just include the `enableSearchByValue` property.
|
|
134
|
+
|
|
135
|
+
The search takes place based on the text of the `label` or `value`, without distinction
|
|
136
|
+
between uppercase and lowercase, spaces and accents.
|
|
137
|
+
|
|
138
|
+
<Story of={SelectSmartStories.EnableSearchByValue} />
|
|
139
|
+
|
|
140
|
+
## Multiple
|
|
141
|
+
|
|
142
|
+
To use the component version that allows the selection of
|
|
143
|
+
several options, just pass the `multiple` property.
|
|
144
|
+
|
|
145
|
+
You also have the freedom to customize the message that signals
|
|
146
|
+
when no option has been selected, through the `multipleWithoutSelectsMessage` property.
|
|
147
|
+
|
|
148
|
+
Typically, components involving multiple options offer a considerable range
|
|
149
|
+
of choices. So, in order to improve the user experience, the `multiple` option
|
|
150
|
+
automatically activates the `autocomplete` feature, it cannot be deactivated.
|
|
151
|
+
|
|
152
|
+
<Story of={SelectSmartStories.Multiple} />
|