@vc-shell/framework 1.0.38 → 1.0.40

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 (256) hide show
  1. package/core/api/index.ts +1 -0
  2. package/core/api/platform.ts +8332 -0
  3. package/core/composables/index.ts +8 -0
  4. package/core/composables/useAutosave/index.ts +57 -0
  5. package/core/composables/useFunctions/debounce.ts +18 -0
  6. package/core/composables/useFunctions/delay.ts +7 -0
  7. package/core/composables/useFunctions/index.ts +21 -0
  8. package/core/composables/useFunctions/once.ts +14 -0
  9. package/core/composables/useFunctions/sleep.ts +4 -0
  10. package/core/composables/useFunctions/throttle.ts +17 -0
  11. package/core/composables/useI18n/index.ts +28 -0
  12. package/core/composables/useLogger/index.ts +24 -0
  13. package/core/composables/useNotifications/index.ts +116 -0
  14. package/core/composables/usePermissions/index.ts +32 -0
  15. package/core/composables/useSettings/index.ts +62 -0
  16. package/core/composables/useUser/index.ts +266 -0
  17. package/core/directives/autofocus/index.ts +9 -0
  18. package/core/directives/click-outside/index.ts +21 -0
  19. package/core/directives/index.ts +4 -0
  20. package/core/directives/loading/index.ts +28 -0
  21. package/core/directives/permissions/index.ts +20 -0
  22. package/core/plugins/index.ts +1 -0
  23. package/core/plugins/validation/index.ts +2 -0
  24. package/core/plugins/validation/rules.ts +196 -0
  25. package/core/types/index.ts +92 -0
  26. package/core/utilities/camelToSnake.ts +7 -0
  27. package/core/utilities/index.ts +1 -0
  28. package/dist/core/composables/useNotifications/index.d.ts +1 -1
  29. package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
  30. package/dist/core/composables/useSettings/index.d.ts +10 -1
  31. package/dist/core/composables/useSettings/index.d.ts.map +1 -1
  32. package/dist/core/composables/useUser/index.d.ts +2 -2
  33. package/dist/core/composables/useUser/index.d.ts.map +1 -1
  34. package/dist/core/plugins/validation/index.d.ts.map +1 -1
  35. package/dist/core/types/index.d.ts +1 -1
  36. package/dist/core/types/index.d.ts.map +1 -1
  37. package/dist/framework.js +72 -99
  38. package/dist/framework.js.map +1 -1
  39. package/dist/index.d.ts +3 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts +1 -1
  42. package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
  43. package/dist/shared/app-switcher/index.d.ts +2 -2
  44. package/dist/shared/app-switcher/index.d.ts.map +1 -1
  45. package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts +1 -1
  46. package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
  47. package/dist/shared/blade-navigation/types/index.d.ts +1 -1
  48. package/dist/shared/blade-navigation/types/index.d.ts.map +1 -1
  49. package/dist/style.css +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -0
  51. package/dist/ui/components/atoms/vc-badge/index.d.ts +5 -0
  52. package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -0
  53. package/dist/ui/components/atoms/vc-badge/vc-badge-model.d.ts +28 -0
  54. package/dist/ui/components/atoms/vc-badge/vc-badge-model.d.ts.map +1 -0
  55. package/dist/{components → ui/components}/atoms/vc-badge/vc-badge.stories.d.ts +0 -0
  56. package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts.map +1 -0
  57. package/dist/ui/components/atoms/vc-button/index.d.ts +5 -0
  58. package/dist/ui/components/atoms/vc-button/index.d.ts.map +1 -0
  59. package/dist/ui/components/atoms/vc-button/vc-button-model.d.ts +28 -0
  60. package/dist/ui/components/atoms/vc-button/vc-button-model.d.ts.map +1 -0
  61. package/dist/{components → ui/components}/atoms/vc-button/vc-button.stories.d.ts +0 -0
  62. package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -0
  63. package/dist/{components → ui/components}/atoms/vc-checkbox/vc-checkbox.stories.d.ts +0 -0
  64. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts.map +1 -0
  65. package/dist/{components → ui/components}/atoms/vc-container/vc-container.stories.d.ts +0 -0
  66. package/dist/ui/components/atoms/vc-container/vc-container.stories.d.ts.map +1 -0
  67. package/dist/{components → ui/components}/atoms/vc-hint/vc-hint.stories.d.ts +0 -0
  68. package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts.map +1 -0
  69. package/dist/{components → ui/components}/atoms/vc-icon/vc-icon.stories.d.ts +0 -0
  70. package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts.map +1 -0
  71. package/dist/{components → ui/components}/atoms/vc-image/vc-image.stories.d.ts +0 -0
  72. package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts.map +1 -0
  73. package/dist/{components → ui/components}/atoms/vc-label/vc-label.stories.d.ts +0 -0
  74. package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts.map +1 -0
  75. package/dist/{components → ui/components}/atoms/vc-link/vc-link.stories.d.ts +0 -0
  76. package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts.map +1 -0
  77. package/dist/{components → ui/components}/atoms/vc-progress/vc-progress.stories.d.ts +0 -0
  78. package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts.map +1 -0
  79. package/dist/{components → ui/components}/atoms/vc-status/vc-status.stories.d.ts +0 -0
  80. package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts.map +1 -0
  81. package/dist/{components → ui/components}/atoms/vc-switch/vc-switch.stories.d.ts +0 -0
  82. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -0
  83. package/dist/{components → ui/components}/index.d.ts +4 -3
  84. package/dist/ui/components/index.d.ts.map +1 -0
  85. package/dist/{components → ui/components}/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts +0 -0
  86. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts.map +1 -0
  87. package/dist/{components → ui/components}/molecules/vc-form/vc-form.stories.d.ts +0 -0
  88. package/dist/ui/components/molecules/vc-form/vc-form.stories.d.ts.map +1 -0
  89. package/dist/ui/components/molecules/vc-input/index.d.ts +5 -0
  90. package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -0
  91. package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts +140 -0
  92. package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts.map +1 -0
  93. package/dist/ui/components/molecules/vc-input-currency/index.d.ts +5 -0
  94. package/dist/ui/components/molecules/vc-input-currency/index.d.ts.map +1 -0
  95. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts +124 -0
  96. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts.map +1 -0
  97. package/dist/{components → ui/components}/molecules/vc-pagination/vc-pagination.stories.d.ts +0 -0
  98. package/dist/ui/components/molecules/vc-pagination/vc-pagination.stories.d.ts.map +1 -0
  99. package/dist/{components → ui/components}/molecules/vc-rating/vc-rating.stories.d.ts +0 -0
  100. package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts.map +1 -0
  101. package/dist/ui/components/molecules/vc-select/index.d.ts +5 -0
  102. package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -0
  103. package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts +207 -0
  104. package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts.map +1 -0
  105. package/dist/{components → ui/components}/molecules/vc-textarea/vc-textarea.stories.d.ts +0 -0
  106. package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts.map +1 -0
  107. package/dist/{components → ui/components}/organisms/vc-app/vc-app.stories.d.ts +0 -0
  108. package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts.map +1 -0
  109. package/dist/{components → ui/components}/organisms/vc-blade/vc-blade.stories.d.ts +0 -0
  110. package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts.map +1 -0
  111. package/dist/{components → ui/components}/organisms/vc-login-form/vc-login-form.stories.d.ts +0 -0
  112. package/dist/ui/components/organisms/vc-login-form/vc-login-form.stories.d.ts.map +1 -0
  113. package/dist/{components → ui/components}/organisms/vc-popup/vc-popup.stories.d.ts +0 -0
  114. package/dist/ui/components/organisms/vc-popup/vc-popup.stories.d.ts.map +1 -0
  115. package/dist/{components → ui/components}/organisms/vc-table/vc-table.stories.d.ts +0 -0
  116. package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -0
  117. package/dist/ui/types/index.d.ts +13 -0
  118. package/dist/ui/types/index.d.ts.map +1 -0
  119. package/dist/ui/types/ts-helpers.d.ts +13 -0
  120. package/dist/ui/types/ts-helpers.d.ts.map +1 -0
  121. package/dist/vite.config.d.ts.map +1 -1
  122. package/package.json +30 -10
  123. package/shared/app-switcher/components/index.ts +1 -0
  124. package/shared/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +90 -0
  125. package/shared/app-switcher/composables/index.ts +1 -0
  126. package/shared/app-switcher/composables/useAppSwitcher/index.ts +54 -0
  127. package/shared/app-switcher/index.ts +14 -0
  128. package/shared/assets/components/assets-details/assets-details.vue +138 -0
  129. package/shared/assets/components/index.ts +1 -0
  130. package/shared/assets/index.ts +19 -0
  131. package/shared/assets/locales/en.json +29 -0
  132. package/shared/assets/locales/index.ts +2 -0
  133. package/shared/blade-navigation/components/index.ts +1 -0
  134. package/shared/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +84 -0
  135. package/shared/blade-navigation/composables/index.ts +1 -0
  136. package/shared/blade-navigation/composables/useBladeNavigation/index.ts +216 -0
  137. package/shared/blade-navigation/index.ts +15 -0
  138. package/shared/blade-navigation/types/index.ts +52 -0
  139. package/shared/index.ts +16 -0
  140. package/tailwind.config.js +4 -3
  141. package/ui/components/atoms/vc-badge/index.ts +7 -0
  142. package/ui/components/atoms/vc-badge/vc-badge-model.ts +30 -0
  143. package/ui/components/atoms/vc-badge/vc-badge.stories.ts +27 -0
  144. package/ui/components/atoms/vc-badge/vc-badge.vue +57 -0
  145. package/ui/components/atoms/vc-button/index.ts +7 -0
  146. package/ui/components/atoms/vc-button/vc-button-model.ts +30 -0
  147. package/ui/components/atoms/vc-button/vc-button.stories.ts +34 -0
  148. package/ui/components/atoms/vc-button/vc-button.vue +219 -0
  149. package/ui/components/atoms/vc-card/vc-card.vue +137 -0
  150. package/ui/components/atoms/vc-checkbox/vc-checkbox.stories.ts +25 -0
  151. package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +130 -0
  152. package/ui/components/atoms/vc-col/vc-col.vue +22 -0
  153. package/ui/components/atoms/vc-container/vc-container.stories.ts +31 -0
  154. package/ui/components/atoms/vc-container/vc-container.vue +222 -0
  155. package/ui/components/atoms/vc-hint/vc-hint.stories.ts +23 -0
  156. package/ui/components/atoms/vc-hint/vc-hint.vue +11 -0
  157. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +32 -0
  158. package/ui/components/atoms/vc-icon/vc-icon.vue +36 -0
  159. package/ui/components/atoms/vc-image/vc-image.stories.ts +40 -0
  160. package/ui/components/atoms/vc-image/vc-image.vue +122 -0
  161. package/ui/components/atoms/vc-info-row/vc-info-row.vue +42 -0
  162. package/ui/components/atoms/vc-label/vc-label.stories.ts +23 -0
  163. package/ui/components/atoms/vc-label/vc-label.vue +49 -0
  164. package/ui/components/atoms/vc-link/vc-link.stories.ts +30 -0
  165. package/ui/components/atoms/vc-link/vc-link.vue +46 -0
  166. package/ui/components/atoms/vc-loading/vc-loading.vue +33 -0
  167. package/ui/components/atoms/vc-progress/vc-progress.stories.ts +25 -0
  168. package/ui/components/atoms/vc-progress/vc-progress.vue +65 -0
  169. package/ui/components/atoms/vc-row/vc-row.vue +13 -0
  170. package/ui/components/atoms/vc-status/vc-status.stories.ts +26 -0
  171. package/ui/components/atoms/vc-status/vc-status.vue +78 -0
  172. package/ui/components/atoms/vc-status-icon/vc-status-icon.vue +21 -0
  173. package/ui/components/atoms/vc-switch/vc-switch.stories.ts +27 -0
  174. package/ui/components/atoms/vc-switch/vc-switch.vue +100 -0
  175. package/ui/components/atoms/vc-widget/vc-widget.vue +85 -0
  176. package/ui/components/index.ts +44 -0
  177. package/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue +103 -0
  178. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +39 -0
  179. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +21 -0
  180. package/ui/components/molecules/vc-currency-input/vc-input.vue +436 -0
  181. package/ui/components/molecules/vc-editor/vc-editor.vue +117 -0
  182. package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +134 -0
  183. package/ui/components/molecules/vc-form/vc-form.stories.ts +23 -0
  184. package/ui/components/molecules/vc-form/vc-form.vue +5 -0
  185. package/ui/components/molecules/vc-input/index.ts +8 -0
  186. package/ui/components/molecules/vc-input/vc-input-model.ts +150 -0
  187. package/ui/components/molecules/vc-input/vc-input.vue +324 -0
  188. package/ui/components/molecules/vc-input-currency/index.ts +8 -0
  189. package/ui/components/molecules/vc-input-currency/vc-input-currency-model.ts +128 -0
  190. package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +86 -0
  191. package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +447 -0
  192. package/ui/components/molecules/vc-notification/vc-notification.vue +101 -0
  193. package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +23 -0
  194. package/ui/components/molecules/vc-pagination/vc-pagination.vue +169 -0
  195. package/ui/components/molecules/vc-rating/vc-rating.stories.ts +23 -0
  196. package/ui/components/molecules/vc-rating/vc-rating.vue +77 -0
  197. package/ui/components/molecules/vc-select/index.ts +7 -0
  198. package/ui/components/molecules/vc-select/vc-select-model.ts +216 -0
  199. package/ui/components/molecules/vc-select/vc-select.vue +727 -0
  200. package/ui/components/molecules/vc-slider/vc-slider.vue +106 -0
  201. package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +23 -0
  202. package/ui/components/molecules/vc-textarea/vc-textarea.vue +155 -0
  203. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +150 -0
  204. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +148 -0
  205. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +157 -0
  206. package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +110 -0
  207. package/ui/components/organisms/vc-app/vc-app.stories.ts +75 -0
  208. package/ui/components/organisms/vc-app/vc-app.vue +169 -0
  209. package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +126 -0
  210. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +223 -0
  211. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +67 -0
  212. package/ui/components/organisms/vc-blade/vc-blade.stories.ts +46 -0
  213. package/ui/components/organisms/vc-blade/vc-blade.vue +87 -0
  214. package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +426 -0
  215. package/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +123 -0
  216. package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +93 -0
  217. package/ui/components/organisms/vc-gallery/vc-gallery.vue +186 -0
  218. package/ui/components/organisms/vc-login-form/vc-login-form.stories.ts +55 -0
  219. package/ui/components/organisms/vc-login-form/vc-login-form.vue +48 -0
  220. package/ui/components/organisms/vc-popup/vc-popup.stories.ts +23 -0
  221. package/ui/components/organisms/vc-popup/vc-popup.vue +97 -0
  222. package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +113 -0
  223. package/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue +29 -0
  224. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +152 -0
  225. package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +272 -0
  226. package/ui/components/organisms/vc-table/vc-table.stories.ts +99 -0
  227. package/ui/components/organisms/vc-table/vc-table.vue +638 -0
  228. package/ui/types/index.ts +38 -0
  229. package/ui/types/ts-helpers.ts +46 -0
  230. package/dist/components/atoms/vc-badge/vc-badge.stories.d.ts.map +0 -1
  231. package/dist/components/atoms/vc-button/vc-button.stories.d.ts.map +0 -1
  232. package/dist/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts.map +0 -1
  233. package/dist/components/atoms/vc-container/vc-container.stories.d.ts.map +0 -1
  234. package/dist/components/atoms/vc-hint/vc-hint.stories.d.ts.map +0 -1
  235. package/dist/components/atoms/vc-icon/vc-icon.stories.d.ts.map +0 -1
  236. package/dist/components/atoms/vc-image/vc-image.stories.d.ts.map +0 -1
  237. package/dist/components/atoms/vc-label/vc-label.stories.d.ts.map +0 -1
  238. package/dist/components/atoms/vc-link/vc-link.stories.d.ts.map +0 -1
  239. package/dist/components/atoms/vc-progress/vc-progress.stories.d.ts.map +0 -1
  240. package/dist/components/atoms/vc-status/vc-status.stories.d.ts.map +0 -1
  241. package/dist/components/atoms/vc-switch/vc-switch.stories.d.ts.map +0 -1
  242. package/dist/components/index.d.ts.map +0 -1
  243. package/dist/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts.map +0 -1
  244. package/dist/components/molecules/vc-form/vc-form.stories.d.ts.map +0 -1
  245. package/dist/components/molecules/vc-input/vc-input.stories.d.ts +0 -7
  246. package/dist/components/molecules/vc-input/vc-input.stories.d.ts.map +0 -1
  247. package/dist/components/molecules/vc-pagination/vc-pagination.stories.d.ts.map +0 -1
  248. package/dist/components/molecules/vc-rating/vc-rating.stories.d.ts.map +0 -1
  249. package/dist/components/molecules/vc-select/vc-select.stories.d.ts +0 -7
  250. package/dist/components/molecules/vc-select/vc-select.stories.d.ts.map +0 -1
  251. package/dist/components/molecules/vc-textarea/vc-textarea.stories.d.ts.map +0 -1
  252. package/dist/components/organisms/vc-app/vc-app.stories.d.ts.map +0 -1
  253. package/dist/components/organisms/vc-blade/vc-blade.stories.d.ts.map +0 -1
  254. package/dist/components/organisms/vc-login-form/vc-login-form.stories.d.ts.map +0 -1
  255. package/dist/components/organisms/vc-popup/vc-popup.stories.d.ts.map +0 -1
  256. package/dist/components/organisms/vc-table/vc-table.stories.d.ts.map +0 -1
