@webitel/ui-sdk 0.1.2-vue3 → 0.1.3-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 +36361 -11605
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +36342 -11586
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import jszipUtils from 'jszip-utils';
|
|
2
2
|
import { saveAs } from 'file-saver';
|
|
3
3
|
import JSZip from 'jszip';
|
|
4
|
+
import path from 'path';
|
|
4
5
|
import generateMediaURL from './scripts/generateMediaURL';
|
|
5
6
|
|
|
6
7
|
/* eslint-disable no-await-in-loop, no-restricted-syntax */
|
|
@@ -47,7 +48,9 @@ export default class FilesExport {
|
|
|
47
48
|
} else {
|
|
48
49
|
const binary = await this._fetchFileBinary(item.id);
|
|
49
50
|
const ext = item.mimeType.split('/').pop();
|
|
50
|
-
|
|
51
|
+
// itemName needed to remove extension from item.name https://stackoverflow.com/a/31615711
|
|
52
|
+
const itemName = path.parse(item.name).name;
|
|
53
|
+
zip.file(`${itemName}.${ext}`, binary);
|
|
51
54
|
this.downloadProgress.count += 1;
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const generateMediaURL = (id) => {
|
|
2
2
|
const token = localStorage.getItem('access-token');
|
|
3
|
-
const BASE_URL = process.env.
|
|
3
|
+
const BASE_URL = process?.env?.VUE_APP_API_URL || import.meta.env.VITE_API_URL;
|
|
4
4
|
return `${BASE_URL}/storage/recordings/${id}/stream?access_token=${token}`;
|
|
5
5
|
};
|
|
6
6
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default class BaseFilterSchema {
|
|
2
|
+
constructor({
|
|
3
|
+
value = '',
|
|
4
|
+
defaultValue = '',
|
|
5
|
+
restore,
|
|
6
|
+
localStorageKey,
|
|
7
|
+
} = {}) {
|
|
8
|
+
this.value = value;
|
|
9
|
+
this.defaultValue = defaultValue;
|
|
10
|
+
if (restore) this.restore = restore;
|
|
11
|
+
if (localStorageKey) this.localStorageKey = localStorageKey;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-pagination
|
|
3
|
+
:next="isNext"
|
|
4
|
+
:prev="page > 1"
|
|
5
|
+
:size="localSize"
|
|
6
|
+
debounce
|
|
7
|
+
@input="localSize = $event"
|
|
8
|
+
@change="setSize(localSize)"
|
|
9
|
+
@next="setPage(+page + 1)"
|
|
10
|
+
@prev="setPage(page - 1)"
|
|
11
|
+
></wt-pagination>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { computed, ref, watch } from 'vue';
|
|
16
|
+
import { useStore } from 'vuex';
|
|
17
|
+
import getNamespacedState from '../../../store/helpers/getNamespacedState';
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
namespace: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
isNext: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const pageFilterName = 'page';
|
|
31
|
+
const sizeFilterName = 'size';
|
|
32
|
+
|
|
33
|
+
const store = useStore();
|
|
34
|
+
|
|
35
|
+
const localSize = ref(0);
|
|
36
|
+
|
|
37
|
+
const page = computed(() => getNamespacedState(store.state, props.namespace)[pageFilterName].value);
|
|
38
|
+
const size = computed(() => getNamespacedState(store.state, props.namespace)[sizeFilterName].value);
|
|
39
|
+
|
|
40
|
+
function setFilter(payload) {
|
|
41
|
+
return store.dispatch(`${props.namespace}/SET_FILTER`, payload);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function setPage(value) {
|
|
45
|
+
return setFilter({ value, filter: pageFilterName });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function setSize(value) {
|
|
49
|
+
if (value === size.value) return;
|
|
50
|
+
// eslint-disable-next-line consistent-return
|
|
51
|
+
return setFilter({ value, filter: sizeFilterName });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
watch(size, () => {
|
|
55
|
+
localSize.value = size.value;
|
|
56
|
+
}, { immediate: true });
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="scss" scoped>
|
|
60
|
+
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-table-column-select
|
|
3
|
+
:headers="headers"
|
|
4
|
+
:static-headers="staticHeaders"
|
|
5
|
+
@change="handleChange"
|
|
6
|
+
></wt-table-column-select>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { computed } from 'vue';
|
|
11
|
+
import { useStore } from 'vuex';
|
|
12
|
+
import getNamespacedState from '../../../store/helpers/getNamespacedState';
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
namespace: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
headers: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
staticHeaders: {
|
|
24
|
+
type: Array,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const emit = defineEmits(
|
|
29
|
+
'change',
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
// const storedProp = 'value';
|
|
33
|
+
const filterQuery = 'fields';
|
|
34
|
+
|
|
35
|
+
const store = useStore();
|
|
36
|
+
|
|
37
|
+
const filterSchema = computed(() => getNamespacedState(store.state, props.namespace)[filterQuery]);
|
|
38
|
+
|
|
39
|
+
function setValue(payload) {
|
|
40
|
+
return store.dispatch(`${props.namespace}/SET_FILTER`, payload);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function setToLocalStorage({ value }) {
|
|
44
|
+
localStorage.setItem(filterSchema.value.localStorageKey, value);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleChange(headers) {
|
|
48
|
+
const value = headers.filter((item) => item.show).map(({ value }) => value);
|
|
49
|
+
const params = {
|
|
50
|
+
filter: filterQuery,
|
|
51
|
+
value,
|
|
52
|
+
};
|
|
53
|
+
setToLocalStorage(params);
|
|
54
|
+
setValue(params);
|
|
55
|
+
emit('change', headers);
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style scoped>
|
|
60
|
+
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useStore } from 'vuex';
|
|
2
|
+
|
|
3
|
+
export const useTableFilters = (namespace) => {
|
|
4
|
+
const store = useStore();
|
|
5
|
+
|
|
6
|
+
const filtersNamespace = `${namespace}/filters`;
|
|
7
|
+
|
|
8
|
+
function restoreFilters(payload) {
|
|
9
|
+
return store.dispatch(`${filtersNamespace}/RESTORE_FILTERS`, payload);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
restoreFilters();
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
filtersNamespace,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"restore" functions for filters
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import deepEqual from 'deep-equal';
|
|
2
|
+
import debounce from '../../../scripts/debounce';
|
|
3
|
+
import isEmpty from '../../../scripts/isEmpty';
|
|
4
|
+
import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule';
|
|
5
|
+
|
|
6
|
+
const SET_FILTER_SOURCE = Object.freeze({
|
|
7
|
+
RESTORE: 'restore', // when filter is restored at session start
|
|
8
|
+
DEFAULT: 'default',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default class FiltersStoreModule extends BaseStoreModule {
|
|
12
|
+
getters = {
|
|
13
|
+
ROUTER: () => console.error('setup ROUTER getter for filters store'),
|
|
14
|
+
TABLE_NAMESPACE: () => console.error('setup TABLE_NAMESPACE getter for filters store'),
|
|
15
|
+
|
|
16
|
+
// get value of specific filter
|
|
17
|
+
GET_FILTER: (state) => (filter) => {
|
|
18
|
+
if (!state[filter]) return null;
|
|
19
|
+
const { value, storedProp, multiple } = state[filter];
|
|
20
|
+
if (multiple) return value.map((item) => item[storedProp]); // if arr, map
|
|
21
|
+
if (storedProp) return value[storedProp]; // if object and has specific prop, return this prop
|
|
22
|
+
return value; // else return val
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
// get all filters values
|
|
26
|
+
GET_FILTERS: (state, getters) => Object.keys(state)
|
|
27
|
+
.reduce((filters, filterKey) => {
|
|
28
|
+
const filterValue = getters.GET_FILTER(filterKey);
|
|
29
|
+
return isEmpty(filterValue) ? filters : {
|
|
30
|
+
...filters,
|
|
31
|
+
[filterKey]: filterValue,
|
|
32
|
+
};
|
|
33
|
+
}, {}),
|
|
34
|
+
|
|
35
|
+
// get value of filter from query string by query key
|
|
36
|
+
GET_VALUE_FROM_QUERY: (state, getters) => ({ filterQuery }) => (
|
|
37
|
+
getters.ROUTER.currentRoute.value.query[filterQuery]
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
actions = {
|
|
42
|
+
SET_FILTER: async (context, {
|
|
43
|
+
filter,
|
|
44
|
+
value,
|
|
45
|
+
source = SET_FILTER_SOURCE.DEFAULT,
|
|
46
|
+
silent = false, // if true, don't call ON_FILTER_SET event
|
|
47
|
+
}) => {
|
|
48
|
+
const { multiple, defaultValue } = context.state[filter];
|
|
49
|
+
|
|
50
|
+
let newValue = value;
|
|
51
|
+
|
|
52
|
+
if (value) {
|
|
53
|
+
if (multiple && !Array.isArray(value)) newValue = [value];
|
|
54
|
+
} else if (value === null || value === undefined) {
|
|
55
|
+
newValue = defaultValue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await context.dispatch('SET_VALUE_TO_QUERY', {
|
|
59
|
+
filterQuery: filter,
|
|
60
|
+
value,
|
|
61
|
+
storedProp: context.state[filter].storedProp,
|
|
62
|
+
});
|
|
63
|
+
context.commit('SET_FILTER', { filter, value: newValue });
|
|
64
|
+
|
|
65
|
+
if (source !== SET_FILTER_SOURCE.RESTORE && filter !== 'page') {
|
|
66
|
+
await context.dispatch('SET_FILTER', {
|
|
67
|
+
filter: 'page',
|
|
68
|
+
value: 1,
|
|
69
|
+
silent: true,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!silent) await context.dispatch('ON_FILTER_SET', { filter, value });
|
|
74
|
+
},
|
|
75
|
+
SET_VALUE_TO_QUERY: async (
|
|
76
|
+
context,
|
|
77
|
+
{ filterQuery, value, storedProp = 'id' },
|
|
78
|
+
) => {
|
|
79
|
+
let newValue = '';
|
|
80
|
+
if (Array.isArray(value)) {
|
|
81
|
+
if (value.length && typeof value[0] !== 'object') {
|
|
82
|
+
newValue = value;
|
|
83
|
+
} else {
|
|
84
|
+
newValue = value.map((item) => item[storedProp]);
|
|
85
|
+
}
|
|
86
|
+
} else if (typeof value === 'object' && value !== null) {
|
|
87
|
+
newValue = value[storedProp];
|
|
88
|
+
} else {
|
|
89
|
+
newValue = value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return context.dispatch('CHANGE_ROUTE_QUERY', ({
|
|
93
|
+
value: newValue,
|
|
94
|
+
filterQuery,
|
|
95
|
+
}));
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
CHANGE_ROUTE_QUERY: (context, { value, filterQuery }) => {
|
|
99
|
+
if (deepEqual(context.getters.GET_VALUE_FROM_QUERY({ filterQuery }), value)) return;
|
|
100
|
+
const query = { ...context.getters.ROUTER.currentRoute.value.query };
|
|
101
|
+
query[filterQuery] = value;
|
|
102
|
+
// eslint-disable-next-line consistent-return
|
|
103
|
+
return context.getters.ROUTER.replace({
|
|
104
|
+
name: context.getters.ROUTER.currentRoute.value.name,
|
|
105
|
+
query,
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
RESTORE_FILTER: async (context, { filter }) => {
|
|
110
|
+
const query = context.getters.GET_VALUE_FROM_QUERY({ filterQuery: filter });
|
|
111
|
+
// note: restore fn may still return value even if there's no query value
|
|
112
|
+
// from localStorage, for instance
|
|
113
|
+
const value = context.state[filter].restore
|
|
114
|
+
? context.state[filter].restore({ query })
|
|
115
|
+
: query;
|
|
116
|
+
if (value) {
|
|
117
|
+
if (filter
|
|
118
|
+
=== 'sort') await context.dispatch('RESTORE_SORT', { value });
|
|
119
|
+
else if (filter
|
|
120
|
+
=== 'fields') await context.dispatch('RESTORE_FIELDS', { value });
|
|
121
|
+
await context.dispatch('SET_FILTER', ({
|
|
122
|
+
filter,
|
|
123
|
+
value,
|
|
124
|
+
source: SET_FILTER_SOURCE.RESTORE,
|
|
125
|
+
}));
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
RESTORE_FILTERS: async (context) => {
|
|
132
|
+
const restores = [];
|
|
133
|
+
for (const filter of Object.keys(context.state)) {
|
|
134
|
+
// collect restores in order to check if there were actually any restores
|
|
135
|
+
// empty restore returns "false"
|
|
136
|
+
const result = await context.dispatch('RESTORE_FILTER', { filter });
|
|
137
|
+
restores.push(result);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// if no filters to restore, call LOAD_LIST manually
|
|
141
|
+
if (restores.every((restore) => restore === false)) {
|
|
142
|
+
context.dispatch('LOAD_DATA_LIST');
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
RESET_FILTERS: (context) => Promise.allSettled(Object.keys(context.state)
|
|
147
|
+
.map((filter) => {
|
|
148
|
+
return context.dispatch('SET_FILTER', {
|
|
149
|
+
filter,
|
|
150
|
+
value: context.state[filter].defaultValue,
|
|
151
|
+
});
|
|
152
|
+
})),
|
|
153
|
+
|
|
154
|
+
ON_FILTER_SET: (
|
|
155
|
+
context,
|
|
156
|
+
{ filter, value },
|
|
157
|
+
) => context.dispatch('LOAD_DATA_LIST'),
|
|
158
|
+
|
|
159
|
+
LOAD_DATA_LIST: (context) => context.dispatch(
|
|
160
|
+
`${context.getters.TABLE_NAMESPACE}/LOAD_DATA_LIST`,
|
|
161
|
+
{ filters: context.getters.GET_FILTERS },
|
|
162
|
+
{ root: true },
|
|
163
|
+
),
|
|
164
|
+
RESTORE_SORT: (context, { value }) => context.dispatch(
|
|
165
|
+
`${context.getters.TABLE_NAMESPACE}/RESTORE_SORT_FROM_FILTER`,
|
|
166
|
+
{ value },
|
|
167
|
+
{ root: true },
|
|
168
|
+
),
|
|
169
|
+
RESTORE_FIELDS: (context, { value }) => context.dispatch(
|
|
170
|
+
`${context.getters.TABLE_NAMESPACE}/RESTORE_FIELDS_FROM_FILTER`,
|
|
171
|
+
{ value },
|
|
172
|
+
{ root: true },
|
|
173
|
+
),
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
mutations = {
|
|
177
|
+
SET_FILTER: (state, { filter, value }) => {
|
|
178
|
+
state[filter].value = value;
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import AbstractApiFilter from '../abstract-api-filter.vue';
|
|
5
5
|
import ApiFilterSchema from '../../classes/ApiFilterSchema';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const router = createRouter({
|
|
8
|
+
history: createWebHistory(),
|
|
9
|
+
routes: [],
|
|
10
|
+
});
|
|
11
11
|
|
|
12
12
|
describe('Abstract Api Filter', () => {
|
|
13
13
|
const namespace = 'jest';
|
|
@@ -17,7 +17,7 @@ describe('Abstract Api Filter', () => {
|
|
|
17
17
|
const fetchSelectedMock = jest.fn(() => ({ items: [] }));
|
|
18
18
|
jest.spyOn(filterSchema, 'search').mockImplementation(searchMock);
|
|
19
19
|
jest.spyOn(filterSchema, 'fetchSelected').mockImplementation(fetchSelectedMock);
|
|
20
|
-
const store =
|
|
20
|
+
const store = createStore({
|
|
21
21
|
modules: {
|
|
22
22
|
[namespace]: {
|
|
23
23
|
namespaced: true,
|
|
@@ -29,10 +29,8 @@ describe('Abstract Api Filter', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const mountOptions = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
router,
|
|
35
|
-
propsData: {
|
|
32
|
+
global: { plugins: [store, router] },
|
|
33
|
+
props: {
|
|
36
34
|
namespace,
|
|
37
35
|
filterQuery,
|
|
38
36
|
},
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import AbstractEnumFilter from '../abstract-enum-filter.vue';
|
|
5
5
|
import EnumFilterSchema from '../../classes/EnumFilterSchema';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const router = createRouter({
|
|
8
|
+
history: createWebHistory(),
|
|
9
|
+
routes: [],
|
|
10
|
+
});
|
|
11
11
|
|
|
12
12
|
describe('Abstract Enum Filter', () => {
|
|
13
13
|
const namespace = 'jest';
|
|
14
14
|
const filterQuery = 'jest';
|
|
15
15
|
const filterSchema = new EnumFilterSchema({ locale: {} });
|
|
16
|
-
const store =
|
|
16
|
+
const store = createStore({
|
|
17
17
|
modules: {
|
|
18
18
|
[namespace]: {
|
|
19
19
|
namespaced: true,
|
|
@@ -25,10 +25,8 @@ describe('Abstract Enum Filter', () => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const mountOptions = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
router,
|
|
31
|
-
propsData: {
|
|
28
|
+
global: { plugins: [store, router] },
|
|
29
|
+
props: {
|
|
32
30
|
namespace,
|
|
33
31
|
filterQuery,
|
|
34
32
|
},
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import DatetimeFilter from '../filter-datetime.vue';
|
|
5
5
|
import BaseFilterSchema from '../../classes/BaseFilterSchema';
|
|
6
6
|
import baseFilterMixin from '../../mixins/baseFilterMixin/baseFilterMixin';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const router = createRouter({
|
|
9
|
+
history: createWebHistory(),
|
|
10
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
11
|
+
});
|
|
12
12
|
|
|
13
13
|
describe('DatetimeFilter Filter', () => {
|
|
14
14
|
const namespace = 'jest';
|
|
15
15
|
const filterQuery = 'jest';
|
|
16
16
|
const filterSchema = new BaseFilterSchema();
|
|
17
|
-
const store =
|
|
17
|
+
const store = createStore({
|
|
18
18
|
modules: {
|
|
19
19
|
[namespace]: {
|
|
20
20
|
namespaced: true,
|
|
@@ -26,10 +26,10 @@ describe('DatetimeFilter Filter', () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const mountOptions = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
global: {
|
|
30
|
+
plugins: [router, store],
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
33
|
namespace,
|
|
34
34
|
filterQuery,
|
|
35
35
|
},
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import BaseFilterSchema from '../../classes/BaseFilterSchema';
|
|
5
5
|
import baseFilterMixin from '../../mixins/baseFilterMixin/baseFilterMixin';
|
|
6
6
|
import FilterFromTo from '../filter-from-to.vue';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const router = createRouter({
|
|
9
|
+
history: createWebHistory(),
|
|
10
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
11
|
+
});
|
|
12
12
|
|
|
13
13
|
describe('FilterFromTo Filter', () => {
|
|
14
14
|
const namespace = 'jest';
|
|
15
15
|
const filterQuery = 'jest';
|
|
16
16
|
const filterSchema = new BaseFilterSchema();
|
|
17
|
-
const store =
|
|
17
|
+
const store = createStore({
|
|
18
18
|
modules: {
|
|
19
19
|
[namespace]: {
|
|
20
20
|
namespaced: true,
|
|
@@ -26,10 +26,8 @@ describe('FilterFromTo Filter', () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const mountOptions = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
router,
|
|
32
|
-
propsData: {
|
|
29
|
+
global: { plugins: [store, router] },
|
|
30
|
+
props: {
|
|
33
31
|
namespace,
|
|
34
32
|
filterQuery,
|
|
35
33
|
},
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import SearchFilter from '../filter-search.vue';
|
|
5
5
|
import BaseFilterSchema from '../../classes/BaseFilterSchema';
|
|
6
6
|
import baseFilterMixin from '../../mixins/baseFilterMixin/baseFilterMixin';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const router = createRouter({
|
|
9
|
+
history: createWebHistory(),
|
|
10
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
11
|
+
});
|
|
12
12
|
|
|
13
13
|
describe('Search Filter', () => {
|
|
14
14
|
const namespace = 'jest';
|
|
15
15
|
const filterQuery = 'jest';
|
|
16
16
|
const filterSchema = new BaseFilterSchema();
|
|
17
|
-
const store =
|
|
17
|
+
const store = createStore({
|
|
18
18
|
modules: {
|
|
19
19
|
[namespace]: {
|
|
20
20
|
namespaced: true,
|
|
@@ -26,10 +26,8 @@ describe('Search Filter', () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const mountOptions = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
router,
|
|
32
|
-
propsData: {
|
|
29
|
+
global: { plugins: [store, router] },
|
|
30
|
+
props: {
|
|
33
31
|
namespace,
|
|
34
32
|
filterQuery,
|
|
35
33
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<wt-select
|
|
3
|
+
v-bind="$attrs"
|
|
3
4
|
:value="filterSchema.value"
|
|
4
5
|
:label="label"
|
|
5
6
|
:track-by="filterSchema.storedProp"
|
|
6
7
|
:multiple="filterSchema.multiple"
|
|
7
8
|
:search-method="search"
|
|
8
9
|
:close-on-select="filterSchema.closeOnSelect"
|
|
9
|
-
v-bind="$attrs"
|
|
10
10
|
@input="setValue({ filter: filterQuery, value: $event })"
|
|
11
11
|
@reset="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
|
|
12
12
|
@closed="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<wt-select
|
|
3
|
+
v-bind="$attrs"
|
|
3
4
|
:value="value"
|
|
4
5
|
:options="localizedOptions"
|
|
5
6
|
:label="label"
|
|
6
7
|
:track-by="filterSchema.storedProp"
|
|
7
8
|
:multiple="filterSchema.multiple"
|
|
8
|
-
v-bind="$attrs"
|
|
9
9
|
@input="setValue({ filter: filterQuery, value: $event })"
|
|
10
10
|
@reset="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
|
|
11
11
|
@closed="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
|