@webitel/ui-sdk 0.1.3 → 0.1.4-vite

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 (621) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +29 -29
  3. package/dist/demo.html +1 -10
  4. package/dist/img/plyr.svg +68 -0
  5. package/dist/img/sprite/account.svg +4 -0
  6. package/dist/img/sprite/adfs.svg +5 -0
  7. package/dist/img/sprite/app-navigator.svg +11 -0
  8. package/dist/img/sprite/arrow-down.svg +3 -0
  9. package/dist/img/sprite/arrow-left.svg +3 -0
  10. package/dist/img/sprite/arrow-mix.svg +5 -0
  11. package/dist/img/sprite/arrow-right.svg +3 -0
  12. package/dist/img/sprite/arrow-up.svg +3 -0
  13. package/dist/img/sprite/attach.svg +3 -0
  14. package/dist/img/sprite/attention.svg +3 -0
  15. package/dist/img/sprite/azure.svg +19 -0
  16. package/dist/img/sprite/back.svg +4 -0
  17. package/dist/img/sprite/bell-badged.svg +4 -0
  18. package/dist/img/sprite/bell.svg +3 -0
  19. package/dist/img/sprite/bucket.svg +3 -0
  20. package/dist/img/sprite/calendar.svg +3 -0
  21. package/dist/img/sprite/call--filled.svg +3 -0
  22. package/dist/img/sprite/call-add-to--filled.svg +4 -0
  23. package/dist/img/sprite/call-add-to.svg +4 -0
  24. package/dist/img/sprite/call-disconnect--filled.svg +3 -0
  25. package/dist/img/sprite/call-disconnect.svg +3 -0
  26. package/dist/img/sprite/call-end--filled.svg +3 -0
  27. package/dist/img/sprite/call-end.svg +3 -0
  28. package/dist/img/sprite/call-inbound--filled.svg +4 -0
  29. package/dist/img/sprite/call-inbound.svg +3 -0
  30. package/dist/img/sprite/call-missed--filled.svg +4 -0
  31. package/dist/img/sprite/call-missed.svg +3 -0
  32. package/dist/img/sprite/call-outbound--filled.svg +3 -0
  33. package/dist/img/sprite/call-outbound.svg +3 -0
  34. package/dist/img/sprite/call-ringing--filled.svg +5 -0
  35. package/dist/img/sprite/call-ringing.svg +3 -0
  36. package/dist/img/sprite/call-transfer--filled.svg +4 -0
  37. package/dist/img/sprite/call-transfer.svg +3 -0
  38. package/dist/img/sprite/call.svg +3 -0
  39. package/dist/img/sprite/chat--filled.svg +3 -0
  40. package/dist/img/sprite/chat-emoji.svg +3 -0
  41. package/dist/img/sprite/chat-end--filled.svg +3 -0
  42. package/dist/img/sprite/chat-end.svg +4 -0
  43. package/dist/img/sprite/chat-group.svg +5 -0
  44. package/dist/img/sprite/chat-join.svg +4 -0
  45. package/dist/img/sprite/chat-message-status-read.svg +3 -0
  46. package/dist/img/sprite/chat-message-status-sent.svg +3 -0
  47. package/dist/img/sprite/chat-quick-response--filled.svg +3 -0
  48. package/dist/img/sprite/chat-quick-response.svg +3 -0
  49. package/dist/img/sprite/chat-reply.svg +3 -0
  50. package/dist/img/sprite/chat-send.svg +6 -0
  51. package/dist/img/sprite/chat-transfer--filled.svg +3 -0
  52. package/dist/img/sprite/chat-transfer.svg +4 -0
  53. package/dist/img/sprite/chat.svg +3 -0
  54. package/dist/img/sprite/checkbox--checked--filled.svg +3 -0
  55. package/dist/img/sprite/checkbox--checked.svg +3 -0
  56. package/dist/img/sprite/checkbox.svg +3 -0
  57. package/dist/img/sprite/clear.svg +3 -0
  58. package/dist/img/sprite/close--filled.svg +3 -0
  59. package/dist/img/sprite/close.svg +3 -0
  60. package/dist/img/sprite/collapse.svg +5 -0
  61. package/dist/img/sprite/column-select.svg +4 -0
  62. package/dist/img/sprite/conference.svg +8 -0
  63. package/dist/img/sprite/contacts.svg +3 -0
  64. package/dist/img/sprite/copy.svg +3 -0
  65. package/dist/img/sprite/docs.svg +6 -0
  66. package/dist/img/sprite/done.svg +4 -0
  67. package/dist/img/sprite/download.svg +5 -0
  68. package/dist/img/sprite/edit.svg +3 -0
  69. package/dist/img/sprite/email.svg +3 -0
  70. package/dist/img/sprite/expand.svg +5 -0
  71. package/dist/img/sprite/eye--closed.svg +5 -0
  72. package/dist/img/sprite/eye--opened.svg +4 -0
  73. package/dist/img/sprite/filter.svg +5 -0
  74. package/dist/img/sprite/generate.svg +4 -0
  75. package/dist/img/sprite/google.svg +6 -0
  76. package/dist/img/sprite/history.svg +4 -0
  77. package/dist/img/sprite/hold.svg +3 -0
  78. package/dist/img/sprite/idle.svg +4 -0
  79. package/dist/img/sprite/index.js +1 -0
  80. package/dist/img/sprite/instagram.svg +28 -0
  81. package/dist/img/sprite/job--accept.svg +4 -0
  82. package/dist/img/sprite/job--end.svg +4 -0
  83. package/dist/img/sprite/job.svg +5 -0
  84. package/dist/img/sprite/lock.svg +3 -0
  85. package/dist/img/sprite/logout.svg +3 -0
  86. package/dist/img/sprite/mail--color.svg +4 -0
  87. package/dist/img/sprite/mail.svg +3 -0
  88. package/dist/img/sprite/menu.svg +3 -0
  89. package/dist/img/sprite/messenger-facebook--filled.svg +3 -0
  90. package/dist/img/sprite/messenger-facebook.svg +9 -0
  91. package/dist/img/sprite/messenger-infobip.svg +5 -0
  92. package/dist/img/sprite/messenger-messenger.svg +12 -0
  93. package/dist/img/sprite/messenger-telegram--filled.svg +3 -0
  94. package/dist/img/sprite/messenger-telegram.svg +10 -0
  95. package/dist/img/sprite/messenger-viber--filled.svg +3 -0
  96. package/dist/img/sprite/messenger-viber.svg +3 -0
  97. package/dist/img/sprite/messenger-web-chat.svg +7 -0
  98. package/dist/img/sprite/messenger-whatsapp--filled.svg +4 -0
  99. package/dist/img/sprite/messenger-whatsapp.svg +10 -0
  100. package/dist/img/sprite/meta.svg +17 -0
  101. package/dist/img/sprite/mic-muted.svg +6 -0
  102. package/dist/img/sprite/mic.svg +4 -0
  103. package/dist/img/sprite/move.svg +6 -0
  104. package/dist/img/sprite/note.svg +3 -0
  105. package/dist/img/sprite/numpad.svg +24 -0
  106. package/dist/img/sprite/options.svg +5 -0
  107. package/dist/img/sprite/pause.svg +3 -0
  108. package/dist/img/sprite/pin.svg +3 -0
  109. package/dist/img/sprite/play.svg +4 -0
  110. package/dist/img/sprite/plus.svg +3 -0
  111. package/dist/img/sprite/preview-tag-application.svg +6 -0
  112. package/dist/img/sprite/preview-tag-audio.svg +4 -0
  113. package/dist/img/sprite/preview-tag-image.svg +4 -0
  114. package/dist/img/sprite/preview-tag-video.svg +4 -0
  115. package/dist/img/sprite/prompter.svg +3 -0
  116. package/dist/img/sprite/queue-member.svg +3 -0
  117. package/dist/img/sprite/radio--checked.svg +4 -0
  118. package/dist/img/sprite/radio.svg +3 -0
  119. package/dist/img/sprite/rec-off.svg +3 -0
  120. package/dist/img/sprite/rec.svg +4 -0
  121. package/dist/img/sprite/refresh.svg +4 -0
  122. package/dist/img/sprite/role.svg +3 -0
  123. package/dist/img/sprite/rounded-info.svg +3 -0
  124. package/dist/img/sprite/scorecard.svg +4 -0
  125. package/dist/img/sprite/search.svg +3 -0
  126. package/dist/img/sprite/send-arrow.svg +4 -0
  127. package/dist/img/sprite/settings.svg +3 -0
  128. package/dist/img/sprite/sort-arrow-down.svg +4 -0
  129. package/dist/img/sprite/sort-arrow-up.svg +4 -0
  130. package/dist/img/sprite/sound-off.svg +4 -0
  131. package/dist/img/sprite/sound-on.svg +3 -0
  132. package/dist/img/sprite/star--filled.svg +3 -0
  133. package/dist/img/sprite/star.svg +3 -0
  134. package/dist/img/sprite/stop.svg +4 -0
  135. package/dist/img/sprite/stt-download.svg +4 -0
  136. package/dist/img/sprite/stt-search.svg +3 -0
  137. package/dist/img/sprite/stt.svg +4 -0
  138. package/dist/img/sprite/telegram-bot.svg +6 -0
  139. package/dist/img/sprite/tick.svg +3 -0
  140. package/dist/img/sprite/tts-download.svg +5 -0
  141. package/dist/img/sprite/unpin.svg +5 -0
  142. package/dist/img/sprite/upload.svg +5 -0
  143. package/dist/img/sprite/user.svg +3 -0
  144. package/dist/img/sprite/video-cam-off.svg +4 -0
  145. package/dist/img/sprite/video-cam.svg +3 -0
  146. package/dist/img/sprite/zoom-in.svg +3 -0
  147. package/dist/img/sprite/zoom-out.svg +4 -0
  148. package/dist/ui-sdk.common.js +43300 -0
  149. package/dist/ui-sdk.common.js.map +1 -0
  150. package/dist/ui-sdk.css +1 -0
  151. package/dist/ui-sdk.umd.js +43319 -0
  152. package/dist/ui-sdk.umd.js.map +1 -0
  153. package/dist/ui-sdk.umd.min.js +35 -0
  154. package/dist/ui-sdk.umd.min.js.map +1 -0
  155. package/package.json +95 -45
  156. package/src/api/axios/generateInstance.js +25 -0
  157. package/src/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.js +6 -0
  158. package/src/api/defaults/getDefaultGetParams/getDefaultGetParams.js +9 -0
  159. package/src/api/defaults/index.js +7 -0
  160. package/src/api/interceptors/request/updateToken.interceptor.js +10 -0
  161. package/src/api/interceptors/response/handleUnauthorized.interceptor.js +12 -0
  162. package/src/api/transformers/applyTransform.js +8 -0
  163. package/src/api/transformers/camelToSnake/camelToSnake.transformer.js +4 -0
  164. package/src/api/transformers/generateUrl/generateUrl.transformer.js +13 -0
  165. package/src/api/transformers/index.js +23 -0
  166. package/src/api/transformers/log/log.transformer.js +6 -0
  167. package/src/api/transformers/merge/merge.transformer.js +5 -0
  168. package/src/api/transformers/mergeEach/mergeEach.transformer.js +8 -0
  169. package/src/api/transformers/notify/notify.transformer.js +32 -0
  170. package/src/api/transformers/sanitize/sanitize.transformer.js +12 -0
  171. package/src/api/transformers/snakeToCamel/snakeToCamel.transformer.js +4 -0
  172. package/src/api/transformers/starToSearch/starToSearch.transformer.js +12 -0
  173. package/src/components/index.js +91 -33
  174. package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +25 -0
  175. package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +48 -0
  176. package/src/components/transitions/__tests__/ExpandTransition.spec.js +9 -0
  177. package/src/components/transitions/wt-expand-transition.vue +72 -0
  178. package/src/components/wt-app-header/__tests__/WtAppHeader.spec.js +19 -0
  179. package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +23 -0
  180. package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +21 -0
  181. package/src/components/wt-app-header/_variables.scss +25 -0
  182. package/src/components/wt-app-header/wt-app-header.vue +29 -0
  183. package/src/components/wt-app-header/wt-app-navigator.vue +278 -0
  184. package/src/components/wt-app-header/wt-header-actions.vue +183 -0
  185. package/src/components/wt-avatar/__tests__/wt-avatar.spec.js +9 -0
  186. package/src/components/wt-avatar/_variables.scss +32 -0
  187. package/src/components/wt-avatar/wt-avatar.vue +187 -0
  188. package/src/components/wt-badge/__tests__/wt-badge.spec.js +9 -0
  189. package/src/components/wt-badge/_variables.scss +3 -0
  190. package/src/components/wt-badge/wt-badge.vue +59 -0
  191. package/src/components/wt-button/Readme.md +23 -0
  192. package/src/components/wt-button/__tests__/WtButton.spec.js +29 -0
  193. package/src/components/wt-button/_variables.scss +41 -0
  194. package/src/components/wt-button/wt-button.vue +205 -0
  195. package/src/components/wt-button-select/Readme.md +13 -0
  196. package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +40 -0
  197. package/src/components/wt-button-select/_variables.scss +7 -0
  198. package/src/components/wt-button-select/wt-button-select.vue +130 -0
  199. package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +41 -0
  200. package/src/components/wt-checkbox/_variables.scss +4 -0
  201. package/src/components/wt-checkbox/wt-checkbox.vue +191 -0
  202. package/src/components/wt-chip/__tests__/WtChip.spec.js +19 -0
  203. package/src/components/wt-chip/_variables.scss +7 -0
  204. package/src/components/wt-chip/wt-chip.scss +41 -0
  205. package/src/components/wt-chip/wt-chip.vue +24 -0
  206. package/src/components/wt-context-menu/__tests__/WtContextMenu.spec.js +9 -0
  207. package/src/components/wt-context-menu/_variables.scss +9 -0
  208. package/src/components/wt-context-menu/wt-context-menu.vue +131 -0
  209. package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +14 -0
  210. package/src/components/wt-copy-action/wt-copy-action.vue +63 -0
  211. package/src/components/wt-datepicker/__tests__/WtDatepicker.spec.js +28 -0
  212. package/src/components/wt-datepicker/_variables.scss +56 -0
  213. package/src/components/wt-datepicker/wt-datepicker.vue +240 -0
  214. package/src/components/wt-divider/__tests__/WtDivider.spec.js +9 -0
  215. package/src/components/wt-divider/_variables.scss +5 -0
  216. package/src/components/wt-divider/wt-divider.vue +30 -0
  217. package/src/components/wt-dummy/__tests__/WtDummy.spec.js +9 -0
  218. package/src/components/wt-dummy/wt-dummy.vue +73 -0
  219. package/src/components/wt-error-page/__tests__/wt-error-page.spec.js +17 -0
  220. package/src/components/wt-error-page/wt-error-page.vue +104 -0
  221. package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +9 -0
  222. package/src/components/wt-expansion-panel/wt-expansion-panel.vue +67 -0
  223. package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +24 -0
  224. package/src/components/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +146 -0
  225. package/src/components/wt-headline/__tests__/WtHeadline.spec.js +47 -0
  226. package/src/components/wt-headline/_variables.scss +6 -0
  227. package/src/components/wt-headline/wt-headline.vue +50 -0
  228. package/src/components/wt-headline-nav/Readme.md +9 -0
  229. package/src/components/wt-headline-nav/__tests__/wt-headline-nav.spec.js +13 -0
  230. package/src/components/wt-headline-nav/_variables.scss +8 -0
  231. package/src/components/wt-headline-nav/wt-headline-nav.vue +97 -0
  232. package/src/components/wt-hint/__tests__/WtHint.spec.js +9 -0
  233. package/src/components/wt-hint/wt-hint.vue +27 -0
  234. package/src/components/wt-icon/Readme.md +327 -0
  235. package/src/components/wt-icon/__tests__/WtIcon.spec.js +24 -0
  236. package/src/components/wt-icon/_variables.scss +31 -0
  237. package/src/components/wt-icon/docs/cleanup-svg-fill-none.png +0 -0
  238. package/src/components/wt-icon/docs/cleanup-svg-fill.png +0 -0
  239. package/src/components/wt-icon/docs/cleanup-svg-viewbox-correct.png +0 -0
  240. package/src/components/wt-icon/docs/cleanup-svg-viewbox-incorrect.png +0 -0
  241. package/src/components/wt-icon/docs/cleanup-svg-width-height.png +0 -0
  242. package/src/components/wt-icon/docs/svg-icon-code-example.png +0 -0
  243. package/src/components/wt-icon/docs/svg-sprite-in-dom.png +0 -0
  244. package/src/components/wt-icon/wt-icon.vue +172 -0
  245. package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +9 -0
  246. package/src/components/wt-icon-action/_internals/__tests__/WtAddIconAction.spec.js +9 -0
  247. package/src/components/wt-icon-action/_internals/__tests__/WtDeleteIconAction.spec.js +9 -0
  248. package/src/components/wt-icon-action/_internals/__tests__/WtDownloadIconAction.spec.js +9 -0
  249. package/src/components/wt-icon-action/_internals/__tests__/WtEditIconAction.spec.js +9 -0
  250. package/src/components/wt-icon-action/_internals/__tests__/WtHistoryIconAction.spec.js +9 -0
  251. package/src/components/wt-icon-action/_internals/__tests__/WtRefreshIconAction.spec.js +9 -0
  252. package/src/components/wt-icon-action/_internals/wt-add-icon-action.vue +27 -0
  253. package/src/components/wt-icon-action/_internals/wt-delete-icon-action.vue +27 -0
  254. package/src/components/wt-icon-action/_internals/wt-download-icon-action.vue +27 -0
  255. package/src/components/wt-icon-action/_internals/wt-edit-icon-action.vue +27 -0
  256. package/src/components/wt-icon-action/_internals/wt-history-icon-action.vue +27 -0
  257. package/src/components/wt-icon-action/_internals/wt-refresh-icon-action.vue +27 -0
  258. package/src/components/wt-icon-action/wt-icon-action.vue +54 -0
  259. package/src/components/wt-icon-btn/Readme.md +10 -0
  260. package/src/components/wt-icon-btn/__tests__/WtIconBtn.spec.js +15 -0
  261. package/src/components/wt-icon-btn/_variables.scss +9 -0
  262. package/src/components/wt-icon-btn/wt-icon-btn.vue +47 -0
  263. package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +29 -0
  264. package/src/components/wt-indicator/_variables.scss +22 -0
  265. package/src/components/wt-indicator/wt-indicator.vue +124 -0
  266. package/src/components/wt-input/__tests__/WtInput.spec.js +25 -0
  267. package/src/components/wt-input/_variables.scss +8 -0
  268. package/src/components/wt-input/wt-input.vue +343 -0
  269. package/src/components/wt-input-info/__tests__/WtInputInfo.spec.js +9 -0
  270. package/src/{css/components/atoms → components}/wt-input-info/_variables.scss +7 -6
  271. package/src/components/wt-input-info/wt-input-info.vue +40 -0
  272. package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +9 -0
  273. package/src/components/wt-item-link/wt-item-link.vue +57 -0
  274. package/src/components/wt-label/__tests__/WtLabel.spec.js +9 -0
  275. package/src/{css/components/atoms → components}/wt-label/_variables.scss +3 -4
  276. package/src/components/wt-label/mixins/labelUsageMixin.js +21 -0
  277. package/src/components/wt-label/wt-label.vue +77 -0
  278. package/src/components/wt-load-bar/__tests__/WtLoadBar.spec.js +9 -0
  279. package/src/components/wt-load-bar/_variables.scss +6 -0
  280. package/src/components/wt-load-bar/wt-load-bar.vue +55 -0
  281. package/src/components/wt-loader/__tests__/WtLoader.spec.js +9 -0
  282. package/src/components/{atoms/wt-loader/wt-loader.vue → wt-loader/_internals/wt-loader--md.vue} +5 -6
  283. package/src/components/wt-loader/_internals/wt-loader--sm.vue +73 -0
  284. package/src/components/wt-loader/_variables.scss +8 -0
  285. package/src/components/wt-loader/wt-loader.vue +37 -0
  286. package/src/components/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +68 -0
  287. package/src/components/wt-navigation-bar/_variables.scss +16 -0
  288. package/src/components/wt-navigation-bar/wt-navigation-bar.vue +282 -0
  289. package/src/components/wt-notification/__tests__/WtNotification.spec.js +21 -0
  290. package/src/components/wt-notification/_variables.scss +10 -0
  291. package/src/components/wt-notification/wt-notification.vue +86 -0
  292. package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +50 -0
  293. package/src/components/wt-notifications-bar/_variables.scss +7 -0
  294. package/src/components/wt-notifications-bar/wt-notifications-bar.vue +78 -0
  295. package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +9 -0
  296. package/src/components/wt-page-header/wt-page-header.vue +83 -0
  297. package/src/components/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +33 -0
  298. package/src/components/wt-page-wrapper/_variables.scss +5 -0
  299. package/src/components/wt-page-wrapper/wt-page-wrapper.vue +58 -0
  300. package/src/components/wt-pagination/__tests__/WtPagination.spec.js +38 -0
  301. package/src/components/wt-pagination/_variables.scss +5 -0
  302. package/src/components/wt-pagination/wt-pagination.vue +148 -0
  303. package/src/components/wt-player/__tests__/WtPlayer.spec.js +9 -0
  304. package/src/components/wt-player/_variables.scss +8 -0
  305. package/src/components/wt-player/wt-player.vue +208 -0
  306. package/src/components/wt-popup/__tests__/WtPopup.spec.js +47 -0
  307. package/src/components/wt-popup/_variables.scss +20 -0
  308. package/src/components/wt-popup/wt-popup.vue +138 -0
  309. package/src/components/wt-progress-bar/__tests__/WtProgressBar.spec.js +17 -0
  310. package/src/components/wt-progress-bar/_variables.scss +11 -0
  311. package/src/components/wt-progress-bar/wt-progress-bar.vue +89 -0
  312. package/src/components/wt-radio/__tests__/WtRadio.spec.js +42 -0
  313. package/src/{css/components/molecules → components}/wt-radio/_variables.scss +6 -6
  314. package/src/components/wt-radio/wt-radio.vue +180 -0
  315. package/src/components/wt-rounded-action/Readme.md +68 -0
  316. package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +9 -0
  317. package/src/components/wt-rounded-action/_variables.scss +14 -0
  318. package/src/components/wt-rounded-action/wt-rounded-action.vue +139 -0
  319. package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +44 -0
  320. package/src/components/wt-search-bar/_variables.scss +8 -0
  321. package/src/components/wt-search-bar/wt-search-bar.vue +222 -0
  322. package/src/components/wt-select/__tests__/WtSelect.spec.js +27 -0
  323. package/src/components/wt-select/_multiselect.scss +198 -0
  324. package/src/components/wt-select/_variables.scss +14 -0
  325. package/src/components/wt-select/mixins/__tests__/multiselectMixin.spec.js +32 -0
  326. package/src/components/wt-select/mixins/multiselectMixin.js +151 -0
  327. package/src/components/wt-select/wt-select.vue +288 -0
  328. package/src/components/wt-slider/__tests__/WtSlider.spec.js +9 -0
  329. package/src/components/wt-slider/_variables.scss +15 -0
  330. package/src/components/wt-slider/wt-slider.vue +179 -0
  331. package/src/components/wt-status-select/__tests__/WtStatusSelect.spec.js +25 -0
  332. package/src/components/wt-status-select/_internals/StatusOptions.lookup.js +24 -0
  333. package/src/components/wt-status-select/_variables.scss +6 -0
  334. package/src/components/wt-status-select/wt-status-select.vue +134 -0
  335. package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +18 -0
  336. package/src/components/wt-stepper/wt-stepper.vue +89 -0
  337. package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +31 -0
  338. package/src/components/wt-switcher/_variables.scss +17 -0
  339. package/src/components/wt-switcher/wt-switcher.vue +191 -0
  340. package/src/components/wt-table/__tests__/WtTable.spec.js +134 -0
  341. package/src/components/wt-table/_internals/getSortOrder.js +12 -0
  342. package/src/components/wt-table/_variables.scss +16 -0
  343. package/src/components/wt-table/wt-table.vue +269 -0
  344. package/src/components/wt-table-actions/__tests__/WtTableActions.spec.js +9 -0
  345. package/src/components/wt-table-actions/_variables.scss +5 -0
  346. package/src/components/wt-table-actions/wt-table-actions.vue +110 -0
  347. package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +31 -0
  348. package/src/components/wt-table-column-select/wt-table-column-select.vue +178 -0
  349. package/src/components/wt-tabs/__tests__/WtTabs.spec.js +36 -0
  350. package/src/{css/components/molecules → components}/wt-tabs/_variables.scss +14 -14
  351. package/src/components/wt-tabs/wt-tabs.vue +125 -0
  352. package/src/components/wt-tags-input/__tests__/WtTagsInput.spec.js +42 -0
  353. package/src/components/wt-tags-input/_variables.scss +24 -0
  354. package/src/components/wt-tags-input/wt-tags-input.vue +226 -0
  355. package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +46 -0
  356. package/src/components/wt-textarea/_variables.scss +5 -0
  357. package/src/components/wt-textarea/wt-textarea.vue +223 -0
  358. package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +25 -0
  359. package/src/components/wt-time-input/wt-time-input.vue +187 -0
  360. package/src/components/wt-timepicker/__tests__/WtTimepicker.spec.js +60 -0
  361. package/src/components/wt-timepicker/_variables.scss +5 -0
  362. package/src/components/wt-timepicker/wt-timepicker.vue +181 -0
  363. package/src/components/wt-tooltip/__tests__/WtTooltip.spec.js +30 -0
  364. package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +68 -0
  365. package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +48 -0
  366. package/src/components/wt-tooltip/_variables.scss +11 -0
  367. package/src/components/wt-tooltip/wt-tooltip.vue +150 -0
  368. package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +14 -0
  369. package/src/composables/useCachedInterval/useCachedInterval.js +21 -0
  370. package/src/composables/useDestroyableSortable/useDestroyableSortable.js +66 -0
  371. package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +83 -0
  372. package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +37 -0
  373. package/src/css/main.scss +72 -69
  374. package/src/css/styleguide/_styleguide.scss +9 -0
  375. package/src/css/styleguide/border-radius/_border-radius.scss +4 -0
  376. package/src/css/styleguide/colors/_colors.scss +180 -0
  377. package/src/css/styleguide/colors/_deprecated.scss +151 -0
  378. package/src/css/styleguide/colors/_palette.scss +358 -0
  379. package/src/css/styleguide/display-helpers/_display-helpers.scss +23 -0
  380. package/src/css/styleguide/elevations/_elevations.scss +13 -0
  381. package/src/css/styleguide/fonts/_fonts.scss +126 -0
  382. package/src/css/styleguide/placeholder/_placeholder.scss +49 -0
  383. package/src/css/styleguide/scroll.scss +43 -40
  384. package/src/css/styleguide/spacings/_spacings.scss +15 -0
  385. package/src/css/styleguide/transitions/_transitions.scss +1 -0
  386. package/src/css/styleguide/transitions/fade/_fade.scss +8 -0
  387. package/src/css/styleguide/typography/_typography.scss +113 -0
  388. package/src/css/styleguide/viewport-breakpoints/_viewport-breakpoints.scss +25 -0
  389. package/src/directives/clickaway/clickaway.js +3 -52
  390. package/src/directives/index.js +0 -5
  391. package/src/enums/AbstractUserStatus/AbstractUserStatus.enum.js +8 -0
  392. package/src/enums/AgentStatus/AgentStatus.enum.js +6 -0
  393. package/src/enums/WebitelApplications/AdminSections.enum.js +50 -0
  394. package/src/enums/WebitelApplications/AuditorSections.enum.js +5 -0
  395. package/src/enums/WebitelApplications/CrmSections.enum.js +5 -0
  396. package/src/enums/WebitelApplications/SupervisorSections.enum.js +7 -0
  397. package/src/enums/WebitelApplications/WebitelApplications.enum.js +11 -0
  398. package/src/locale/.DS_Store +0 -0
  399. package/src/locale/en/en.js +333 -0
  400. package/src/locale/es/es.js +282 -0
  401. package/src/locale/i18n.js +9 -5
  402. package/src/locale/ru/ru.js +334 -3
  403. package/src/locale/ua/ua.js +358 -0
  404. package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +55 -0
  405. package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +70 -0
  406. package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +85 -0
  407. package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +57 -0
  408. package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +48 -0
  409. package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +37 -0
  410. package/src/mixins/dataFilterMixins/apiFilterMixin.js +23 -0
  411. package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +29 -0
  412. package/src/mixins/dataFilterMixins/enumFilterMixin.js +30 -0
  413. package/src/mixins/dataFilterMixins/paginationFilterMixin.js +79 -0
  414. package/src/mixins/dataFilterMixins/sortFilterMixin.js +75 -0
  415. package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +47 -0
  416. package/src/mixins/validationMixin/useValidation.js +41 -0
  417. package/src/mixins/validationMixin/validationMixin.js +26 -10
  418. package/src/modules/AgentStatusSelect/api/agent-status.js +24 -0
  419. package/src/modules/AgentStatusSelect/api/pause-cause.js +47 -0
  420. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +83 -0
  421. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +18 -0
  422. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +122 -0
  423. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +55 -0
  424. package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +107 -0
  425. package/src/modules/AuditForm/components/__tests__/audit-form-question-read-wrapper.spec.js +14 -0
  426. package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +60 -0
  427. package/src/modules/AuditForm/components/__tests__/audit-form-question.spec.js +14 -0
  428. package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +70 -0
  429. package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +132 -0
  430. package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +154 -0
  431. package/src/modules/AuditForm/components/audit-form-question.vue +136 -0
  432. package/src/modules/AuditForm/components/audit-form.vue +183 -0
  433. package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +24 -0
  434. package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +45 -0
  435. package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +89 -0
  436. package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +97 -0
  437. package/src/modules/AuditForm/components/questions/score/__tests__/audit-form-question-score.spec.js +30 -0
  438. package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +132 -0
  439. package/src/modules/AuditForm/schemas/AuditFormQuestionOptionsSchema.js +13 -0
  440. package/src/modules/AuditForm/schemas/AuditFormQuestionSchema.js +8 -0
  441. package/src/modules/AuditForm/schemas/AuditFormQuestionScoreSchema.js +8 -0
  442. package/src/modules/CSVExport/CSVExport.js +89 -0
  443. package/src/modules/CSVExport/__tests__/CSVExport.spec.js +63 -0
  444. package/src/modules/CSVExport/mixins/exportCSVMixin.js +46 -0
  445. package/src/modules/CardStoreModule/composables/useCardStore.js +55 -0
  446. package/src/modules/CardStoreModule/store/CardStoreModule.js +84 -0
  447. package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +87 -0
  448. package/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup.js +28 -0
  449. package/src/modules/FilesExport/FilesExport.js +113 -0
  450. package/src/modules/FilesExport/__tests__/FilesExport.spec.js +66 -0
  451. package/src/modules/FilesExport/mixins/exportFilesMixin.js +46 -0
  452. package/src/modules/FilesExport/scripts/generateMediaURL.js +7 -0
  453. package/src/modules/Filters/classes/BaseFilterSchema.js +13 -0
  454. package/src/modules/Filters/components/filter-pagination.vue +61 -0
  455. package/src/modules/Filters/components/filter-table-fields.vue +61 -0
  456. package/src/modules/Filters/composables/useTableFilters.js +17 -0
  457. package/src/modules/Filters/restores/filterFieldsRestore.js +9 -0
  458. package/src/modules/Filters/restores/readme.md +1 -0
  459. package/src/modules/Filters/store/FiltersStoreModule.js +181 -0
  460. package/src/modules/Notifications/assets/audio/end-chat.wav +0 -0
  461. package/src/modules/Notifications/assets/audio/new-chat.wav +0 -0
  462. package/src/modules/Notifications/assets/audio/new-message.wav +0 -0
  463. package/src/modules/Notifications/assets/audio/ringing.mp3 +0 -0
  464. package/src/modules/Notifications/assets/img/notification-icon.png +0 -0
  465. package/src/modules/Notifications/store/NotificationsStoreModule.js +185 -0
  466. package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +130 -0
  467. package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.mutations.spec.js +49 -0
  468. package/src/modules/QueryFilters/api/__tests__/defaults.spec.js +18 -0
  469. package/src/modules/QueryFilters/api/defaults.js +16 -0
  470. package/src/modules/QueryFilters/classes/ApiFilterSchema.js +32 -0
  471. package/src/modules/QueryFilters/classes/BaseFilterSchema.js +6 -0
  472. package/src/modules/QueryFilters/classes/EnumFilterSchema.js +23 -0
  473. package/src/modules/QueryFilters/classes/__tests__/ApiFilterSchema.spec.js +25 -0
  474. package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +52 -0
  475. package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +38 -0
  476. package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +49 -0
  477. package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +63 -0
  478. package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +47 -0
  479. package/src/modules/QueryFilters/components/abstract-api-filter.vue +42 -0
  480. package/src/modules/QueryFilters/components/abstract-enum-filter.vue +32 -0
  481. package/src/modules/QueryFilters/components/filter-datetime.vue +40 -0
  482. package/src/modules/QueryFilters/components/filter-from-to.vue +143 -0
  483. package/src/modules/QueryFilters/components/filter-search.vue +33 -0
  484. package/src/modules/QueryFilters/components/filter-table-fields.vue +101 -0
  485. package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +48 -0
  486. package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +68 -0
  487. package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +79 -0
  488. package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +63 -0
  489. package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +46 -0
  490. package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +39 -0
  491. package/src/modules/QueryFilters/mixins/apiFilterMixin.js +41 -0
  492. package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +34 -0
  493. package/src/modules/QueryFilters/mixins/enumFilterMixin.js +51 -0
  494. package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +76 -0
  495. package/src/modules/QueryFilters/mixins/sortFilterMixin.js +56 -0
  496. package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +61 -0
  497. package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +89 -0
  498. package/src/modules/QueryFilters/store/queryFilters.js +6 -0
  499. package/src/modules/TableStoreModule/composables/useTableStore.js +58 -0
  500. package/src/modules/TableStoreModule/store/TableStoreModule.js +207 -0
  501. package/src/modules/Userinfo/api/BaseAPIService.js +7 -0
  502. package/src/modules/Userinfo/api/auth.js +31 -0
  503. package/src/modules/Userinfo/api/userinfo.js +44 -0
  504. package/src/modules/Userinfo/classes/ApplicationsAccess.js +217 -0
  505. package/src/modules/Userinfo/components/__tests__/auth.spec.js +55 -0
  506. package/src/modules/Userinfo/components/the-auth.vue +76 -0
  507. package/src/modules/Userinfo/enums/Permissions.enum.js +7 -0
  508. package/src/modules/Userinfo/store/UserinfoStoreModule.js +153 -0
  509. package/src/plugins/breakpoint/breakpoint.plugin.js +137 -0
  510. package/src/scripts/__tests__/caseConverters.spec.js +81 -0
  511. package/src/scripts/__tests__/convertDuration.spec.js +21 -0
  512. package/src/scripts/__tests__/debounce.spec.js +14 -0
  513. package/src/scripts/__tests__/editProxy.spec.js +9 -0
  514. package/src/scripts/__tests__/isEmpty.spec.js +16 -0
  515. package/src/scripts/__tests__/prettifyFileSize.spec.js +18 -0
  516. package/src/scripts/__tests__/prettifyTime.spec.js +18 -0
  517. package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +16 -0
  518. package/src/scripts/__tests__/sortQueryAdapters.spec.js +12 -0
  519. package/src/scripts/__tests__/updateObject.spec.js +19 -0
  520. package/src/scripts/caseConverters.js +89 -0
  521. package/src/scripts/convertDuration.js +15 -0
  522. package/src/scripts/debounce.js +3 -9
  523. package/src/scripts/editProxy.js +9 -0
  524. package/src/scripts/eventBus.js +8 -0
  525. package/src/scripts/isEmpty.js +9 -0
  526. package/src/scripts/prettifyFileSize.js +11 -0
  527. package/src/scripts/prettifyTime.js +9 -0
  528. package/src/scripts/preventHiddenPageCallsDecorator.js +6 -0
  529. package/src/scripts/sortQueryAdapters.js +21 -0
  530. package/src/scripts/updateObject.js +6 -0
  531. package/src/store/BaseStoreModules/ApiStoreModule.js +93 -0
  532. package/src/store/BaseStoreModules/BaseStoreModule.js +49 -0
  533. package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +104 -0
  534. package/src/store/ReactiveNowStoreModule/ReactiveNowStoreModule.js +27 -0
  535. package/src/store/helpers/__tests__/getNamespacedState.spec.js +11 -0
  536. package/src/store/helpers/getNamespacedState.js +5 -0
  537. package/src/validators/decimalValidator.js +9 -0
  538. package/src/validators/domainValidator.js +5 -0
  539. package/.eslintrc.js +0 -34
  540. package/babel.config.js +0 -5
  541. package/dist/@webitel/ui-sdk.common.js +0 -11586
  542. package/dist/@webitel/ui-sdk.common.js.map +0 -1
  543. package/dist/@webitel/ui-sdk.css +0 -1
  544. package/dist/@webitel/ui-sdk.umd.js +0 -11596
  545. package/dist/@webitel/ui-sdk.umd.js.map +0 -1
  546. package/dist/@webitel/ui-sdk.umd.min.js +0 -2
  547. package/dist/@webitel/ui-sdk.umd.min.js.map +0 -1
  548. package/dist/fonts/Montserrat-Regular.ee653992.ttf +0 -0
  549. package/dist/fonts/Montserrat-SemiBold.c641dbee.ttf +0 -0
  550. package/dist/img/arrow-down--active--md.06c6b9a1.svg +0 -3
  551. package/dist/img/arrow-down--disabled--md.8dd31dcb.svg +0 -3
  552. package/dist/img/arrow-down--md.907c231e.svg +0 -3
  553. package/dist/img/calendar--active--md.b649abe2.svg +0 -6
  554. package/dist/img/calendar--disabled--md.ff268289.svg +0 -3
  555. package/dist/img/calendar--md.d0280382.svg +0 -6
  556. package/jest.config.js +0 -3
  557. package/package-lock.json +0 -15091
  558. package/public/favicon.ico +0 -0
  559. package/public/index.html +0 -17
  560. package/src/assets/icons/arrow-down--active--md.svg +0 -3
  561. package/src/assets/icons/arrow-down--disabled--md.svg +0 -3
  562. package/src/assets/icons/arrow-down--md.svg +0 -3
  563. package/src/assets/icons/calendar--active--md.svg +0 -6
  564. package/src/assets/icons/calendar--disabled--md.svg +0 -3
  565. package/src/assets/icons/calendar--md.svg +0 -6
  566. package/src/components/atoms/wt-badge/wt-badge.vue +0 -15
  567. package/src/components/atoms/wt-button/wt-button.vue +0 -202
  568. package/src/components/atoms/wt-divider/wt-divider.vue +0 -24
  569. package/src/components/atoms/wt-icon/wt-icon.vue +0 -499
  570. package/src/components/atoms/wt-input-info/wt-input-info.vue +0 -34
  571. package/src/components/atoms/wt-label/wt-label.vue +0 -58
  572. package/src/components/atoms/wt-tooltip/wt-tooltip.vue +0 -54
  573. package/src/components/molecules/wt-checkbox/wt-checkbox.vue +0 -167
  574. package/src/components/molecules/wt-datepicker/wt-datepicker.vue +0 -200
  575. package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +0 -306
  576. package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +0 -69
  577. package/src/components/molecules/wt-input/wt-input.vue +0 -300
  578. package/src/components/molecules/wt-notification/wt-notification.vue +0 -74
  579. package/src/components/molecules/wt-popup/wt-popup.vue +0 -89
  580. package/src/components/molecules/wt-radio/wt-radio.vue +0 -168
  581. package/src/components/molecules/wt-search-bar/wt-search-bar.vue +0 -186
  582. package/src/components/molecules/wt-select/wt-select.vue +0 -394
  583. package/src/components/molecules/wt-switcher/wt-switcher.vue +0 -157
  584. package/src/components/molecules/wt-tabs/wt-tabs.vue +0 -125
  585. package/src/components/molecules/wt-textarea/wt-textarea.vue +0 -141
  586. package/src/components/molecules/wt-time-input/wt-time-input.vue +0 -141
  587. package/src/components/molecules/wt-timepicker/wt-timepicker.vue +0 -110
  588. package/src/components/organisms/wt-pagination/wt-pagination.vue +0 -122
  589. package/src/css/colors/_colors.scss +0 -67
  590. package/src/css/components/_components.scss +0 -25
  591. package/src/css/components/atoms/wt-badge/_variables.scss +0 -6
  592. package/src/css/components/atoms/wt-badge/wt-badge.scss +0 -8
  593. package/src/css/components/atoms/wt-button/_variables.scss +0 -47
  594. package/src/css/components/atoms/wt-divider/_variables.scss +0 -5
  595. package/src/css/components/atoms/wt-icon/_variables.scss +0 -29
  596. package/src/css/components/atoms/wt-loader/_variables.scss +0 -8
  597. package/src/css/components/atoms/wt-tooltip/_variables.scss +0 -10
  598. package/src/css/components/molecules/wt-checkbox/_variables.scss +0 -4
  599. package/src/css/components/molecules/wt-datepicker/_variables.scss +0 -20
  600. package/src/css/components/molecules/wt-datepicker/datepicker-calendar.scss +0 -100
  601. package/src/css/components/molecules/wt-datetimepicker/_variables.scss +0 -12
  602. package/src/css/components/molecules/wt-icon-btn/_variables.scss +0 -3
  603. package/src/css/components/molecules/wt-input/_variables.scss +0 -6
  604. package/src/css/components/molecules/wt-notification/_variables.scss +0 -10
  605. package/src/css/components/molecules/wt-popup/_variables.scss +0 -11
  606. package/src/css/components/molecules/wt-search-bar/_variables.scss +0 -4
  607. package/src/css/components/molecules/wt-select/_variables.scss +0 -23
  608. package/src/css/components/molecules/wt-switcher/_variables.scss +0 -14
  609. package/src/css/components/molecules/wt-textarea/_variables.scss +0 -5
  610. package/src/css/components/molecules/wt-timepicker/_variables.scss +0 -4
  611. package/src/css/components/organisms/wt-pagination/_variables.scss +0 -7
  612. package/src/css/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  613. package/src/css/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  614. package/src/css/fonts.scss +0 -9
  615. package/src/css/styleguide/styleguide.scss +0 -3
  616. package/src/css/typography/_typography.scss +0 -72
  617. package/src/install.js +0 -15
  618. package/src/main.js +0 -14
  619. package/src/playground.vue +0 -451
  620. package/src/the-app.vue +0 -20
  621. package/vue.config.js +0 -11
