@autoafleveren/ui 1.2.13 → 1.3.3
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/config/tailwind/config.cjs +1 -0
- package/dist/icons.cjs +229 -230
- package/dist/icons.css +1 -1
- package/dist/icons.js +9985 -9758
- package/dist/types/components/AppActionBar/AppActionBar.vue.d.ts +1 -4
- package/dist/types/components/AppActionBar/AppActionBarItem.vue.d.ts +21 -0
- package/dist/types/components/AppActionBar/AppActionBarSubMenu.vue.d.ts +2 -6
- package/dist/types/components/AppActionBar/Components/Error.vue.d.ts +1 -1
- package/dist/types/components/AppActionBar/Components/Loading.vue.d.ts +1 -1
- package/dist/types/components/AppActionBar/Components/MultiSelect.vue.d.ts +4 -4
- package/dist/types/components/AppAlert/AppAlert.vue.d.ts +29 -0
- package/dist/types/components/AppAvatar/AppAvatar.vue.d.ts +2 -2
- package/dist/types/components/AppAvatar/DefaultAvatar.vue.d.ts +1 -1
- package/dist/types/components/AppBackButton/AppBackButton.vue.d.ts +4 -15
- package/dist/types/components/AppBadge/AppBadge.vue.d.ts +23 -0
- package/dist/types/components/AppButton/AppButton.vue.d.ts +26 -0
- package/dist/types/components/AppButton/ButtonIconSlot.vue.d.ts +15 -0
- package/dist/types/components/AppCard/AppCard.vue.d.ts +39 -0
- package/dist/types/components/AppCard/CardAction.vue.d.ts +1 -1
- package/dist/types/components/AppCard/CardIconSlot.vue.d.ts +17 -0
- package/dist/types/components/AppColor/AppColor.vue.d.ts +3 -6
- package/dist/types/components/AppColorCard/AppColorCard.vue.d.ts +27 -0
- package/dist/types/components/AppConfirm/AppConfirm.vue.d.ts +6 -284
- package/dist/types/components/AppContextMenu/AppContextMenu.vue.d.ts +1 -4
- package/dist/types/components/AppContextMenu/ShortcutItem.vue.d.ts +2 -2
- package/dist/types/components/AppDataTable/AppDataTable.vue.d.ts +10 -5
- package/dist/types/components/AppDataTable/AppDataTableFooter.vue.d.ts +5 -35
- package/dist/types/components/AppDefinitionList/AppDefinitionItem.vue.d.ts +30 -0
- package/dist/types/components/AppDefinitionList/AppDefinitionList.vue.d.ts +5 -13
- package/dist/types/components/AppDisclosure/AppDisclosure.vue.d.ts +3 -10
- package/dist/types/components/AppDisclosure/AppDisclosureButton.vue.d.ts +16 -0
- package/dist/types/components/AppDisclosure/AppDisclosurePanel.vue.d.ts +5 -13
- package/dist/types/components/AppDrawer/AppDrawer.vue.d.ts +4 -35
- package/dist/types/components/AppDropdownButton/AppDropdownButton.vue.d.ts +25 -0
- package/dist/types/components/AppDropdownButton/AppDropdownItem.vue.d.ts +2 -23
- package/dist/types/components/AppError/AppError.vue.d.ts +6 -47
- package/dist/types/components/AppImageDropzone/AppImageDropzone.vue.d.ts +2 -6
- package/dist/types/components/AppInput/AppInput.vue.d.ts +14 -8
- package/dist/types/components/AppInput/FileInput.vue.d.ts +5 -19
- package/dist/types/components/AppInput/Input.vue.d.ts +2 -2
- package/dist/types/components/AppInput/InputIconSlot.vue.d.ts +15 -0
- package/dist/types/components/AppInput/LocationInput.vue.d.ts +2 -5
- package/dist/types/components/AppInputLabel/AppInputLabel.vue.d.ts +5 -7
- package/dist/types/components/AppLicensePlate/AppLicensePlate.vue.d.ts +5 -11
- package/dist/types/components/AppLoader/AppLoader.vue.d.ts +2 -2
- package/dist/types/components/AppMaps/AppMaps.vue.d.ts +2 -5
- package/dist/types/components/AppMenu/AppMenu.vue.d.ts +2 -2
- package/dist/types/components/AppMenu/AppMenuItem.vue.d.ts +16 -0
- package/dist/types/components/AppModal/AppModal.vue.d.ts +51 -0
- package/dist/types/components/AppNavigationMenu/AppNavigationMenu.vue.d.ts +1 -1
- package/dist/types/components/AppNavigationMenu/Mobile.vue.d.ts +1 -1
- package/dist/types/components/AppNavigationMenu/NavigationItem.vue.d.ts +1 -1
- package/dist/types/components/AppNavigationMenu/SupportItem.vue.d.ts +1 -1
- package/dist/types/components/AppPagination/AppPagination.vue.d.ts +2 -2
- package/dist/types/components/AppPagination/AppPaginationItem.vue.d.ts +3 -9
- package/dist/types/components/AppProgressBar/AppProgressBar.vue.d.ts +2 -2
- package/dist/types/components/AppProgressBar/AppProgressBarStep.vue.d.ts +5 -7
- package/dist/types/components/AppRating/AppRating.vue.d.ts +5 -23
- package/dist/types/components/AppRating/VueStarRating/Star.vue.d.ts +2 -2
- package/dist/types/components/AppRating/VueStarRating/StarRating.vue.d.ts +5 -62
- package/dist/types/components/AppSection/AppSection.vue.d.ts +8 -13
- package/dist/types/components/AppSelect/AppSelect.vue.d.ts +33 -0
- package/dist/types/components/AppStepper/AppStepper.vue.d.ts +4 -27
- package/dist/types/components/AppTable/AppTable.vue.d.ts +5 -7
- package/dist/types/components/AppTimeline/AppTimeline.vue.d.ts +5 -12
- package/dist/types/components/AppTimeline/AppTimelineItem.vue.d.ts +10 -28
- package/dist/types/components/AppTimeline/AppTimelineItemIcon.vue.d.ts +1 -1
- package/dist/types/components/AppToggle/AppToggle.vue.d.ts +4 -4
- package/dist/types/components/AppToggleCard/AppToggleCard.vue.d.ts +27 -0
- package/dist/types/composables/index.d.ts +1 -1
- package/dist/types/composables/useActionBar/index.d.ts +3 -3
- package/dist/types/icons/BuildingCircleCheck.vue.d.ts +1 -1
- package/dist/types/icons/BuildingCircleXmark.vue.d.ts +1 -1
- package/dist/types/icons/CarsIcon.vue.d.ts +1 -1
- package/dist/types/icons/ChatPersonRoundedIcon.vue.d.ts +1 -1
- package/dist/types/icons/CompanyIcon.vue.d.ts +1 -1
- package/dist/types/icons/HeroGirlIcon.vue.d.ts +1 -1
- package/dist/types/icons/HeroPersonIcon.vue.d.ts +1 -1
- package/dist/types/icons/HeroPersonRoundedIcon.vue.d.ts +1 -1
- package/dist/types/icons/HeroPersonWithBgIcon.vue.d.ts +1 -1
- package/dist/types/icons/LocationMarkerIcon.vue.d.ts +1 -1
- package/dist/types/icons/PartyPopperIcon.vue.d.ts +1 -1
- package/dist/types/icons/status/ErrorIcon.vue.d.ts +1 -1
- package/dist/types/icons/status/SuccessIcon.vue.d.ts +1 -1
- package/dist/types/icons/status/WarningIcon.vue.d.ts +1 -1
- package/dist/types/layouts/Auth/Auth.vue.d.ts +5 -13
- package/dist/types/layouts/Base/Base.vue.d.ts +4 -17
- package/dist/types/layouts/Platform/Platform.vue.d.ts +4 -20
- package/dist/types/plugins/Toast/Toast.vue.d.ts +2 -2
- package/dist/ui-library.css +2 -2
- package/dist/ui-storybook.css +2 -2
- package/dist/ui.cjs +190 -191
- package/dist/ui.css +1 -1
- package/dist/ui.js +20566 -19443
- package/package.json +43 -47
- package/src/App.vue +15 -0
- package/src/Playground.vue.example +9 -0
- package/src/config/eslint.cjs +199 -0
- package/src/config/tailwind/config.cjs +229 -0
- package/src/config/tailwind/screens.json +9 -0
- package/src/css/build.css +52 -0
- package/src/css/main.css +4 -0
- package/src/css/theme.css +208 -0
- package/src/css/tinymce.css +58 -0
- package/src/main.ts +34 -0
- package/src/modules/components/AppActionBar/AppActionBar.vue +96 -0
- package/src/modules/components/AppActionBar/AppActionBarItem.vue +123 -0
- package/src/modules/components/AppActionBar/AppActionBarSubMenu.vue +89 -0
- package/src/modules/components/AppActionBar/Components/Error.vue +11 -0
- package/src/modules/components/AppActionBar/Components/Loading.vue +9 -0
- package/src/modules/components/AppActionBar/Components/MultiSelect.vue +102 -0
- package/src/modules/components/AppActionBar/Components/__tests__/multi-select.spec.ts +74 -0
- package/src/modules/components/AppActionBar/__mocks__/index.ts +36 -0
- package/src/modules/components/AppActionBar/__tests__/app-action-bar-item.spec.ts +134 -0
- package/src/modules/components/AppActionBar/__tests__/app-action-bar-sub-menu.spec.ts +45 -0
- package/src/modules/components/AppActionBar/__tests__/app-action-bar.spec.ts +92 -0
- package/src/modules/components/AppActionBar/index.d.ts +29 -0
- package/src/modules/components/AppActionBar/index.ts +18 -0
- package/src/modules/components/AppAlert/AppAlert.vue +69 -0
- package/src/modules/components/AppAlert/__tests__/app-alert.spec.ts +67 -0
- package/src/modules/components/AppAlert/index.d.ts +3 -0
- package/src/modules/components/AppAlert/index.ts +18 -0
- package/src/modules/components/AppAvatar/AppAvatar.vue +30 -0
- package/src/modules/components/AppAvatar/DefaultAvatar.vue +187 -0
- package/src/modules/components/AppAvatar/__tests__/app-avatar.spec.ts +70 -0
- package/src/modules/components/AppAvatar/index.d.ts +9 -0
- package/src/modules/components/AppAvatar/index.ts +9 -0
- package/src/modules/components/AppBackButton/AppBackButton.vue +51 -0
- package/src/modules/components/AppBackButton/__tests__/app-back-button.spec.ts +70 -0
- package/src/modules/components/AppBadge/AppBadge.vue +65 -0
- package/src/modules/components/AppBadge/__tests__/app-badge.spec.ts +64 -0
- package/src/modules/components/AppBadge/index.d.ts +13 -0
- package/src/modules/components/AppBadge/index.ts +29 -0
- package/src/modules/components/AppButton/AppButton.vue +53 -0
- package/src/modules/components/AppButton/ButtonIconSlot.vue +26 -0
- package/src/modules/components/AppButton/__tests__/app-button.spec.ts +145 -0
- package/src/modules/components/AppButton/__tests__/button-icon-slot.spec.ts +30 -0
- package/src/modules/components/AppButton/index.d.ts +16 -0
- package/src/modules/components/AppButton/index.ts +57 -0
- package/src/modules/components/AppCard/AppCard.vue +88 -0
- package/src/modules/components/AppCard/CardAction.vue +101 -0
- package/src/modules/components/AppCard/CardIconSlot.vue +65 -0
- package/src/modules/components/AppCard/__tests__/app-card.spec.ts +109 -0
- package/src/modules/components/AppCard/__tests__/card-action.spec.ts +55 -0
- package/src/modules/components/AppCard/__tests__/card-icon-slot.spec.ts +27 -0
- package/src/modules/components/AppCard/index.d.ts +12 -0
- package/src/modules/components/AppCard/index.ts +5 -0
- package/src/modules/components/AppColor/AppColor.vue +74 -0
- package/src/modules/components/AppColor/__tests__/app-color.spec.ts +53 -0
- package/src/modules/components/AppColor/index.d.ts +10 -0
- package/src/modules/components/AppColorCard/AppColorCard.vue +41 -0
- package/src/modules/components/AppColorCard/__tests__/app-color-card.spec.ts +55 -0
- package/src/modules/components/AppConfirm/AppConfirm.vue +237 -0
- package/src/modules/components/AppConfirm/__tests__/app-confirm.spec.ts +366 -0
- package/src/modules/components/AppConfirm/index.d.ts +31 -0
- package/src/modules/components/AppConfirm/index.ts +1 -0
- package/src/modules/components/AppContextMenu/AppContextMenu.vue +100 -0
- package/src/modules/components/AppContextMenu/ShortcutItem.vue +37 -0
- package/src/modules/components/AppContextMenu/__mocks__/index.ts +25 -0
- package/src/modules/components/AppContextMenu/__tests__/app-context-menu.spec.ts +71 -0
- package/src/modules/components/AppContextMenu/__tests__/shortcut-item.spec.ts +29 -0
- package/src/modules/components/AppContextMenu/index.d.ts +23 -0
- package/src/modules/components/AppDataTable/AppDataTable.vue +323 -0
- package/src/modules/components/AppDataTable/AppDataTableFooter.vue +91 -0
- package/src/modules/components/AppDataTable/__mocks__/index.ts +71 -0
- package/src/modules/components/AppDataTable/__tests__/app-data-table-footer.spec.ts +107 -0
- package/src/modules/components/AppDataTable/__tests__/app-data-table.spec.ts +153 -0
- package/src/modules/components/AppDataTable/index.d.ts +29 -0
- package/src/modules/components/AppDefinitionList/AppDefinitionItem.vue +57 -0
- package/src/modules/components/AppDefinitionList/AppDefinitionList.vue +31 -0
- package/src/modules/components/AppDefinitionList/__mocks__/index.ts +31 -0
- package/src/modules/components/AppDefinitionList/__tests__/app-definition-item.spec.ts +93 -0
- package/src/modules/components/AppDefinitionList/__tests__/app-definition-list.spec.ts +35 -0
- package/src/modules/components/AppDefinitionList/index.d.ts +8 -0
- package/src/modules/components/AppDisclosure/AppDisclosure.vue +19 -0
- package/src/modules/components/AppDisclosure/AppDisclosureButton.vue +43 -0
- package/src/modules/components/AppDisclosure/AppDisclosurePanel.vue +31 -0
- package/src/modules/components/AppDisclosure/__tests__/app-disclosure-button.spec.ts +70 -0
- package/src/modules/components/AppDisclosure/__tests__/app-disclosure-panel.spec.ts +64 -0
- package/src/modules/components/AppDisclosure/__tests__/app-disclosure.spec.ts +41 -0
- package/src/modules/components/AppDrawer/AppDrawer.vue +149 -0
- package/src/modules/components/AppDrawer/__tests__/app-drawer.spec.ts +120 -0
- package/src/modules/components/AppDrawer/index.d.ts +27 -0
- package/src/modules/components/AppDropdownButton/AppDropdownButton.vue +82 -0
- package/src/modules/components/AppDropdownButton/AppDropdownItem.vue +67 -0
- package/src/modules/components/AppDropdownButton/__mocks__/index.ts +25 -0
- package/src/modules/components/AppDropdownButton/__tests__/app-dropdown-button.spec.ts +81 -0
- package/src/modules/components/AppDropdownButton/__tests__/app-dropdown-item.spec.ts +108 -0
- package/src/modules/components/AppDropdownButton/index.d.ts +26 -0
- package/src/modules/components/AppDropdownButton/index.ts +8 -0
- package/src/modules/components/AppError/AppError.vue +233 -0
- package/src/modules/components/AppError/__tests__/app-error.spec.ts +366 -0
- package/src/modules/components/AppError/index.d.ts +30 -0
- package/src/modules/components/AppError/index.ts +1 -0
- package/src/modules/components/AppImageDropzone/AppImageDropzone.vue +130 -0
- package/src/modules/components/AppImageDropzone/__tests__/app-image-dropzone.spec.ts +92 -0
- package/src/modules/components/AppImageDropzone/index.d.ts +8 -0
- package/src/modules/components/AppInput/AppInput.vue +247 -0
- package/src/modules/components/AppInput/FileInput.vue +58 -0
- package/src/modules/components/AppInput/Input.vue +141 -0
- package/src/modules/components/AppInput/InputIconSlot.vue +27 -0
- package/src/modules/components/AppInput/LocationInput.vue +150 -0
- package/src/modules/components/AppInput/__mocks__/location.ts +13 -0
- package/src/modules/components/AppInput/__tests__/app-input.spec.ts +255 -0
- package/src/modules/components/AppInput/__tests__/file-input.spec.ts +48 -0
- package/src/modules/components/AppInput/__tests__/input-icon-slot.spec.ts +27 -0
- package/src/modules/components/AppInput/__tests__/input.spec.ts +260 -0
- package/src/modules/components/AppInput/__tests__/location-input.spec.ts +159 -0
- package/src/modules/components/AppInput/choice.ts +24 -0
- package/src/modules/components/AppInput/datepicker.ts +62 -0
- package/src/modules/components/AppInput/index.d.ts +68 -0
- package/src/modules/components/AppInput/index.ts +133 -0
- package/src/modules/components/AppInput/location.ts +8 -0
- package/src/modules/components/AppInput/richText.ts +45 -0
- package/src/modules/components/AppInputLabel/AppInputLabel.vue +15 -0
- package/src/modules/components/AppInputLabel/__tests__/app-input-label.spec.ts +38 -0
- package/src/modules/components/AppInputLabel/index.d.ts +6 -0
- package/src/modules/components/AppLicensePlate/AppLicensePlate.vue +34 -0
- package/src/modules/components/AppLicensePlate/__tests__/app-license-plate.spec.ts +46 -0
- package/src/modules/components/AppLicensePlate/index.d.ts +1 -0
- package/src/modules/components/AppLoader/AppLoader.vue +37 -0
- package/src/modules/components/AppLoader/index.d.ts +1 -0
- package/src/modules/components/AppLoader/index.ts +8 -0
- package/src/modules/components/AppMaps/AppMaps.vue +105 -0
- package/src/modules/components/AppMaps/index.ts +44 -0
- package/src/modules/components/AppMenu/AppMenu.vue +79 -0
- package/src/modules/components/AppMenu/AppMenuItem.vue +40 -0
- package/src/modules/components/AppMenu/__mocks__/index.ts +23 -0
- package/src/modules/components/AppMenu/__tests__/app-menu-item.spec.ts +47 -0
- package/src/modules/components/AppMenu/__tests__/app-menu.spec.ts +53 -0
- package/src/modules/components/AppMenu/index.d.ts +15 -0
- package/src/modules/components/AppModal/AppModal.vue +261 -0
- package/src/modules/components/AppModal/__tests__/app-modal.spec.ts +282 -0
- package/src/modules/components/AppModal/index.d.ts +36 -0
- package/src/modules/components/AppNavigationMenu/AppNavigationMenu.vue +95 -0
- package/src/modules/components/AppNavigationMenu/Mobile.vue +126 -0
- package/src/modules/components/AppNavigationMenu/NavigationItem.vue +82 -0
- package/src/modules/components/AppNavigationMenu/SupportItem.vue +29 -0
- package/src/modules/components/AppNavigationMenu/__tests__/app-navigation-menu.spec.ts +104 -0
- package/src/modules/components/AppNavigationMenu/__tests__/mobile.spec.ts +155 -0
- package/src/modules/components/AppNavigationMenu/__tests__/navigation-item.spec.ts +91 -0
- package/src/modules/components/AppNavigationMenu/__tests__/support-item.spec.ts +48 -0
- package/src/modules/components/AppPagination/AppPagination.vue +133 -0
- package/src/modules/components/AppPagination/AppPaginationItem.vue +28 -0
- package/src/modules/components/AppPagination/__mocks__/index.ts +20 -0
- package/src/modules/components/AppPagination/__tests__/app-pagination.spec.ts +143 -0
- package/src/modules/components/AppPagination/index.d.ts +24 -0
- package/src/modules/components/AppProgressBar/AppProgressBar.vue +93 -0
- package/src/modules/components/AppProgressBar/AppProgressBarStep.vue +5 -0
- package/src/modules/components/AppProgressBar/__mocks__/index.ts +17 -0
- package/src/modules/components/AppProgressBar/__tests__/app-progress-bar-step.spec.ts +18 -0
- package/src/modules/components/AppProgressBar/__tests__/app-progress-bar.spec.ts +77 -0
- package/src/modules/components/AppProgressBar/index.d.ts +21 -0
- package/src/modules/components/AppRating/AppRating.vue +42 -0
- package/src/modules/components/AppRating/VueStarRating/Star.vue +215 -0
- package/src/modules/components/AppRating/VueStarRating/StarRating.vue +231 -0
- package/src/modules/components/AppRating/VueStarRating/classes/AlphaColor.ts +68 -0
- package/src/modules/components/AppRating/VueStarRating/readme.md +279 -0
- package/src/modules/components/AppRating/__tests__/app-rating.spec.ts +36 -0
- package/src/modules/components/AppSection/AppSection.vue +35 -0
- package/src/modules/components/AppSection/__tests__/app-section.spec.ts +53 -0
- package/src/modules/components/AppSelect/AppSelect.vue +176 -0
- package/src/modules/components/AppSelect/__mocks__/index.ts +24 -0
- package/src/modules/components/AppSelect/__tests__/app-select.spec.ts +73 -0
- package/src/modules/components/AppSelect/index.d.ts +43 -0
- package/src/modules/components/AppSelect/index.ts +69 -0
- package/src/modules/components/AppStepper/AppStepper.vue +79 -0
- package/src/modules/components/AppStepper/__tests__/app-stepper.spec.ts +59 -0
- package/src/modules/components/AppTable/AppTable.vue +40 -0
- package/src/modules/components/AppTimeline/AppTimeline.vue +22 -0
- package/src/modules/components/AppTimeline/AppTimelineItem.vue +97 -0
- package/src/modules/components/AppTimeline/AppTimelineItemIcon.vue +55 -0
- package/src/modules/components/AppTimeline/__mocks__/timeline.ts +29 -0
- package/src/modules/components/AppTimeline/__tests__/app-timeline-item-Icon.spec.ts +35 -0
- package/src/modules/components/AppTimeline/__tests__/app-timeline-item.spec.ts +121 -0
- package/src/modules/components/AppTimeline/__tests__/app-timeline.spec.ts +55 -0
- package/src/modules/components/AppTimeline/index.d.ts +30 -0
- package/src/modules/components/AppTimeline/index.ts +13 -0
- package/src/modules/components/AppToggle/AppToggle.vue +36 -0
- package/src/modules/components/AppToggle/__tests__/app-toggle.spec.ts +54 -0
- package/src/modules/components/AppToggle/index.d.ts +3 -0
- package/src/modules/components/AppToggleCard/AppToggleCard.vue +45 -0
- package/src/modules/components/AppToggleCard/__tests__/app-toggle-card.spec.ts +55 -0
- package/src/modules/components/index.ts +43 -0
- package/src/modules/composables/index.ts +13 -0
- package/src/modules/composables/useActionBar/__mocks__/index.ts +17 -0
- package/src/modules/composables/useActionBar/__tests__/index.spec.ts +62 -0
- package/src/modules/composables/useActionBar/index.d.ts +1 -0
- package/src/modules/composables/useActionBar/index.ts +67 -0
- package/src/modules/composables/useComputedPosition/index.d.ts +16 -0
- package/src/modules/composables/useComputedPosition/index.ts +199 -0
- package/src/modules/composables/useConfirm/__tests__/index.spec.ts +29 -0
- package/src/modules/composables/useConfirm/index.ts +63 -0
- package/src/modules/composables/useContextMenu/index.ts +127 -0
- package/src/modules/composables/useDrawer/__tests__/index.spec.ts +34 -0
- package/src/modules/composables/useDrawer/index.ts +136 -0
- package/src/modules/composables/useEcho/index.ts +167 -0
- package/src/modules/composables/useError/__tests__/index.spec.ts +29 -0
- package/src/modules/composables/useError/index.ts +61 -0
- package/src/modules/composables/useGoogleApi/__tests__/index.spec.ts +39 -0
- package/src/modules/composables/useGoogleApi/index.ts +26 -0
- package/src/modules/composables/useLayout/__tests__/index.spec.ts +34 -0
- package/src/modules/composables/useLayout/index.d.ts +1 -0
- package/src/modules/composables/useLayout/index.ts +68 -0
- package/src/modules/composables/useModal/__tests__/index.spec.ts +34 -0
- package/src/modules/composables/useModal/index.ts +97 -0
- package/src/modules/composables/useNavigation/__mocks__/navigation.ts +22 -0
- package/src/modules/composables/useNavigation/__tests__/index.spec.ts +88 -0
- package/src/modules/composables/useNavigation/index.d.ts +17 -0
- package/src/modules/composables/useNavigation/index.ts +97 -0
- package/src/modules/icons/BuildingCircleCheck.vue +32 -0
- package/src/modules/icons/BuildingCircleXmark.vue +20 -0
- package/src/modules/icons/CarsIcon.vue +29 -0
- package/src/modules/icons/ChatPersonRoundedIcon.vue +184 -0
- package/src/modules/icons/CompanyIcon.vue +18 -0
- package/src/modules/icons/HeroGirlIcon.vue +246 -0
- package/src/modules/icons/HeroPersonIcon.vue +402 -0
- package/src/modules/icons/HeroPersonRoundedIcon.vue +412 -0
- package/src/modules/icons/HeroPersonWithBgIcon.vue +4503 -0
- package/src/modules/icons/LocationMarkerIcon.vue +33 -0
- package/src/modules/icons/PartyPopperIcon.vue +146 -0
- package/src/modules/icons/index.ts +32 -0
- package/src/modules/icons/status/ErrorIcon.vue +24 -0
- package/src/modules/icons/status/SuccessIcon.vue +24 -0
- package/src/modules/icons/status/WarningIcon.vue +27 -0
- package/src/modules/icons/status/index.ts +3 -0
- package/src/modules/index.ts +8 -0
- package/src/modules/layouts/Auth/Auth.vue +36 -0
- package/src/modules/layouts/Auth/__tests__/auth.spec.ts +63 -0
- package/src/modules/layouts/Base/Base.vue +69 -0
- package/src/modules/layouts/Base/__tests__/base.spec.ts +56 -0
- package/src/modules/layouts/Platform/Platform.vue +96 -0
- package/src/modules/layouts/Platform/__tests__/platform.spec.ts +56 -0
- package/src/modules/layouts/index.ts +9 -0
- package/src/modules/plugins/Sentry/index.d.ts +16 -0
- package/src/modules/plugins/Sentry/index.ts +65 -0
- package/src/modules/plugins/Sentry/language/nl.ts +13 -0
- package/src/modules/plugins/TinyMCE/lang/nl.js +430 -0
- package/src/modules/plugins/Toast/Toast.vue +58 -0
- package/src/modules/plugins/Toast/__tests__/toast.spec.ts +90 -0
- package/src/modules/plugins/Toast/index.ts +36 -0
- package/src/modules/plugins/Toast/types.d.ts +265 -0
- package/src/modules/plugins/index.ts +63 -0
- package/src/stories/Introduction.mdx +4 -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/logo.png +0 -0
- package/src/stories/assets/images/road.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/components/ActionBar/ActionBar.stories.ts +67 -0
- package/src/stories/components/Alert/Alert.stories.ts +53 -0
- package/src/stories/components/Avatar/Avatar.stories.ts +44 -0
- package/src/stories/components/BackButton/BackButton.stories.ts +39 -0
- package/src/stories/components/Badge/Badge.stories.ts +42 -0
- package/src/stories/components/Button/Button.stories.ts +132 -0
- package/src/stories/components/Card/Card.stories.ts +70 -0
- package/src/stories/components/Color/Color.stories.ts +41 -0
- package/src/stories/components/ColorCard/ColorCard.stories.ts +43 -0
- package/src/stories/components/Confirm/Confirm.stories.ts +110 -0
- package/src/stories/components/ContextMenu/ContextMenu.stories.ts +85 -0
- package/src/stories/components/DefinitionList/DefinitionList.stories.ts +32 -0
- package/src/stories/components/Disclosure/Disclosure.stories.ts +61 -0
- package/src/stories/components/DropdownButton/DropdownButton.stories.ts +121 -0
- package/src/stories/components/Error/Error.stories.ts +106 -0
- package/src/stories/components/ImageDropzone/ImageDropzone.stories.ts +41 -0
- package/src/stories/components/Input/Input.stories.ts +180 -0
- package/src/stories/components/Input/LocationInput.stories.ts +77 -0
- package/src/stories/components/LicensePlate/LicensePlate.stories.ts +39 -0
- package/src/stories/components/Maps/Maps.stories.ts +36 -0
- package/src/stories/components/Menu/Menu.stories.ts +41 -0
- package/src/stories/components/Modal/Modal.stories.ts +68 -0
- package/src/stories/components/Navigation/Navigation.stories.ts +62 -0
- package/src/stories/components/Pagination/Pagination.stories.ts +62 -0
- package/src/stories/components/ProgressBar/ProgressBar.stories.ts +48 -0
- package/src/stories/components/Rating/Rating.stories.ts +38 -0
- package/src/stories/components/Section/Section.stories.ts +44 -0
- package/src/stories/components/Select/Select.stories.ts +90 -0
- package/src/stories/components/Stepper/Stepper.stories.ts +38 -0
- package/src/stories/components/Table/DataTable.stories.ts +96 -0
- package/src/stories/components/Table/Table.stories.ts +45 -0
- package/src/stories/components/Timeline/Timeline.stories.ts +46 -0
- package/src/stories/components/Toast/Toast.stories.ts +47 -0
- package/src/stories/components/Toggle/Toggle.stories.ts +41 -0
- package/src/stories/components/ToggleCard/ToggleCard.stories.ts +43 -0
- package/src/stories/layouts/Auth.stories.ts +43 -0
- package/src/stories/layouts/Base.stories.ts +70 -0
- package/src/tests/mocks/resize-observer.ts +13 -0
- package/src/tests/stubs/AppSelect.ts +89 -0
- package/src/tests/stubs/HeadlessUiDialogStub.ts +24 -0
- package/src/tests/stubs/HeadlessUiTransitionChildStub.ts +20 -0
- package/src/tests/stubs/HeadlessUiTransitionRootStub.ts +25 -0
- package/src/tests/stubs/IconStub.ts +9 -0
- package/src/tests/stubs/Vue3EasyDataTableStub.ts +53 -0
- package/src/typings/plugin.d.ts +5 -0
- package/src/typings/shims-vue.d.ts +13 -0
- package/src/typings/utilities.d.ts +4 -0
- package/src/typings/vite-environment.d.ts +12 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { shallowMount } from '@vue/test-utils';
|
|
3
|
+
import VueDatePicker from '@vuepic/vue-datepicker';
|
|
4
|
+
import { AppInputLabel } from '~/modules/components';
|
|
5
|
+
import InputIconSlot from '../InputIconSlot.vue';
|
|
6
|
+
import { isChoiceInputCheck } from '../choice';
|
|
7
|
+
import AppInput from '../AppInput.vue';
|
|
8
|
+
import Input from '../Input.vue';
|
|
9
|
+
|
|
10
|
+
import type { VueWrapper, ComponentMountingOptions } from '@vue/test-utils';
|
|
11
|
+
import type { AppInputProps, InputType } from '../index.d';
|
|
12
|
+
|
|
13
|
+
function createWrapper(
|
|
14
|
+
props?: Partial<AppInputProps<string>>,
|
|
15
|
+
slots?: ComponentMountingOptions<typeof AppInput>['slots'],
|
|
16
|
+
attrs?: Record<string, unknown>,
|
|
17
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
18
|
+
): VueWrapper<InstanceType<typeof AppInput>> {
|
|
19
|
+
const inputProps = {
|
|
20
|
+
...props ?? {},
|
|
21
|
+
type: props?.type ?? 'text',
|
|
22
|
+
modelValue: props?.modelValue ?? '',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return shallowMount(AppInput, { props: inputProps, attrs, slots });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe('the AppInput component', () => {
|
|
29
|
+
it('should not render the optional elements by default', () => {
|
|
30
|
+
const wrapper = createWrapper();
|
|
31
|
+
|
|
32
|
+
expect(wrapper.findComponent(AppInputLabel).exists()).toBe(false);
|
|
33
|
+
expect(wrapper.find('[data-test-leading-icon]').exists()).toBe(false);
|
|
34
|
+
expect(wrapper.find('[data-test-trailing-icon]').exists()).toBe(false);
|
|
35
|
+
expect(wrapper.find('[data-test-error-message]').exists()).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('can set the label by prop', () => {
|
|
39
|
+
const label = 'label';
|
|
40
|
+
const wrapper = createWrapper({ label });
|
|
41
|
+
|
|
42
|
+
const labelElement = wrapper.findComponent(AppInputLabel);
|
|
43
|
+
expect(labelElement.exists()).toBe(true);
|
|
44
|
+
expect(labelElement.text()).toBe('label');
|
|
45
|
+
expect(labelElement.props('disabled')).toBe(false);
|
|
46
|
+
expect(labelElement.props('hasError')).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('can show input slot when custom prop passed', () => {
|
|
50
|
+
const label = 'label';
|
|
51
|
+
const wrapper = createWrapper({ label, custom: true }, { input: '<span data-test-input-override></span>' });
|
|
52
|
+
|
|
53
|
+
expect(wrapper.find('[data-test-input-override]').exists()).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('can set the label by slot', () => {
|
|
57
|
+
function testLabel(type: InputType): void {
|
|
58
|
+
const labelText = 'Test label';
|
|
59
|
+
// eslint-disable-next-line vitest/no-conditional-in-test, vitest/no-conditional-tests
|
|
60
|
+
const labelSlotName = isChoiceInputCheck(type) ? 'default' : 'label';
|
|
61
|
+
const wrapper = createWrapper({ type }, { [labelSlotName]: labelText });
|
|
62
|
+
|
|
63
|
+
const normalLabel = wrapper.findComponent(AppInputLabel);
|
|
64
|
+
expect(normalLabel.exists()).toBe(!isChoiceInputCheck(type));
|
|
65
|
+
|
|
66
|
+
const choiceLabel = wrapper.find('[data-test-choice-label]');
|
|
67
|
+
expect(choiceLabel.exists()).toBe(isChoiceInputCheck(type));
|
|
68
|
+
|
|
69
|
+
// eslint-disable-next-line vitest/no-conditional-in-test, vitest/no-conditional-tests
|
|
70
|
+
const label = isChoiceInputCheck(type) ? choiceLabel : normalLabel;
|
|
71
|
+
expect(label.text()).toBe(labelText);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
testLabel('text');
|
|
75
|
+
testLabel('number');
|
|
76
|
+
testLabel('checkbox');
|
|
77
|
+
testLabel('radio');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('can set the leading icon', () => {
|
|
81
|
+
const leadingIcon = '<span>icon</span>';
|
|
82
|
+
const wrapper = createWrapper(undefined, { leadingIcon });
|
|
83
|
+
|
|
84
|
+
const leadingIconComponent = wrapper.findComponent(InputIconSlot);
|
|
85
|
+
expect(leadingIconComponent.exists()).toBe(true);
|
|
86
|
+
expect(leadingIconComponent.props('loading')).toBe(false);
|
|
87
|
+
expect(leadingIconComponent.element.innerHTML).toBe(leadingIcon);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('can set the trailing icon', () => {
|
|
91
|
+
const trailingIcon = '<span>icon</span>';
|
|
92
|
+
const wrapper = createWrapper(undefined, { trailingIcon });
|
|
93
|
+
|
|
94
|
+
const trailingIconComponent = wrapper.findComponent(InputIconSlot);
|
|
95
|
+
expect(trailingIconComponent.exists()).toBe(true);
|
|
96
|
+
expect(trailingIconComponent.props('loading')).toBe(false);
|
|
97
|
+
expect(trailingIconComponent.element.innerHTML).toBe(trailingIcon);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('passes the loading prop to the trailing icon', () => {
|
|
101
|
+
const trailingIcon = '<span>icon</span>';
|
|
102
|
+
const wrapper = createWrapper(
|
|
103
|
+
{ loading: true },
|
|
104
|
+
{ trailingIcon },
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const trailingIconComponent = wrapper.findComponent(InputIconSlot);
|
|
108
|
+
expect(trailingIconComponent.exists()).toBe(true);
|
|
109
|
+
expect(trailingIconComponent.props('loading')).toBe(true);
|
|
110
|
+
expect(trailingIconComponent.element.innerHTML).toBe(trailingIcon);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('can set an error message', () => {
|
|
114
|
+
const errorMessage = 'error message';
|
|
115
|
+
const wrapper = createWrapper({ hasError: true, errorMessage, errorWrapperClasses: 'error-wrapper-class' });
|
|
116
|
+
|
|
117
|
+
const errorMessageElement = wrapper.find('[data-test-error-message]');
|
|
118
|
+
expect(errorMessageElement.exists()).toBe(true);
|
|
119
|
+
expect(errorMessageElement.text()).toBe(errorMessage);
|
|
120
|
+
expect(errorMessageElement.classes('error-wrapper-class')).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('should render the input component with default attributes', () => {
|
|
124
|
+
const wrapper = createWrapper();
|
|
125
|
+
|
|
126
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
127
|
+
const input = wrapper.findComponent(Input);
|
|
128
|
+
expect(input.exists()).toBe(true);
|
|
129
|
+
expect(input.attributes('type')).toBe('text');
|
|
130
|
+
expect(input.attributes('disabled')).toBe('false');
|
|
131
|
+
expect(input.attributes('required')).toBe('false');
|
|
132
|
+
expect(input.attributes('readonly')).toBeUndefined();
|
|
133
|
+
|
|
134
|
+
const datePicker = wrapper.findComponent(VueDatePicker);
|
|
135
|
+
expect(datePicker.exists()).toBe(false);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('should render the input component with type textarea when type is textarea', () => {
|
|
139
|
+
const wrapper = createWrapper({ type: 'textarea' });
|
|
140
|
+
|
|
141
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
142
|
+
const input = wrapper.findComponent(Input);
|
|
143
|
+
expect(input.exists()).toBe(true);
|
|
144
|
+
// @ts-expect-error wrong input wrapper type
|
|
145
|
+
expect(input.props('type')).toBe('textarea');
|
|
146
|
+
expect(input.attributes('disabled')).toBe('false');
|
|
147
|
+
expect(input.attributes('required')).toBe('false');
|
|
148
|
+
expect(input.attributes('readonly')).toBeUndefined();
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('should render the input component with type date when type is datepicker type', () => {
|
|
152
|
+
const wrapper = createWrapper(
|
|
153
|
+
{ type: 'date' },
|
|
154
|
+
undefined,
|
|
155
|
+
{ 'min-date': 'custom' },
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
159
|
+
const input = wrapper.findComponent(Input);
|
|
160
|
+
expect(input.exists()).toBe(true);
|
|
161
|
+
// @ts-expect-error wrong input wrapper type
|
|
162
|
+
expect(input.props('type')).toBe('date');
|
|
163
|
+
expect(input.attributes('disabled')).toBe('false');
|
|
164
|
+
expect(input.attributes('required')).toBe('false');
|
|
165
|
+
expect(input.attributes('readonly')).toBeUndefined();
|
|
166
|
+
expect(input.attributes('min-date')).toBe('custom');
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('should render the input component with type text when type is license type', () => {
|
|
170
|
+
const wrapper = createWrapper(
|
|
171
|
+
{ type: 'license' },
|
|
172
|
+
undefined,
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
176
|
+
const input = wrapper.findComponent(Input);
|
|
177
|
+
expect(input.exists()).toBe(true);
|
|
178
|
+
// @ts-expect-error wrong input wrapper type
|
|
179
|
+
expect(input.props('type')).toBe('text');
|
|
180
|
+
expect(input.attributes('disabled')).toBe('false');
|
|
181
|
+
expect(input.attributes('required')).toBe('false');
|
|
182
|
+
expect(input.attributes('readonly')).toBeUndefined();
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should render the input component with type file when type is file type', () => {
|
|
186
|
+
const wrapper = createWrapper(
|
|
187
|
+
{ type: 'file' },
|
|
188
|
+
undefined,
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
192
|
+
const input = wrapper.findComponent(Input);
|
|
193
|
+
expect(input.exists()).toBe(true);
|
|
194
|
+
// @ts-expect-error wrong input wrapper type
|
|
195
|
+
expect(input.props('type')).toBe('file');
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it('should emit on input change', () => {
|
|
199
|
+
const wrapper = createWrapper();
|
|
200
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
201
|
+
|
|
202
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
203
|
+
const input = wrapper.findComponent(Input);
|
|
204
|
+
|
|
205
|
+
// @ts-expect-error Property 'vm' does not exist on type 'WrapperLike'
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
207
|
+
input.vm.$emit('update:modelValue', 'new text');
|
|
208
|
+
|
|
209
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe('new text');
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it('can make the input and label disabled', () => {
|
|
213
|
+
const wrapper = createWrapper({ disabled: true, label: 'label' });
|
|
214
|
+
|
|
215
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
216
|
+
const input = wrapper.findComponent(Input);
|
|
217
|
+
expect(input.attributes('disabled')).toBe('true');
|
|
218
|
+
expect(input.attributes('readonly')).toBeUndefined();
|
|
219
|
+
expect(input.attributes('required')).toBe('false');
|
|
220
|
+
|
|
221
|
+
const inputLabel = wrapper.findComponent(AppInputLabel);
|
|
222
|
+
expect(inputLabel.props('disabled')).toBe(true);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('can make the input readonly', () => {
|
|
226
|
+
const wrapper = createWrapper({ readonly: true });
|
|
227
|
+
|
|
228
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
229
|
+
const input = wrapper.findComponent(Input);
|
|
230
|
+
expect(input.attributes('disabled')).toBe('false');
|
|
231
|
+
expect(input.attributes('readonly')).toBe('');
|
|
232
|
+
expect(input.attributes('required')).toBe('false');
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('can make the input required', () => {
|
|
236
|
+
const wrapper = createWrapper({ required: true });
|
|
237
|
+
|
|
238
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
239
|
+
const input = wrapper.findComponent(Input);
|
|
240
|
+
expect(input.attributes('disabled')).toBe('false');
|
|
241
|
+
expect(input.attributes('readonly')).toBeUndefined();
|
|
242
|
+
expect(input.attributes('required')).toBe('true');
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('should mark label and input red when has error', () => {
|
|
246
|
+
const wrapper = createWrapper({ hasError: true, label: 'label' });
|
|
247
|
+
|
|
248
|
+
const labelElement = wrapper.findComponent(AppInputLabel);
|
|
249
|
+
expect(labelElement.props('hasError')).toBe(true);
|
|
250
|
+
|
|
251
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
252
|
+
const input = wrapper.findComponent(Input);
|
|
253
|
+
expect(input.classes('text-error')).toBe(true);
|
|
254
|
+
});
|
|
255
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { shallowMount } from '@vue/test-utils';
|
|
3
|
+
import { AppButton } from '~components';
|
|
4
|
+
import FileInput from '../FileInput.vue';
|
|
5
|
+
|
|
6
|
+
import type { VueWrapper } from '@vue/test-utils';
|
|
7
|
+
import type { FileInputProps } from '../index.d';
|
|
8
|
+
|
|
9
|
+
function createWrapper(
|
|
10
|
+
props?: Partial<FileInputProps & { accept: string }>,
|
|
11
|
+
slots?: { default: string },
|
|
12
|
+
): VueWrapper<InstanceType<typeof FileInput>> {
|
|
13
|
+
return shallowMount(FileInput, {
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: [],
|
|
16
|
+
...props,
|
|
17
|
+
},
|
|
18
|
+
slots,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe('the LocationInput component', () => {
|
|
23
|
+
it('should render the default elements', () => {
|
|
24
|
+
const wrapper = createWrapper();
|
|
25
|
+
|
|
26
|
+
expect(wrapper.find('input').exists()).toBe(true);
|
|
27
|
+
expect(wrapper.findComponent(AppButton).exists()).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should pass props and attrs to the input', () => {
|
|
31
|
+
const wrapper = createWrapper({ accept: 'application/pdf', multiple: true });
|
|
32
|
+
|
|
33
|
+
const input = wrapper.find('input');
|
|
34
|
+
expect(input.exists()).toBe(true);
|
|
35
|
+
expect(input.attributes('accept')).toBe('application/pdf');
|
|
36
|
+
expect(input.attributes('multiple')).toBe('');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should render custom slot when provided', () => {
|
|
40
|
+
const wrapper = createWrapper({}, { default: '<div data-test-slot></div>' });
|
|
41
|
+
|
|
42
|
+
const input = wrapper.find('input');
|
|
43
|
+
expect(input.exists()).toBe(true);
|
|
44
|
+
|
|
45
|
+
expect(wrapper.findComponent(AppButton).exists()).toBe(false);
|
|
46
|
+
expect(wrapper.find('[data-test-slot]').exists()).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { shallowMount } from '@vue/test-utils';
|
|
3
|
+
import { AppLoader } from '~/modules/components';
|
|
4
|
+
import InputIconSlot from '../InputIconSlot.vue';
|
|
5
|
+
|
|
6
|
+
describe('the InputIconSlot component', () => {
|
|
7
|
+
it('should render the default slot by default', () => {
|
|
8
|
+
const icon = '<i>Icon</i>';
|
|
9
|
+
const wrapper = shallowMount(InputIconSlot, {
|
|
10
|
+
slots: { default: icon },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
expect(wrapper.element.innerHTML).toBe(icon);
|
|
14
|
+
expect(wrapper.findComponent(AppLoader).exists()).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should render the loader when loading is true', () => {
|
|
18
|
+
const icon = '<i data-test-icon>Icon</i>';
|
|
19
|
+
const wrapper = shallowMount(InputIconSlot, {
|
|
20
|
+
props: { loading: true },
|
|
21
|
+
slots: { default: icon },
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(wrapper.findComponent(AppLoader).exists()).toBe(true);
|
|
25
|
+
expect(wrapper.find('[data-test-icon]').exists()).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { shallowMount } from '@vue/test-utils';
|
|
3
|
+
import Editor from '@tinymce/tinymce-vue';
|
|
4
|
+
import VueDatePicker from '@vuepic/vue-datepicker';
|
|
5
|
+
import LocationInput from '../LocationInput.vue';
|
|
6
|
+
import Input from '../Input.vue';
|
|
7
|
+
|
|
8
|
+
import type { ComponentMountingOptions, VueWrapper } from '@vue/test-utils';
|
|
9
|
+
import type { InputProps, LocationModelValue } from '../index.d';
|
|
10
|
+
|
|
11
|
+
function createWrapper<ModelValue>(
|
|
12
|
+
props?: Partial<InputProps<ModelValue> & { custom?: boolean }>,
|
|
13
|
+
slots?: ComponentMountingOptions<typeof Input>['slots'],
|
|
14
|
+
attrs?: Record<string, unknown>,
|
|
15
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
16
|
+
): VueWrapper<InstanceType<typeof Input>> {
|
|
17
|
+
const defaultModelValue = props?.type === 'location' ? null : '';
|
|
18
|
+
|
|
19
|
+
const inputProps = {
|
|
20
|
+
...props ?? {},
|
|
21
|
+
type: props?.type ?? 'text',
|
|
22
|
+
custom: props?.custom ?? false,
|
|
23
|
+
modelValue: props?.modelValue ?? defaultModelValue,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return shallowMount(Input, { attachTo: document.body, props: inputProps, attrs, slots });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const inputLikeTypes = ['email', 'number', 'search', 'tel', 'text', 'url', 'password', 'checkbox', 'radio'] as const;
|
|
30
|
+
|
|
31
|
+
describe('the Input component', () => {
|
|
32
|
+
it('should render an input when type is input type like', () => {
|
|
33
|
+
inputLikeTypes.forEach(inputType => {
|
|
34
|
+
const wrapper = createWrapper({ type: inputType });
|
|
35
|
+
|
|
36
|
+
const input = wrapper.find('[data-test-input]');
|
|
37
|
+
expect(input.exists()).toBe(true);
|
|
38
|
+
expect(input.isVisible()).toBe(true);
|
|
39
|
+
expect(input.element).toBeInstanceOf(HTMLInputElement);
|
|
40
|
+
expect(input.attributes('type')).toBe(inputType);
|
|
41
|
+
expect(input.attributes('required')).toBeUndefined();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should not show an input when custom passed', () => {
|
|
46
|
+
inputLikeTypes.forEach(inputType => {
|
|
47
|
+
const wrapper = createWrapper({ type: inputType, custom: true });
|
|
48
|
+
|
|
49
|
+
const input = wrapper.find('[data-test-input]');
|
|
50
|
+
expect(input.exists()).toBe(true);
|
|
51
|
+
expect(input.isVisible()).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should pass attributes to the root element correctly', () => {
|
|
56
|
+
// @ts-expect-error doesn't work with generic components yet
|
|
57
|
+
let wrapper: VueWrapper<InstanceType<typeof Input>> | null = null;
|
|
58
|
+
|
|
59
|
+
inputLikeTypes.forEach(inputType => {
|
|
60
|
+
wrapper = createWrapper({ type: inputType }, undefined, { required: true });
|
|
61
|
+
expect(wrapper.find('[data-test-input]').attributes('required')).toBe('');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
wrapper = createWrapper({ type: 'text' }, undefined, { required: true });
|
|
65
|
+
expect(wrapper.find('[data-test-input]').attributes('required')).toBe('');
|
|
66
|
+
|
|
67
|
+
wrapper = createWrapper({ type: 'textarea' }, undefined, { required: true });
|
|
68
|
+
expect(wrapper.find('[data-test-textarea]').attributes('required')).toBe('');
|
|
69
|
+
|
|
70
|
+
wrapper = createWrapper({ type: 'date' }, undefined, { required: true });
|
|
71
|
+
expect(wrapper.findComponent(VueDatePicker).attributes('required')).toBe('true');
|
|
72
|
+
|
|
73
|
+
wrapper = createWrapper({ type: 'location' }, undefined, { required: true });
|
|
74
|
+
expect(wrapper.findComponent(LocationInput).attributes('required')).toBe('true');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('should be able to pass a model value to the input', () => {
|
|
78
|
+
const wrapper = createWrapper({ type: 'text', modelValue: 'Test text' });
|
|
79
|
+
|
|
80
|
+
const input = wrapper.find('[data-test-input]');
|
|
81
|
+
expect((input.element as HTMLInputElement).value).toBe('Test text');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('should emit update:modelValue on input text change', async () => {
|
|
85
|
+
expect.assertions(3);
|
|
86
|
+
|
|
87
|
+
const wrapper = createWrapper({ type: 'text' });
|
|
88
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
89
|
+
|
|
90
|
+
const input = wrapper.find('[data-test-input]');
|
|
91
|
+
|
|
92
|
+
await input.setValue('new input text');
|
|
93
|
+
|
|
94
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
95
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe('new input text');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('should emit update:modelValue on input number change', async () => {
|
|
99
|
+
expect.assertions(3);
|
|
100
|
+
|
|
101
|
+
const wrapper = createWrapper({ type: 'number' });
|
|
102
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
103
|
+
|
|
104
|
+
const input = wrapper.find('[data-test-input]');
|
|
105
|
+
|
|
106
|
+
await input.setValue('15');
|
|
107
|
+
|
|
108
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
109
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe(15);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('should emit update:modelValue on input checkbox change', async () => {
|
|
113
|
+
expect.assertions(3);
|
|
114
|
+
|
|
115
|
+
const wrapper = createWrapper({ type: 'checkbox', modelValue: false });
|
|
116
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
117
|
+
|
|
118
|
+
const input = wrapper.find('[data-test-input]');
|
|
119
|
+
|
|
120
|
+
await input.setValue(true);
|
|
121
|
+
|
|
122
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
123
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe(true);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should emit update:modelValue on input radio change', async () => {
|
|
127
|
+
expect.assertions(3);
|
|
128
|
+
|
|
129
|
+
const wrapper = createWrapper({ type: 'checkbox', modelValue: false });
|
|
130
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
131
|
+
|
|
132
|
+
const input = wrapper.find('[data-test-input]');
|
|
133
|
+
|
|
134
|
+
await input.setValue(true);
|
|
135
|
+
|
|
136
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
137
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe(true);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should render a textarea when type is textarea', () => {
|
|
141
|
+
const wrapper = createWrapper({ type: 'textarea' });
|
|
142
|
+
|
|
143
|
+
const textarea = wrapper.find('[data-test-textarea]');
|
|
144
|
+
expect(textarea.exists()).toBe(true);
|
|
145
|
+
expect(textarea.element).toBeInstanceOf(HTMLTextAreaElement);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('should be able to pass a model value to the textarea', () => {
|
|
149
|
+
const wrapper = createWrapper({ type: 'textarea', modelValue: 'Test text' });
|
|
150
|
+
|
|
151
|
+
const textarea = wrapper.find('[data-test-textarea]');
|
|
152
|
+
expect((textarea.element as HTMLTextAreaElement).value).toBe('Test text');
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it('should emit update:modelValue on textarea change', async () => {
|
|
156
|
+
expect.assertions(3);
|
|
157
|
+
|
|
158
|
+
const wrapper = createWrapper({ type: 'textarea' });
|
|
159
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
160
|
+
|
|
161
|
+
const textarea = wrapper.find('[data-test-textarea]');
|
|
162
|
+
|
|
163
|
+
await textarea.setValue('new input text');
|
|
164
|
+
|
|
165
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
166
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe('new input text');
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('should render a datepicker with default attributes when type is datepicker type', () => {
|
|
170
|
+
const wrapper = createWrapper(
|
|
171
|
+
{ type: 'date' },
|
|
172
|
+
undefined,
|
|
173
|
+
{ 'min-date': 'custom' },
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
const datePickerComponent = wrapper.findComponent(VueDatePicker);
|
|
177
|
+
expect(datePickerComponent.exists()).toBe(true);
|
|
178
|
+
expect(datePickerComponent.attributes('disabled')).toBe('false');
|
|
179
|
+
expect(datePickerComponent.attributes('required')).toBe('false');
|
|
180
|
+
expect(datePickerComponent.attributes('readonly')).toBeUndefined();
|
|
181
|
+
|
|
182
|
+
const inputElement = wrapper.find('input');
|
|
183
|
+
expect(inputElement.exists()).toBe(false);
|
|
184
|
+
|
|
185
|
+
const locationInput = wrapper.findComponent(LocationInput);
|
|
186
|
+
expect(locationInput.exists()).toBe(false);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('should emit update:modelValue on datepicker type date change', () => {
|
|
190
|
+
const wrapper = createWrapper({ type: 'date' });
|
|
191
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
192
|
+
|
|
193
|
+
const datePickerComponent = wrapper.findComponent(VueDatePicker);
|
|
194
|
+
datePickerComponent.vm.$emit('update:modelValue', '15-05-2025');
|
|
195
|
+
|
|
196
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
197
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe('15-05-2025');
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('should emit update:modelValue on datepicker type time change', () => {
|
|
201
|
+
const wrapper = createWrapper({ type: 'time' });
|
|
202
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
203
|
+
|
|
204
|
+
const datePickerComponent = wrapper.findComponent(VueDatePicker);
|
|
205
|
+
datePickerComponent.vm.$emit('update:modelValue', '12:00:15');
|
|
206
|
+
|
|
207
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
208
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe('12:00:15');
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('should render a location input when type is location', () => {
|
|
212
|
+
const wrapper = createWrapper({ type: 'location' });
|
|
213
|
+
|
|
214
|
+
const locationInputComponent = wrapper.findComponent(LocationInput);
|
|
215
|
+
expect(locationInputComponent.exists()).toBe(true);
|
|
216
|
+
|
|
217
|
+
const inputElement = wrapper.find('input');
|
|
218
|
+
expect(inputElement.exists()).toBe(false);
|
|
219
|
+
|
|
220
|
+
const datePicker = wrapper.findComponent(VueDatePicker);
|
|
221
|
+
expect(datePicker.exists()).toBe(false);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('should emit update:modelValue on location input change', () => {
|
|
225
|
+
const wrapper = createWrapper({ type: 'location' });
|
|
226
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
227
|
+
|
|
228
|
+
const location: LocationModelValue = {
|
|
229
|
+
postcode: '7418 AJ',
|
|
230
|
+
street: 'Zutphenseweg',
|
|
231
|
+
lat: 52.243_064_6,
|
|
232
|
+
lng: 6.167_831_3,
|
|
233
|
+
numberSuffix: '',
|
|
234
|
+
city: 'Deventer',
|
|
235
|
+
province: 'OV',
|
|
236
|
+
number: 6,
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const locationInputComponent = wrapper.findComponent(LocationInput);
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
241
|
+
locationInputComponent.vm.$emit('update:modelValue', location);
|
|
242
|
+
|
|
243
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
244
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toStrictEqual(location);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
it('should emit update:modelValue on richtText change', async () => {
|
|
248
|
+
expect.assertions(3);
|
|
249
|
+
|
|
250
|
+
const wrapper = createWrapper({ type: 'richText' });
|
|
251
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
252
|
+
|
|
253
|
+
const textarea = wrapper.findComponent(Editor);
|
|
254
|
+
|
|
255
|
+
await textarea.setValue('new input text');
|
|
256
|
+
|
|
257
|
+
expect(wrapper.emitted('update:modelValue')).toBeDefined();
|
|
258
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toBe('new input text');
|
|
259
|
+
});
|
|
260
|
+
});
|