@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,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<field
|
|
3
|
+
:label="label"
|
|
4
|
+
:errors="errors"
|
|
5
|
+
:captions="captions"
|
|
6
|
+
:required="required"
|
|
7
|
+
:optional="optional"
|
|
8
|
+
:helperText="helperText"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
>
|
|
11
|
+
<span class="input-radio-group-caption-wrapper" :class="align">
|
|
12
|
+
<slot>
|
|
13
|
+
<BmsInputRadioCaption
|
|
14
|
+
v-for="option in options"
|
|
15
|
+
:key="option.value"
|
|
16
|
+
v-model="inputValue"
|
|
17
|
+
:value="option.value"
|
|
18
|
+
:name="name"
|
|
19
|
+
:label="option.label || option.value"
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:required="required"
|
|
22
|
+
:captions="option.captions"
|
|
23
|
+
/>
|
|
24
|
+
</slot>
|
|
25
|
+
</span>
|
|
26
|
+
</field>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import { Ref, computed, ref } from 'vue';
|
|
31
|
+
import BmsInputRadioCaption from './BmsInputRadioCaption.vue';
|
|
32
|
+
import { v4 as uuid } from 'uuid';
|
|
33
|
+
import { BmsInputRadioCaptionGroupOption } from '@/models';
|
|
34
|
+
import { Caption } from '@/models/caption.model';
|
|
35
|
+
|
|
36
|
+
export interface Props {
|
|
37
|
+
options?: BmsInputRadioCaptionGroupOption[];
|
|
38
|
+
modelValue: any;
|
|
39
|
+
label?: string;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
optional?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
helperText?: string;
|
|
44
|
+
captions?: string[] | Caption[];
|
|
45
|
+
errors?: string[] | Caption[];
|
|
46
|
+
align?: 'row' | 'column';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
50
|
+
options: () => [],
|
|
51
|
+
align: 'row',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const name: Ref<string> = ref<string>('radio-group-caption-' + uuid());
|
|
55
|
+
|
|
56
|
+
const $emits = defineEmits<{
|
|
57
|
+
(e: 'update:modelValue', value: any): void;
|
|
58
|
+
}>();
|
|
59
|
+
|
|
60
|
+
const inputValue = computed({
|
|
61
|
+
get() {
|
|
62
|
+
return props.modelValue;
|
|
63
|
+
},
|
|
64
|
+
set(val: any) {
|
|
65
|
+
$emits('update:modelValue', val);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
.input-radio-group-caption-wrapper {
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 1em;
|
|
74
|
+
margin: 0.5em 0;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
|
|
77
|
+
&.column {
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import BmsInputRadioGroup from '@/components/form/BmsInputRadioGroup.vue';
|
|
2
|
+
import BmsInputRadio from '@/components/form/BmsInputRadio.vue';
|
|
3
|
+
import { StatusType } from '@/models/status-type.model';
|
|
4
|
+
|
|
5
|
+
import template from '@/documentation/template_field_dependency.mdx';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
page: template,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
title: 'Composants/form/InputRadioGroup',
|
|
14
|
+
component: BmsInputRadioGroup,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const Template = (args) => ({
|
|
18
|
+
setup() {
|
|
19
|
+
return { args };
|
|
20
|
+
},
|
|
21
|
+
components: {
|
|
22
|
+
BmsInputRadioGroup,
|
|
23
|
+
BmsInputRadio,
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<BmsInputRadioGroup v-bind="args">
|
|
27
|
+
<template v-if="args.slot" #default>
|
|
28
|
+
<BmsInputRadio :modelValue='args.modelValue' value='toto' name='sameName'>
|
|
29
|
+
<template #label><span>toto</span></template>
|
|
30
|
+
</BmsInputRadio>
|
|
31
|
+
<BmsInputRadio :modelValue='args.modelValue' value='titi' name='sameName'>
|
|
32
|
+
<template #label><span>titi</span></template>
|
|
33
|
+
</BmsInputRadio>
|
|
34
|
+
</template>
|
|
35
|
+
</BmsInputRadioGroup>
|
|
36
|
+
`,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const DefaultRow = Template.bind({});
|
|
40
|
+
DefaultRow.args = {
|
|
41
|
+
values: [
|
|
42
|
+
{ value: 'tata', label: 'Tata' },
|
|
43
|
+
{ value: 'titi', label: 'Titi' },
|
|
44
|
+
{ value: 'toto', label: 'Toto' },
|
|
45
|
+
{ value: 'tutu', label: 'Tutu' },
|
|
46
|
+
],
|
|
47
|
+
modelValue: '',
|
|
48
|
+
label: 'This is a field label',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const DefaultColumn = Template.bind({});
|
|
52
|
+
DefaultColumn.args = {
|
|
53
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
54
|
+
modelValue: '',
|
|
55
|
+
label: 'This is a field label',
|
|
56
|
+
align: 'column',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const DefaultSelected = Template.bind({});
|
|
60
|
+
DefaultSelected.args = {
|
|
61
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
62
|
+
modelValue: 'toto',
|
|
63
|
+
label: 'This is a field label',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const FullHelp = Template.bind({});
|
|
67
|
+
FullHelp.args = {
|
|
68
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
69
|
+
modelValue: 'toto',
|
|
70
|
+
label: 'This is a field label',
|
|
71
|
+
helperText: 'this is a help',
|
|
72
|
+
captions: [
|
|
73
|
+
{ label: 'Group Caption 1', mode: StatusType.Success },
|
|
74
|
+
'Group Caption 2',
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Disabled = Template.bind({});
|
|
79
|
+
Disabled.args = {
|
|
80
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
81
|
+
modelValue: 'toto',
|
|
82
|
+
label: 'This is a field label',
|
|
83
|
+
disabled: true,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Required = Template.bind({});
|
|
87
|
+
Required.args = {
|
|
88
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
89
|
+
modelValue: 'toto',
|
|
90
|
+
label: 'This is a field label',
|
|
91
|
+
required: true,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const Errors = Template.bind({});
|
|
95
|
+
Errors.args = {
|
|
96
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
97
|
+
modelValue: 'toto',
|
|
98
|
+
label: 'This is a field label',
|
|
99
|
+
errors: ['Error 1', 'Error 2'],
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Slot = Template.bind({});
|
|
103
|
+
Slot.args = {
|
|
104
|
+
values: ['tata', 'titi', 'toto', 'tutu'],
|
|
105
|
+
modelValue: 'toto',
|
|
106
|
+
label: 'This is a field label',
|
|
107
|
+
slot: true,
|
|
108
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<field
|
|
3
|
+
:label="label"
|
|
4
|
+
:errors="errors"
|
|
5
|
+
:captions="captions"
|
|
6
|
+
:required="required"
|
|
7
|
+
:optional="optional"
|
|
8
|
+
:helperText="helperText"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
>
|
|
11
|
+
<span class="input-radio-group-wrapper" :class="align">
|
|
12
|
+
<slot>
|
|
13
|
+
<BmsInputRadio
|
|
14
|
+
v-for="option in computedValues"
|
|
15
|
+
:key="option.value"
|
|
16
|
+
v-model="inputValue"
|
|
17
|
+
:value="option.value"
|
|
18
|
+
:name="name"
|
|
19
|
+
:label="option.label || option.value"
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:required="required"
|
|
22
|
+
:errors="errors"
|
|
23
|
+
/>
|
|
24
|
+
</slot>
|
|
25
|
+
</span>
|
|
26
|
+
</field>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import { computed, ComputedRef, ref, Ref } from 'vue';
|
|
31
|
+
import BmsInputRadio from './BmsInputRadio.vue';
|
|
32
|
+
import { v4 as uuid } from 'uuid';
|
|
33
|
+
import { BmsInputRadioGroupOption } from '@/models';
|
|
34
|
+
import { Caption } from '@/models/caption.model';
|
|
35
|
+
|
|
36
|
+
export interface Props {
|
|
37
|
+
values?: string[] | BmsInputRadioGroupOption[];
|
|
38
|
+
modelValue: any;
|
|
39
|
+
label?: string;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
optional?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
helperText?: string;
|
|
44
|
+
captions?: string[] | Caption[];
|
|
45
|
+
errors?: string[] | Caption[];
|
|
46
|
+
align?: 'row' | 'column';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
50
|
+
values: () => [],
|
|
51
|
+
align: 'row',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const name: Ref<string> = ref<string>('radio-group-' + uuid());
|
|
55
|
+
|
|
56
|
+
const $emits = defineEmits<{
|
|
57
|
+
(e: 'update:modelValue', value: any): void;
|
|
58
|
+
}>();
|
|
59
|
+
|
|
60
|
+
const inputValue = computed({
|
|
61
|
+
get() {
|
|
62
|
+
return props.modelValue;
|
|
63
|
+
},
|
|
64
|
+
set(val: any) {
|
|
65
|
+
$emits('update:modelValue', val);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const computedValues: ComputedRef<BmsInputRadioGroupOption[]> = computed(() => {
|
|
70
|
+
return props.values.map((curValue) => {
|
|
71
|
+
if (typeof curValue === 'string') {
|
|
72
|
+
return {
|
|
73
|
+
value: curValue,
|
|
74
|
+
label: curValue,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return curValue;
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="scss" scoped>
|
|
83
|
+
.input-radio-group-wrapper {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: 1em;
|
|
86
|
+
margin: 0.5em 0;
|
|
87
|
+
flex-direction: row;
|
|
88
|
+
|
|
89
|
+
&.column {
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { field } from '@/plugins/field';
|
|
2
|
+
import BmsInputText, { Props } from './BmsInputText.vue';
|
|
3
|
+
import { mount } from '@vue/test-utils';
|
|
4
|
+
import { nextTick } from 'vue';
|
|
5
|
+
|
|
6
|
+
const factory = (props: Props) => {
|
|
7
|
+
const wrapper = mount(BmsInputText, { props, global: { plugins: [field] } });
|
|
8
|
+
const inputElement = wrapper.get('input');
|
|
9
|
+
|
|
10
|
+
return { wrapper, inputElement };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('BmsInputText', () => {
|
|
14
|
+
it('should display correct value on init', () => {
|
|
15
|
+
const { inputElement } = factory({ modelValue: 'toto' });
|
|
16
|
+
|
|
17
|
+
expect(inputElement.element.value).toStrictEqual('toto');
|
|
18
|
+
});
|
|
19
|
+
it('should react correctly on input', async () => {
|
|
20
|
+
const { wrapper, inputElement } = factory({ modelValue: 'toto' });
|
|
21
|
+
|
|
22
|
+
inputElement.setValue('titi');
|
|
23
|
+
await nextTick();
|
|
24
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toStrictEqual(['titi']);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should not update if disabled', async () => {
|
|
28
|
+
const { wrapper, inputElement } = factory({
|
|
29
|
+
modelValue: 'toto',
|
|
30
|
+
disabled: true,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
inputElement.setValue('titi');
|
|
34
|
+
await nextTick();
|
|
35
|
+
expect(wrapper.emitted()['update:modelValue']).toBeUndefined();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import BmsInputText from '@/components/form/BmsInputText.vue';
|
|
2
|
+
import { within } from 'storybook/test';
|
|
3
|
+
import { BookOpen, CloudLightning } from 'lucide-vue-next';
|
|
4
|
+
import template from '@/documentation/template_field_dependency.mdx';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Composants/form/InputText',
|
|
8
|
+
component: BmsInputText,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
page: template,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Template = (args) => ({
|
|
17
|
+
setup() {
|
|
18
|
+
return { args };
|
|
19
|
+
},
|
|
20
|
+
components: {
|
|
21
|
+
BmsInputText,
|
|
22
|
+
BookOpen,
|
|
23
|
+
CloudLightning,
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<BmsInputText v-bind="args">
|
|
27
|
+
<template v-if="args.iconStart" #icon-start><BookOpen/></template>
|
|
28
|
+
<template v-if="args.iconEnd" #icon-end><CloudLightning/></template>
|
|
29
|
+
</BmsInputText>
|
|
30
|
+
`,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const Default = Template.bind({});
|
|
34
|
+
Default.args = {
|
|
35
|
+
label: 'My label',
|
|
36
|
+
placeholder: 'Placeholder',
|
|
37
|
+
captions: ['There is more information'],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const WithValue = Template.bind({});
|
|
41
|
+
WithValue.args = {
|
|
42
|
+
label: 'My label',
|
|
43
|
+
modelValue: 'Une valeur',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Disabled = Template.bind({});
|
|
47
|
+
Disabled.args = {
|
|
48
|
+
label: 'My label',
|
|
49
|
+
modelValue: 'Une valeur',
|
|
50
|
+
disabled: true,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const WithIcons = Template.bind({});
|
|
54
|
+
WithIcons.args = {
|
|
55
|
+
label: 'My label',
|
|
56
|
+
modelValue: 'Une valeur',
|
|
57
|
+
iconStart: true,
|
|
58
|
+
iconEnd: true,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const WithErrors = Template.bind({});
|
|
62
|
+
WithErrors.args = {
|
|
63
|
+
label: 'My label',
|
|
64
|
+
modelValue: 'Une valeur',
|
|
65
|
+
errors: ['Error 1', 'Error 2'],
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const WithFocusState = {
|
|
69
|
+
args: {
|
|
70
|
+
modelValue: '',
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
play: async ({ canvasElement }) => {
|
|
74
|
+
const canvas = within(canvasElement);
|
|
75
|
+
await canvas.getByRole('input').click();
|
|
76
|
+
await canvas.getByRole('input').focus();
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<field
|
|
3
|
+
:label="label"
|
|
4
|
+
:errors="errors"
|
|
5
|
+
:captions="captions"
|
|
6
|
+
:required="required"
|
|
7
|
+
:optional="optional"
|
|
8
|
+
:helperText="helperText"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
>
|
|
11
|
+
<RawInputText
|
|
12
|
+
ref="input"
|
|
13
|
+
:type="inputType"
|
|
14
|
+
:modelValue="modelValue"
|
|
15
|
+
:required="required"
|
|
16
|
+
:placeholder="placeholder"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
:errors="errors"
|
|
19
|
+
:hasDate="false"
|
|
20
|
+
@input="onInput"
|
|
21
|
+
@keyup="onInput"
|
|
22
|
+
>
|
|
23
|
+
<template #icon-start><slot name="icon-start"></slot></template>
|
|
24
|
+
<template #icon-end><slot name="icon-end"></slot></template>
|
|
25
|
+
</RawInputText>
|
|
26
|
+
</field>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import { Ref, ref } from 'vue';
|
|
31
|
+
import { Caption } from '@/models/caption.model';
|
|
32
|
+
import RawInputText from '@/components/form/RawInputText.vue';
|
|
33
|
+
import { InputType } from '@/models';
|
|
34
|
+
|
|
35
|
+
export interface Props {
|
|
36
|
+
inputType?:
|
|
37
|
+
| InputType.TEXT
|
|
38
|
+
| InputType.NUMBER
|
|
39
|
+
| InputType.DATE
|
|
40
|
+
| InputType.DATETIME;
|
|
41
|
+
modelValue: string | number;
|
|
42
|
+
label?: string;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
optional?: boolean;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
helperText?: string;
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
captions?: string[] | Caption[];
|
|
49
|
+
errors?: string[] | Caption[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
53
|
+
inputType: InputType.TEXT,
|
|
54
|
+
label: '',
|
|
55
|
+
required: false,
|
|
56
|
+
disabled: false,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const input: Ref<HTMLElement | null> = ref(null);
|
|
60
|
+
|
|
61
|
+
const $emits = defineEmits<{
|
|
62
|
+
(e: 'update:modelValue', value: string): void;
|
|
63
|
+
}>();
|
|
64
|
+
|
|
65
|
+
const setFocus = () => {
|
|
66
|
+
if (input.value) {
|
|
67
|
+
(input.value as any).setFocus();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
defineExpose({
|
|
72
|
+
setFocus,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const onInput = (e: Event) => {
|
|
76
|
+
if (!props.disabled)
|
|
77
|
+
$emits('update:modelValue', (e?.target as HTMLInputElement).value);
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import BmsInputToggle from '@/components/form/BmsInputToggle.vue';
|
|
2
|
+
import { ref } from 'vue';
|
|
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/BmsInputToggle',
|
|
13
|
+
component: BmsInputToggle,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Template = (args) => ({
|
|
17
|
+
setup() {
|
|
18
|
+
const curentValue = ref(args.modelValue);
|
|
19
|
+
return { args, curentValue };
|
|
20
|
+
},
|
|
21
|
+
components: {
|
|
22
|
+
BmsInputToggle,
|
|
23
|
+
},
|
|
24
|
+
template: `
|
|
25
|
+
<BmsInputToggle v-bind="{...args}" v-model="curentValue"/>
|
|
26
|
+
Valeur de mon toggle : {{ curentValue }}
|
|
27
|
+
`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = { label: 'without value', name: 'my-input' };
|
|
32
|
+
|
|
33
|
+
export const On = Template.bind({});
|
|
34
|
+
On.args = { label: 'Label', modelValue: true, name: 'my-input' };
|
|
35
|
+
|
|
36
|
+
export const Off = Template.bind({});
|
|
37
|
+
Off.args = { label: 'Label', modelValue: false, name: 'my-input' };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<field :disabled="disabled">
|
|
3
|
+
<label class="input-toggle" :class="{ isOn: modelValue, disabled }">
|
|
4
|
+
<span class="input-switch-info">{{ label }}</span>
|
|
5
|
+
<UiBmsSwitch
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:name="name"
|
|
9
|
+
@update:modelValue="
|
|
10
|
+
(value: boolean) => $emit('update:modelValue', value)
|
|
11
|
+
"
|
|
12
|
+
/>
|
|
13
|
+
</label>
|
|
14
|
+
</field>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import UiBmsSwitch from '@/components/form/UiBmsSwitch.vue';
|
|
19
|
+
|
|
20
|
+
withDefaults(
|
|
21
|
+
defineProps<{
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
name: string;
|
|
24
|
+
modelValue: boolean;
|
|
25
|
+
label: string;
|
|
26
|
+
}>(),
|
|
27
|
+
{
|
|
28
|
+
disabled: false,
|
|
29
|
+
modelValue: false,
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const $emits = defineEmits<{
|
|
34
|
+
(e: 'update:modelValue', value: any): void;
|
|
35
|
+
}>();
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss" scoped>
|
|
39
|
+
.input-toggle {
|
|
40
|
+
--label-color: var(--bms-grey-100);
|
|
41
|
+
--cursor: pointer;
|
|
42
|
+
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 0.5em;
|
|
47
|
+
|
|
48
|
+
.input-switch-info {
|
|
49
|
+
color: var(--label-color);
|
|
50
|
+
transition: 0.2s;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.isOn {
|
|
54
|
+
--label-color: var(--bms-main-100);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.disabled {
|
|
58
|
+
--label-color: var(--bms-grey-50);
|
|
59
|
+
--cursor: default;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
cursor: var(--cursor);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { field } from '@/plugins/field';
|
|
2
|
+
import BmsSearch, { Props } from './BmsSearch.vue';
|
|
3
|
+
import { mount } from '@vue/test-utils';
|
|
4
|
+
import { nextTick } from 'vue';
|
|
5
|
+
|
|
6
|
+
const factory = (props: Props) => {
|
|
7
|
+
const wrapper = mount(BmsSearch, { props, global: { plugins: [field] } });
|
|
8
|
+
const inputElement = wrapper.get('input');
|
|
9
|
+
|
|
10
|
+
return { wrapper, inputElement };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('BmsSearch', () => {
|
|
14
|
+
it('should display correct value on init', () => {
|
|
15
|
+
const { inputElement } = factory({
|
|
16
|
+
modelValue: 'toto',
|
|
17
|
+
placeholder: 'placeholderrr',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
expect(inputElement.element.value).toStrictEqual('toto');
|
|
21
|
+
expect(inputElement.element.placeholder).toStrictEqual('placeholderrr');
|
|
22
|
+
});
|
|
23
|
+
it('should react correctly on input', async () => {
|
|
24
|
+
const { wrapper, inputElement } = factory({ modelValue: 'toto' });
|
|
25
|
+
|
|
26
|
+
inputElement.setValue('titi');
|
|
27
|
+
await nextTick();
|
|
28
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toStrictEqual(['titi']);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should not update if disabled', async () => {
|
|
32
|
+
const { wrapper, inputElement } = factory({
|
|
33
|
+
modelValue: 'toto',
|
|
34
|
+
disabled: true,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
inputElement.setValue('titi');
|
|
38
|
+
await nextTick();
|
|
39
|
+
expect(wrapper.emitted()['update:modelValue']).toBeUndefined();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import BmsSearch from '@/components/form/BmsSearch.vue';
|
|
2
|
+
import { within } from 'storybook/test';
|
|
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/Search',
|
|
13
|
+
component: BmsSearch,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Template = (args) => ({
|
|
17
|
+
setup() {
|
|
18
|
+
return { args };
|
|
19
|
+
},
|
|
20
|
+
components: {
|
|
21
|
+
BmsSearch,
|
|
22
|
+
},
|
|
23
|
+
template: `
|
|
24
|
+
<BmsSearch v-bind="args"/>
|
|
25
|
+
`,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const Default = Template.bind({});
|
|
29
|
+
Default.args = {
|
|
30
|
+
placeholder: 'Placeholder',
|
|
31
|
+
captions: ['There is more information'],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const WithValue = Template.bind({});
|
|
35
|
+
WithValue.args = {
|
|
36
|
+
modelValue: 'Une valeur',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Disabled = Template.bind({});
|
|
40
|
+
Disabled.args = {
|
|
41
|
+
modelValue: 'Une valeur',
|
|
42
|
+
disabled: true,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const CustomPlaceholder = Template.bind({});
|
|
46
|
+
CustomPlaceholder.args = {
|
|
47
|
+
placeholder: 'Type here !!!!!',
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Captions = Template.bind({});
|
|
51
|
+
Captions.args = {
|
|
52
|
+
captions: ['Very good info', 'Yes yes'],
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Errors = Template.bind({});
|
|
56
|
+
Errors.args = {
|
|
57
|
+
errors: ['Very bad errors', 'No no'],
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const WithFocusState = {
|
|
61
|
+
args: {
|
|
62
|
+
modelValue: '',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
play: async ({ canvasElement }) => {
|
|
66
|
+
const canvas = within(canvasElement);
|
|
67
|
+
await canvas.getByRole('input').click();
|
|
68
|
+
await canvas.getByRole('input').focus();
|
|
69
|
+
},
|
|
70
|
+
};
|