@webitel/ui-sdk 0.1.1-vue3 → 0.1.2-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 +36363 -11607
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +36344 -11588
- 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 +2 -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
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="wt-button"
|
|
4
|
+
:class="[
|
|
5
|
+
colorClass,
|
|
6
|
+
`wt-button--size-${size}`,
|
|
7
|
+
{
|
|
8
|
+
'wt-button--contains-icon': containsIcon,
|
|
9
|
+
'wt-button--wide': wide,
|
|
10
|
+
'wt-button--disabled': disabled,
|
|
11
|
+
'wt-button--loading': loading,
|
|
12
|
+
}
|
|
13
|
+
]"
|
|
14
|
+
type="button"
|
|
15
|
+
:disabled="disabled"
|
|
16
|
+
@click="$emit('click', $event)"
|
|
17
|
+
>
|
|
18
|
+
<wt-loader
|
|
19
|
+
v-if="loading"
|
|
20
|
+
size="sm"
|
|
21
|
+
:color="loaderColor"
|
|
22
|
+
></wt-loader>
|
|
23
|
+
<slot v-else>no content provided</slot>
|
|
24
|
+
</button>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
name: 'wt-button',
|
|
30
|
+
props: {
|
|
31
|
+
/**
|
|
32
|
+
* @values 'primary', 'secondary', 'success', 'error', 'transfer', 'job', 'info'
|
|
33
|
+
* @example <wt-button color="success"></wt-button>
|
|
34
|
+
*/
|
|
35
|
+
color: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'primary',
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
loading: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* @values 'sm', 'md'
|
|
49
|
+
* @example <wt-button size="sm"></wt-button>
|
|
50
|
+
*/
|
|
51
|
+
size: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'md',
|
|
54
|
+
options: ['sm', 'md'],
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Stretches button to all available width
|
|
58
|
+
*/
|
|
59
|
+
wide: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* sets wt-button line-height to 0 to prevent height changing: [stack overflow](https://stackoverflow.com/a/11126701)
|
|
65
|
+
*/
|
|
66
|
+
containsIcon: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
description: 'https://stackoverflow.com/a/11126701',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
emits: ['click'],
|
|
73
|
+
computed: {
|
|
74
|
+
colorClass() {
|
|
75
|
+
if (!this.disabled) return `${this.color}`;
|
|
76
|
+
return '';
|
|
77
|
+
},
|
|
78
|
+
loaderColor() {
|
|
79
|
+
if (['success', 'transfer', 'error', 'job'].includes(this.color)) return 'main';
|
|
80
|
+
return 'contrast';
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="scss">
|
|
87
|
+
@import './variables.scss';
|
|
88
|
+
</style>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped>
|
|
91
|
+
.wt-button {
|
|
92
|
+
@extend %typo-button;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
position: relative;
|
|
95
|
+
display: inline-block;
|
|
96
|
+
min-width: var(--btn-min-width);
|
|
97
|
+
padding: var(--btn-padding);
|
|
98
|
+
color: var(--btn-primary-text-color);
|
|
99
|
+
background-color: var(--btn-primary-color);
|
|
100
|
+
background-clip: padding-box;
|
|
101
|
+
border-radius: var(--border-radius);
|
|
102
|
+
transition: var(--transition);
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
|
|
105
|
+
&--wide {
|
|
106
|
+
width: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// https://stackoverflow.com/a/11126701
|
|
110
|
+
&--contains-icon {
|
|
111
|
+
line-height: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&--loading {
|
|
115
|
+
pointer-events: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--size {
|
|
119
|
+
&-sm {
|
|
120
|
+
padding: var(--btn-padding--size-sm);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&-md {
|
|
124
|
+
padding: var(--btn-padding);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:hover,
|
|
129
|
+
&:active {
|
|
130
|
+
background-color: var(--btn-primary-hover-color);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.secondary {
|
|
134
|
+
color: var(--btn-secondary-text-color);
|
|
135
|
+
background-color: var(--btn-secondary-color);
|
|
136
|
+
|
|
137
|
+
&:hover,
|
|
138
|
+
&:active {
|
|
139
|
+
background-color: var(--btn-secondary-hover-color);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.success {
|
|
144
|
+
color: var(--btn-success-text-color);
|
|
145
|
+
background-color: var(--btn-success-color);
|
|
146
|
+
|
|
147
|
+
&:hover,
|
|
148
|
+
&:active {
|
|
149
|
+
background-color: var(--btn-success-hover-color);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.info {
|
|
154
|
+
color: var(--btn-info-text-color);
|
|
155
|
+
background-color: var(--btn-info-color);
|
|
156
|
+
|
|
157
|
+
&:hover,
|
|
158
|
+
&:active {
|
|
159
|
+
background-color: var(--btn-info-hover-color);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.job {
|
|
164
|
+
color: var(--btn-job-text-color);
|
|
165
|
+
background-color: var(--btn-job-color);
|
|
166
|
+
|
|
167
|
+
&:hover,
|
|
168
|
+
&:active {
|
|
169
|
+
background-color: var(--btn-job-hover-color);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.transfer {
|
|
174
|
+
color: var(--btn-transfer-text-color);
|
|
175
|
+
background-color: var(--btn-transfer-color);
|
|
176
|
+
|
|
177
|
+
&:hover,
|
|
178
|
+
&:active {
|
|
179
|
+
background-color: var(--btn-transfer-hover-color);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&.error {
|
|
184
|
+
color: var(--btn-error-text-color);
|
|
185
|
+
background-color: var(--btn-error-color);
|
|
186
|
+
|
|
187
|
+
&:hover,
|
|
188
|
+
&:active {
|
|
189
|
+
background-color: var(--btn-error-hover-color);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&.wt-button--disabled {
|
|
194
|
+
color: var(--btn-disabled-text-color);
|
|
195
|
+
background-color: var(--btn-disabled-color);
|
|
196
|
+
cursor: auto;
|
|
197
|
+
pointer-events: none;
|
|
198
|
+
box-shadow: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.wt-loader {
|
|
202
|
+
margin: auto;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
### Note: all buttons props are passed as "$attrs"
|
|
2
|
+
|
|
3
|
+
Different colors
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
const options = [{ text: 'lorem ipsum' }, { text: 'dolor sit amet' }, { text: 'consectetur adipiscing elit' }];
|
|
7
|
+
|
|
8
|
+
<div style="display: flex; gap: var(--spacing-xs);">
|
|
9
|
+
<wt-button-select :options="this.options">Primary</wt-button-select>
|
|
10
|
+
<wt-button-select color="secondary" :options="this.options">Secondary</wt-button-select>
|
|
11
|
+
<wt-button-select disabled :options="this.options">Disabled</wt-button-select>
|
|
12
|
+
</div>
|
|
13
|
+
```
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
2
|
import WtSelectButton from '../wt-button-select.vue';
|
|
3
3
|
|
|
4
|
+
// helps to mock @floating-ui/vue autoUpdate method
|
|
5
|
+
global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
6
|
+
observe: jest.fn(),
|
|
7
|
+
unobserve: jest.fn(),
|
|
8
|
+
disconnect: jest.fn(),
|
|
9
|
+
}));
|
|
10
|
+
|
|
4
11
|
describe('WtSelectButton', () => {
|
|
5
12
|
it('renders a component', () => {
|
|
6
13
|
const wrapper = shallowMount(WtSelectButton);
|
|
@@ -9,7 +16,7 @@ describe('WtSelectButton', () => {
|
|
|
9
16
|
|
|
10
17
|
it('renders a button content via default slot', () => {
|
|
11
18
|
const content = 'button content';
|
|
12
|
-
const wrapper =
|
|
19
|
+
const wrapper = mount(WtSelectButton, {
|
|
13
20
|
slots: {
|
|
14
21
|
default: content,
|
|
15
22
|
},
|
|
@@ -17,12 +24,16 @@ describe('WtSelectButton', () => {
|
|
|
17
24
|
expect(wrapper.find('.wt-button-select__button').text()).toBe(content);
|
|
18
25
|
});
|
|
19
26
|
|
|
20
|
-
it('should rotate the arrow', () => {
|
|
27
|
+
it('should rotate the arrow', async () => {
|
|
21
28
|
const wrapper = mount(WtSelectButton, {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
29
|
+
props: {
|
|
30
|
+
options: [],
|
|
31
|
+
},
|
|
25
32
|
});
|
|
33
|
+
const arrowBtn = wrapper.findAllComponents({ name: 'wt-button' })
|
|
34
|
+
.find((component) => component.classes().includes('wt-button-select__select-btn'));
|
|
35
|
+
arrowBtn.vm.$emit('click');
|
|
36
|
+
await wrapper.vm.$nextTick();
|
|
26
37
|
const wtIcon = wrapper.find('.wt-button-select__select-arrow');
|
|
27
38
|
expect(wtIcon.classes()).toContain('wt-button-select__select-arrow--active');
|
|
28
39
|
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-clickaway="atClickaway"
|
|
4
|
+
class="wt-button-select"
|
|
5
|
+
>
|
|
6
|
+
<wt-button
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
:color="color"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
class="wt-button-select__button"
|
|
11
|
+
@click="$emit('click', $event)"
|
|
12
|
+
>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</wt-button>
|
|
15
|
+
|
|
16
|
+
<wt-context-menu
|
|
17
|
+
:options="options"
|
|
18
|
+
:visible="isOpened"
|
|
19
|
+
@click="selectOption"
|
|
20
|
+
>
|
|
21
|
+
<template v-slot:activator>
|
|
22
|
+
<wt-button
|
|
23
|
+
v-bind="$attrs"
|
|
24
|
+
:color="color"
|
|
25
|
+
:disabled="disabled"
|
|
26
|
+
:loading="false"
|
|
27
|
+
class="wt-button-select__select-btn"
|
|
28
|
+
@click="isOpened = !isOpened"
|
|
29
|
+
>
|
|
30
|
+
<wt-icon
|
|
31
|
+
:class="{'wt-button-select__select-arrow--active': isOpened}"
|
|
32
|
+
:color="color === 'primary' ? 'on-primary' : 'default'"
|
|
33
|
+
:disabled="disabled"
|
|
34
|
+
class="wt-button-select__select-arrow"
|
|
35
|
+
icon="arrow-down"
|
|
36
|
+
></wt-icon>
|
|
37
|
+
</wt-button>
|
|
38
|
+
</template>
|
|
39
|
+
</wt-context-menu>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref } from 'vue';
|
|
45
|
+
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
/**
|
|
48
|
+
* See context-menu component docs
|
|
49
|
+
*/
|
|
50
|
+
options: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* @values 'primary', 'secondary'
|
|
56
|
+
* @example <wt-button color="secondary"></wt-button>
|
|
57
|
+
*/
|
|
58
|
+
color: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'primary',
|
|
61
|
+
},
|
|
62
|
+
disabled: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const emit = defineEmits([
|
|
69
|
+
/**
|
|
70
|
+
* @event click
|
|
71
|
+
*/
|
|
72
|
+
'click',
|
|
73
|
+
/**
|
|
74
|
+
* Click on option in context-menu
|
|
75
|
+
*
|
|
76
|
+
* @event click:option
|
|
77
|
+
*
|
|
78
|
+
* @property {object} option clicked option object
|
|
79
|
+
* @property {index} index clicked option index in options list
|
|
80
|
+
*/
|
|
81
|
+
'click:option',
|
|
82
|
+
]);
|
|
83
|
+
|
|
84
|
+
const isOpened = ref(false);
|
|
85
|
+
|
|
86
|
+
function selectOption({ option, index }) {
|
|
87
|
+
emit('click:option', option, index);
|
|
88
|
+
isOpened.value = false;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function atClickaway() {
|
|
92
|
+
isOpened.value = false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style lang="scss">
|
|
98
|
+
@import './variables.scss';
|
|
99
|
+
</style>
|
|
100
|
+
|
|
101
|
+
<style lang="scss" scoped>
|
|
102
|
+
|
|
103
|
+
.wt-button-select {
|
|
104
|
+
position: relative;
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: var(--button-select-buttons-gap);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.wt-button-select__button {
|
|
111
|
+
padding: var(--button-select-button-padding);
|
|
112
|
+
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.wt-button-select__select-btn {
|
|
116
|
+
min-width: auto;
|
|
117
|
+
padding: var(--button-select-icon-button-padding);
|
|
118
|
+
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
|
119
|
+
|
|
120
|
+
// OPEN AND SHUT ARROW
|
|
121
|
+
.wt-button-select__select-arrow {
|
|
122
|
+
display: flex;
|
|
123
|
+
transform: rotate(0);
|
|
124
|
+
|
|
125
|
+
&--active {
|
|
126
|
+
transform: rotate(180deg);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
2
|
import WtCheckbox from '../wt-checkbox.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('WtCheckbox', () => {
|
|
7
7
|
it('renders a component', () => {
|
|
@@ -16,24 +16,24 @@ describe('WtCheckbox', () => {
|
|
|
16
16
|
|
|
17
17
|
it('renders label text when passed', () => {
|
|
18
18
|
const label = 'Hello there';
|
|
19
|
-
const wrapper =
|
|
19
|
+
const wrapper = mount(WtCheckbox, {
|
|
20
20
|
stubs: {
|
|
21
21
|
WtLabel,
|
|
22
22
|
WtIcon,
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
props: { label },
|
|
25
25
|
});
|
|
26
26
|
expect(wrapper.find('.wt-checkbox__label').text()).toBe(label);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
it('toggles passed value at click', () => {
|
|
30
30
|
const selected = true;
|
|
31
|
-
const wrapper =
|
|
31
|
+
const wrapper = mount(WtCheckbox, {
|
|
32
32
|
stubs: {
|
|
33
33
|
WtLabel,
|
|
34
34
|
WtIcon,
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
props: { selected },
|
|
37
37
|
});
|
|
38
38
|
wrapper.find('.wt-checkbox__input').trigger('change');
|
|
39
39
|
expect(wrapper.emitted().change[0]).toEqual([!selected]);
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="wt-checkbox"
|
|
4
|
+
:class="{
|
|
5
|
+
'wt-checkbox--active': isChecked,
|
|
6
|
+
'wt-checkbox--outline': outline,
|
|
7
|
+
'wt-checkbox--disabled': disabled,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<wt-label
|
|
11
|
+
v-bind="labelProps"
|
|
12
|
+
class="wt-checkbox__wrapper"
|
|
13
|
+
>
|
|
14
|
+
<input
|
|
15
|
+
class="wt-checkbox__input"
|
|
16
|
+
type="checkbox"
|
|
17
|
+
:value="value"
|
|
18
|
+
:checked="isChecked"
|
|
19
|
+
:disabled="disabled"
|
|
20
|
+
@change="inputHandler"
|
|
21
|
+
>
|
|
22
|
+
<span class="wt-checkbox__checkmark">
|
|
23
|
+
<wt-icon
|
|
24
|
+
:icon="checkboxIcon"
|
|
25
|
+
:color="iconColor"
|
|
26
|
+
></wt-icon>
|
|
27
|
+
</span>
|
|
28
|
+
<!-- @slot Custom label markup -->
|
|
29
|
+
<slot
|
|
30
|
+
v-bind="{ label, isChecked, disabled }"
|
|
31
|
+
name="label"
|
|
32
|
+
>
|
|
33
|
+
<div v-if="label" class="wt-checkbox__label">{{ label }}</div>
|
|
34
|
+
</slot>
|
|
35
|
+
</wt-label>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
name: 'wt-checkbox',
|
|
42
|
+
model: {
|
|
43
|
+
prop: 'selected',
|
|
44
|
+
event: 'change',
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
value: {
|
|
48
|
+
type: [String, Boolean],
|
|
49
|
+
default: '',
|
|
50
|
+
},
|
|
51
|
+
selected: {
|
|
52
|
+
type: [Array, Boolean],
|
|
53
|
+
default: () => [],
|
|
54
|
+
},
|
|
55
|
+
label: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: '',
|
|
58
|
+
},
|
|
59
|
+
disabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
outline: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false,
|
|
66
|
+
},
|
|
67
|
+
labelProps: {
|
|
68
|
+
type: Object,
|
|
69
|
+
description: 'Object with props, passed down to wt-label as props',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
emits: ['change'],
|
|
73
|
+
computed: {
|
|
74
|
+
isChecked() {
|
|
75
|
+
if (typeof this.selected === 'boolean') {
|
|
76
|
+
return this.selected;
|
|
77
|
+
}
|
|
78
|
+
return this.selected.includes(this.value);
|
|
79
|
+
},
|
|
80
|
+
checkboxIcon() {
|
|
81
|
+
return this.isChecked ? 'checkbox--checked' : 'checkbox';
|
|
82
|
+
},
|
|
83
|
+
iconColor() {
|
|
84
|
+
if (this.disabled) return 'disabled';
|
|
85
|
+
if (this.isChecked) return 'active';
|
|
86
|
+
return null;
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
methods: {
|
|
90
|
+
inputHandler() {
|
|
91
|
+
if (typeof this.selected === 'boolean') {
|
|
92
|
+
this.$emit('change', !this.selected);
|
|
93
|
+
} else {
|
|
94
|
+
let selected = [...this.selected];
|
|
95
|
+
if (selected.includes(this.value)) {
|
|
96
|
+
selected = selected.filter((value) => value !== this.value);
|
|
97
|
+
} else {
|
|
98
|
+
selected.push(this.value);
|
|
99
|
+
}
|
|
100
|
+
this.$emit('change', selected);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style lang="scss">
|
|
108
|
+
@import './variables.scss';
|
|
109
|
+
</style>
|
|
110
|
+
|
|
111
|
+
<style lang="scss" scoped>
|
|
112
|
+
|
|
113
|
+
.wt-checkbox {
|
|
114
|
+
@include width-fit-content;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
|
|
117
|
+
.wt-label {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wt-checkbox__wrapper {
|
|
123
|
+
position: relative;
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
user-select: none;
|
|
127
|
+
|
|
128
|
+
.wt-checkbox__checkmark {
|
|
129
|
+
line-height: 0; // prevent icon height >> content
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.wt-checkbox__label {
|
|
134
|
+
margin-left: var(--checkbox-icon-margin);
|
|
135
|
+
transition: var(--transition);
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Hide the browser's default checkbox */
|
|
140
|
+
.wt-checkbox__input {
|
|
141
|
+
position: absolute;
|
|
142
|
+
width: 0;
|
|
143
|
+
height: 0;
|
|
144
|
+
opacity: 0;
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.wt-checkbox:hover {
|
|
149
|
+
.wt-checkbox__label {
|
|
150
|
+
color: var(--form-label--hover-color);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
::v-deep .wt-icon__icon {
|
|
154
|
+
fill: var(--icon-color--hover);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.wt-checkbox--active {
|
|
159
|
+
.wt-checkbox__label {
|
|
160
|
+
color: var(--form-label--active-color);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.wt-checkbox--outline {
|
|
165
|
+
.wt-checkbox__label {
|
|
166
|
+
color: var(--form-outline-label-color);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
::v-deep .wt-icon__icon {
|
|
170
|
+
fill: var(--icon-outline-color);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.wt-checkbox--active {
|
|
174
|
+
.wt-checkbox__label {
|
|
175
|
+
color: var(--form-label--active-color);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
::v-deep .wt-icon__icon {
|
|
179
|
+
fill: var(--icon-outline--active-color);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.wt-checkbox--disabled {
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
|
|
187
|
+
.wt-checkbox__label {
|
|
188
|
+
color: var(--form-label--disabled-color);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="wt-chip" :class="`wt-chip--${color}-color`">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</span>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'wt-chip',
|
|
10
|
+
props: {
|
|
11
|
+
color: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'main',
|
|
14
|
+
options: ['main', 'outline', 'accent', 'secondary', 'secondary-50', 'success', 'danger', 'transfer'],
|
|
15
|
+
notes: '"main" and "outline" are chip-specific colors',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style lang="scss">
|
|
22
|
+
@import './wt-chip.scss';
|
|
23
|
+
@import './variables.scss';
|
|
24
|
+
</style>
|
package/src/components/{atoms/wt-context-menu → wt-context-menu}/__tests__/WtContextMenu.spec.js
RENAMED
|
@@ -3,7 +3,7 @@ import WtContextMenu from '../wt-context-menu.vue';
|
|
|
3
3
|
|
|
4
4
|
describe('WtContextMenu', () => {
|
|
5
5
|
it('renders a component', () => {
|
|
6
|
-
const wrapper = shallowMount(WtContextMenu, {
|
|
6
|
+
const wrapper = shallowMount(WtContextMenu, { props: { options: [] } });
|
|
7
7
|
expect(wrapper.classes('wt-context-menu')).toBe(true);
|
|
8
8
|
});
|
|
9
9
|
});
|