@vc-shell/framework 1.0.128 → 1.0.130

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 (331) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/core/api/platform.ts +514 -92
  3. package/core/composables/index.ts +2 -1
  4. package/core/composables/useApiClient/index.ts +1 -7
  5. package/core/composables/useAssets/index.ts +0 -6
  6. package/core/composables/useBeforeUnload/index.ts +20 -0
  7. package/core/composables/useMenuService/index.ts +96 -0
  8. package/core/composables/useNotifications/index.ts +29 -40
  9. package/core/composables/useSettings/index.ts +23 -29
  10. package/core/composables/useUser/index.ts +61 -132
  11. package/core/directives/loading/styles.css +5 -5
  12. package/core/interceptors/index.ts +75 -0
  13. package/core/plugins/i18n/index.ts +1 -0
  14. package/core/plugins/modularity/index.ts +63 -20
  15. package/core/plugins/moment/moment.ts +2 -2
  16. package/core/plugins/signalR/index.ts +23 -3
  17. package/core/types/index.ts +18 -35
  18. package/core/utilities/kebabToCamel.ts +1 -1
  19. package/dist/core/api/platform.d.ts +125 -87
  20. package/dist/core/api/platform.d.ts.map +1 -1
  21. package/dist/core/composables/index.d.ts +2 -1
  22. package/dist/core/composables/index.d.ts.map +1 -1
  23. package/dist/core/composables/useApiClient/index.d.ts.map +1 -1
  24. package/dist/core/composables/useAssets/index.d.ts.map +1 -1
  25. package/dist/core/composables/useBeforeUnload/index.d.ts +5 -0
  26. package/dist/core/composables/useBeforeUnload/index.d.ts.map +1 -0
  27. package/dist/core/composables/useMenuService/index.d.ts +16 -0
  28. package/dist/core/composables/useMenuService/index.d.ts.map +1 -0
  29. package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
  30. package/dist/core/composables/useSettings/index.d.ts +2 -2
  31. package/dist/core/composables/useSettings/index.d.ts.map +1 -1
  32. package/dist/core/composables/useUser/index.d.ts +8 -6
  33. package/dist/core/composables/useUser/index.d.ts.map +1 -1
  34. package/dist/core/interceptors/index.d.ts +3 -0
  35. package/dist/core/interceptors/index.d.ts.map +1 -0
  36. package/dist/core/plugins/i18n/index.d.ts.map +1 -1
  37. package/dist/core/plugins/modularity/index.d.ts +1 -1
  38. package/dist/core/plugins/modularity/index.d.ts.map +1 -1
  39. package/dist/core/plugins/moment/moment.d.ts.map +1 -1
  40. package/dist/core/plugins/signalR/index.d.ts.map +1 -1
  41. package/dist/core/types/index.d.ts +16 -29
  42. package/dist/core/types/index.d.ts.map +1 -1
  43. package/dist/{framework.mjs → framework.js} +32147 -32235
  44. package/dist/index.css +1 -1
  45. package/dist/index.d.ts +5 -2
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/shared/components/app-switcher/components/vc-app-switcher/index.d.ts +1 -19
  48. package/dist/shared/components/app-switcher/components/vc-app-switcher/index.d.ts.map +1 -1
  49. package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts +3 -0
  50. package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts.map +1 -1
  51. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts +1 -70
  52. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts.map +1 -1
  53. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts +1 -82
  54. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
  55. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +28 -0
  56. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -0
  57. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts +11 -27
  58. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
  59. package/dist/shared/components/blade-navigation/injectionKeys.d.ts +4 -0
  60. package/dist/shared/components/blade-navigation/injectionKeys.d.ts.map +1 -0
  61. package/dist/shared/components/blade-navigation/plugin.d.ts +4 -1
  62. package/dist/shared/components/blade-navigation/plugin.d.ts.map +1 -1
  63. package/dist/shared/components/blade-navigation/types/index.d.ts +48 -35
  64. package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
  65. package/dist/shared/components/error-interceptor/index.d.ts +33 -67
  66. package/dist/shared/components/error-interceptor/index.d.ts.map +1 -1
  67. package/dist/shared/components/index.d.ts +2 -0
  68. package/dist/shared/components/index.d.ts.map +1 -1
  69. package/dist/shared/components/language-selector/index.d.ts +1 -49
  70. package/dist/shared/components/language-selector/index.d.ts.map +1 -1
  71. package/dist/shared/components/language-selector/language-selector.vue.d.ts +1 -40
  72. package/dist/shared/components/language-selector/language-selector.vue.d.ts.map +1 -1
  73. package/dist/{ui/components/organisms/vc-notification-dropdown → shared/components/notification-dropdown}/_internal/notification/notification.vue.d.ts +2 -2
  74. package/dist/shared/components/notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -0
  75. package/dist/shared/components/notification-dropdown/index.d.ts +7 -0
  76. package/dist/shared/components/notification-dropdown/index.d.ts.map +1 -0
  77. package/dist/shared/components/notification-dropdown/notification-dropdown.vue.d.ts +3 -0
  78. package/dist/shared/components/notification-dropdown/notification-dropdown.vue.d.ts.map +1 -0
  79. package/dist/shared/components/notification-template/index.d.ts +91 -0
  80. package/dist/shared/components/notification-template/index.d.ts.map +1 -0
  81. package/dist/{ui/components/organisms/vc-notification-template/vc-notification-template.vue.d.ts → shared/components/notification-template/notification-template.vue.d.ts} +2 -2
  82. package/dist/shared/components/notification-template/notification-template.vue.d.ts.map +1 -0
  83. package/dist/shared/components/notifications/components/notification-container/index.d.ts +1 -1
  84. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
  85. package/dist/shared/components/popup-handler/composables/usePopup/index.d.ts.map +1 -1
  86. package/dist/shared/components/user-dropdown-button/index.d.ts +10 -16
  87. package/dist/shared/components/user-dropdown-button/index.d.ts.map +1 -1
  88. package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts +7 -4
  89. package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
  90. package/dist/shared/index.d.ts +4 -1
  91. package/dist/shared/index.d.ts.map +1 -1
  92. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts +3 -0
  93. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
  94. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +3 -0
  95. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
  96. package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
  97. package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -1
  98. package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
  99. package/dist/shared/modules/dynamic/factories/types/index.d.ts +3 -1
  100. package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
  101. package/dist/shared/modules/dynamic/index.d.ts +1 -3
  102. package/dist/shared/modules/dynamic/index.d.ts.map +1 -1
  103. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +12 -10
  104. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
  105. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +5 -2
  106. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  107. package/dist/shared/modules/dynamic/types/index.d.ts +16 -1
  108. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  109. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  110. package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
  111. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  112. package/dist/shared/utilities/vueUtils.d.ts.map +1 -1
  113. package/dist/tailwind.config.d.ts +56 -0
  114. package/dist/tailwind.config.d.ts.map +1 -0
  115. package/dist/tsconfig.tsbuildinfo +1 -1
  116. package/dist/ui/components/atoms/vc-badge/index.d.ts +32 -67
  117. package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -1
  118. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
  119. package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +6 -1
  120. package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
  121. package/dist/ui/components/atoms/vc-card/index.d.ts +66 -102
  122. package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
  123. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +7 -0
  124. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -0
  125. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts +7 -1
  126. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
  127. package/dist/ui/components/atoms/vc-checkbox/index.d.ts +91 -129
  128. package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -1
  129. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts +7 -1
  130. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
  131. package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts +6 -1
  132. package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts.map +1 -1
  133. package/dist/ui/components/atoms/vc-container/index.d.ts +36 -71
  134. package/dist/ui/components/atoms/vc-container/index.d.ts.map +1 -1
  135. package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts.map +1 -1
  136. package/dist/ui/components/atoms/vc-hint/index.d.ts +8 -38
  137. package/dist/ui/components/atoms/vc-hint/index.d.ts.map +1 -1
  138. package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
  139. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +3 -0
  140. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  141. package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts +3 -0
  142. package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts.map +1 -1
  143. package/dist/ui/components/atoms/vc-info-row/vc-info-row.vue.d.ts +3 -0
  144. package/dist/ui/components/atoms/vc-info-row/vc-info-row.vue.d.ts.map +1 -1
  145. package/dist/ui/components/atoms/vc-label/index.d.ts +42 -74
  146. package/dist/ui/components/atoms/vc-label/index.d.ts.map +1 -1
  147. package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts +7 -1
  148. package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts.map +1 -1
  149. package/dist/ui/components/atoms/vc-link/index.d.ts +32 -66
  150. package/dist/ui/components/atoms/vc-link/index.d.ts.map +1 -1
  151. package/dist/ui/components/atoms/vc-link/vc-link.vue.d.ts.map +1 -1
  152. package/dist/ui/components/atoms/vc-loading/vc-loading.vue.d.ts.map +1 -1
  153. package/dist/ui/components/atoms/vc-progress/index.d.ts +30 -63
  154. package/dist/ui/components/atoms/vc-progress/index.d.ts.map +1 -1
  155. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +3 -0
  156. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
  157. package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts +3 -1
  158. package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts.map +1 -1
  159. package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts +6 -1
  160. package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts.map +1 -1
  161. package/dist/ui/components/atoms/vc-status-icon/vc-status-icon.vue.d.ts.map +1 -1
  162. package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts.map +1 -1
  163. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts +3 -0
  164. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
  165. package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
  166. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts +3 -0
  167. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
  168. package/dist/ui/components/molecules/vc-code-editor/index.d.ts +59 -98
  169. package/dist/ui/components/molecules/vc-code-editor/index.d.ts.map +1 -1
  170. package/dist/ui/components/molecules/vc-code-editor/vc-code-editor.vue.d.ts +1 -0
  171. package/dist/ui/components/molecules/vc-code-editor/vc-code-editor.vue.d.ts.map +1 -1
  172. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +4 -1
  173. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  174. package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts.map +1 -1
  175. package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts +3 -0
  176. package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -1
  177. package/dist/ui/components/molecules/vc-file-upload/index.d.ts +67 -105
  178. package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -1
  179. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +3 -0
  180. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
  181. package/dist/ui/components/molecules/vc-form/index.d.ts +8 -38
  182. package/dist/ui/components/molecules/vc-form/index.d.ts.map +1 -1
  183. package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
  184. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +56 -1
  185. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
  186. package/dist/ui/components/molecules/vc-input-currency/index.d.ts +159 -214
  187. package/dist/ui/components/molecules/vc-input-currency/index.d.ts.map +1 -1
  188. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +3 -0
  189. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  190. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +27 -9
  191. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
  192. package/dist/ui/components/molecules/vc-notification/vc-notification.vue.d.ts.map +1 -1
  193. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts +3 -0
  194. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  195. package/dist/ui/components/molecules/vc-rating/index.d.ts +59 -96
  196. package/dist/ui/components/molecules/vc-rating/index.d.ts.map +1 -1
  197. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +3 -0
  198. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
  199. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +257 -8
  200. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  201. package/dist/ui/components/molecules/vc-slider/index.d.ts +55 -91
  202. package/dist/ui/components/molecules/vc-slider/index.d.ts.map +1 -1
  203. package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts +3 -0
  204. package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts.map +1 -1
  205. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +6 -1
  206. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
  207. package/dist/ui/components/organisms/index.d.ts +0 -2
  208. package/dist/ui/components/organisms/index.d.ts.map +1 -1
  209. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +2 -4
  210. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  211. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts +10 -7
  212. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  213. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +10 -18
  214. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
  215. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts +16 -16
  216. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
  217. package/dist/ui/components/organisms/vc-app/index.d.ts +1 -292
  218. package/dist/ui/components/organisms/vc-app/index.d.ts.map +1 -1
  219. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +17 -56
  220. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  221. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
  222. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +3 -0
  223. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
  224. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts +3 -0
  225. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts.map +1 -1
  226. package/dist/ui/components/organisms/vc-blade/index.d.ts +89 -131
  227. package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
  228. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +3 -0
  229. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  230. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +21 -18
  231. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
  232. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +4 -1
  233. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts.map +1 -1
  234. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +4 -1
  235. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
  236. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +3 -0
  237. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  238. package/dist/ui/components/organisms/vc-login-form/index.d.ts +32 -66
  239. package/dist/ui/components/organisms/vc-login-form/index.d.ts.map +1 -1
  240. package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts +3 -0
  241. package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts.map +1 -1
  242. package/dist/ui/components/organisms/vc-popup/_internal/vc-popup-error/vc-popup-error.vue.d.ts.map +1 -1
  243. package/dist/ui/components/organisms/vc-popup/_internal/vc-popup-warning/vc-popup-warning.vue.d.ts.map +1 -1
  244. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
  245. package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts +3 -0
  246. package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts.map +1 -1
  247. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +3 -0
  248. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
  249. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts +3 -0
  250. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  251. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +57 -6
  252. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  253. package/dist/ui/types/index.d.ts +5 -45
  254. package/dist/ui/types/index.d.ts.map +1 -1
  255. package/package.json +26 -30
  256. package/shared/components/app-switcher/components/vc-app-switcher/index.ts +1 -3
  257. package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +2 -2
  258. package/shared/components/blade-navigation/components/vc-blade-navigation/index.ts +1 -3
  259. package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +46 -157
  260. package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +81 -0
  261. package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +323 -261
  262. package/shared/components/blade-navigation/injectionKeys.ts +4 -0
  263. package/shared/components/blade-navigation/plugin.ts +8 -10
  264. package/shared/components/blade-navigation/types/index.ts +53 -44
  265. package/shared/components/index.ts +2 -0
  266. package/shared/components/language-selector/language-selector.vue +12 -12
  267. package/{ui/components/organisms/vc-notification-dropdown → shared/components/notification-dropdown}/_internal/notification/notification.vue +6 -5
  268. package/shared/components/notification-dropdown/index.ts +10 -0
  269. package/{ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue → shared/components/notification-dropdown/notification-dropdown.vue} +21 -17
  270. package/shared/components/notification-template/index.ts +10 -0
  271. package/{ui/components/organisms/vc-notification-template/vc-notification-template.vue → shared/components/notification-template/notification-template.vue} +2 -2
  272. package/shared/components/popup-handler/composables/usePopup/index.ts +29 -9
  273. package/shared/components/user-dropdown-button/user-dropdown-button.vue +58 -17
  274. package/shared/index.ts +3 -2
  275. package/shared/locales/en.json +7 -0
  276. package/shared/modules/assets/components/assets-details/assets-details.vue +5 -0
  277. package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +8 -5
  278. package/shared/modules/dynamic/components/fields/GalleryField.ts +7 -7
  279. package/shared/modules/dynamic/components/fields/InputCurrency.ts +2 -1
  280. package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +42 -36
  281. package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +5 -3
  282. package/shared/modules/dynamic/factories/types/index.ts +6 -2
  283. package/shared/modules/dynamic/helpers/override.ts +38 -32
  284. package/shared/modules/dynamic/helpers/safeIn.ts +1 -1
  285. package/shared/modules/dynamic/index.ts +12 -12
  286. package/shared/modules/dynamic/pages/dynamic-blade-form.vue +96 -57
  287. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +133 -118
  288. package/shared/modules/dynamic/types/index.ts +16 -1
  289. package/shared/pages/InvitePage/components/invite/Invite.vue +2 -2
  290. package/shared/pages/LoginPage/components/login/Login.vue +23 -16
  291. package/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue +3 -3
  292. package/shared/utilities/vueUtils.ts +7 -7
  293. package/tailwind.config.ts +50 -0
  294. package/ui/components/atoms/vc-button/vc-button.vue +1 -1
  295. package/ui/components/atoms/vc-card/vc-card.stories.ts +25 -0
  296. package/ui/components/atoms/vc-card/vc-card.vue +1 -1
  297. package/ui/components/atoms/vc-container/vc-container.vue +1 -1
  298. package/ui/components/atoms/vc-icon/vc-icon.vue +1 -1
  299. package/ui/components/molecules/vc-editor/vc-editor.vue +2 -7
  300. package/ui/components/molecules/vc-notification/vc-notification.vue +2 -2
  301. package/ui/components/molecules/vc-select/vc-select.vue +13 -13
  302. package/ui/components/organisms/index.ts +0 -2
  303. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +25 -42
  304. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +123 -25
  305. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +11 -103
  306. package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +34 -52
  307. package/ui/components/organisms/vc-app/index.ts +1 -12
  308. package/ui/components/organisms/vc-app/vc-app.stories.ts +36 -36
  309. package/ui/components/organisms/vc-app/vc-app.vue +122 -61
  310. package/ui/components/organisms/vc-blade/vc-blade.vue +5 -13
  311. package/ui/components/organisms/vc-table/vc-table.vue +9 -9
  312. package/ui/locales/en.json +2 -4
  313. package/ui/types/index.ts +7 -51
  314. package/core/composables/useMenuComposer/index.ts +0 -25
  315. package/dist/core/composables/useMenuComposer/index.d.ts +0 -12
  316. package/dist/core/composables/useMenuComposer/index.d.ts.map +0 -1
  317. package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts.map +0 -1
  318. package/dist/ui/components/organisms/vc-notification-dropdown/index.d.ts +0 -38
  319. package/dist/ui/components/organisms/vc-notification-dropdown/index.d.ts.map +0 -1
  320. package/dist/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue.d.ts +0 -21
  321. package/dist/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue.d.ts.map +0 -1
  322. package/dist/ui/components/organisms/vc-notification-template/index.d.ts +0 -2
  323. package/dist/ui/components/organisms/vc-notification-template/index.d.ts.map +0 -1
  324. package/dist/ui/components/organisms/vc-notification-template/vc-notification-template.vue.d.ts.map +0 -1
  325. package/dist/utils/isInDemoMode.d.ts +0 -2
  326. package/dist/utils/isInDemoMode.d.ts.map +0 -1
  327. package/dist/vite.config.d.ts +0 -3
  328. package/dist/vite.config.d.ts.map +0 -1
  329. package/tailwind.config.js +0 -50
  330. package/ui/components/organisms/vc-notification-dropdown/index.ts +0 -3
  331. package/ui/components/organisms/vc-notification-template/index.ts +0 -1
