@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,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article class="filters-panel-wrapper" :class="{ 'filters-panel-wrapper--opened': isOpened }">
|
|
3
|
+
<div class="filters-wrap">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="actions-wrap">
|
|
7
|
+
<wt-table-actions
|
|
8
|
+
:icons="['filter-reset', 'settings']"
|
|
9
|
+
@input="tableActionsHandler"
|
|
10
|
+
></wt-table-actions>
|
|
11
|
+
</div>
|
|
12
|
+
</article>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'filters-panel-wrapper',
|
|
18
|
+
data: () => ({
|
|
19
|
+
isOpened: false,
|
|
20
|
+
filtersCount: 0,
|
|
21
|
+
}),
|
|
22
|
+
methods: {
|
|
23
|
+
tableActionsHandler(eventName) {
|
|
24
|
+
switch (eventName) {
|
|
25
|
+
case 'filterReset':
|
|
26
|
+
this.resetFilters();
|
|
27
|
+
break;
|
|
28
|
+
case 'settings':
|
|
29
|
+
this.toggleFiltersExpansion();
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
toggleFiltersExpansion() {
|
|
35
|
+
this.isOpened = !this.isOpened;
|
|
36
|
+
},
|
|
37
|
+
resetFilters() {
|
|
38
|
+
this.$emit('reset');
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
$actions-width: calc(2 * (24px + var(--table-actions-icon-gap)));
|
|
46
|
+
|
|
47
|
+
.filters-panel-wrapper {
|
|
48
|
+
display: flex;
|
|
49
|
+
|
|
50
|
+
.filters-wrap {
|
|
51
|
+
flex: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.actions-wrap {
|
|
55
|
+
display: flex;
|
|
56
|
+
margin-left: auto;
|
|
57
|
+
margin-top: 24px;
|
|
58
|
+
flex: 0 0 $actions-width;
|
|
59
|
+
|
|
60
|
+
.wt-table-actions {
|
|
61
|
+
height: fit-content;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 30px*2 outer paddings, 30px*2 inner paddings, table actions var value
|
|
67
|
+
// -- sass doesnt work with css variables :(
|
|
68
|
+
$width-except-filters: 60px + 60px + 88px;
|
|
69
|
+
$filter-width: 230px;
|
|
70
|
+
$filter-gap: 10px; // var(--component-spacing)
|
|
71
|
+
@function filters-width($num) {
|
|
72
|
+
// 1px corrects max width
|
|
73
|
+
@return ($filter-width * $num) + $filter-gap * $num + $width-except-filters - 1px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.filters-wrap {
|
|
77
|
+
display: grid;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
grid-gap: var(--component-spacing);
|
|
80
|
+
|
|
81
|
+
.filters-panel-wrapper & > * {
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
& {
|
|
85
|
+
grid-template-columns: repeat(6, 1fr);
|
|
86
|
+
|
|
87
|
+
> *:nth-child(n+7) {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media (max-width: filters-width(6)) {
|
|
93
|
+
& {
|
|
94
|
+
grid-template-columns: repeat(5, 1fr);
|
|
95
|
+
|
|
96
|
+
> *:nth-child(n+6) {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (max-width: filters-width(5)) {
|
|
103
|
+
& {
|
|
104
|
+
grid-template-columns: repeat(4, 1fr);
|
|
105
|
+
|
|
106
|
+
> *:nth-child(n+5) {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (max-width: filters-width(4)) {
|
|
113
|
+
& {
|
|
114
|
+
grid-template-columns: repeat(3, 1fr);
|
|
115
|
+
|
|
116
|
+
> *:nth-child(n+4) {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (max-width: filters-width(3)) {
|
|
123
|
+
& {
|
|
124
|
+
grid-template-columns: repeat(2, 1fr);
|
|
125
|
+
|
|
126
|
+
> *:nth-child(n+3) {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (max-width: filters-width(2)) {
|
|
133
|
+
& {
|
|
134
|
+
grid-template-columns: repeat(1, 1fr);
|
|
135
|
+
|
|
136
|
+
> *:nth-child(n+2) {
|
|
137
|
+
display: none;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.filters-panel-wrapper--opened .filters-wrap > * {
|
|
144
|
+
display: block;
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtHeadline from '../wt-headline.vue';
|
|
3
|
+
|
|
4
|
+
describe('WtHeadline', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtHeadline, {
|
|
7
|
+
stubs: { WtIconBtn: true },
|
|
8
|
+
});
|
|
9
|
+
expect(wrapper.classes('wt-headline')).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('renders headline main content via title-wrapper slot', () => {
|
|
13
|
+
const content = 'Headline title';
|
|
14
|
+
const wrapper = shallowMount(WtHeadline, {
|
|
15
|
+
stubs: { WtIconBtn: true },
|
|
16
|
+
slots: { 'title-wrapper': content },
|
|
17
|
+
});
|
|
18
|
+
expect(wrapper.find('.wt-headline').text()).toBe(content);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('renders headline title via title slot', () => {
|
|
22
|
+
const content = 'Headline title';
|
|
23
|
+
const wrapper = shallowMount(WtHeadline, {
|
|
24
|
+
stubs: { WtIconBtn: true },
|
|
25
|
+
slots: { title: content },
|
|
26
|
+
});
|
|
27
|
+
expect(wrapper.find('.wt-headline__title').text()).toBe(content);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('renders headline search via search slot', () => {
|
|
31
|
+
const content = 'Headline search content';
|
|
32
|
+
const wrapper = shallowMount(WtHeadline, {
|
|
33
|
+
stubs: { WtIconBtn: true },
|
|
34
|
+
slots: { search: content },
|
|
35
|
+
});
|
|
36
|
+
expect(wrapper.find('.wt-headline__actions-wrapper').text()).toBe(content);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders headline actions via actions slot', () => {
|
|
40
|
+
const content = 'Headline actions';
|
|
41
|
+
const wrapper = shallowMount(WtHeadline, {
|
|
42
|
+
stubs: { WtIconBtn: true },
|
|
43
|
+
slots: { actions: content },
|
|
44
|
+
});
|
|
45
|
+
expect(wrapper.find('.wt-headline__actions-wrapper').text()).toBe(content);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header class="wt-headline">
|
|
3
|
+
<slot>
|
|
4
|
+
<slot name="title-wrapper">
|
|
5
|
+
<h1 class="wt-headline__title">
|
|
6
|
+
<slot name="title"></slot>
|
|
7
|
+
</h1>
|
|
8
|
+
</slot>
|
|
9
|
+
<div class="wt-headline__actions-wrapper">
|
|
10
|
+
<slot name="search"></slot>
|
|
11
|
+
<slot name="actions"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</slot>
|
|
14
|
+
</header>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'wt-headline',
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
.wt-headline {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
min-height: var(--headline-min-height);
|
|
30
|
+
padding: var(--headline-padding);
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
background: var(--headline-background);
|
|
33
|
+
border-radius: var(--border-radius);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.wt-headline__title {
|
|
37
|
+
@extend %typo-heading-md;
|
|
38
|
+
margin-right: var(--headline-title-margin);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.wt-headline__actions-wrapper {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { shallowMount, createLocalVue } from '@vue/test-utils';
|
|
2
|
+
import VueRouter from 'vue-router';
|
|
3
|
+
import WtNavigationBar from '../wt-navigation-bar.vue';
|
|
4
|
+
|
|
5
|
+
const nav = [
|
|
6
|
+
{ value: '1', route: '/1' },
|
|
7
|
+
{
|
|
8
|
+
value: '2',
|
|
9
|
+
route: '/2',
|
|
10
|
+
subNav: [
|
|
11
|
+
{ value: '3', route: '3' },
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const localVue = createLocalVue();
|
|
17
|
+
localVue.use(VueRouter);
|
|
18
|
+
const router = new VueRouter();
|
|
19
|
+
|
|
20
|
+
describe('WtNavigationBar', () => {
|
|
21
|
+
it('renders a component', () => {
|
|
22
|
+
const wrapper = shallowMount(WtNavigationBar);
|
|
23
|
+
expect(wrapper.classes('wt-navigation-bar')).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders navigation links', () => {
|
|
27
|
+
const wrapper = shallowMount(WtNavigationBar, {
|
|
28
|
+
localVue,
|
|
29
|
+
router,
|
|
30
|
+
propsData: { nav },
|
|
31
|
+
});
|
|
32
|
+
const navLinksLen = nav.filter((nav) => !nav.subNav).length;
|
|
33
|
+
expect(wrapper.findAll('.wt-navigation-bar__nav-item-link').length).toBe(navLinksLen);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('renders navigation expansions with subNav inside it', async () => {
|
|
37
|
+
const wrapper = shallowMount(WtNavigationBar, {
|
|
38
|
+
localVue,
|
|
39
|
+
router,
|
|
40
|
+
propsData: { nav },
|
|
41
|
+
});
|
|
42
|
+
wrapper.find('.wt-navigation-bar__nav-expansion').trigger('click');
|
|
43
|
+
await wrapper.vm.$nextTick();
|
|
44
|
+
const navExpansion = nav
|
|
45
|
+
.find((nav) => nav.subNav)
|
|
46
|
+
.subNav.length;
|
|
47
|
+
expect(wrapper
|
|
48
|
+
.findAll('.wt-navigation-bar__nav-item-link--subnav')
|
|
49
|
+
.length)
|
|
50
|
+
.toBe(navExpansion);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('correctly computes subNav nested routes', async () => {
|
|
54
|
+
const wrapper = shallowMount(WtNavigationBar, {
|
|
55
|
+
localVue,
|
|
56
|
+
router,
|
|
57
|
+
propsData: { nav },
|
|
58
|
+
});
|
|
59
|
+
wrapper.find('.wt-navigation-bar__nav-expansion').trigger('click');
|
|
60
|
+
await wrapper.vm.$nextTick();
|
|
61
|
+
expect(wrapper.find('.wt-navigation-bar__nav-item-link--subnav').attributes('to'))
|
|
62
|
+
.toBe('/2/3');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<aside class="wt-navigation-bar" v-clickaway="close">
|
|
3
|
+
<wt-icon-btn
|
|
4
|
+
class="wt-navigation-bar__menu-btn"
|
|
5
|
+
icon="menu"
|
|
6
|
+
:class="{'active': isOpened}"
|
|
7
|
+
@click="isOpened = !isOpened"
|
|
8
|
+
></wt-icon-btn>
|
|
9
|
+
<transition name="fade">
|
|
10
|
+
<nav class="wt-navigation-bar__nav" v-show="isOpened">
|
|
11
|
+
<header class="wt-navigation-bar__nav-header">
|
|
12
|
+
<!-- vue cli build target lib cant handle dynamic require :( -->
|
|
13
|
+
<img v-if="currentApp === 'admin'"
|
|
14
|
+
src="../../../assets/components/organisms/wt-navigation-bar/logo-admin-app.svg" alt="admin">
|
|
15
|
+
<img v-if="currentApp === 'agent'"
|
|
16
|
+
src="../../../assets/components/organisms/wt-navigation-bar/logo-agent-app.svg" alt="agent">
|
|
17
|
+
<img v-if="currentApp === 'audit'"
|
|
18
|
+
src="../../../assets/components/organisms/wt-navigation-bar/logo-audit-app.svg" alt="audit">
|
|
19
|
+
<img v-if="currentApp === 'history'"
|
|
20
|
+
src="../../../assets/components/organisms/wt-navigation-bar/logo-history-app.svg" alt="history">
|
|
21
|
+
<img v-if="currentApp === 'supervisor'"
|
|
22
|
+
src="../../../assets/components/organisms/wt-navigation-bar/logo-supervisor-app.svg" alt="supervisor">
|
|
23
|
+
<wt-icon-btn
|
|
24
|
+
class="wt-navigation-bar__nav-close"
|
|
25
|
+
icon="close"
|
|
26
|
+
@click="isOpened = false"
|
|
27
|
+
></wt-icon-btn>
|
|
28
|
+
</header>
|
|
29
|
+
<wt-divider/>
|
|
30
|
+
<ul class="wt-navigation-bar__nav-list">
|
|
31
|
+
<li
|
|
32
|
+
v-for="(navItem, key) of nav"
|
|
33
|
+
class="wt-navigation-bar__nav-item"
|
|
34
|
+
:key="key"
|
|
35
|
+
>
|
|
36
|
+
<div v-if="!navItem.subNav">
|
|
37
|
+
<div class="wt-navigation-bar__nav-item-wrapper">
|
|
38
|
+
<router-link
|
|
39
|
+
class="wt-navigation-bar__nav-item-link"
|
|
40
|
+
:class="{'wt-navigation-bar__nav-item-link--active': currentNav.nav === navItem.value}"
|
|
41
|
+
:to="navItem.route"
|
|
42
|
+
@click.native="close"
|
|
43
|
+
> {{ navItem.name || navItem.value }}
|
|
44
|
+
</router-link>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div v-else>
|
|
48
|
+
<button
|
|
49
|
+
class="wt-navigation-bar__nav-expansion"
|
|
50
|
+
:class="{
|
|
51
|
+
'wt-navigation-bar__nav-expansion--expanded': isExpanded(navItem),
|
|
52
|
+
'wt-navigation-bar__nav-expansion--active': currentNav.expansion === navItem.value,
|
|
53
|
+
}"
|
|
54
|
+
type="button"
|
|
55
|
+
@click="expand(navItem)"
|
|
56
|
+
>
|
|
57
|
+
<span class="wt-navigation-bar__nav-expansion-name">{{ navItem.name || navItem.value }}</span>
|
|
58
|
+
<wt-icon
|
|
59
|
+
class="wt-navigation-bar__expansion-arrow"
|
|
60
|
+
icon="arrow-right"
|
|
61
|
+
color="active"
|
|
62
|
+
></wt-icon>
|
|
63
|
+
</button>
|
|
64
|
+
<expand-transition>
|
|
65
|
+
<ul v-if="isExpanded(navItem)">
|
|
66
|
+
<li
|
|
67
|
+
v-for="(subNavItem, subNavKey) of navItem.subNav"
|
|
68
|
+
class="wt-navigation-bar__nav-item"
|
|
69
|
+
:key="subNavKey"
|
|
70
|
+
>
|
|
71
|
+
<div class="wt-navigation-bar__nav-item-wrapper">
|
|
72
|
+
<router-link
|
|
73
|
+
class="wt-navigation-bar__nav-item-link wt-navigation-bar__nav-item-link--subnav"
|
|
74
|
+
:class="{'wt-navigation-bar__nav-item-link--active': currentNav.nav === subNavItem.value}"
|
|
75
|
+
:to="nestedRoute(subNavItem, navItem)"
|
|
76
|
+
@click.native="close"
|
|
77
|
+
>{{ subNavItem.name || subNavItem.value }}
|
|
78
|
+
</router-link>
|
|
79
|
+
</div>
|
|
80
|
+
</li>
|
|
81
|
+
</ul>
|
|
82
|
+
</expand-transition>
|
|
83
|
+
</div>
|
|
84
|
+
</li>
|
|
85
|
+
</ul>
|
|
86
|
+
</nav>
|
|
87
|
+
</transition>
|
|
88
|
+
</aside>
|
|
89
|
+
</template>
|
|
90
|
+
|
|
91
|
+
<script>
|
|
92
|
+
import ExpandTransition from '../../transitions/expand-transition.vue';
|
|
93
|
+
|
|
94
|
+
export default {
|
|
95
|
+
name: 'wt-navigation-bar',
|
|
96
|
+
components: { ExpandTransition },
|
|
97
|
+
props: {
|
|
98
|
+
currentApp: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: 'admin',
|
|
101
|
+
},
|
|
102
|
+
nav: {
|
|
103
|
+
type: Array,
|
|
104
|
+
default: () => [],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
data: () => ({
|
|
108
|
+
isOpened: false,
|
|
109
|
+
expandedName: '',
|
|
110
|
+
}),
|
|
111
|
+
|
|
112
|
+
computed: {
|
|
113
|
+
currentNav() {
|
|
114
|
+
const path = this.$route.fullPath;
|
|
115
|
+
const currentNav = this.nav
|
|
116
|
+
.reduce((flatNav, currentNavItem) => {
|
|
117
|
+
if (currentNavItem.subNav) return flatNav.concat(currentNavItem.subNav);
|
|
118
|
+
return [...flatNav, currentNavItem];
|
|
119
|
+
}, [])
|
|
120
|
+
.find((navItem) => path.includes(navItem.route));
|
|
121
|
+
const currentExpansion = this.nav
|
|
122
|
+
.filter((nav) => nav.subNav)
|
|
123
|
+
.find((nav) => nav.subNav.indexOf(currentNav) !== -1);
|
|
124
|
+
return {
|
|
125
|
+
nav: currentNav?.value,
|
|
126
|
+
expansion: currentExpansion?.value,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
methods: {
|
|
131
|
+
nestedRoute(subNavItem, navItem) {
|
|
132
|
+
return navItem.route ? `${navItem.route}/${subNavItem.route}` : subNavItem.route;
|
|
133
|
+
},
|
|
134
|
+
expand(navItem) {
|
|
135
|
+
this.expandedName = this.expandedName !== navItem.value ? navItem.value : '';
|
|
136
|
+
},
|
|
137
|
+
isExpanded(navItem) {
|
|
138
|
+
return this.expandedName === navItem.value;
|
|
139
|
+
},
|
|
140
|
+
close() {
|
|
141
|
+
this.isOpened = false;
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<style lang="scss" scoped>
|
|
148
|
+
.wt-navigation-bar__menu-btn {
|
|
149
|
+
display: block;
|
|
150
|
+
width: fit-content;
|
|
151
|
+
width: -moz-fit-content;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.wt-navigation-bar__nav {
|
|
155
|
+
@extend %wt-scrollbar;
|
|
156
|
+
position: fixed;
|
|
157
|
+
top: 0;
|
|
158
|
+
bottom: 0;
|
|
159
|
+
left: 0;
|
|
160
|
+
width: var(--navigation-bar-width);
|
|
161
|
+
overflow: auto;
|
|
162
|
+
z-index: var(--navigation-bar-z-index);
|
|
163
|
+
border-radius: var(--border-radius);
|
|
164
|
+
box-shadow: var(--box-shadow);
|
|
165
|
+
background: var(--navigation-bar-bg-color);
|
|
166
|
+
|
|
167
|
+
// expand animation optimization
|
|
168
|
+
* {
|
|
169
|
+
will-change: height;
|
|
170
|
+
transform: translateZ(0);
|
|
171
|
+
backface-visibility: hidden;
|
|
172
|
+
perspective: 1000px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.wt-navigation-bar__nav-header {
|
|
177
|
+
display: flex;
|
|
178
|
+
justify-content: space-between;
|
|
179
|
+
align-items: center;
|
|
180
|
+
padding: var(--navigation-bar-header-padding);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.wt-navigation-bar__nav-list {
|
|
184
|
+
padding: var(--navigation-bar-list-padding);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.wt-navigation-bar__nav-item-link {
|
|
188
|
+
@extend %typo-body-lg;
|
|
189
|
+
display: block;
|
|
190
|
+
padding: var(--navigation-bar-link-padding);
|
|
191
|
+
transition: var(--transition);
|
|
192
|
+
word-wrap: break-word;
|
|
193
|
+
|
|
194
|
+
&:hover {
|
|
195
|
+
background: var(--main-option-hover-color);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&--active {
|
|
199
|
+
background: var(--main-option-hover-color);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.wt-navigation-bar__nav-expansion {
|
|
204
|
+
@extend %typo-heading-sm;
|
|
205
|
+
position: relative;
|
|
206
|
+
display: flex;
|
|
207
|
+
justify-content: space-between;
|
|
208
|
+
align-items: center;
|
|
209
|
+
width: 100%;
|
|
210
|
+
padding: var(--navigation-bar-link-padding);
|
|
211
|
+
outline: none;
|
|
212
|
+
|
|
213
|
+
&:before {
|
|
214
|
+
opacity: 0;
|
|
215
|
+
content: "";
|
|
216
|
+
position: absolute;
|
|
217
|
+
top: 0;
|
|
218
|
+
bottom: 0;
|
|
219
|
+
left: calc(var(--navigation-bar-horizontal-padding) * -1);
|
|
220
|
+
width: var(--navigation-bar-active-expansion-flag-width);
|
|
221
|
+
border-radius: var(--border-radius);
|
|
222
|
+
background: var(--main-accent-color);
|
|
223
|
+
transition: var(--transition);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.wt-navigation-bar__expansion-arrow {
|
|
227
|
+
transition: var(--transition);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&--expanded:before,
|
|
231
|
+
&--active:before {
|
|
232
|
+
opacity: 1;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&--expanded .wt-navigation-bar__expansion-arrow {
|
|
236
|
+
transform: rotate(90deg);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.wt-navigation-bar__nav-expansion-name {
|
|
241
|
+
display: block;
|
|
242
|
+
max-width: var(--navigation-bar-active-expansion-name-max-width);
|
|
243
|
+
word-wrap: break-word;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.wt-navigation-bar__nav-item-link--subnav {
|
|
247
|
+
padding-left: var(--navigation-bar-subnav-padding-left);
|
|
248
|
+
}
|
|
249
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtNotificationsBar from '../wt-notifications-bar.vue';
|
|
3
|
+
import WtNotification from '../../../molecules/wt-notification/wt-notification.vue';
|
|
4
|
+
import eventBus from '../../../../scripts/eventBus';
|
|
5
|
+
|
|
6
|
+
describe('WtNotificationsBar', () => {
|
|
7
|
+
it('renders a component', () => {
|
|
8
|
+
const wrapper = shallowMount(WtNotificationsBar, {
|
|
9
|
+
mocks: { $eventBus: eventBus },
|
|
10
|
+
});
|
|
11
|
+
expect(wrapper.classes('wt-notifications-bar')).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('shows notification at event bus event', async () => {
|
|
15
|
+
const wrapper = shallowMount(WtNotificationsBar, {
|
|
16
|
+
mocks: { $eventBus: eventBus },
|
|
17
|
+
});
|
|
18
|
+
wrapper.vm.$eventBus.$emit('notification', {
|
|
19
|
+
type: 'error', text: 'error',
|
|
20
|
+
});
|
|
21
|
+
await wrapper.vm.$nextTick();
|
|
22
|
+
expect(wrapper.findAllComponents(WtNotification).length).toBe(1);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('closes notification manually', async () => {
|
|
26
|
+
const wrapper = shallowMount(WtNotificationsBar, {
|
|
27
|
+
mocks: { $eventBus: eventBus },
|
|
28
|
+
});
|
|
29
|
+
wrapper.vm.$eventBus.$emit('notification', {
|
|
30
|
+
type: 'error', text: 'error',
|
|
31
|
+
});
|
|
32
|
+
await wrapper.vm.$nextTick();
|
|
33
|
+
wrapper.findComponent(WtNotification).vm.$emit('close');
|
|
34
|
+
await wrapper.vm.$nextTick();
|
|
35
|
+
expect(wrapper.findAllComponents(WtNotification).length).toBe(0);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('closes notification automatically', async () => {
|
|
39
|
+
const wrapper = shallowMount(WtNotificationsBar, {
|
|
40
|
+
mocks: { $eventBus: eventBus },
|
|
41
|
+
data: () => ({ notificationDuration: 100 }),
|
|
42
|
+
});
|
|
43
|
+
wrapper.vm.$eventBus.$emit('notification', {
|
|
44
|
+
type: 'error', text: 'error',
|
|
45
|
+
});
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
expect(wrapper.findAllComponents(WtNotification).length).toBe(0);
|
|
48
|
+
}, 101);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<aside class="wt-notifications-bar">
|
|
3
|
+
<transition-group name="wt-notifications-transition" tag="div">
|
|
4
|
+
<wt-notification
|
|
5
|
+
v-for="(notification, key) of notifications"
|
|
6
|
+
:type="notification.type"
|
|
7
|
+
:key="key+notification.text"
|
|
8
|
+
@close="closeNotification(notification)"
|
|
9
|
+
>{{notification.text}}
|
|
10
|
+
</wt-notification>
|
|
11
|
+
</transition-group>
|
|
12
|
+
</aside>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'wt-notifications-bar',
|
|
18
|
+
data: () => ({
|
|
19
|
+
notificationDuration: 4000,
|
|
20
|
+
notifications: [],
|
|
21
|
+
}),
|
|
22
|
+
created() {
|
|
23
|
+
try {
|
|
24
|
+
this.$eventBus.$on('notification', this.showNotification);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.error('wt-notifications-bar cannot work without globally registered eventBus', err);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
destroyed() {
|
|
30
|
+
this.$eventBus.$off('notification', this.showNotification);
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
showNotification(notification) {
|
|
34
|
+
this.notifications.unshift(notification);
|
|
35
|
+
setTimeout(() => this.closeNotification(notification), this.notificationDuration);
|
|
36
|
+
},
|
|
37
|
+
closeNotification(notification) {
|
|
38
|
+
const index = this.notifications.indexOf(notification);
|
|
39
|
+
this.notifications.splice(index, 1);
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="scss" scoped>
|
|
46
|
+
.wt-notifications-bar {
|
|
47
|
+
@extend %wt-scrollbar;
|
|
48
|
+
|
|
49
|
+
position: fixed;
|
|
50
|
+
top: var(--notifications-bar-corner-margin);
|
|
51
|
+
right: var(--notifications-bar-corner-margin);
|
|
52
|
+
max-height: var(--notifications-bar-max-height);
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
overflow-x: hidden;
|
|
55
|
+
z-index: var(--notifications-bar-z-index);
|
|
56
|
+
|
|
57
|
+
.wt-notification {
|
|
58
|
+
margin: var(--notifications-bar-notifications-margin);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.wt-notifications-transition-enter-active,
|
|
63
|
+
.wt-notifications-transition-leave-active {
|
|
64
|
+
transition: all var(--transition);
|
|
65
|
+
}
|
|
66
|
+
.wt-notifications-transition-enter,
|
|
67
|
+
.wt-notifications-transition-leave-to {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transform: translateX(60px);
|
|
70
|
+
}
|
|
71
|
+
</style>
|