@webitel/ui-sdk 0.1.3-vue3 → 0.1.4-vite
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 +1 -1
- package/dist/img/sprite/arrow-mix.svg +5 -0
- package/dist/img/sprite/azure.svg +19 -0
- package/dist/img/sprite/email.svg +3 -0
- package/dist/img/sprite/index.js +1 -1
- package/dist/img/sprite/meta.svg +17 -0
- package/dist/img/sprite/options.svg +5 -0
- package/dist/img/sprite/role.svg +3 -0
- package/dist/img/sprite/scorecard.svg +4 -0
- package/dist/img/sprite/user.svg +3 -0
- package/dist/ui-sdk.common.js +36397 -11631
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +36402 -11636
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +27 -4
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +24 -8
- package/src/api/axios/generateInstance.js +25 -0
- package/src/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.js +6 -0
- package/src/api/defaults/getDefaultGetParams/getDefaultGetParams.js +9 -0
- package/src/api/defaults/index.js +7 -0
- package/src/api/interceptors/request/updateToken.interceptor.js +10 -0
- package/src/api/interceptors/response/handleUnauthorized.interceptor.js +12 -0
- package/src/api/transformers/applyTransform.js +8 -0
- package/src/api/transformers/camelToSnake/camelToSnake.transformer.js +4 -0
- package/src/api/transformers/generateUrl/generateUrl.transformer.js +13 -0
- package/src/api/transformers/index.js +23 -0
- package/src/api/transformers/log/log.transformer.js +6 -0
- package/src/api/transformers/merge/merge.transformer.js +5 -0
- package/src/api/transformers/mergeEach/mergeEach.transformer.js +8 -0
- package/src/api/transformers/notify/notify.transformer.js +32 -0
- package/src/api/transformers/sanitize/sanitize.transformer.js +12 -0
- package/src/api/transformers/snakeToCamel/snakeToCamel.transformer.js +4 -0
- package/src/api/transformers/starToSearch/starToSearch.transformer.js +12 -0
- package/src/components/index.js +63 -55
- package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +25 -0
- package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +48 -0
- package/src/components/transitions/wt-expand-transition.vue +41 -39
- package/src/components/{organisms/wt-app-header → wt-app-header}/__tests__/WtAppNavigator.spec.js +2 -2
- package/src/components/{organisms/wt-app-header → wt-app-header}/__tests__/WtHeaderActions.spec.js +1 -1
- package/src/{css/components/organisms → components}/wt-app-header/_variables.scss +3 -2
- package/src/components/wt-app-header/wt-app-header.vue +29 -0
- package/src/components/{organisms/wt-app-header → wt-app-header}/wt-app-navigator.vue +69 -40
- package/src/components/wt-avatar/_variables.scss +32 -0
- package/src/components/wt-avatar/wt-avatar.vue +187 -0
- package/src/components/{atoms/wt-badge → wt-badge}/wt-badge.vue +20 -13
- package/src/components/wt-button/Readme.md +23 -0
- package/src/components/{atoms/wt-button → wt-button}/__tests__/WtButton.spec.js +1 -1
- package/src/components/wt-button/_variables.scss +41 -0
- package/src/components/wt-button/wt-button.vue +205 -0
- package/src/components/wt-button-select/Readme.md +13 -0
- package/src/components/{molecules/wt-button-select → wt-button-select}/__tests__/WtButtonSelect.spec.js +16 -5
- package/src/components/wt-button-select/_variables.scss +7 -0
- package/src/components/wt-button-select/wt-button-select.vue +130 -0
- package/src/components/{molecules/wt-checkbox → wt-checkbox}/__tests__/WtCheckbox.spec.js +6 -6
- package/src/components/wt-checkbox/wt-checkbox.vue +191 -0
- package/src/{css/components/atoms → components}/wt-chip/wt-chip.scss +1 -1
- package/src/components/wt-chip/wt-chip.vue +24 -0
- package/src/components/{atoms/wt-context-menu → wt-context-menu}/__tests__/WtContextMenu.spec.js +1 -1
- package/src/{css/components/atoms → components}/wt-context-menu/_variables.scss +2 -0
- package/src/components/{atoms/wt-context-menu → wt-context-menu}/wt-context-menu.vue +68 -42
- package/src/components/{molecules/wt-datepicker → wt-datepicker}/__tests__/WtDatepicker.spec.js +4 -4
- package/src/components/wt-datepicker/_variables.scss +56 -0
- package/src/components/wt-datepicker/wt-datepicker.vue +240 -0
- package/src/components/wt-divider/wt-divider.vue +30 -0
- package/src/components/wt-dummy/__tests__/WtDummy.spec.js +9 -0
- package/src/components/wt-dummy/wt-dummy.vue +73 -0
- package/src/components/{organisms/wt-error-page → wt-error-page}/__tests__/wt-error-page.spec.js +3 -3
- package/src/components/{organisms/wt-error-page → wt-error-page}/wt-error-page.vue +2 -2
- package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +9 -0
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +67 -0
- package/src/components/{organisms/wt-filters-panel-wrapper → wt-filters-panel-wrapper}/wt-filters-panel-wrapper.vue +6 -6
- package/src/components/{organisms/wt-headline → wt-headline}/wt-headline.vue +5 -0
- package/src/components/wt-headline-nav/Readme.md +9 -0
- package/src/components/{organisms/wt-headline-nav → wt-headline-nav}/__tests__/wt-headline-nav.spec.js +1 -1
- package/src/components/wt-headline-nav/_variables.scss +8 -0
- package/src/components/{organisms/wt-headline-nav → wt-headline-nav}/wt-headline-nav.vue +41 -29
- package/src/components/{molecules/wt-hint → wt-hint}/wt-hint.vue +7 -1
- package/src/components/wt-icon/Readme.md +327 -0
- package/src/components/{atoms/wt-icon → wt-icon}/__tests__/WtIcon.spec.js +2 -2
- package/src/components/wt-icon/_variables.scss +31 -0
- package/src/components/wt-icon/docs/cleanup-svg-fill-none.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-fill.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-viewbox-correct.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-viewbox-incorrect.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-width-height.png +0 -0
- package/src/components/wt-icon/docs/svg-icon-code-example.png +0 -0
- package/src/components/wt-icon/docs/svg-sprite-in-dom.png +0 -0
- package/src/components/wt-icon/wt-icon.vue +172 -0
- package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtAddIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtDeleteIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtDownloadIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtEditIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtHistoryIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtRefreshIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/wt-add-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-delete-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-download-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-edit-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-history-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-refresh-icon-action.vue +27 -0
- package/src/components/wt-icon-action/wt-icon-action.vue +54 -0
- package/src/components/wt-icon-btn/Readme.md +10 -0
- package/src/components/{molecules/wt-icon-btn → wt-icon-btn}/__tests__/WtIconBtn.spec.js +2 -2
- package/src/components/wt-icon-btn/_variables.scss +9 -0
- package/src/components/wt-icon-btn/wt-icon-btn.vue +47 -0
- package/src/components/{atoms/wt-indicator → wt-indicator}/__tests__/WtIndicator.spec.js +2 -2
- package/src/{css/components/atoms → components}/wt-indicator/_variables.scss +3 -3
- package/src/components/{atoms/wt-indicator → wt-indicator}/wt-indicator.vue +5 -0
- package/src/components/{molecules/wt-input → wt-input}/__tests__/WtInput.spec.js +3 -3
- package/src/components/{molecules/wt-input → wt-input}/wt-input.vue +40 -20
- package/src/{css/components/atoms → components}/wt-input-info/_variables.scss +2 -2
- package/src/components/wt-input-info/wt-input-info.vue +40 -0
- package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +9 -0
- package/src/components/wt-item-link/wt-item-link.vue +57 -0
- package/src/components/{molecules/wt-label → wt-label}/wt-label.vue +5 -0
- package/src/components/{molecules/wt-load-bar → wt-load-bar}/wt-load-bar.vue +7 -2
- package/src/{css/components/atoms → components}/wt-loader/_variables.scss +2 -2
- package/src/components/{atoms/wt-loader → wt-loader}/wt-loader.vue +22 -17
- package/src/components/{organisms/wt-navigation-bar → wt-navigation-bar}/__tests__/WtNavigationBar.spec.js +22 -18
- package/src/components/{organisms/wt-navigation-bar → wt-navigation-bar}/wt-navigation-bar.vue +27 -16
- package/src/components/{molecules/wt-notification → wt-notification}/__tests__/WtNotification.spec.js +1 -1
- package/src/components/wt-notification/wt-notification.vue +86 -0
- package/src/components/{organisms/wt-notifications-bar → wt-notifications-bar}/__tests__/WtNotificationsBar.spec.js +6 -6
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +78 -0
- package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +9 -0
- package/src/components/wt-page-header/wt-page-header.vue +83 -0
- package/src/components/{organisms/wt-page-wrapper → wt-page-wrapper}/wt-page-wrapper.vue +6 -0
- package/src/components/{organisms/wt-pagination → wt-pagination}/__tests__/WtPagination.spec.js +2 -1
- package/src/components/{organisms/wt-pagination → wt-pagination}/wt-pagination.vue +7 -1
- package/src/{css/components/organisms → components}/wt-player/_variables.scss +1 -1
- package/src/components/{organisms/wt-player → wt-player}/wt-player.vue +10 -5
- package/src/components/{molecules/wt-popup → wt-popup}/wt-popup.vue +5 -0
- package/src/components/{molecules/wt-progress-bar → wt-progress-bar}/__tests__/WtProgressBar.spec.js +2 -2
- package/src/{css/components/molecules → components}/wt-progress-bar/_variables.scss +2 -2
- package/src/components/{molecules/wt-progress-bar → wt-progress-bar}/wt-progress-bar.vue +13 -3
- package/src/components/{molecules/wt-radio → wt-radio}/__tests__/WtRadio.spec.js +6 -6
- package/src/components/wt-radio/wt-radio.vue +180 -0
- package/src/components/wt-rounded-action/Readme.md +68 -0
- package/src/components/{atoms/wt-rounded-action → wt-rounded-action}/__tests__/WtRoundedAction.spec.js +1 -1
- package/src/components/wt-rounded-action/_variables.scss +14 -0
- package/src/components/wt-rounded-action/wt-rounded-action.vue +139 -0
- package/src/components/{molecules/wt-search-bar → wt-search-bar}/__tests__/WtSearchBar.spec.js +9 -0
- package/src/components/wt-search-bar/wt-search-bar.vue +222 -0
- package/src/components/{molecules/wt-select → wt-select}/__tests__/WtSelect.spec.js +3 -3
- package/src/components/{molecules/wt-select → wt-select}/mixins/__tests__/multiselectMixin.spec.js +4 -4
- package/src/components/{molecules/wt-select → wt-select}/mixins/multiselectMixin.js +9 -4
- package/src/components/{molecules/wt-select → wt-select}/wt-select.vue +23 -9
- package/src/components/{molecules/wt-slider → wt-slider}/wt-slider.vue +8 -3
- package/src/components/{organisms/wt-status-select → wt-status-select}/__tests__/WtStatusSelect.spec.js +1 -1
- package/src/components/{organisms/wt-status-select → wt-status-select}/_internals/StatusOptions.lookup.js +1 -1
- package/src/components/{organisms/wt-status-select → wt-status-select}/wt-status-select.vue +27 -23
- package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +18 -0
- package/src/components/wt-stepper/wt-stepper.vue +89 -0
- package/src/components/{molecules/wt-switcher → wt-switcher}/__tests__/WtSwitcher.spec.js +5 -5
- package/src/components/wt-switcher/wt-switcher.vue +191 -0
- package/src/components/{organisms/wt-table → wt-table}/__tests__/WtTable.spec.js +11 -11
- package/src/components/{organisms/wt-table → wt-table}/wt-table.vue +20 -3
- package/src/components/{organisms/wt-table-actions → wt-table-actions}/wt-table-actions.vue +5 -0
- package/src/components/{organisms/wt-table-column-select → wt-table-column-select}/__tests__/WtTableColumnSelect.spec.js +3 -3
- package/src/components/wt-table-column-select/wt-table-column-select.vue +178 -0
- package/src/components/{molecules/wt-tabs → wt-tabs}/__tests__/WtTabs.spec.js +3 -3
- package/src/{css/components/molecules → components}/wt-tabs/_variables.scss +1 -1
- package/src/components/{molecules/wt-tabs → wt-tabs}/wt-tabs.vue +9 -1
- package/src/components/{molecules/wt-tags-input → wt-tags-input}/__tests__/WtTagsInput.spec.js +7 -7
- package/src/components/{molecules/wt-tags-input → wt-tags-input}/wt-tags-input.vue +18 -7
- package/src/components/{molecules/wt-textarea → wt-textarea}/__tests__/WtTextarea.spec.js +4 -4
- package/src/components/wt-textarea/wt-textarea.vue +223 -0
- package/src/components/{molecules/wt-time-input → wt-time-input}/__tests__/WtTimeInput.spec.js +3 -3
- package/src/components/wt-time-input/wt-time-input.vue +187 -0
- package/src/components/{molecules/wt-timepicker → wt-timepicker}/__tests__/WtTimepicker.spec.js +13 -13
- package/src/components/{molecules/wt-timepicker → wt-timepicker}/wt-timepicker.vue +13 -5
- package/src/components/{atoms/wt-tooltip → wt-tooltip}/__tests__/WtTooltip.spec.js +1 -1
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +68 -0
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +48 -0
- package/src/components/wt-tooltip/_variables.scss +11 -0
- package/src/components/wt-tooltip/wt-tooltip.vue +150 -0
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +14 -0
- package/src/composables/useCachedInterval/useCachedInterval.js +21 -0
- package/src/composables/useDestroyableSortable/useDestroyableSortable.js +66 -0
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +83 -0
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +37 -0
- package/src/css/main.scss +0 -3
- package/src/css/styleguide/colors/_colors.scss +177 -147
- package/src/css/styleguide/colors/_deprecated.scss +151 -0
- package/src/css/styleguide/colors/_palette.scss +358 -0
- package/src/directives/clickaway/clickaway.js +3 -0
- package/src/directives/index.js +7 -0
- package/src/enums/WebitelApplications/AdminSections.enum.js +4 -0
- package/src/enums/WebitelApplications/AuditorSections.enum.js +5 -0
- package/src/enums/WebitelApplications/CrmSections.enum.js +5 -0
- package/src/enums/WebitelApplications/WebitelApplications.enum.js +1 -0
- package/src/locale/.DS_Store +0 -0
- package/src/locale/en/en.js +96 -13
- package/src/locale/es/es.js +282 -0
- package/src/locale/i18n.js +4 -0
- package/src/locale/ru/ru.js +97 -12
- package/src/locale/ua/ua.js +98 -13
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +5 -7
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +17 -13
- package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +23 -31
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +12 -15
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +12 -12
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +3 -3
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +2 -2
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +5 -5
- package/src/mixins/validationMixin/useValidation.js +41 -0
- package/src/mixins/validationMixin/validationMixin.js +17 -12
- package/src/modules/AgentStatusSelect/api/agent-status.js +24 -0
- package/src/modules/AgentStatusSelect/api/pause-cause.js +47 -0
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +83 -0
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +18 -0
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +122 -0
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +55 -0
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +107 -0
- package/src/modules/AuditForm/components/__tests__/audit-form-question-read-wrapper.spec.js +14 -0
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +60 -0
- package/src/modules/AuditForm/components/__tests__/audit-form-question.spec.js +14 -0
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +70 -0
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +132 -0
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +154 -0
- package/src/modules/AuditForm/components/audit-form-question.vue +136 -0
- package/src/modules/AuditForm/components/audit-form.vue +183 -0
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +24 -0
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +45 -0
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +89 -0
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +97 -0
- package/src/modules/AuditForm/components/questions/score/__tests__/audit-form-question-score.spec.js +30 -0
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +132 -0
- package/src/modules/AuditForm/schemas/AuditFormQuestionOptionsSchema.js +13 -0
- package/src/modules/AuditForm/schemas/AuditFormQuestionSchema.js +8 -0
- package/src/modules/AuditForm/schemas/AuditFormQuestionScoreSchema.js +8 -0
- package/src/modules/CardStoreModule/composables/useCardStore.js +55 -0
- package/src/modules/CardStoreModule/store/CardStoreModule.js +84 -0
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +87 -0
- package/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup.js +28 -0
- package/src/modules/FilesExport/FilesExport.js +4 -1
- package/src/modules/FilesExport/scripts/generateMediaURL.js +1 -1
- package/src/modules/Filters/classes/BaseFilterSchema.js +13 -0
- package/src/modules/Filters/components/filter-pagination.vue +61 -0
- package/src/modules/Filters/components/filter-table-fields.vue +61 -0
- package/src/modules/Filters/composables/useTableFilters.js +17 -0
- package/src/modules/Filters/restores/filterFieldsRestore.js +9 -0
- package/src/modules/Filters/restores/readme.md +1 -0
- package/src/modules/Filters/store/FiltersStoreModule.js +181 -0
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +10 -12
- package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +10 -12
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +12 -12
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +10 -12
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +10 -12
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +1 -1
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +1 -1
- package/src/modules/QueryFilters/components/filter-datetime.vue +4 -3
- package/src/modules/QueryFilters/components/filter-from-to.vue +15 -8
- package/src/modules/QueryFilters/components/filter-table-fields.vue +101 -0
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +11 -11
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +11 -13
- package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +18 -25
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +14 -9
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +12 -14
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +4 -4
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +21 -8
- package/src/modules/TableStoreModule/composables/useTableStore.js +58 -0
- package/src/modules/TableStoreModule/store/TableStoreModule.js +207 -0
- package/src/modules/Userinfo/api/auth.js +6 -4
- package/src/modules/Userinfo/api/userinfo.js +16 -4
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +27 -0
- package/src/modules/Userinfo/components/__tests__/auth.spec.js +11 -12
- package/src/modules/Userinfo/components/the-auth.vue +1 -1
- package/src/modules/Userinfo/enums/Permissions.enum.js +7 -0
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +41 -1
- package/src/plugins/breakpoint/breakpoint.plugin.js +5 -4
- package/src/scripts/__tests__/updateObject.spec.js +19 -0
- package/src/scripts/caseConverters.js +2 -2
- package/src/scripts/debounce.js +3 -9
- package/src/scripts/eventBus.js +7 -3
- package/src/scripts/updateObject.js +6 -0
- package/src/store/BaseStoreModules/ApiStoreModule.js +93 -0
- package/src/store/ReactiveNowStoreModule/ReactiveNowStoreModule.js +27 -0
- package/src/validators/decimalValidator.js +9 -0
- package/src/validators/domainValidator.js +5 -0
- package/src/components/atoms/wt-avatar/wt-avatar.vue +0 -102
- package/src/components/atoms/wt-button/wt-button.vue +0 -288
- package/src/components/atoms/wt-chip/wt-chip.vue +0 -23
- package/src/components/atoms/wt-divider/wt-divider.vue +0 -25
- package/src/components/atoms/wt-icon/wt-icon.vue +0 -150
- package/src/components/atoms/wt-input-info/wt-input-info.vue +0 -35
- package/src/components/atoms/wt-rounded-action/wt-rounded-action.vue +0 -156
- package/src/components/atoms/wt-tooltip/wt-tooltip.vue +0 -48
- package/src/components/molecules/wt-button-select/wt-button-select.vue +0 -184
- package/src/components/molecules/wt-checkbox/wt-checkbox.vue +0 -179
- package/src/components/molecules/wt-datepicker/wt-datepicker.vue +0 -203
- package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +0 -79
- package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +0 -300
- package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +0 -75
- package/src/components/molecules/wt-notification/wt-notification.vue +0 -75
- package/src/components/molecules/wt-radio/wt-radio.vue +0 -170
- package/src/components/molecules/wt-search-bar/wt-search-bar.vue +0 -194
- package/src/components/molecules/wt-switcher/wt-switcher.vue +0 -182
- package/src/components/molecules/wt-textarea/wt-textarea.vue +0 -215
- package/src/components/molecules/wt-time-input/wt-time-input.vue +0 -190
- package/src/components/organisms/wt-app-header/wt-app-header.vue +0 -24
- package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +0 -71
- package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +0 -9
- package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +0 -9
- package/src/components/organisms/wt-table/table-cells/wt-table-delete-action.vue +0 -21
- package/src/components/organisms/wt-table/table-cells/wt-table-edit-action.vue +0 -22
- package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +0 -120
- package/src/css/components/_components.scss +0 -45
- package/src/css/components/atoms/wt-avatar/_variables.scss +0 -14
- package/src/css/components/atoms/wt-button/_variables.scss +0 -47
- package/src/css/components/atoms/wt-icon/_variables.scss +0 -8
- package/src/css/components/atoms/wt-rounded-action/_variables.scss +0 -7
- package/src/css/components/atoms/wt-tooltip/_variables.scss +0 -29
- package/src/css/components/molecules/wt-button-select/_variables.scss +0 -18
- package/src/css/components/molecules/wt-datepicker/_variables.scss +0 -21
- package/src/css/components/molecules/wt-datepicker/datepicker-calendar.scss +0 -90
- package/src/css/components/molecules/wt-datetimepicker/_variables.scss +0 -11
- package/src/css/components/molecules/wt-icon-btn/_variables.scss +0 -3
- package/src/css/components/organisms/wt-headline-nav/_variables.scss +0 -5
- /package/src/components/{organisms/wt-app-header → wt-app-header}/__tests__/WtAppHeader.spec.js +0 -0
- /package/src/components/{organisms/wt-app-header → wt-app-header}/wt-header-actions.vue +0 -0
- /package/src/components/{atoms/wt-avatar → wt-avatar}/__tests__/wt-avatar.spec.js +0 -0
- /package/src/components/{atoms/wt-badge → wt-badge}/__tests__/wt-badge.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-badge/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-checkbox/_variables.scss +0 -0
- /package/src/components/{atoms/wt-chip → wt-chip}/__tests__/WtChip.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-chip/_variables.scss +0 -0
- /package/src/components/{molecules/wt-copy-action → wt-copy-action}/__tests__/WtCopyAction.spec.js +0 -0
- /package/src/components/{molecules/wt-copy-action → wt-copy-action}/wt-copy-action.vue +0 -0
- /package/src/components/{atoms/wt-divider → wt-divider}/__tests__/WtDivider.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-divider/_variables.scss +0 -0
- /package/src/components/{organisms/wt-filters-panel-wrapper/__tests__/wt-filters-panel-wrapper.spec.js → wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js} +0 -0
- /package/src/components/{organisms/wt-headline → wt-headline}/__tests__/WtHeadline.spec.js +0 -0
- /package/src/{css/components/organisms → components}/wt-headline/_variables.scss +0 -0
- /package/src/components/{molecules/wt-hint → wt-hint}/__tests__/WtHint.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-input/_variables.scss +0 -0
- /package/src/components/{atoms/wt-input-info → wt-input-info}/__tests__/WtInputInfo.spec.js +0 -0
- /package/src/components/{molecules/wt-label → wt-label}/__tests__/WtLabel.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-label/_variables.scss +0 -0
- /package/src/components/{molecules/wt-label → wt-label}/mixins/labelUsageMixin.js +0 -0
- /package/src/components/{molecules/wt-load-bar → wt-load-bar}/__tests__/WtLoadBar.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-load-bar/_variables.scss +0 -0
- /package/src/components/{atoms/wt-loader → wt-loader}/__tests__/WtLoader.spec.js +0 -0
- /package/src/components/{atoms/wt-loader → wt-loader}/_internals/wt-loader--md.vue +0 -0
- /package/src/components/{atoms/wt-loader → wt-loader}/_internals/wt-loader--sm.vue +0 -0
- /package/src/{css/components/organisms → components}/wt-navigation-bar/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-notification/_variables.scss +0 -0
- /package/src/{css/components/organisms → components}/wt-notifications-bar/_variables.scss +0 -0
- /package/src/components/{organisms/wt-page-wrapper → wt-page-wrapper}/__tests__/WtPageWrapper.spec.js +0 -0
- /package/src/{css/components/organisms → components}/wt-page-wrapper/_variables.scss +0 -0
- /package/src/{css/components/organisms → components}/wt-pagination/_variables.scss +0 -0
- /package/src/components/{organisms/wt-player → wt-player}/__tests__/WtPlayer.spec.js +0 -0
- /package/src/components/{molecules/wt-popup → wt-popup}/__tests__/WtPopup.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-popup/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-radio/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-search-bar/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-select/_multiselect.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-select/_variables.scss +0 -0
- /package/src/components/{molecules/wt-slider → wt-slider}/__tests__/WtSlider.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-slider/_variables.scss +0 -0
- /package/src/{css/components/organisms → components}/wt-status-select/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-switcher/_variables.scss +0 -0
- /package/src/components/{organisms/wt-table → wt-table}/_internals/getSortOrder.js +0 -0
- /package/src/{css/components/organisms → components}/wt-table/_variables.scss +0 -0
- /package/src/components/{organisms/wt-table-actions → wt-table-actions}/__tests__/WtTableActions.spec.js +0 -0
- /package/src/{css/components/organisms → components}/wt-table-actions/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-tags-input/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-textarea/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-timepicker/_variables.scss +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import WtNotificationsBar from '../wt-notifications-bar.vue';
|
|
3
|
-
import WtNotification from '
|
|
4
|
-
import eventBus from '
|
|
3
|
+
import WtNotification from '../../wt-notification/wt-notification.vue';
|
|
4
|
+
import eventBus from '../../../scripts/eventBus';
|
|
5
5
|
|
|
6
6
|
describe('WtNotificationsBar', () => {
|
|
7
7
|
it('renders a component', () => {
|
|
8
8
|
const wrapper = shallowMount(WtNotificationsBar, {
|
|
9
|
-
|
|
9
|
+
global: { provide: { $eventBus: eventBus } },
|
|
10
10
|
});
|
|
11
11
|
expect(wrapper.classes('wt-notifications-bar')).toBe(true);
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it('shows notification at event bus event', async () => {
|
|
15
15
|
const wrapper = shallowMount(WtNotificationsBar, {
|
|
16
|
-
|
|
16
|
+
global: { provide: { $eventBus: eventBus } },
|
|
17
17
|
});
|
|
18
18
|
wrapper.vm.$eventBus.$emit('notification', {
|
|
19
19
|
type: 'error', text: 'error',
|
|
@@ -24,7 +24,7 @@ describe('WtNotificationsBar', () => {
|
|
|
24
24
|
|
|
25
25
|
it('closes notification manually', async () => {
|
|
26
26
|
const wrapper = shallowMount(WtNotificationsBar, {
|
|
27
|
-
|
|
27
|
+
global: { provide: { $eventBus: eventBus } },
|
|
28
28
|
});
|
|
29
29
|
wrapper.vm.$eventBus.$emit('notification', {
|
|
30
30
|
type: 'error', text: 'error',
|
|
@@ -37,7 +37,7 @@ describe('WtNotificationsBar', () => {
|
|
|
37
37
|
|
|
38
38
|
it('closes notification automatically', async () => {
|
|
39
39
|
const wrapper = shallowMount(WtNotificationsBar, {
|
|
40
|
-
|
|
40
|
+
global: { provide: { $eventBus: eventBus } },
|
|
41
41
|
data: () => ({ notificationDuration: 100 }),
|
|
42
42
|
});
|
|
43
43
|
wrapper.vm.$eventBus.$emit('notification', {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<aside class="wt-notifications-bar">
|
|
3
|
+
<transition-group name="wt-notifications-transition" tag="div">
|
|
4
|
+
<wt-notification
|
|
5
|
+
v-for="(notification, key) of notifications"
|
|
6
|
+
:type="notification.type"
|
|
7
|
+
:key="key+notification.text"
|
|
8
|
+
@close="closeNotification(notification)"
|
|
9
|
+
>{{ notification.text }}
|
|
10
|
+
</wt-notification>
|
|
11
|
+
</transition-group>
|
|
12
|
+
</aside>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'wt-notifications-bar',
|
|
18
|
+
inject: ['$eventBus'],
|
|
19
|
+
data: () => ({
|
|
20
|
+
notificationDuration: 4000,
|
|
21
|
+
notifications: [],
|
|
22
|
+
}),
|
|
23
|
+
created() {
|
|
24
|
+
try {
|
|
25
|
+
this.$eventBus.$on('notification', this.showNotification);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error('wt-notifications-bar cannot work without globally registered eventBus', err);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
destroyed() {
|
|
31
|
+
this.$eventBus.$off('notification', this.showNotification);
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
showNotification(notification) {
|
|
35
|
+
this.notifications.unshift(notification);
|
|
36
|
+
setTimeout(() => this.closeNotification(notification), this.notificationDuration);
|
|
37
|
+
},
|
|
38
|
+
closeNotification(notification) {
|
|
39
|
+
const index = this.notifications.indexOf(notification);
|
|
40
|
+
this.notifications.splice(index, 1);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style lang="scss">
|
|
47
|
+
@import './variables.scss';
|
|
48
|
+
</style>
|
|
49
|
+
|
|
50
|
+
<style lang="scss" scoped>
|
|
51
|
+
|
|
52
|
+
.wt-notifications-bar {
|
|
53
|
+
@extend %wt-scrollbar;
|
|
54
|
+
|
|
55
|
+
position: fixed;
|
|
56
|
+
top: var(--notifications-bar-corner-margin);
|
|
57
|
+
right: var(--notifications-bar-corner-margin);
|
|
58
|
+
max-height: var(--notifications-bar-max-height);
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
overflow-x: hidden;
|
|
61
|
+
z-index: var(--notifications-bar-z-index);
|
|
62
|
+
|
|
63
|
+
.wt-notification {
|
|
64
|
+
margin: var(--notifications-bar-notifications-margin);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.wt-notifications-transition-enter-active,
|
|
69
|
+
.wt-notifications-transition-leave-active {
|
|
70
|
+
transition: all var(--transition);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.wt-notifications-transition-enter,
|
|
74
|
+
.wt-notifications-transition-leave-to {
|
|
75
|
+
opacity: 0;
|
|
76
|
+
transform: translateX(60px);
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtPageHeader from '../wt-page-header.vue';
|
|
3
|
+
|
|
4
|
+
describe('WtPageHeader', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtPageHeader);
|
|
7
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-headline>
|
|
3
|
+
<template v-slot:title-wrapper>
|
|
4
|
+
<slot>
|
|
5
|
+
</slot>
|
|
6
|
+
</template>
|
|
7
|
+
<template v-slot:title>
|
|
8
|
+
<slot name="title"></slot>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-slot:actions>
|
|
11
|
+
<slot name="actions"></slot>
|
|
12
|
+
<slot
|
|
13
|
+
name="primary-action"
|
|
14
|
+
v-if="!hidePrimary"
|
|
15
|
+
>
|
|
16
|
+
<wt-button
|
|
17
|
+
:disabled="primaryDisabled"
|
|
18
|
+
@click="primaryAction"
|
|
19
|
+
>
|
|
20
|
+
{{ primaryText || $t('reusable.add') }}
|
|
21
|
+
</wt-button>
|
|
22
|
+
</slot>
|
|
23
|
+
<wt-button
|
|
24
|
+
v-if="!hideSecondary && !emptySecondary"
|
|
25
|
+
color="secondary"
|
|
26
|
+
:disabled="secondaryDisabled"
|
|
27
|
+
@click="secondaryAction"
|
|
28
|
+
>
|
|
29
|
+
{{ secondaryText || $t('reusable.close') }}
|
|
30
|
+
</wt-button>
|
|
31
|
+
</template>
|
|
32
|
+
</wt-headline>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
import { computed } from 'vue';
|
|
37
|
+
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
hidePrimary: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
hideSecondary: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
primaryText: {
|
|
48
|
+
type: String,
|
|
49
|
+
},
|
|
50
|
+
primaryAction: {
|
|
51
|
+
type: Function,
|
|
52
|
+
},
|
|
53
|
+
primaryDisabled: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
secondaryDisabled: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
secondaryText: {
|
|
62
|
+
type: String,
|
|
63
|
+
},
|
|
64
|
+
secondaryAction: {
|
|
65
|
+
type: Function,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const emptySecondary = computed(() => !(props.secondaryAction || props.secondaryText));
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="scss" scoped>
|
|
73
|
+
|
|
74
|
+
.wt-headline {
|
|
75
|
+
.wt-button {
|
|
76
|
+
margin-left: var(--spacing-sm);
|
|
77
|
+
|
|
78
|
+
&:first-child {
|
|
79
|
+
margin-left: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -24,12 +24,18 @@ export default {
|
|
|
24
24
|
};
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
+
<style lang="scss">
|
|
28
|
+
@import './variables.scss';
|
|
29
|
+
</style>
|
|
30
|
+
|
|
27
31
|
<style lang="scss" scoped>
|
|
32
|
+
|
|
28
33
|
.wt-page-wrapper {
|
|
29
34
|
display: flex;
|
|
30
35
|
flex-direction: column;
|
|
31
36
|
box-sizing: border-box;
|
|
32
37
|
min-height: 100%;
|
|
38
|
+
max-width: 100%;
|
|
33
39
|
padding: var(--page-wrapper-padding);
|
|
34
40
|
gap: var(--page-wrapper-section-gap);
|
|
35
41
|
}
|
package/src/components/{organisms/wt-pagination → wt-pagination}/__tests__/WtPagination.spec.js
RENAMED
|
@@ -28,9 +28,10 @@ describe('WtPagination', () => {
|
|
|
28
28
|
const wrapper = mount(WtPagination, {
|
|
29
29
|
props: { isNext: true, page: 2 },
|
|
30
30
|
});
|
|
31
|
-
const pageControls = wrapper.
|
|
31
|
+
const pageControls = wrapper.findAllComponents({ name: 'wt-icon-btn' });
|
|
32
32
|
pageControls.at(0).vm.$emit('click');
|
|
33
33
|
pageControls.at(1).vm.$emit('click');
|
|
34
|
+
console.info(wrapper.emitted());
|
|
34
35
|
expect(wrapper.emitted().prev.length).toBe(1);
|
|
35
36
|
expect(wrapper.emitted().next.length).toBe(1);
|
|
36
37
|
});
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script>
|
|
42
|
-
import debounce from '
|
|
42
|
+
import debounce from '../../scripts/debounce';
|
|
43
43
|
|
|
44
44
|
export default {
|
|
45
45
|
name: 'wt-pagination',
|
|
@@ -64,6 +64,7 @@ export default {
|
|
|
64
64
|
default: 1000,
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
|
+
emits: ['change', 'input', 'prev', 'next'],
|
|
67
68
|
model: {
|
|
68
69
|
prop: 'size',
|
|
69
70
|
event: 'change',
|
|
@@ -104,7 +105,12 @@ export default {
|
|
|
104
105
|
};
|
|
105
106
|
</script>
|
|
106
107
|
|
|
108
|
+
<style lang="scss">
|
|
109
|
+
@import './variables.scss';
|
|
110
|
+
</style>
|
|
111
|
+
|
|
107
112
|
<style lang="scss" scoped>
|
|
113
|
+
|
|
108
114
|
.wt-pagination {
|
|
109
115
|
@extend %typo-body-1;
|
|
110
116
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.wt-player {
|
|
2
|
-
--plyr-color-main: var(--
|
|
2
|
+
--plyr-color-main: var(--primary-color);
|
|
3
3
|
--plyr-audio-control-color: var(--icon-primary-color);
|
|
4
4
|
// --plyr-control-toggle-checked-background: var(--main-color);
|
|
5
5
|
--player-close-icon-transform-translate-x: var(--spacing-md);
|
|
@@ -101,14 +101,16 @@ export default {
|
|
|
101
101
|
methods: {
|
|
102
102
|
async setupPlayer() {
|
|
103
103
|
await this.$nextTick(); // test is failing to render component if element is passed to Plyr as Vue $ref
|
|
104
|
-
const baseURL = this.$baseURL || process.env.BASE_URL;
|
|
104
|
+
const baseURL = this.$baseURL || (process || import.meta).env.BASE_URL;
|
|
105
105
|
if (this.player) this.player.destroy();
|
|
106
|
-
const controls = [
|
|
106
|
+
const controls = [
|
|
107
|
+
'play-large', 'play', 'progress', 'current-time',
|
|
107
108
|
'mute', 'volume', 'captions', 'settings', 'pip',
|
|
108
|
-
'airplay', 'fullscreen'
|
|
109
|
+
'airplay', 'fullscreen',
|
|
110
|
+
];
|
|
109
111
|
if (this.download) controls.push('download');
|
|
110
112
|
this.player = new Plyr(this.$refs.player, {
|
|
111
|
-
|
|
113
|
+
// this.player = new Plyr('.wt-player__player', {
|
|
112
114
|
autoplay: this.autoplay,
|
|
113
115
|
loadSprite: false,
|
|
114
116
|
resetOnEnd: this.resetOnEnd,
|
|
@@ -150,7 +152,8 @@ export default {
|
|
|
150
152
|
</script>
|
|
151
153
|
|
|
152
154
|
<style lang="scss">
|
|
153
|
-
@import
|
|
155
|
+
@import '../../../node_modules/plyr/src/sass/plyr';
|
|
156
|
+
@import './variables.scss';
|
|
154
157
|
|
|
155
158
|
.wt-player {
|
|
156
159
|
@extend %typo-body-2;
|
|
@@ -160,10 +163,12 @@ export default {
|
|
|
160
163
|
&-sticky {
|
|
161
164
|
position: sticky;
|
|
162
165
|
}
|
|
166
|
+
|
|
163
167
|
&-relative {
|
|
164
168
|
position: relative;
|
|
165
169
|
bottom: unset;
|
|
166
170
|
}
|
|
171
|
+
|
|
167
172
|
&-static {
|
|
168
173
|
position: static;
|
|
169
174
|
}
|
package/src/components/{molecules/wt-progress-bar → wt-progress-bar}/__tests__/WtProgressBar.spec.js
RENAMED
|
@@ -7,11 +7,11 @@ describe('WtProgressBar', () => {
|
|
|
7
7
|
expect(wrapper.exists()).toBe(true);
|
|
8
8
|
});
|
|
9
9
|
it('isOverflow correctly computes overflow=true', () => {
|
|
10
|
-
const wrapper = shallowMount(WtProgressBar, {
|
|
10
|
+
const wrapper = shallowMount(WtProgressBar, { props: { value: 2, max: 1 } });
|
|
11
11
|
expect(wrapper.vm.isOverflow).toBe(true);
|
|
12
12
|
});
|
|
13
13
|
it('isOverflow correctly computes overflow=false', () => {
|
|
14
|
-
const wrapper = shallowMount(WtProgressBar, {
|
|
14
|
+
const wrapper = shallowMount(WtProgressBar, { props: { value: 0.99, max: 1 } });
|
|
15
15
|
expect(wrapper.vm.isOverflow).toBe(false);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
--progress-bar-padding: var(--spacing-3xs);
|
|
5
5
|
--progress-bar-border-radius: var(--progress-bar-padding);
|
|
6
6
|
|
|
7
|
-
--progress-bar-bg-color--primary: var(--
|
|
7
|
+
--progress-bar-bg-color--primary: var(--primary-color);
|
|
8
8
|
--progress-bar-bg-color--secondary: var(--secondary-color);
|
|
9
9
|
--progress-bar-bg-color--success: var(--true-color);
|
|
10
10
|
--progress-bar-bg-color--danger: var(--false-color);
|
|
11
|
-
}
|
|
11
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="wt-progress-bar" :class="[{
|
|
3
4
|
'wt-progress-bar--overflow': isOverflow,
|
|
4
5
|
},
|
|
5
6
|
`wt-progress-bar--${color}`
|
|
6
|
-
]"
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
7
9
|
<span class="wt-progress-bar__progress" :style="`width: ${this.progressWidth}%;`"></span>
|
|
8
10
|
</div>
|
|
9
11
|
</template>
|
|
@@ -40,7 +42,12 @@ export default {
|
|
|
40
42
|
};
|
|
41
43
|
</script>
|
|
42
44
|
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
@import './variables.scss';
|
|
47
|
+
</style>
|
|
48
|
+
|
|
43
49
|
<style lang="scss" scoped>
|
|
50
|
+
|
|
44
51
|
.wt-progress-bar {
|
|
45
52
|
box-sizing: border-box;
|
|
46
53
|
width: 100%;
|
|
@@ -55,7 +62,7 @@ export default {
|
|
|
55
62
|
display: inline-block;
|
|
56
63
|
height: var(--progress-bar-height);
|
|
57
64
|
will-change: width;
|
|
58
|
-
background: var(--
|
|
65
|
+
background: var(--primary-color);
|
|
59
66
|
border-radius: var(--progress-bar-border-radius) 0 0 var(--progress-bar-border-radius);
|
|
60
67
|
transition: var(--transition);
|
|
61
68
|
}
|
|
@@ -63,12 +70,15 @@ export default {
|
|
|
63
70
|
.wt-progress-bar--primary .wt-progress-bar__progress {
|
|
64
71
|
background: var(--progress-bar-bg-color--primary);
|
|
65
72
|
}
|
|
73
|
+
|
|
66
74
|
.wt-progress-bar--secondary .wt-progress-bar__progress {
|
|
67
75
|
background: var(--progress-bar-bg-color--secondary);
|
|
68
76
|
}
|
|
77
|
+
|
|
69
78
|
.wt-progress-bar--success .wt-progress-bar__progress {
|
|
70
79
|
background: var(--progress-bar-bg-color--success);
|
|
71
80
|
}
|
|
81
|
+
|
|
72
82
|
.wt-progress-bar--danger .wt-progress-bar__progress {
|
|
73
83
|
background: var(--progress-bar-bg-color--danger);
|
|
74
84
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
import WtRadio from '../wt-radio.vue';
|
|
3
3
|
import WtLabel from '../../wt-label/wt-label.vue';
|
|
4
|
-
import WtIcon from '
|
|
4
|
+
import WtIcon from '../../wt-icon/wt-icon.vue';
|
|
5
5
|
|
|
6
6
|
describe('WtRadio', () => {
|
|
7
7
|
it('renders a component', () => {
|
|
@@ -16,12 +16,12 @@ describe('WtRadio', () => {
|
|
|
16
16
|
|
|
17
17
|
it('renders label text when passed', () => {
|
|
18
18
|
const label = 'Hello there';
|
|
19
|
-
const wrapper =
|
|
19
|
+
const wrapper = mount(WtRadio, {
|
|
20
20
|
stubs: {
|
|
21
21
|
WtLabel,
|
|
22
22
|
WtIcon,
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
props: { label },
|
|
25
25
|
});
|
|
26
26
|
expect(wrapper.find('.wt-radio__label').text()).toBe(label);
|
|
27
27
|
});
|
|
@@ -29,12 +29,12 @@ describe('WtRadio', () => {
|
|
|
29
29
|
it('toggles passed value at click', () => {
|
|
30
30
|
const selected = '';
|
|
31
31
|
const value = 'jest';
|
|
32
|
-
const wrapper =
|
|
32
|
+
const wrapper = mount(WtRadio, {
|
|
33
33
|
stubs: {
|
|
34
34
|
WtLabel,
|
|
35
35
|
WtIcon,
|
|
36
36
|
},
|
|
37
|
-
|
|
37
|
+
props: { selected, value },
|
|
38
38
|
});
|
|
39
39
|
wrapper.find('.wt-radio__input').trigger('input');
|
|
40
40
|
expect(wrapper.emitted().input[0]).toEqual([value]);
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="wt-radio"
|
|
4
|
+
:class="{
|
|
5
|
+
'wt-radio--active': isChecked,
|
|
6
|
+
'wt-radio--outline': outline,
|
|
7
|
+
'wt-radio--disabled': disabled,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<wt-label class="wt-radio__wrapper">
|
|
11
|
+
<input
|
|
12
|
+
class="wt-radio__input"
|
|
13
|
+
type="radio"
|
|
14
|
+
:value="value"
|
|
15
|
+
:checked="isChecked"
|
|
16
|
+
:disabled="disabled"
|
|
17
|
+
@input="inputHandler"
|
|
18
|
+
>
|
|
19
|
+
<wt-icon class="wt-radio__icon" :icon="radioIcon"></wt-icon>
|
|
20
|
+
<!-- @slot Custom input label -->
|
|
21
|
+
<slot
|
|
22
|
+
v-bind="{ label, isChecked, disabled }"
|
|
23
|
+
name="label"
|
|
24
|
+
>
|
|
25
|
+
<div v-if="label" class="wt-radio__label">{{ label }}</div>
|
|
26
|
+
</slot>
|
|
27
|
+
</wt-label>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
name: 'wt-radio',
|
|
34
|
+
props: {
|
|
35
|
+
// value, set by radio
|
|
36
|
+
value: {
|
|
37
|
+
type: [String, Number, Boolean, Object],
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
// currently selected value
|
|
41
|
+
selected: {
|
|
42
|
+
type: [String, Number, Boolean, Object],
|
|
43
|
+
default: '',
|
|
44
|
+
},
|
|
45
|
+
label: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '',
|
|
48
|
+
},
|
|
49
|
+
required: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
outline: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
model: {
|
|
63
|
+
prop: 'selected',
|
|
64
|
+
event: 'input',
|
|
65
|
+
},
|
|
66
|
+
computed: {
|
|
67
|
+
isChecked() {
|
|
68
|
+
return this.value === this.selected;
|
|
69
|
+
},
|
|
70
|
+
radioIcon() {
|
|
71
|
+
return this.isChecked ? 'radio--checked' : 'radio';
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
inputHandler() {
|
|
76
|
+
this.$emit('input', this.value);
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="scss" scoped>
|
|
83
|
+
|
|
84
|
+
@import './variables.scss';
|
|
85
|
+
|
|
86
|
+
/* Customize the label (the container) */
|
|
87
|
+
.wt-radio {
|
|
88
|
+
@include width-fit-content;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
|
|
91
|
+
.wt-label {
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.wt-radio__wrapper {
|
|
97
|
+
position: relative;
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
user-select: none;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.wt-radio__label {
|
|
105
|
+
margin-left: var(--radio-icon-margin);
|
|
106
|
+
transition: var(--transition);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Hide the browser's default radio button */
|
|
110
|
+
.wt-radio__input {
|
|
111
|
+
position: absolute;
|
|
112
|
+
width: 0;
|
|
113
|
+
height: 0;
|
|
114
|
+
opacity: 0;
|
|
115
|
+
pointer-events: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wt-radio__icon {
|
|
119
|
+
flex: 0 0 var(--icon-md-size);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wt-radio:hover {
|
|
123
|
+
.wt-radio__label {
|
|
124
|
+
color: var(--form-label--hover-color);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
::v-deep .wt-icon__icon {
|
|
128
|
+
fill: var(--icon-color--hover);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.wt-radio--active {
|
|
133
|
+
.wt-radio__label {
|
|
134
|
+
color: var(--form-label--active-color);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
::v-deep .wt-icon__icon {
|
|
138
|
+
fill: var(--icon-color-active);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.wt-radio--outline {
|
|
143
|
+
.wt-radio__label {
|
|
144
|
+
color: var(--form-outline-label-color);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
::v-deep .wt-icon__icon {
|
|
148
|
+
fill: var(--icon-outline-color);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.wt-radio--active {
|
|
152
|
+
.wt-radio__label {
|
|
153
|
+
color: var(--form-label--active-color);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
::v-deep .wt-icon__icon {
|
|
157
|
+
fill: var(--icon-outline--active-color);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:hover {
|
|
162
|
+
|
|
163
|
+
::v-deep .wt-icon__icon {
|
|
164
|
+
fill: var(--icon-outline--hover-color);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.wt-radio--disabled {
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
|
|
172
|
+
.wt-radio__label {
|
|
173
|
+
color: var(--form-label--disabled-color);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
::v-deep .wt-icon__icon {
|
|
177
|
+
fill: var(--icon-color-disabled);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
</style>
|