@webitel/ui-sdk 26.6.46 → 26.6.48

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.
Files changed (66) hide show
  1. package/dist/{components-gi3TmScp.js → components-BvEqkYgM.js} +575 -606
  2. package/dist/{composables-BJtyGE9D.js → composables-BB80tQ5H.js} +1 -1
  3. package/dist/{debounce-DrmECuJ2.js → debounce-DPzXwiOS.js} +9 -4
  4. package/dist/eventBus-By3thVlR.js +31 -0
  5. package/dist/ui-sdk.css +1 -1
  6. package/dist/ui-sdk.js +5015 -4022
  7. package/dist/ui-sdk.umd.cjs +918 -628
  8. package/dist/{useVidstackSrc-DfNrFbOO.js → useVidstackSrc-jCDCYTce.js} +1 -1
  9. package/dist/usetoast-BECIyaas.js +10 -0
  10. package/dist/{vidstack-Bq6c3Bam-3dCf_D36.js → vidstack-Bq6c3Bam-hoRopLll.js} +1 -1
  11. package/dist/{vidstack-D2pY00kU-DoW028io.js → vidstack-D2pY00kU-dXPuSPZl.js} +1 -1
  12. package/dist/{vidstack-audio-B58bvsna.js → vidstack-audio-CCSR8cXr.js} +1 -1
  13. package/dist/{vidstack-dash-CX-LTHx3.js → vidstack-dash-CNcNULYU.js} +2 -2
  14. package/dist/{vidstack-hls-CLzdTFu6.js → vidstack-hls-BP6P23Cc.js} +2 -2
  15. package/dist/{vidstack-video-XtP8iTBc.js → vidstack-video-IgjC6GLU.js} +2 -2
  16. package/dist/{wt-button-BJmzJIU6.js → wt-button-CZfPNaIj.js} +1 -1
  17. package/dist/{wt-chat-emoji-70Ip-iGR.js → wt-chat-emoji-D0e2D_oH.js} +571 -553
  18. package/dist/{wt-display-chip-items-7t7gfd-q.js → wt-display-chip-items-Df-7rB8U.js} +1 -1
  19. package/dist/{wt-expansion-card-Bvs6YO3O.js → wt-expansion-card-B9GnNWua.js} +1 -1
  20. package/dist/{wt-galleria-BXZJO_cB.js → wt-galleria-CbkWtFhM.js} +1 -1
  21. package/dist/{wt-icon-pxO7IjwV.js → wt-icon-DZxZg6ON.js} +2 -0
  22. package/dist/{wt-icon-btn-CjjI4cgE.js → wt-icon-btn-BUpa-fbk.js} +1 -1
  23. package/dist/wt-notifications-bar-CDTqa7M9.js +29 -0
  24. package/dist/{wt-pagination-BA_PZPIE.js → wt-pagination-CZuQFM3-.js} +1 -1
  25. package/dist/{wt-player-DROQ1CPs.js → wt-player-BxvfY3f0.js} +3 -3
  26. package/dist/{wt-search-bar-CWZdvAOf.js → wt-search-bar-CyMYRgHH.js} +1 -1
  27. package/dist/{wt-send-message-popup-Bg1K-tw8.js → wt-send-message-popup-D1z5Kbon.js} +1 -1
  28. package/dist/{wt-table-D4XANcJ1.js → wt-table-DRNWny3Q.js} +1 -1
  29. package/dist/wt-toast-m61COwji.js +44 -0
  30. package/dist/{wt-tree-table-MLET4gIv.js → wt-tree-table-2u2mPfO_.js} +1 -1
  31. package/dist/{wt-type-extension-value-input-DQhC5C4L.js → wt-type-extension-value-input-D2LEPL22.js} +1 -1
  32. package/dist/{wt-vidstack-player-CmdiCgCp.js → wt-vidstack-player-DTPlrBiG.js} +9 -9
  33. package/package.json +1 -1
  34. package/src/assets/icons/sprite/error.svg +4 -0
  35. package/src/assets/icons/sprite/index.ts +4 -0
  36. package/src/assets/icons/sprite/warning.svg +3 -0
  37. package/src/components/index.js +3 -3
  38. package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +49 -46
  39. package/src/components/wt-notifications-bar/wt-notifications-bar.vue +24 -84
  40. package/src/components/wt-toast/__tests__/WtToast.spec.js +19 -0
  41. package/src/components/wt-toast/types/index.ts +11 -0
  42. package/src/components/wt-toast/wt-toast.vue +53 -0
  43. package/src/components/wt-vidstack-player/components/panels/playback-controls-panel/components/time-group.vue +1 -0
  44. package/src/css/components-variables.css +0 -1
  45. package/src/enums/LoginOptions/LoginOptions.ts +7 -0
  46. package/src/enums/index.ts +2 -0
  47. package/src/plugins/primevue/primevue.plugin.js +4 -0
  48. package/src/plugins/primevue/theme/components/components.js +2 -0
  49. package/src/plugins/primevue/theme/components/toast/toast.js +26 -0
  50. package/types/components/wt-notifications-bar/wt-notifications-bar.vue.d.ts +1 -12
  51. package/types/components/wt-player/wt-player.vue.d.ts +1 -1
  52. package/types/components/wt-toast/types/index.d.ts +7 -0
  53. package/types/components/wt-toast/wt-toast.vue.d.ts +3 -0
  54. package/types/enums/LoginOptions/LoginOptions.d.ts +6 -0
  55. package/types/enums/index.d.ts +2 -1
  56. package/types/modules/Flow/lookups/FlowTypeApplications.lookup.d.ts +5 -5
  57. package/types/plugins/primevue/theme/components/components.d.ts +2 -0
  58. package/types/plugins/primevue/theme/components/toast/toast.d.ts +223 -0
  59. package/dist/isObject-Dgs_L5xI.js +0 -11
  60. package/dist/logger-hl3ueNok.js +0 -47
  61. package/dist/wt-notifications-bar-BwO_qvrc.js +0 -52
  62. package/src/components/wt-notification/__tests__/WtNotification.spec.js +0 -28
  63. package/src/components/wt-notification/_variables.css +0 -9
  64. package/src/components/wt-notification/wt-notification.vue +0 -68
  65. package/types/components/wt-notification/wt-notification.vue.d.ts +0 -18
  66. /package/types/components/{wt-notification/__tests__/WtNotification.spec.d.ts → wt-toast/__tests__/WtToast.spec.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./components-gi3TmScp.js";
1
+ import { c as e, i as t } from "./components-BvEqkYgM.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as r } from "./displayText-CtaxzaBz.js";
4
4
  import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { c as t } from "./enums-pbYAJNeb.js";
3
3
  import { t as n } from "./useExpansion-DVdIpoOn.js";
4
- import "./composables-BJtyGE9D.js";
4
+ import "./composables-BB80tQ5H.js";
5
5
  import { t as r } from "./wt-expand-transition-C2p9bR4j.js";
6
6
  import { createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, guardReactiveProps as c, normalizeClass as l, normalizeProps as u, openBlock as d, renderSlot as f, resolveComponent as p, toRef as m, unref as h, vShow as g, withCtx as _, withDirectives as v, withKeys as y } from "vue";
7
7
  //#region src/components/wt-expansion-card/wt-expansion-card.vue?vue&type=script&setup=true&lang.ts
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { t } from "./vue-i18n-B8Px6VcD.js";
3
- import { a as n, o as r } from "./composables-BJtyGE9D.js";
3
+ import { a as n, o as r } from "./composables-BB80tQ5H.js";
4
4
  import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as p, mergeProps as m, nextTick as h, normalizeClass as g, onMounted as _, onUnmounted as v, openBlock as y, ref as b, renderSlot as x, resolveComponent as S, toDisplayString as C, unref as w, useAttrs as T, useModel as E, vShow as D, watch as O, withCtx as k, withDirectives as A } from "vue";
