@webitel/ui-sdk 0.1.13 → 0.1.100
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 +29 -29
- package/dist/img/plyr.svg +68 -0
- package/dist/img/sprite/account.svg +4 -0
- package/dist/img/sprite/adfs.svg +5 -0
- package/dist/img/sprite/app-navigator.svg +11 -0
- package/dist/img/sprite/arrow-down.svg +3 -0
- package/dist/img/sprite/arrow-left.svg +3 -0
- package/dist/img/sprite/arrow-right.svg +3 -0
- package/dist/img/sprite/arrow-up.svg +3 -0
- package/dist/img/sprite/attach.svg +3 -0
- package/dist/img/sprite/attention.svg +3 -0
- package/dist/img/sprite/back.svg +4 -0
- package/dist/img/sprite/bell-badged.svg +4 -0
- package/dist/img/sprite/bell.svg +3 -0
- package/dist/img/sprite/bucket.svg +3 -0
- package/dist/img/sprite/calendar.svg +3 -0
- package/dist/img/sprite/call--filled.svg +3 -0
- package/dist/img/sprite/call-add-to--filled.svg +4 -0
- package/dist/img/sprite/call-add-to.svg +4 -0
- package/dist/img/sprite/call-disconnect--filled.svg +3 -0
- package/dist/img/sprite/call-disconnect.svg +3 -0
- package/dist/img/sprite/call-end--filled.svg +3 -0
- package/dist/img/sprite/call-end.svg +3 -0
- package/dist/img/sprite/call-inbound--filled.svg +4 -0
- package/dist/img/sprite/call-inbound.svg +3 -0
- package/dist/img/sprite/call-missed--filled.svg +4 -0
- package/dist/img/sprite/call-missed.svg +3 -0
- package/dist/img/sprite/call-outbound--filled.svg +3 -0
- package/dist/img/sprite/call-outbound.svg +3 -0
- package/dist/img/sprite/call-ringing--filled.svg +5 -0
- package/dist/img/sprite/call-ringing.svg +3 -0
- package/dist/img/sprite/call-transfer--filled.svg +4 -0
- package/dist/img/sprite/call-transfer.svg +3 -0
- package/dist/img/sprite/call.svg +3 -0
- package/dist/img/sprite/chat--filled.svg +3 -0
- package/dist/img/sprite/chat-emoji.svg +3 -0
- package/dist/img/sprite/chat-end--filled.svg +3 -0
- package/dist/img/sprite/chat-end.svg +4 -0
- package/dist/img/sprite/chat-group.svg +5 -0
- package/dist/img/sprite/chat-join.svg +4 -0
- package/dist/img/sprite/chat-message-status-read.svg +3 -0
- package/dist/img/sprite/chat-message-status-sent.svg +3 -0
- package/dist/img/sprite/chat-quick-response--filled.svg +3 -0
- package/dist/img/sprite/chat-quick-response.svg +3 -0
- package/dist/img/sprite/chat-reply.svg +3 -0
- package/dist/img/sprite/chat-send.svg +6 -0
- package/dist/img/sprite/chat-transfer--filled.svg +3 -0
- package/dist/img/sprite/chat-transfer.svg +4 -0
- package/dist/img/sprite/chat.svg +3 -0
- package/dist/img/sprite/checkbox--checked--filled.svg +3 -0
- package/dist/img/sprite/checkbox--checked.svg +3 -0
- package/dist/img/sprite/checkbox.svg +3 -0
- package/dist/img/sprite/clear.svg +3 -0
- package/dist/img/sprite/close--filled.svg +3 -0
- package/dist/img/sprite/close.svg +3 -0
- package/dist/img/sprite/collapse.svg +5 -0
- package/dist/img/sprite/column-select.svg +4 -0
- package/dist/img/sprite/contacts.svg +3 -0
- package/dist/img/sprite/copy.svg +3 -0
- package/dist/img/sprite/docs.svg +6 -0
- package/dist/img/sprite/done.svg +4 -0
- package/dist/img/sprite/download.svg +5 -0
- package/dist/img/sprite/edit.svg +3 -0
- package/dist/img/sprite/expand.svg +5 -0
- package/dist/img/sprite/eye--closed.svg +5 -0
- package/dist/img/sprite/eye--opened.svg +4 -0
- package/dist/img/sprite/filter.svg +5 -0
- package/dist/img/sprite/generate.svg +4 -0
- package/dist/img/sprite/google.svg +6 -0
- package/dist/img/sprite/history.svg +4 -0
- package/dist/img/sprite/hold.svg +3 -0
- package/dist/img/sprite/index.js +120 -0
- package/dist/img/sprite/lock.svg +3 -0
- package/dist/img/sprite/logout.svg +3 -0
- package/dist/img/sprite/menu.svg +3 -0
- package/dist/img/sprite/messenger-facebook.svg +3 -0
- package/dist/img/sprite/messenger-infobip.svg +9 -0
- package/dist/img/sprite/messenger-telegram.svg +6 -0
- package/dist/img/sprite/messenger-viber.svg +3 -0
- package/dist/img/sprite/messenger-web-chat.svg +7 -0
- package/dist/img/sprite/messenger-whatsapp.svg +4 -0
- package/dist/img/sprite/mic-muted.svg +6 -0
- package/dist/img/sprite/mic.svg +4 -0
- package/dist/img/sprite/move.svg +6 -0
- package/dist/img/sprite/note.svg +3 -0
- package/dist/img/sprite/numpad.svg +24 -0
- package/dist/img/sprite/pause.svg +3 -0
- package/dist/img/sprite/play.svg +4 -0
- package/dist/img/sprite/plus.svg +3 -0
- package/dist/img/sprite/prompter.svg +3 -0
- package/dist/img/sprite/queue-member.svg +3 -0
- package/dist/img/sprite/radio--checked.svg +4 -0
- package/dist/img/sprite/radio.svg +3 -0
- package/dist/img/sprite/rec-off.svg +3 -0
- package/dist/img/sprite/rec.svg +4 -0
- package/dist/img/sprite/refresh.svg +4 -0
- package/dist/img/sprite/rounded-info.svg +3 -0
- package/dist/img/sprite/search.svg +3 -0
- package/dist/img/sprite/send-arrow.svg +4 -0
- package/dist/img/sprite/settings.svg +3 -0
- package/dist/img/sprite/sort-arrow-down.svg +4 -0
- package/dist/img/sprite/sort-arrow-up.svg +4 -0
- package/dist/img/sprite/sound-off.svg +4 -0
- package/dist/img/sprite/sound-on.svg +3 -0
- package/dist/img/sprite/star--filled.svg +3 -0
- package/dist/img/sprite/star.svg +3 -0
- package/dist/img/sprite/stop.svg +4 -0
- package/dist/img/sprite/tick.svg +3 -0
- package/dist/img/sprite/upload.svg +5 -0
- package/dist/img/sprite/video-off.svg +4 -0
- package/dist/img/sprite/video.svg +3 -0
- package/dist/img/sprite/widget-avg-hold.svg +3 -0
- package/dist/img/sprite/widget-avg-talk.svg +8 -0
- package/dist/img/sprite/widget-handles.svg +4 -0
- package/dist/img/sprite/widget-inbound.svg +6 -0
- package/dist/img/sprite/widget-missed.svg +5 -0
- package/dist/img/sprite/widget-occupancy.svg +5 -0
- package/dist/img/sprite/widget-utilization.svg +6 -0
- package/dist/img/sprite/zoom-in.svg +3 -0
- package/dist/img/sprite/zoom-out.svg +3 -0
- package/dist/ui-sdk.common.js +8729 -4165
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +8729 -4165
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +3 -1
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +64 -42
- package/src/components/atoms/wt-badge/__tests__/WtBadge.spec.js +19 -0
- package/src/components/atoms/wt-badge/wt-badge.vue +23 -0
- package/src/components/atoms/wt-button/__tests__/WtButton.spec.js +29 -0
- package/src/components/atoms/wt-button/wt-button.vue +211 -0
- package/src/components/atoms/wt-context-menu/__tests__/WtContextMenu.spec.js +43 -0
- package/src/components/atoms/wt-context-menu/wt-context-menu.vue +78 -0
- package/src/components/atoms/wt-divider/__tests__/WtDivider.spec.js +9 -0
- package/src/components/atoms/wt-divider/wt-divider.vue +25 -0
- package/src/components/atoms/wt-icon/__tests__/WtIcon.spec.js +24 -0
- package/src/components/atoms/wt-icon/wt-icon.vue +134 -0
- package/src/components/atoms/wt-indicator/__tests__/WtIndicator.spec.js +29 -0
- package/src/components/atoms/wt-indicator/wt-indicator.vue +81 -0
- package/src/components/atoms/wt-input-info/__tests__/WtInputInfo.spec.js +9 -0
- package/src/components/atoms/wt-input-info/wt-input-info.vue +35 -0
- package/src/components/atoms/wt-loader/__tests__/WtLoader.spec.js +9 -0
- package/src/components/atoms/wt-loader/_internals/wt-loader--md.vue +83 -0
- package/src/components/atoms/wt-loader/_internals/wt-loader--sm.vue +189 -0
- package/src/components/atoms/wt-loader/wt-loader.vue +34 -0
- package/src/components/atoms/wt-rounded-action/__tests__/WtRoundedAction.spec.js +20 -0
- package/src/components/atoms/wt-rounded-action/wt-rounded-action.vue +227 -0
- package/src/components/atoms/wt-tooltip/__tests__/WtTooltip.spec.js +29 -0
- package/src/components/atoms/wt-tooltip/wt-tooltip.vue +54 -0
- package/src/components/index.js +102 -0
- package/src/components/molecules/wt-button-select/__tests__/WtButtonSelect.spec.js +63 -0
- package/src/components/molecules/wt-button-select/wt-button-select.vue +187 -0
- package/src/components/molecules/wt-checkbox/__tests__/WtCheckbox.spec.js +41 -0
- package/src/components/molecules/wt-checkbox/wt-checkbox.vue +175 -0
- package/src/components/molecules/wt-datepicker/__tests__/WtDatepicker.spec.js +28 -0
- package/src/components/molecules/wt-datepicker/wt-datepicker.vue +209 -0
- package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +67 -0
- package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +314 -0
- package/src/components/molecules/wt-icon-btn/__tests__/WtIconBtn.spec.js +31 -0
- package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +113 -0
- package/src/components/molecules/wt-input/__tests__/WtInput.spec.js +25 -0
- package/src/components/molecules/wt-input/wt-input.vue +342 -0
- package/src/components/molecules/wt-label/__tests__/WtLabel.spec.js +9 -0
- package/src/components/molecules/wt-label/wt-label.vue +87 -0
- package/src/components/molecules/wt-notification/__tests__/WtNotification.spec.js +21 -0
- package/src/components/molecules/wt-notification/wt-notification.vue +74 -0
- package/src/components/molecules/wt-popup/__tests__/WtPopup.spec.js +47 -0
- package/src/components/molecules/wt-popup/wt-popup.vue +130 -0
- package/src/components/molecules/wt-progress-bar/__tests__/WtProgressBar.spec.js +17 -0
- package/src/components/molecules/wt-progress-bar/wt-progress-bar.vue +80 -0
- package/src/components/molecules/wt-radio/__tests__/WtRadio.spec.js +42 -0
- package/src/components/molecules/wt-radio/wt-radio.vue +168 -0
- package/src/components/molecules/wt-search-bar/__tests__/WtSearchBar.spec.js +36 -0
- package/src/components/molecules/wt-search-bar/wt-search-bar.vue +205 -0
- package/src/components/molecules/wt-select/__tests__/WtSelect.spec.js +53 -0
- package/src/components/molecules/wt-select/wt-select.vue +553 -0
- package/src/components/molecules/wt-slider/__tests__/WtSlider.spec.js +9 -0
- package/src/components/molecules/wt-slider/wt-slider.vue +175 -0
- package/src/components/molecules/wt-switcher/__tests__/WtSwitcher.spec.js +31 -0
- package/src/components/molecules/wt-switcher/wt-switcher.vue +177 -0
- package/src/components/molecules/wt-tabs/__tests__/WtTabs.spec.js +36 -0
- package/src/components/molecules/wt-tabs/wt-tabs.vue +127 -0
- package/src/components/molecules/wt-tags-input/__tests__/WtTagsInput.spec.js +45 -0
- package/src/components/molecules/wt-tags-input/wt-tags-input.vue +295 -0
- package/src/components/molecules/wt-textarea/__tests__/WtTextarea.spec.js +46 -0
- package/src/components/molecules/wt-textarea/wt-textarea.vue +185 -0
- package/src/components/molecules/wt-time-input/__tests__/WtTimeInput.spec.js +25 -0
- package/src/components/molecules/wt-time-input/wt-time-input.vue +192 -0
- package/src/components/molecules/wt-timepicker/__tests__/WtTimepicker.spec.js +60 -0
- package/src/components/molecules/wt-timepicker/wt-timepicker.vue +176 -0
- package/src/components/organisms/wt-app-header/__tests__/WtAppHeader.spec.js +19 -0
- package/src/components/organisms/wt-app-header/__tests__/WtAppNavigator.spec.js +23 -0
- package/src/components/organisms/wt-app-header/__tests__/WtHeaderActions.spec.js +21 -0
- package/src/components/organisms/wt-app-header/wt-app-header.vue +23 -0
- package/src/components/organisms/wt-app-header/wt-app-navigator.vue +245 -0
- package/src/components/organisms/wt-app-header/wt-header-actions.vue +177 -0
- package/src/components/organisms/wt-error-page/__tests__/wt-error-page.spec.js +17 -0
- package/src/components/organisms/wt-error-page/wt-error-page.vue +104 -0
- package/src/components/organisms/wt-filters-panel-wrapper/__tests__/wt-filters-panel-wrapper.spec.js +24 -0
- package/src/components/organisms/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +146 -0
- package/src/components/organisms/wt-headline/__tests__/WtHeadline.spec.js +47 -0
- package/src/components/organisms/wt-headline/wt-headline.vue +46 -0
- package/src/components/organisms/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +64 -0
- package/src/components/organisms/wt-navigation-bar/wt-navigation-bar.vue +249 -0
- package/src/components/organisms/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +50 -0
- package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +71 -0
- package/src/components/organisms/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +33 -0
- package/src/components/organisms/wt-page-wrapper/wt-page-wrapper.vue +60 -0
- package/src/components/organisms/wt-pagination/__tests__/WtPagination.spec.js +38 -0
- package/src/components/organisms/wt-pagination/wt-pagination.vue +134 -0
- package/src/components/organisms/wt-player/__tests__/WtPlayer.spec.js +9 -0
- package/src/components/organisms/wt-player/wt-player.vue +139 -0
- package/src/components/organisms/wt-status-select/__tests__/WtStatusSelect.spec.js +25 -0
- package/src/components/organisms/wt-status-select/_internals/StatusOptions.lookup.js +24 -0
- package/src/components/organisms/wt-status-select/wt-status-select.vue +110 -0
- package/src/components/organisms/wt-table/__tests__/WtTable.spec.js +133 -0
- package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +9 -0
- package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +9 -0
- package/src/components/organisms/wt-table/_internals/getSortOrder.js +12 -0
- package/src/components/organisms/wt-table/table-cells/wt-table-delete-action.vue +18 -0
- package/src/components/organisms/wt-table/table-cells/wt-table-edit-action.vue +19 -0
- package/src/components/organisms/wt-table/wt-table.vue +241 -0
- package/src/components/organisms/wt-table-actions/__tests__/WtTableActions.spec.js +9 -0
- package/src/components/organisms/wt-table-actions/wt-table-actions.vue +90 -0
- package/src/components/organisms/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +31 -0
- package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +116 -0
- package/src/components/transitions/__tests__/ExpandTransition.spec.js +9 -0
- package/src/components/transitions/expand-transition.vue +70 -0
- package/src/css/colors/_colors.scss +151 -67
- package/src/css/components/_components.scss +41 -25
- package/src/css/components/atoms/wt-badge/_variables.scss +6 -5
- package/src/css/components/atoms/wt-badge/wt-badge.scss +40 -8
- package/src/css/components/atoms/wt-button/_variables.scss +45 -46
- package/src/css/components/atoms/wt-context-menu/_variables.scss +10 -0
- package/src/css/components/atoms/wt-divider/_variables.scss +4 -4
- package/src/css/components/atoms/wt-icon/_variables.scss +7 -28
- package/src/css/components/atoms/wt-indicator/_variables.scss +18 -0
- package/src/css/components/atoms/wt-input-info/_variables.scss +6 -5
- package/src/css/components/atoms/wt-label/_variables.scss +4 -4
- package/src/css/components/atoms/wt-loader/_variables.scss +7 -7
- package/src/css/components/atoms/wt-rounded-action/_variables.scss +30 -0
- package/src/css/components/atoms/wt-tooltip/_variables.scss +9 -9
- package/src/css/components/molecules/wt-button-select/_variables.scss +21 -0
- package/src/css/components/molecules/wt-checkbox/_variables.scss +3 -3
- package/src/css/components/molecules/wt-datepicker/_variables.scss +20 -20
- package/src/css/components/molecules/wt-datepicker/datepicker-calendar.scss +101 -100
- package/src/css/components/molecules/wt-datetimepicker/_variables.scss +11 -11
- package/src/css/components/molecules/wt-icon-btn/_variables.scss +2 -2
- package/src/css/components/molecules/wt-input/_variables.scss +7 -5
- package/src/css/components/molecules/wt-notification/_variables.scss +9 -9
- package/src/css/components/molecules/wt-popup/_variables.scss +11 -10
- package/src/css/components/molecules/wt-progress-bar/_variables.scss +11 -0
- package/src/css/components/molecules/wt-radio/_variables.scss +6 -6
- package/src/css/components/molecules/wt-search-bar/_variables.scss +3 -3
- package/src/css/components/molecules/wt-select/_variables.scss +25 -23
- package/src/css/components/molecules/wt-slider/_variables.scss +15 -0
- package/src/css/components/molecules/wt-switcher/_variables.scss +17 -14
- package/src/css/components/molecules/wt-tabs/_variables.scss +13 -13
- package/src/css/components/molecules/wt-tags-input/_variables.scss +25 -0
- package/src/css/components/molecules/wt-textarea/_variables.scss +4 -4
- package/src/css/components/molecules/wt-timepicker/_variables.scss +4 -3
- package/src/css/components/organisms/wt-app-header/_variables.scss +20 -0
- package/src/css/components/organisms/wt-headline/_variables.scss +7 -0
- package/src/css/components/organisms/wt-navigation-bar/_variables.scss +14 -0
- package/src/css/components/organisms/wt-notifications-bar/_variables.scss +7 -0
- package/src/css/components/organisms/wt-page-wrapper/_variables.scss +5 -0
- package/src/css/components/organisms/wt-pagination/_variables.scss +6 -6
- package/src/css/components/organisms/wt-player/_variables.scss +8 -0
- package/src/css/components/organisms/wt-status-select/_variables.scss +6 -0
- package/src/css/components/organisms/wt-table/_variables.scss +16 -0
- package/src/css/components/organisms/wt-table-actions/_variables.scss +4 -0
- package/src/css/display-helpers/_display-helpers.scss +21 -0
- package/src/css/fonts/_fonts.scss +9 -0
- package/src/css/main.scss +67 -65
- package/src/css/shadows/_shadows.scss +7 -0
- package/src/css/sizes/_sizes.scss +2 -0
- package/src/css/sizes/_spacing.scss +33 -0
- package/src/css/sizes/_viewport-breakpoints.scss +20 -0
- package/src/css/styleguide/{styleguide.scss → _styleguide.scss} +4 -3
- package/src/css/styleguide/scroll.scss +43 -40
- package/src/css/transitions/_transitions.scss +1 -0
- package/src/css/transitions/fade/_fade.scss +8 -0
- package/src/css/typography/_typography.scss +72 -72
- package/src/enums/AgentStatus/AgentStatus.enum.js +6 -0
- package/src/enums/WebitelApplications/AdminSections.enum.js +41 -0
- package/src/enums/WebitelApplications/SupervisorSections.enum.js +7 -0
- package/src/enums/WebitelApplications/WebitelApplications.enum.js +10 -0
- package/src/locale/en/en.js +192 -0
- package/src/locale/i18n.js +2 -0
- package/src/locale/ru/ru.js +192 -2
- package/src/locale/ua/ua.js +217 -0
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +57 -0
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +66 -0
- package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +93 -0
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +60 -0
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +48 -0
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +37 -0
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +23 -0
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +29 -0
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +30 -0
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +79 -0
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +75 -0
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +47 -0
- package/src/mixins/validationMixin/validationMixin.js +41 -0
- package/src/modules/CSVExport/CSVExport.js +88 -0
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +63 -0
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +46 -0
- package/src/modules/FilesExport/FilesExport.js +110 -0
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +66 -0
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +46 -0
- package/src/modules/FilesExport/scripts/generateMediaURL.js +7 -0
- package/src/modules/QueryFilters/api/__tests__/defaults.spec.js +18 -0
- package/src/modules/QueryFilters/api/defaults.js +16 -0
- package/src/modules/QueryFilters/classes/ApiFilterSchema.js +32 -0
- package/src/modules/QueryFilters/classes/BaseFilterSchema.js +6 -0
- package/src/modules/QueryFilters/classes/EnumFilterSchema.js +23 -0
- package/src/modules/QueryFilters/classes/__tests__/ApiFilterSchema.spec.js +25 -0
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +54 -0
- package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +40 -0
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +49 -0
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +42 -0
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +32 -0
- package/src/modules/QueryFilters/components/filter-search.vue +33 -0
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +48 -0
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +70 -0
- package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +86 -0
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +58 -0
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +48 -0
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +39 -0
- package/src/modules/QueryFilters/mixins/apiFilterMixin.js +36 -0
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +34 -0
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +46 -0
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +76 -0
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +56 -0
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +50 -0
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +83 -0
- package/src/modules/QueryFilters/store/queryFilters.js +6 -0
- package/src/modules/Userinfo/api/BaseAPIService.js +7 -0
- package/src/modules/Userinfo/api/auth.js +29 -0
- package/src/modules/Userinfo/api/userinfo.js +32 -0
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +170 -0
- package/src/modules/Userinfo/components/__tests__/auth.spec.js +57 -0
- package/src/modules/Userinfo/components/the-auth.vue +75 -0
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +112 -0
- package/src/scripts/__tests__/caseConverters.spec.js +72 -0
- package/src/scripts/__tests__/convertDuration.spec.js +21 -0
- package/src/scripts/__tests__/debounce.spec.js +15 -0
- package/src/scripts/__tests__/editProxy.spec.js +9 -0
- package/src/scripts/__tests__/isEmpty.spec.js +16 -0
- package/src/scripts/__tests__/prettifyFileSize.spec.js +18 -0
- package/src/scripts/__tests__/prettifyTime.spec.js +18 -0
- package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +16 -0
- package/src/scripts/__tests__/sortQueryAdapters.spec.js +12 -0
- package/src/scripts/caseConverters.js +77 -0
- package/src/scripts/convertDuration.js +15 -0
- package/src/scripts/editProxy.js +9 -0
- package/src/scripts/eventBus.js +4 -0
- package/src/scripts/isEmpty.js +9 -0
- package/src/scripts/prettifyFileSize.js +11 -0
- package/src/scripts/prettifyTime.js +9 -0
- package/src/scripts/preventHiddenPageCallsDecorator.js +6 -0
- package/src/scripts/sortQueryAdapters.js +21 -0
- package/src/store/BaseStoreModules/BaseStoreModule.js +49 -0
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +104 -0
- package/src/store/helpers/__tests__/getNamespacedState.spec.js +11 -0
- package/src/store/helpers/getNamespacedState.js +5 -0
- package/dist/img/arrow-down--active--md.7b60f2fb6090366652124f77c543a516.svg +0 -3
- package/dist/img/arrow-down--disabled--md.f58424cd673258365e78863edd1e92cc.svg +0 -3
- package/dist/img/arrow-down--md.1843b60e1c244e066a650e8d19ea83c9.svg +0 -3
- package/dist/img/calendar--active--md.7fd3d949ec7234a4940ea452d95b4165.svg +0 -6
- package/dist/img/calendar--disabled--md.8e7a1e18f93ae8af270060400e6f881c.svg +0 -3
- package/dist/img/calendar--md.9c265581c3a405ff0f0e46e8092f36b8.svg +0 -6
- package/src/css/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/src/css/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/src/css/fonts.scss +0 -9
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtPageWrapper from '../wt-page-wrapper.vue';
|
|
3
|
+
|
|
4
|
+
describe('WtPageWrapper', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtPageWrapper);
|
|
7
|
+
expect(wrapper.classes('wt-page-wrapper')).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders page wrapper header via header slot', () => {
|
|
11
|
+
const content = 'Page Wrapper header';
|
|
12
|
+
const wrapper = shallowMount(WtPageWrapper, {
|
|
13
|
+
slots: { header: content },
|
|
14
|
+
});
|
|
15
|
+
expect(wrapper.find('.wt-page-wrapper__header').text()).toBe(content);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders page wrapper actions panel via actions panel slot', () => {
|
|
19
|
+
const content = 'Page Wrapper actions panel content';
|
|
20
|
+
const wrapper = shallowMount(WtPageWrapper, {
|
|
21
|
+
slots: { 'actions-panel': content },
|
|
22
|
+
});
|
|
23
|
+
expect(wrapper.find('.wt-page-wrapper__actions-panel').text()).toBe(content);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders page wrapper main content via main slot', () => {
|
|
27
|
+
const content = 'Page Wrapper main';
|
|
28
|
+
const wrapper = shallowMount(WtPageWrapper, {
|
|
29
|
+
slots: { main: content },
|
|
30
|
+
});
|
|
31
|
+
expect(wrapper.find('.wt-page-wrapper__main').text()).toBe(content);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="wt-page-wrapper">
|
|
3
|
+
<div class="wt-page-wrapper__header">
|
|
4
|
+
<slot name="header"></slot>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="wt-page-wrapper__actions-panel" v-if="actionsPanel">
|
|
7
|
+
<slot name="actions-panel"></slot>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="wt-page-wrapper__main">
|
|
10
|
+
<slot name="main"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</section>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'wt-page-wrapper',
|
|
18
|
+
props: {
|
|
19
|
+
actionsPanel: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
.wt-page-wrapper {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
min-height: 100%;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
padding: var(--page-wrapper-padding);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.wt-page-wrapper__header,
|
|
37
|
+
.wt-page-wrapper__actions-panel,
|
|
38
|
+
.wt-page-wrapper__main {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
background: var(--main-primary-color);
|
|
41
|
+
border-radius: var(--border-radius);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.wt-page-wrapper__header,
|
|
45
|
+
.wt-page-wrapper__actions-panel {
|
|
46
|
+
margin-bottom: var(--page-wrapper-section-margin);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.wt-page-wrapper__actions-panel {
|
|
50
|
+
padding: var(--page-wrapper-padding);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wt-page-wrapper__main {
|
|
54
|
+
flex: 1;
|
|
55
|
+
display: flex;
|
|
56
|
+
width: 100%;
|
|
57
|
+
padding: var(--page-wrapper-main-section-padding);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtPagination from '../wt-pagination.vue';
|
|
3
|
+
|
|
4
|
+
describe('WtPagination', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtPagination);
|
|
7
|
+
expect(wrapper.classes('wt-pagination')).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('debounces size change event when debounce prop is true', async (done) => {
|
|
11
|
+
const props = {
|
|
12
|
+
size: '10',
|
|
13
|
+
debounce: true,
|
|
14
|
+
debounceDelay: 100,
|
|
15
|
+
};
|
|
16
|
+
const wrapper = shallowMount(WtPagination, {
|
|
17
|
+
props,
|
|
18
|
+
});
|
|
19
|
+
props.size = '20';
|
|
20
|
+
wrapper.setProps(props);
|
|
21
|
+
expect(wrapper.emitted().change).toBeFalsy();
|
|
22
|
+
await setTimeout(() => {
|
|
23
|
+
expect(wrapper.emitted().change[0].length).toBe(1);
|
|
24
|
+
done();
|
|
25
|
+
}, 1000);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('changes pages at icon btn click', async () => {
|
|
29
|
+
const wrapper = shallowMount(WtPagination, {
|
|
30
|
+
props: { isNext: true, page: 2 },
|
|
31
|
+
});
|
|
32
|
+
const pageControls = wrapper.findAll('.wt-pagination__page-control');
|
|
33
|
+
pageControls.at(0).vm.$emit('click');
|
|
34
|
+
pageControls.at(1).vm.$emit('click');
|
|
35
|
+
expect(wrapper.emitted().prev.length).toBe(1);
|
|
36
|
+
expect(wrapper.emitted().next.length).toBe(1);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<footer class="wt-pagination">
|
|
3
|
+
<div class="wt-pagination__size">
|
|
4
|
+
<div class="wt-pagination__size-text">{{ $t('webitelUI.pagination.sizeText') }}</div>
|
|
5
|
+
<wt-input
|
|
6
|
+
class="wt-pagination__size-input"
|
|
7
|
+
:value="size"
|
|
8
|
+
type="number"
|
|
9
|
+
:number-min="1"
|
|
10
|
+
:number-max="1000"
|
|
11
|
+
@input="inputHandler"
|
|
12
|
+
></wt-input>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="wt-pagination__page-controls">
|
|
15
|
+
<wt-icon-btn
|
|
16
|
+
class="wt-pagination__page-control"
|
|
17
|
+
icon="arrow-left"
|
|
18
|
+
:tooltip="$t('webitelUI.pagination.prev')"
|
|
19
|
+
:disabled="!prev"
|
|
20
|
+
@click="goPrev"
|
|
21
|
+
></wt-icon-btn>
|
|
22
|
+
<wt-icon-btn
|
|
23
|
+
class="wt-pagination__page-control"
|
|
24
|
+
icon="arrow-right"
|
|
25
|
+
:tooltip="$t('webitelUI.pagination.next')"
|
|
26
|
+
:disabled="!next"
|
|
27
|
+
@click="goNext"
|
|
28
|
+
></wt-icon-btn>
|
|
29
|
+
</div>
|
|
30
|
+
</footer>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import debounce from '../../../scripts/debounce';
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: 'wt-pagination',
|
|
38
|
+
props: {
|
|
39
|
+
size: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
},
|
|
42
|
+
next: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
prev: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
debounce: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
debounceDelay: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 1000,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
model: {
|
|
60
|
+
prop: 'size',
|
|
61
|
+
event: 'change',
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
watch: {
|
|
65
|
+
size(value) {
|
|
66
|
+
this.changeSize(value);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
data: () => ({
|
|
71
|
+
defaultSize: '10',
|
|
72
|
+
}),
|
|
73
|
+
|
|
74
|
+
created() {
|
|
75
|
+
if (this.debounce) this.changeSize = debounce(this.changeSize, this.debounceDelay);
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
methods: {
|
|
79
|
+
inputHandler(value) {
|
|
80
|
+
const size = (value > 0 && value <= 1000)
|
|
81
|
+
? value
|
|
82
|
+
: this.defaultSize;
|
|
83
|
+
this.$emit('input', size);
|
|
84
|
+
this.changeSize(size);
|
|
85
|
+
},
|
|
86
|
+
changeSize(value) {
|
|
87
|
+
this.$emit('change', value);
|
|
88
|
+
},
|
|
89
|
+
goNext() {
|
|
90
|
+
this.$emit('next');
|
|
91
|
+
},
|
|
92
|
+
goPrev() {
|
|
93
|
+
this.$emit('prev');
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="scss" scoped>
|
|
100
|
+
.wt-pagination {
|
|
101
|
+
@extend %typo-body-md;
|
|
102
|
+
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
margin-left: auto;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.wt-pagination__size {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
margin-right: var(--pagination-margin-right);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.wt-pagination__size-text {
|
|
115
|
+
margin-right: var(--pagination-size-text-margin-right);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wt-pagination__size-input {
|
|
119
|
+
width: var(--pagination-size-input-width);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wt-pagination__page-controls {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.wt-pagination__page-control {
|
|
128
|
+
margin-left: var(--pagination-page-controls-margin);
|
|
129
|
+
|
|
130
|
+
&:first-child {
|
|
131
|
+
margin-left: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtPlayer from '../wt-player.vue';
|
|
3
|
+
|
|
4
|
+
describe('WtPlayer', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtPlayer);
|
|
7
|
+
expect(wrapper.classes('wt-player')).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<aside class="wt-player">
|
|
3
|
+
<audio
|
|
4
|
+
id="wt-player__player"
|
|
5
|
+
ref="audio"
|
|
6
|
+
:src="src"
|
|
7
|
+
:autoplay="autoplay"
|
|
8
|
+
controls
|
|
9
|
+
v-on="listeners"
|
|
10
|
+
></audio>
|
|
11
|
+
|
|
12
|
+
<!-- The "wt-icon-btn" component is append in to "audio" element by "setCloseIcon" method-->
|
|
13
|
+
<wt-icon-btn
|
|
14
|
+
class="wt-player__close-icon"
|
|
15
|
+
ref="close-icon"
|
|
16
|
+
icon="close"
|
|
17
|
+
@click="$emit('close')"
|
|
18
|
+
></wt-icon-btn>
|
|
19
|
+
</aside>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import Plyr from 'plyr';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'wt-player',
|
|
27
|
+
props: {
|
|
28
|
+
src: {},
|
|
29
|
+
autoplay: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true,
|
|
32
|
+
},
|
|
33
|
+
loop: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
download: {
|
|
38
|
+
type: [String, Function, Boolean],
|
|
39
|
+
default: () => (url) => url.replace('/stream', '/download'),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
data: () => ({
|
|
43
|
+
player: null,
|
|
44
|
+
}),
|
|
45
|
+
|
|
46
|
+
watch: {
|
|
47
|
+
src() {
|
|
48
|
+
this.setupDownload();
|
|
49
|
+
},
|
|
50
|
+
download() {
|
|
51
|
+
this.setupDownload();
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
mounted() {
|
|
56
|
+
this.setupPlayer();
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
computed: {
|
|
60
|
+
listeners() {
|
|
61
|
+
return {
|
|
62
|
+
...this.$listeners,
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
methods: {
|
|
68
|
+
setupPlayer() {
|
|
69
|
+
const baseURL = this.$baseURL || process.env.BASE_URL;
|
|
70
|
+
if (this.player) this.player.restart();
|
|
71
|
+
const controls = ['play-large', 'play', 'progress', 'current-time',
|
|
72
|
+
'mute', 'volume', 'captions', 'settings', 'pip',
|
|
73
|
+
'airplay', 'fullscreen'];
|
|
74
|
+
if (this.download) controls.push('download');
|
|
75
|
+
this.player = new Plyr('#wt-player__player', {
|
|
76
|
+
autoplay: this.autoplay,
|
|
77
|
+
loadSprite: false,
|
|
78
|
+
iconUrl: `${baseURL}img/plyr.svg`,
|
|
79
|
+
controls,
|
|
80
|
+
loop: {
|
|
81
|
+
active: this.loop,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
this.appendCloseIcon();
|
|
85
|
+
},
|
|
86
|
+
setupDownload() {
|
|
87
|
+
if (!this.download) this.setupPlayer();
|
|
88
|
+
else if (typeof this.download === 'string') {
|
|
89
|
+
this.player.download = this.download;
|
|
90
|
+
} else if (typeof this.download === 'function') {
|
|
91
|
+
this.player.download = this.download(this.src);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
appendCloseIcon() {
|
|
95
|
+
const plyrControls = this.$refs.audio.plyr?.elements?.controls;
|
|
96
|
+
const closeIcon = this.$refs['close-icon'].$el;
|
|
97
|
+
if (plyrControls) {
|
|
98
|
+
plyrControls.append(closeIcon);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style lang="scss">
|
|
106
|
+
@import "~plyr/src/sass/plyr.scss";
|
|
107
|
+
|
|
108
|
+
.wt-player {
|
|
109
|
+
@extend %typo-body-md;
|
|
110
|
+
position: sticky;
|
|
111
|
+
bottom: 60px;
|
|
112
|
+
|
|
113
|
+
.plyr {
|
|
114
|
+
border-radius: var(--border-radius);
|
|
115
|
+
box-shadow: var(--box-shadow);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__close-icon {
|
|
119
|
+
transform: translate(var(--player-close-icon-transform-translate-x),
|
|
120
|
+
var(--player-close-icon-transform-translate-y));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.plyr__control:hover, {
|
|
124
|
+
background: var(--main-option-hover-color);
|
|
125
|
+
color: var(--text-primary-color);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
//.plyr__control[role='menuitemradio']::before,
|
|
129
|
+
//.plyr__control[role='menuitemradio']:hover::before {
|
|
130
|
+
// border: 2px solid var(--main-secondary-color);
|
|
131
|
+
// background: var(--main-primary-color);
|
|
132
|
+
//}
|
|
133
|
+
//
|
|
134
|
+
//.plyr__control[role='menuitemradio']::after {
|
|
135
|
+
// background: var(--main-secondary-color);
|
|
136
|
+
//}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtStatusSelect from '../wt-status-select.vue';
|
|
3
|
+
import WtSelect from '../../../molecules/wt-select/wt-select.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtStatusSelect', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtStatusSelect, {
|
|
8
|
+
stubs: { WtSelect },
|
|
9
|
+
});
|
|
10
|
+
expect(wrapper.classes('wt-status-select')).toBe(true);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('correctly represents duration', () => {
|
|
14
|
+
const wrapper = shallowMount(WtStatusSelect, {
|
|
15
|
+
stubs: { WtSelect },
|
|
16
|
+
});
|
|
17
|
+
expect(wrapper.vm.duration).toBe('00:00:00');
|
|
18
|
+
|
|
19
|
+
// wrapper.setProps({ statusDuration: 1 });
|
|
20
|
+
// expect(wrapper.vm.duration).toBe('00:00:01');
|
|
21
|
+
//
|
|
22
|
+
// wrapper.setProps({ statusDuration: '01' });
|
|
23
|
+
// expect(wrapper.vm.duration).toBe('00:00:01');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import AgentStatus from '../../../../enums/AgentStatus/AgentStatus.enum';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
locale: 'webitelUI.statusSelect.online',
|
|
6
|
+
color: 'success',
|
|
7
|
+
value: AgentStatus.ONLINE,
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
locale: 'webitelUI.statusSelect.pause',
|
|
11
|
+
color: 'primary',
|
|
12
|
+
value: AgentStatus.PAUSE,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
locale: 'webitelUI.statusSelect.offline',
|
|
16
|
+
color: 'disabled',
|
|
17
|
+
value: AgentStatus.OFFLINE,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
locale: 'webitelUI.statusSelect.breakOut',
|
|
21
|
+
color: 'break-out',
|
|
22
|
+
value: AgentStatus.BREAK_OUT,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-select
|
|
3
|
+
class="wt-status-select"
|
|
4
|
+
:value="selectedOption"
|
|
5
|
+
:options="availableOptions"
|
|
6
|
+
track-by="value"
|
|
7
|
+
:clearable="false"
|
|
8
|
+
:searchable="false"
|
|
9
|
+
@input="inputHandler"
|
|
10
|
+
>
|
|
11
|
+
<template slot="singleLabel" slot-scope="{ option }">
|
|
12
|
+
<wt-indicator
|
|
13
|
+
:color="option.color"
|
|
14
|
+
:text="duration"
|
|
15
|
+
></wt-indicator>
|
|
16
|
+
</template>
|
|
17
|
+
<template slot="option" slot-scope="{ option }">
|
|
18
|
+
<wt-indicator
|
|
19
|
+
:color="option.color"
|
|
20
|
+
:text="option.text"
|
|
21
|
+
></wt-indicator>
|
|
22
|
+
</template>
|
|
23
|
+
</wt-select>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import AgentStatus from '../../../enums/AgentStatus/AgentStatus.enum';
|
|
28
|
+
import convertDuration from '../../../scripts/convertDuration';
|
|
29
|
+
import StatusOptions from './_internals/StatusOptions.lookup';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'wt-status-select',
|
|
33
|
+
props: {
|
|
34
|
+
status: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: AgentStatus.OFFLINE,
|
|
37
|
+
},
|
|
38
|
+
statusDuration: {
|
|
39
|
+
type: [String, Number],
|
|
40
|
+
default: 0,
|
|
41
|
+
},
|
|
42
|
+
options: {
|
|
43
|
+
type: Array,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
model: {
|
|
47
|
+
prop: 'status',
|
|
48
|
+
event: 'change',
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
selectedOption() {
|
|
52
|
+
return this.statusOptions.find((option) => option.value === this.status);
|
|
53
|
+
},
|
|
54
|
+
statusOptions() {
|
|
55
|
+
return this.options ? this.options
|
|
56
|
+
: StatusOptions.map((opt) => ({
|
|
57
|
+
...opt,
|
|
58
|
+
text: this.$t(opt.locale),
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
availableOptions() {
|
|
62
|
+
return this.statusOptions.reduce((options, opt) => {
|
|
63
|
+
// PAUSE option is always passed
|
|
64
|
+
if ((this.status === opt.value && opt.value !== AgentStatus.PAUSE)
|
|
65
|
+
|| opt.value === AgentStatus.BREAK_OUT) { // skip breakout option
|
|
66
|
+
return options;
|
|
67
|
+
}
|
|
68
|
+
return [...options, opt];
|
|
69
|
+
}, []);
|
|
70
|
+
},
|
|
71
|
+
duration() {
|
|
72
|
+
/* The check commented below limits the display of time in the status to 8 characters.
|
|
73
|
+
Accordingly, if the agent is in the status of 100 hours (100: 00: 00),
|
|
74
|
+
then this time will be displayed as NaN:NaN:NaN */
|
|
75
|
+
|
|
76
|
+
// if (typeof this.statusDuration === 'string' && this.statusDuration.length === 8) return this.statusDuration;
|
|
77
|
+
if (typeof this.statusDuration === 'string') return this.statusDuration;
|
|
78
|
+
if (this.statusDuration !== undefined) {
|
|
79
|
+
return convertDuration(this.statusDuration);
|
|
80
|
+
}
|
|
81
|
+
return this.selectedOption.text;
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
inputHandler(value) {
|
|
86
|
+
this.$emit('change', value.value);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style lang="scss" scoped>
|
|
93
|
+
.wt-select ::v-deep {
|
|
94
|
+
box-shadow: var(--box-shadow);
|
|
95
|
+
|
|
96
|
+
.multiselect__tags {
|
|
97
|
+
padding: var(--status-select-select-tags-padding);
|
|
98
|
+
border: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.multiselect__content-wrapper {
|
|
102
|
+
border: none;
|
|
103
|
+
|
|
104
|
+
.multiselect__option--highlight {
|
|
105
|
+
color: var(--status-select--hover-color);
|
|
106
|
+
background: var(--status-select-bg--hover-color);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtTable from '../wt-table.vue';
|
|
3
|
+
import WtCheckbox from '../../../molecules/wt-checkbox/wt-checkbox.vue';
|
|
4
|
+
|
|
5
|
+
const headers = [
|
|
6
|
+
{
|
|
7
|
+
text: 'heading 1',
|
|
8
|
+
value: 'h1',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
text: 'heading2',
|
|
12
|
+
value: 'h2',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
text: 'heading 3',
|
|
16
|
+
value: 'h3',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
const data = [
|
|
20
|
+
{
|
|
21
|
+
h1: 'value 1',
|
|
22
|
+
h2: 'value 2',
|
|
23
|
+
h3: 'value 3',
|
|
24
|
+
_isSelected: false,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
h1: 'value 1',
|
|
28
|
+
h2: 'value 2',
|
|
29
|
+
h3: 'value 3',
|
|
30
|
+
_isSelected: false,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
h1: 'value 1',
|
|
34
|
+
h2: 'value 2',
|
|
35
|
+
h3: 'value 3',
|
|
36
|
+
_isSelected: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
h1: 'value 1',
|
|
40
|
+
h2: 'value 2',
|
|
41
|
+
h3: 'value 3',
|
|
42
|
+
_isSelected: false,
|
|
43
|
+
}];
|
|
44
|
+
|
|
45
|
+
describe('WtTable', () => {
|
|
46
|
+
it('renders a component', () => {
|
|
47
|
+
const wrapper = shallowMount(WtTable);
|
|
48
|
+
expect(wrapper.classes('wt-table')).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders table data rows', () => {
|
|
52
|
+
const wrapper = shallowMount(WtTable, {
|
|
53
|
+
propsData: {
|
|
54
|
+
headers,
|
|
55
|
+
data,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
expect(wrapper.findAll('.wt-table__tr__body').length).toBe(data.length);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('renders table headers', () => {
|
|
62
|
+
const wrapper = shallowMount(WtTable, {
|
|
63
|
+
propsData: {
|
|
64
|
+
headers,
|
|
65
|
+
data,
|
|
66
|
+
selectable: false,
|
|
67
|
+
gridActions: false,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
expect(wrapper.findAll('.wt-table__tr__head th').length).toBe(headers.length);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('do not renders table footer by default', () => {
|
|
74
|
+
const wrapper = shallowMount(WtTable, {
|
|
75
|
+
propsData: {
|
|
76
|
+
headers,
|
|
77
|
+
data,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
expect(wrapper.find('.wt-table__foot').exists()).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('renders table footer if footer slot is passed', () => {
|
|
84
|
+
const wrapper = shallowMount(WtTable, {
|
|
85
|
+
propsData: {
|
|
86
|
+
headers,
|
|
87
|
+
data,
|
|
88
|
+
},
|
|
89
|
+
scopedSlots: {
|
|
90
|
+
'data-footer': '',
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
expect(wrapper.find('.wt-table__foot').isVisible()).toBe(true);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('emits sort event at header click when sortable is true', () => {
|
|
97
|
+
const wrapper = shallowMount(WtTable, {
|
|
98
|
+
propsData: {
|
|
99
|
+
headers,
|
|
100
|
+
data,
|
|
101
|
+
sortable: true,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
wrapper.find('.wt-table__th--sortable').trigger('click');
|
|
105
|
+
expect(wrapper.emitted().sort.pop()).toBeTruthy();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('draws sort arrow, if a column is sorted', () => {
|
|
109
|
+
headers[0].sort = 'asc';
|
|
110
|
+
const wrapper = shallowMount(WtTable, {
|
|
111
|
+
propsData: {
|
|
112
|
+
headers,
|
|
113
|
+
data,
|
|
114
|
+
sortable: true,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
expect(wrapper
|
|
118
|
+
.find('.wt-table__th--sortable .wt-table__th__sort-arrow')
|
|
119
|
+
.exists()).toBe(true);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('selects all rows at header checkbox click', async () => {
|
|
123
|
+
const wrapper = shallowMount(WtTable, {
|
|
124
|
+
propsData: {
|
|
125
|
+
headers,
|
|
126
|
+
data,
|
|
127
|
+
selectable: true,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
wrapper.findComponent(WtCheckbox).vm.$emit('change');
|
|
131
|
+
expect(data.every((item) => item._isSelected)).toBe(true);
|
|
132
|
+
});
|
|
133
|
+
});
|