@@ -0,0 +1,4 @@
1
+ import { InjectionKey } from "vue";
2
+ import { BladeVNode } from "./types";
3
+
4
+ export const navigationViewLocation = Symbol("blade navigation view location") as InjectionKey<BladeVNode>;
@@ -1,7 +1,7 @@
1
- import { App, ref } from "vue";
2
- import { createModule } from "./../../../core/plugins";
1
+ import { Router } from "vue-router";
2
+ import { App } from "vue";
3
3
  import * as components from "./components";
4
- import { BladeNavigationPlugin, IBladeContainer, IBladeRef } from "./types";
4
+ import { BladeNavigationPlugin } from "./types";
5
5
 
6
6
  // Declare globally
7
7
  declare module "@vue/runtime-core" {
@@ -13,17 +13,15 @@ declare module "@vue/runtime-core" {
13
13
  export let bladeNavigationInstance: BladeNavigationPlugin;
14
14
 
15
15
  export const VcBladeNavigationComponent = {
16
- install(app: App) {
16
+ install(app: App, args: { router: Router }) {
17
17
  // Register components
18
- createModule(components).install(app);
18
+ Object.entries(components).forEach(([componentName, component]) => {
19
+ app.component(componentName, component);
20
+ });
19
21
 
20
22
  // Plugin
21
- const blades = ref<IBladeContainer[]>([]);
22
- const bladesRefs = ref<IBladeRef[]>([]);
23
-
24
23
  const bladeNavigationPlugin: BladeNavigationPlugin = {
25
- blades,
26
- bladesRefs,
24
+ router: args.router,
27
25
  };
28
26
 
29
27
  app.config.globalProperties.$bladeNavigationPlugin = bladeNavigationPlugin;
@@ -1,24 +1,17 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { RouteRecordNormalized, Router } from "vue-router";
2
3
  import {
3
4
  AppContext,
4
5
  Component,
5
6
  ComponentOptionsBase,
6
7
  ComponentOptionsMixin,
7
- ComponentPublicInstance,
8
- ComputedOptions,
9
8
  VNode,
10
9
  ComponentInternalInstance,
11
10
  VNodeTypes,
12
- Ref,
13
- MethodOptions,
11
+ ComponentPublicInstance,
14
12
  } from "vue";
15
13
  import { ComponentPublicInstanceConstructor } from "../../../utilities/vueUtils";
16
14
 
17
- /**
18
- * @deprecated use `ComponentPublicInstanceConstructor` interface instead
19
- */
20
- export type ComponentInstanceConstructor<T = any> = ComponentPublicInstanceConstructor<T>;
21
-
22
15
  export type CoreBladeComponentProps = {
23
16
  expanded?: boolean;
24
17
  closable?: boolean;
@@ -31,29 +24,38 @@ export type CoreDynamicBladeComponentProps = {
31
24
  composables?: any;
32
25
  };
33
26
 
34
- /**
35
- * @deprecated use `BladeInstanceConstructor` interface instead
36
- */
37
- export type BladePageComponent = BladeInstanceConstructor;
38
-
39
- export type CoreComponentData = {
40
- isBladeComponent?: boolean;
41
- };
27
+ export interface MenuItemConfig {
28
+ id?: string;
29
+ /**
30
+ * Menu item title.
31
+ */
32
+ title: string;
33
+ /**
34
+ * Menu item icon.
35
+ */
36
+ icon: string;
37
+ /**
38
+ * Menu item group. Is used to group menu items with it's provided name.
39
+ *
40
+ * If the path is not specified, the menu item is added to the root of the menu.
41
+ */
42
+ group?: string;
43
+ /**
44
+ * Position priority.
45
+ */
46
+ priority: number;
47
+ }
42
48
 
43
49
  export type CoreBladeAdditionalSettings = {
44
50
  url?: `/${string}`;
45
51
  permissions?: string | string[];
46
52
  isWorkspace?: boolean;
53
+ name?: string;
54
+ menuItem?: MenuItemConfig;
47
55
  };
48
-
49
- export type CoreBladeNavigationData = {
50
- idx?: number;
51
- };
52
-
53
56
  export interface CoreBladeExposed {
54
57
  [x: string]: any;
55
58
  title?: string;
56
- onBeforeClose?: () => Promise<boolean>;
57
59
  reloadParent?: () => void;
58
60
  reload?: () => void;
59
61
  }
@@ -64,22 +66,13 @@ export interface IParentCallArgs {
64
66
  callback?: (args: unknown) => void;
65
67
  }
66
68
 
67
- export interface IBladeContainer extends IBladeEvent {
68
- idx?: number;
69
- }
70
-
71
69
  export interface BladeComponentInternalInstance extends ComponentInternalInstance {
72
- vnode: VNode & { type: VNodeTypes & CoreBladeAdditionalSettings & CoreBladeNavigationData };
70
+ vnode: VNode & BladeVNode;
73
71
  appContext: AppContext & { components: Record<string, BladeInstanceConstructor> };
74
72
  }
75
73
 
76
74
  export type ExtractedBladeOptions<T, U extends keyof T> = T[U];
77
75
 
78
- /**
79
- * @deprecated use `BladeInstanceConstructor` interface instead
80
- */
81
- export type BladeConstructor<T extends ComponentPublicInstance = ComponentPublicInstance> = BladeInstanceConstructor<T>;
82
-
83
76
  type Extractor<T> = Extract<T, ComponentPublicInstanceConstructor>;
84
77
 
85
78
  export type BladeInstanceConstructor<T extends Component = Component> = Extractor<T> & {
@@ -90,9 +83,7 @@ export type BladeInstanceConstructor<T extends Component = Component> = Extracto
90
83
  $props: InstanceType<Extractor<T>>["$props"] & CoreBladeComponentProps;
91
84
  };
92
85
  } & ComponentOptionsBase<any, any, any, any, ComponentOptionsMixin, ComponentOptionsMixin, any, any, any> &
93
- CoreComponentData &
94
- CoreBladeAdditionalSettings &
95
- CoreBladeNavigationData;
86
+ CoreBladeAdditionalSettings;
96
87
 
97
88
  export interface IBladeEvent<T extends Component = Component> {
98
89
  blade: BladeInstanceConstructor<T>;
@@ -102,14 +93,32 @@ export interface IBladeEvent<T extends Component = Component> {
102
93
  onClose?: () => void;
103
94
  }
104
95
 
105
- export interface IBladeRef {
106
- exposed: CoreBladeExposed;
107
- blade: IBladeContainer;
108
- expanded?: boolean;
109
- active?: boolean;
96
+ export interface BladeNavigationPlugin {
97
+ router: Router;
110
98
  }
111
99
 
112
- export interface BladeNavigationPlugin {
113
- blades: Ref<IBladeContainer[]>;
114
- bladesRefs: Ref<IBladeRef[]>;
100
+ type VNodeMountHook = (vnode: BladeVNode | VNode) => void;
101
+ export interface BladeVNode extends VNode {
102
+ props: {
103
+ navigation: {
104
+ onOpen?: () => void;
105
+ onClose?: () => void;
106
+ fullPath: string;
107
+ bladePath?: string;
108
+ idx: number;
109
+ uniqueRouteKey: string;
110
+ };
111
+ onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
112
+ onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
113
+ } & Omit<VNode["props"], "onVnodeUnmounted" | "onVnodeMounted"> &
114
+ CoreBladeComponentProps;
115
+ type: VNodeTypes & BladeInstanceConstructor;
116
+ }
117
+
118
+ export interface BladeRouteRecordLocationNormalized extends RouteRecordNormalized {
119
+ components: Record<string, BladeVNode>;
120
+ instances: Record<
121
+ string,
122
+ ComponentPublicInstance<CoreBladeExposed, any, CoreBladeExposed, any, CoreBladeExposed, any, any, any, any, any>
123
+ >;
115
124
  }
@@ -6,3 +6,5 @@ export * from "./popup-handler";
6
6
  export * from "./change-password";
7
7
  export * from "./language-selector";
8
8
  export * from "./user-dropdown-button";
9
+ export * from "./notification-dropdown";
10
+ export * from "./notification-template";
@@ -6,7 +6,7 @@
6
6
  }
7
7
  "
8
8
  class="tw-relative"
9
- :title="title"
9
+ :title="$t('COMPONENTS.LANGUAGE_SELECTOR.TITLE')"
10
10
  @click.stop="isDropActive = !isDropActive"
11
11
  >
12
12
  <div
@@ -43,18 +43,18 @@
43
43
  import { VcIcon } from "./../../../ui/components";
44
44
  import { ref } from "vue";
45
45
  import { vOnClickOutside } from "@vueuse/components";
46
+ import { useI18n } from "vue-i18n";
46
47
 
47
- export interface Props {
48
- title: string;
49
- value: string;
50
- languageItems: { lang: string; title: string; clickHandler: (lang: string) => void }[];
51
- }
52
-
53
- withDefaults(defineProps<Props>(), {
54
- title: "",
55
- value: "",
56
- languageItems: () => [],
57
- });
48
+ const { locale: currentLocale, availableLocales, getLocaleMessage } = useI18n({ useScope: "global" });
58
49
 
59
50
  const isDropActive = ref(false);
51
+
52
+ const languageItems = availableLocales.map((locale: string) => ({
53
+ lang: locale,
54
+ title: (getLocaleMessage(locale) as { language_name: string }).language_name,
55
+ clickHandler(lang: string) {
56
+ currentLocale.value = lang;
57
+ localStorage.setItem("VC_LANGUAGE_SETTINGS", lang);
58
+ },
59
+ }));
60
60
  </script>
@@ -5,7 +5,7 @@
5
5
  <notificationTemplateRenderer />
6
6
  </template>
7
7
  <template v-else>
8
- <VcNotificationTemplate
8
+ <NotificationTemplate
9
9
  :color="notificationStyle.color"
10
10
  :title="notification.title ?? ''"
11
11
  :icon="notificationStyle.icon"
@@ -16,7 +16,7 @@
16
16
  class="tw-mb-1"
17
17
  >{{ notification.description }}</VcHint
18
18
  >
19
- </VcNotificationTemplate>
19
+ </NotificationTemplate>
20
20
  </template>
21
21
  </VcRow>
22
22
  </div>
@@ -24,9 +24,10 @@
24
24
 
25
25
  <script lang="ts" setup>
26
26
  import { computed, h } from "vue";
27
- import { PushNotification } from "./../../../../../../core/api/platform";
28
- import { VcRow, VcNotificationTemplate } from "./../../../../";
29
- import { NotificationTemplateConstructor } from "./../../../../../../core/types";
27
+ import { PushNotification } from "./../../../../../core/api/platform";
28
+ import { VcRow } from "./../../../../../ui/components";
29
+ import { NotificationTemplate } from "./../../../notification-template";
30
+ import { NotificationTemplateConstructor } from "../../../../../core/types";
30
31
 
31
32
  export interface Props {
32
33
  notification: PushNotification;
@@ -0,0 +1,10 @@
1
+ import _NotificationDropdown from "./notification-dropdown.vue";
2
+
3
+ export const NotificationDropdown = _NotificationDropdown as typeof _NotificationDropdown;
4
+
5
+ // Declare globally
6
+ declare module "@vue/runtime-core" {
7
+ export interface GlobalComponents {
8
+ NotificationDropdown: typeof NotificationDropdown;
9
+ }
10
+ }
@@ -6,7 +6,7 @@
6
6
  }
7
7
  "
8
8
  class="tw-relative tw-flex tw-items-center tw-h-full"
9
- :title="title"
9
+ :title="$t('COMPONENTS.NOTIFICATION_DROPDOWN.TITLE')"
10
10
  @click.stop="toggleNotificationsDrop"
11
11
  >
12
12
  <div
@@ -65,7 +65,7 @@
65
65
  >
66
66
  <NotificationItem
67
67
  :notification="item"
68
- :templates="templates || []"
68
+ :templates="notificationTemplates || []"
69
69
  @on-click="() => (isDropdownVisible = false)"
70
70
  />
71
71
  </div>
@@ -74,7 +74,7 @@
74
74
  v-else
75
75
  class="tw-flex tw-justify-center tw-items-center tw-p-4"
76
76
  >
77
- {{ t("COMPONENTS.ORGANISMS.VC_NOTIFICATION_DROPDOWN.EMPTY") }}
77
+ {{ t("COMPONENTS.NOTIFICATION_DROPDOWN.EMPTY") }}
78
78
  </div>
79
79
  </VcContainer>
80
80
  </div>
@@ -82,30 +82,34 @@
82
82
  </template>
83
83
 
84
84
  <script lang="ts" setup>
85
- import { ref } from "vue";
85
+ import { ref, inject, computed } from "vue";
86
86
  import NotificationItem from "./_internal/notification/notification.vue";
87
- import { PushNotification } from "./../../../../core/api/platform";
88
- import { VcCol, VcContainer, VcIcon } from "./../../";
87
+ import { VcCol, VcContainer, VcIcon } from "../../../ui/components";
89
88
  import { vOnClickOutside } from "@vueuse/components";
90
- import { NotificationTemplateConstructor } from "./../../../../core/types";
91
89
  import { useI18n } from "vue-i18n";
90
+ import { NotificationTemplateConstructor } from "../../../core/types";
91
+ import { useNotifications } from "../../../core/composables";
92
92
 
93
- export interface Props {
94
- title: string;
95
- isAccent?: boolean;
96
- notifications: PushNotification[];
97
- templates?: NotificationTemplateConstructor[];
98
- onOpen?: () => void;
99
- }
93
+ const notificationTemplates = inject<NotificationTemplateConstructor[]>("notificationTemplates");
100
94
 
101
- const props = defineProps<Props>();
102
95
  const { t } = useI18n({ useScope: "global" });
96
+ const { notifications, markAllAsRead } = useNotifications();
97
+
103
98
  const isDropdownVisible = ref(false);
104
99
 
100
+ const isAccent = computed(() => {
101
+ return notifications.value.some((item) => item.isNew);
102
+ });
103
+
105
104
  function toggleNotificationsDrop() {
106
105
  isDropdownVisible.value = !isDropdownVisible.value;
107
- if (props.onOpen && typeof props.onOpen === "function") {
108
- props.onOpen();
106
+
107
+ onOpen();
108
+ }
109
+
110
+ function onOpen() {
111
+ if (notifications.value.some((x) => x.isNew)) {
112
+ markAllAsRead();
109
113
  }
110
114
  }
111
115
  </script>
@@ -0,0 +1,10 @@
1
+ import _NotificationTemplate from "./notification-template.vue";
2
+
3
+ export const NotificationTemplate = _NotificationTemplate as typeof _NotificationTemplate;
4
+
5
+ // Declare globally
6
+ declare module "@vue/runtime-core" {
7
+ export interface GlobalComponents {
8
+ NotificationTemplate: typeof NotificationTemplate;
9
+ }
10
+ }
@@ -30,9 +30,9 @@
30
30
 
31
31
  <script setup lang="ts">
32
32
  import { computed } from "vue";
33
- import { VcIcon } from "./../../";
33
+ import { VcIcon } from "../../../ui/components";
34
34
  import moment from "moment";
35
- import { PushNotification } from "../../../../core/api/platform";
35
+ import { PushNotification } from "../../../core/api/platform";
36
36
 
37
37
  export interface Props {
38
38
  color: string;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { VcPopup } from "./../../../../../ui/components";
2
3
  import {
3
4
  markRaw,
@@ -16,6 +17,7 @@ import { PopupPlugin, UsePopupInternal, UsePopupProps } from "./../../types";
16
17
  import { popupPluginInstance } from "./../../plugin";
17
18
  import { useI18n } from "vue-i18n";
18
19
  import { ComponentPublicInstanceConstructor } from "../../../../utilities/vueUtils";
20
+ import * as _ from "lodash-es";
19
21
 
20
22
  interface IUsePopup {
21
23
  open(): void;
@@ -24,12 +26,18 @@ interface IUsePopup {
24
26
  showError(message: string | Ref<string>): void;
25
27
  }
26
28
 
29
+ function usePopupInternal() {
30
+ const instance = getCurrentInstance();
31
+ const popupInstance: PopupPlugin = (instance && inject("popupPlugin")) || popupPluginInstance;
32
+
33
+ return popupInstance;
34
+ }
35
+
27
36
  export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typeof VcPopup>(
28
- options?: MaybeRef<UsePopupProps<T>>
37
+ options?: MaybeRef<UsePopupProps<T>>,
29
38
  ): IUsePopup {
30
39
  const { t } = useI18n({ useScope: "global" });
31
- const instance = getCurrentInstance();
32
- const popupInstance: PopupPlugin = (instance && inject("popupPlugin")) || popupPluginInstance;
40
+ const popupInstance = usePopupInternal();
33
41
  let rawPopup: UsePopupProps<DefineComponent> & UsePopupInternal;
34
42
 
35
43
  if (options) {
@@ -43,9 +51,16 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
43
51
  rawPopup = createInstance(unref(newVal));
44
52
  }
45
53
  },
46
- { deep: true }
54
+ { deep: true },
47
55
  );
48
56
 
57
+ function destroy(confirmation: UsePopupProps<DefineComponent>): void {
58
+ const popupInstanceInternal = usePopupInternal();
59
+ const index = popupInstanceInternal.popups.findIndex((x) => _.isEqualWith(x, confirmation, (val) => val.component));
60
+
61
+ if (index !== -1) popupInstanceInternal.popups.splice(index, 1);
62
+ }
63
+
49
64
  async function open(customInstance?: UsePopupProps<DefineComponent>) {
50
65
  let activeInstance;
51
66
  await nextTick();
@@ -53,6 +68,8 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
53
68
  activeInstance = popupInstance;
54
69
  }
55
70
 
71
+ destroy(rawPopup || customInstance);
72
+
56
73
  activeInstance?.popups.push(rawPopup || customInstance);
57
74
  }
58
75
 
@@ -89,6 +106,8 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
89
106
  },
90
107
  });
91
108
 
109
+ destroy(confirmation);
110
+
92
111
  popupInstance.popups.push(confirmation);
93
112
 
94
113
  return new Promise((resolve) => {
@@ -114,20 +133,21 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
114
133
  },
115
134
  });
116
135
 
136
+ destroy(confirmation);
137
+
117
138
  popupInstance.popups.push(confirmation);
118
139
  }
119
140
 
120
141
  function createInstance<T extends ComponentPublicInstanceConstructor<any> = typeof VcPopup>(
121
- options: UsePopupProps<T>
142
+ options: UsePopupProps<T>,
122
143
  ) {
123
144
  return (
124
145
  options &&
125
146
  (reactive({
126
- id: Symbol("usePopup"),
127
147
  ...createComponent(options),
128
148
  close: close,
129
149
  open: open,
130
- }) as UsePopupProps<DefineComponent> & UsePopupInternal)
150
+ }) as unknown as UsePopupProps<DefineComponent> & UsePopupInternal)
131
151
  );
132
152
  }
133
153
 
@@ -140,7 +160,7 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
140
160
  }
