@webitel/ui-sdk 0.1.11 → 0.1.112

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 (254) hide show
  1. package/README.md +29 -29
  2. package/dist/img/plyr.svg +70 -0
  3. package/dist/img/svg-sprites/attach.svg +4 -0
  4. package/dist/img/svg-sprites/index.js +1 -0
  5. package/dist/img/svg-sprites/wt-icon.svg +880 -0
  6. package/dist/ui-sdk.common.js +8287 -4335
  7. package/dist/ui-sdk.common.js.map +1 -1
  8. package/dist/ui-sdk.css +1 -1
  9. package/dist/ui-sdk.umd.js +8287 -4335
  10. package/dist/ui-sdk.umd.js.map +1 -1
  11. package/dist/ui-sdk.umd.min.js +3 -1
  12. package/dist/ui-sdk.umd.min.js.map +1 -1
  13. package/package.json +62 -41
  14. package/src/components/atoms/wt-badge/__tests__/WtBadge.spec.js +19 -0
  15. package/src/components/atoms/wt-badge/wt-badge.vue +23 -0
  16. package/src/components/atoms/wt-button/__tests__/WtButton.spec.js +29 -0
  17. package/src/components/atoms/wt-button/wt-button.vue +212 -0
  18. package/src/components/atoms/wt-divider/__tests__/WtDivider.spec.js +9 -0
  19. package/src/components/atoms/wt-divider/wt-divider.vue +25 -0
  20. package/src/components/atoms/wt-icon/__tests__/WtIcon.spec.js +24 -0
  21. package/src/components/atoms/wt-icon/wt-icon.vue +138 -0
  22. package/src/components/atoms/wt-indicator/__tests__/WtIndicator.spec.js +29 -0
  23. package/src/components/atoms/wt-indicator/wt-indicator.vue +81 -0
  24. package/src/components/atoms/wt-input-info/__tests__/WtInputInfo.spec.js +9 -0
  25. package/src/components/atoms/wt-input-info/wt-input-info.vue +35 -0
  26. package/src/components/atoms/wt-loader/__tests__/WtLoader.spec.js +9 -0
  27. package/src/components/atoms/wt-loader/_internals/wt-loader--md.vue +83 -0
  28. package/src/components/atoms/wt-loader/_internals/wt-loader--sm.vue +189 -0
  29. package/src/components/atoms/wt-loader/wt-loader.vue +34 -0
  30. package/src/components/atoms/wt-rounded-action/__tests__/WtRoundedAction.spec.js +20 -0
  31. package/src/components/atoms/wt-rounded-action/wt-rounded-action.vue +227 -0
  32. package/src/components/atoms/wt-tooltip/__tests__/WtTooltip.spec.js +29 -0
  33. package/src/components/atoms/wt-tooltip/wt-tooltip.vue +54 -0
  34. package/src/components/index.js +98 -0
  35. package/src/components/molecules/wt-checkbox/__tests__/WtCheckbox.spec.js +41 -0
  36. package/src/components/molecules/wt-checkbox/wt-checkbox.vue +175 -0
  37. package/src/components/molecules/wt-datepicker/__tests__/WtDatepicker.spec.js +28 -0
  38. package/src/components/molecules/wt-datepicker/wt-datepicker.vue +209 -0
  39. package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +67 -0
  40. package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +314 -0
  41. package/src/components/molecules/wt-icon-btn/__tests__/WtIconBtn.spec.js +31 -0
  42. package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +113 -0
  43. package/src/components/molecules/wt-input/__tests__/WtInput.spec.js +25 -0
  44. package/src/components/molecules/wt-input/wt-input.vue +316 -0
  45. package/src/components/molecules/wt-label/__tests__/WtLabel.spec.js +9 -0
  46. package/src/components/molecules/wt-label/wt-label.vue +87 -0
  47. package/src/components/molecules/wt-notification/__tests__/WtNotification.spec.js +21 -0
  48. package/src/components/molecules/wt-notification/wt-notification.vue +74 -0
  49. package/src/components/molecules/wt-popup/__tests__/WtPopup.spec.js +47 -0
  50. package/src/components/molecules/wt-popup/wt-popup.vue +130 -0
  51. package/src/components/molecules/wt-progress-bar/__tests__/WtProgressBar.spec.js +17 -0
  52. package/src/components/molecules/wt-progress-bar/wt-progress-bar.vue +80 -0
  53. package/src/components/molecules/wt-radio/__tests__/WtRadio.spec.js +42 -0
  54. package/src/components/molecules/wt-radio/wt-radio.vue +168 -0
  55. package/src/components/molecules/wt-search-bar/__tests__/WtSearchBar.spec.js +36 -0
  56. package/src/components/molecules/wt-search-bar/wt-search-bar.vue +203 -0
  57. package/src/components/molecules/wt-select/__tests__/WtSelect.spec.js +53 -0
  58. package/src/components/molecules/wt-select/wt-select.vue +492 -0
  59. package/src/components/molecules/wt-slider/__tests__/WtSlider.spec.js +9 -0
  60. package/src/components/molecules/wt-slider/wt-slider.vue +175 -0
  61. package/src/components/molecules/wt-switcher/__tests__/WtSwitcher.spec.js +31 -0
  62. package/src/components/molecules/wt-switcher/wt-switcher.vue +177 -0
  63. package/src/components/molecules/wt-tabs/__tests__/WtTabs.spec.js +36 -0
  64. package/src/components/molecules/wt-tabs/wt-tabs.vue +127 -0
  65. package/src/components/molecules/wt-tags-input/__tests__/WtTagsInput.spec.js +45 -0
  66. package/src/components/molecules/wt-tags-input/wt-tags-input.vue +295 -0
  67. package/src/components/molecules/wt-textarea/__tests__/WtTextarea.spec.js +46 -0
  68. package/src/components/molecules/wt-textarea/wt-textarea.vue +185 -0
  69. package/src/components/molecules/wt-time-input/__tests__/WtTimeInput.spec.js +25 -0
  70. package/src/components/molecules/wt-time-input/wt-time-input.vue +192 -0
  71. package/src/components/molecules/wt-timepicker/__tests__/WtTimepicker.spec.js +60 -0
  72. package/src/components/molecules/wt-timepicker/wt-timepicker.vue +176 -0
  73. package/src/components/organisms/wt-app-header/__tests__/WtAppHeader.spec.js +19 -0
  74. package/src/components/organisms/wt-app-header/__tests__/WtAppNavigator.spec.js +23 -0
  75. package/src/components/organisms/wt-app-header/__tests__/WtHeaderActions.spec.js +21 -0
  76. package/src/components/organisms/wt-app-header/wt-app-header.vue +23 -0
  77. package/src/components/organisms/wt-app-header/wt-app-navigator.vue +245 -0
  78. package/src/components/organisms/wt-app-header/wt-header-actions.vue +177 -0
  79. package/src/components/organisms/wt-error-page/__tests__/wt-error-page.spec.js +17 -0
  80. package/src/components/organisms/wt-error-page/wt-error-page.vue +104 -0
  81. package/src/components/organisms/wt-filters-panel-wrapper/__tests__/wt-filters-panel-wrapper.spec.js +24 -0
  82. package/src/components/organisms/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +146 -0
  83. package/src/components/organisms/wt-headline/__tests__/WtHeadline.spec.js +47 -0
  84. package/src/components/organisms/wt-headline/wt-headline.vue +46 -0
  85. package/src/components/organisms/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +64 -0
  86. package/src/components/organisms/wt-navigation-bar/wt-navigation-bar.vue +249 -0
  87. package/src/components/organisms/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +50 -0
  88. package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +71 -0
  89. package/src/components/organisms/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +33 -0
  90. package/src/components/organisms/wt-page-wrapper/wt-page-wrapper.vue +60 -0
  91. package/src/components/organisms/wt-pagination/__tests__/WtPagination.spec.js +38 -0
  92. package/src/components/organisms/wt-pagination/wt-pagination.vue +134 -0
  93. package/src/components/organisms/wt-player/__tests__/WtPlayer.spec.js +9 -0
  94. package/src/components/organisms/wt-player/wt-player.vue +116 -0
  95. package/src/components/organisms/wt-status-select/__tests__/WtStatusSelect.spec.js +25 -0
  96. package/src/components/organisms/wt-status-select/_internals/StatusOptions.lookup.js +24 -0
  97. package/src/components/organisms/wt-status-select/wt-status-select.vue +110 -0
  98. package/src/components/organisms/wt-table/__tests__/WtTable.spec.js +133 -0
  99. package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +9 -0
  100. package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +9 -0
  101. package/src/components/organisms/wt-table/_internals/getSortOrder.js +12 -0
  102. package/src/components/organisms/wt-table/table-cells/wt-table-delete-action.vue +18 -0
  103. package/src/components/organisms/wt-table/table-cells/wt-table-edit-action.vue +19 -0
  104. package/src/components/organisms/wt-table/wt-table.vue +241 -0
  105. package/src/components/organisms/wt-table-actions/__tests__/WtTableActions.spec.js +9 -0
  106. package/src/components/organisms/wt-table-actions/wt-table-actions.vue +90 -0
  107. package/src/components/organisms/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +31 -0
  108. package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +113 -0
  109. package/src/components/transitions/__tests__/ExpandTransition.spec.js +9 -0
  110. package/src/components/transitions/expand-transition.vue +70 -0
  111. package/src/css/colors/_colors.scss +151 -67
  112. package/src/css/components/_components.scss +38 -25
  113. package/src/css/components/atoms/wt-badge/_variables.scss +6 -5
  114. package/src/css/components/atoms/wt-badge/wt-badge.scss +36 -8
  115. package/src/css/components/atoms/wt-button/_variables.scss +46 -46
  116. package/src/css/components/atoms/wt-divider/_variables.scss +4 -4
  117. package/src/css/components/atoms/wt-icon/_variables.scss +7 -28
  118. package/src/css/components/atoms/wt-indicator/_variables.scss +18 -0
  119. package/src/css/components/atoms/wt-input-info/_variables.scss +6 -5
  120. package/src/css/components/atoms/wt-label/_variables.scss +4 -4
  121. package/src/css/components/atoms/wt-loader/_variables.scss +7 -7
  122. package/src/css/components/atoms/wt-rounded-action/_variables.scss +30 -0
  123. package/src/css/components/atoms/wt-tooltip/_variables.scss +9 -9
  124. package/src/css/components/molecules/wt-checkbox/_variables.scss +3 -3
  125. package/src/css/components/molecules/wt-datepicker/_variables.scss +19 -19
  126. package/src/css/components/molecules/wt-datepicker/datepicker-calendar.scss +100 -100
  127. package/src/css/components/molecules/wt-datetimepicker/_variables.scss +11 -11
  128. package/src/css/components/molecules/wt-icon-btn/_variables.scss +2 -2
  129. package/src/css/components/molecules/wt-input/_variables.scss +5 -5
  130. package/src/css/components/molecules/wt-notification/_variables.scss +9 -9
  131. package/src/css/components/molecules/wt-popup/_variables.scss +11 -10
  132. package/src/css/components/molecules/wt-progress-bar/_variables.scss +11 -0
  133. package/src/css/components/molecules/wt-radio/_variables.scss +6 -6
  134. package/src/css/components/molecules/wt-search-bar/_variables.scss +3 -3
  135. package/src/css/components/molecules/wt-select/_variables.scss +24 -22
  136. package/src/css/components/molecules/wt-slider/_variables.scss +15 -0
  137. package/src/css/components/molecules/wt-switcher/_variables.scss +17 -14
  138. package/src/css/components/molecules/wt-tabs/_variables.scss +13 -13
  139. package/src/css/components/molecules/wt-tags-input/_variables.scss +25 -0
  140. package/src/css/components/molecules/wt-textarea/_variables.scss +4 -4
  141. package/src/css/components/molecules/wt-timepicker/_variables.scss +4 -3
  142. package/src/css/components/organisms/wt-app-header/_variables.scss +20 -0
  143. package/src/css/components/organisms/wt-headline/_variables.scss +7 -0
  144. package/src/css/components/organisms/wt-navigation-bar/_variables.scss +14 -0
  145. package/src/css/components/organisms/wt-notifications-bar/_variables.scss +7 -0
  146. package/src/css/components/organisms/wt-page-wrapper/_variables.scss +5 -0
  147. package/src/css/components/organisms/wt-pagination/_variables.scss +6 -6
  148. package/src/css/components/organisms/wt-status-select/_variables.scss +6 -0
  149. package/src/css/components/organisms/wt-table/_variables.scss +16 -0
  150. package/src/css/components/organisms/wt-table-actions/_variables.scss +4 -0
  151. package/src/css/display-helpers/_display-helpers.scss +21 -0
  152. package/src/css/fonts/_fonts.scss +9 -0
  153. package/src/css/main.scss +68 -65
  154. package/src/css/shadows/_shadows.scss +7 -0
  155. package/src/css/sizes/_sizes.scss +2 -0
  156. package/src/css/sizes/_spacing.scss +17 -0
  157. package/src/css/sizes/_viewport-breakpoints.scss +20 -0
  158. package/src/css/styleguide/{styleguide.scss → _styleguide.scss} +4 -3
  159. package/src/css/styleguide/scroll.scss +43 -40
  160. package/src/css/transitions/_transitions.scss +1 -0
  161. package/src/css/transitions/fade/_fade.scss +8 -0
  162. package/src/css/typography/_typography.scss +72 -72
  163. package/src/enums/AgentStatus/AgentStatus.enum.js +6 -0
  164. package/src/enums/WebitelApplications/AdminSections.enum.js +41 -0
  165. package/src/enums/WebitelApplications/SupervisorSections.enum.js +7 -0
  166. package/src/enums/WebitelApplications/WebitelApplications.enum.js +10 -0
  167. package/src/locale/en/en.js +135 -0
  168. package/src/locale/i18n.js +2 -0
  169. package/src/locale/ru/ru.js +135 -2
  170. package/src/locale/ua/ua.js +160 -0
  171. package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +57 -0
  172. package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +66 -0
  173. package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +93 -0
  174. package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +60 -0
  175. package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +48 -0
  176. package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +37 -0
  177. package/src/mixins/dataFilterMixins/apiFilterMixin.js +23 -0
  178. package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +29 -0
  179. package/src/mixins/dataFilterMixins/enumFilterMixin.js +30 -0
  180. package/src/mixins/dataFilterMixins/paginationFilterMixin.js +79 -0
  181. package/src/mixins/dataFilterMixins/sortFilterMixin.js +75 -0
  182. package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +47 -0
  183. package/src/mixins/validationMixin/validationMixin.js +40 -0
  184. package/src/modules/CSVExport/CSVExport.js +88 -0
  185. package/src/modules/CSVExport/__tests__/CSVExport.spec.js +63 -0
  186. package/src/modules/CSVExport/mixins/exportCSVMixin.js +46 -0
  187. package/src/modules/FilesExport/FilesExport.js +110 -0
  188. package/src/modules/FilesExport/__tests__/FilesExport.spec.js +66 -0
  189. package/src/modules/FilesExport/mixins/exportFilesMixin.js +46 -0
  190. package/src/modules/FilesExport/scripts/generateMediaURL.js +7 -0
  191. package/src/modules/QueryFilters/api/__tests__/defaults.spec.js +18 -0
  192. package/src/modules/QueryFilters/api/defaults.js +16 -0
  193. package/src/modules/QueryFilters/classes/ApiFilterSchema.js +32 -0
  194. package/src/modules/QueryFilters/classes/BaseFilterSchema.js +6 -0
  195. package/src/modules/QueryFilters/classes/EnumFilterSchema.js +23 -0
  196. package/src/modules/QueryFilters/classes/__tests__/ApiFilterSchema.spec.js +25 -0
  197. package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +54 -0
  198. package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +40 -0
  199. package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +49 -0
  200. package/src/modules/QueryFilters/components/abstract-api-filter.vue +42 -0
  201. package/src/modules/QueryFilters/components/abstract-enum-filter.vue +32 -0
  202. package/src/modules/QueryFilters/components/filter-search.vue +33 -0
  203. package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +48 -0
  204. package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +54 -0
  205. package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +74 -0
  206. package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +58 -0
  207. package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +48 -0
  208. package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +39 -0
  209. package/src/modules/QueryFilters/mixins/apiFilterMixin.js +36 -0
  210. package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +34 -0
  211. package/src/modules/QueryFilters/mixins/enumFilterMixin.js +36 -0
  212. package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +66 -0
  213. package/src/modules/QueryFilters/mixins/sortFilterMixin.js +56 -0
  214. package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +50 -0
  215. package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +83 -0
  216. package/src/modules/QueryFilters/store/queryFilters.js +6 -0
  217. package/src/modules/Userinfo/api/BaseAPIService.js +7 -0
  218. package/src/modules/Userinfo/api/auth.js +29 -0
  219. package/src/modules/Userinfo/api/userinfo.js +32 -0
  220. package/src/modules/Userinfo/classes/ApplicationsAccess.js +170 -0
  221. package/src/modules/Userinfo/components/__tests__/auth.spec.js +57 -0
  222. package/src/modules/Userinfo/components/the-auth.vue +75 -0
  223. package/src/modules/Userinfo/store/UserinfoStoreModule.js +112 -0
  224. package/src/scripts/__tests__/caseConverters.spec.js +65 -0
  225. package/src/scripts/__tests__/convertDuration.spec.js +21 -0
  226. package/src/scripts/__tests__/debounce.spec.js +15 -0
  227. package/src/scripts/__tests__/editProxy.spec.js +9 -0
  228. package/src/scripts/__tests__/isEmpty.spec.js +16 -0
  229. package/src/scripts/__tests__/prettifyFileSize.spec.js +18 -0
  230. package/src/scripts/__tests__/prettifyTime.spec.js +18 -0
  231. package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +16 -0
  232. package/src/scripts/__tests__/sortQueryAdapters.spec.js +12 -0
  233. package/src/scripts/caseConverters.js +78 -0
  234. package/src/scripts/convertDuration.js +15 -0
  235. package/src/scripts/editProxy.js +9 -0
  236. package/src/scripts/eventBus.js +4 -0
  237. package/src/scripts/isEmpty.js +9 -0
  238. package/src/scripts/prettifyFileSize.js +11 -0
  239. package/src/scripts/prettifyTime.js +9 -0
  240. package/src/scripts/preventHiddenPageCallsDecorator.js +6 -0
  241. package/src/scripts/sortQueryAdapters.js +21 -0
  242. package/src/store/BaseStoreModules/BaseStoreModule.js +49 -0
  243. package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +104 -0
  244. package/src/store/helpers/__tests__/getNamespacedState.spec.js +11 -0
  245. package/src/store/helpers/getNamespacedState.js +5 -0
  246. package/dist/img/arrow-down--active--md.7b60f2fb6090366652124f77c543a516.svg +0 -3
  247. package/dist/img/arrow-down--disabled--md.f58424cd673258365e78863edd1e92cc.svg +0 -3
  248. package/dist/img/arrow-down--md.1843b60e1c244e066a650e8d19ea83c9.svg +0 -3
  249. package/dist/img/calendar--active--md.7fd3d949ec7234a4940ea452d95b4165.svg +0 -6
  250. package/dist/img/calendar--disabled--md.8e7a1e18f93ae8af270060400e6f881c.svg +0 -3
  251. package/dist/img/calendar--md.9c265581c3a405ff0f0e46e8092f36b8.svg +0 -6
  252. package/src/css/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  253. package/src/css/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  254. package/src/css/fonts.scss +0 -9
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <div class="wt-indicator">
3
+ <span
4
+ class="wt-indicator__indicator"
5
+ :class="`wt-indicator__indicator--${color}`"
6
+ ></span>
7
+ <div v-if="isText" class="wt-indicator__text">
8
+ {{ text }}
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'wt-indicator',
16
+ props: {
17
+ color: {
18
+ type: String,
19
+ default: 'secondary',
20
+ options: ['primary', 'secondary', 'disabled', 'success', 'danger', 'transfer', 'break-out'],
21
+ },
22
+
23
+ text: {
24
+ type: [String, Number],
25
+ },
26
+ },
27
+
28
+ computed: {
29
+ isText() {
30
+ return this.text !== undefined && this.text !== null && this.text !== '';
31
+ },
32
+ },
33
+ };
34
+ </script>
35
+
36
+ <style lang="scss" scoped>
37
+ .wt-indicator {
38
+ display: flex;
39
+ align-items: center;
40
+ }
41
+
42
+ .wt-indicator__text {
43
+ @extend %typo-strong-lg;
44
+ margin-left: var(--indicator-text-margin);
45
+ }
46
+
47
+ .wt-indicator__indicator {
48
+ min-width: var(--indicator-size);
49
+ height: var(--indicator-size);
50
+ background: var(--indicator-disabled-color);
51
+ border-radius: 50%;
52
+
53
+ &--primary {
54
+ background: var(--indicator-primary-color);
55
+ }
56
+
57
+ &--secondary {
58
+ background: var(--indicator-secondary-color);
59
+ }
60
+
61
+ &--disabled {
62
+ background: var(--indicator-disabled-color);
63
+ }
64
+
65
+ &--success {
66
+ background: var(--indicator-true-color);
67
+ }
68
+
69
+ &--danger {
70
+ background: var(--indicator-false-color);
71
+ }
72
+
73
+ &--transfer {
74
+ background: var(--indicator-transfer-color);
75
+ }
76
+
77
+ &--break-out {
78
+ background: var(--indicator-break-out-color);
79
+ }
80
+ }
81
+ </style>
@@ -0,0 +1,9 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtInputInfo from '../wt-input-info.vue';
3
+
4
+ describe('WtInputInfo', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtInputInfo);
7
+ expect(wrapper.classes('wt-input-info')).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <div
3
+ class="wt-input-info"
4
+ :class="{
5
+ 'wt-input-info--invalid': invalid,
6
+ }"
7
+ >
8
+ <slot></slot>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'wt-input-info',
15
+ props: {
16
+ invalid: {
17
+ type: Boolean,
18
+ default: false,
19
+ },
20
+ },
21
+ };
22
+ </script>
23
+
24
+ <style lang="scss" scoped>
25
+ .wt-input-info {
26
+ @extend %typo-body-sm;
27
+ margin-top: var(--input-info-margin);
28
+ color: var(--input-info-color);
29
+ min-height: var(--input-info-min-height);
30
+
31
+ &--invalid {
32
+ color: var(--input-info--invalid-color);
33
+ }
34
+ }
35
+ </style>
@@ -0,0 +1,9 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtLoader from '../wt-loader.vue';
3
+
4
+ describe('WtLoader', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtLoader);
7
+ expect(wrapper.classes('wt-loader')).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div class="wt-loader wt-loader--md">
3
+ <svg class="wt-loader--md__svg" viewBox="0 0 80 80">
4
+ <rect class="wt-loader--md__svg__rect" x="8" y="8" width="64" height="64"></rect>
5
+ </svg>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ };
12
+ </script>
13
+
14
+ <style lang="scss" scoped>
15
+ // https://codepen.io/aaroniker/pen/omvYNZ
16
+ .wt-loader--md {
17
+ position: relative;
18
+ width: var(--loader-size);
19
+ height: var(--loader-size);
20
+ margin: auto;
21
+
22
+ &:before {
23
+ content: '';
24
+ width: var(--loader-dot-size);
25
+ height: var(--loader-dot-size);
26
+ display: block;
27
+ position: absolute;
28
+ top: 37px;
29
+ left: 19px;
30
+ transform: translate(-18px, -18px);
31
+ background: var(--loader-dot-color);
32
+ border-radius: 50%;
33
+ animation: dotRect var(--loader-animation-duration) linear infinite;
34
+ }
35
+
36
+ .wt-loader--md__svg {
37
+ display: block;
38
+ width: 100%;
39
+ height: 100%;
40
+
41
+ &__rect {
42
+ fill: none;
43
+ stroke: var(--loader-path-color);
44
+ stroke-width: 10px;
45
+ stroke-linejoin: round;
46
+ stroke-linecap: round;
47
+ stroke-dasharray: (256 / 4 * 3) (256 / 4) (256 / 4 * 3) (256 / 4);
48
+ stroke-dashoffset: 0;
49
+ animation: pathRect var(--loader-animation-duration) linear infinite;
50
+ }
51
+ }
52
+ }
53
+
54
+ @keyframes pathRect {
55
+ 25% {
56
+ stroke-dashoffset: 64;
57
+ }
58
+ 50% {
59
+ stroke-dashoffset: 128;
60
+ }
61
+ 75% {
62
+ stroke-dashoffset: 192;
63
+ }
64
+ 100% {
65
+ stroke-dashoffset: 256;
66
+ }
67
+ }
68
+
69
+ @keyframes dotRect {
70
+ 25% {
71
+ transform: translate(0, 0);
72
+ }
73
+ 50% {
74
+ transform: translate(18px, -18px);
75
+ }
76
+ 75% {
77
+ transform: translate(0, -36px);
78
+ }
79
+ 100% {
80
+ transform: translate(-18px, -18px);
81
+ }
82
+ }
83
+ </style>
@@ -0,0 +1,189 @@
1
+ <!--https://codepen.io/adityapunjani/pen/YyQmBZ-->
2
+
3
+ <template>
4
+ <div class="wt-loader--sm" :class="`wt-loader--sm--${color}`">
5
+ <div class="wt-loader--sm__container active common">
6
+ <div class="wt-loader--sm__layer layer-1 common">
7
+ <div class="circle-clipper left common">
8
+ <div class="circle common" style="border-width:3px;"></div>
9
+ </div>
10
+ <div class="gap-patch common">
11
+ <div class="circle common" style="border-width:3px;"></div>
12
+ </div>
13
+ <div class="circle-clipper right common">
14
+ <div class="circle common" style="border-width:3px;"></div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ props: {
24
+ color: {
25
+ type: String,
26
+ default: 'contrast',
27
+ description: '["main", "contrast"]',
28
+ },
29
+ },
30
+ };
31
+ </script>
32
+
33
+ <style lang="scss" scoped>
34
+ .common {
35
+ display: inline-block;
36
+ position: relative;
37
+ }
38
+
39
+ .wt-loader--sm {
40
+ width: 14px;
41
+ height: 14px;
42
+ display: block;
43
+ position: relative;
44
+ text-align: initial;
45
+ color: var(--contrast-color);
46
+
47
+ &--main {
48
+ color: var(--main-color);
49
+ }
50
+ &--contrast {
51
+ color: var(--contrast-color);
52
+ }
53
+ }
54
+
55
+ .wt-loader--sm__container {
56
+ width: 100%;
57
+ height: 100%;
58
+ direction: ltr;
59
+ }
60
+
61
+ .wt-loader--sm__container.active {
62
+ animation: container-rotate 1568ms linear infinite;
63
+ }
64
+
65
+ @keyframes container-rotate {
66
+ to {
67
+ transform: rotate(360deg)
68
+ }
69
+ }
70
+
71
+ .wt-loader--sm__layer {
72
+ position: absolute;
73
+ width: 100%;
74
+ height: 100%;
75
+ }
76
+
77
+ .active .wt-loader--sm__layer.layer-1 {
78
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
79
+ }
80
+
81
+ @keyframes fill-unfill-rotate {
82
+ 12.5% {
83
+ transform: rotate(135deg);
84
+ }
85
+ 25% {
86
+ transform: rotate(270deg);
87
+ }
88
+ 37.5% {
89
+ transform: rotate(405deg);
90
+ }
91
+ 50% {
92
+ transform: rotate(540deg);
93
+ }
94
+ 62.5% {
95
+ transform: rotate(675deg);
96
+ }
97
+ 75% {
98
+ transform: rotate(810deg);
99
+ }
100
+ 87.5% {
101
+ transform: rotate(945deg);
102
+ }
103
+ to {
104
+ transform: rotate(1080deg);
105
+ }
106
+ }
107
+
108
+ .gap-patch {
109
+ position: absolute;
110
+ box-sizing: border-box;
111
+ top: 0;
112
+ left: 45%;
113
+ width: 10%;
114
+ height: 100%;
115
+ overflow: hidden;
116
+ border-color: inherit;
117
+ }
118
+
119
+ .gap-patch .circle {
120
+ width: 1000%;
121
+ left: -450%;
122
+ }
123
+
124
+ .circle-clipper {
125
+ display: inline-block;
126
+ position: relative;
127
+ width: 50%;
128
+ height: 100%;
129
+ overflow: hidden;
130
+ border-color: inherit;
131
+ }
132
+
133
+ .circle-clipper .circle {
134
+ width: 200%;
135
+ }
136
+
137
+ .circle {
138
+ box-sizing: border-box;
139
+ height: 100%;
140
+ border-style: solid;
141
+ border-color: inherit;
142
+ border-bottom-color: transparent !important;
143
+ border-radius: 50%;
144
+ animation: none;
145
+ }
146
+
147
+ .circle-clipper.left .circle {
148
+ border-right-color: transparent !important;
149
+ transform: rotate(129deg);
150
+ }
151
+
152
+ .circle-clipper.right .circle {
153
+ left: -100%;
154
+ border-left-color: transparent !important;
155
+ transform: rotate(-129deg);
156
+ }
157
+
158
+ .active .circle-clipper.left .circle {
159
+ animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
160
+ }
161
+
162
+ .active .circle-clipper.right .circle {
163
+ animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
164
+ }
165
+
166
+ @keyframes left-spin {
167
+ from {
168
+ transform: rotate(130deg);
169
+ }
170
+ 50% {
171
+ transform: rotate(-5deg);
172
+ }
173
+ to {
174
+ transform: rotate(130deg);
175
+ }
176
+ }
177
+
178
+ @keyframes right-spin {
179
+ from {
180
+ transform: rotate(-130deg);
181
+ }
182
+ 50% {
183
+ transform: rotate(5deg);
184
+ }
185
+ to {
186
+ transform: rotate(-130deg);
187
+ }
188
+ }
189
+ </style>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div class="wt-loader">
3
+ <wt-loader-sm v-if="size === 'sm'" :color="color"></wt-loader-sm>
4
+ <wt-loader-md v-if="size === 'md'"></wt-loader-md>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import WtLoaderSm from './_internals/wt-loader--sm.vue';
10
+ import WtLoaderMd from './_internals/wt-loader--md.vue';
11
+
12
+ export default {
13
+ name: 'wt-loader',
14
+ components: {
15
+ WtLoaderSm,
16
+ WtLoaderMd,
17
+ },
18
+ props: {
19
+ size: {
20
+ type: String,
21
+ default: 'md',
22
+ description: '["sm", "md"]',
23
+ },
24
+ color: {
25
+ type: String,
26
+ default: 'contrast',
27
+ description: '["main", "contrast"]',
28
+ },
29
+ },
30
+ };
31
+ </script>
32
+
33
+ <style lang="scss" scoped>
34
+ </style>
@@ -0,0 +1,20 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtRoundedAction from '../wt-rounded-action.vue';
3
+ import WtLoader from '../../wt-loader/wt-loader.vue';
4
+
5
+ describe('WtRoundedAction', () => {
6
+ it('renders a component', () => {
7
+ const wrapper = shallowMount(WtRoundedAction, { propsData: { icon: 'call' } });
8
+ expect(wrapper.classes('wt-rounded-action')).toBe(true);
9
+ });
10
+
11
+ it('renders button spinner', () => {
12
+ const wrapper = shallowMount(WtRoundedAction, {
13
+ propsData: {
14
+ icon: 'call',
15
+ loading: true,
16
+ },
17
+ });
18
+ expect(wrapper.findComponent(WtLoader).exists()).toBe(true);
19
+ });
20
+ });
@@ -0,0 +1,227 @@
1
+ <template>
2
+ <button
3
+ class="wt-rounded-action"
4
+ :class="[
5
+ colorClass,
6
+ `wt-rounded-action--${size}`,
7
+ {
8
+ 'wt-rounded-action--disabled': disabled,
9
+ }
10
+ ]"
11
+ type="button"
12
+ :disabled="disabled"
13
+ @click="$emit('click', $event)"
14
+ >
15
+ <wt-loader v-if="loading" size="sm" :color="loaderColor"/>
16
+ <slot v-else>
17
+ <wt-icon
18
+ :icon="icon"
19
+ :color="computeIconColor"
20
+ ></wt-icon>
21
+ </slot>
22
+ </button>
23
+ </template>
24
+
25
+ <script>
26
+ export default {
27
+ name: 'wt-rounded-action',
28
+ props: {
29
+ icon: {
30
+ type: String,
31
+ },
32
+ color: {
33
+ type: String,
34
+ default: '',
35
+ },
36
+ iconColor: {
37
+ type: String,
38
+ default: null,
39
+ },
40
+ size: {
41
+ type: String,
42
+ default: 'md',
43
+ },
44
+ disabled: {
45
+ type: Boolean,
46
+ default: false,
47
+ },
48
+ loading: {
49
+ type: Boolean,
50
+ default: false,
51
+ },
52
+ },
53
+ computed: {
54
+ colorClass() {
55
+ if (!this.disabled) return `${this.color}`;
56
+ return '';
57
+ },
58
+ computeIconColor() {
59
+ if (this.iconColor) return this.iconColor;
60
+ switch (this.colorClass) {
61
+ case 'secondary':
62
+ return 'default';
63
+ case 'success':
64
+ return 'contrast';
65
+ case 'transfer':
66
+ return 'contrast';
67
+ case 'danger':
68
+ return 'contrast';
69
+ default:
70
+ return 'active';
71
+ }
72
+ },
73
+ loaderColor() {
74
+ if (['success', 'transfer', 'danger'].includes(this.color)) return 'main';
75
+ return 'contrast';
76
+ },
77
+ },
78
+ };
79
+ </script>
80
+
81
+ <!--not scoped to change .icon colors-->
82
+ <style lang="scss" scoped>
83
+ .wt-rounded-action {
84
+ position: relative;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ border: var(--rounded-action-border);
89
+ color: var(--rounded-action-dark-font-color);
90
+ background: var(--rounded-action-primary-color);
91
+ border-color: var(--rounded-action-primary-color);
92
+ border-radius: 50%;
93
+ transition: var(--transition);
94
+ cursor: pointer;
95
+
96
+ &--sm {
97
+ width: var(--rounded-action-size--sm);
98
+ height: var(--rounded-action-size--sm);
99
+ }
100
+
101
+ &--md {
102
+ width: var(--rounded-action-size--md);
103
+ height: var(--rounded-action-size--md);
104
+ }
105
+
106
+ &--lg {
107
+ width: var(--rounded-action-size--lg);
108
+ height: var(--rounded-action-size--lg);
109
+ }
110
+
111
+ @media screen and (max-width: 1336px) {
112
+ .wt-icon.sm {
113
+ width: 14px;
114
+ height: 14px;
115
+ }
116
+
117
+ .wt-icon.md {
118
+ width: 20px;
119
+ height: 20px;
120
+ }
121
+
122
+ .wt-icon.lg {
123
+ width: 25px;
124
+ height: 25px;
125
+ }
126
+
127
+ &--sm {
128
+ width: calc(var(--rounded-action-size--sm) * 0.8);
129
+ height: calc(var(--rounded-action-size--sm) * 0.8);
130
+ }
131
+
132
+ &--md {
133
+ width: calc(var(--rounded-action-size--md) * 0.8);
134
+ height: calc(var(--rounded-action-size--md) * 0.8);
135
+ }
136
+
137
+ &--lg {
138
+ width: calc(var(--rounded-action-size--lg) * 0.8);
139
+ height: calc(var(--rounded-action-size--lg) * 0.8);
140
+ }
141
+ }
142
+
143
+ &--disabled {
144
+ color: var(--text--disabled-color);
145
+ background: var(--rounded-action-disabled-bg-color);
146
+ border-color: var(--disabled-color);
147
+ cursor: auto;
148
+ pointer-events: none;
149
+
150
+ .wt-icon ::v-deep .wt-icon__icon {
151
+ fill: var(--icon-color-disabled);
152
+ }
153
+ }
154
+
155
+ &:hover {
156
+ background: var(--rounded-action-primary--hover-color);
157
+ border-color: var(--rounded-action-primary--hover-color);
158
+ }
159
+
160
+ &.active,
161
+ &:active {
162
+ background: var(--rounded-action-primary--hover-color);
163
+ border-color: var(--rounded-action-primary--hover-color);
164
+ }
165
+
166
+ &.secondary {
167
+ border-color: var(--rounded-action-secondary-color);
168
+ background: var(--rounded-action-secondary-bg-color);
169
+
170
+ &:hover{
171
+ border-color: var(--rounded-action-secondary--hover-color);
172
+ background: var(--rounded-action-secondary-bg-color);
173
+
174
+ .wt-icon ::v-deep .wt-icon__icon {
175
+ fill: var(--icon-color--hover);
176
+ }
177
+ }
178
+
179
+ &.active,
180
+ &:active {
181
+ color: var(--text-primary-color);
182
+ border-color: var(--rounded-action-secondary--active-color);
183
+ background: var(--rounded-action-secondary-bg-color);
184
+
185
+ .wt-icon ::v-deep .wt-icon__icon {
186
+ fill: var(--icon-color-active);
187
+ }
188
+ }
189
+ }
190
+
191
+ &.success {
192
+ color: var(--text-contrast-color);
193
+ background: var(--rounded-action-true-color);
194
+ border-color: var(--rounded-action-true-color);
195
+
196
+ &:hover,
197
+ &:active {
198
+ background: var(--rounded-action-true--hover-color);
199
+ border-color: var(--rounded-action-true--hover-color);
200
+ }
201
+ }
202
+
203
+ &.transfer {
204
+ color: var(--text-contrast-color);
205
+ background: var(--rounded-action-transfer-color);
206
+ border-color: var(--rounded-action-transfer-color);
207
+
208
+ &:hover,
209
+ &:active {
210
+ background: var(--rounded-action-transfer--hover-color);
211
+ border-color: var(--rounded-action-transfer--hover-color);
212
+ }
213
+ }
214
+
215
+ &.danger {
216
+ color: var(--text-contrast-color);
217
+ background: var(--rounded-action-false-color);
218
+ border-color: var(--rounded-action-false-color);
219
+
220
+ &:hover,
221
+ &:active {
222
+ background: var(--rounded-action-false--hover-color);
223
+ border-color: var(--rounded-action-false--hover-color);
224
+ }
225
+ }
226
+ }
227
+ </style>