@ouestfrance/sipa-bms-ui 7.14.1
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 +280 -0
- package/dist/assets/animated-icons/AnimatedActivityIcon.vue.d.ts +133 -0
- package/dist/assets/animated-icons/AnimatedCircleHelpIcon.vue.d.ts +133 -0
- package/dist/assets/animated-icons/AnimatedHomeIcon.vue.d.ts +133 -0
- package/dist/components/button/BmsButton.spec.d.ts +1 -0
- package/dist/components/button/BmsButton.vue.d.ts +24 -0
- package/dist/components/button/BmsIconButton.vue.d.ts +23 -0
- package/dist/components/button/UiButton.vue.d.ts +26 -0
- package/dist/components/button/UiButtonLink.vue.d.ts +20 -0
- package/dist/components/feedback/BmsAlert.vue.d.ts +24 -0
- package/dist/components/feedback/BmsBadge.vue.d.ts +18 -0
- package/dist/components/feedback/BmsCaption.vue.d.ts +6 -0
- package/dist/components/feedback/BmsCircularProgress.spec.d.ts +1 -0
- package/dist/components/feedback/BmsCircularProgress.vue.d.ts +6 -0
- package/dist/components/feedback/BmsLoader.spec.d.ts +1 -0
- package/dist/components/feedback/BmsLoader.vue.d.ts +9 -0
- package/dist/components/feedback/BmsTooltip.vue.d.ts +28 -0
- package/dist/components/feedback/UiTooltip.spec.d.ts +1 -0
- package/dist/components/feedback/UiTooltip.vue.d.ts +27 -0
- package/dist/components/feedback/tooltip.helper.d.ts +45 -0
- package/dist/components/feedback/tooltip.helper.spec.d.ts +1 -0
- package/dist/components/form/BmsAutocomplete.vue.d.ts +31 -0
- package/dist/components/form/BmsBetweenInput.vue.d.ts +32 -0
- package/dist/components/form/BmsChip.vue.d.ts +15 -0
- package/dist/components/form/BmsFilePicker.spec.d.ts +1 -0
- package/dist/components/form/BmsFilePicker.vue.d.ts +12 -0
- package/dist/components/form/BmsInputBooleanCheckbox.vue.d.ts +30 -0
- package/dist/components/form/BmsInputCheckboxCaption.spec.d.ts +1 -0
- package/dist/components/form/BmsInputCheckboxCaption.vue.d.ts +31 -0
- package/dist/components/form/BmsInputCheckboxCaptionGroup.vue.d.ts +25 -0
- package/dist/components/form/BmsInputCheckboxGroup.vue.d.ts +24 -0
- package/dist/components/form/BmsInputCode.vue.d.ts +27 -0
- package/dist/components/form/BmsInputDateTime.vue.d.ts +24 -0
- package/dist/components/form/BmsInputFile.spec.d.ts +1 -0
- package/dist/components/form/BmsInputFile.vue.d.ts +27 -0
- package/dist/components/form/BmsInputNumber.spec.d.ts +1 -0
- package/dist/components/form/BmsInputNumber.vue.d.ts +26 -0
- package/dist/components/form/BmsInputRadio.vue.d.ts +28 -0
- package/dist/components/form/BmsInputRadioCaption.vue.d.ts +30 -0
- package/dist/components/form/BmsInputRadioCaptionGroup.vue.d.ts +30 -0
- package/dist/components/form/BmsInputRadioGroup.vue.d.ts +30 -0
- package/dist/components/form/BmsInputText.spec.d.ts +1 -0
- package/dist/components/form/BmsInputText.vue.d.ts +128 -0
- package/dist/components/form/BmsInputToggle.vue.d.ts +15 -0
- package/dist/components/form/BmsSearch.spec.d.ts +1 -0
- package/dist/components/form/BmsSearch.vue.d.ts +187 -0
- package/dist/components/form/BmsSelect.spec.d.ts +1 -0
- package/dist/components/form/BmsSelect.vue.d.ts +34 -0
- package/dist/components/form/BmsTag.vue.d.ts +25 -0
- package/dist/components/form/BmsTextArea.spec.d.ts +1 -0
- package/dist/components/form/BmsTextArea.vue.d.ts +26 -0
- package/dist/components/form/RawAutocomplete.spec.d.ts +1 -0
- package/dist/components/form/RawAutocomplete.vue.d.ts +130 -0
- package/dist/components/form/RawInputText.vue.d.ts +42 -0
- package/dist/components/form/UiBmsInputCheckbox.vue.d.ts +28 -0
- package/dist/components/form/UiBmsSwitch.vue.d.ts +14 -0
- package/dist/components/layout/BmsCard.vue.d.ts +21 -0
- package/dist/components/layout/BmsContentPageLayout.vue.d.ts +17 -0
- package/dist/components/layout/BmsForm.vue.d.ts +7 -0
- package/dist/components/layout/BmsHeader.vue.d.ts +9 -0
- package/dist/components/layout/BmsHeaderTitle.vue.d.ts +22 -0
- package/dist/components/layout/BmsModal.spec.d.ts +1 -0
- package/dist/components/layout/BmsModal.vue.d.ts +60 -0
- package/dist/components/layout/BmsOverlay.vue.d.ts +13 -0
- package/dist/components/layout/BmsSection.vue.d.ts +15 -0
- package/dist/components/layout/BmsStep.vue.d.ts +27 -0
- package/dist/components/layout/BmsStepper.vue.d.ts +13 -0
- package/dist/components/layout/UiPopoverMenu.vue.d.ts +23 -0
- package/dist/components/navigation/BmsBackButton.vue.d.ts +13 -0
- package/dist/components/navigation/BmsBreadcrumb.vue.d.ts +12 -0
- package/dist/components/navigation/BmsLink.spec.d.ts +1 -0
- package/dist/components/navigation/BmsLink.vue.d.ts +22 -0
- package/dist/components/navigation/BmsMenu.spec.d.ts +1 -0
- package/dist/components/navigation/BmsMenu.vue.d.ts +21 -0
- package/dist/components/navigation/BmsMenuNav.spec.d.ts +1 -0
- package/dist/components/navigation/BmsMenuNav.vue.d.ts +23 -0
- package/dist/components/navigation/BmsShortLinkMenu.vue.d.ts +20 -0
- package/dist/components/navigation/BmsTabs.vue.d.ts +7 -0
- package/dist/components/navigation/BmsTenantSwitcher.vue.d.ts +22 -0
- package/dist/components/navigation/UiMenuItem.vue.d.ts +11 -0
- package/dist/components/navigation/UiTab.vue.d.ts +15 -0
- package/dist/components/navigation/UiTenantImage.vue.d.ts +6 -0
- package/dist/components/navigation/UiTenantLabel.vue.d.ts +12 -0
- package/dist/components/navigation/UiTenantSwitcher.spec.d.ts +1 -0
- package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +189 -0
- package/dist/components/table/BmsEmptyScreen.vue.d.ts +6 -0
- package/dist/components/table/BmsPagination.spec.d.ts +1 -0
- package/dist/components/table/BmsPagination.vue.d.ts +35 -0
- package/dist/components/table/BmsServerTable.vue.d.ts +74 -0
- package/dist/components/table/BmsTable.spec.d.ts +1 -0
- package/dist/components/table/BmsTable.vue.d.ts +53 -0
- package/dist/components/table/BmsTableFilters.spec.d.ts +1 -0
- package/dist/components/table/BmsTableFilters.vue.d.ts +188 -0
- package/dist/components/table/DraggableList.vue.d.ts +26 -0
- package/dist/components/table/UiBmsTable.spec.d.ts +1 -0
- package/dist/components/table/UiBmsTable.vue.d.ts +66 -0
- package/dist/components/table/UiFilterButton.vue.d.ts +13 -0
- package/dist/components/utils/BmsCocarde.vue.d.ts +11 -0
- package/dist/components/utils/BmsProblem.vue.d.ts +9 -0
- package/dist/components/utils/BmsRelativeTime.spec.d.ts +1 -0
- package/dist/components/utils/BmsRelativeTime.vue.d.ts +11 -0
- package/dist/composables/clipboard.composable.d.ts +3 -0
- package/dist/composables/index.d.ts +5 -0
- package/dist/composables/pagination.composable.d.ts +14 -0
- package/dist/composables/pagination.composable.spec.d.ts +1 -0
- package/dist/composables/search.composable.d.ts +52 -0
- package/dist/composables/search.composable.spec.d.ts +1 -0
- package/dist/composables/search.helper.d.ts +7 -0
- package/dist/composables/search.helper.spec.d.ts +1 -0
- package/dist/composables/sort.composable.d.ts +10 -0
- package/dist/composables/sort.composable.spec.d.ts +1 -0
- package/dist/composables/userPref.composable.d.ts +6 -0
- package/dist/composables/userPref.composable.spec.d.ts +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/helpers/cocarde.helper.d.ts +1 -0
- package/dist/helpers/cocarde.helper.spec.d.ts +1 -0
- package/dist/helpers/date.helper.d.ts +26 -0
- package/dist/helpers/date.helper.spec.d.ts +1 -0
- package/dist/helpers/file.helper.d.ts +5 -0
- package/dist/helpers/file.helper.spec.d.ts +1 -0
- package/dist/helpers/index.d.ts +6 -0
- package/dist/helpers/location.helper.d.ts +10 -0
- package/dist/helpers/location.helper.spec.d.ts +1 -0
- package/dist/helpers/problem.helper.d.ts +1 -0
- package/dist/helpers/problem.helper.spec.d.ts +1 -0
- package/dist/helpers/string.helper.d.ts +9 -0
- package/dist/helpers/string.helper.spec.d.ts +1 -0
- package/dist/helpers/table.helper.d.ts +16 -0
- package/dist/helpers/table.helper.spec.d.ts +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/logo.png +0 -0
- package/dist/main.d.ts +0 -0
- package/dist/mockServiceWorker.js +344 -0
- package/dist/models/breadcrumb.model.d.ts +5 -0
- package/dist/models/caption.model.d.ts +6 -0
- package/dist/models/chip.model.d.ts +8 -0
- package/dist/models/cocarde.model.d.ts +4 -0
- package/dist/models/form.model.d.ts +25 -0
- package/dist/models/index.d.ts +14 -0
- package/dist/models/menu.model.d.ts +18 -0
- package/dist/models/modal.model.d.ts +8 -0
- package/dist/models/problem.model.d.ts +14 -0
- package/dist/models/sort.model.d.ts +11 -0
- package/dist/models/status-type.model.d.ts +7 -0
- package/dist/models/tab.model.d.ts +7 -0
- package/dist/models/table.model.d.ts +53 -0
- package/dist/models/tenant.model.d.ts +7 -0
- package/dist/models/tooltip.model.d.ts +6 -0
- package/dist/plugins/confirm/index.d.ts +9 -0
- package/dist/plugins/feature-flipper/FeatureFlipper.vue.d.ts +9 -0
- package/dist/plugins/feature-flipper/FeatureFlipperIndicator.vue.d.ts +6 -0
- package/dist/plugins/feature-flipper/FeatureFlipperModal.vue.d.ts +16 -0
- package/dist/plugins/feature-flipper/featureFlipper.composable.d.ts +10 -0
- package/dist/plugins/feature-flipper/featureFlipper.composable.spec.d.ts +1 -0
- package/dist/plugins/feature-flipper/featureFlipper.model.d.ts +3 -0
- package/dist/plugins/feature-flipper/index.d.ts +4 -0
- package/dist/plugins/field/FieldComponent.spec.d.ts +1 -0
- package/dist/plugins/field/FieldComponent.vue.d.ts +25 -0
- package/dist/plugins/field/FieldDatalist.vue.d.ts +27 -0
- package/dist/plugins/field/index.d.ts +2 -0
- package/dist/plugins/keycloak-auth-adapter/index.d.ts +20 -0
- package/dist/plugins/notifications/NotificationItem.vue.d.ts +12 -0
- package/dist/plugins/notifications/NotificationWidget.vue.d.ts +2 -0
- package/dist/plugins/notifications/index.d.ts +11 -0
- package/dist/plugins/notifications/notification.model.d.ts +20 -0
- package/dist/plugins/router-history/index.d.ts +6 -0
- package/dist/plugins/router-history/router-history.composable.d.ts +7 -0
- package/dist/plugins/router-history/router-history.composable.spec.d.ts +1 -0
- package/dist/plugins/runtime-env/index.d.ts +7 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/konami.service.d.ts +2 -0
- package/dist/showroom/App.vue.d.ts +2 -0
- package/dist/showroom/router.d.ts +8 -0
- package/dist/sipa-bms-ui.css +3024 -0
- package/dist/sipa-bms-ui.es.js +102694 -0
- package/dist/sipa-bms-ui.es.js.map +1 -0
- package/dist/sipa-bms-ui.umd.js +102815 -0
- package/dist/sipa-bms-ui.umd.js.map +1 -0
- package/package.json +126 -0
- package/src/assets/animated-icons/AnimatedActivityIcon.vue +77 -0
- package/src/assets/animated-icons/AnimatedCircleHelpIcon.vue +67 -0
- package/src/assets/animated-icons/AnimatedHomeIcon.vue +69 -0
- package/src/assets/empty.svg +1 -0
- package/src/assets/scss/_conf.scss +203 -0
- package/src/assets/scss/_formkit.scss +353 -0
- package/src/assets/scss/app.scss +11 -0
- package/src/assets/scss/global-variables.scss +56 -0
- package/src/components/button/BmsAllButtons.stories.js +56 -0
- package/src/components/button/BmsButton.spec.ts +37 -0
- package/src/components/button/BmsButton.stories.js +84 -0
- package/src/components/button/BmsButton.vue +50 -0
- package/src/components/button/BmsIconButton.stories.js +67 -0
- package/src/components/button/BmsIconButton.vue +34 -0
- package/src/components/button/UiButton.stories.js +131 -0
- package/src/components/button/UiButton.vue +37 -0
- package/src/components/button/UiButtonLink.vue +186 -0
- package/src/components/feedback/BmsAlert.stories.js +75 -0
- package/src/components/feedback/BmsAlert.vue +91 -0
- package/src/components/feedback/BmsBadge.stories.js +34 -0
- package/src/components/feedback/BmsBadge.vue +76 -0
- package/src/components/feedback/BmsCaption.stories.js +59 -0
- package/src/components/feedback/BmsCaption.vue +88 -0
- package/src/components/feedback/BmsCircularProgress.spec.ts +14 -0
- package/src/components/feedback/BmsCircularProgress.stories.js +45 -0
- package/src/components/feedback/BmsCircularProgress.vue +64 -0
- package/src/components/feedback/BmsLoader.spec.ts +7 -0
- package/src/components/feedback/BmsLoader.stories.js +31 -0
- package/src/components/feedback/BmsLoader.vue +82 -0
- package/src/components/feedback/BmsTooltip.stories.js +65 -0
- package/src/components/feedback/BmsTooltip.vue +102 -0
- package/src/components/feedback/Notification.stories.js +37 -0
- package/src/components/feedback/UiTooltip.spec.ts +62 -0
- package/src/components/feedback/UiTooltip.stories.js +71 -0
- package/src/components/feedback/UiTooltip.vue +219 -0
- package/src/components/feedback/tooltip.helper.spec.ts +92 -0
- package/src/components/feedback/tooltip.helper.ts +121 -0
- package/src/components/form/BmsAutocomplete.stories.js +90 -0
- package/src/components/form/BmsAutocomplete.vue +100 -0
- package/src/components/form/BmsBetweenInput.stories.js +69 -0
- package/src/components/form/BmsBetweenInput.vue +146 -0
- package/src/components/form/BmsChip.stories.js +65 -0
- package/src/components/form/BmsChip.vue +92 -0
- package/src/components/form/BmsFilePicker.spec.ts +94 -0
- package/src/components/form/BmsFilePicker.stories.js +53 -0
- package/src/components/form/BmsFilePicker.vue +186 -0
- package/src/components/form/BmsInputBooleanCheckbox.stories.js +90 -0
- package/src/components/form/BmsInputBooleanCheckbox.vue +70 -0
- package/src/components/form/BmsInputCheckboxCaption.spec.ts +45 -0
- package/src/components/form/BmsInputCheckboxCaption.stories.js +92 -0
- package/src/components/form/BmsInputCheckboxCaption.vue +126 -0
- package/src/components/form/BmsInputCheckboxCaptionGroup.stories.js +153 -0
- package/src/components/form/BmsInputCheckboxCaptionGroup.vue +81 -0
- package/src/components/form/BmsInputCheckboxGroup.stories.js +94 -0
- package/src/components/form/BmsInputCheckboxGroup.vue +94 -0
- package/src/components/form/BmsInputCode.stories.js +43 -0
- package/src/components/form/BmsInputCode.vue +71 -0
- package/src/components/form/BmsInputDateTime.stories.js +71 -0
- package/src/components/form/BmsInputDateTime.vue +55 -0
- package/src/components/form/BmsInputFile.spec.ts +90 -0
- package/src/components/form/BmsInputFile.stories.js +156 -0
- package/src/components/form/BmsInputFile.vue +310 -0
- package/src/components/form/BmsInputNumber.spec.ts +40 -0
- package/src/components/form/BmsInputNumber.stories.js +79 -0
- package/src/components/form/BmsInputNumber.vue +67 -0
- package/src/components/form/BmsInputRadio.stories.js +79 -0
- package/src/components/form/BmsInputRadio.vue +121 -0
- package/src/components/form/BmsInputRadioCaption.stories.js +98 -0
- package/src/components/form/BmsInputRadioCaption.vue +110 -0
- package/src/components/form/BmsInputRadioCaptionGroup.stories.js +166 -0
- package/src/components/form/BmsInputRadioCaptionGroup.vue +81 -0
- package/src/components/form/BmsInputRadioGroup.stories.js +108 -0
- package/src/components/form/BmsInputRadioGroup.vue +93 -0
- package/src/components/form/BmsInputText.spec.ts +37 -0
- package/src/components/form/BmsInputText.stories.js +78 -0
- package/src/components/form/BmsInputText.vue +79 -0
- package/src/components/form/BmsInputToggle.stories.js +37 -0
- package/src/components/form/BmsInputToggle.vue +66 -0
- package/src/components/form/BmsSearch.spec.ts +41 -0
- package/src/components/form/BmsSearch.stories.js +70 -0
- package/src/components/form/BmsSearch.vue +62 -0
- package/src/components/form/BmsSelect.spec.ts +57 -0
- package/src/components/form/BmsSelect.stories.js +131 -0
- package/src/components/form/BmsSelect.vue +225 -0
- package/src/components/form/BmsTag.stories.js +64 -0
- package/src/components/form/BmsTag.vue +109 -0
- package/src/components/form/BmsTextArea.spec.ts +37 -0
- package/src/components/form/BmsTextArea.stories.js +74 -0
- package/src/components/form/BmsTextArea.vue +112 -0
- package/src/components/form/Form.stories.js +35 -0
- package/src/components/form/RawAutocomplete.spec.ts +103 -0
- package/src/components/form/RawAutocomplete.vue +218 -0
- package/src/components/form/RawInputText.vue +173 -0
- package/src/components/form/UiBmsInputCheckbox.stories.js +77 -0
- package/src/components/form/UiBmsInputCheckbox.vue +126 -0
- package/src/components/form/UiBmsSwitch.stories.js +40 -0
- package/src/components/form/UiBmsSwitch.vue +80 -0
- package/src/components/layout/BmsCard.stories.js +77 -0
- package/src/components/layout/BmsCard.vue +133 -0
- package/src/components/layout/BmsContentPageLayout.vue +92 -0
- package/src/components/layout/BmsForm.stories.js +30 -0
- package/src/components/layout/BmsForm.vue +42 -0
- package/src/components/layout/BmsHeader.stories.js +29 -0
- package/src/components/layout/BmsHeader.vue +16 -0
- package/src/components/layout/BmsHeaderTitle.stories.js +68 -0
- package/src/components/layout/BmsHeaderTitle.vue +76 -0
- package/src/components/layout/BmsModal.spec.ts +174 -0
- package/src/components/layout/BmsModal.stories.js +153 -0
- package/src/components/layout/BmsModal.vue +359 -0
- package/src/components/layout/BmsOverlay.stories.js +34 -0
- package/src/components/layout/BmsOverlay.vue +28 -0
- package/src/components/layout/BmsSection.stories.js +45 -0
- package/src/components/layout/BmsSection.vue +35 -0
- package/src/components/layout/BmsStep.stories.js +71 -0
- package/src/components/layout/BmsStep.vue +60 -0
- package/src/components/layout/BmsStepper.stories.js +57 -0
- package/src/components/layout/BmsStepper.vue +195 -0
- package/src/components/layout/UiPopoverMenu.vue +167 -0
- package/src/components/navigation/BmsBackButton.stories.js +27 -0
- package/src/components/navigation/BmsBackButton.vue +38 -0
- package/src/components/navigation/BmsBreadcrumb.stories.js +80 -0
- package/src/components/navigation/BmsBreadcrumb.vue +45 -0
- package/src/components/navigation/BmsLink.spec.ts +45 -0
- package/src/components/navigation/BmsLink.vue +59 -0
- package/src/components/navigation/BmsMenu.spec.ts +95 -0
- package/src/components/navigation/BmsMenu.stories.js +85 -0
- package/src/components/navigation/BmsMenu.vue +148 -0
- package/src/components/navigation/BmsMenuNav.spec.ts +140 -0
- package/src/components/navigation/BmsMenuNav.stories.js +187 -0
- package/src/components/navigation/BmsMenuNav.vue +217 -0
- package/src/components/navigation/BmsShortLinkMenu.stories.js +55 -0
- package/src/components/navigation/BmsShortLinkMenu.vue +59 -0
- package/src/components/navigation/BmsTabs.stories.js +30 -0
- package/src/components/navigation/BmsTabs.vue +46 -0
- package/src/components/navigation/BmsTenantSwitcher.stories.js +89 -0
- package/src/components/navigation/BmsTenantSwitcher.vue +135 -0
- package/src/components/navigation/UiMenuItem.stories.js +73 -0
- package/src/components/navigation/UiMenuItem.vue +116 -0
- package/src/components/navigation/UiMenuItemStatus.stories.js +58 -0
- package/src/components/navigation/UiTab.stories.js +56 -0
- package/src/components/navigation/UiTab.vue +71 -0
- package/src/components/navigation/UiTenantImage.vue +22 -0
- package/src/components/navigation/UiTenantLabel.vue +94 -0
- package/src/components/navigation/UiTenantSwitcher.spec.ts +167 -0
- package/src/components/navigation/UiTenantSwitcher.stories.js +70 -0
- package/src/components/navigation/UiTenantSwitcher.vue +161 -0
- package/src/components/table/BmsEmptyScreen.stories.js +32 -0
- package/src/components/table/BmsEmptyScreen.vue +54 -0
- package/src/components/table/BmsPagination.spec.ts +73 -0
- package/src/components/table/BmsPagination.stories.js +34 -0
- package/src/components/table/BmsPagination.vue +154 -0
- package/src/components/table/BmsServerTable.stories.js +422 -0
- package/src/components/table/BmsServerTable.vue +402 -0
- package/src/components/table/BmsTable.spec.ts +309 -0
- package/src/components/table/BmsTable.stories.js +930 -0
- package/src/components/table/BmsTable.vue +308 -0
- package/src/components/table/BmsTableFilters.spec.ts +494 -0
- package/src/components/table/BmsTableFilters.stories.js +114 -0
- package/src/components/table/BmsTableFilters.vue +268 -0
- package/src/components/table/DraggableList.stories.js +29 -0
- package/src/components/table/DraggableList.vue +179 -0
- package/src/components/table/UiBmsTable.spec.ts +373 -0
- package/src/components/table/UiBmsTable.stories.js +563 -0
- package/src/components/table/UiBmsTable.vue +617 -0
- package/src/components/table/UiFilterButton.stories.js +37 -0
- package/src/components/table/UiFilterButton.vue +85 -0
- package/src/components/utils/BmsCocarde.stories.js +47 -0
- package/src/components/utils/BmsCocarde.vue +66 -0
- package/src/components/utils/BmsProblem.stories.js +82 -0
- package/src/components/utils/BmsProblem.vue +223 -0
- package/src/components/utils/BmsRelativeTime.spec.ts +41 -0
- package/src/components/utils/BmsRelativeTime.stories.js +48 -0
- package/src/components/utils/BmsRelativeTime.vue +57 -0
- package/src/composables/clipboard.composable.ts +14 -0
- package/src/composables/index.ts +5 -0
- package/src/composables/pagination.composable.spec.ts +258 -0
- package/src/composables/pagination.composable.ts +111 -0
- package/src/composables/search.composable.spec.ts +1296 -0
- package/src/composables/search.composable.ts +316 -0
- package/src/composables/search.helper.spec.ts +339 -0
- package/src/composables/search.helper.ts +103 -0
- package/src/composables/sort.composable.spec.ts +349 -0
- package/src/composables/sort.composable.ts +129 -0
- package/src/composables/userPref.composable.spec.ts +115 -0
- package/src/composables/userPref.composable.ts +43 -0
- package/src/documentation/ColorTile.vue +23 -0
- package/src/documentation/assets/BmsIcon.png +0 -0
- package/src/documentation/assets/CoverBmsUI.png +0 -0
- package/src/documentation/assets/button/CoverPrimaryButton.png +0 -0
- package/src/documentation/assets/button/CoverSecondaryButton.png +0 -0
- package/src/documentation/assets/button/DoButtonLabel.png +0 -0
- package/src/documentation/assets/button/DontButtonLabel.png +0 -0
- package/src/documentation/assets/button/PrimaryButtonRepresentation.png +0 -0
- package/src/documentation/assets/cards/CardRepresentation.png +0 -0
- package/src/documentation/assets/cards/CoverCard.png +0 -0
- package/src/documentation/assets/chip/ChipRepresentation.png +0 -0
- package/src/documentation/assets/chip/CoverChips.png +0 -0
- package/src/documentation/assets/fields/Anatomy.png +0 -0
- package/src/documentation/assets/fields/CaptionRepresentation.png +0 -0
- package/src/documentation/assets/fields/CaptionTextRepresentation.png +0 -0
- package/src/documentation/assets/fields/CoverFieldsAnatomy.png +0 -0
- package/src/documentation/assets/fields/CoverInputFile.png +0 -0
- package/src/documentation/assets/fields/CoverInputText.png +0 -0
- package/src/documentation/assets/fields/CoverRadioCaptionGroup.png +0 -0
- package/src/documentation/assets/fields/CoverRadioGroup.png +0 -0
- package/src/documentation/assets/fields/CoverSearch.png +0 -0
- package/src/documentation/assets/fields/CoverSelect.png +0 -0
- package/src/documentation/assets/fields/CoverTextArea.png +0 -0
- package/src/documentation/assets/fields/FieldLabel.png +0 -0
- package/src/documentation/assets/fields/InputMediaRepresentation.png +0 -0
- package/src/documentation/assets/fields/InputRepresentation.png +0 -0
- package/src/documentation/assets/fields/InputSearchRepresentation.png +0 -0
- package/src/documentation/assets/fields/InputText.png +0 -0
- package/src/documentation/assets/fields/InputTextAreaRepresentation.png +0 -0
- package/src/documentation/assets/fields/LabelDo.png +0 -0
- package/src/documentation/assets/fields/LabelDont.png +0 -0
- package/src/documentation/assets/fields/LabelRepresentation.png +0 -0
- package/src/documentation/assets/fields/RadioCaptionGroupRepresentation.png +0 -0
- package/src/documentation/assets/fields/RadioGroupRepresentation.png +0 -0
- package/src/documentation/assets/fields/SelectRepresentation.png +0 -0
- package/src/documentation/assets/tag/CoverTag.png +0 -0
- package/src/documentation/assets/tag/TagRepresentation.png +0 -0
- package/src/documentation/button.mdx +24 -0
- package/src/documentation/card.mdx +28 -0
- package/src/documentation/chip.mdx +28 -0
- package/src/documentation/colors.mdx +118 -0
- package/src/documentation/fields.mdx +52 -0
- package/src/documentation/fields_text.mdx +31 -0
- package/src/documentation/icons.mdx +33 -0
- package/src/documentation/inputFile.mdx +28 -0
- package/src/documentation/primaryButton.mdx +20 -0
- package/src/documentation/principles.mdx +23 -0
- package/src/documentation/radioCaptionGroup.mdx +34 -0
- package/src/documentation/radioGroup.mdx +34 -0
- package/src/documentation/search.mdx +28 -0
- package/src/documentation/secondaryButton.mdx +17 -0
- package/src/documentation/select.mdx +31 -0
- package/src/documentation/tag.mdx +28 -0
- package/src/documentation/template_field_dependency.mdx +19 -0
- package/src/documentation/textArea.mdx +27 -0
- package/src/documentation/typography.mdx +93 -0
- package/src/documentation/typography.stories.js +26 -0
- package/src/helpers/cocarde.helper.spec.ts +14 -0
- package/src/helpers/cocarde.helper.ts +22 -0
- package/src/helpers/date.helper.spec.ts +91 -0
- package/src/helpers/date.helper.ts +105 -0
- package/src/helpers/file.helper.spec.ts +60 -0
- package/src/helpers/file.helper.ts +24 -0
- package/src/helpers/index.ts +6 -0
- package/src/helpers/location.helper.spec.ts +195 -0
- package/src/helpers/location.helper.ts +53 -0
- package/src/helpers/problem.helper.spec.ts +21 -0
- package/src/helpers/problem.helper.ts +4 -0
- package/src/helpers/string.helper.spec.ts +186 -0
- package/src/helpers/string.helper.ts +83 -0
- package/src/helpers/table.helper.spec.ts +141 -0
- package/src/helpers/table.helper.ts +88 -0
- package/src/index.ts +203 -0
- package/src/main.ts +25 -0
- package/src/models/breadcrumb.model.ts +6 -0
- package/src/models/caption.model.ts +7 -0
- package/src/models/chip.model.ts +8 -0
- package/src/models/cocarde.model.ts +4 -0
- package/src/models/form.model.ts +30 -0
- package/src/models/index.ts +14 -0
- package/src/models/menu.model.ts +20 -0
- package/src/models/modal.model.ts +9 -0
- package/src/models/problem.model.ts +10 -0
- package/src/models/sort.model.ts +13 -0
- package/src/models/status-type.model.ts +7 -0
- package/src/models/tab.model.ts +7 -0
- package/src/models/table.model.ts +58 -0
- package/src/models/tenant.model.ts +7 -0
- package/src/models/tooltip.model.ts +6 -0
- package/src/pages/Form.stories.js +83 -0
- package/src/pages/List.stories.js +88 -0
- package/src/plugins/confirm/index.ts +109 -0
- package/src/plugins/feature-flipper/FeatureFlipper.vue +23 -0
- package/src/plugins/feature-flipper/FeatureFlipperIndicator.vue +27 -0
- package/src/plugins/feature-flipper/FeatureFlipperModal.vue +68 -0
- package/src/plugins/feature-flipper/featureFlipper.composable.spec.ts +107 -0
- package/src/plugins/feature-flipper/featureFlipper.composable.ts +68 -0
- package/src/plugins/feature-flipper/featureFlipper.model.ts +1 -0
- package/src/plugins/feature-flipper/index.ts +15 -0
- package/src/plugins/field/FieldComponent.spec.ts +34 -0
- package/src/plugins/field/FieldComponent.stories.js +78 -0
- package/src/plugins/field/FieldComponent.vue +208 -0
- package/src/plugins/field/FieldDatalist.stories.js +35 -0
- package/src/plugins/field/FieldDatalist.vue +68 -0
- package/src/plugins/field/index.ts +31 -0
- package/src/plugins/keycloak-auth-adapter/index.ts +102 -0
- package/src/plugins/notifications/NotificationItem.stories.js +60 -0
- package/src/plugins/notifications/NotificationItem.vue +116 -0
- package/src/plugins/notifications/NotificationWidget.vue +129 -0
- package/src/plugins/notifications/index.ts +83 -0
- package/src/plugins/notifications/notification.model.ts +24 -0
- package/src/plugins/notifications/notifications.spec.js +78 -0
- package/src/plugins/router-history/index.ts +23 -0
- package/src/plugins/router-history/router-history.composable.spec.ts +323 -0
- package/src/plugins/router-history/router-history.composable.ts +47 -0
- package/src/plugins/runtime-env/index.ts +19 -0
- package/src/services/index.ts +1 -0
- package/src/services/konami.service.ts +28 -0
- package/src/showroom/App.vue +109 -0
- package/src/showroom/db.json +1967 -0
- package/src/showroom/pages/autocomplete.vue +54 -0
- package/src/showroom/pages/draggable-list.vue +20 -0
- package/src/showroom/pages/file-picker.vue +74 -0
- package/src/showroom/pages/forms.vue +389 -0
- package/src/showroom/pages/index.vue +209 -0
- package/src/showroom/pages/paginated-cards.vue +48 -0
- package/src/showroom/pages/server-table.vue +160 -0
- package/src/showroom/pages/stepper.vue +37 -0
- package/src/showroom/pages/table.vue +192 -0
- package/src/showroom/pages/tabs/[tabName].vue +28 -0
- package/src/showroom/router.ts +15 -0
- package/src/showroom/server.js +45 -0
- package/src/vite-env.d.ts +9 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { beforeEach, describe, it, vi } from 'vitest';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
4
|
+
import UiTooltip from './UiTooltip.vue';
|
|
5
|
+
|
|
6
|
+
let spy = vi.fn();
|
|
7
|
+
vi.mock('@/components/feedback/tooltip.helper', () => ({
|
|
8
|
+
useTooltipHelper: vi.fn(() => ({
|
|
9
|
+
getTooltipTranslatePosition: spy.mockImplementation(() => {
|
|
10
|
+
return { translateX: 0, translateY: 0 };
|
|
11
|
+
}),
|
|
12
|
+
})),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
let props = {
|
|
16
|
+
visible: false,
|
|
17
|
+
tooltipText: 'this is a longer tooltip',
|
|
18
|
+
direction: 'bottom',
|
|
19
|
+
getAnchorElementValues: () => ({
|
|
20
|
+
top: 50,
|
|
21
|
+
left: 50,
|
|
22
|
+
width: 100,
|
|
23
|
+
height: 100,
|
|
24
|
+
}),
|
|
25
|
+
} as any;
|
|
26
|
+
const factory = () =>
|
|
27
|
+
mount(UiTooltip, {
|
|
28
|
+
props: props,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('UiTooltip', () => {
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
vi.resetAllMocks();
|
|
34
|
+
});
|
|
35
|
+
it('should not calculate position of tooltip if tooltip not visible', async () => {
|
|
36
|
+
factory();
|
|
37
|
+
await nextTick();
|
|
38
|
+
expect(spy).not.toHaveBeenCalled();
|
|
39
|
+
});
|
|
40
|
+
it('should calculate position of tooltip', async () => {
|
|
41
|
+
const wrapper = factory();
|
|
42
|
+
await nextTick();
|
|
43
|
+
wrapper.setProps({ ...props, visible: true });
|
|
44
|
+
await nextTick();
|
|
45
|
+
await nextTick();
|
|
46
|
+
expect(spy).toHaveBeenCalled();
|
|
47
|
+
});
|
|
48
|
+
it('should calculate position of tooltip only once', async () => {
|
|
49
|
+
const wrapper = factory();
|
|
50
|
+
await nextTick();
|
|
51
|
+
wrapper.setProps({ ...props, visible: true });
|
|
52
|
+
await nextTick();
|
|
53
|
+
await nextTick();
|
|
54
|
+
wrapper.setProps({ ...props, visible: false });
|
|
55
|
+
await nextTick();
|
|
56
|
+
await nextTick();
|
|
57
|
+
wrapper.setProps({ ...props, visible: true });
|
|
58
|
+
await nextTick();
|
|
59
|
+
await nextTick();
|
|
60
|
+
expect(spy).toHaveBeenCalledOnce();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import UiTooltip from './UiTooltip.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Composants/feedback/UiTooltip',
|
|
5
|
+
component: UiTooltip,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => ({
|
|
9
|
+
components: {
|
|
10
|
+
UiTooltip,
|
|
11
|
+
},
|
|
12
|
+
setup() {
|
|
13
|
+
return { args };
|
|
14
|
+
},
|
|
15
|
+
template: `
|
|
16
|
+
<div
|
|
17
|
+
style="border: 1px solid var(--bms-grey-100);position: absolute; top: 50px; left: 50px; width: 100px; height: 100px;">
|
|
18
|
+
anchor
|
|
19
|
+
</div>
|
|
20
|
+
<UiTooltip v-bind="args">{{ args.tooltipText }}</UiTooltip>
|
|
21
|
+
`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const Bottom = Template.bind({});
|
|
25
|
+
Bottom.args = {
|
|
26
|
+
tooltipText: 'this is a longer tooltip',
|
|
27
|
+
direction: 'bottom',
|
|
28
|
+
getAnchorElementValues: () => ({
|
|
29
|
+
top: 50,
|
|
30
|
+
left: 50,
|
|
31
|
+
width: 100,
|
|
32
|
+
height: 100,
|
|
33
|
+
}),
|
|
34
|
+
visible: true,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Right = Template.bind({});
|
|
38
|
+
Right.args = {
|
|
39
|
+
tooltipText: 'this is a longer tooltip',
|
|
40
|
+
direction: 'right',
|
|
41
|
+
getAnchorElementValues: () => ({
|
|
42
|
+
top: 50,
|
|
43
|
+
left: 50,
|
|
44
|
+
width: 100,
|
|
45
|
+
height: 100,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Left = Template.bind({});
|
|
50
|
+
Left.args = {
|
|
51
|
+
tooltipText: 'this is a longer tooltip',
|
|
52
|
+
direction: 'left',
|
|
53
|
+
getAnchorElementValues: () => ({
|
|
54
|
+
top: 50,
|
|
55
|
+
left: 50,
|
|
56
|
+
width: 100,
|
|
57
|
+
height: 100,
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Top = Template.bind({});
|
|
62
|
+
Top.args = {
|
|
63
|
+
tooltipText: 'this is a longer tooltip',
|
|
64
|
+
direction: 'top',
|
|
65
|
+
getAnchorElementValues: () => ({
|
|
66
|
+
top: 50,
|
|
67
|
+
left: 50,
|
|
68
|
+
width: 100,
|
|
69
|
+
height: 100,
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Transition name="tooltip-fade">
|
|
3
|
+
<div v-show="visible" ref="tooltipElement" :class="classes" :style="style">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</Transition>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { TooltipDirection } from '@/models';
|
|
11
|
+
import { computed, nextTick, onMounted, Ref, ref, watch } from 'vue';
|
|
12
|
+
import { useTooltipHelper } from './tooltip.helper';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
MaybeComputedElementRef,
|
|
16
|
+
useElementBounding,
|
|
17
|
+
useWindowSize,
|
|
18
|
+
} from '@vueuse/core';
|
|
19
|
+
|
|
20
|
+
const tooltipElement = ref(null);
|
|
21
|
+
const tooltipElementBounding = useElementBounding(
|
|
22
|
+
tooltipElement as MaybeComputedElementRef,
|
|
23
|
+
);
|
|
24
|
+
const calculatedTooltipTransform: Ref<string> = ref<string>('none');
|
|
25
|
+
const windowSize = useWindowSize();
|
|
26
|
+
const { getTooltipTranslatePosition } = useTooltipHelper();
|
|
27
|
+
|
|
28
|
+
const props = withDefaults(
|
|
29
|
+
defineProps<{
|
|
30
|
+
visible?: boolean;
|
|
31
|
+
direction?: TooltipDirection;
|
|
32
|
+
// Callback parce que le calcul de position a besoin d'être fait
|
|
33
|
+
// au moment ou l'on affiche le tooltip. Les computed & composables
|
|
34
|
+
// ne déclenchent pas le re-calcul au bon moment du render.
|
|
35
|
+
getAnchorElementValues: () =>
|
|
36
|
+
| undefined
|
|
37
|
+
| {
|
|
38
|
+
top: number;
|
|
39
|
+
left: number;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
right: number;
|
|
43
|
+
bottom: number;
|
|
44
|
+
};
|
|
45
|
+
}>(),
|
|
46
|
+
{
|
|
47
|
+
visible: true,
|
|
48
|
+
direction: TooltipDirection.Bottom,
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
const anchorElement = ref<
|
|
52
|
+
| undefined
|
|
53
|
+
| {
|
|
54
|
+
top: number;
|
|
55
|
+
left: number;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
right: number;
|
|
59
|
+
bottom: number;
|
|
60
|
+
}
|
|
61
|
+
>(undefined);
|
|
62
|
+
|
|
63
|
+
const classes = computed(
|
|
64
|
+
() => `bms-tooltip__text bms-tooltip__text--${props.direction}`,
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const setTooltipPosition = async () => {
|
|
68
|
+
if (
|
|
69
|
+
props.visible &&
|
|
70
|
+
JSON.stringify(anchorElement.value) !==
|
|
71
|
+
JSON.stringify(props.getAnchorElementValues())
|
|
72
|
+
) {
|
|
73
|
+
anchorElement.value = props.getAnchorElementValues();
|
|
74
|
+
|
|
75
|
+
// reset position
|
|
76
|
+
calculatedTooltipTransform.value = 'none';
|
|
77
|
+
|
|
78
|
+
if (!anchorElement.value) return;
|
|
79
|
+
|
|
80
|
+
// we wait for the tooltip to be mounted and have a width & height to base our calculation from
|
|
81
|
+
await nextTick();
|
|
82
|
+
|
|
83
|
+
const { translateX, translateY } = getTooltipTranslatePosition(
|
|
84
|
+
props.direction,
|
|
85
|
+
{
|
|
86
|
+
width: windowSize.width.value,
|
|
87
|
+
height: windowSize.height.value,
|
|
88
|
+
},
|
|
89
|
+
anchorElement.value,
|
|
90
|
+
{
|
|
91
|
+
width: tooltipElementBounding.width.value,
|
|
92
|
+
height: tooltipElementBounding.height.value,
|
|
93
|
+
left: tooltipElementBounding.left.value,
|
|
94
|
+
right: tooltipElementBounding.right.value,
|
|
95
|
+
top: tooltipElementBounding.top.value,
|
|
96
|
+
bottom: tooltipElementBounding.bottom.value,
|
|
97
|
+
},
|
|
98
|
+
);
|
|
99
|
+
calculatedTooltipTransform.value = `translate(${Math.floor(translateX)}px,${Math.floor(translateY)}px)`;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
watch(() => props.visible, setTooltipPosition);
|
|
104
|
+
onMounted(setTooltipPosition);
|
|
105
|
+
|
|
106
|
+
const style = computed(() => {
|
|
107
|
+
const anchorElement = props.getAnchorElementValues();
|
|
108
|
+
if (!anchorElement) return;
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
top: `${anchorElement.top}px`,
|
|
112
|
+
left: `${anchorElement.left}px`,
|
|
113
|
+
'--bms-tooltip-transform': calculatedTooltipTransform.value,
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style lang="scss" scoped>
|
|
119
|
+
.bms-tooltip__text {
|
|
120
|
+
--bms-tooltip-background-color: white;
|
|
121
|
+
--bms-tooltip-color: inherit;
|
|
122
|
+
--bms-tooltip-margin: 4px;
|
|
123
|
+
|
|
124
|
+
background-color: var(--bms-tooltip-background-color);
|
|
125
|
+
width: max-content;
|
|
126
|
+
text-align: center;
|
|
127
|
+
padding: 4px 8px;
|
|
128
|
+
border-radius: var(--bms-border-radius);
|
|
129
|
+
max-width: var(--bms-tooltip-max-width, 30rem);
|
|
130
|
+
max-height: 30rem;
|
|
131
|
+
position: absolute;
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
z-index: 20;
|
|
134
|
+
filter: drop-shadow(0 0 0.8rem var(--bms-shadow-color));
|
|
135
|
+
color: var(--bms-font-color);
|
|
136
|
+
transform: var(--bms-tooltip-transform);
|
|
137
|
+
|
|
138
|
+
&::before {
|
|
139
|
+
content: '';
|
|
140
|
+
position: absolute;
|
|
141
|
+
right: var(--bms-tooltip-indicator-position-right);
|
|
142
|
+
left: var(--bms-tooltip-indicator-position-left);
|
|
143
|
+
top: var(--bms-tooltip-indicator-position-top);
|
|
144
|
+
bottom: var(--bms-tooltip-indicator-position-bottom);
|
|
145
|
+
transform: var(--bms-tooltip-indicator-transform);
|
|
146
|
+
border-width: 3px;
|
|
147
|
+
border-style: solid;
|
|
148
|
+
border-color: var(--bms-tooltip-indicator-border);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&--top,
|
|
152
|
+
&--bottom {
|
|
153
|
+
--bms-tooltip-indicator-position-left: 50%;
|
|
154
|
+
--bms-tooltip-indicator-position-right: initial;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--bottom {
|
|
158
|
+
--bms-tooltip-indicator-position-top: initial;
|
|
159
|
+
--bms-tooltip-indicator-position-bottom: 100%;
|
|
160
|
+
--bms-tooltip-indicator-border: transparent transparent
|
|
161
|
+
var(--bms-tooltip-background-color) transparent;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&--top {
|
|
165
|
+
--bms-tooltip-indicator-position-top: 100%;
|
|
166
|
+
--bms-tooltip-indicator-position-bottom: initial;
|
|
167
|
+
--bms-tooltip-indicator-border: var(--bms-tooltip-background-color)
|
|
168
|
+
transparent transparent transparent;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&--left,
|
|
172
|
+
&--right {
|
|
173
|
+
--bms-tooltip-indicator-position-top: 50%;
|
|
174
|
+
--bms-tooltip-indicator-position-bottom: initial;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&--left {
|
|
178
|
+
--bms-tooltip-indicator-position-right: initial;
|
|
179
|
+
--bms-tooltip-indicator-position-left: 100%;
|
|
180
|
+
--bms-tooltip-indicator-border: transparent transparent transparent
|
|
181
|
+
var(--bms-tooltip-background-color);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&--right {
|
|
185
|
+
--bms-tooltip-indicator-position-right: 100%;
|
|
186
|
+
--bms-tooltip-indicator-position-left: initial;
|
|
187
|
+
--bms-tooltip-indicator-border: transparent
|
|
188
|
+
var(--bms-tooltip-background-color) transparent transparent;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.tooltip-fade-enter {
|
|
193
|
+
&-active {
|
|
194
|
+
transition: opacity 0.2s ease;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&-from {
|
|
198
|
+
opacity: 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&-to {
|
|
202
|
+
opacity: 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.tooltip-fade-leave {
|
|
207
|
+
&-active {
|
|
208
|
+
transition: opacity 0.3s ease;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&-from {
|
|
212
|
+
opacity: 1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&-to {
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TooltipDirection } from '@/models';
|
|
2
|
+
import { useTooltipHelper } from './tooltip.helper';
|
|
3
|
+
|
|
4
|
+
const { _getTranslatePosition, _shiftTranslatePosition } = useTooltipHelper();
|
|
5
|
+
|
|
6
|
+
describe('tooltip.helper', () => {
|
|
7
|
+
describe('_getTranslatePosition', () => {
|
|
8
|
+
test.each([
|
|
9
|
+
[
|
|
10
|
+
TooltipDirection.Top,
|
|
11
|
+
{ width: 40, height: 20 }, // anchor element
|
|
12
|
+
{ width: 200, height: 100 }, // tooltip element
|
|
13
|
+
{ x: -80, y: -100 }, // resulted
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
TooltipDirection.Bottom,
|
|
17
|
+
{ width: 40, height: 20 },
|
|
18
|
+
{ width: 200, height: 100 },
|
|
19
|
+
{ x: -80, y: 20 },
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
TooltipDirection.Right,
|
|
23
|
+
{ width: 40, height: 20 },
|
|
24
|
+
{ width: 200, height: 100 },
|
|
25
|
+
{ x: 40, y: -40 },
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
TooltipDirection.Left,
|
|
29
|
+
{ width: 40, height: 20 },
|
|
30
|
+
{ width: 200, height: 100 },
|
|
31
|
+
{ x: -200, y: -40 },
|
|
32
|
+
],
|
|
33
|
+
])(
|
|
34
|
+
'calculate position on %s',
|
|
35
|
+
(
|
|
36
|
+
direction: TooltipDirection,
|
|
37
|
+
anchorElement: { width: number; height: number },
|
|
38
|
+
tooltipElement: { width: number; height: number },
|
|
39
|
+
transformResult: { x: number; y: number },
|
|
40
|
+
) => {
|
|
41
|
+
expect(
|
|
42
|
+
_getTranslatePosition(direction, anchorElement, tooltipElement, 0),
|
|
43
|
+
).toStrictEqual(transformResult);
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
describe('_shiftTranslatePosition', () => {
|
|
49
|
+
test.each([
|
|
50
|
+
[
|
|
51
|
+
'should shift to the right if overflows on left',
|
|
52
|
+
TooltipDirection.Top,
|
|
53
|
+
{ left: 0, top: 0, right: 100, bottom: 50 },
|
|
54
|
+
{ width: 500, height: 500 },
|
|
55
|
+
{ x: -20, y: -20 },
|
|
56
|
+
{ shiftedX: -0, shiftedY: -20 },
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
'should shift to the bottom if overflows on top',
|
|
60
|
+
TooltipDirection.Left,
|
|
61
|
+
{ left: 0, top: -50, right: 100, bottom: 0 },
|
|
62
|
+
{ width: 500, height: 500 },
|
|
63
|
+
{ x: -20, y: -20 },
|
|
64
|
+
{ shiftedX: -20, shiftedY: -50 },
|
|
65
|
+
],
|
|
66
|
+
])(
|
|
67
|
+
'%s',
|
|
68
|
+
(
|
|
69
|
+
_comment: string,
|
|
70
|
+
direction: TooltipDirection,
|
|
71
|
+
tooltipElement: {
|
|
72
|
+
left: number;
|
|
73
|
+
top: number;
|
|
74
|
+
right: number;
|
|
75
|
+
bottom: number;
|
|
76
|
+
},
|
|
77
|
+
window: { width: number; height: number },
|
|
78
|
+
translatePosition: { x: number; y: number },
|
|
79
|
+
transformResult: { shiftedX: number; shiftedY: number },
|
|
80
|
+
) => {
|
|
81
|
+
expect(
|
|
82
|
+
_shiftTranslatePosition(
|
|
83
|
+
direction,
|
|
84
|
+
tooltipElement,
|
|
85
|
+
window,
|
|
86
|
+
translatePosition,
|
|
87
|
+
),
|
|
88
|
+
).toStrictEqual(transformResult);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { TooltipDirection } from '@/models';
|
|
2
|
+
|
|
3
|
+
export const useTooltipHelper = () => {
|
|
4
|
+
const _shiftTranslatePosition = (
|
|
5
|
+
direction: TooltipDirection,
|
|
6
|
+
tooltipElement: {
|
|
7
|
+
right: number;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
bottom: number;
|
|
11
|
+
},
|
|
12
|
+
window: { width: number; height: number },
|
|
13
|
+
translatePosition: { x: number; y: number },
|
|
14
|
+
) => {
|
|
15
|
+
let shiftedX = translatePosition.x;
|
|
16
|
+
let shiftedY = translatePosition.y;
|
|
17
|
+
|
|
18
|
+
if (
|
|
19
|
+
direction === TooltipDirection.Bottom ||
|
|
20
|
+
direction === TooltipDirection.Top
|
|
21
|
+
) {
|
|
22
|
+
// overflow left
|
|
23
|
+
if (tooltipElement.left + translatePosition.x < 0)
|
|
24
|
+
shiftedX = -tooltipElement.left;
|
|
25
|
+
|
|
26
|
+
// overflow right
|
|
27
|
+
if (tooltipElement.right + translatePosition.x > window.width)
|
|
28
|
+
shiftedX = window.width - tooltipElement.right;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (
|
|
32
|
+
direction === TooltipDirection.Left ||
|
|
33
|
+
direction === TooltipDirection.Right
|
|
34
|
+
) {
|
|
35
|
+
// overflow top
|
|
36
|
+
if (tooltipElement.top + translatePosition.y < 0)
|
|
37
|
+
shiftedY = tooltipElement.top;
|
|
38
|
+
|
|
39
|
+
// overflow bottom
|
|
40
|
+
if (tooltipElement.bottom + translatePosition.y > window.height)
|
|
41
|
+
shiftedY = window.height - tooltipElement.bottom;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return { shiftedX, shiftedY };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const _getTranslatePosition = (
|
|
48
|
+
direction: TooltipDirection,
|
|
49
|
+
|
|
50
|
+
anchorElement: { width: number; height: number },
|
|
51
|
+
tooltipElement: {
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
},
|
|
55
|
+
margin = 5,
|
|
56
|
+
) => {
|
|
57
|
+
switch (direction) {
|
|
58
|
+
case TooltipDirection.Top:
|
|
59
|
+
return {
|
|
60
|
+
x: (anchorElement.width - tooltipElement.width) / 2,
|
|
61
|
+
y: -tooltipElement.height - margin,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
case TooltipDirection.Bottom:
|
|
65
|
+
return {
|
|
66
|
+
x: (anchorElement.width - tooltipElement.width) / 2,
|
|
67
|
+
y: anchorElement.height + margin,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
case TooltipDirection.Left:
|
|
71
|
+
return {
|
|
72
|
+
x: -tooltipElement.width - margin,
|
|
73
|
+
y: (anchorElement.height - tooltipElement.height) / 2,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
case TooltipDirection.Right:
|
|
77
|
+
return {
|
|
78
|
+
x: anchorElement.width + margin,
|
|
79
|
+
y: (anchorElement.height - tooltipElement.height) / 2,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const getTooltipTranslatePosition = (
|
|
85
|
+
direction: TooltipDirection,
|
|
86
|
+
window: { width: number; height: number },
|
|
87
|
+
anchorElement: { width: number; height: number },
|
|
88
|
+
tooltipElement: {
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
right: number;
|
|
92
|
+
left: number;
|
|
93
|
+
top: number;
|
|
94
|
+
bottom: number;
|
|
95
|
+
},
|
|
96
|
+
) => {
|
|
97
|
+
const { x, y } = _getTranslatePosition(
|
|
98
|
+
direction,
|
|
99
|
+
anchorElement,
|
|
100
|
+
tooltipElement,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
let { shiftedX, shiftedY } = _shiftTranslatePosition(
|
|
104
|
+
direction,
|
|
105
|
+
tooltipElement,
|
|
106
|
+
window,
|
|
107
|
+
{ x, y },
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
translateX: shiftedX,
|
|
112
|
+
translateY: shiftedY,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
getTooltipTranslatePosition,
|
|
118
|
+
_getTranslatePosition,
|
|
119
|
+
_shiftTranslatePosition,
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import BmsAutocomplete from '@/components/form/BmsAutocomplete.vue';
|
|
2
|
+
import { Cat, Heart, Wheat } from 'lucide-vue-next';
|
|
3
|
+
|
|
4
|
+
import template from '@/documentation/template_field_dependency.mdx';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
page: template,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
title: 'Composants/form/AutocompleteTextIcon',
|
|
13
|
+
component: BmsAutocomplete,
|
|
14
|
+
argTypes: {},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const Template = (args) => ({
|
|
18
|
+
components: {
|
|
19
|
+
BmsAutocomplete,
|
|
20
|
+
},
|
|
21
|
+
setup() {
|
|
22
|
+
return { args };
|
|
23
|
+
},
|
|
24
|
+
template: `
|
|
25
|
+
<BmsAutocomplete v-bind="args" />
|
|
26
|
+
`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Default = Template.bind({});
|
|
30
|
+
Default.args = {
|
|
31
|
+
options: [
|
|
32
|
+
{ label: 'titi', value: 'i' },
|
|
33
|
+
{ label: 'toto', value: 'o' },
|
|
34
|
+
{ label: 'tutu', value: 'u' },
|
|
35
|
+
],
|
|
36
|
+
modelValue: '',
|
|
37
|
+
};
|
|
38
|
+
export const WithStringArray = Template.bind({});
|
|
39
|
+
WithStringArray.args = {
|
|
40
|
+
options: ['titi', 'toto', 'tutu'],
|
|
41
|
+
modelValue: '',
|
|
42
|
+
open: true,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WithValue = Template.bind({});
|
|
46
|
+
WithValue.args = {
|
|
47
|
+
options: [
|
|
48
|
+
{ label: 'titi', value: 'i' },
|
|
49
|
+
{ label: 'toto', value: 'o' },
|
|
50
|
+
{ label: 'tutu', value: 'u' },
|
|
51
|
+
],
|
|
52
|
+
modelValue: 'i',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Opened = Template.bind({});
|
|
56
|
+
Opened.parameters = { pseudo: { focus: 'input' } };
|
|
57
|
+
Opened.args = {
|
|
58
|
+
options: [
|
|
59
|
+
{ label: 'titi', value: 'i' },
|
|
60
|
+
{ label: 'toto', value: 'o' },
|
|
61
|
+
{ label: 'tutu', value: 'u' },
|
|
62
|
+
],
|
|
63
|
+
modelValue: '',
|
|
64
|
+
open: true,
|
|
65
|
+
};
|
|
66
|
+
export const IconsWithValue = Template.bind({});
|
|
67
|
+
IconsWithValue.args = {
|
|
68
|
+
options: [
|
|
69
|
+
{ label: 'titi', value: 'i', icon: Heart },
|
|
70
|
+
{ label: 'toto', value: 'o', icon: Cat },
|
|
71
|
+
{ label: 'tutu', value: 'u', icon: Wheat },
|
|
72
|
+
],
|
|
73
|
+
modelValue: 'i',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const IconsOpened = Template.bind({});
|
|
77
|
+
IconsOpened.parameters = { pseudo: { focus: 'input' } };
|
|
78
|
+
IconsOpened.args = {
|
|
79
|
+
options: [
|
|
80
|
+
{ label: 'titi', value: 'i', icon: Heart },
|
|
81
|
+
{ label: 'toto', value: 'o', icon: Cat },
|
|
82
|
+
{
|
|
83
|
+
label: 'tutu',
|
|
84
|
+
value: 'u',
|
|
85
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/></svg>`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
modelValue: '',
|
|
89
|
+
open: true,
|
|
90
|
+
};
|