@livestorm/ui-vue 1.1.3 → 2.0.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/README.md +164 -32
- package/components-vite.js +5 -5
- package/components.d.ts +3 -3
- package/dist/UiTimelineItem.vue_vue_type_style_index_0_lang-DOLFRKcb.mjs +5565 -0
- package/dist/a11y-DIdrv5Mn.mjs +66 -0
- package/dist/breakpoints.mjs +9 -0
- package/dist/bus.mjs +5 -0
- package/dist/components.mjs +214 -1663
- package/dist/index.mjs +84 -166
- package/dist/integrations.mjs +8 -0
- package/dist/layouts.mjs +236 -0
- package/dist/responsive.mjs +25 -0
- package/dist/slot.mjs +21 -0
- package/dist/toastDSV2-wMh-UMzW.mjs +74 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/src/components/Toast/LayoutToasts.vue.d.ts +3 -0
- package/dist/types/src/components/Toast/ToastMessage.vue.d.ts +21 -0
- package/dist/types/src/components/Toast/toastDSV2.d.ts +102 -0
- package/dist/types/src/components/UiActionBar/UiActionBar.vue.d.ts +44 -0
- package/dist/types/src/components/UiActionBar/UiActionBarItem.vue.d.ts +47 -0
- package/dist/types/src/components/UiActionBar/UiActionBarSeparator.vue.d.ts +3 -0
- package/dist/types/src/components/UiActionBar/index.d.ts +4 -0
- package/dist/types/src/components/UiActionBar/types.d.ts +14 -0
- package/dist/types/src/components/UiAnimatedLogo/UiAnimatedLogo.vue.d.ts +10 -0
- package/dist/types/src/components/UiAnimatedLogo/animations-links.d.ts +3 -0
- package/dist/types/src/components/UiAvatar/UiAvatar.vue.d.ts +55 -0
- package/dist/types/src/components/UiAvatar/index.d.ts +1 -0
- package/dist/types/src/components/UiAvatarList/UiAvatarList.vue.d.ts +28 -0
- package/dist/types/src/components/UiAvatarList/index.d.ts +1 -0
- package/dist/types/src/components/UiBadge/UiBadge.vue.d.ts +47 -0
- package/dist/types/src/components/UiBadge/index.d.ts +1 -0
- package/dist/types/src/components/UiBanner/UiBanner.vue.d.ts +96 -0
- package/dist/types/src/components/UiBanner/index.d.ts +2 -0
- package/dist/types/src/components/UiBreadcrumb/UiBreadcrumb.vue.d.ts +15 -0
- package/dist/types/src/components/UiBreadcrumb/index.d.ts +2 -0
- package/dist/types/src/components/UiButton/UiButton.vue.d.ts +249 -0
- package/dist/types/src/components/UiButtonGroup/UiButtonGroup.vue.d.ts +42 -0
- package/dist/types/src/components/UiButtonGroup/UiButtonGroupItem.vue.d.ts +21 -0
- package/dist/types/src/components/UiButtonGroup/index.d.ts +3 -0
- package/dist/types/src/components/UiButtonGroup/types.d.ts +10 -0
- package/dist/types/src/components/UiCard/UiCard.vue.d.ts +31 -0
- package/dist/types/src/components/UiCarousel/UiCarousel.vue.d.ts +63 -0
- package/dist/types/src/components/UiCarousel/index.d.ts +2 -0
- package/dist/types/src/components/UiColorField/UiColorField.vue.d.ts +19 -0
- package/dist/types/src/components/UiColorField/index.d.ts +2 -0
- package/dist/types/src/components/UiColorField/types.d.ts +29 -0
- package/dist/types/src/components/UiColorPicker/UiColorPicker.vue.d.ts +35 -0
- package/dist/types/src/components/UiColorPicker/index.d.ts +2 -0
- package/dist/types/src/components/UiColorPicker/types.d.ts +97 -0
- package/dist/types/src/components/UiDialog/MarketplaceHeaderExample.vue.d.ts +28 -0
- package/dist/types/src/components/UiDialog/UiDialog.vue.d.ts +18 -0
- package/dist/types/src/components/UiDialog/UiDialogClose.vue.d.ts +10 -0
- package/dist/types/src/components/UiDialog/UiDialogContent.vue.d.ts +54 -0
- package/dist/types/src/components/UiDialog/UiDialogFooter.vue.d.ts +13 -0
- package/dist/types/src/components/UiDialog/UiDialogTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiDialog/index.d.ts +7 -0
- package/dist/types/src/components/UiDropdown/UiDropdown.vue.d.ts +42 -0
- package/dist/types/src/components/UiDropdown/UiDropdownContent.vue.d.ts +32 -0
- package/dist/types/src/components/UiDropdown/UiDropdownItem.vue.d.ts +27 -0
- package/dist/types/src/components/UiDropdown/UiDropdownSeparator.vue.d.ts +3 -0
- package/dist/types/src/components/UiDropdown/UiDropdownTrigger.vue.d.ts +45 -0
- package/dist/types/src/components/UiDropdown/context.d.ts +7 -0
- package/dist/types/src/components/UiDropdown/index.d.ts +6 -0
- package/dist/types/src/components/UiEmptyState/UiEmptyState.vue.d.ts +29 -0
- package/dist/types/src/components/UiFieldWrapper/UiFieldWrapper.vue.d.ts +36 -0
- package/dist/types/src/components/UiFieldWrapper/index.d.ts +1 -0
- package/dist/types/src/components/UiForm/UiFormField.types.d.ts +22 -0
- package/dist/types/src/components/UiForm/UiFormField.vue.d.ts +34 -0
- package/dist/types/src/components/UiForm/index.d.ts +3 -0
- package/dist/types/src/components/UiHorizontalSeparator/UiHorizontalSeparator.vue.d.ts +6 -0
- package/dist/types/src/components/UiInputCheckbox/UiInputCheckbox.vue.d.ts +108 -0
- package/dist/types/src/components/UiInputCheckbox/index.d.ts +2 -0
- package/dist/types/src/components/UiInputCheckbox/types.d.ts +1 -0
- package/dist/types/src/components/UiInputSelect/UiInputSelect.vue.d.ts +66 -0
- package/dist/types/src/components/UiInputSelect/index.d.ts +2 -0
- package/dist/types/src/components/UiInputSelect/types.d.ts +1 -0
- package/dist/types/src/components/UiInputTextarea/UiInputTextarea.vue.d.ts +49 -0
- package/dist/types/src/components/UiInputTextarea/index.d.ts +2 -0
- package/dist/types/src/components/UiInputTextarea/types.d.ts +1 -0
- package/dist/types/src/components/UiLabel/UiLabel.vue.d.ts +17 -0
- package/dist/types/src/components/UiList/UiList.vue.d.ts +27 -0
- package/dist/types/src/components/UiListItem/UiListItem.vue.d.ts +35 -0
- package/dist/types/src/components/UiLoader/UiLoader.vue.d.ts +17 -0
- package/dist/types/src/components/UiLogo/UiLogo.vue.d.ts +20 -0
- package/dist/types/src/components/UiLogo/variants/PulseVariant.vue.d.ts +3 -0
- package/dist/types/src/components/UiLogo/variants/TornadoVariant.vue.d.ts +3 -0
- package/dist/types/src/components/UiMenu/UiMenu.vue.d.ts +18 -0
- package/dist/types/src/components/UiMenu/UiMenuContent.vue.d.ts +30 -0
- package/dist/types/src/components/UiMenu/UiMenuGroup.vue.d.ts +16 -0
- package/dist/types/src/components/UiMenu/UiMenuItem.vue.d.ts +18 -0
- package/dist/types/src/components/UiMenu/UiMenuLabel.vue.d.ts +13 -0
- package/dist/types/src/components/UiMenu/UiMenuSeparator.vue.d.ts +13 -0
- package/dist/types/src/components/UiMenu/UiMenuSub.vue.d.ts +18 -0
- package/dist/types/src/components/UiMenu/UiMenuSubContent.vue.d.ts +32 -0
- package/dist/types/src/components/UiMenu/UiMenuSubTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiMenu/UiMenuTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiMenu/index.d.ts +10 -0
- package/dist/types/src/components/UiPage/UiPage.vue.d.ts +37 -0
- package/dist/types/src/components/UiPageHeader/UiPageHeader.vue.d.ts +33 -0
- package/dist/types/src/components/UiPopover/UiPopover.vue.d.ts +18 -0
- package/dist/types/src/components/UiPopover/UiPopoverAnchor.vue.d.ts +14 -0
- package/dist/types/src/components/UiPopover/UiPopoverContent.vue.d.ts +28 -0
- package/dist/types/src/components/UiPopover/UiPopoverTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiProgress/UiProgress.vue.d.ts +15 -0
- package/dist/types/src/components/UiProgress/index.d.ts +2 -0
- package/dist/types/src/components/UiProgress/types.d.ts +4 -0
- package/dist/types/src/components/UiRoomButton/UiRoomButton.vue.d.ts +29 -0
- package/dist/types/src/components/UiShell/UiShell.vue.d.ts +24 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenu.vue.d.ts +64 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuBottom.vue.d.ts +7 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuItem.vue.d.ts +53 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuItemContent.vue.d.ts +43 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuTop.vue.d.ts +7 -0
- package/dist/types/src/components/UiSideMenu/injection.d.ts +7 -0
- package/dist/types/src/components/UiSideMenu/types.d.ts +39 -0
- package/dist/types/src/components/UiSideMenu/useLabelHidden.d.ts +2 -0
- package/dist/types/src/components/UiSideMenu/useSideMenuLayout.d.ts +7 -0
- package/dist/types/src/components/UiStepper/UiStepper.vue.d.ts +18 -0
- package/dist/types/src/components/UiStepper/UiStepperDescription.vue.d.ts +14 -0
- package/dist/types/src/components/UiStepper/UiStepperIndicator.vue.d.ts +20 -0
- package/dist/types/src/components/UiStepper/UiStepperItem.vue.d.ts +19 -0
- package/dist/types/src/components/UiStepper/UiStepperSeparator.vue.d.ts +10 -0
- package/dist/types/src/components/UiStepper/UiStepperTitle.vue.d.ts +14 -0
- package/dist/types/src/components/UiStepper/index.d.ts +7 -0
- package/dist/types/src/components/UiTable/UiTable.vue.d.ts +20 -0
- package/dist/types/src/components/UiTable/UiTableBody.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableCell.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableHeader.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableHeaderCell.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableRow.vue.d.ts +16 -0
- package/dist/types/src/components/UiTable/index.d.ts +6 -0
- package/dist/types/src/components/UiTabs/UiTabs.vue.d.ts +37 -0
- package/dist/types/src/components/UiTabs/index.d.ts +2 -0
- package/dist/types/src/components/UiTag/UiTag.vue.d.ts +43 -0
- package/dist/types/src/components/UiTag/index.d.ts +1 -0
- package/dist/types/src/components/UiTextField/UiTextField.vue.d.ts +65 -0
- package/dist/types/src/components/UiTextField/index.d.ts +2 -0
- package/dist/types/src/components/UiTextField/types.d.ts +2 -0
- package/dist/types/src/components/UiTimeline/UiTimeline.vue.d.ts +19 -0
- package/dist/types/src/components/UiTimeline/UiTimelineItem.vue.d.ts +28 -0
- package/dist/types/src/components/UiTimeline/index.d.ts +2 -0
- package/dist/types/src/components/UiTooltip/UiTooltip.vue.d.ts +18 -0
- package/dist/types/src/components/UiTooltip/UiTooltipContent.vue.d.ts +54 -0
- package/dist/types/src/components/UiTooltip/UiTooltipProvider.vue.d.ts +17 -0
- package/dist/types/src/components/UiTooltip/UiTooltipTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiTooltip/index.d.ts +4 -0
- package/dist/types/src/composables/useButtonStyles.d.ts +20 -0
- package/dist/types/src/composables/useMobileMenu.d.ts +11 -0
- package/dist/types/src/composables/useThemeAndModes.d.ts +34 -0
- package/dist/types/src/constants/index.d.ts +2 -0
- package/dist/types/src/constants/sizes.d.ts +2 -0
- package/dist/types/src/constants/themes.d.ts +22 -0
- package/dist/types/src/integrations/index.d.ts +1 -0
- package/dist/types/src/layouts/index.d.ts +2 -0
- package/dist/types/src/mixins/DynamicAction.d.ts +30 -0
- package/dist/types/src/primitives.d.ts +6 -0
- package/dist/types/src/theme.d.ts +1 -0
- package/dist/types/src/utils/a11y.d.ts +2 -0
- package/dist/types/src/utils/breakpoints.d.ts +9 -0
- package/dist/types/src/utils/bus.d.ts +2 -0
- package/dist/types/src/utils/clipboard.d.ts +4 -0
- package/dist/types/src/utils/devices.d.ts +19 -0
- package/dist/types/src/utils/elements.d.ts +1 -0
- package/dist/types/src/utils/index.d.ts +9 -0
- package/dist/types/src/utils/numbers.d.ts +30 -0
- package/dist/types/src/utils/responsive.d.ts +5 -0
- package/dist/types/src/utils/responsive.types.d.ts +12 -0
- package/dist/types/src/utils/router.d.ts +1 -0
- package/dist/types/src/utils/slot.d.ts +8 -0
- package/dist/types/src/utils/stack-view.d.ts +10 -0
- package/dist/types/src/utils/uid.d.ts +1 -0
- package/dist/types/style.d.ts +1 -0
- package/dist/ui-vue.css +1 -0
- package/dist/useThemeAndModes-DY5SDC0a.mjs +109 -0
- package/dist/utils.mjs +111 -0
- package/index.d.ts +88 -2
- package/index.js +169 -16
- package/integrations.d.ts +10 -0
- package/package.json +131 -63
- package/src/components/Toast/LayoutToasts.vue +63 -0
- package/src/components/Toast/ToastMessage.vue +208 -0
- package/src/components/Toast/toastDSV2.ts +151 -0
- package/src/components/UiActionBar/UiActionBar.vue +86 -0
- package/src/components/UiActionBar/UiActionBarItem.vue +179 -0
- package/src/components/UiActionBar/UiActionBarSeparator.vue +18 -0
- package/src/components/UiActionBar/index.ts +4 -0
- package/src/components/UiActionBar/types.ts +24 -0
- package/src/components/UiAnimatedLogo/UiAnimatedLogo.vue +47 -0
- package/src/components/UiAnimatedLogo/animations-links.ts +6 -0
- package/src/components/UiAvatar/UiAvatar.vue +186 -0
- package/src/components/UiAvatar/index.js +1 -0
- package/src/components/UiAvatarList/UiAvatarList.vue +109 -0
- package/src/components/UiAvatarList/index.js +1 -0
- package/src/components/UiBadge/UiBadge.vue +161 -0
- package/src/components/UiBadge/index.ts +2 -0
- package/src/components/UiBanner/UiBanner.vue +363 -0
- package/src/components/UiBanner/index.ts +2 -0
- package/src/components/UiBreadcrumb/UiBreadcrumb.vue +93 -0
- package/src/components/UiBreadcrumb/index.ts +2 -0
- package/src/components/UiButton/UiButton.vue +319 -0
- package/src/components/UiButtonGroup/UiButtonGroup.vue +198 -0
- package/src/components/UiButtonGroup/UiButtonGroupItem.vue +123 -0
- package/src/components/UiButtonGroup/index.ts +3 -0
- package/src/components/UiButtonGroup/types.ts +24 -0
- package/src/components/UiCard/UiCard.vue +112 -0
- package/src/components/UiCarousel/UiCarousel.vue +215 -0
- package/src/components/UiCarousel/index.ts +2 -0
- package/src/components/UiColorField/UiColorField.vue +158 -0
- package/src/components/UiColorField/index.ts +2 -0
- package/src/components/UiColorField/types.ts +30 -0
- package/src/components/UiColorPicker/UiColorPicker.vue +487 -0
- package/src/components/UiColorPicker/index.ts +2 -0
- package/src/components/UiColorPicker/types.ts +103 -0
- package/src/components/UiDialog/MarketplaceHeaderExample.vue +217 -0
- package/src/components/UiDialog/UiDialog.md +97 -0
- package/src/components/UiDialog/UiDialog.vue +16 -0
- package/src/components/UiDialog/UiDialogClose.vue +29 -0
- package/src/components/UiDialog/UiDialogContent.vue +238 -0
- package/src/components/UiDialog/UiDialogFooter.vue +9 -0
- package/src/components/UiDialog/UiDialogTrigger.vue +12 -0
- package/src/components/UiDialog/index.ts +18 -0
- package/src/components/UiDropdown/UiDropdown.vue +48 -0
- package/src/components/UiDropdown/UiDropdownContent.vue +72 -0
- package/src/components/UiDropdown/UiDropdownItem.vue +75 -0
- package/src/components/UiDropdown/UiDropdownSeparator.vue +7 -0
- package/src/components/UiDropdown/UiDropdownTrigger.vue +239 -0
- package/src/components/UiDropdown/context.ts +9 -0
- package/src/components/UiDropdown/index.ts +21 -0
- package/src/components/UiEmptyState/UiEmptyState.vue +80 -0
- package/src/components/UiFieldWrapper/UiFieldWrapper.vue +79 -0
- package/src/components/UiFieldWrapper/index.ts +1 -0
- package/src/components/UiForm/UiFormField.types.ts +24 -0
- package/src/components/UiForm/UiFormField.vue +66 -0
- package/src/components/UiForm/index.ts +3 -0
- package/src/components/UiHorizontalSeparator/UiHorizontalSeparator.vue +28 -0
- package/src/components/UiInputCheckbox/UiInputCheckbox.vue +477 -0
- package/src/components/UiInputCheckbox/index.ts +2 -0
- package/src/components/UiInputCheckbox/types.ts +1 -0
- package/src/components/UiInputSelect/UiInputSelect.vue +166 -0
- package/src/components/UiInputSelect/index.ts +2 -0
- package/src/components/UiInputSelect/types.ts +1 -0
- package/src/components/UiInputTextarea/UiInputTextarea.vue +219 -0
- package/src/components/UiInputTextarea/index.ts +2 -0
- package/src/components/UiInputTextarea/types.ts +1 -0
- package/src/components/UiLabel/UiLabel.vue +34 -0
- package/src/components/UiList/UiList.vue +45 -0
- package/src/components/UiListItem/UiListItem.vue +108 -0
- package/src/components/UiLoader/UiLoader.vue +45 -0
- package/src/components/UiLogo/UiLogo.vue +99 -0
- package/src/components/UiLogo/variants/PulseVariant.vue +51 -0
- package/src/components/UiLogo/variants/TornadoVariant.vue +147 -0
- package/src/components/UiMenu/UiMenu.vue +15 -0
- package/src/components/UiMenu/UiMenuContent.vue +25 -0
- package/src/components/UiMenu/UiMenuGroup.vue +19 -0
- package/src/components/UiMenu/UiMenuItem.vue +18 -0
- package/src/components/UiMenu/UiMenuLabel.vue +9 -0
- package/src/components/UiMenu/UiMenuSeparator.vue +9 -0
- package/src/components/UiMenu/UiMenuSub.vue +15 -0
- package/src/components/UiMenu/UiMenuSubContent.vue +23 -0
- package/src/components/UiMenu/UiMenuSubTrigger.vue +17 -0
- package/src/components/UiMenu/UiMenuTrigger.vue +13 -0
- package/src/components/UiMenu/index.ts +10 -0
- package/src/components/UiPage/UiPage.vue +201 -0
- package/src/components/UiPageHeader/UiPageHeader.vue +128 -0
- package/src/components/UiPopover/UiPopover.vue +16 -0
- package/src/components/UiPopover/UiPopoverAnchor.vue +12 -0
- package/src/components/UiPopover/UiPopoverContent.vue +26 -0
- package/src/components/UiPopover/UiPopoverTrigger.vue +19 -0
- package/src/components/UiProgress/UiProgress.vue +92 -0
- package/src/components/UiProgress/index.ts +2 -0
- package/src/components/UiProgress/types.ts +5 -0
- package/src/components/UiRoomButton/UiRoomButton.vue +240 -0
- package/src/components/UiShell/UiShell.vue +88 -0
- package/src/components/UiSideMenu/UiSideMenu.vue +513 -0
- package/src/components/UiSideMenu/UiSideMenuBottom.vue +27 -0
- package/src/components/UiSideMenu/UiSideMenuItem.vue +102 -0
- package/src/components/UiSideMenu/UiSideMenuItemContent.vue +172 -0
- package/src/components/UiSideMenu/UiSideMenuTop.vue +29 -0
- package/src/components/UiSideMenu/injection.ts +9 -0
- package/src/components/UiSideMenu/types.ts +41 -0
- package/src/components/UiSideMenu/useLabelHidden.ts +33 -0
- package/src/components/UiSideMenu/useSideMenuLayout.ts +12 -0
- package/src/components/UiStepper/UiStepper.vue +40 -0
- package/src/components/UiStepper/UiStepperDescription.vue +27 -0
- package/src/components/UiStepper/UiStepperIndicator.vue +93 -0
- package/src/components/UiStepper/UiStepperItem.vue +30 -0
- package/src/components/UiStepper/UiStepperSeparator.vue +49 -0
- package/src/components/UiStepper/UiStepperTitle.vue +24 -0
- package/src/components/UiStepper/index.ts +17 -0
- package/src/components/UiTable/UiTable.vue +24 -0
- package/src/components/UiTable/UiTableBody.vue +5 -0
- package/src/components/UiTable/UiTableCell.vue +26 -0
- package/src/components/UiTable/UiTableHeader.vue +17 -0
- package/src/components/UiTable/UiTableHeaderCell.vue +19 -0
- package/src/components/UiTable/UiTableRow.vue +27 -0
- package/src/components/UiTable/index.ts +6 -0
- package/src/components/UiTabs/UiTabs.vue +218 -0
- package/src/components/UiTabs/index.ts +5 -0
- package/src/components/UiTag/UiTag.vue +187 -0
- package/src/components/UiTag/index.js +1 -0
- package/src/components/UiTextField/UiTextField.vue +370 -0
- package/src/components/UiTextField/index.ts +2 -0
- package/src/components/UiTextField/types.ts +2 -0
- package/src/components/UiTimeline/README.md +169 -0
- package/src/components/UiTimeline/UiTimeline.vue +58 -0
- package/src/components/UiTimeline/UiTimelineItem.vue +141 -0
- package/src/components/UiTimeline/index.ts +2 -0
- package/src/components/UiTooltip/UiTooltip.vue +16 -0
- package/src/components/UiTooltip/UiTooltipContent.vue +86 -0
- package/src/components/UiTooltip/UiTooltipProvider.vue +15 -0
- package/src/components/UiTooltip/UiTooltipTrigger.vue +19 -0
- package/src/components/UiTooltip/index.js +4 -0
- package/src/composables/useButtonStyles.ts +242 -0
- package/src/composables/useMobileMenu.ts +57 -0
- package/src/composables/useThemeAndModes.ts +225 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/sizes.ts +2 -0
- package/src/constants/themes.ts +34 -0
- package/src/css/{body.postcss → body.css} +3 -2
- package/src/css/reka-animations.css +209 -0
- package/src/css/{transitions.postcss → transitions.css} +12 -5
- package/src/global.d.ts +181 -0
- package/src/integrations/index.js +1 -0
- package/src/layouts/index.js +5 -0
- package/src/mixins/DynamicAction.js +5 -3
- package/src/primitives.ts +6 -0
- package/src/theme.ts +1 -0
- package/src/utils/a11y.ts +8 -0
- package/src/utils/{breakpoints.js → breakpoints.ts} +1 -0
- package/src/utils/clipboard.js +2 -2
- package/src/utils/devices.js +0 -3
- package/src/utils/index.js +2 -1
- package/src/utils/numbers.ts +61 -0
- package/src/utils/responsive.types.ts +12 -0
- package/src/utils/{slot.js → slot.ts} +18 -1
- package/style.js +3 -12
- package/theme.d.ts +1 -0
- package/.env +0 -1
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -49
- package/.pkg +0 -11
- package/babel.config.js +0 -5
- package/build/Dockerfile +0 -31
- package/ci/ci.yml +0 -54
- package/components-webpack.js +0 -29
- package/dist/environment-da321c85.mjs +0 -1656
- package/dist/style.css +0 -1
- package/plugins.js +0 -17
- package/postcss.config.js +0 -1
- package/src/components/BaseAutocomplete/BaseAutocomplete.spec.js +0 -506
- package/src/components/BaseAutocomplete/BaseAutocomplete.stories.js +0 -184
- package/src/components/BaseAutocomplete/BaseAutocomplete.vue +0 -431
- package/src/components/BaseBanner/BaseBanner.spec.js +0 -32
- package/src/components/BaseBanner/BaseBanner.stories.js +0 -133
- package/src/components/BaseBanner/BaseBanner.vue +0 -229
- package/src/components/BaseButton/BaseButton.spec.js +0 -98
- package/src/components/BaseButton/BaseButton.stories.js +0 -300
- package/src/components/BaseButton/BaseButton.vue +0 -193
- package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap +0 -37
- package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap.old +0 -31
- package/src/components/BaseCheckbox/BaseCheckbox.stories.js +0 -157
- package/src/components/BaseCheckbox/BaseCheckbox.vue +0 -180
- package/src/components/BaseDropdownMenu/BaseDropdownMenu.stories.js +0 -84
- package/src/components/BaseDropdownMenu/BaseDropdownMenu.vue +0 -251
- package/src/components/BaseDropdownMenu/BaseDropdownMenuButton.vue +0 -26
- package/src/components/BaseDropdownMenu/BaseDropdownMenuDivider.vue +0 -10
- package/src/components/BaseDropdownMenu/BaseDropdownMenuItem.vue +0 -206
- package/src/components/BaseDropdownMenu/BaseDropdownMenuSearch.vue +0 -49
- package/src/components/BaseDropdownMenu/BaseDropdownMenuTitle.vue +0 -26
- package/src/components/BaseModal/BaseModal.stories.js +0 -155
- package/src/components/BaseModal/BaseModal.vue +0 -187
- package/src/components/BaseModal/BaseModalContent.vue +0 -166
- package/src/components/BaseModal/BaseModalContentOld.vue +0 -242
- package/src/components/BaseRadio/BaseRadio.stories.js +0 -164
- package/src/components/BaseRadio/BaseRadio.vue +0 -153
- package/src/components/BaseRating/BaseRating.spec.js +0 -46
- package/src/components/BaseRating/BaseRating.stories.js +0 -46
- package/src/components/BaseRating/BaseRating.vue +0 -119
- package/src/components/BaseSelect/BaseSelect.stories.js +0 -177
- package/src/components/BaseSelect/BaseSelect.vue +0 -443
- package/src/components/BaseSelect/BaseSelectGroup.vue +0 -34
- package/src/components/BaseSelect/BaseSelectOption.vue +0 -219
- package/src/components/BaseSwitch/BaseSwitch.stories.js +0 -44
- package/src/components/BaseSwitch/BaseSwitch.vue +0 -114
- package/src/components/BaseTag/BaseTag.stories.js +0 -123
- package/src/components/BaseTag/BaseTag.vue +0 -244
- package/src/css/button.postcss +0 -363
- package/src/css/checkbox-radio.postcss +0 -188
- package/src/css/icon.postcss +0 -9
- package/src/css/loader.postcss +0 -120
- package/src/css/popper.postcss +0 -161
- package/src/css/tailwind-utilities.postcss +0 -1
- package/src/css/tailwind.postcss +0 -2
- package/style-postcss.d.ts +0 -3
- package/style-postcss.js +0 -2
- package/tailwind.config.base.cjs +0 -88
- package/tailwind.config.js +0 -9
- package/tsconfig.check.json +0 -13
- package/tsconfig.json +0 -66
- package/vite.config.js +0 -43
- package/vitest.setup.js +0 -26
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* @TODO Remove it once the fullscreen mode is supported
|
|
4
|
-
* in BaseModal or another dedicated component (to define)
|
|
5
|
-
*/
|
|
6
|
-
import { computed, inject, watch, toRefs } from 'vue'
|
|
7
|
-
import { useSlotsAsComponents } from '../../utils/slot'
|
|
8
|
-
import { InjectPropsFromContent, InjectClose, InjectOnClose } from './BaseModal.vue'
|
|
9
|
-
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
locked: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: false,
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
width: {
|
|
17
|
-
type: Number,
|
|
18
|
-
default: null,
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// @deprecated
|
|
22
|
-
fullScreen: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false,
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
// @deprecated
|
|
28
|
-
noPadding: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
dataTestid: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: null,
|
|
36
|
-
},
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
const {
|
|
40
|
-
locked,
|
|
41
|
-
fullScreen,
|
|
42
|
-
width,
|
|
43
|
-
noPadding,
|
|
44
|
-
} = toRefs(props)
|
|
45
|
-
|
|
46
|
-
const emit = defineEmits([
|
|
47
|
-
'close',
|
|
48
|
-
])
|
|
49
|
-
|
|
50
|
-
// Send back to BaseModal the props used in BaseModal
|
|
51
|
-
|
|
52
|
-
const propsToParent = inject(InjectPropsFromContent)
|
|
53
|
-
|
|
54
|
-
if (!propsToParent) {
|
|
55
|
-
throw new Error('BaseModalContentOld must be used inside BaseModal')
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
watch(() => props.locked, value => {
|
|
59
|
-
propsToParent.locked = value
|
|
60
|
-
}, { immediate: true })
|
|
61
|
-
watch(() => props.fullScreen, value => {
|
|
62
|
-
propsToParent.fullScreen = value
|
|
63
|
-
}, { immediate: true })
|
|
64
|
-
|
|
65
|
-
// Close
|
|
66
|
-
|
|
67
|
-
const closeParent = inject(InjectClose)!
|
|
68
|
-
|
|
69
|
-
function close (alsoCloseParent = true) {
|
|
70
|
-
if (!locked.value) {
|
|
71
|
-
emit('close')
|
|
72
|
-
if (alsoCloseParent) {
|
|
73
|
-
closeParent()
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const onParentClose = inject(InjectOnClose)!
|
|
79
|
-
|
|
80
|
-
onParentClose(() => {
|
|
81
|
-
close(false)
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
// Slots
|
|
85
|
-
|
|
86
|
-
const slots = useSlotsAsComponents()
|
|
87
|
-
const titleSlot = computed(() => slots.title!())
|
|
88
|
-
const subtitleSlot = computed(() => slots.subtitle!())
|
|
89
|
-
const contentSlot = computed(() => slots.content!())
|
|
90
|
-
</script>
|
|
91
|
-
|
|
92
|
-
<template>
|
|
93
|
-
<div
|
|
94
|
-
:class="{
|
|
95
|
-
'has-header': titleSlot || subtitleSlot,
|
|
96
|
-
'has-title': titleSlot,
|
|
97
|
-
'has-subtitle': subtitleSlot,
|
|
98
|
-
'has-content': contentSlot,
|
|
99
|
-
}"
|
|
100
|
-
class="base-modal-layout"
|
|
101
|
-
@click.stop
|
|
102
|
-
>
|
|
103
|
-
<section
|
|
104
|
-
:style="{ 'max-width': `${width}px` }"
|
|
105
|
-
:class="[noPadding ? 'p-0': 'p-5']"
|
|
106
|
-
class="transition-transform"
|
|
107
|
-
:data-testid="dataTestid"
|
|
108
|
-
>
|
|
109
|
-
<slot name="outside-header" />
|
|
110
|
-
|
|
111
|
-
<div class="base-modal-header">
|
|
112
|
-
<div
|
|
113
|
-
v-if="!locked && !fullScreen"
|
|
114
|
-
class="close-button"
|
|
115
|
-
data-testid="modal-close-icon"
|
|
116
|
-
@click="close()"
|
|
117
|
-
>
|
|
118
|
-
<div
|
|
119
|
-
class="i-ls-x icon"
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
<div
|
|
124
|
-
v-if="titleSlot"
|
|
125
|
-
class="title text-grey-900"
|
|
126
|
-
:class="{
|
|
127
|
-
'flex flex-row items-center border-b h-16 border-grey-200 px-6 py-4': fullScreen,
|
|
128
|
-
}"
|
|
129
|
-
>
|
|
130
|
-
<div
|
|
131
|
-
v-if="fullScreen"
|
|
132
|
-
class="i-ls-chevron-left arrow-back cursor-pointer w-6 h-6 mr-2 text-grey-600 hover:text-grey-600"
|
|
133
|
-
@click="close()"
|
|
134
|
-
/>
|
|
135
|
-
<RenderSlot :vnodes="titleSlot" />
|
|
136
|
-
</div>
|
|
137
|
-
<div
|
|
138
|
-
v-if="subtitleSlot"
|
|
139
|
-
class="subtitle"
|
|
140
|
-
>
|
|
141
|
-
<RenderSlot :vnodes="subtitleSlot" />
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
<div
|
|
146
|
-
v-if="contentSlot"
|
|
147
|
-
class="base-modal-content"
|
|
148
|
-
>
|
|
149
|
-
<RenderSlot :vnodes="contentSlot" />
|
|
150
|
-
</div>
|
|
151
|
-
</section>
|
|
152
|
-
</div>
|
|
153
|
-
</template>
|
|
154
|
-
|
|
155
|
-
<style lang="postcss" scoped>
|
|
156
|
-
.close-button {
|
|
157
|
-
position: absolute;
|
|
158
|
-
top: 0;
|
|
159
|
-
right: 0;
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
opacity: 0.5;
|
|
162
|
-
transition: opacity 0.2s ease;
|
|
163
|
-
margin: 2px;
|
|
164
|
-
padding: 16px;
|
|
165
|
-
.icon {
|
|
166
|
-
width: 24px;
|
|
167
|
-
height: 24px;
|
|
168
|
-
}
|
|
169
|
-
&:hover {
|
|
170
|
-
opacity: 1;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.base-modal-layout {
|
|
175
|
-
position: absolute;
|
|
176
|
-
top: 0;
|
|
177
|
-
left: 0;
|
|
178
|
-
width: 100%;
|
|
179
|
-
height: 0;
|
|
180
|
-
z-index: 8001;
|
|
181
|
-
padding: 0 10px;
|
|
182
|
-
@apply text-grey-900;
|
|
183
|
-
& > section {
|
|
184
|
-
position: relative;
|
|
185
|
-
background: #fff;
|
|
186
|
-
margin: 30px auto;
|
|
187
|
-
max-width: 650px;
|
|
188
|
-
@apply rounded-8;
|
|
189
|
-
}
|
|
190
|
-
&.has-content {
|
|
191
|
-
&.has-header {
|
|
192
|
-
.base-modal-header {
|
|
193
|
-
margin-bottom: 16px;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
&.has-title {
|
|
198
|
-
&.has-subtitle {
|
|
199
|
-
.base-modal-header {
|
|
200
|
-
.subtitle {
|
|
201
|
-
margin-top: 6px;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
&:not(.has-header) {
|
|
207
|
-
.close-button {
|
|
208
|
-
padding: 6px;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.base-modal-header {
|
|
214
|
-
@apply text-grey-700;
|
|
215
|
-
text-align: center;
|
|
216
|
-
& > span {
|
|
217
|
-
display: block;
|
|
218
|
-
}
|
|
219
|
-
.title {
|
|
220
|
-
font-size: 1.1em;
|
|
221
|
-
font-weight: 600;
|
|
222
|
-
}
|
|
223
|
-
.subtitle {
|
|
224
|
-
font-weight: 300;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.img-ico {
|
|
229
|
-
display: block;
|
|
230
|
-
margin: 0 auto 16px auto;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.cover-ico {
|
|
234
|
-
width: 36px;
|
|
235
|
-
height: 36px;
|
|
236
|
-
margin: 0 auto 16px auto;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
:deep(.warning-title) {
|
|
240
|
-
@apply font-semibold text-grey-900
|
|
241
|
-
}
|
|
242
|
-
</style>
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import BaseRadio from './BaseRadio.vue'
|
|
2
|
-
import { action } from '@storybook/addon-actions'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'common/vue/components/BaseRadio',
|
|
6
|
-
component: BaseRadio,
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const actions = {
|
|
10
|
-
onChange: action('change'),
|
|
11
|
-
onClick: action('click'),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Template = (args) => ({
|
|
15
|
-
components: { BaseRadio },
|
|
16
|
-
setup: () => ({ args, ...actions }),
|
|
17
|
-
template: '<BaseRadio v-bind="args" @tooltip-clicked="onClick" @change="onChange" />',
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const TemplateWithBackground = (args) => ({
|
|
21
|
-
components: { BaseRadio },
|
|
22
|
-
setup: () => ({ args, ...actions }),
|
|
23
|
-
template: '<BaseRadio class="base-choice" v-bind="args" @tooltip-clicked="onClick" @change="onChange" />',
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
export const Selected = Template.bind({})
|
|
27
|
-
Selected.args = {
|
|
28
|
-
value: true,
|
|
29
|
-
modelValue: true,
|
|
30
|
-
forId: 'my-radio',
|
|
31
|
-
label: 'This Radio button is selected',
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const SelectedWithBackground = TemplateWithBackground.bind({})
|
|
35
|
-
SelectedWithBackground.args = Selected.args
|
|
36
|
-
|
|
37
|
-
export const NotSelected = Template.bind({})
|
|
38
|
-
NotSelected.args = {
|
|
39
|
-
value: false,
|
|
40
|
-
modelValue: true,
|
|
41
|
-
forId: 'my-radio',
|
|
42
|
-
label: 'This Radio button is not selected',
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const WithLabelClass = Template.bind({})
|
|
46
|
-
WithLabelClass.args = {
|
|
47
|
-
value: false,
|
|
48
|
-
modelValue: true,
|
|
49
|
-
forId: 'my-radio',
|
|
50
|
-
label: 'This radio button has a label class',
|
|
51
|
-
labelClass: '!text-16-medium',
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const WithDescription = Template.bind({})
|
|
55
|
-
WithDescription.args = {
|
|
56
|
-
value: false,
|
|
57
|
-
modelValue: true,
|
|
58
|
-
forId: 'my-radio',
|
|
59
|
-
label: 'This radio button has a description',
|
|
60
|
-
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam diam leo, semper ut urna ut, tristique placerat dolor. Mauris hendrerit dolor tempus purus fringilla malesuada.',
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const Required = Template.bind({})
|
|
64
|
-
Required.args = {
|
|
65
|
-
value: true,
|
|
66
|
-
modelValue: true,
|
|
67
|
-
forId: 'my-radio',
|
|
68
|
-
label: 'This Radio button is required',
|
|
69
|
-
required: true,
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export const Disabled = Template.bind({})
|
|
73
|
-
Disabled.args = {
|
|
74
|
-
value: true,
|
|
75
|
-
modelValue: true,
|
|
76
|
-
forId: 'my-radio',
|
|
77
|
-
label: 'This Radio button is disabled',
|
|
78
|
-
disabled: true,
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const WithTooltip = Template.bind({})
|
|
82
|
-
WithTooltip.args = {
|
|
83
|
-
value: true,
|
|
84
|
-
modelValue: true,
|
|
85
|
-
forId: 'my-radio',
|
|
86
|
-
label: 'This Radio button has a tooltip',
|
|
87
|
-
tooltip: 'Base radio tooltip',
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const WithBorderTemplate = (args) => ({
|
|
91
|
-
components: { BaseRadio },
|
|
92
|
-
setup: () => ({ args, ...actions }),
|
|
93
|
-
template: '<BaseRadio class="base-choice" v-bind="args" @tooltip-clicked="onClick" @change="onChange" />',
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
export const WithBorder = WithBorderTemplate.bind({})
|
|
97
|
-
WithBorder.args = {
|
|
98
|
-
value: true,
|
|
99
|
-
modelValue: true,
|
|
100
|
-
forId: 'my-radio',
|
|
101
|
-
label: 'This Radio has a border',
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export const WithBorderDisabled = WithBorderTemplate.bind({})
|
|
105
|
-
WithBorderDisabled.args = {
|
|
106
|
-
value: true,
|
|
107
|
-
modelValue: true,
|
|
108
|
-
disabled: true,
|
|
109
|
-
forId: 'my-radio',
|
|
110
|
-
label: 'This Radio has a border and is disabled',
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export const SelectedWithBorder = WithBorderTemplate.bind({})
|
|
114
|
-
SelectedWithBorder.args = Selected.args
|
|
115
|
-
|
|
116
|
-
export const NotSelectedWithBorder = WithBorderTemplate.bind({})
|
|
117
|
-
NotSelectedWithBorder.args = NotSelected.args
|
|
118
|
-
|
|
119
|
-
export const WithDescriptionWithBorder = WithBorderTemplate.bind({})
|
|
120
|
-
WithDescriptionWithBorder.args = WithDescription.args
|
|
121
|
-
|
|
122
|
-
export const WithBorderVertical = WithBorderTemplate.bind({})
|
|
123
|
-
WithBorderVertical.args = {
|
|
124
|
-
...WithBorder.args,
|
|
125
|
-
orientation: 'vertical',
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export const WithBorderWithDescriptionVertical = WithBorderTemplate.bind({})
|
|
129
|
-
WithBorderWithDescriptionVertical.args = {
|
|
130
|
-
...WithDescription.args,
|
|
131
|
-
orientation: 'vertical',
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const WithBorderAndImageTemplate = (args) => ({
|
|
135
|
-
components: { BaseRadio },
|
|
136
|
-
setup: () => ({ args, ...actions }),
|
|
137
|
-
template: `<BaseRadio class="base-choice" v-bind="args" @tooltip-clicked="onClick" @change="onChange">
|
|
138
|
-
<template #icon>
|
|
139
|
-
<div class="i-ls-twitter-fill" />
|
|
140
|
-
</template>
|
|
141
|
-
</BaseRadio>`,
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
export const WithBorderWithDescriptionWithIconVertical = WithBorderAndImageTemplate.bind({})
|
|
145
|
-
WithBorderWithDescriptionWithIconVertical.args = {
|
|
146
|
-
...WithDescription.args,
|
|
147
|
-
orientation: 'vertical',
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const withBorderAndImageTemplate = (args) => ({
|
|
151
|
-
components: { BaseRadio },
|
|
152
|
-
setup: () => ({ args, ...actions }),
|
|
153
|
-
template: `<BaseRadio class="base-choice" v-bind="args" @tooltip-clicked="onClick" @change="onChange">
|
|
154
|
-
<template #icon>
|
|
155
|
-
<img src="/outlook.svg" />
|
|
156
|
-
</template>
|
|
157
|
-
</BaseRadio>`,
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
export const WithBorderWithDescriptionWithImageVertical = withBorderAndImageTemplate.bind({})
|
|
161
|
-
WithBorderWithDescriptionWithImageVertical.args = {
|
|
162
|
-
...WithDescription.args,
|
|
163
|
-
orientation: 'vertical',
|
|
164
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useSlotsAsComponents } from '../../utils/slot'
|
|
3
|
-
import { computed, inject, ref } from 'vue'
|
|
4
|
-
|
|
5
|
-
interface BaseFormInputInjectionType {
|
|
6
|
-
childConfig: { value: any } | undefined,
|
|
7
|
-
setInputModel: (value: any) => void,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const BaseFormInputInjection = inject<BaseFormInputInjectionType | undefined>('BaseFormInputInjection', undefined)
|
|
11
|
-
|
|
12
|
-
const props = withDefaults(defineProps<{
|
|
13
|
-
modelValue?: any,
|
|
14
|
-
value: any,
|
|
15
|
-
label?: string,
|
|
16
|
-
labelContainerClass?: string,
|
|
17
|
-
labelClass?: string,
|
|
18
|
-
description?: string,
|
|
19
|
-
forId?: string,
|
|
20
|
-
required?: boolean,
|
|
21
|
-
disabled?: boolean,
|
|
22
|
-
tooltip?: string,
|
|
23
|
-
orientation?: 'horizontal' | 'vertical'
|
|
24
|
-
}>(), {
|
|
25
|
-
modelValue: null,
|
|
26
|
-
label: undefined,
|
|
27
|
-
labelContainerClass: undefined,
|
|
28
|
-
labelClass: undefined,
|
|
29
|
-
description: undefined,
|
|
30
|
-
forId: undefined,
|
|
31
|
-
required: false,
|
|
32
|
-
disabled: false,
|
|
33
|
-
tooltip: undefined,
|
|
34
|
-
orientation: 'horizontal',
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const emit = defineEmits<{
|
|
38
|
-
(e: 'change', a: any): void,
|
|
39
|
-
(e: 'update:modelValue', a: any): void,
|
|
40
|
-
(e: 'tooltip-clicked'): void,
|
|
41
|
-
}>()
|
|
42
|
-
|
|
43
|
-
const slots = useSlotsAsComponents()
|
|
44
|
-
const iconSlot = computed(() => slots.icon ? slots.icon() : null)
|
|
45
|
-
|
|
46
|
-
const finalCurrentValue = computed(() => BaseFormInputInjection?.childConfig?.value)
|
|
47
|
-
const checked = computed(() => {
|
|
48
|
-
if (!BaseFormInputInjection) {
|
|
49
|
-
return props.modelValue === props.value
|
|
50
|
-
}
|
|
51
|
-
return finalCurrentValue.value === props.value
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
function onChange () {
|
|
55
|
-
if (!BaseFormInputInjection) {
|
|
56
|
-
emit('update:modelValue', props.value)
|
|
57
|
-
emit('change', props.value)
|
|
58
|
-
return false
|
|
59
|
-
}
|
|
60
|
-
BaseFormInputInjection.setInputModel(props.value)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const myUid = ref()
|
|
64
|
-
|
|
65
|
-
myUid.value = `BaseRadio:${uid++}`
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<template>
|
|
69
|
-
<div
|
|
70
|
-
class="base-radio"
|
|
71
|
-
:class="{
|
|
72
|
-
'base-radio-disabled': disabled,
|
|
73
|
-
'with-description': description,
|
|
74
|
-
}"
|
|
75
|
-
>
|
|
76
|
-
<input
|
|
77
|
-
:id="forId || myUid"
|
|
78
|
-
:checked="checked"
|
|
79
|
-
:disabled="disabled"
|
|
80
|
-
:value="value"
|
|
81
|
-
type="radio"
|
|
82
|
-
@change="onChange"
|
|
83
|
-
>
|
|
84
|
-
<label
|
|
85
|
-
:for="forId || myUid"
|
|
86
|
-
:class="{
|
|
87
|
-
'label-disabled': disabled,
|
|
88
|
-
'flex flex-col vertical-padding-large': orientation === 'vertical',
|
|
89
|
-
'vertical-padding': description && orientation === 'horizontal',
|
|
90
|
-
}"
|
|
91
|
-
>
|
|
92
|
-
|
|
93
|
-
<div
|
|
94
|
-
v-if="iconSlot"
|
|
95
|
-
class="w-4 h-4 icon flex items-center justify-center"
|
|
96
|
-
:class="[orientation === 'vertical' ? 'mb-2' : 'mr-2']"
|
|
97
|
-
>
|
|
98
|
-
<RenderSlot
|
|
99
|
-
:vnodes="iconSlot"
|
|
100
|
-
/>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<span
|
|
104
|
-
v-if="orientation === 'horizontal'"
|
|
105
|
-
class="input-custom"
|
|
106
|
-
>
|
|
107
|
-
<span class="check-radio" />
|
|
108
|
-
</span>
|
|
109
|
-
|
|
110
|
-
<span
|
|
111
|
-
v-if="label"
|
|
112
|
-
class="label-custom"
|
|
113
|
-
:class="{
|
|
114
|
-
'mb-2 !ml-0 text-center': orientation === 'vertical'
|
|
115
|
-
}"
|
|
116
|
-
>
|
|
117
|
-
<span
|
|
118
|
-
class="text-grey-700 label"
|
|
119
|
-
:class="[
|
|
120
|
-
labelClass,
|
|
121
|
-
]"
|
|
122
|
-
v-html="required ? `${label} *` : label"
|
|
123
|
-
/>
|
|
124
|
-
<span
|
|
125
|
-
v-if="tooltip"
|
|
126
|
-
v-tooltip="tooltip"
|
|
127
|
-
@click.stop.prevent="$emit('tooltip-clicked')"
|
|
128
|
-
/>
|
|
129
|
-
<span
|
|
130
|
-
v-if="description"
|
|
131
|
-
class="description text-grey-600 block"
|
|
132
|
-
:class="{
|
|
133
|
-
'text-center': orientation === 'vertical'
|
|
134
|
-
}"
|
|
135
|
-
v-html="description"
|
|
136
|
-
/>
|
|
137
|
-
</span>
|
|
138
|
-
|
|
139
|
-
<span
|
|
140
|
-
v-if="orientation === 'vertical'"
|
|
141
|
-
class="input-custom"
|
|
142
|
-
>
|
|
143
|
-
<span class="check-radio" />
|
|
144
|
-
</span>
|
|
145
|
-
|
|
146
|
-
<slot name="incentive" />
|
|
147
|
-
</label>
|
|
148
|
-
</div>
|
|
149
|
-
</template>
|
|
150
|
-
|
|
151
|
-
<script lang="ts">
|
|
152
|
-
let uid = 0
|
|
153
|
-
</script>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import BaseRating from './BaseRating.vue'
|
|
3
|
-
|
|
4
|
-
const Selectors = {
|
|
5
|
-
Item: '[data-testid="base-rating-item"]',
|
|
6
|
-
ItemLabel: 'label',
|
|
7
|
-
ItemActive: '.active',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
describe('BaseRating', () => {
|
|
11
|
-
test('it should interact with the user', async () => {
|
|
12
|
-
const wrapper = mount(BaseRating)
|
|
13
|
-
await wrapper.findAll(Selectors.Item)[2].find(Selectors.ItemLabel).trigger('click')
|
|
14
|
-
expect(wrapper.emitted()['update:modelValue'][0][0]).toBe(3)
|
|
15
|
-
|
|
16
|
-
await wrapper.findAll(Selectors.Item)[4].find(Selectors.ItemLabel).trigger('click')
|
|
17
|
-
expect(wrapper.emitted()['update:modelValue'][1][0]).toBe(5)
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
test('it should active items on hover', async () => {
|
|
21
|
-
const wrapper = mount(BaseRating, {
|
|
22
|
-
props: {
|
|
23
|
-
hover: true,
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
expect(wrapper.findAll(`${Selectors.Item}${Selectors.ItemActive}`).length).toBe(0)
|
|
27
|
-
|
|
28
|
-
await wrapper.findAll(Selectors.Item)[2].trigger('mouseenter')
|
|
29
|
-
expect(wrapper.findAll(Selectors.Item)[0].classes()).toContain(Selectors.ItemActive.slice(1))
|
|
30
|
-
expect(wrapper.findAll(Selectors.Item)[1].classes()).toContain(Selectors.ItemActive.slice(1))
|
|
31
|
-
expect(wrapper.findAll(Selectors.Item)[2].classes()).toContain(Selectors.ItemActive.slice(1))
|
|
32
|
-
expect(wrapper.findAll(Selectors.Item)[3].classes()).not.toContain(Selectors.ItemActive.slice(1))
|
|
33
|
-
expect(wrapper.findAll(Selectors.Item)[4].classes()).not.toContain(Selectors.ItemActive.slice(1))
|
|
34
|
-
expect(wrapper.emitted()['update:modelValue']).toBeUndefined()
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
test('it should not react to events when readonly', async () => {
|
|
38
|
-
const wrapper = mount(BaseRating, {
|
|
39
|
-
props: {
|
|
40
|
-
readonly: true,
|
|
41
|
-
},
|
|
42
|
-
})
|
|
43
|
-
await wrapper.findAll(Selectors.Item)[2].find(Selectors.ItemLabel).trigger('click')
|
|
44
|
-
expect(wrapper.emitted()['update:modelValue']).toBeUndefined()
|
|
45
|
-
})
|
|
46
|
-
})
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import BaseRating from './BaseRating.vue'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'common/vue/components/BaseRating',
|
|
5
|
-
component: BaseRating,
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const defaultTemplate = (args) => ({
|
|
9
|
-
setup: () => ({ args }),
|
|
10
|
-
template: `
|
|
11
|
-
<BaseRating v-bind="args" />
|
|
12
|
-
`,
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
export const Simple = defaultTemplate.bind({})
|
|
16
|
-
|
|
17
|
-
export const Labels = defaultTemplate.bind({})
|
|
18
|
-
Labels.args = {
|
|
19
|
-
itemLabels: ['Very poor', 'Poor', 'Average', 'Good', 'Great'],
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const StyledLabels = defaultTemplate.bind({})
|
|
23
|
-
StyledLabels.args = {
|
|
24
|
-
itemLabels: ['Very poor', 'Poor', 'Not so bad', 'Good', 'Very good'],
|
|
25
|
-
itemLabelClass: 'w-[50px] border border-grey-200 rounded p-1',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const TenItems = defaultTemplate.bind({})
|
|
29
|
-
TenItems.args = {
|
|
30
|
-
length: 10,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const Rated = defaultTemplate.bind({})
|
|
34
|
-
Rated.args = {
|
|
35
|
-
modelValue: 3,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const Hover = defaultTemplate.bind({})
|
|
39
|
-
Hover.args = {
|
|
40
|
-
hover: true,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const Name = defaultTemplate.bind({})
|
|
44
|
-
Name.args = {
|
|
45
|
-
name: 'session-quality',
|
|
46
|
-
}
|