@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,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BmsLink :to="(item as MenuItem).link" :target="target" :classes="classes">
|
|
3
|
+
<span class="bar"> </span>
|
|
4
|
+
<component v-if="item.icon" :is="item.icon" :size="20" />
|
|
5
|
+
<span class="label"> {{ item.label }}</span>
|
|
6
|
+
</BmsLink>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { MenuItem } from '@/models/menu.model';
|
|
11
|
+
import { computed } from 'vue';
|
|
12
|
+
import BmsLink from '@/components/navigation/BmsLink.vue';
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(
|
|
15
|
+
defineProps<{
|
|
16
|
+
item: MenuItem;
|
|
17
|
+
active?: boolean;
|
|
18
|
+
target?: string;
|
|
19
|
+
}>(),
|
|
20
|
+
{ active: false, target: '_self' },
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const classes = computed(() => {
|
|
24
|
+
let classes: any = { menu__link: true, active: props.active };
|
|
25
|
+
if (props.item.status) {
|
|
26
|
+
classes[props.item.status] = true;
|
|
27
|
+
}
|
|
28
|
+
return classes;
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss">
|
|
33
|
+
.menu__link {
|
|
34
|
+
--bar-color: transparent;
|
|
35
|
+
--label-color: var(--bms-font-color);
|
|
36
|
+
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 16px;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
color: inherit;
|
|
42
|
+
background-color: var(--bms-white);
|
|
43
|
+
width: 100%;
|
|
44
|
+
color: var(--label-color);
|
|
45
|
+
|
|
46
|
+
&.active {
|
|
47
|
+
--label-color: var(--bms-main-100);
|
|
48
|
+
--bar-color: var(--bms-main-100);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
--bar-color: var(--bms-main-75);
|
|
53
|
+
--label-color: var(--bms-main-75);
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.danger {
|
|
58
|
+
--label-color: var(--bms-red-100);
|
|
59
|
+
|
|
60
|
+
&.active {
|
|
61
|
+
--bar-color: var(--bms-red-100);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
--bar-color: var(--bms-red-75);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.warning {
|
|
70
|
+
--label-color: var(--bms-orange-100);
|
|
71
|
+
|
|
72
|
+
&.active {
|
|
73
|
+
--bar-color: var(--bms-orange-100);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
--bar-color: var(--bms-orange-75);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.success {
|
|
82
|
+
--label-color: var(--bms-green-100);
|
|
83
|
+
|
|
84
|
+
&.active {
|
|
85
|
+
--bar-color: var(--bms-green-100);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
--bar-color: var(--bms-green-75);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.information {
|
|
94
|
+
--label-color: var(--bms-grey-100);
|
|
95
|
+
|
|
96
|
+
&.active {
|
|
97
|
+
--bar-color: var(--bms-grey-100);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
--bar-color: var(--bms-grey-75);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bar {
|
|
106
|
+
width: 4px;
|
|
107
|
+
background-color: var(--bar-color);
|
|
108
|
+
align-self: stretch;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.label {
|
|
112
|
+
padding: 16px 16px 16px 0;
|
|
113
|
+
line-height: 16px;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import UiMenuItem from '@/components/navigation/UiMenuItem.vue';
|
|
2
|
+
import { ShieldAlert, ShieldCheck, ShieldOff } from 'lucide-vue-next';
|
|
3
|
+
import { StatusType } from '../../models';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Composants/navigation/MenuItem',
|
|
7
|
+
component: UiMenuItem,
|
|
8
|
+
argTypes: {},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template = (args) => ({
|
|
12
|
+
components: {
|
|
13
|
+
UiMenuItem,
|
|
14
|
+
},
|
|
15
|
+
setup() {
|
|
16
|
+
return { args };
|
|
17
|
+
},
|
|
18
|
+
template: `
|
|
19
|
+
<UiMenuItem :item="args.items[0]"/>
|
|
20
|
+
<UiMenuItem :item="args.items[0]" :active="true"/>
|
|
21
|
+
<UiMenuItem :item="args.items[1]"/>
|
|
22
|
+
<UiMenuItem :item="args.items[1]" :active="true"/>
|
|
23
|
+
<UiMenuItem :item="args.items[2]"/>
|
|
24
|
+
<UiMenuItem :item="args.items[2]" :active="true"/>
|
|
25
|
+
<UiMenuItem :item="args.items[3]"/>
|
|
26
|
+
<UiMenuItem :item="args.items[3]" :active="true"/>
|
|
27
|
+
`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const WithStatusType = Template.bind({});
|
|
31
|
+
WithStatusType.args = {
|
|
32
|
+
items: [
|
|
33
|
+
{
|
|
34
|
+
label: 'Item label',
|
|
35
|
+
link: 'http://google.fr',
|
|
36
|
+
icon: ShieldAlert,
|
|
37
|
+
status: StatusType.Danger,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Item label',
|
|
41
|
+
link: 'http://google.fr',
|
|
42
|
+
icon: ShieldAlert,
|
|
43
|
+
status: StatusType.Warning,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Item label',
|
|
47
|
+
link: 'http://google.fr',
|
|
48
|
+
icon: ShieldCheck,
|
|
49
|
+
status: StatusType.Success,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Item label',
|
|
53
|
+
link: 'http://google.fr',
|
|
54
|
+
icon: ShieldOff,
|
|
55
|
+
status: StatusType.Information,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import UiTab from '@/components/navigation/UiTab.vue';
|
|
2
|
+
import { within } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Composants/navigation/UiTab',
|
|
6
|
+
component: UiTab,
|
|
7
|
+
argTypes: {
|
|
8
|
+
items: {},
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Template = (args) => ({
|
|
13
|
+
components: {
|
|
14
|
+
UiTab,
|
|
15
|
+
},
|
|
16
|
+
setup() {
|
|
17
|
+
return { args };
|
|
18
|
+
},
|
|
19
|
+
template: `
|
|
20
|
+
<UiTab v-bind="args" />
|
|
21
|
+
`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
Default.args = {
|
|
26
|
+
currentRoute: { path: 'toto' },
|
|
27
|
+
tab: { name: 'Titi', routePath: 'titi' },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Active = Template.bind({});
|
|
31
|
+
Active.args = {
|
|
32
|
+
currentRoute: { path: 'titi-subRoute' },
|
|
33
|
+
tab: { name: 'Titi', routePath: 'titi' },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Disabled = Template.bind({});
|
|
37
|
+
Disabled.args = {
|
|
38
|
+
currentRoute: { path: 'toto' },
|
|
39
|
+
tab: { name: 'Titi', routePath: 'titi', disabled: true },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Error = Template.bind({});
|
|
43
|
+
Error.args = {
|
|
44
|
+
currentRoute: { path: 'toto' },
|
|
45
|
+
tab: { name: 'Titi', routePath: 'titi', error: true },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Hover = Template.bind({});
|
|
49
|
+
Hover.args = {
|
|
50
|
+
currentRoute: { path: 'toto' },
|
|
51
|
+
tab: { name: 'Titi', routePath: 'titi' },
|
|
52
|
+
};
|
|
53
|
+
Hover.play = async ({ canvasElement }) => {
|
|
54
|
+
const canvas = within(canvasElement);
|
|
55
|
+
await canvas.getByTestId('tab').classList.add('tab__hover');
|
|
56
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<router-link
|
|
3
|
+
:to="tabTarget"
|
|
4
|
+
data-testid="tab"
|
|
5
|
+
class="tab"
|
|
6
|
+
:class="{ active: isTabSelected, error: tab.error, disabled: tab.disabled }"
|
|
7
|
+
>
|
|
8
|
+
<slot>{{ tab.name }}</slot>
|
|
9
|
+
</router-link>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { Tab } from '@/models/tab.model';
|
|
14
|
+
import { ComputedRef, computed } from 'vue';
|
|
15
|
+
import { RouteLocation, RouteLocationRaw } from 'vue-router';
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
currentRoute: RouteLocation;
|
|
20
|
+
tab: Tab;
|
|
21
|
+
}>(),
|
|
22
|
+
{},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const isTabSelected: ComputedRef<boolean> = computed(() =>
|
|
26
|
+
props.tab.routePath
|
|
27
|
+
? props.currentRoute.path.includes(props.tab.routePath)
|
|
28
|
+
: props.tab.routeName
|
|
29
|
+
? !!props.currentRoute.name &&
|
|
30
|
+
(props.currentRoute.name as string).includes(props.tab.routeName)
|
|
31
|
+
: false,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const tabTarget: ComputedRef<RouteLocationRaw> = computed(() =>
|
|
35
|
+
props.tab.routePath
|
|
36
|
+
? { path: props.tab.routePath }
|
|
37
|
+
: { name: props.tab.routeName },
|
|
38
|
+
);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style lang="scss" scoped>
|
|
42
|
+
.tab {
|
|
43
|
+
--tab-border-color: transparent;
|
|
44
|
+
--tab-color: var(--bms-font-color);
|
|
45
|
+
|
|
46
|
+
color: var(--tab-color);
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
border-bottom: 4px solid var(--tab-border-color);
|
|
49
|
+
padding: 0 8px 16px 8px;
|
|
50
|
+
|
|
51
|
+
&:hover,
|
|
52
|
+
&__hover {
|
|
53
|
+
--tab-border-color: var(--bms-main-50);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.active {
|
|
57
|
+
--tab-border-color: var(--bms-main-100);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.disabled {
|
|
61
|
+
--tab-border-color: var(transparent);
|
|
62
|
+
--tab-color: var(--bms-grey-50);
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.error {
|
|
67
|
+
--tab-border-color: var(--bms-danger-color);
|
|
68
|
+
--tab-color: var(--bms-danger-color);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img v-if="tenant?.logoFile" :src="tenant?.logoFile" class="site-logo" />
|
|
3
|
+
<BmsCocarde v-else :initials="getInitials(tenant.label)" size="small" />
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { getInitials } from '@/helpers/cocarde.helper';
|
|
8
|
+
import { BmsCocarde } from '@/index';
|
|
9
|
+
import { Tenant } from '@/models';
|
|
10
|
+
|
|
11
|
+
defineProps<{
|
|
12
|
+
tenant: Tenant;
|
|
13
|
+
}>();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
.site-logo {
|
|
18
|
+
display: block;
|
|
19
|
+
border: 1px solid var(--bms-grey-10);
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tenantsMenu-tenants-item" @click="emits('changeTenant')">
|
|
3
|
+
<div
|
|
4
|
+
class="tenantsMenu-tenants-item-label"
|
|
5
|
+
:data-testid="`item-${tenant.id}`"
|
|
6
|
+
>
|
|
7
|
+
<Clock :size="12" v-if="tenant.isFavorite" />
|
|
8
|
+
<UiTenantImage :tenant="tenant" />
|
|
9
|
+
{{ tenant.label }}<em>- {{ tenant.information }}</em>
|
|
10
|
+
</div>
|
|
11
|
+
<BmsIconButton
|
|
12
|
+
class="remove-tenant-button"
|
|
13
|
+
v-if="tenant.isFavorite"
|
|
14
|
+
@click.stop="emits('removeFavorite')"
|
|
15
|
+
>
|
|
16
|
+
<X />
|
|
17
|
+
</BmsIconButton>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { Clock, X } from 'lucide-vue-next';
|
|
23
|
+
import { Tenant } from '@/models';
|
|
24
|
+
import BmsIconButton from '../button/BmsIconButton.vue';
|
|
25
|
+
import UiTenantImage from './UiTenantImage.vue';
|
|
26
|
+
|
|
27
|
+
defineProps<{
|
|
28
|
+
tenant: Tenant;
|
|
29
|
+
}>();
|
|
30
|
+
|
|
31
|
+
const emits = defineEmits<{
|
|
32
|
+
removeFavorite: [];
|
|
33
|
+
changeTenant: [];
|
|
34
|
+
}>();
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style scoped lang="scss">
|
|
38
|
+
.tenantsMenu-tenants-item {
|
|
39
|
+
min-height: 40px;
|
|
40
|
+
padding: 4px 16px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 4px;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background: var(--bms-grey-10);
|
|
50
|
+
|
|
51
|
+
:deep(.remove-tenant-button) {
|
|
52
|
+
display: inherit;
|
|
53
|
+
&:hover {
|
|
54
|
+
background-color: var(--bms-grey-25);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-label {
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 0.2em;
|
|
66
|
+
|
|
67
|
+
em {
|
|
68
|
+
opacity: 0.48;
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
font-style: normal;
|
|
71
|
+
margin-left: 0.4em;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:deep(svg) {
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.site-logo {
|
|
80
|
+
width: 1em;
|
|
81
|
+
height: 1em;
|
|
82
|
+
}
|
|
83
|
+
:deep(.remove-tenant-button) {
|
|
84
|
+
padding: 0;
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ui-button.is-icon.is-compact {
|
|
89
|
+
min-height: auto;
|
|
90
|
+
min-width: auto;
|
|
91
|
+
width: auto;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import UiTenantSwitcher from '@/components/navigation/UiTenantSwitcher.vue';
|
|
4
|
+
import { field } from '@/plugins/field';
|
|
5
|
+
|
|
6
|
+
const intersectionObserverMock = () => ({
|
|
7
|
+
observe: () => null,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const UiTenantSwitcherFactory = (props: any) => {
|
|
11
|
+
const wrapper = mount(UiTenantSwitcher, {
|
|
12
|
+
global: {
|
|
13
|
+
plugins: [field],
|
|
14
|
+
stubs: {
|
|
15
|
+
Teleport: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
...props,
|
|
20
|
+
to: 'div#App',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
wrapper,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
describe('UiTenantSwitcherFactory', () => {
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
vi.resetAllMocks();
|
|
32
|
+
window.IntersectionObserver = vi
|
|
33
|
+
.fn()
|
|
34
|
+
.mockImplementation(intersectionObserverMock);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('filteredTenants', () => {
|
|
38
|
+
it('should retrieve tenants based on tenant id', () => {
|
|
39
|
+
const { wrapper } = UiTenantSwitcherFactory({
|
|
40
|
+
visible: true,
|
|
41
|
+
tenants: [
|
|
42
|
+
{
|
|
43
|
+
information: 'blue team',
|
|
44
|
+
label: 'First tenant',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
information: 'red team',
|
|
48
|
+
label: 'Second tenant',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
(wrapper.vm as any).search = 'blue';
|
|
53
|
+
expect((wrapper.vm as any).filteredTenants).toEqual([
|
|
54
|
+
{
|
|
55
|
+
information: 'blue team',
|
|
56
|
+
label: 'First tenant',
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
});
|
|
60
|
+
it('should retrieve tenants based on tenant label', () => {
|
|
61
|
+
const { wrapper } = UiTenantSwitcherFactory({
|
|
62
|
+
visible: true,
|
|
63
|
+
tenants: [
|
|
64
|
+
{
|
|
65
|
+
information: 'blue team',
|
|
66
|
+
label: 'First tenant',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
information: 'red team',
|
|
70
|
+
label: 'Second tenant',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
});
|
|
74
|
+
(wrapper.vm as any).search = 'Sec';
|
|
75
|
+
expect((wrapper.vm as any).filteredTenants).toEqual([
|
|
76
|
+
{
|
|
77
|
+
information: 'red team',
|
|
78
|
+
label: 'Second tenant',
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('remove favourite tenant', () => {
|
|
85
|
+
it('should emit remove event when click on close icon', () => {
|
|
86
|
+
const { wrapper } = UiTenantSwitcherFactory({
|
|
87
|
+
visible: true,
|
|
88
|
+
tenants: [
|
|
89
|
+
{
|
|
90
|
+
information: 'blue team',
|
|
91
|
+
label: 'First tenant',
|
|
92
|
+
isFavorite: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
information: 'red team',
|
|
96
|
+
label: 'Second tenant',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
const items = wrapper.findAll('.tenantsMenu-tenants-item');
|
|
101
|
+
items[0].find('.remove-tenant-button').trigger('click');
|
|
102
|
+
expect((wrapper as any).emitted()['removeFavoriteTenant'][0][0]).toEqual({
|
|
103
|
+
information: 'blue team',
|
|
104
|
+
label: 'First tenant',
|
|
105
|
+
isFavorite: true,
|
|
106
|
+
});
|
|
107
|
+
expect(wrapper.emitted()['changeTenant']).toEqual(undefined);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe('change tenant', () => {
|
|
112
|
+
it('should emit changeTenant event when click on tenant', () => {
|
|
113
|
+
const { wrapper } = UiTenantSwitcherFactory({
|
|
114
|
+
visible: true,
|
|
115
|
+
tenants: [
|
|
116
|
+
{
|
|
117
|
+
information: 'blue team',
|
|
118
|
+
label: 'First tenant',
|
|
119
|
+
isFavorite: true,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
information: 'red team',
|
|
123
|
+
label: 'Second tenant',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
});
|
|
127
|
+
const items = wrapper.findAll('.tenantsMenu-tenants-item');
|
|
128
|
+
items[1].trigger('click');
|
|
129
|
+
expect(wrapper.emitted()['removeFavoriTetenant']).toEqual(undefined);
|
|
130
|
+
expect((wrapper as any).emitted()['changeTenant'][0][0]).toEqual({
|
|
131
|
+
information: 'red team',
|
|
132
|
+
label: 'Second tenant',
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('keypress', () => {
|
|
138
|
+
it('should select first entry when pressing enter', () => {
|
|
139
|
+
const { wrapper } = UiTenantSwitcherFactory({
|
|
140
|
+
visible: true,
|
|
141
|
+
tenants: [
|
|
142
|
+
{
|
|
143
|
+
information: 'blue team',
|
|
144
|
+
label: 'First tenant',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
information: 'red team',
|
|
148
|
+
label: 'Second tenant',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
});
|
|
152
|
+
(wrapper.vm as any).onEnterKeyPress();
|
|
153
|
+
expect((wrapper as any).emitted()['changeTenant'][0][0]).toEqual({
|
|
154
|
+
information: 'blue team',
|
|
155
|
+
label: 'First tenant',
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
it('should not do anything when pressing enter if no tenants', () => {
|
|
159
|
+
const { wrapper } = UiTenantSwitcherFactory({
|
|
160
|
+
visible: true,
|
|
161
|
+
tenants: [],
|
|
162
|
+
});
|
|
163
|
+
(wrapper.vm as any).onEnterKeyPress();
|
|
164
|
+
expect(wrapper.emitted()['changeTenant']).toBeFalsy();
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import UiTenantSwitcher from './UiTenantSwitcher.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Composants/navigation/UiTenantSwitcher',
|
|
5
|
+
component: UiTenantSwitcher,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => ({
|
|
9
|
+
components: {
|
|
10
|
+
UiTenantSwitcher,
|
|
11
|
+
},
|
|
12
|
+
setup() {
|
|
13
|
+
return { args };
|
|
14
|
+
},
|
|
15
|
+
template: `
|
|
16
|
+
<UiTenantSwitcher v-bind="args"/>
|
|
17
|
+
`,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const Default = Template.bind({});
|
|
21
|
+
|
|
22
|
+
Default.args = {
|
|
23
|
+
visible: true,
|
|
24
|
+
to: 'div#anchor',
|
|
25
|
+
selectTenantPlaceholder: 'placeholder',
|
|
26
|
+
tenants: [
|
|
27
|
+
{
|
|
28
|
+
id: 'siteId',
|
|
29
|
+
information: 'ouest-france',
|
|
30
|
+
label: 'Ouest France',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const WithFavoritesSites = Template.bind({});
|
|
36
|
+
|
|
37
|
+
WithFavoritesSites.args = {
|
|
38
|
+
visible: true,
|
|
39
|
+
to: 'div#anchor',
|
|
40
|
+
selectTenantPlaceholder: 'placeholder',
|
|
41
|
+
tenants: [
|
|
42
|
+
{
|
|
43
|
+
id: 'siteId1',
|
|
44
|
+
information: 'siteinformation1',
|
|
45
|
+
label: 'Mon Site 1 with a super long that should overflow',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'siteId2',
|
|
49
|
+
information: 'siteinformation2',
|
|
50
|
+
label: 'Mon Site 2',
|
|
51
|
+
isFavorite: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'siteId3',
|
|
55
|
+
information: 'siteinformation3',
|
|
56
|
+
label: 'Mon Site 3',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'siteId4',
|
|
60
|
+
information: 'siteinformation4',
|
|
61
|
+
label: 'Mon Site 4',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'siteId5',
|
|
65
|
+
information: 'siteinformation5',
|
|
66
|
+
label: 'Mon Site 5',
|
|
67
|
+
isFavorite: true,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|