5
5
  //#region src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup.js
6
6
  var j = () => {
@@ -904,6 +904,8 @@ var Ye = Je(), Xe = e({
904
904
  tick: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M18.1213 7.29289C18.5118 7.68342 18.5118 8.31658 18.1213 8.70711L11.1213 15.7071C10.3403 16.4882 9.07394 16.4882 8.29289 15.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L9.35355 13.9393C9.54882 14.1346 9.8654 14.1346 10.0607 13.9393L16.7071 7.29289C17.0976 6.90237 17.7308 6.90237 18.1213 7.29289Z\"/>\n</svg>\n",
905
905
  upload: "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M12 4C10.0181 4 8.38792 5.17946 7.69143 6.88619C7.56628 7.19288 7.29738 7.41769 6.97337 7.48653C5.2921 7.84373 4 9.37617 4 11.1774C4 13.3226 5.67696 15 7.81395 15C8.36624 15 8.81395 15.4477 8.81395 16C8.81395 16.5523 8.36624 17 7.81395 17C4.56901 17 2 14.4238 2 11.1774C2 8.59983 3.71529 6.39186 6.05171 5.66263C7.14127 3.48306 9.36157 2 12 2C15.1838 2 17.8548 4.26129 18.5018 7.25771C20.5249 7.8911 22 9.786 22 12.0161C22 14.7593 19.7659 17 17.0233 17C16.471 17 16.0233 16.5523 16.0233 16C16.0233 15.4477 16.471 15 17.0233 15C18.6579 15 20 13.6581 20 12.0161C20 10.5286 18.8967 9.28345 17.4704 9.06601C17.0202 8.99738 16.6733 8.63322 16.6264 8.18023C16.3845 5.83898 14.3926 4 12 4Z\"/>\n <path d=\"M11.9146 6.0036C11.7254 6.01961 11.5511 6.0883 11.4067 6.19496C11.3964 6.20254 11.3862 6.21033 11.3762 6.21833L11.3621 6.22969C11.2809 6.29681 11.2122 6.37536 11.1571 6.46172C11.1338 6.49819 11.1127 6.53627 11.0942 6.57576C10.988 6.79005 10.9006 6.99207 10.8125 7.19575C10.6324 7.61196 10.4494 8.03517 10.0963 8.58446C9.60834 9.34345 8.83095 10.2444 7.44524 11.1682C6.98572 11.4745 6.86154 12.0954 7.1679 12.5549C7.47425 13.0144 8.09512 13.1386 8.55464 12.8323C9.61983 12.1221 10.4056 11.402 11 10.7096V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V10.7098C13.5943 11.4022 14.3801 12.1222 15.4452 12.8323C15.9047 13.1386 16.5256 13.0144 16.8319 12.5549C17.1383 12.0954 17.0141 11.4745 16.5546 11.1682C15.1689 10.2444 14.3915 9.34345 13.9036 8.58446C13.5505 8.03516 13.3674 7.61196 13.1874 7.19575C13.1 6.9938 13.0134 6.79348 12.9084 6.58121C12.8768 6.51282 12.8377 6.44859 12.7922 6.3896C12.7487 6.33313 12.6989 6.2809 12.643 6.23411C12.4851 6.10143 12.2857 6.01666 12.0669 6.00221\"/>\n <path d=\"M11.9999 6C11.9715 5.99998 11.943 6.00117 11.9146 6.0036L11.9999 6Z\"/>\n</svg>\n",
906
906
  user: "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M14.011 7C14.011 8.10457 13.1107 9 12 9C10.8893 9 9.98898 8.10457 9.98898 7C9.98898 5.89543 10.8893 5 12 5C13.1107 5 14.011 5.89543 14.011 7ZM16.022 7C16.022 9.20914 14.2213 11 12 11C9.77869 11 7.97796 9.20914 7.97796 7C7.97796 4.79086 9.77869 3 12 3C14.2213 3 16.022 4.79086 16.022 7ZM18.9677 21.003C18.4811 17.6092 15.5469 15 12 15C8.45307 15 5.51891 17.6092 5.03229 21.003C4.95389 21.5497 4.51126 22 3.95593 22C3.4006 22 2.94455 21.5506 3.00547 21.0016C3.50492 16.5009 7.34137 13 12 13C16.6586 13 20.4951 16.5009 20.9945 21.0016C21.0554 21.5506 20.5994 22 20.0441 22C19.4887 22 19.0461 21.5497 18.9677 21.003Z\"/>\n</svg>\n",
907
+ error: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M14.2422 8.58594C14.6327 8.19541 15.2657 8.19541 15.6562 8.58594C16.0468 8.97646 16.0468 9.60948 15.6562 10L13.5352 12.1211L15.6562 14.2432C16.0466 14.6337 16.0467 15.2668 15.6562 15.6572C15.2658 16.0475 14.6327 16.0475 14.2422 15.6572L12.1211 13.5352L9.99902 15.6572C9.60847 16.0474 8.97536 16.0476 8.58496 15.6572C8.19456 15.2668 8.19481 14.6337 8.58496 14.2432L10.707 12.1211L8.58496 10C8.19468 9.60952 8.19468 8.97641 8.58496 8.58594C8.97542 8.19548 9.60848 8.1956 9.99902 8.58594L12.1211 10.707L14.2422 8.58594Z\" fill=\"#E54C4C\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z\" fill=\"#E54C4C\"/>\n</svg>\n",
908
+ warning: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM12 6C12.5523 6 13 6.44772 13 7V12.5C13 13.0523 12.5523 13.5 12 13.5C11.4477 13.5 11 13.0523 11 12.5V7C11 6.44772 11.4477 6 12 6ZM13 16.5C13 15.9477 12.5523 15.5 12 15.5C11.4477 15.5 11 15.9477 11 16.5V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16.5Z\" fill=\"#E28136\"/>\n</svg>\n",
907
909
  union: "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.0988 3.66504C12.4511 3.25822 11.6282 3.25636 10.9787 3.66024L4.94383 7.41318C4.35688 7.77819 4 8.42038 4 9.11156V15.4153C4 16.0929 4.34304 16.7243 4.91144 17.0931L10.9114 20.9859C11.5736 21.4155 12.4264 21.4155 13.0886 20.9859L19.0886 17.0931C19.657 16.7243 20 16.0929 20 15.4153V9.10565C20 8.41769 19.6464 7.77801 19.0638 7.41207L13.0988 3.66504ZM12.0349 5.35862L7.78725 8.00012L12.0349 10.6416L16.2401 8.00012L12.0349 5.35862ZM6 15.4153V9.24387L11 12.3532V18.6593L6 15.4153ZM13 18.6593L18 15.4153V9.25644L13 12.3972V18.6593Z\"/>\n</svg>\n",
908
910
  videoCamOff: "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M17.6943 12L20 10.3127V13.6873L17.6943 12ZM15.3846 15.5C15.3846 15.5658 15.378 15.6283 15.3661 15.6875C15.2792 16.1163 14.8665 16.5 14.3077 16.5H5.07692C4.43412 16.5 4 16.0049 4 15.5V8.5C4 7.99515 4.43412 7.5 5.07692 7.5L14.3077 7.5C14.8665 7.5 15.2792 7.88373 15.3661 8.31254C15.378 8.37173 15.3846 8.43417 15.3846 8.5V15.5ZM17.3846 9.74834V8.5C17.3846 8.30001 17.3645 8.10458 17.3263 7.91554C17.2917 7.7448 17.2422 7.57926 17.1793 7.42026C16.7347 6.29691 15.6166 5.5 14.3077 5.5L5.07692 5.5C3.37759 5.5 2 6.84315 2 8.5V15.5C2 17.1569 3.37759 18.5 5.07692 18.5H14.3077C15.6166 18.5 16.7347 17.7031 17.1793 16.5797C17.2422 16.4207 17.2917 16.2552 17.3263 16.0845C17.3645 15.8954 17.3846 15.7 17.3846 15.5V14.2517L20.3587 16.4281C21.0348 16.9228 22 16.4525 22 15.6283V8.37172C22 7.54751 21.0348 7.07718 20.3587 7.57194L17.3846 9.74834Z\"/>\n <path d=\"M8.5119 9.77455L9.63371 10.8931L10.7555 9.77455C11.0992 9.4319 11.6563 9.4319 12 9.77455C12.3437 10.1172 12.3437 10.6728 12 11.0154L10.8742 12.1379L11.9987 13.2591C12.3423 13.6018 12.3423 14.1573 11.9987 14.5C11.655 14.8427 11.0979 14.8427 10.7542 14.5L9.63371 13.3827L8.5132 14.5C8.16955 14.8427 7.61239 14.8427 7.26874 14.5C6.92508 14.1573 6.92508 13.6018 7.26874 13.2591L8.39322 12.1379L7.26743 11.0154C6.92378 10.6728 6.92378 10.1172 7.26743 9.77455C7.61108 9.4319 8.16825 9.4319 8.5119 9.77455Z\"\n fill=\"#E63E1A\"/>\n</svg>\n",
909
911
  "video-cam-off--filled": "<svg viewBox=\"0 0 64 64\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M38.1536 49.3335C41.644 49.3335 44.6267 47.2091 45.8125 44.2137C45.9803 43.7897 46.1109 43.3461 46.2031 42.8908C46.305 42.3871 46.3594 41.8664 46.3594 41.3335V38.0054L54.289 43.8075C56.092 45.1269 58.6666 43.8726 58.6666 41.6747V22.3257C58.6666 20.1278 56.092 18.8736 54.289 20.1929L46.3594 25.995V22.6669C46.3594 22.134 46.305 21.6133 46.2031 21.1096C46.1109 20.6543 45.9803 20.2107 45.8125 19.7867C44.6267 16.7913 41.644 14.6669 38.1536 14.6669H13.539C9.00747 14.6669 5.33331 18.2486 5.33331 22.6669V41.3335C5.33331 45.7518 9.00747 49.3335 13.539 49.3335H38.1536ZM31.9974 38.6669C31.081 39.5806 29.5935 39.5806 28.6771 38.6669L25.6901 35.6877L22.7031 38.6669C21.7867 39.5806 20.2992 39.5806 19.3828 38.6669C18.4666 37.7531 18.4665 36.2706 19.3828 35.357L22.3828 32.3674L19.3802 29.3752C18.4638 28.4615 18.4638 26.979 19.3802 26.0653C20.2965 25.1521 21.7816 25.1521 22.6979 26.0653L25.6901 29.0497L28.6823 26.0653C29.5987 25.1523 31.0838 25.152 32 26.0653C32.9164 26.979 32.9164 28.4615 32 29.3752L28.9974 32.3674L31.9974 35.357C32.9136 36.2706 32.9133 37.7531 31.9974 38.6669Z\" />\n</svg>\n",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./wt-icon-pxO7IjwV.js";
1
+ import { t as e } from "./wt-icon-DZxZg6ON.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeClass as f, normalizeProps as p, openBlock as m, renderSlot as h, resolveComponent as g, toDisplayString as _, useModel as v, useSlots as y, withCtx as b } from "vue";
4
4
  //#region src/components/wt-checkbox/wt-checkbox.vue?vue&type=script&setup=true&lang.ts
@@ -0,0 +1,29 @@
1
+ import { i as e } from "./enums-pbYAJNeb.js";
2
+ import { t } from "./wt-toast-m61COwji.js";
3
+ import { n } from "./usetoast-BECIyaas.js";
4
+ import { t as r } from "./eventBus-By3thVlR.js";
5
+ import { createBlock as i, inject as a, onUnmounted as o, openBlock as s } from "vue";
6
+ //#region src/components/wt-toast/types/index.ts
7
+ var c = {
8
+ success: e.SUCCESS,
9
+ info: e.INFO,
10
+ error: e.ERROR,
11
+ warning: e.WARN
12
+ }, l = 4e3, u = /*@__PURE__*/ Object.assign({ name: "WtNotificationsBar" }, {
13
+ __name: "wt-notifications-bar",
14
+ setup(e) {
15
+ let u = a("$eventBus", null) ?? r, d = n();
16
+ function f({ type: e, text: t, timeout: n }) {
17
+ d.add({
18
+ severity: c[e],
19
+ detail: t,
20
+ life: n == null ? l : n * 1e3
21
+ });
22
+ }
23
+ return u.$on("notification", f), o(() => {
24
+ u.$off("notification", f);
25
+ }), (e, n) => (s(), i(t, { position: "top-right" }));
26
+ }
27
+ });
28
+ //#endregion
29
+ export { u as default };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { t } from "./debounce-DrmECuJ2.js";
2
+ import { t } from "./debounce-DPzXwiOS.js";
3
3
  import { createElementBlock as n, createElementVNode as r, createVNode as i, openBlock as a, resolveComponent as o, resolveDirective as s, toDisplayString as c, withDirectives as l } from "vue";
4
4
  //#region src/components/wt-pagination/wt-pagination.vue
5
5
  var u = 10, d = {
@@ -1,8 +1,8 @@
1
- import { t as e } from "./wt-icon-pxO7IjwV.js";
1
+ import { t as e } from "./wt-icon-DZxZg6ON.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { c as n } from "./enums-pbYAJNeb.js";
4
- import { t as r } from "./wt-button-BJmzJIU6.js";
5
- import { n as i, t as a } from "./useVidstackSrc-DfNrFbOO.js";
4
+ import { t as r } from "./wt-button-CZfPNaIj.js";
5
+ import { n as i, t as a } from "./useVidstackSrc-jCDCYTce.js";
6
6
  import { t as o } from "./wt-popover-CJZH3wMl.js";
7
7
  import { t as s } from "./wt-slider-BS3SoGht.js";
8
8
  import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, normalizeClass as g, openBlock as _, ref as v, renderList as y, resolveComponent as b, toDisplayString as x, toRefs as S, unref as C, watch as w, withCtx as T } from "vue";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { t } from "./useValidation-DG0tifBv.js";
3
- import { t as n } from "./debounce-DrmECuJ2.js";
3
+ import { t as n } from "./debounce-DPzXwiOS.js";
4
4
  import { computed as r, createBlock as i, createCommentVNode as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderSlot as p, resolveComponent as m, resolveDirective as h, toDisplayString as g, toRefs as _, unref as v, withCtx as y, withDirectives as b } from "vue";
5
5
  //#region src/components/wt-search-bar/wt-search-bar.vue?vue&type=script&setup=true&lang.ts
6
6
  var x = { class: "wt-search-bar__icon-controls" }, S = /*#__PURE__*/ e(/* @__PURE__ */ u({
@@ -1,4 +1,4 @@
1
- import { n as e } from "./components-gi3TmScp.js";
1
+ import { n as e } from "./components-BvEqkYgM.js";
2
2
  import { t } from "./vue-i18n-B8Px6VcD.js";
3
3
  import { n, r } from "./clients-aQCH0OHp.js";
4
4
  import { createBlock as i, createTextVNode as a, createVNode as o, defineComponent as s, inject as c, mergeProps as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { t } from "./vue-i18n-B8Px6VcD.js";
3
3
  import { n, t as r } from "./sortQueryAdapters-CyYXvnDN.js";
4
- import { t as i } from "./composables-BJtyGE9D.js";
4
+ import { t as i } from "./composables-BB80tQ5H.js";
5
5
  import { Fragment as ee, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, normalizeStyle as h, onMounted as g, onUnmounted as _, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, resolveDirective as C, toDisplayString as w, useSlots as T, useTemplateRef as E, withCtx as D, withDirectives as O, withModifiers as k } from "vue";
6
6
  //#region src/components/wt-table/wt-table.vue?vue&type=script&setup=true&lang.ts
7
7
  var A = { class: "wt-table__th__content typo-body-1-bold" }, j = { class: "wt-table__td__actions" }, M = 10, N = /*#__PURE__*/ e(/* @__PURE__ */ p({
@@ -0,0 +1,44 @@
1
+ import { t as e } from "./wt-icon-DZxZg6ON.js";
2
+ import { c as t, i as n } from "./enums-pbYAJNeb.js";
3
+ import { createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, normalizeProps as u, openBlock as d, resolveComponent as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
4
+ //#region src/components/wt-toast/wt-toast.vue?vue&type=script&setup=true&lang.ts
5
+ var g = { class: "p-toast-message-text" }, _ = { class: "p-toast-summary" }, v = {
6
+ key: 0,
7
+ class: "p-toast-detail"
8
+ }, y = /* @__PURE__ */ c({
9
+ name: "WtToast",
10
+ inheritAttrs: !1,
11
+ __name: "wt-toast",
12
+ setup(c) {
13
+ let y = {
14
+ success: "done",
15
+ info: "rounded-info",
16
+ warn: "warning",
17
+ error: "error"
18
+ }, b = {
19
+ success: n.SUCCESS,
20
+ info: n.INFO,
21
+ warn: n.WARN,
22
+ error: n.ERROR,
23
+ contrast: n.CONTRAST,
24
+ secondary: n.SECONDARY
25
+ };
26
+ return (c, x) => {
27
+ let S = f("PToast");
28
+ return d(), r(S, u(l(c.$attrs)), {
29
+ message: h(({ message: t }) => [s(e, {
30
+ icon: y[t.severity] ?? "",
31
+ color: b[t.severity] ?? m(n).CONTRAST,
32
+ class: "p-toast-message-icon"
33
+ }, null, 8, ["icon", "color"]), o("div", g, [o("span", _, p(t.summary), 1), t.detail ? (d(), a("div", v, p(t.detail), 1)) : i("", !0)])]),
34
+ closeicon: h(() => [s(e, {
35
+ icon: "close",
36
+ size: m(t).SM
37
+ }, null, 8, ["size"])]),
38
+ _: 1
39
+ }, 16);
40
+ };
41
+ }
42
+ });
43
+ //#endregion
44
+ export { y as t };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { n as t, t as n } from "./wt-icon-btn-CjjI4cgE.js";
2
+ import { n as t, t as n } from "./wt-icon-btn-BUpa-fbk.js";
3
3
  import { n as r } from "./sortQueryAdapters-CyYXvnDN.js";
4
4
  import { t as i } from "./useWtTable-tqmVOvve.js";
5
5
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createTextVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, normalizeStyle as g, onMounted as _, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, toDisplayString as C, toRef as w, unref as T, withCtx as E, withModifiers as D } from "vue";
@@ -1,4 +1,4 @@
1
- import { a as e, o as t, r as n, s as r } from "./components-gi3TmScp.js";
1
+ import { a as e, o as t, r as n, s as r } from "./components-BvEqkYgM.js";
2
2
  import { t as i } from "./enums-pbYAJNeb.js";
3
3
  import { t as a } from "./vue-i18n-B8Px6VcD.js";
4
4
  import { t as o } from "./clients-aQCH0OHp.js";
@@ -1,10 +1,10 @@
1
- import { l as e } from "./components-gi3TmScp.js";
1
+ import { l as e } from "./components-BvEqkYgM.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { c as n } from "./enums-pbYAJNeb.js";
4
- import "./wt-button-BJmzJIU6.js";
5
- import { t as r } from "./wt-icon-btn-CjjI4cgE.js";
4
+ import "./wt-button-CZfPNaIj.js";
5
+ import { t as r } from "./wt-icon-btn-BUpa-fbk.js";
6
6
  import { $ as i, A as a, B as o, C as s, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as ee, P as te, Q as _, R as ne, T as re, U as v, W as ie, X as ae, Y as oe, Z as y, _ as b, a as se, at as ce, b as le, c as ue, d as de, et as x, f as fe, g as pe, h as me, i as S, it as he, k as ge, l as C, m as _e, n as w, nt as ve, o as T, p as E, q as D, r as O, rt as k, st as ye, t as be, tt as xe, u as Se, v as A, w as j, x as Ce, y as we, z as Te } from "./vidstack-BGSTndAW-CyKM_CM4.js";
7
- import { _ as Ee, a as De, c as Oe, f as ke, g as Ae, h as je, i as Me, l as Ne, n as Pe, r as Fe, s as Ie, t as Le, u as Re, v as ze, x as Be, y as Ve } from "./useVidstackSrc-DfNrFbOO.js";
7
+ import { _ as Ee, a as De, c as Oe, f as ke, g as Ae, h as je, i as Me, l as Ne, n as Pe, r as Fe, s as Ie, t as Le, u as Re, v as ze, x as Be, y as Ve } from "./useVidstackSrc-jCDCYTce.js";
8
8
  import { i as He, n as Ue } from "./vidstack-CTojmhKq-D7sZJxgm.js";
9
9
  import { _ as M, a as We, c as Ge, d as Ke, f as qe, g as Je, h as N, i as Ye, l as Xe, m as Ze, n as Qe, o as $e, p as et, r as tt, s as nt, t as P, u as rt } from "./vidstack-C2US-gSO-DeIgENrW.js";
10
10
  import { n as it, r as F, t as at } from "./vidstack-Dihypf8P-ibWMCHK-.js";
@@ -1225,7 +1225,7 @@ var _n = class extends cn {
1225
1225
  return "audio";
1226
1226
  }
1227
1227
  async load(e) {
1228
- return new (await (import("./vidstack-audio-B58bvsna.js"))).AudioProvider(this.target, e);
1228
+ return new (await (import("./vidstack-audio-CCSR8cXr.js"))).AudioProvider(this.target, e);
1229
1229
  }
1230
1230
  }, yn = class {
1231
1231
  name = "video";
@@ -1237,7 +1237,7 @@ var _n = class extends cn {
1237
1237
  return "video";
1238
1238
  }
1239
1239
  async load(e) {
1240
- return new (await (import("./vidstack-video-XtP8iTBc.js"))).VideoProvider(this.target, e);
1240
+ return new (await (import("./vidstack-video-IgjC6GLU.js"))).VideoProvider(this.target, e);
1241
1241
  }
1242
1242
  }, bn = class e extends yn {
1243
1243
  static supported = Ve();
@@ -1246,7 +1246,7 @@ var _n = class extends cn {
1246
1246
  return e.supported && ze(t);
1247
1247
  }
1248
1248
  async load(e) {
1249
- return new (await (import("./vidstack-hls-CLzdTFu6.js"))).HLSProvider(this.target, e);
1249
+ return new (await (import("./vidstack-hls-BP6P23Cc.js"))).HLSProvider(this.target, e);
1250
1250
  }
1251
1251
  }, xn = class e extends yn {
1252
1252
  static supported = Ee();
@@ -1255,7 +1255,7 @@ var _n = class extends cn {
1255
1255
  return e.supported && Ae(t);
1256
1256
  }
1257
1257
  async load(e) {
1258
- return new (await (import("./vidstack-dash-CX-LTHx3.js"))).DASHProvider(this.target, e);
1258
+ return new (await (import("./vidstack-dash-CNcNULYU.js"))).DASHProvider(this.target, e);
1259
1259
  }
1260
1260
  }, Sn = class {
1261
1261
  name = "vimeo";
@@ -1651,7 +1651,7 @@ var _n = class extends cn {
1651
1651
  throw e.code = "CAST_NOT_AVAILABLE", e;
1652
1652
  }
1653
1653
  if (He("https://www.gstatic.com"), !this.#b) {
1654
- let e = await import("./vidstack-D2pY00kU-DoW028io.js");
1654
+ let e = await import("./vidstack-D2pY00kU-dXPuSPZl.js");
1655
1655
  this.#b = new e.GoogleCastLoader();
1656
1656
  }
1657
1657
  await this.#b.prompt(this.#n), e && this.#t.queue.enqueue("media-google-cast-request", e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.6.46",
3
+ "version": "26.6.48",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.2422 8.58594C14.6327 8.19541 15.2657 8.19541 15.6562 8.58594C16.0468 8.97646 16.0468 9.60948 15.6562 10L13.5352 12.1211L15.6562 14.2432C16.0466 14.6337 16.0467 15.2668 15.6562 15.6572C15.2658 16.0475 14.6327 16.0475 14.2422 15.6572L12.1211 13.5352L9.99902 15.6572C9.60847 16.0474 8.97536 16.0476 8.58496 15.6572C8.19456 15.2668 8.19481 14.6337 8.58496 14.2432L10.707 12.1211L8.58496 10C8.19468 9.60952 8.19468 8.97641 8.58496 8.58594C8.97542 8.19548 9.60848 8.1956 9.99902 8.58594L12.1211 10.707L14.2422 8.58594Z" fill="#E54C4C"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z" fill="#E54C4C"/>
4
+ </svg>
@@ -89,6 +89,7 @@ import elevenlabs from './elevenlabs.svg?raw';
89
89
  import email from './email.svg?raw';
90
90
  import emailInbound from './email-inbound.svg?raw';
91
91
  import emailOutbound from './email-outbound.svg?raw';
92
+ import error from './error.svg?raw';
92
93
  import expand from './expand.svg?raw';
93
94
  import exportExel from './export-exel.svg?raw';
94
95
  import eyeClosed from './eye--closed.svg?raw';
@@ -238,6 +239,7 @@ import videoCamOff from './video-cam-off.svg?raw';
238
239
  import videoCamOffFilled from './video-cam-off--filled.svg?raw';
239
240
  import violation from './violation.svg?raw';
240
241
  import violationFilled from './violation--filled.svg?raw';
242
+ import warning from './warning.svg?raw';
241
243
  import webitelLogo from './webitel-logo.svg?raw';
242
244
  import zoomIn from './zoom-in.svg?raw';
243
245
  import zoomOut from './zoom-out.svg?raw';
@@ -418,6 +420,8 @@ export default objCamelToKebab({
418
420
  tick,
419
421
  upload,
420
422
  user,
423
+ error,
424
+ warning,
421
425
  union,
422
426
  videoCamOff,
423
427
  'video-cam-off--filled': videoCamOffFilled,
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM12 6C12.5523 6 13 6.44772 13 7V12.5C13 13.0523 12.5523 13.5 12 13.5C11.4477 13.5 11 13.0523 11 12.5V7C11 6.44772 11.4477 6 12 6ZM13 16.5C13 15.9477 12.5523 15.5 12 15.5C11.4477 15.5 11 15.9477 11 16.5V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16.5Z" fill="#E28136"/>
3
+ </svg>
@@ -33,7 +33,6 @@ import WtLogo from './wt-logo/wt-logo.vue';
33
33
  import WtMessage from './wt-message/wt-message.vue';
34
34
  import WtMultiSelect from './wt-multi-select/wt-multi-select.vue';
35
35
  import WtNavigationBar from './wt-navigation-bar/wt-navigation-bar.vue';
36
- import WtNotification from './wt-notification/wt-notification.vue';
37
36
  import WtPageWrapper from './wt-page-wrapper/wt-page-wrapper.vue';
38
37
  import WtPassword from './wt-password/wt-password.vue';
39
38
  import WtPopup from './wt-popup/wt-popup.vue';
@@ -44,6 +43,7 @@ import WtSelect from './wt-select/wt-select.vue';
44
43
  import WtSingleSelect from './wt-single-select/wt-single-select.vue';
45
44
  import WtSwitcher from './wt-switcher/wt-switcher.vue';
46
45
  import WtTextarea from './wt-textarea/wt-textarea.vue';
46
+ import WtToast from './wt-toast/wt-toast.vue';
47
47
  import WtTooltip from './wt-tooltip/wt-tooltip.vue';
48
48
 
49
49
  // Async components - heavy or rarely used components
@@ -199,7 +199,6 @@ const Components = {
199
199
  WtPassword,
200
200
  WtIntersectionObserver,
201
201
  WtHint,
202
- WtNotification,
203
202
  WtPopup,
204
203
  WtProgressBar,
205
204
  WtRadio,
@@ -211,6 +210,7 @@ const Components = {
211
210
  WtTimeInput,
212
211
  WtTimepicker,
213
212
  WtTextarea,
213
+ WtToast,
214
214
  WtAppHeader,
215
215
  WtHeadline,
216
216
  WtBreadcrumb,
@@ -308,7 +308,6 @@ export {
308
308
  WtMultiSelect,
309
309
  WtNavigationBar,
310
310
  WtNavigationMenu,
311
- WtNotification,
312
311
  WtNotificationsBar,
313
312
  WtPageHeader,
314
313
  WtPageWrapper,
@@ -339,6 +338,7 @@ export {
339
338
  WtTextarea,
340
339
  WtTimeInput,
341
340
  WtTimepicker,
341
+ WtToast,
342
342
  WtTooltip,
343
343
  WtTree,
344
344
  WtTreeTable,
@@ -1,72 +1,75 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import { useToast } from 'primevue/usetoast';
2
3
 
3
4
  import eventBus from '../../../scripts/eventBus.js';
4
- import WtNotification from '../../wt-notification/wt-notification.vue';
5
+ import { TypeToSeverityMap } from '../../wt-toast/types';
6
+ import WtToast from '../../wt-toast/wt-toast.vue';
5
7
  import WtNotificationsBar from '../wt-notifications-bar.vue';
6
8
 
9
+ vi.mock('primevue/usetoast');
10
+
7
11
  describe('WtNotificationsBar', () => {
8
- it('renders a component', () => {
9
- const wrapper = shallowMount(WtNotificationsBar, {
10
- global: {
11
- provide: {
12
- $eventBus: eventBus,
13
- },
14
- },
12
+ let toastAdd;
13
+
14
+ beforeEach(() => {
15
+ toastAdd = vi.fn();
16
+ useToast.mockReturnValue({
17
+ add: toastAdd,
15
18
  });
16
- expect(wrapper.classes('wt-notifications-bar')).toBe(true);
17
19
  });
18
20
 
19
- it('shows notification at event bus event', async () => {
20
- const wrapper = shallowMount(WtNotificationsBar, {
21
+ function mountComponent() {
22
+ return shallowMount(WtNotificationsBar, {
21
23
  global: {
22
24
  provide: {
23
25
  $eventBus: eventBus,
24
26
  },
25
27
  },
26
28
  });
27
- eventBus.$emit('notification', {
28
- type: 'error',
29
- text: 'error',
30
- });
31
- await wrapper.vm.$nextTick();
32
- expect(wrapper.findAllComponents(WtNotification).length).toBe(1);
29
+ }
30
+
31
+ it('renders WtToast with position top-right', () => {
32
+ const wrapper = mountComponent();
33
+ const wtToast = wrapper.findComponent(WtToast);
34
+ expect(wtToast.exists()).toBe(true);
35
+ expect(wtToast.attributes('position')).toBe('top-right');
36
+ wrapper.unmount();
33
37
  });
34
38
 
35
- it('closes notification manually', async () => {
36
- const wrapper = shallowMount(WtNotificationsBar, {
37
- global: {
38
- provide: {
39
- $eventBus: eventBus,
40
- },
41
- },
42
- });
39
+ it('calls toast.add with mapped severity and detail on notification event', () => {
40
+ const wrapper = mountComponent();
43
41
  eventBus.$emit('notification', {
44
42
  type: 'error',
45
- text: 'error',
43
+ text: 'Something went wrong',
44
+ });
45
+ expect(toastAdd).toHaveBeenCalledWith({
46
+ severity: TypeToSeverityMap.error,
47
+ detail: 'Something went wrong',
48
+ life: 4000,
46
49
  });
47
- await wrapper.vm.$nextTick();
48
- wrapper.findComponent(WtNotification).vm.$emit('close');
49
- await wrapper.vm.$nextTick();
50
- expect(wrapper.findAllComponents(WtNotification).length).toBe(0);
50
+ wrapper.unmount();
51
51
  });
52
52
 
53
- it('closes notification automatically', async () => {
54
- const wrapper = shallowMount(WtNotificationsBar, {
55
- global: {
56
- provide: {
57
- $eventBus: eventBus,
58
- },
59
- },
60
- data: () => ({
61
- notificationDuration: 100,
62
- }),
63
- });
53
+ it('converts timeout from seconds to milliseconds as toast life', () => {
54
+ const wrapper = mountComponent();
64
55
  eventBus.$emit('notification', {
65
- type: 'error',
66
- text: 'error',
56
+ type: 'success',
57
+ text: 'Done',
58
+ timeout: 10,
67
59
  });
68
- setTimeout(() => {
69
- expect(wrapper.findAllComponents(WtNotification).length).toBe(0);
70
- }, 101);
60
+ expect(toastAdd).toHaveBeenCalledWith({
61
+ severity: TypeToSeverityMap.success,
62
+ detail: 'Done',
63
+ life: 10000,
64
+ });
65
+ wrapper.unmount();
66
+ });
67
+
68
+ it('unregisters event bus listener on unmount', () => {
69
+ const offSpy = vi.spyOn(eventBus, '$off');
70
+ const wrapper = mountComponent();
71
+ wrapper.unmount();
72
+ expect(offSpy).toHaveBeenCalledWith('notification', expect.any(Function));
73
+ offSpy.mockRestore();
71
74
  });
72
75
  });
@@ -1,97 +1,37 @@
1
1
  <template>
2
- <aside class="wt-notifications-bar wt-scrollbar">
3
- <transition-group
4
- class="wt-notifications-bar__wrapper"
5
- name="wt-notifications-transition"
6
- tag="div"
7
- >
8
- <wt-notification
9
- v-for="(notification, key) of notifications"
10
- :key="key + notification.text"
11
- :type="notification.type"
12
- @close="closeNotification(notification)"
13
- >
14
- {{ notification.text }}
15
- </wt-notification>
16
- </transition-group>
17
- </aside>
2
+ <wt-toast position="top-right" />
18
3
  </template>
19
4
 
20
- <script>
5
+ <script setup>
6
+ import { useToast } from 'primevue/usetoast';
7
+ import { inject, onUnmounted } from 'vue';
21
8
  import defaultEventBus from '../../scripts/eventBus.js';
22
- import { _wtUiLog as loggr } from '../../scripts/logger.js';
9
+ import { TypeToSeverityMap } from '../wt-toast/types';
10
+ import WtToast from '../wt-toast/wt-toast.vue';
23
11
 
24
- export default {
12
+ defineOptions({
25
13
  name: 'WtNotificationsBar',
26
- inject: [
27
- '$eventBus',
28
- ],
29
- data: () => ({
30
- notificationDuration: 4000,
31
- notifications: [],
14
+ });
32
15
 
33
- eventBus: defaultEventBus,
34
- }),
35
- created() {
36
- if (this.$eventBus) {
37
- this.eventBus = this.$eventBus;
38
- } else {
39
- loggr.warn({
40
- entity: 'component',
41
- module: 'wt-notification-bar',
42
- })(
43
- 'no globally provided $eventBus found, using default webitel-ui eventBus',
44
- );
45
- }
16
+ const DEFAULT_NOTIFICATION_LIFE_MS = 4000;
46
17
 
47
- this.eventBus.$on('notification', this.showNotification);
48
- },
49
- unmounted() {
50
- this.eventBus.$off('notification', this.showNotification);
51
- },
52
- methods: {
53
- showNotification(notification) {
54
- this.notifications.unshift(notification);
55
- setTimeout(
56
- () => this.closeNotification(notification),
57
- notification.timeout * 1000 || this.notificationDuration,
58
- );
59
- },
60
- closeNotification(notification) {
61
- const index = this.notifications.indexOf(notification);
62
- this.notifications.splice(index, 1);
63
- },
64
- },
65
- };
66
- </script>
18
+ const injectedEventBus = inject('$eventBus', null);
67
19
 
68
- <style scoped>
69
- .wt-notifications-bar {
70
- position: fixed;
71
- top: var(--notifications-bar-corner-margin);
72
- right: var(--notifications-bar-corner-margin);
73
- z-index: var(--notifications-bar-z-index);
74
- max-height: var(--notifications-bar-max-height);
75
- overflow-x: hidden;
76
- overflow-y: auto;
77
- }
20
+ const activeEventBus = injectedEventBus ?? defaultEventBus;
78
21
 
79
- .wt-notifications-bar__wrapper {
80
- display: flex;
81
- flex-direction: column;
82
- gap: var(--spacing-xs);
83
- min-height: 0;
84
- align-items: flex-end;
85
- }
22
+ const toast = useToast();
86
23
 
87
- .wt-notifications-transition-enter-active,
88
- .wt-notifications-transition-leave-active {
89
- transition: all var(--transition);
24
+ function showNotification({ type, text, timeout }) {
25
+ toast.add({
26
+ severity: TypeToSeverityMap[type],
27
+ detail: text,
28
+ life: timeout != null ? timeout * 1000 : DEFAULT_NOTIFICATION_LIFE_MS,
29
+ });
90
30
  }
91
31
 
92
- .wt-notifications-transition-enter,
93
- .wt-notifications-transition-leave-to {
94
- transform: translateX(60px);
95
- opacity: 0;
96
- }
97
- </style>
32
+ activeEventBus.$on('notification', showNotification);
33
+
34
+ onUnmounted(() => {
35
+ activeEventBus.$off('notification', showNotification);
36
+ });
37
+ </script>
@@ -0,0 +1,19 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+
3
+ import WtToast from '../wt-toast.vue';
4
+
5
+ describe('WtToast', () => {
6
+ it('renders a component', () => {
7
+ const wrapper = shallowMount(WtToast);
8
+ expect(wrapper.exists()).toBe(true);
9
+ });
10
+
11
+ it('forwards attributes to the underlying PToast', () => {
12
+ const wrapper = shallowMount(WtToast, {
13
+ attrs: {
14
+ position: 'bottom-right',
15
+ },
16
+ });
17
+ expect(wrapper.attributes('position')).toBe('bottom-right');
18
+ });
19
+ });
@@ -0,0 +1,11 @@
1
+ import { MessageColor } from '../../../enums';
2
+
3
+ export const TypeToSeverityMap = {
4
+ success: MessageColor.SUCCESS,
5
+ info: MessageColor.INFO,
6
+ error: MessageColor.ERROR,
7
+ warning: MessageColor.WARN,
8
+ } as const;
9
+
10
+ export type TypeToSeverityMap =
11
+ (typeof TypeToSeverityMap)[keyof typeof TypeToSeverityMap];