@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
|
+
import AuditFormQuestionOptions from '../audit-form-question-options.vue';
|
|
3
|
+
|
|
4
|
+
describe('AuditFormQuestionOptions', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(AuditFormQuestionOptions, {
|
|
7
|
+
props: {
|
|
8
|
+
question: {},
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
it('adds new question option at "add" button click', () => {
|
|
14
|
+
const wrapper = shallowMount(AuditFormQuestionOptions, {
|
|
15
|
+
props: {
|
|
16
|
+
question: { options: [{}] },
|
|
17
|
+
mode: 'write',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
wrapper.findComponent('.audit-form-question-options-write__add-button').vm.$emit('click');
|
|
21
|
+
expect(wrapper.emitted()['change:question'][0][0].options.length).toBe(2);
|
|
22
|
+
});
|
|
23
|
+
it('deletes existing question option at "delete" icon-btn click', () => {
|
|
24
|
+
const wrapper = mount(AuditFormQuestionOptions, {
|
|
25
|
+
props: {
|
|
26
|
+
question: { options: [{}] },
|
|
27
|
+
mode: 'write',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const writeRow = wrapper.findComponent({ name: 'audit-form-question-options-write-row' });
|
|
31
|
+
writeRow.vm.$emit('delete');
|
|
32
|
+
expect(wrapper.emitted()['change:question'][0][0].options.length).toBe(0);
|
|
33
|
+
});
|
|
34
|
+
it('emits result change with selected radio option score', () => {
|
|
35
|
+
const score = 11;
|
|
36
|
+
const wrapper = shallowMount(AuditFormQuestionOptions, {
|
|
37
|
+
props: {
|
|
38
|
+
question: { options: [{ score }] },
|
|
39
|
+
mode: 'read',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
wrapper.findComponent({ name: 'wt-radio' }).vm.$emit('input', { score });
|
|
43
|
+
expect(wrapper.emitted()['change:result'][0][0]).toEqual({ score });
|
|
44
|
+
});
|
|
45
|
+
});
|
package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="audit-form-question-options-write-row">
|
|
3
|
+
<wt-input
|
|
4
|
+
:label="$t('webitelUI.auditForm.option', 1)"
|
|
5
|
+
:value="option.name"
|
|
6
|
+
:v="v$.option.name"
|
|
7
|
+
prevent-trim
|
|
8
|
+
@input="emit('update:option', { name: $event, score: option.score })"
|
|
9
|
+
></wt-input>
|
|
10
|
+
<wt-input
|
|
11
|
+
:label="$t('webitelUI.auditForm.score', 1)"
|
|
12
|
+
:value="option.score"
|
|
13
|
+
:v="v$.option.score"
|
|
14
|
+
type="number"
|
|
15
|
+
@input="emit('update:option', { name: option.name, score: $event })"
|
|
16
|
+
></wt-input>
|
|
17
|
+
<wt-tooltip class="audit-form-question-options-write-row__tooltip">
|
|
18
|
+
<template v-slot:activator>
|
|
19
|
+
<wt-icon-btn
|
|
20
|
+
:disabled="first"
|
|
21
|
+
icon="bucket"
|
|
22
|
+
@click="emit('delete')"
|
|
23
|
+
></wt-icon-btn>
|
|
24
|
+
</template>
|
|
25
|
+
{{ $t('reusable.delete') }}
|
|
26
|
+
</wt-tooltip>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { useVuelidate } from '@vuelidate/core';
|
|
32
|
+
import { required, minValue, maxValue } from '@vuelidate/validators';
|
|
33
|
+
import { computed, onMounted, toRefs } from 'vue';
|
|
34
|
+
import WtTooltip from '../../../../../components/wt-tooltip/wt-tooltip.vue';
|
|
35
|
+
import WtIconBtn from '../../../../../components/wt-icon-btn/wt-icon-btn.vue';
|
|
36
|
+
import WtInput from '../../../../../components/wt-input/wt-input.vue';
|
|
37
|
+
import decimalValidator from '../../../../../validators/decimalValidator';
|
|
38
|
+
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
option: {
|
|
41
|
+
type: Object,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
first: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const emit = defineEmits([
|
|
51
|
+
'change:option',
|
|
52
|
+
'delete',
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
// is needed for useVuelidate, because props.question/props.result isn't reactive
|
|
56
|
+
const { option } = toRefs(props);
|
|
57
|
+
|
|
58
|
+
const v$ = useVuelidate(
|
|
59
|
+
computed(() => (
|
|
60
|
+
{
|
|
61
|
+
option: {
|
|
62
|
+
name: { required },
|
|
63
|
+
score: {
|
|
64
|
+
required,
|
|
65
|
+
minValue: minValue(0),
|
|
66
|
+
maxValue: maxValue(10),
|
|
67
|
+
decimalValidator: decimalValidator(2),
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
})),
|
|
71
|
+
{ option },
|
|
72
|
+
{ $autoDirty: true },
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// init validation
|
|
76
|
+
onMounted(() => v$.value.$touch());
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss" scoped>
|
|
80
|
+
.audit-form-question-options-write-row {
|
|
81
|
+
display: grid;
|
|
82
|
+
grid-template-columns: 3fr 1fr 24px;
|
|
83
|
+
gap: var(--spacing-sm);
|
|
84
|
+
|
|
85
|
+
&__tooltip {
|
|
86
|
+
padding-top: var(--spacing-md);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article class="audit-form-question-options">
|
|
3
|
+
<div
|
|
4
|
+
v-if="mode === 'write'"
|
|
5
|
+
class="audit-form-question-options-write"
|
|
6
|
+
>
|
|
7
|
+
<options-write-row
|
|
8
|
+
v-for="(option, key) of question.options"
|
|
9
|
+
:key="key"
|
|
10
|
+
:option="option"
|
|
11
|
+
:first="key === 0"
|
|
12
|
+
@update:option="updateQuestion({ path: `options[${key}]`, value: $event })"
|
|
13
|
+
@delete="deleteQuestionOption({ key })"
|
|
14
|
+
></options-write-row>
|
|
15
|
+
<wt-button
|
|
16
|
+
class="audit-form-question-options-write__add-button"
|
|
17
|
+
@click="addQuestionOption"
|
|
18
|
+
>{{ $t('reusable.add') }}
|
|
19
|
+
</wt-button>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
v-else-if="mode === 'read'"
|
|
23
|
+
class="audit-form-question-options-read"
|
|
24
|
+
>
|
|
25
|
+
<wt-radio
|
|
26
|
+
v-for="opt of question.options"
|
|
27
|
+
:key="opt.score+opt.name"
|
|
28
|
+
:label="opt.name"
|
|
29
|
+
:selected="result"
|
|
30
|
+
:value="opt"
|
|
31
|
+
@input="emit('change:result', $event)"
|
|
32
|
+
></wt-radio>
|
|
33
|
+
</div>
|
|
34
|
+
<div v-else>Unknown mode: {{ mode }}</div>
|
|
35
|
+
</article>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
39
|
+
import OptionsWriteRow from './audit-form-question-options-write-row.vue';
|
|
40
|
+
import WtButton from '../../../../../components/wt-button/wt-button.vue';
|
|
41
|
+
import WtRadio from '../../../../../components/wt-radio/wt-radio.vue';
|
|
42
|
+
import updateObject from '../../../../../scripts/updateObject';
|
|
43
|
+
import { generateOption } from '../../../schemas/AuditFormQuestionOptionsSchema';
|
|
44
|
+
|
|
45
|
+
const props = defineProps({
|
|
46
|
+
question: {
|
|
47
|
+
type: Object,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
result: {
|
|
51
|
+
type: Object,
|
|
52
|
+
},
|
|
53
|
+
mode: {
|
|
54
|
+
// options: ['read', 'write']
|
|
55
|
+
type: String,
|
|
56
|
+
default: 'read',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const emit = defineEmits([
|
|
61
|
+
'change:question',
|
|
62
|
+
'change:result',
|
|
63
|
+
]);
|
|
64
|
+
|
|
65
|
+
function updateQuestion({ path, value }) {
|
|
66
|
+
emit('change:question', updateObject({ obj: props.question, path, value }));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function addQuestionOption() {
|
|
70
|
+
const options = [...props.question.options, generateOption()];
|
|
71
|
+
return updateQuestion({ path: 'options', value: options });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function deleteQuestionOption({ key }) {
|
|
75
|
+
const options = [...props.question.options];
|
|
76
|
+
options.splice(key, 1);
|
|
77
|
+
return updateQuestion({ path: 'options', value: options });
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
.audit-form-question-options-write {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: var(--spacing-sm);
|
|
86
|
+
|
|
87
|
+
&__add-button {
|
|
88
|
+
align-self: flex-start;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.audit-form-question-options-read {
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: var(--spacing-sm);
|
|
96
|
+
}
|
|
97
|
+
</style>
|
package/src/modules/AuditForm/components/questions/score/__tests__/audit-form-question-score.spec.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import AuditFormQuestionScore from '../audit-form-question-score.vue';
|
|
3
|
+
|
|
4
|
+
describe('AuditFormQuestionScore', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(AuditFormQuestionScore, {
|
|
7
|
+
props: {
|
|
8
|
+
question: {
|
|
9
|
+
min: 0,
|
|
10
|
+
max: 10,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('emits result change with selected radio score', () => {
|
|
17
|
+
const min = 8;
|
|
18
|
+
const wrapper = shallowMount(AuditFormQuestionScore, {
|
|
19
|
+
props: {
|
|
20
|
+
question: {
|
|
21
|
+
min,
|
|
22
|
+
max: 10,
|
|
23
|
+
},
|
|
24
|
+
mode: 'read',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
wrapper.findComponent({ name: 'wt-radio' }).vm.$emit('input');
|
|
28
|
+
expect(wrapper.emitted()['change:result'][0][0]).toEqual({ score: min });
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article class="audit-form-question-score">
|
|
3
|
+
<div
|
|
4
|
+
v-if="mode === 'write'"
|
|
5
|
+
class="audit-form-question-score-write"
|
|
6
|
+
>
|
|
7
|
+
<wt-input
|
|
8
|
+
:value="question.min"
|
|
9
|
+
:v="v$.question.min"
|
|
10
|
+
:number-min="0"
|
|
11
|
+
:number-max="19"
|
|
12
|
+
:label="$t('reusable.from')"
|
|
13
|
+
type="number"
|
|
14
|
+
required
|
|
15
|
+
@input="updateQuestion({ path: 'min', value: $event })"
|
|
16
|
+
></wt-input>
|
|
17
|
+
<wt-input
|
|
18
|
+
:value="question.max"
|
|
19
|
+
:v="v$.question.max"
|
|
20
|
+
:number-min="1"
|
|
21
|
+
:number-max="20"
|
|
22
|
+
:label="$t('reusable.to')"
|
|
23
|
+
type="number"
|
|
24
|
+
required
|
|
25
|
+
@input="updateQuestion({ path: 'max', value: $event })"
|
|
26
|
+
></wt-input>
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
v-else-if="mode === 'read'"
|
|
30
|
+
class="audit-form-question-score-read"
|
|
31
|
+
>
|
|
32
|
+
<wt-radio
|
|
33
|
+
v-for="(value) of scoreRange"
|
|
34
|
+
:key="value"
|
|
35
|
+
:label="`${value}`"
|
|
36
|
+
:value="value"
|
|
37
|
+
:selected="isResult ? result.score : null"
|
|
38
|
+
@input="emit('change:result', { score: value })"
|
|
39
|
+
></wt-radio>
|
|
40
|
+
</div>
|
|
41
|
+
</article>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup>
|
|
45
|
+
import { useVuelidate } from '@vuelidate/core';
|
|
46
|
+
import { maxValue, minValue, required, integer } from '@vuelidate/validators';
|
|
47
|
+
import { computed, onMounted, toRefs } from 'vue';
|
|
48
|
+
import isEmpty from '../../../../../scripts/isEmpty';
|
|
49
|
+
import updateObject from '../../../../../scripts/updateObject';
|
|
50
|
+
import WtRadio from '../../../../../components/wt-radio/wt-radio.vue';
|
|
51
|
+
import WtInput from '../../../../../components/wt-input/wt-input.vue';
|
|
52
|
+
|
|
53
|
+
const props = defineProps({
|
|
54
|
+
question: {
|
|
55
|
+
type: Object,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
result: {
|
|
59
|
+
type: Object,
|
|
60
|
+
},
|
|
61
|
+
mode: {
|
|
62
|
+
// options: ['read', 'write']
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'read',
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const emit = defineEmits([
|
|
69
|
+
'change:question',
|
|
70
|
+
'change:result',
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
// is needed for useVuelidate, because props.question/props.result isn't reactive
|
|
74
|
+
const { question } = toRefs(props);
|
|
75
|
+
|
|
76
|
+
const v$ = useVuelidate(
|
|
77
|
+
computed(() => (
|
|
78
|
+
{
|
|
79
|
+
question: {
|
|
80
|
+
min: {
|
|
81
|
+
minValue: minValue(0),
|
|
82
|
+
maxValue: maxValue(9),
|
|
83
|
+
required,
|
|
84
|
+
integer,
|
|
85
|
+
},
|
|
86
|
+
max: {
|
|
87
|
+
minValue: minValue(1),
|
|
88
|
+
maxValue: maxValue(10),
|
|
89
|
+
required,
|
|
90
|
+
integer,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
})),
|
|
94
|
+
{ question },
|
|
95
|
+
{ $autoDirty: true },
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const scoreRange = computed(() => {
|
|
99
|
+
if (props.question.min > props.question.max) return [];
|
|
100
|
+
const result = [];
|
|
101
|
+
let i = +props.question.min;
|
|
102
|
+
do {
|
|
103
|
+
result.push(i);
|
|
104
|
+
i += 1;
|
|
105
|
+
} while (i <= props.question.max);
|
|
106
|
+
return result;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const isResult = computed(() => !isEmpty(props.result));
|
|
110
|
+
|
|
111
|
+
function updateQuestion({ path, value }) {
|
|
112
|
+
emit('change:question', updateObject({ obj: props.question, path, value }));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// init validation
|
|
116
|
+
onMounted(() => v$.value.$touch());
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<style lang="scss" scoped>
|
|
120
|
+
.audit-form-question-score-write {
|
|
121
|
+
display: grid;
|
|
122
|
+
grid-template-columns: 100px 100px;
|
|
123
|
+
gap: var(--spacing-sm);
|
|
124
|
+
margin-right: calc(var(--spacing-sm) + 24px); // icon offset
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.audit-form-question-score-read {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-wrap: wrap;
|
|
130
|
+
gap: var(--spacing-sm);
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EngineAuditQuestionType } from 'webitel-sdk';
|
|
2
|
+
|
|
3
|
+
export const generateOption = () => ({
|
|
4
|
+
name: '',
|
|
5
|
+
score: 10,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const generateQuestionOptionsSchema = () => ({
|
|
9
|
+
type: EngineAuditQuestionType.Option,
|
|
10
|
+
options: [
|
|
11
|
+
generateOption(),
|
|
12
|
+
],
|
|
13
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { generateQuestionScoreSchema } from './AuditFormQuestionScoreSchema';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
4
|
+
export const generateQuestionSchema = ({ required = true } = {}) => ({
|
|
5
|
+
required,
|
|
6
|
+
question: '',
|
|
7
|
+
...generateQuestionScoreSchema(),
|
|
8
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { useStore } from 'vuex';
|
|
3
|
+
import getNamespacedState from '../../../store/helpers/getNamespacedState';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
6
|
+
export const useCardStore = (namespace) => {
|
|
7
|
+
const store = useStore();
|
|
8
|
+
|
|
9
|
+
const cardNamespace = `${namespace}/card`;
|
|
10
|
+
|
|
11
|
+
const id = computed(() => getNamespacedState(store.state, cardNamespace).itemId);
|
|
12
|
+
const itemInstance = computed(() => getNamespacedState(store.state, cardNamespace).itemInstance);
|
|
13
|
+
|
|
14
|
+
function loadItem(payload) {
|
|
15
|
+
return store.dispatch(`${cardNamespace}/LOAD_ITEM`, payload);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function addItem(payload) {
|
|
19
|
+
return store.dispatch(`${cardNamespace}/ADD_ITEM`, payload);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function updateItem(payload) {
|
|
23
|
+
return store.dispatch(`${cardNamespace}/UPDATE_ITEM`, payload);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function setId(payload) {
|
|
27
|
+
return store.dispatch(`${cardNamespace}/SET_ITEM_ID`, payload);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function resetState() {
|
|
31
|
+
return store.dispatch(`${cardNamespace}/RESET_ITEM_STATE`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function setItemProp(payload) {
|
|
35
|
+
return store.dispatch(`${cardNamespace}/SET_ITEM_PROPERTY`, payload);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function deleteItem(payload) {
|
|
39
|
+
return store.dispatch(`${cardNamespace}/DELETE_ITEM`, payload);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
namespace: cardNamespace,
|
|
44
|
+
id,
|
|
45
|
+
itemInstance,
|
|
46
|
+
|
|
47
|
+
loadItem,
|
|
48
|
+
addItem,
|
|
49
|
+
updateItem,
|
|
50
|
+
setId,
|
|
51
|
+
resetState,
|
|
52
|
+
setItemProp,
|
|
53
|
+
deleteItem,
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import deepCopy from 'deep-copy';
|
|
2
|
+
import set from 'lodash/set';
|
|
3
|
+
import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule';
|
|
4
|
+
|
|
5
|
+
export default class CardStoreModule extends BaseStoreModule {
|
|
6
|
+
state = {
|
|
7
|
+
itemId: 0,
|
|
8
|
+
itemInstance: {},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
actions = {
|
|
12
|
+
SET_PARENT_ITEM_ID: (context, id) => {
|
|
13
|
+
context.commit('SET_PARENT_ITEM_ID', id);
|
|
14
|
+
},
|
|
15
|
+
SET_ITEM_ID: (context, id) => {
|
|
16
|
+
if (id !== 'new') context.commit('SET_ITEM_ID', id);
|
|
17
|
+
else context.commit('SET_ITEM_ID', 0);
|
|
18
|
+
},
|
|
19
|
+
LOAD_ITEM: async (context) => {
|
|
20
|
+
if (context.state.itemId) {
|
|
21
|
+
const item = await context.dispatch('api/GET_ITEM', { context });
|
|
22
|
+
context.commit('SET_ITEM', item);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
ADD_ITEM: async (context) => {
|
|
26
|
+
if (!context.state.itemId) {
|
|
27
|
+
const { id } = await context.dispatch('api/POST_ITEM', { context });
|
|
28
|
+
await context.dispatch('SET_ITEM_ID', id);
|
|
29
|
+
context.dispatch('LOAD_ITEM');
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
UPDATE_ITEM: async (context) => {
|
|
33
|
+
await context.dispatch('api/UPD_ITEM', { context });
|
|
34
|
+
context.dispatch('LOAD_ITEM');
|
|
35
|
+
},
|
|
36
|
+
SET_ITEM_PROPERTY: (context, payload) => {
|
|
37
|
+
context.commit('SET_ITEM_PROPERTY', payload);
|
|
38
|
+
context.commit('SET_ITEM_PROPERTY', { path: '_dirty', value: true });
|
|
39
|
+
},
|
|
40
|
+
RESET_ITEM_STATE: async (context) => {
|
|
41
|
+
context.commit('RESET_ITEM_STATE');
|
|
42
|
+
},
|
|
43
|
+
DELETE_ITEM: async (context, { id }) => {
|
|
44
|
+
await context.dispatch('api/DELETE_ITEM', {context, id});
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
mutations = {
|
|
49
|
+
SET_PARENT_ITEM_ID: (state, id) => {
|
|
50
|
+
state.parentId = id;
|
|
51
|
+
},
|
|
52
|
+
SET_ITEM_ID: (state, id) => {
|
|
53
|
+
state.itemId = id;
|
|
54
|
+
},
|
|
55
|
+
SET_ITEM_PROPERTY: (state, { prop, value, path }) => {
|
|
56
|
+
if (path) {
|
|
57
|
+
set(state.itemInstance, path, value);
|
|
58
|
+
} else {
|
|
59
|
+
// DEPRECATED, LEGACY CODE
|
|
60
|
+
state.itemInstance[prop] = value;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
SET_ITEM: (state, item) => {
|
|
64
|
+
state.itemInstance = item;
|
|
65
|
+
},
|
|
66
|
+
RESET_ITEM_STATE: (state) => {
|
|
67
|
+
Object.assign(state, deepCopy(this.state));
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
getModule({
|
|
72
|
+
state = {},
|
|
73
|
+
...rest
|
|
74
|
+
} = {}) {
|
|
75
|
+
this.state = {
|
|
76
|
+
...this.state,
|
|
77
|
+
...state,
|
|
78
|
+
};
|
|
79
|
+
return super.getModule({
|
|
80
|
+
...rest,
|
|
81
|
+
state: deepCopy(this.state),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-popup
|
|
3
|
+
class="delete-confirmation-popup"
|
|
4
|
+
min-width="480"
|
|
5
|
+
@close="close"
|
|
6
|
+
>
|
|
7
|
+
<template v-slot:title>{{ $t('webitelUI.deleteConfirmationPopup.title') }}</template>
|
|
8
|
+
<template v-slot:main>
|
|
9
|
+
<p>
|
|
10
|
+
{{ deleteMessage }}
|
|
11
|
+
{{ $t('webitelUI.deleteConfirmationPopup.undoneActionAlert') }}
|
|
12
|
+
</p>
|
|
13
|
+
</template>
|
|
14
|
+
<template v-slot:actions>
|
|
15
|
+
<wt-button
|
|
16
|
+
color="secondary"
|
|
17
|
+
:disabled="isDeleting"
|
|
18
|
+
@click="close"
|
|
19
|
+
>{{ $t('reusable.cancel') }}
|
|
20
|
+
</wt-button>
|
|
21
|
+
<wt-button
|
|
22
|
+
color="danger"
|
|
23
|
+
:loading="isDeleting"
|
|
24
|
+
@click="confirm"
|
|
25
|
+
>{{ $t('reusable.delete') }}
|
|
26
|
+
</wt-button>
|
|
27
|
+
</template>
|
|
28
|
+
</wt-popup>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup>
|
|
32
|
+
import { computed, ref } from 'vue';
|
|
33
|
+
import { useI18n } from 'vue-i18n';
|
|
34
|
+
|
|
35
|
+
const props = defineProps({
|
|
36
|
+
deleteCount: {
|
|
37
|
+
type: Number,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
callback: {
|
|
41
|
+
type: Function,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const emit = defineEmits([
|
|
47
|
+
'close',
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
const { t } = useI18n();
|
|
51
|
+
|
|
52
|
+
const isDeleting = ref(false);
|
|
53
|
+
|
|
54
|
+
const deleteMessage = computed(() => {
|
|
55
|
+
if (props.deleteCount === 0) {
|
|
56
|
+
return t(
|
|
57
|
+
'webitelUI.deleteConfirmationPopup.askingAlert',
|
|
58
|
+
2,
|
|
59
|
+
null,
|
|
60
|
+
{ count: t('webitelUI.deleteConfirmationPopup.deleteAll') },
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
return t(
|
|
64
|
+
'webitelUI.deleteConfirmationPopup.askingAlert',
|
|
65
|
+
{ count: props.deleteCount },
|
|
66
|
+
null,
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
function close() {
|
|
71
|
+
emit('close');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function confirm() {
|
|
75
|
+
try {
|
|
76
|
+
isDeleting.value = true;
|
|
77
|
+
await props.callback();
|
|
78
|
+
close();
|
|
79
|
+
} finally {
|
|
80
|
+
isDeleting.value = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
4
|
+
export const useDeleteConfirmationPopup = () => {
|
|
5
|
+
const isVisible = ref(false);
|
|
6
|
+
const deleteCount = ref(null);
|
|
7
|
+
const deleteCallback = ref(null);
|
|
8
|
+
|
|
9
|
+
function askDeleteConfirmation({ deleted, callback }) {
|
|
10
|
+
if (Array.isArray(deleted)) deleteCount.value = deleted.length;
|
|
11
|
+
else deleteCount.value = 1;
|
|
12
|
+
isVisible.value = true;
|
|
13
|
+
deleteCallback.value = callback;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function closeDelete() {
|
|
17
|
+
isVisible.value = false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
isVisible,
|
|
22
|
+
deleteCount,
|
|
23
|
+
deleteCallback,
|
|
24
|
+
|
|
25
|
+
askDeleteConfirmation,
|
|
26
|
+
closeDelete,
|
|
27
|
+
};
|
|
28
|
+
};
|