141
161
 
142
162
  function createComponent<T extends ComponentPublicInstanceConstructor<any> = typeof VcPopup>(
143
- options: UsePopupProps<T>
163
+ options: UsePopupProps<T>,
144
164
  ) {
145
165
  const slots =
146
166
  typeof options.slots === "undefined"
@@ -151,7 +171,7 @@ function createComponent<T extends ComponentPublicInstanceConstructor<any> = typ
151
171
  return [slotName, slotContent];
152
172
  }
153
173
  return [slotName, markRaw(slotContent)];
154
- })
174
+ }),
155
175
  );
156
176
 
157
177
  return {
@@ -9,19 +9,26 @@
9
9
  @click.stop="toggleAccountMenuVisible"
10
10
  >
11
11
  <div
12
+ v-if="avatarUrl"
12
13
  class="user-dropdown-button__avatar"
13
14
  :style="imageHandler"
14
15
  ></div>
16
+ <VcIcon
17
+ v-else
18
+ icon="fas fa-user-circle"
19
+ size="xxl"
20
+ class="tw-text-[color:var(--app-bar-button-color)]"
21
+ />
15
22
  <div class="tw-grow tw-basis-0 tw-ml-3 tw-overflow-hidden">
16
23
  <div class="user-dropdown-button__name tw-truncate">
17
- {{ name }}
24
+ {{ name || user?.userName }}
18
25
  </div>
19
26
  <div class="user-dropdown-button__role">
20
- {{ role }}
27
+ {{ role || (user?.isAdministrator ? "Administrator" : "") }}
21
28
  </div>
22
29
  </div>
23
30
  <div
24
- v-if="menuItems && menuItems.length"
31
+ v-if="menu && menu.length && !$isMobile.value"
25
32
  class="user-dropdown-button__chevron"
26
33
  >
27
34
  <VcIcon
@@ -30,12 +37,12 @@
30
37
  ></VcIcon>
31
38
  </div>
32
39
  <div
33
- v-if="menuItems && accountMenuVisible"
40
+ v-if="menu && accountMenuVisible"
34
41
  class="user-dropdown-button__menu"
35
42
  @click.stop="accountMenuVisible = false"
36
43
  >
37
44
  <div
38
- v-for="(item, i) in menuItems"
45
+ v-for="(item, i) in menu"
39
46
  :key="`menu_item_${i}`"
40
47
  class="user-dropdown-button__menu-item"
41
48
  @click="item.hasOwnProperty('clickHandler') ? item.clickHandler?.() : null"
@@ -47,31 +54,58 @@
47
54
  </template>
48
55
 
49
56
  <script lang="ts" setup>
50
- import { computed, ref } from "vue";
57
+ import { Ref, computed, inject, ref } from "vue";
51
58
  import { vOnClickOutside } from "@vueuse/components";
52
- import { BladeMenu } from "./../../../core/types";
59
+ import { useUser } from "../../../core/composables";
60
+ import { useBladeNavigation } from "../blade-navigation";
61
+ import { useRouter } from "vue-router";
62
+ import { useI18n } from "vue-i18n";
63
+ import { VcIcon } from "../../../ui/components";
64
+ import { BladeMenu } from "../../../core/types";
65
+ import { usePopup } from "../popup-handler/composables/usePopup";
66
+ import { ChangePassword } from "../change-password";
53
67
 
54
68
  export interface Props {
55
- avatar: string;
56
- name: string;
57
- role: string;
69
+ avatarUrl?: string | undefined;
70
+ name?: string | undefined;
71
+ role?: string | undefined;
58
72
  menuItems?: BladeMenu[];
59
73
  }
60
74
  const props = withDefaults(defineProps<Props>(), {
61
75
  menuItems: () => [],
62
76
  });
63
77
 
64
- const imageHandler = computed(() => {
65
- if (props.avatar) {
66
- return `background-image: url(${CSS.escape(props.avatar)})`;
67
- }
68
- return undefined;
78
+ const isMobile = inject("isMobile") as Ref<boolean>;
79
+
80
+ const { user, signOut } = useUser();
81
+ const { closeBlade } = useBladeNavigation();
82
+ const router = useRouter();
83
+ const { t } = useI18n({ useScope: "global" });
84
+
85
+ const { open } = usePopup({
86
+ component: ChangePassword,
69
87
  });
70
88
 
71
89
  const accountMenuVisible = ref(false);
90
+ const menu = computed(() => [
91
+ ...props.menuItems,
92
+ {
93
+ title: t("Change password"),
94
+ clickHandler() {
95
+ open();
96
+ },
97
+ },
98
+ {
99
+ title: t("Log Out"),
100
+ async clickHandler() {
101
+ await signOut();
102
+ router.push({ name: "Login" });
103
+ },
104
+ },
105
+ ]);
72
106
 
73
107
  const toggleAccountMenuVisible = () => {
74
- if (props.menuItems && props.menuItems.length) {
108
+ if (menu.value && menu.value.length && !isMobile.value) {
75
109
  accountMenuVisible.value = !accountMenuVisible.value;
76
110
  }
77
111
  };
@@ -79,6 +113,13 @@ const toggleAccountMenuVisible = () => {
79
113
  const onClose = () => {
80
114
  accountMenuVisible.value = false;
81
115
  };
116
+
117
+ const imageHandler = computed(() => {
118
+ if (props.avatarUrl) {
119
+ return `background-image: url(${CSS.escape(props.avatarUrl)})`;
120
+ }
121
+ return undefined;
122
+ });
82
123
  </script>
83
124
 
84
125
  <style lang="scss">
@@ -109,7 +150,7 @@ const onClose = () => {
109
150
  }
110
151
 
111
152
  &__chevron {
112
- @apply tw-text-[#7e8e9d] [transition:transform_0.2s_ease] [transition:color_0.2s_ease];
153
+ @apply tw-text-[#7e8e9d] [transition:color_0.2s_ease];
113
154
  }
114
155
 
115
156
  &:hover &__chevron {
package/shared/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Router } from "vue-router";
1
2
  import { App } from "vue";
2
3
  import { AssetsDetailsModule } from "./modules/assets";
3
4
  import { VcAppSwitcherComponent } from "./components/app-switcher";
@@ -8,7 +9,7 @@ import * as locales from "./locales";
8
9
  import { i18n } from "./../core/plugins";
9
10
 
10
11
  export const SharedModule = {
11
- install(app: App): void {
12
+ install(app: App, args: { router: Router }): void {
12
13
  // Load locales
13
14
  if (locales) {
14
15
  Object.entries(locales).forEach(([key, message]) => {
@@ -19,7 +20,7 @@ export const SharedModule = {
19
20
  app
20
21
  .use(AssetsDetailsModule)
21
22
  .use(AssetsManagerModule)
22
- .use(VcBladeNavigationComponent)
23
+ .use(VcBladeNavigationComponent, { router: args.router })
23
24
  .use(VcAppSwitcherComponent)
24
25
  .use(VcPopupHandler);
25
26
  },
@@ -30,6 +30,13 @@
30
30
  "Incorrect password.": "You entered an incorrect password",
31
31
  "You have used this password in the past. Choose another one.": "You have used this password in the past. Choose another one."
32
32
  }
33
+ },
34
+ "NOTIFICATION_DROPDOWN": {
35
+ "TITLE": "Notifications",
36
+ "EMPTY": "No notifications yet"
37
+ },
38
+ "LANGUAGE_SELECTOR": {
39
+ "TITLE": "Language selector"
33
40
  }
34
41
  }
35
42
  }