@@ -0,0 +1,153 @@
1
+ import userinfo from '../api/userinfo';
2
+ import ApplicationsAccess from '../classes/ApplicationsAccess';
3
+ import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule';
4
+ import Permissions from '../enums/Permissions.enum';
5
+
6
+ const defaultState = () => ({
7
+ isLoading: true,
8
+ domainId: 0,
9
+ name: '',
10
+ username: '',
11
+ account: '',
12
+ preferredUsername: '',
13
+ userId: 0,
14
+ scope: {},
15
+ permissions: {},
16
+ roles: [],
17
+ license: [],
18
+ access: {},
19
+ language: localStorage.getItem('lang'),
20
+ });
21
+
22
+ export default class UserinfoStoreModule extends BaseStoreModule {
23
+ state = {
24
+ ...defaultState(),
25
+ }
26
+
27
+ getters = {
28
+ THIS_APP: (state) => state.thisApp,
29
+ // if no access[app] => accessed by default
30
+ CHECK_APP_ACCESS: (state) => (app) => !state.access[app] || state.access[app]?._enabled,
31
+ CHECK_OBJECT_ACCESS: (state, getters) => ({ name, route }) => {
32
+ if (!state.access[getters.THIS_APP] || !state.access[getters.THIS_APP]._enabled) return false;
33
+ if (route) return getters.CHECK_OBJECT_ACCESS_BY_ROUTE(route);
34
+ return getters.CHECK_OBJECT_ACCESS_BY_NAME(name);
35
+ },
36
+ CHECK_OBJECT_ACCESS_BY_NAME: (state, getters) => (name) => (
37
+ state.access[getters.THIS_APP][name]?._enabled
38
+ ),
39
+ CHECK_OBJECT_ACCESS_BY_ROUTE: (state, getters) => (route) => {
40
+ const accessKey = Object.keys(state.access[getters.THIS_APP]).find((object) => route.name.includes(object));
41
+ return state.access[getters.THIS_APP][accessKey]?._enabled;
42
+ },
43
+ GET_OBJECT_SCOPE: (state, getters) => ({ name, route }) => {
44
+ if (route) return getters.GET_OBJECT_SCOPE_BY_ROUTE(route);
45
+ return getters.GET_OBJECT_SCOPE_BY_NAME(name);
46
+ },
47
+ GET_OBJECT_SCOPE_BY_NAME: (state) => (name) => (
48
+ Object.values(state.scope).find((object) => name === object.name)
49
+ ),
50
+ GET_OBJECT_SCOPE_BY_ROUTE: (state) => (route) => (
51
+ Object.values(state.scope).find((object) => route.name.includes(object.route))
52
+ ),
53
+ HAS_READ_ACCESS: (state, getters) => (checkedObject) => {
54
+ if (!getters.CHECK_OBJECT_ACCESS(checkedObject)) return false;
55
+ if (state.permissions[Permissions.READ]) return true;
56
+ const objectScope = getters.GET_OBJECT_SCOPE(checkedObject);
57
+ return objectScope?.access?.includes('r');
58
+ },
59
+ HAS_CREATE_ACCESS: (state, getters) => (checkedObject) => {
60
+ if (state.permissions[Permissions.CREATE]) return true;
61
+ const objectScope = getters.GET_OBJECT_SCOPE(checkedObject);
62
+ return objectScope?.access?.includes('x');
63
+ },
64
+ HAS_EDIT_ACCESS: (state, getters) => (checkedObject) => {
65
+ if (state.permissions[Permissions.EDIT]) return true;
66
+ const objectScope = getters.GET_OBJECT_SCOPE(checkedObject);
67
+ return objectScope?.access?.includes('w');
68
+ },
69
+ HAS_DELETE_ACCESS: (state, getters) => (checkedObject) => {
70
+ if (state.permissions[Permissions.DELETE]) return true;
71
+ const objectScope = getters.GET_OBJECT_SCOPE(checkedObject);
72
+ return objectScope?.access?.includes('d');
73
+ },
74
+ }
75
+
76
+ actions = {
77
+ BEFORE_OPEN_SESSION_HOOK: () => {},
78
+ AFTER_OPEN_SESSION_HOOK: () => {},
79
+ CONVERT_USER_SCOPE: (context, scope) => scope,
80
+ CONVERT_USER_PERMISSIONS: (context, initialPermissions) => {
81
+ let permissions = {};
82
+ if (!initialPermissions) return permissions;
83
+ permissions = initialPermissions.reduce((permissions, currentPermission) => ({
84
+ ...permissions,
85
+ [currentPermission.id]: currentPermission,
86
+ }), {});
87
+ return permissions;
88
+ },
89
+
90
+ OPEN_SESSION: async (context) => {
91
+ await context.dispatch('BEFORE_OPEN_SESSION_HOOK');
92
+ // !!! it should be checked in router.js beforeEach hook
93
+ // if (!localStorage.getItem('access-token')) {
94
+ // context.dispatch('REDIRECT_TO_AUTH');
95
+ // throw new Error('No access-token in localStorage');
96
+ // }
97
+ const session = await userinfo.getSession();
98
+ await context.dispatch('SET_SESSION', session);
99
+ const access = await userinfo.getApplicationsAccess();
100
+ await context.dispatch('SET_APPLICATIONS_ACCESS', new ApplicationsAccess({ access }).getAccess());
101
+ await context.dispatch('AFTER_OPEN_SESSION_HOOK');
102
+ },
103
+ SET_SESSION: async (context, _session) => {
104
+ const defaultSession = {
105
+ domainId: 0,
106
+ username: '',
107
+ userId: 0,
108
+ scope: [],
109
+ roles: [],
110
+ license: [],
111
+ };
112
+
113
+ try {
114
+ await context.dispatch('RESET_STATE');
115
+ const session = { ...defaultSession, ..._session };
116
+ const scope = await context.dispatch('CONVERT_USER_SCOPE', session.scope);
117
+ const permissions = await context.dispatch('CONVERT_USER_PERMISSIONS', session.permissions);
118
+ context.commit('SET_SESSION', { ...session, scope, permissions });
119
+ await context.dispatch('SET_LOADING', false);
120
+ } catch (err) {
121
+ throw err;
122
+ }
123
+ },
124
+
125
+ SET_APPLICATIONS_ACCESS: (context, access) => context.commit('SET_APPLICATIONS_ACCESS', access),
126
+
127
+ SET_LOADING: (context, isLoading) => {
128
+ context.commit('SET_LOADING', isLoading);
129
+ },
130
+
131
+ RESET_STATE: (context) => {
132
+ context.commit('RESET_STATE');
133
+ },
134
+ }
135
+
136
+ mutations = {
137
+ SET_SESSION: (state, session) => {
138
+ Object.assign(state, session);
139
+ },
140
+
141
+ SET_APPLICATIONS_ACCESS: (state, access) => {
142
+ state.access = access;
143
+ },
144
+
145
+ SET_LOADING: (state, isLoading) => {
146
+ state.isLoading = isLoading;
147
+ },
148
+
149
+ RESET_STATE: (state) => {
150
+ Object.assign(state, defaultState());
151
+ },
152
+ }
153
+ }
@@ -0,0 +1,137 @@
1
+ import { reactive } from 'vue';
2
+ import debounce from '../../scripts/debounce';
3
+
4
+ // https://stackoverflow.com/questions/41791193/vuejs-reactive-binding-for-a-plugin-how-to/41801107#41801107
5
+ // https://stackoverflow.com/questions/50111231/vue-prototype-not-reactive-when-data-changes
6
+
7
+ // https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/services/breakpoint/index.ts
8
+
9
+ const breakpoint = reactive({
10
+ // Breakpoints
11
+ xs: false,
12
+ sm: false,
13
+ md: false,
14
+ lg: false,
15
+ xl: false,
16
+
17
+ // Conditionals
18
+ xsOnly: false,
19
+ smOnly: false,
20
+ smAndDown: false,
21
+ smAndUp: false,
22
+ mdOnly: false,
23
+ mdAndDown: false,
24
+ mdAndUp: false,
25
+ lgOnly: false,
26
+ lgAndDown: false,
27
+ lgAndUp: false,
28
+ xlOnly: false,
29
+
30
+ // true if screen width < mobileBreakpoint
31
+ mobile: true,
32
+
33
+ // Current breakpoint name (e.g. 'md')
34
+ name: 'xs',
35
+ // Dimensions
36
+ height: 0,
37
+ width: 0,
38
+ });
39
+
40
+ const getClientWidth = () => Math.max(
41
+ document.documentElement.clientWidth,
42
+ window.innerWidth || 0,
43
+ );
44
+
45
+ const getClientHeight = () => Math.max(
46
+ document.documentElement.clientHeight,
47
+ window.innerHeight || 0,
48
+ );
49
+
50
+ const thresholds = {
51
+ xs: 600,
52
+ sm: 960,
53
+ md: 1264,
54
+ lg: 1904,
55
+ };
56
+ const mobileBreakpoint = 'sm';
57
+ const scrollBarWidth = 16;
58
+
59
+ const onResize = () => {
60
+ const height = getClientHeight();
61
+ const width = getClientWidth();
62
+
63
+ const xs = width < thresholds.xs;
64
+ const sm = width < thresholds.sm && !xs;
65
+ const md = width < (thresholds.md - scrollBarWidth) && !(sm || xs);
66
+ const lg = width < (thresholds.lg - scrollBarWidth) && !(md || sm || xs);
67
+ const xl = width >= (thresholds.lg - scrollBarWidth);
68
+
69
+ breakpoint.height = height;
70
+ breakpoint.width = width;
71
+
72
+ breakpoint.xs = xs;
73
+ breakpoint.sm = sm;
74
+ breakpoint.md = md;
75
+ breakpoint.lg = lg;
76
+ breakpoint.xl = xl;
77
+
78
+ breakpoint.xsOnly = xs;
79
+ breakpoint.smOnly = sm;
80
+ breakpoint.smAndDown = (xs || sm) && !(md || lg || xl);
81
+ breakpoint.smAndUp = !xs && (sm || md || lg || xl);
82
+ breakpoint.mdOnly = md;
83
+ breakpoint.mdAndDown = (xs || sm || md) && !(lg || xl);
84
+ breakpoint.mdAndUp = !(xs || sm) && (md || lg || xl);
85
+ breakpoint.lgOnly = lg;
86
+ breakpoint.lgAndDown = (xs || sm || md || lg) && !xl;
87
+ breakpoint.lgAndUp = !(xs || sm || md) && (lg || xl);
88
+ breakpoint.xlOnly = xl;
89
+
90
+ switch (true) {
91
+ case (xs):
92
+ breakpoint.name = 'xs';
93
+ break;
94
+ case (sm):
95
+ breakpoint.name = 'sm';
96
+ break;
97
+ case (md):
98
+ breakpoint.name = 'md';
99
+ break;
100
+ case (lg):
101
+ breakpoint.name = 'lg';
102
+ break;
103
+ default:
104
+ breakpoint.name = 'xl';
105
+ break;
106
+ }
107
+
108
+ if (typeof mobileBreakpoint === 'number') {
109
+ breakpoint.mobile = width < parseInt(mobileBreakpoint, 10);
110
+
111
+ return;
112
+ }
113
+
114
+ const breakpoints = {
115
+ xs: 0,
116
+ sm: 1,
117
+ md: 2,
118
+ lg: 3,
119
+ xl: 4,
120
+ };
121
+
122
+ const current = breakpoints[breakpoint.name];
123
+ const max = breakpoints[mobileBreakpoint];
124
+
125
+ breakpoint.mobile = current <= max;
126
+ };
127
+
128
+ const install = (app) => {
129
+ window.addEventListener('resize', debounce(onResize), { passive: true });
130
+
131
+ onResize();
132
+
133
+ // eslint-disable-next-line no-param-reassign
134
+ app.config.globalProperties.$breakpoint = breakpoint;
135
+ };
136
+
137
+ export { install };
@@ -0,0 +1,81 @@
1
+ import {
2
+ camelToKebab,
3
+ camelToSnake,
4
+ kebabToCamel,
5
+ snakeToKebab,
6
+ kebabToSnake,
7
+ objCamelToSnake,
8
+ objSnakeToCamel,
9
+ snakeToCamel,
10
+ } from '../caseConverters';
11
+
12
+ describe('Case converters', () => {
13
+ it('Camel-Kebab', () => {
14
+ const camelStr = 'camelToKebab';
15
+ const kebabStr = 'camel-to-kebab';
16
+ expect(camelToKebab(camelStr)).toBe(kebabStr);
17
+ expect(kebabToCamel(kebabStr)).toBe(camelStr);
18
+ });
19
+
20
+ it('Snake-Kebab', () => {
21
+ const snakeStr = 'snake_to_kebab';
22
+ const kebabStr = 'snake-to-kebab';
23
+ expect(snakeToKebab(snakeStr)).toBe(kebabStr);
24
+ expect(kebabToSnake(kebabStr)).toBe(snakeStr);
25
+ });
26
+
27
+ it('Camel-Snake', () => {
28
+ const camelStr = 'camelToSnake';
29
+ const snakeStr = 'camel_to_snake';
30
+ expect(camelToSnake(camelStr)).toBe(snakeStr);
31
+ expect(snakeToCamel(snakeStr)).toBe(camelStr);
32
+ });
33
+
34
+ it('Camel-Snake, test case 1: do not convert 1st uppercase letter', () => {
35
+ const camelStr = 'Timer';
36
+ const snakeStr = 'Timer';
37
+ expect(camelToSnake(camelStr)).toBe(snakeStr);
38
+ expect(snakeToCamel(snakeStr)).toBe(camelStr);
39
+ });
40
+
41
+ it('Camel <- Snake skips first char "_"', () => {
42
+ const camelStr = '_camelToSnake';
43
+ const snakeStr = '_camel_to_snake';
44
+ expect(snakeToCamel(snakeStr)).toBe(camelStr);
45
+ });
46
+
47
+ it('Camel-Snake Objects', () => {
48
+ const camelObj = { camelToSnake: { camelToSnake: null, arr: [10] } };
49
+ const snakeObj = { camel_to_snake: { camel_to_snake: null, arr: [10] } };
50
+ expect(objCamelToSnake(camelObj)).toEqual(snakeObj);
51
+ expect(objSnakeToCamel(snakeObj)).toEqual(camelObj);
52
+ });
53
+
54
+ it('Camel-Snake Objects: NULL VALUES', () => {
55
+ const camelObj = null;
56
+ const snakeObj = null;
57
+ expect(objCamelToSnake(camelObj)).toEqual(snakeObj);
58
+ expect(objSnakeToCamel(snakeObj)).toEqual(camelObj);
59
+ });
60
+
61
+ it('Camel-Snake Arrays', () => {
62
+ const camelArr = ['camelToSnake', { camelToSnake: { camelToSnake: null } }];
63
+ const snakeArr = ['camel_to_snake', { camel_to_snake: { camel_to_snake: null } }];
64
+ expect(objCamelToSnake(camelArr)).toEqual(snakeArr);
65
+ expect(objSnakeToCamel(snakeArr)).toEqual(camelArr);
66
+ });
67
+
68
+ it('Camel-to-Snake Object skips passed keys', () => {
69
+ const skippedKeys = ['skippedKey'];
70
+ const camelArr = { camelToSnake: null, skippedKey: null };
71
+ const snakeArr = { camel_to_snake: null, skippedKey: null };
72
+ expect(objCamelToSnake(camelArr, skippedKeys)).toEqual(snakeArr);
73
+ });
74
+
75
+ it('Snake-to-Camel Object skips passed keys', () => {
76
+ const skippedKeys = ['skipped_key'];
77
+ const camelArr = { camelToSnake: null, skipped_key: null };
78
+ const snakeArr = { camel_to_snake: null, skipped_key: null };
79
+ expect(objSnakeToCamel(snakeArr, skippedKeys)).toEqual(camelArr);
80
+ });
81
+ });
@@ -0,0 +1,21 @@
1
+ import convertDuration from '../convertDuration';
2
+
3
+ describe('Case converters', () => {
4
+ it('duration from sec value', () => {
5
+ const time = 111;
6
+ const duration = '00:01:51';
7
+ expect(convertDuration(time)).toBe(duration);
8
+ });
9
+
10
+ it('duration from sec string value', () => {
11
+ const time = '61';
12
+ const duration = '00:01:01';
13
+ expect(convertDuration(time)).toBe(duration);
14
+ });
15
+
16
+ it('duration from false value', () => {
17
+ const time = null;
18
+ const duration = '00:00:00';
19
+ expect(convertDuration(time)).toBe(duration);
20
+ });
21
+ });
@@ -0,0 +1,14 @@
1
+ import debounce from '../debounce';
2
+
3
+ describe('debounce', () => {
4
+ it('debounces call', async () => {
5
+ let isFnCalled = false;
6
+ let fn = () => { isFnCalled = true; };
7
+ fn = debounce(fn, 50);
8
+ fn();
9
+ expect(isFnCalled).toBeFalsy();
10
+ await setTimeout(() => {
11
+ expect(isFnCalled).toBeTruthy();
12
+ }, 100);
13
+ });
14
+ });
@@ -0,0 +1,9 @@
1
+ import editProxy from '../editProxy';
2
+
3
+ describe('editProxy', () => {
4
+ it('correctly updates _dirty prop at object property change', () => {
5
+ const object = editProxy({ value: 'jest', _dirty: false });
6
+ object.value = 'upd jest';
7
+ expect(object._dirty).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,16 @@
1
+ import isEmpty from '../isEmpty';
2
+
3
+ describe('isEmpty', () => {
4
+ it('falsy cases (not empty)', () => {
5
+ expect(isEmpty(['jest'])).toBeFalsy();
6
+ expect(isEmpty({ jest: 'jest' })).toBeFalsy();
7
+ expect(isEmpty(1)).toBeFalsy();
8
+ expect(isEmpty('jest')).toBeFalsy();
9
+ });
10
+ it('truthy cases (empty)', () => {
11
+ expect(isEmpty([])).toBeTruthy();
12
+ expect(isEmpty({})).toBeTruthy();
13
+ expect(isEmpty(0)).toBeTruthy();
14
+ expect(isEmpty('')).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,18 @@
1
+ import prettifyFileSize from '../prettifyFileSize';
2
+
3
+ describe('prettifyFileSize', () => {
4
+ it('prettifies bytes to kb\'s', () => {
5
+ const size = 1025;
6
+ expect(prettifyFileSize(size)).toBe('1 Kb');
7
+ });
8
+
9
+ it('prettifies bytes to mb\'s', () => {
10
+ const size = 1205 ** 2;
11
+ expect(prettifyFileSize(size)).toBe('1.38 Mb');
12
+ });
13
+
14
+ it('handles 0 size', () => {
15
+ const size = 0;
16
+ expect(prettifyFileSize(size)).toBe('0');
17
+ });
18
+ });
@@ -0,0 +1,18 @@
1
+ import prettifyTime from '../prettifyTime';
2
+
3
+ describe('prettifyTime', () => {
4
+ it('prettifies date-format time', () => {
5
+ const time = new Date(0);
6
+ expect(prettifyTime(time)).toBeTruthy();
7
+ });
8
+
9
+ it('prettifies number-format time', () => {
10
+ const time = 0;
11
+ expect(prettifyTime(time)).toBeTruthy();
12
+ });
13
+
14
+ it('prettifies string-format time', () => {
15
+ const time = '0';
16
+ expect(prettifyTime(time)).toBeTruthy();
17
+ });
18
+ });
@@ -0,0 +1,16 @@
1
+ import preventHiddenPageCallsDecorator from '../preventHiddenPageCallsDecorator';
2
+
3
+ describe('preventHiddenPageCallsDecorator', () => {
4
+ it('prevents call on hidden page', () => {
5
+ let isFnCalled = false;
6
+ let fn = () => { isFnCalled = true; };
7
+ fn = preventHiddenPageCallsDecorator(fn, 50);
8
+ Object.defineProperty(document, 'hidden', {
9
+ configurable: true,
10
+ get() { return true; },
11
+ });
12
+ expect(isFnCalled).toBeFalsy();
13
+ fn();
14
+ expect(isFnCalled).toBeFalsy();
15
+ });
16
+ });
@@ -0,0 +1,12 @@
1
+ import * as sortQueryAdapters from '../sortQueryAdapters';
2
+
3
+ test('sortToQueryAdapter', () => {
4
+ expect(sortQueryAdapters.sortToQueryAdapter('asc')).toBe('+');
5
+ expect(sortQueryAdapters.sortToQueryAdapter('desc')).toBe('-');
6
+ expect(sortQueryAdapters.sortToQueryAdapter(null)).toBe('');
7
+ });
8
+ test('queryToSortAdapter', () => {
9
+ expect(sortQueryAdapters.queryToSortAdapter('+')).toBe('asc');
10
+ expect(sortQueryAdapters.queryToSortAdapter('-')).toBe('desc');
11
+ expect(sortQueryAdapters.queryToSortAdapter('')).toBe(null);
12
+ });
@@ -0,0 +1,19 @@
1
+ import updateObject from '../updateObject';
2
+
3
+ describe('updateObject', () => {
4
+ it('doesn\'t mutate original object', () => {
5
+ const original = { jest: 'jest' };
6
+ updateObject({ obj: original, path: 'jest', value: '123' });
7
+ expect(original.jest).toBe('jest');
8
+ });
9
+ it('changes shallow value', () => {
10
+ const original = { jest: 'jest' };
11
+ const result = { jest: 'huest' };
12
+ expect(updateObject({ obj: original, path: 'jest', value: 'huest' })).toEqual(result);
13
+ });
14
+ it('changes deep value', () => {
15
+ const original = { jest: { deep: 'jest' } };
16
+ const result = { jest: { deep: 'huest' } };
17
+ expect(updateObject({ obj: original, path: 'jest.deep', value: 'huest' })).toEqual(result);
18
+ });
19
+ });
@@ -0,0 +1,89 @@
1
+ export const snakeToCamel = (str) => str.replace(
2
+ /([a-z])([_])([a-z])/g,
3
+ (group, p1, p2, p3) => [p1, p3.toUpperCase()].join(''),
4
+ );
5
+
6
+ export const camelToSnake = (str) => str.replace(
7
+ /([a-z])([A-Z])/g,
8
+ (group, p1, p2) => [p1, '_', p2.toLowerCase()].join(''),
9
+ );
10
+
11
+ export const kebabToCamel = (str) => str.replace(
12
+ /([-_][a-z])/g,
13
+ (group) => group.toUpperCase()
14
+ .replace('-', ''),
15
+ );
16
+
17
+ export const camelToKebab = (str) => str.replace(
18
+ /([A-Z])/g,
19
+ (group) => group.toLowerCase()
20
+ .replace('', '-'),
21
+ );
22
+
23
+ export const kebabToSnake = (str) => str.replace(
24
+ /([-_][a-z])/g,
25
+ (group) => group
26
+ .replace('-', '_'),
27
+ );
28
+
29
+ export const snakeToKebab = (str) => str.replace(
30
+ /([-_][a-z])/g,
31
+ (group) => group
32
+ .replace('_', '-'),
33
+ );
34
+
35
+ export const objSnakeToCamel = (obj, skipKeys = []) => {
36
+ if (!obj) return obj;
37
+ const newObj = {};
38
+ if (Array.isArray(obj)) {
39
+ return obj.map((value) => {
40
+ if (typeof value === 'object') {
41
+ return objSnakeToCamel(value, skipKeys);
42
+ } if (typeof value === 'string') return snakeToCamel(value);
43
+ return value; // number
44
+ });
45
+ }
46
+ Object.keys(obj)
47
+ .forEach((oldKey) => {
48
+ if (skipKeys.includes(oldKey)) {
49
+ newObj[oldKey] = obj[oldKey];
50
+ } else {
51
+ const newKey = snakeToCamel(oldKey);
52
+ let value = obj[oldKey];
53
+ if (Array.isArray(value) || (value !== null && value !== undefined && value.constructor === Object)) {
54
+ value = objSnakeToCamel(value, skipKeys);
55
+ }
56
+ newObj[newKey] = value;
57
+ }
58
+ });
59
+
60
+ return newObj;
61
+ };
62
+
63
+ export const objCamelToSnake = (obj, skipKeys = []) => {
64
+ if (!obj) return obj;
65
+ const newObj = {};
66
+ if (Array.isArray(obj)) {
67
+ return obj.map((value) => {
68
+ if (typeof value === 'object') {
69
+ return objCamelToSnake(value, skipKeys);
70
+ } if (typeof value === 'string') return camelToSnake(value);
71
+ return value; // number
72
+ });
73
+ }
74
+ Object.keys(obj)
75
+ .forEach((oldKey) => {
76
+ if (skipKeys.includes(oldKey)) {
77
+ newObj[oldKey] = obj[oldKey];
78
+ } else {
79
+ const newKey = camelToSnake(oldKey);
80
+ let value = obj[oldKey];
81
+ if (Array.isArray(value) || (value !== null && value !== undefined && value.constructor === Object)) {
82
+ value = objCamelToSnake(value, skipKeys);
83
+ }
84
+ newObj[newKey] = value;
85
+ }
86
+ });
87
+
88
+ return newObj;
89
+ };
@@ -0,0 +1,15 @@
1
+ const convertDuration = (duration) => {
2
+ if (!duration) return '00:00:00';
3
+
4
+ let hour = `${Math.floor(duration / 3600)}`;
5
+ let min = `${Math.floor((duration % 3600) / 60)}`;
6
+ let sec = `${Math.floor((duration % 3600) % 60)}`;
7
+
8
+ if (hour.length === 1) hour = `0${hour}`;
9
+ if (min.length === 1) min = `0${min}`;
10
+ if (sec.length === 1) sec = `0${sec}`;
11
+
12
+ return `${hour}:${min}:${sec}`;
13
+ };
14
+
15
+ export default convertDuration;
@@ -1,11 +1,5 @@
1
- const debounce = (method, delay = 1000) => {
2
- let timer;
3
- return (args) => {
4
- if (timer) clearTimeout(timer);
5
- timer = setTimeout(() => {
6
- method(args);
7
- }, delay);
8
- };
9
- };
1
+ import lodashDebounce from 'lodash/debounce';
2
+
3
+ const debounce = (fn, wait = 1000, options) => lodashDebounce(fn, wait, options);
10
4
 
11
5
  export default debounce;
@@ -0,0 +1,9 @@
1
+ const editProxy = (item) => new Proxy(item, {
2
+ set(obj, prop, value) {
3
+ obj._dirty = true;
4
+ obj[prop] = value;
5
+ return obj;
6
+ },
7
+ });
8
+
9
+ export default editProxy;
@@ -0,0 +1,8 @@
1
+ import emitter from 'tiny-emitter/instance';
2
+
3
+ export default {
4
+ $on: (...args) => emitter.on(...args),
5
+ $once: (...args) => emitter.once(...args),
6
+ $off: (...args) => emitter.off(...args),
7
+ $emit: (...args) => emitter.emit(...args),
8
+ };
@@ -0,0 +1,9 @@
1
+ // checks if value is Falsy,
2
+ // including empty arrays or objects
3
+ const isEmpty = (value) => {
4
+ if (Array.isArray(value)) return !value.length;
5
+ if (typeof value === 'object') return !value || !Object.keys(value).length;
6
+ return !value;
7
+ };
8
+
9
+ export default isEmpty;