@@ -0,0 +1,169 @@
1
+ <template>
2
+ <div class="vc-pagination tw-flex">
3
+ <!-- To first page chevron -->
4
+ <div
5
+ class="vc-pagination__item"
6
+ :class="{
7
+ 'vc-pagination__item_disabled': currentPage === 1,
8
+ }"
9
+ @click="currentPage !== 1 && $emit('itemClick', 1)"
10
+ >
11
+ <VcIcon size="xs" icon="fas fa-angle-double-left"></VcIcon>
12
+ </div>
13
+
14
+ <!-- To previous page arrow -->
15
+ <div
16
+ class="vc-pagination__item"
17
+ :class="{
18
+ 'vc-pagination__item_disabled': currentPage === 1,
19
+ }"
20
+ @click="currentPage !== 1 && $emit('itemClick', currentPage - 1)"
21
+ >
22
+ <VcIcon size="xs" icon="fas fa-arrow-left"></VcIcon>
23
+ </div>
24
+
25
+ <template v-if="expanded && $isDesktop.value">
26
+ <!-- To preprevious page with number -->
27
+ <div
28
+ v-if="currentPage > 2"
29
+ class="vc-pagination__item"
30
+ @click="$emit('itemClick', currentPage - 2)"
31
+ >
32
+ {{ currentPage - 2 }}
33
+ </div>
34
+
35
+ <!-- To previous page with number -->
36
+ <div
37
+ v-if="currentPage > 1"
38
+ class="vc-pagination__item"
39
+ @click="$emit('itemClick', currentPage - 1)"
40
+ >
41
+ {{ currentPage - 1 }}
42
+ </div>
43
+ </template>
44
+
45
+ <!-- Current page -->
46
+ <div class="vc-pagination__item vc-pagination__item_current">
47
+ {{ currentPage }}
48
+ </div>
49
+
50
+ <template v-if="expanded && $isDesktop.value">
51
+ <!-- To next page with number -->
52
+ <div
53
+ v-if="currentPage < pages"
54
+ class="vc-pagination__item"
55
+ @click="$emit('itemClick', currentPage + 1)"
56
+ >
57
+ {{ currentPage + 1 }}
58
+ </div>
59
+
60
+ <!-- To postnext page with number -->
61
+ <div
62
+ v-if="currentPage < pages - 1"
63
+ class="vc-pagination__item"
64
+ @click="$emit('itemClick', currentPage + 2)"
65
+ >
66
+ {{ currentPage + 2 }}
67
+ </div>
68
+ </template>
69
+
70
+ <!-- To next page arrow -->
71
+ <div
72
+ class="vc-pagination__item"
73
+ :class="{
74
+ 'vc-pagination__item_disabled': currentPage === pages,
75
+ }"
76
+ @click="currentPage !== pages && $emit('itemClick', currentPage + 1)"
77
+ >
78
+ <VcIcon size="xs" icon="fas fa-arrow-right"></VcIcon>
79
+ </div>
80
+
81
+ <!-- To last page chevron -->
82
+ <div
83
+ class="vc-pagination__item"
84
+ :class="{
85
+ 'vc-pagination__item_disabled': currentPage === pages,
86
+ }"
87
+ @click="currentPage !== pages && $emit('itemClick', pages)"
88
+ >
89
+ <VcIcon size="xs" icon="fas fa-angle-double-right"></VcIcon>
90
+ </div>
91
+ </div>
92
+ </template>
93
+
94
+ <script lang="ts" setup>
95
+ import { VcIcon } from "@/ui/components";
96
+
97
+ defineProps({
98
+ expanded: {
99
+ type: Boolean,
100
+ default: false,
101
+ },
102
+
103
+ pages: {
104
+ type: Number,
105
+ default: 1,
106
+ },
107
+
108
+ currentPage: {
109
+ type: Number,
110
+ default: 1,
111
+ },
112
+ });
113
+
114
+ defineEmits(["itemClick"]);
115
+ </script>
116
+
117
+ <style lang="scss">
118
+ :root {
119
+ --pagination-item-width: 30px;
120
+ --pagination-item-height: 30px;
121
+ --pagination-item-color: #000000;
122
+ --pagination-item-color-hover:tw- #000000;
123
+ --pagination-item-color-current: #ffffff;
124
+ --pagination-item-color-disabled: #9c9c9c;
125
+ --pagination-item-background-color: #ffffff;
126
+ --pagination-item-background-color-hover: #dfeef9;
127
+ --pagination-item-background-color-current: #43b0e6;
128
+ --pagination-item-background-color-disabled: #ffffff;
129
+ --pagination-item-border-radius: 3px;
130
+ --pagination-item-border-color: #eaecf2;
131
+ --pagination-item-border-color-hover: #eaecf2;
132
+ --pagination-item-border-color-current: #eaecf2;
133
+ --pagination-item-border-color-disabled: #eaecf2;
134
+ }
135
+
136
+ .vc-pagination {
137
+ &__item {
138
+ @apply tw-flex tw-items-center tw-justify-center tw-w-[var(--pagination-item-width)]
139
+ tw-h-[var(--pagination-item-height)]
140
+ tw-bg-[color:var(--pagination-item-background-color)]
141
+ tw-border tw-border-solid tw-border-[color:var(--pagination-item-border-color)]
142
+ tw-rounded-[var(--pagination-item-border-radius)]
143
+ tw-text-[color:var(--pagination-item-color)]
144
+ tw-box-border tw-cursor-pointer
145
+ tw-transition tw-duration-200
146
+ tw-mr-3 tw-select-none last:tw-mr-0
147
+ hover:tw-bg-[color:var(--pagination-item-background-color-hover)]
148
+ hover:tw-text-[color:var(--pagination-item-color-hover)]
149
+ hover:tw-border hover:tw-border-solid
150
+ hover:tw-border-[color:var(--pagination-item-border-color-hover)];
151
+
152
+ &_current,
153
+ &_current:hover {
154
+ @apply tw-bg-[color:var(--pagination-item-background-color-current)]
155
+ tw-text-[color:var(--pagination-item-color-current)]
156
+ tw-border tw-border-solid tw-border-[color:var(--pagination-item-border-color-current)]
157
+ tw-cursor-auto;
158
+ }
159
+
160
+ &_disabled,
161
+ &_disabled:hover {
162
+ @apply tw-bg-[color:var(--pagination-item-background-color-disabled)]
163
+ tw-text-[color:var(--pagination-item-color-disabled)]
164
+ tw-border tw-border-solid tw-border-[color:var(--pagination-item-border-color-disabled)]
165
+ tw-cursor-auto;
166
+ }
167
+ }
168
+ }
169
+ </style>
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Rating component.
3
+ * @author Aleksandr Vishnyakov <av@virtoway.com>
4
+ */
5
+ import { Story } from "@storybook/vue3";
6
+ import VcRating from "./vc-rating.vue";
7
+
8
+ export default {
9
+ title: "atoms/vc-rating",
10
+ component: VcRating,
11
+ };
12
+
13
+ const Template: Story = (args) => ({
14
+ components: { VcRating },
15
+ setup() {
16
+ return { args };
17
+ },
18
+ template: '<vc-rating v-bind="args"></vc-rating>',
19
+ });
20
+
21
+ export const Rating = Template.bind({});
22
+ Rating.storyName = "vc-rating";
23
+ Rating.args = {};
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <div class="vc-rating">
3
+ <!-- Rating label -->
4
+ <VcLabel v-if="label" class="tw-mb-2">
5
+ <span>{{ label }}</span>
6
+ <template v-if="tooltip" v-slot:tooltip>
7
+ <span v-html="tooltip"></span>
8
+ </template>
9
+ </VcLabel>
10
+
11
+ <!-- Rating icon -->
12
+ <template v-if="rating">
13
+ <template v-if="variant == 'stars'">
14
+ <VcIcon
15
+ v-for="index in rating"
16
+ :key="index"
17
+ icon="fas fa-star"
18
+ class="vc-rating__icon"
19
+ ></VcIcon>
20
+ <VcIcon
21
+ v-for="index in max - rating"
22
+ :key="index"
23
+ icon="far fa-star"
24
+ class="vc-rating__icon"
25
+ ></VcIcon>
26
+ </template>
27
+ <template v-else>
28
+ <VcIcon
29
+ v-if="variant == 'star-and-text'"
30
+ icon="fas fa-star"
31
+ class="vc-rating__icon"
32
+ ></VcIcon>
33
+ <span class="vc-rating__rating">{{ rating }}/{{ max }}</span>
34
+ <slot name="details"></slot>
35
+ </template>
36
+ </template>
37
+ <template v-else>
38
+ <span class="vc-rating__placeholder"></span>
39
+ </template>
40
+ </div>
41
+ </template>
42
+
43
+ <script lang="ts" setup>
44
+ import { VcIcon, VcLabel } from "@/ui/components";
45
+
46
+ export interface Props {
47
+ label?: string;
48
+ placeholder?: string;
49
+ tooltip?: string;
50
+ rating: number | undefined;
51
+ max?: number;
52
+ variant?: "stars" | "star-and-text" | "text";
53
+ }
54
+
55
+ withDefaults(defineProps<Props>(), { max: 5, variant: "stars" });
56
+ </script>
57
+
58
+ <style lang="scss">
59
+ :root {
60
+ --rating-placeholder-color: #a5a5a5;
61
+ }
62
+
63
+ .vc-rating {
64
+ @apply tw-align-middle;
65
+
66
+ &__placeholder {
67
+ @apply tw-text-[color:var(--rating-placeholder-color)];
68
+ }
69
+ &__icon {
70
+ @apply tw-text-[color:var(--special-color)] tw-mr-1;
71
+ font-size: inherit;
72
+ }
73
+ &__rating {
74
+ @apply tw-mr-1;
75
+ }
76
+ }
77
+ </style>
@@ -0,0 +1,7 @@
1
+ import { ComponentPublicInstance } from "vue";
2
+ import { VcSelectProps } from "./vc-select-model";
3
+ import { ComponentConstructor } from "@/ui/types/ts-helpers";
4
+ import Select from "./vc-select.vue";
5
+ export const VcSelect: ComponentConstructor<
6
+ ComponentPublicInstance<VcSelectProps>
7
+ > = Select;
@@ -0,0 +1,216 @@
1
+ import { VNode } from "vue";
2
+
3
+ export type OptionProp =
4
+ | ((option: string | Record<string, unknown>) => string)
5
+ | string
6
+ | undefined;
7
+
8
+ export interface VcSelectProps {
9
+ /**
10
+ * Name of select
11
+ */
12
+ name?: string | undefined;
13
+ /**
14
+ * Model of the component; Must be Array if using 'multiple' prop; Use this property with a listener for 'update:modelValue' event OR use v-model directive
15
+ */
16
+ modelValue: any;
17
+ /**
18
+ * Try to map labels of model from 'options' Array; If you are using emit-value you will probably need to use map-options to display the label text in the select field rather than the value;
19
+ * Default value: true
20
+ */
21
+ mapOptions?: boolean | undefined;
22
+ /**
23
+ * Does field have validation errors?
24
+ */
25
+ error?: boolean | undefined;
26
+ /**
27
+ * Validation error message (gets displayed only if 'error' is set to 'true')
28
+ */
29
+ errorMessage?: string | undefined;
30
+ /**
31
+ * Select label
32
+ */
33
+ label?: string | undefined;
34
+ /**
35
+ * Select description (hint) text below input component
36
+ */
37
+ hint?: string | undefined;
38
+ /**
39
+ * Prefix
40
+ */
41
+ prefix?: string | undefined;
42
+ /**
43
+ * Suffix
44
+ */
45
+ suffix?: string | undefined;
46
+ /**
47
+ * Signals the user a process is in progress by displaying a spinner
48
+ */
49
+ loading?: boolean | undefined;
50
+ /**
51
+ * Appends clearable icon when a value is set;
52
+ * When clicked, model becomes null
53
+ */
54
+ clearable?: boolean | undefined;
55
+ /**
56
+ * Put component in disabled mode
57
+ */
58
+ disabled?: boolean | undefined;
59
+ /**
60
+ * Allow multiple selection; Model must be Array
61
+ */
62
+ multiple?: boolean | undefined;
63
+ /**
64
+ * Available options that the user can select from.
65
+ * Default value: []
66
+ */
67
+ options?:
68
+ | ((
69
+ keyword?: string,
70
+ skip?: number,
71
+ ids?: string[]
72
+ ) => Promise<{
73
+ results?: Record<string, unknown>[];
74
+ totalCount?: number;
75
+ }>)
76
+ | any[]
77
+ | undefined;
78
+ /**
79
+ * Property of option which holds the 'value'
80
+ * Default value: id
81
+ * @param option The current option being processed
82
+ * @returns Value of the current option
83
+ */
84
+ optionValue?: OptionProp;
85
+ /**
86
+ * Property of option which holds the 'label'
87
+ * Default value: title
88
+ * @param option The current option being processed
89
+ * @returns Label of the current option
90
+ */
91
+ optionLabel?: OptionProp;
92
+ /**
93
+ * Update model with the value of the selected option instead of the whole option
94
+ */
95
+ emitValue?: boolean | undefined;
96
+ /**
97
+ * Debounce the search input update with an amount of milliseconds
98
+ * Default value: 500
99
+ */
100
+ debounce?: number | string | undefined;
101
+ /**
102
+ * Input placeholder text
103
+ */
104
+ placeholder?: string | undefined;
105
+ /**
106
+ * Input tooltip information
107
+ */
108
+ tooltip?: string | undefined;
109
+ /**
110
+ * Input required state
111
+ */
112
+ required?: boolean | undefined;
113
+ /**
114
+ * Input search activation
115
+ */
116
+ searchable?: boolean | undefined;
117
+ }
118
+ export interface VcSelectEmits {
119
+ /**
120
+ * Emitted when the component needs to change the model; Is also used by v-model
121
+ * @param event Emitted event name
122
+ * @param value New model value
123
+ */
124
+ (event: "update:modelValue", value: any): void;
125
+ /**
126
+ * Emitted when user wants to filter a value
127
+ * @param event Emitted event name
128
+ * @param inputValue What the user typed
129
+ */
130
+ (event: "search", inputValue: string): void;
131
+ /**
132
+ * Emitted when the select options list is hidden
133
+ * @param event Emitted event name
134
+ */
135
+ (event: "close"): void;
136
+ }
137
+ export interface VcSelectSlots {
138
+ /**
139
+ * Custom select control
140
+ */
141
+ control: (scope: { toggleHandler: () => void }) => VNode[];
142
+ /**
143
+ * Prepend inner field
144
+ */
145
+ "prepend-inner": () => VNode[];
146
+ /**
147
+ * Append to inner field
148
+ */
149
+ "append-inner": () => VNode[];
150
+ /**
151
+ * Prepend outer field
152
+ */
153
+ prepend: () => VNode[];
154
+ /**
155
+ * Append outer field
156
+ */
157
+ append: () => VNode[];
158
+ /**
159
+ * What should the menu display after filtering options and none are left to be displayed
160
+ * @param scope
161
+ */
162
+ "no-option": () => VNode[];
163
+ /**
164
+ * Slot for errors
165
+ */
166
+ error: () => VNode[];
167
+ /**
168
+ * Slot for hint text
169
+ */
170
+ hint: () => VNode[];
171
+ /**
172
+ * Override default selection slot
173
+ * @param scope
174
+ */
175
+ "selected-item": (scope: {
176
+ /**
177
+ * Selection index
178
+ */
179
+ index: number;
180
+ /**
181
+ * Selected option -- its value is taken from model
182
+ */
183
+ opt: any;
184
+ /**
185
+ * Always true -- passed as prop
186
+ */
187
+ selected: boolean;
188
+ /**
189
+ * Remove selected option located at specific index
190
+ * @param index Index at which to remove selection
191
+ */
192
+ removeAtIndex: (index: number) => void;
193
+ }) => VNode[];
194
+ /**
195
+ * Override default selection slot;
196
+ */
197
+ option: (scope: {
198
+ /**
199
+ * Option index
200
+ */
201
+ index: number;
202
+ /**
203
+ * Option -- its value is taken from 'options' prop
204
+ */
205
+ opt: any;
206
+ /**
207
+ * Is option selected?
208
+ */
209
+ selected: boolean;
210
+ /**
211
+ * Add/remove option from model
212
+ * @param opt Option to add to model
213
+ */
214
+ toggleOption: (opt: any) => void;
215
+ }) => VNode[];
216
+ }