@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,316 @@
1
+ <template>
2
+ <div
3
+ class="wt-input"
4
+ :class="{
5
+ 'wt-input--outline': outline,
6
+ 'wt-input--disabled': disabled,
7
+ 'wt-input--invalid': invalid,
8
+ }"
9
+ >
10
+ <wt-label
11
+ v-if="hasLabel"
12
+ :for="name"
13
+ :outline="outline"
14
+ :disabled="disabled"
15
+ :invalid="invalid"
16
+ v-bind="labelProps"
17
+ >
18
+ <!-- @slot Custom input label -->
19
+ <slot name="label" v-bind="{ label }">{{ requiredLabel }}</slot>
20
+ </wt-label>
21
+ <div class="wt-input__wrapper">
22
+ <input
23
+ :id="name"
24
+ class="wt-input__input"
25
+ :class="{
26
+ 'wt-input--is-password': isPassword,
27
+ }"
28
+ :value="value"
29
+ :type="inputType"
30
+ :placeholder="placeholder || label"
31
+ :disabled="disabled"
32
+ :min="numberMin"
33
+ :max="numberMax"
34
+ v-on="listeners"
35
+ >
36
+ <slot
37
+ v-if="isPassword"
38
+ name="show-password"
39
+ v-bind="{
40
+ isPasswordVisible,
41
+ switchVisibilityPassword,
42
+ }"
43
+ >
44
+ <wt-icon-btn
45
+ class="wt-input__password-button"
46
+ :icon="showPasswordIcon"
47
+ @click.native="switchVisibilityPassword"
48
+ ></wt-icon-btn>
49
+ </slot>
50
+ </div>
51
+ <wt-input-info
52
+ v-if="isValidation"
53
+ :invalid="invalid"
54
+ >{{ validationText }}
55
+ </wt-input-info>
56
+ </div>
57
+ </template>
58
+
59
+ <script>
60
+ import validationMixin from '../../../mixins/validationMixin/validationMixin';
61
+
62
+ export default {
63
+ name: 'wt-input',
64
+ mixins: [validationMixin],
65
+ props: {
66
+ /**
67
+ * Current input value (`v-model`)
68
+ */
69
+ value: {
70
+ type: [String, Number],
71
+ default: '',
72
+ },
73
+ /**
74
+ * Form input label
75
+ */
76
+ label: {
77
+ type: String,
78
+ default: '',
79
+ },
80
+ /**
81
+ * Form input placeholder
82
+ */
83
+ placeholder: {
84
+ type: String,
85
+ },
86
+ /**
87
+ * Form input name
88
+ */
89
+ name: {
90
+ type: String,
91
+ default: '',
92
+ },
93
+ /**
94
+ * Form input type
95
+ */
96
+ type: {
97
+ type: String,
98
+ default: 'text',
99
+ },
100
+ /**
101
+ * Native input required attribute
102
+ */
103
+ required: {
104
+ type: Boolean,
105
+ default: false,
106
+ description: 'Native input required attribute',
107
+ },
108
+ /**
109
+ * Native input disabled attribute
110
+ */
111
+ disabled: {
112
+ type: Boolean,
113
+ default: false,
114
+ description: 'Native input disabled attribute',
115
+ },
116
+ /**
117
+ * Status of show password icon display
118
+ */
119
+ hasShowPassword: {
120
+ type: Boolean,
121
+ default: false,
122
+ },
123
+
124
+ /**
125
+ * Native number input restrictions
126
+ */
127
+ numberMin: {
128
+ type: Number,
129
+ default: 0,
130
+ },
131
+
132
+ /**
133
+ * Native number input restrictions
134
+ */
135
+ numberMax: {
136
+ type: Number,
137
+ },
138
+
139
+ outline: {
140
+ type: Boolean,
141
+ default: false,
142
+ },
143
+
144
+ labelProps: {
145
+ type: Object,
146
+ description: 'Object with props, passed down to wt-label as props',
147
+ },
148
+ },
149
+
150
+ data: () => ({
151
+ inputType: '',
152
+ isPasswordVisible: false,
153
+ }),
154
+
155
+ watch: {
156
+ type: {
157
+ immediate: true,
158
+ handler(type) {
159
+ let inputType = type;
160
+ // Safari has bug for number input
161
+ if (typeof window !== 'undefined' || typeof document !== 'undefined') {
162
+ const ua = navigator.userAgent.toLocaleLowerCase();
163
+ if (
164
+ ua.indexOf('safari') !== -1
165
+ && ua.indexOf('chrome') === -1
166
+ && type === 'number'
167
+ ) {
168
+ this.isNumberTypeSafari = true;
169
+ inputType = 'text';
170
+ }
171
+ }
172
+ this.inputType = inputType;
173
+ },
174
+ },
175
+ },
176
+
177
+ computed: {
178
+ hasLabel() {
179
+ return !!(this.label || this.$slots.label);
180
+ },
181
+
182
+ requiredLabel() {
183
+ return this.required ? `${this.label}*` : this.label;
184
+ },
185
+
186
+ isPassword() {
187
+ return this.type === 'password' && this.hasShowPassword;
188
+ },
189
+
190
+ showPasswordIcon() {
191
+ return this.isPasswordVisible ? 'eye-closed' : 'eye-opened';
192
+ },
193
+
194
+ listeners() {
195
+ return {
196
+ ...this.$listeners,
197
+ input: this.inputHandler,
198
+ };
199
+ },
200
+ },
201
+ methods: {
202
+ inputHandler(event) {
203
+ this.$emit('input', event.target.value.trim());
204
+ },
205
+
206
+ switchVisibilityPassword() {
207
+ this.isPasswordVisible = !this.isPasswordVisible;
208
+ this.inputType = this.isPasswordVisible ? 'text' : 'password';
209
+ },
210
+ },
211
+ };
212
+ </script>
213
+
214
+ <style lang="scss" scoped>
215
+ .wt-input {
216
+ cursor: text;
217
+
218
+ &--disabled {
219
+ pointer-events: none;
220
+ }
221
+ }
222
+
223
+ .wt-input__wrapper {
224
+ position: relative;
225
+ }
226
+
227
+ .wt-label {
228
+ margin-bottom: var(--label-margin);
229
+ cursor: text;
230
+
231
+ .wt-input:hover &,
232
+ .wt-input:focus-within & {
233
+ color: var(--form-label--hover-color);
234
+ }
235
+
236
+ .wt-input--invalid:hover &,
237
+ .wt-input--invalid:focus-within & {
238
+ color: var(--label--invalid-color);
239
+ }
240
+ }
241
+
242
+ .wt-input__input {
243
+ @extend %typo-body-lg;
244
+
245
+ display: block;
246
+ width: 100%;
247
+ box-sizing: border-box;
248
+ padding: var(--input-padding);
249
+ color: var(--form-input-color);
250
+ border: var(--input-border);
251
+ border-color: var(--form-border-color);
252
+ border-radius: var(--border-radius);
253
+ transition: var(--transition);
254
+
255
+ &::placeholder {
256
+ color: var(--form-placeholder-color);
257
+ }
258
+
259
+ .wt-input:hover &,
260
+ &:focus {
261
+ border-color: var(--form-border--hover-color);
262
+
263
+ &::placeholder {
264
+ color: var(--form-placeholder--hover-color)
265
+ }
266
+ }
267
+
268
+ .wt-input--outline & {
269
+ border-color: var(--form-outline-border-color);
270
+
271
+ &::placeholder {
272
+ color: var(--form-outline-placeholder-color);
273
+ }
274
+ }
275
+
276
+ .wt-input--outline:hover &,
277
+ .wt-input--outline &:focus {
278
+ border-color: var(--form-outline-border--hover-color);
279
+
280
+ &::placeholder {
281
+ color: var(--form-outline-placeholder--hover-color)
282
+ }
283
+ }
284
+
285
+ .wt-input--invalid &,
286
+ .wt-input--invalid:hover & {
287
+ border-color: var(--false-color);
288
+ outline: none; // prevent outline overlapping false color
289
+ }
290
+
291
+ .wt-input--disabled & {
292
+ background: var(--form-border--disabled-color);
293
+ border-color: var(--form-border--disabled-color);
294
+
295
+ &::placeholder {
296
+ color: var(--form-placeholder--disabled-color);
297
+ }
298
+ }
299
+ }
300
+
301
+ .wt-input__password-button {
302
+ position: absolute;
303
+ top: 50%;
304
+ right: var(--input-icon-margin);
305
+ transform: translateY(-50%);
306
+
307
+ .wt-input--disabled & ::v-deep .wt-icon__icon {
308
+ fill: var(--icon-color-disabled);
309
+ }
310
+
311
+ .wt-input:hover & ::v-deep .wt-icon__icon,
312
+ .wt-input:focus-within & ::v-deep .wt-icon__icon {
313
+ fill: var(--icon-color--hover);
314
+ }
315
+ }
316
+ </style>
@@ -0,0 +1,9 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtLabel from '../wt-label.vue';
3
+
4
+ describe('WtLabel', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtLabel);
7
+ expect(wrapper.classes('wt-label')).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <label
3
+ class="wt-label"
4
+ :class="{
5
+ 'wt-label--outline': outline,
6
+ 'wt-label--invalid': invalid,
7
+ 'wt-label--disabled': disabled,
8
+ }"
9
+ :for="this.for"
10
+ >
11
+ <slot></slot>
12
+ <wt-icon-btn
13
+ v-if="hint"
14
+ class="wt-label__hint"
15
+ icon="rounded-info"
16
+ color="outline"
17
+ :tooltip="hint"
18
+ :tooltip-position="hintPosition"
19
+ ></wt-icon-btn>
20
+ </label>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ name: 'wt-label',
26
+ props: {
27
+ for: {
28
+ type: String,
29
+ },
30
+ disabled: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+ outline: {
35
+ type: Boolean,
36
+ default: false,
37
+ },
38
+ invalid: {
39
+ type: Boolean,
40
+ default: false,
41
+ },
42
+ hint: {
43
+ type: String,
44
+ description: 'Adds hint icon + tooltip with text, passed as "hint" prop',
45
+ },
46
+ hintPosition: {
47
+ type: String,
48
+ description: 'See wt-icon-btn tooltip-position prop',
49
+ },
50
+ },
51
+ };
52
+ </script>
53
+
54
+ <style lang="scss" scoped>
55
+ .wt-label {
56
+ @extend %typo-body-lg;
57
+
58
+ display: flex;
59
+ align-items: center;
60
+ color: var(--form-label-color);
61
+ transition: var(--transition);
62
+
63
+ &--outline {
64
+ color: var(--form-outline-label-color);
65
+ }
66
+
67
+ &--invalid {
68
+ color: var(--label--invalid-color);
69
+ }
70
+
71
+ &--disabled {
72
+ color: var(--form-label--disabled-color);
73
+ }
74
+ }
75
+
76
+ .wt-label__hint {
77
+ margin-left: var(--component-spacing);
78
+ ::v-deep {
79
+ .wt-tooltip {
80
+ width: max-content; // experimental css property
81
+ width: -moz-max-content; // experimental css property
82
+ min-width: 120px;
83
+ max-width: 280px;
84
+ }
85
+ }
86
+ }
87
+ </style>
@@ -0,0 +1,21 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtNotification from '../wt-notification.vue';
3
+ import WtIcon from '../../../atoms/wt-icon/wt-icon.vue';
4
+
5
+ describe('WtNotification', () => {
6
+ it('renders a component', () => {
7
+ const wrapper = shallowMount(WtNotification, {
8
+ stubs: { WtIcon },
9
+ });
10
+ expect(wrapper.classes('wt-notification')).toBe(true);
11
+ });
12
+
13
+ it('renders message via default slot', () => {
14
+ const content = 'Hello there';
15
+ const wrapper = shallowMount(WtNotification, {
16
+ stubs: { WtIcon },
17
+ slots: { default: content },
18
+ });
19
+ expect(wrapper.find('.wt-notification__text').text()).toBe(content);
20
+ });
21
+ });
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <article
3
+ class="wt-notification"
4
+ @click="$emit('close')"
5
+ >
6
+ <wt-icon
7
+ class="wt-notification__icon"
8
+ :icon="notificationIcon"
9
+ :color="notificationIconColor"
10
+ ></wt-icon>
11
+
12
+ <p class="wt-notification__text">
13
+ <slot></slot>
14
+ </p>
15
+ </article>
16
+ </template>
17
+
18
+ <script>
19
+
20
+ export default {
21
+ name: 'wt-notification',
22
+ props: {
23
+ type: {
24
+ type: String,
25
+ default: 'info',
26
+ },
27
+ },
28
+ computed: {
29
+ notificationIcon() {
30
+ switch (this.type) {
31
+ case 'info': return 'rounded-tick';
32
+ case 'error': return 'attention';
33
+ default: return '';
34
+ }
35
+ },
36
+ notificationIconColor() {
37
+ switch (this.type) {
38
+ case 'info': return 'true';
39
+ case 'error': return 'false';
40
+ default: return '';
41
+ }
42
+ },
43
+ },
44
+ };
45
+ </script>
46
+
47
+ <style lang="scss" scoped>
48
+ .wt-notification {
49
+ @extend %typo-body-lg;
50
+ @include width-fit-content;
51
+
52
+ position: relative;
53
+ display: flex;
54
+ align-items: flex-start;
55
+ min-width: var(--notification-min-width);
56
+ max-width: var(--notification-max-width);
57
+ padding: var(--notification-padding);
58
+ color: var(--notification-text-color);
59
+ background: var(--notification-bg-color);
60
+ border-radius: var(--border-radius);
61
+ box-shadow: var(--box-shadow);
62
+ cursor: pointer;
63
+ }
64
+
65
+ .wt-notification__icon {
66
+ margin-right: var(--notification-icon-margin);
67
+ }
68
+
69
+ .wt-notification__text {
70
+ flex-grow: 1;
71
+ align-self: center;
72
+ margin: 0;
73
+ }
74
+ </style>
@@ -0,0 +1,47 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtPopup from '../wt-popup.vue';
3
+
4
+ describe('WtPopup', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtPopup, {
7
+ stubs: { WtIconBtn: true },
8
+ });
9
+ expect(wrapper.classes('wt-popup')).toBe(true);
10
+ });
11
+
12
+ it('renders popup header via header slot', () => {
13
+ const content = 'Popup header';
14
+ const wrapper = shallowMount(WtPopup, {
15
+ stubs: { WtIconBtn: true },
16
+ slots: { header: content },
17
+ });
18
+ expect(wrapper.find('.wt-popup__header').text()).toBe(content);
19
+ });
20
+
21
+ it('renders popup header via title slot', () => {
22
+ const content = 'Popup title';
23
+ const wrapper = shallowMount(WtPopup, {
24
+ stubs: { WtIconBtn: true },
25
+ slots: { title: content },
26
+ });
27
+ expect(wrapper.find('.wt-popup__header__title').text()).toBe(content);
28
+ });
29
+
30
+ it('renders popup main via main slot', () => {
31
+ const content = 'Popup main content';
32
+ const wrapper = shallowMount(WtPopup, {
33
+ stubs: { WtIconBtn: true },
34
+ slots: { main: content },
35
+ });
36
+ expect(wrapper.find('.wt-popup__main').text()).toBe(content);
37
+ });
38
+
39
+ it('renders popup actions via actions slot', () => {
40
+ const content = 'Popup actions';
41
+ const wrapper = shallowMount(WtPopup, {
42
+ stubs: { WtIconBtn: true },
43
+ slots: { actions: content },
44
+ });
45
+ expect(wrapper.find('.wt-popup__actions').text()).toBe(content);
46
+ });
47
+ });
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <div class="wt-popup">
3
+ <div class="wt-popup__shadow"></div>
4
+ <aside
5
+ class="wt-popup__popup"
6
+ :class="{'wt-popup__popup--overflow': overflow}"
7
+ :style="popupStyle"
8
+ >
9
+ <header class="wt-popup__header">
10
+ <slot name="header">
11
+ <h3 class="wt-popup__header__title">
12
+ <slot name="title"></slot>
13
+ </h3>
14
+ </slot>
15
+ <wt-icon-btn
16
+ class="wt-popup__close-btn"
17
+ icon="remove-rounded"
18
+ size="sm"
19
+ color="active"
20
+ @click.native="$emit('close')"
21
+ ></wt-icon-btn>
22
+ </header>
23
+ <section class="wt-popup__main" v-if="$slots.main">
24
+ <slot name="main"></slot>
25
+ </section>
26
+ <footer class="wt-popup__actions" v-if="$slots.actions">
27
+ <slot name="actions"></slot>
28
+ </footer>
29
+ </aside>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+ name: 'wt-popup',
36
+ props: {
37
+ minWidth: {
38
+ type: [Number, String],
39
+ },
40
+ overflow: {
41
+ type: Boolean,
42
+ default: false,
43
+ },
44
+ },
45
+ computed: {
46
+ popupStyle() {
47
+ return this.minWidth ? `min-width: ${this.minWidth}px;` : '';
48
+ },
49
+ },
50
+ };
51
+ </script>
52
+
53
+ <style lang="scss" scoped>
54
+ .wt-popup {
55
+ position: fixed;
56
+ top: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ left: 0;
60
+ z-index: var(--popup-wrapper-z-index);
61
+
62
+ &__shadow {
63
+ position: absolute;
64
+ top: 0;
65
+ right: 0;
66
+ bottom: 0;
67
+ left: 0;
68
+ background: var(--main-primary-accent-color);
69
+ opacity: var(--popup-shadow-opacity);
70
+ z-index: 0;
71
+ }
72
+ }
73
+
74
+ .wt-popup__popup {
75
+ @extend %wt-scrollbar;
76
+
77
+ position: absolute;
78
+ top: 50%;
79
+ left: 50%;
80
+ max-height: var(--popup-max-height);
81
+ padding: var(--popup-padding);
82
+ background: var(--popup-bg-color);
83
+ transform: translate(-50%, -50%);
84
+ border-radius: var(--border-radius);
85
+ box-shadow: var(--box-shadow);
86
+ overflow-y: auto;
87
+ z-index: 1;
88
+
89
+ &--overflow {
90
+ overflow: visible;
91
+ }
92
+ }
93
+
94
+ .wt-popup__header {
95
+ position: relative;
96
+ padding: var(--popup-header-padding);
97
+
98
+ .wt-popup__header__title {
99
+ @extend %typo-strong-lg;
100
+ text-align: center;
101
+ padding: var(--popup-header-title-padding);
102
+ }
103
+
104
+ .wt-popup__close-btn {
105
+ position: absolute;
106
+ top: 0;
107
+ right: 0;
108
+ }
109
+ }
110
+
111
+ .wt-popup__main {
112
+ @extend %typo-body-lg;
113
+ padding: var(--popup-main-padding);
114
+ }
115
+
116
+ .wt-popup__actions {
117
+ display: flex;
118
+ justify-content: center;
119
+ align-items: center;
120
+ padding: var(--popup-actions-padding);
121
+
122
+ .wt-button {
123
+ margin-left: 20px;
124
+
125
+ &:first-child {
126
+ margin-left: 0;
127
+ }
128
+ }
129
+ }
130
+ </style>
@@ -0,0 +1,17 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtProgressBar from '../wt-progress-bar.vue';
3
+
4
+ describe('WtProgressBar', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtProgressBar);
7
+ expect(wrapper.exists()).toBe(true);
8
+ });
9
+ it('isOverflow correctly computes overflow=true', () => {
10
+ const wrapper = shallowMount(WtProgressBar, { propsData: { value: 2, max: 1 } });
11
+ expect(wrapper.vm.isOverflow).toBe(true);
12
+ });
13
+ it('isOverflow correctly computes overflow=false', () => {
14
+ const wrapper = shallowMount(WtProgressBar, { propsData: { value: 0.99, max: 1 } });
15
+ expect(wrapper.vm.isOverflow).toBe(false);
16
+ });
17
+ });