@webitel/ui-sdk 26.6.95 → 26.6.97

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 (154) hide show
  1. package/dist/{clients-Bj07uFky.js → clients-Ban2DI-G.js} +8 -7
  2. package/dist/{components-l3RJbNmv.js → components-CSWXogKF.js} +13 -8
  3. package/dist/{composables-vmCh4eqT.js → composables-CeAM_2lo.js} +12 -14
  4. package/dist/ui-sdk.css +1 -1
  5. package/dist/ui-sdk.js +605 -605
  6. package/dist/ui-sdk.umd.cjs +382 -382
  7. package/dist/useValidation-lRiKF7xV.js +39 -0
  8. package/dist/{useVidstackSrc-epUQZhkL.js → useVidstackSrc-B4mUti_c.js} +1 -1
  9. package/dist/{vidstack-C6nBVWwn-BlZqtkYB.js → vidstack-C6nBVWwn-cKiWT0KJ.js} +2 -2
  10. package/dist/{vidstack-CI5oafcm-DAV7Lilr.js → vidstack-CI5oafcm-DfWpvayJ.js} +1 -1
  11. package/dist/{vidstack-DUnfBERX2-Cl6yTfB3.js → vidstack-DUnfBERX2-BJtKHFxc.js} +1 -1
  12. package/dist/{vidstack-audio-CH4wIf0F.js → vidstack-audio-BCPraiiR.js} +1 -1
  13. package/dist/{vidstack-dash-CmlmZIFT.js → vidstack-dash-MBx5aEEA.js} +2 -2
  14. package/dist/{vidstack-hls-D1sxUvBd.js → vidstack-hls-BbZsbfaO.js} +2 -2
  15. package/dist/vidstack-video-DwlbGwN7.js +2 -0
  16. package/dist/{wt-chat-emoji-CGf8vRlv.js → wt-chat-emoji-Zfe96hoz.js} +1 -1
  17. package/dist/{wt-datepicker-D2GjAUWU.js → wt-datepicker-BtjegGDk.js} +175 -92
  18. package/dist/{wt-display-chip-items-C3TZt4Gn.js → wt-display-chip-items-YauywYzZ.js} +1 -1
  19. package/dist/{wt-expansion-card-DvLD-TP4.js → wt-expansion-card-DET-o0Jq.js} +1 -1
  20. package/dist/{wt-galleria-DT0SOjXk.js → wt-galleria-B6kMr_xS.js} +1 -1
  21. package/dist/{wt-icon-btn-BIU9YjS8.js → wt-icon-btn-DYjjSl-C.js} +5 -2
  22. package/dist/{wt-player-_mTlxsCu.js → wt-player-Bbirdlj9.js} +1 -1
  23. package/dist/{wt-search-bar-CUxiGcoz.js → wt-search-bar-D50lqCd8.js} +1 -1
  24. package/dist/{wt-send-message-popup-CCSOL-wH.js → wt-send-message-popup-DV1i1Q52.js} +2 -2
  25. package/dist/{wt-table-DS_2J5zF.js → wt-table-C39WpJH8.js} +1 -1
  26. package/dist/{wt-timepicker-Bxdc4s3_.js → wt-timepicker-CYNrvbWf.js} +1 -1
  27. package/dist/{wt-tree-table-2K7cdct7.js → wt-tree-table-umRsVKWt.js} +1 -1
  28. package/dist/{wt-type-extension-value-input-Bl8jpyTn.js → wt-type-extension-value-input-CpYbzjDU.js} +2 -2
  29. package/dist/{wt-vidstack-player-BaH2oaMr.js → wt-vidstack-player-CC6dwrnv.js} +10 -10
  30. package/package.json +3 -2
  31. package/src/api/clients/wtTypes/_shared/utils/sortDynamicFields.ts +18 -4
  32. package/src/api/types/ApiModule.d.ts +28 -9
  33. package/src/components/_internals/composables/useGalleriaFullscreen/useGalleriaFullscreen.ts +25 -9
  34. package/src/components/_internals/composables/useSelect/useSelect.ts +3 -5
  35. package/src/components/_internals/composables/useSelect/useSelectCustomValues.ts +0 -3
  36. package/src/components/_internals/composables/useSelect/useSelectOptions.ts +7 -2
  37. package/src/components/_internals/composables/useWtTable/useWtTable.ts +1 -1
  38. package/src/components/wt-badge-new/types/WtBadge.d.ts +12 -0
  39. package/src/components/wt-badge-new/wt-badge.vue +2 -12
  40. package/src/components/wt-button/wt-button.vue +2 -1
  41. package/src/components/wt-datepicker/_internals/composables/useAutoSeparator.ts +96 -0
  42. package/src/components/wt-datepicker/_internals/composables/useDatepicker.ts +78 -0
  43. package/src/components/wt-datepicker/_internals/composables/usePreventZeroPad.ts +10 -24
  44. package/src/components/wt-datepicker/_internals/composables/useStrictInput.ts +61 -0
  45. package/src/components/wt-datepicker/wt-datepicker.vue +4 -8
  46. package/src/components/wt-icon-btn/wt-icon-btn.vue +1 -1
  47. package/src/components/wt-popup/wt-popup.vue +3 -1
  48. package/src/components/wt-slider/wt-slider.vue +1 -1
  49. package/src/components/wt-table/types/WtTable.d.ts +5 -1
  50. package/src/components/wt-vidstack-player/components/panels/playback-controls-panel/components/time-group.vue +0 -2
  51. package/src/components/wt-vidstack-player/components/panels/playback-controls-panel/playback-controls-panel.vue +0 -1
  52. package/src/components/wt-vidstack-player/components/panels/screen-sharing-controls-panel/screen-sharing-controls-panel.vue +1 -2
  53. package/src/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue +1 -9
  54. package/src/composables/index.d.ts +9 -0
  55. package/src/composables/index.ts +1 -0
  56. package/src/composables/useEventBus/useEventBus.d.ts +11 -0
  57. package/src/composables/useEventBus/useEventBus.ts +16 -0
  58. package/src/enums/BroadcastChannelName/BroadcastChannelName.d.ts +5 -0
  59. package/src/enums/BroadcastChannelName/UserSettingsBroadcastMessage.d.ts +12 -0
  60. package/src/enums/ButtonColor/ButtonColor.d.ts +11 -0
  61. package/src/enums/ButtonVariant/ButtonVariant.d.ts +6 -0
  62. package/src/enums/ChipColor/ChipColor.d.ts +11 -0
  63. package/src/enums/ComponentSize/ComponentSize.d.ts +17 -0
  64. package/src/enums/ConnectionQualityLevel/ConnectionQualityLevel.enum.d.ts +7 -0
  65. package/src/enums/CrudAction/CrudAction.d.ts +7 -0
  66. package/src/enums/DefaultWorkspaceTabSettings/DefaultWorkspaceTabSettings.d.ts +10 -0
  67. package/src/enums/EmptyCause/EmptyCause.d.ts +6 -0
  68. package/src/enums/FormatDateMode/FormatDateMode.d.ts +9 -0
  69. package/src/enums/IconColor/IconColor.d.ts +17 -0
  70. package/src/enums/LoginOptions/LoginOptions.d.ts +6 -0
  71. package/src/enums/MessageColor/MessageColor.d.ts +9 -0
  72. package/src/enums/MessageVariant/MessageVariant.d.ts +6 -0
  73. package/src/enums/MimeTypes/MimeTypes.enum.d.ts +17 -0
  74. package/src/enums/ProcessingTableColumnType/ProcessingTableColumnType.d.ts +9 -0
  75. package/src/enums/QueueType/QueueType.enum.d.ts +28 -0
  76. package/src/enums/RelativeDatetimeValue/RelativeDatetimeValue.d.ts +8 -0
  77. package/src/enums/RingtoneType/RingtoneType.d.ts +6 -0
  78. package/src/enums/SingleSignOnProvider/SingleSignOnProvider.d.ts +8 -0
  79. package/src/enums/SingleSignOnProviderIconMappings/SingleSignOnProviderIconMappings.d.ts +7 -0
  80. package/src/enums/WebitelApplications/AdminSections.d.ts +46 -0
  81. package/src/enums/WebitelApplications/AuditorSections.d.ts +5 -0
  82. package/src/enums/WebitelApplications/CrmSections.d.ts +16 -0
  83. package/src/enums/WebitelApplications/SupervisorSections.d.ts +7 -0
  84. package/src/enums/WebitelApplications/WfmSections.d.ts +6 -0
  85. package/src/enums/WebitelApplications/WtApplication.d.ts +12 -0
  86. package/src/enums/WtObject/WtObject.d.ts +63 -0
  87. package/src/enums/WtTypeExtensionFieldKind/WtTypeExtensionFieldKind.d.ts +14 -0
  88. package/src/enums/index.d.ts +88 -0
  89. package/src/install.ts +2 -1
  90. package/src/mixins/validationMixin/regle/useRegleValidation.ts +4 -4
  91. package/src/mixins/validationMixin/useValidation.ts +8 -3
  92. package/src/mixins/validationMixin/vuelidate/useVuelidateValidation.ts +63 -40
  93. package/src/modules/CSVExport/composables/useCSVExport.ts +1 -1
  94. package/src/modules/CallSession/modules/ScreenSharing/screen-sharing.vue +1 -2
  95. package/src/modules/CallSession/modules/VideoCall/composables/useDocumentPiP/domTraversal.ts +2 -2
  96. package/src/modules/CallSession/modules/VideoCall/video-call.vue +1 -1
  97. package/src/modules/CallSession/types/index.ts +3 -3
  98. package/src/modules/UploadCsvPopup/composable/useUploadCsv.ts +1 -1
  99. package/src/modules/UploadCsvPopup/scripts/parseCSV.ts +1 -1
  100. package/src/modules/UserNotifications/maps/userNotificationConfigsMap.ts +10 -7
  101. package/src/modules/UserNotifications/stores/userNotificationsStore.ts +1 -0
  102. package/src/modules/UserNotifications/types/UserNotifications.ts +2 -1
  103. package/src/modules/Userinfo/constants/UserSettingsConstants.d.ts +1 -0
  104. package/src/scripts/__tests__/isEmpty.spec.js +1 -1
  105. package/src/scripts/downloadFile/types/downloadFile.types.ts +7 -1
  106. package/src/scripts/index.js +1 -1
  107. package/src/scripts/{isEmpty.js → isEmpty.ts} +10 -1
  108. package/src/scripts/normalizeDatetime.ts +4 -2
  109. package/src/utils/displayText.d.ts +2 -0
  110. package/src/utils/formatDate.d.ts +10 -0
  111. package/src/utils/index.d.ts +2 -0
  112. package/src/validations/config/errors/customZodErrorsHandler.ts +8 -4
  113. package/types/api/defaults/getDefaultInstance/getDefaultInstance.d.ts +1 -1
  114. package/types/components/_internals/composables/useSelect/useSelect.d.ts +2 -2
  115. package/types/components/_internals/composables/useSelect/useSelectCustomValues.d.ts +1 -4
  116. package/types/components/_internals/composables/useWtTable/useWtTable.d.ts +1 -0
  117. package/types/components/on-demand/wt-call-media-action/wt-call-media-action.vue.d.ts +2 -2
  118. package/types/components/on-demand/wt-selection-popup/wt-selection-popup.vue.d.ts +4 -4
  119. package/types/components/wt-action-bar/WtActionBarActionsOrder.d.ts +2 -2
  120. package/types/components/wt-action-bar/wt-action-bar.vue.d.ts +17 -17
  121. package/types/components/wt-badge-new/wt-badge.vue.d.ts +3 -2
  122. package/types/components/wt-button/wt-button.vue.d.ts +2 -1
  123. package/types/components/wt-datepicker/_internals/composables/useAutoSeparator.d.ts +17 -0
  124. package/types/components/wt-datepicker/_internals/composables/useDatepicker.d.ts +19 -0
  125. package/types/components/wt-datepicker/_internals/composables/usePreventZeroPad.d.ts +9 -5
  126. package/types/components/wt-datepicker/_internals/composables/useStrictInput.d.ts +17 -0
  127. package/types/components/wt-inline-add-panel/wt-inline-add-panel.vue.d.ts +3 -3
  128. package/types/components/wt-popup/wt-popup.vue.d.ts +2 -0
  129. package/types/components/wt-search-bar/wt-search-bar.vue.d.ts +2 -2
  130. package/types/components/wt-status-select/wt-status-select.vue.d.ts +2 -2
  131. package/types/components/wt-tree-table/wt-tree-table.vue.d.ts +1 -1
  132. package/types/composables/index.d.ts +1 -0
  133. package/types/composables/useEventBus/useEventBus.d.ts +11 -0
  134. package/types/mixins/validationMixin/regle/useRegleValidation.d.ts +2 -2
  135. package/types/mixins/validationMixin/useValidation.d.ts +9 -4
  136. package/types/mixins/validationMixin/validationMixin.d.ts +1 -1
  137. package/types/mixins/validationMixin/vuelidate/useVuelidateValidation.d.ts +14 -9
  138. package/types/modules/AgentPdfs/components/agent-pdfs-tab.vue.d.ts +4 -1
  139. package/types/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue.d.ts +2 -2
  140. package/types/modules/CallSession/types/index.d.ts +3 -3
  141. package/types/modules/TableComponentModule/composables/useTableEmpty.d.ts +1 -1
  142. package/types/modules/UploadCsvPopup/composable/useUploadCsv.d.ts +1 -1
  143. package/types/modules/UploadCsvPopup/scripts/parseCSV.d.ts +1 -1
  144. package/types/modules/UserNotifications/maps/userNotificationConfigsMap.d.ts +2 -2
  145. package/types/modules/UserNotifications/types/UserNotifications.d.ts +2 -1
  146. package/types/scripts/caseConverters.d.ts +1 -1
  147. package/types/scripts/downloadFile/types/downloadFile.types.d.ts +6 -1
  148. package/types/scripts/index.d.ts +1 -1
  149. package/types/scripts/isEmpty.d.ts +2 -1
  150. package/types/scripts/normalizeDatetime.d.ts +1 -1
  151. package/types/validations/config/errors/customZodErrorsHandler.d.ts +1 -1
  152. package/dist/useValidation-BedhHNX5.js +0 -37
  153. package/dist/vidstack-video-iy3-Vo1A.js +0 -2
  154. package/types/install.d.ts +0 -15
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Represents existing Webitel entities
3
+ */
4
+ export declare const WtObject: {
5
+ readonly Agent: 'agent';
6
+ readonly Queue: 'queue';
7
+ readonly Contact: 'contact';
8
+ readonly Region: 'region';
9
+ readonly User: 'user';
10
+ readonly Resource: 'resource';
11
+ readonly Device: 'device';
12
+ readonly License: 'license';
13
+ readonly Flow: 'flow';
14
+ readonly Dialplan: 'dialplan';
15
+ readonly Gateway: 'gateway';
16
+ readonly Chatplan: 'chatplan';
17
+ readonly ChatGateway: 'chatGateway';
18
+ readonly Blacklist: 'blacklist';
19
+ readonly Calendar: 'calendar';
20
+ readonly Communication: 'communication';
21
+ readonly PauseCause: 'pauseCause';
22
+ readonly Media: 'media';
23
+ readonly ShiftTemplate: 'shiftTemplate';
24
+ readonly PauseTemplate: 'pauseTemplate';
25
+ readonly WorkingCondition: 'workingCondition';
26
+ readonly Skill: 'skill';
27
+ readonly Bucket: 'bucket';
28
+ readonly Member: 'member';
29
+ readonly ResourceGroup: 'resourceGroup';
30
+ readonly Team: 'team';
31
+ readonly Storage: 'storage';
32
+ readonly CognitiveProfile: 'cognitiveProfile';
33
+ readonly EmailProfile: 'emailProfile';
34
+ readonly SingleSignOn: 'singleSignOn';
35
+ readonly ImportCsv: 'importCsv';
36
+ readonly Trigger: 'trigger';
37
+ readonly Role: 'role';
38
+ readonly Object: 'object';
39
+ readonly ChangeLog: 'changelog';
40
+ readonly Configuration: 'configuration';
41
+ readonly GlobalVariable: 'globalVariable';
42
+ readonly Call: 'call';
43
+ readonly RecordFile: 'recordFile';
44
+ readonly ContactGroup: 'contactGroup';
45
+ readonly Case: 'case';
46
+ readonly CaseComment: 'caseComment';
47
+ readonly Slas: 'slas';
48
+ readonly ServiceCatalog: 'serviceCatalog';
49
+ readonly CaseSource: 'caseSource';
50
+ readonly CloseReasonGroup: 'closeReasonGroup';
51
+ readonly Priorities: 'priorities';
52
+ readonly Status: 'status';
53
+ readonly Source: 'source';
54
+ readonly CustomLookup: 'customLookup';
55
+ readonly AuditForm: 'auditForm';
56
+ readonly AuditRating: 'auditRating';
57
+ readonly QuickReply: 'quickReply';
58
+ readonly ListNumber: 'listNumber';
59
+ readonly AgentWorkingCondition: 'agentWorkingCondition';
60
+ readonly FilePolicy: 'filePolicy';
61
+ readonly PortalUser: 'portalUser';
62
+ };
63
+ export type WtObject = (typeof WtObject)[keyof typeof WtObject];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @name FieldType
3
+ * @description Enumerates (ONLY!) the types of field type.
4
+ */
5
+ export declare const WtTypeExtensionFieldKind: {
6
+ readonly Text: 'string';
7
+ readonly Number: 'int32';
8
+ readonly Select: 'lookup';
9
+ readonly Multiselect: 'list';
10
+ readonly Calendar: 'datetime';
11
+ readonly Boolean: 'bool';
12
+ };
13
+ export type ExtensionFieldType =
14
+ (typeof WtTypeExtensionFieldKind)[keyof typeof WtTypeExtensionFieldKind];
@@ -0,0 +1,88 @@
1
+ import AbstractUserStatus from './AbstractUserStatus/AbstractUserStatus.enum.js';
2
+ import AgentStatus from './AgentStatus/AgentStatus.enum.js';
3
+ import { BroadcastChannelName } from './BroadcastChannelName/BroadcastChannelName';
4
+ import type {
5
+ UserSettingsBroadcastMessage,
6
+ WebphoneBroadcastMessage,
7
+ WebphoneBroadcastPayload,
8
+ } from './BroadcastChannelName/UserSettingsBroadcastMessage';
9
+ import { ButtonColor } from './ButtonColor/ButtonColor';
10
+ import { ButtonVariant } from './ButtonVariant/ButtonVariant';
11
+ import ChatGatewayProvider from './ChatGatewayProvider/ChatGatewayProvider.enum.js';
12
+ import ProviderIconType from './ChatGatewayProvider/ProviderIconType.enum';
13
+ import { ChipColor } from './ChipColor/ChipColor';
14
+ import { ComponentSize } from './ComponentSize/ComponentSize';
15
+ import {
16
+ ConnectionQualityLevels,
17
+ type ConnectionQualityLevelsType,
18
+ } from './ConnectionQualityLevel/ConnectionQualityLevel.enum';
19
+ import { CrudAction } from './CrudAction/CrudAction';
20
+ import { DefaultWorkspaceTabSettings } from './DefaultWorkspaceTabSettings/DefaultWorkspaceTabSettings';
21
+ import { EmptyCause } from './EmptyCause/EmptyCause';
22
+ import { FormatDateMode } from './FormatDateMode/FormatDateMode';
23
+ import IconAction from './IconAction/IconAction.enum.js';
24
+ import { IconColor } from './IconColor/IconColor';
25
+ import { LoginOptions } from './LoginOptions/LoginOptions';
26
+ import { MessageColor } from './MessageColor/MessageColor';
27
+ import { MessageVariant } from './MessageVariant/MessageVariant';
28
+ import { MimeTypes } from './MimeTypes/MimeTypes.enum';
29
+ import { ProcessingTableColumnType } from './ProcessingTableColumnType/ProcessingTableColumnType';
30
+ import { QueueType, QueueTypeName } from './QueueType/QueueType.enum';
31
+ import { RelativeDatetimeValue } from './RelativeDatetimeValue/RelativeDatetimeValue';
32
+ import { RingtoneType } from './RingtoneType/RingtoneType.js';
33
+ import { SingleSignOnProvider } from './SingleSignOnProvider/SingleSignOnProvider';
34
+ import { SingleSignOnProviderIconMappings } from './SingleSignOnProviderIconMappings/SingleSignOnProviderIconMappings';
35
+ import TypesExportedSettings from './TypesExportedSettings/TypesExportedSettings.enum.js';
36
+ import { AdminSections } from './WebitelApplications/AdminSections';
37
+ import { AuditorSections } from './WebitelApplications/AuditorSections';
38
+ import { CrmSections } from './WebitelApplications/CrmSections';
39
+ import { SupervisorSections } from './WebitelApplications/SupervisorSections';
40
+ import { WfmSections } from './WebitelApplications/WfmSections';
41
+ import { WtApplication } from './WebitelApplications/WtApplication';
42
+ import { WtObject } from './WtObject/WtObject';
43
+ import { WtTypeExtensionFieldKind } from './WtTypeExtensionFieldKind/WtTypeExtensionFieldKind';
44
+
45
+ export type {
46
+ ConnectionQualityLevelsType,
47
+ UserSettingsBroadcastMessage,
48
+ WebphoneBroadcastMessage,
49
+ WebphoneBroadcastPayload,
50
+ };
51
+ export {
52
+ AbstractUserStatus,
53
+ AdminSections,
54
+ AgentStatus,
55
+ AuditorSections,
56
+ BroadcastChannelName,
57
+ ButtonColor,
58
+ ButtonVariant,
59
+ ChatGatewayProvider,
60
+ ChipColor,
61
+ ComponentSize,
62
+ ConnectionQualityLevels,
63
+ CrmSections,
64
+ CrudAction,
65
+ DefaultWorkspaceTabSettings,
66
+ EmptyCause,
67
+ FormatDateMode,
68
+ IconAction,
69
+ IconColor,
70
+ LoginOptions,
71
+ MessageColor,
72
+ MessageVariant,
73
+ MimeTypes,
74
+ ProcessingTableColumnType,
75
+ ProviderIconType,
76
+ QueueType,
77
+ QueueTypeName,
78
+ RelativeDatetimeValue,
79
+ RingtoneType,
80
+ SingleSignOnProvider,
81
+ SingleSignOnProviderIconMappings,
82
+ SupervisorSections,
83
+ TypesExportedSettings,
84
+ WfmSections,
85
+ WtApplication,
86
+ WtObject,
87
+ WtTypeExtensionFieldKind,
88
+ };
package/src/install.ts CHANGED
@@ -7,6 +7,7 @@ import './css/tailwind.css';
7
7
  import { generateInstance } from '@webitel/api-services/api/axios';
8
8
  import { fillIconsRepository } from './assets/icons';
9
9
  import Components from './components'; // init all components
10
+ import { EVENT_BUS_INJECTION_KEY } from './composables/useEventBus/useEventBus';
10
11
  import Directives from './directives'; // init all directives
11
12
  import initPrimevue from './plugins/primevue/primevue.plugin';
12
13
 
@@ -23,7 +24,7 @@ export default {
23
24
  Object.keys(globals).forEach((globalKey) => {
24
25
  app.provide(globalKey, globals[globalKey]);
25
26
  });
26
- app.provide('$eventBus', eventBus);
27
+ app.provide(EVENT_BUS_INJECTION_KEY, eventBus);
27
28
  initPrimevue(app);
28
29
  },
29
30
  generateInstance,
@@ -2,23 +2,23 @@ import type { RegleFieldStatus } from '@regle/core';
2
2
  import { type ComputedRef, computed, type Ref } from 'vue';
3
3
 
4
4
  export type UseFieldValidationParams = {
5
- field: Ref<RegleFieldStatus<string>>;
5
+ field?: Ref<RegleFieldStatus<string>>;
6
6
  };
7
7
 
8
8
  export type UseFieldValidationReturn = {
9
9
  invalid: ComputedRef<boolean | null>; // null if is not validated
10
- validationText?: ComputedRef<string>;
10
+ validationText?: ComputedRef<string | undefined>;
11
11
  };
12
12
 
13
13
  export const useFieldValidation = ({
14
14
  field: fieldRef,
15
15
  }: UseFieldValidationParams): UseFieldValidationReturn => {
16
16
  const invalid = computed(() => {
17
- return fieldRef.value.$error;
17
+ return fieldRef?.value.$error ?? null;
18
18
  });
19
19
 
20
20
  const validationText = computed(() => {
21
- return fieldRef.value?.$errors?.at(0);
21
+ return fieldRef?.value?.$errors?.at(0);
22
22
  });
23
23
 
24
24
  return {
@@ -10,15 +10,20 @@ import {
10
10
  useFieldValidation as useVuelidateValidation,
11
11
  } from './vuelidate/useVuelidateValidation';
12
12
 
13
- type CompatVuelidateParams = {
14
- v: UseVuelidateFieldValidationParams['field'];
13
+ type UseValidationParams = {
14
+ /** vuelidate field validation (compat) */
15
+ v?: UseVuelidateFieldValidationParams['field'];
16
+ /** vuelidate custom validations (compat) */
17
+ customValidators?: UseVuelidateFieldValidationParams['customValidators'];
18
+ /** regle field validation */
19
+ regleValidation?: UseRegleFieldValidationParams['field'];
15
20
  };
16
21
 
17
22
  export const useValidation = ({
18
23
  v: vuelidateValidation,
19
24
  customValidators: inputCustomValidators, // vuelidate custom validations, compat
20
25
  regleValidation,
21
- }: UseRegleFieldValidationParams | CompatVuelidateParams) => {
26
+ }: UseValidationParams) => {
22
27
  const {
23
28
  isValidation: isVuelidateValidation,
24
29
  invalid: vuelidateInvalid,
@@ -1,10 +1,22 @@
1
1
  import type { Validation } from '@vuelidate/core';
2
- import { computed, isReactive, type Ref } from 'vue';
2
+ import {
3
+ type ComputedRef,
4
+ computed,
5
+ isReactive,
6
+ isRef,
7
+ type Ref,
8
+ unref,
9
+ } from 'vue';
3
10
  import { useI18n } from 'vue-i18n';
4
11
 
12
+ type CompatCustomValidator = {
13
+ name: string;
14
+ text: string;
15
+ };
16
+
5
17
  export type UseFieldValidationParams = {
6
- field: Ref<Validation>;
7
- customValidators?: Array<object>;
18
+ field?: Ref<Validation>;
19
+ customValidators?: CompatCustomValidator[];
8
20
  };
9
21
 
10
22
  export const useFieldValidation = ({
@@ -14,11 +26,15 @@ export const useFieldValidation = ({
14
26
  const { t } = useI18n();
15
27
 
16
28
  // support vue options api, where v is a reactive, not ref
17
- let v = inputV;
18
- let customValidators = inputCustomValidators;
29
+ let v: Ref<Validation> | ComputedRef<Validation | undefined> | undefined =
30
+ inputV;
31
+ let customValidators:
32
+ | CompatCustomValidator[]
33
+ | ComputedRef<CompatCustomValidator[] | undefined>
34
+ | undefined = inputCustomValidators;
19
35
 
20
- if (isReactive(v)) {
21
- v = computed(() => inputV);
36
+ if (isReactive(inputV)) {
37
+ v = computed(() => unref(inputV));
22
38
  customValidators = computed(() => inputCustomValidators);
23
39
  }
24
40
  // end
@@ -26,66 +42,73 @@ export const useFieldValidation = ({
26
42
  const isValidation = computed(
27
43
  () => !!v && !!v.value && !!Object.keys(v.value).length,
28
44
  );
29
- const invalid = computed(() => isValidation.value && v.value.$error);
45
+ const invalid = computed(() => isValidation.value && v?.value?.$error);
30
46
 
31
47
  const validationText = computed(() => {
32
48
  let validationText = '';
33
- if (isValidation.value && invalid.value) {
34
- if (v.value.required?.$invalid) validationText = t('validation.required');
35
- else if (v.value.numeric?.$invalid)
49
+ const validation = v?.value;
50
+ if (validation && isValidation.value && invalid.value) {
51
+ if (validation.required?.$invalid)
52
+ validationText = t('validation.required');
53
+ else if (validation.numeric?.$invalid)
36
54
  validationText = t('validation.numeric');
37
- else if (v.value.email?.$invalid) validationText = t('validation.email');
38
- else if (v.value.gatewayHostValidator?.$invalid)
55
+ else if (validation.email?.$invalid)
56
+ validationText = t('validation.email');
57
+ else if (validation.gatewayHostValidator?.$invalid)
39
58
  validationText = t('validation.gatewayHostValidator');
40
- else if (v.value.ipValidator?.$invalid)
59
+ else if (validation.ipValidator?.$invalid)
41
60
  validationText = t('validation.ipValidator');
42
- else if (v.value.macValidator?.$invalid)
61
+ else if (validation.macValidator?.$invalid)
43
62
  validationText = t('validation.macValidator');
44
- else if (v.value.minValue?.$invalid)
63
+ else if (validation.minValue?.$invalid)
45
64
  validationText = t('validation.minValue', {
46
- min: v.value.minValue.$params.min,
65
+ min: validation.minValue.$params.min,
47
66
  });
48
- else if (v.value.maxValue?.$invalid)
67
+ else if (validation.maxValue?.$invalid)
49
68
  validationText = t('validation.maxValue', {
50
- max: v.value.maxValue.$params.max,
69
+ max: validation.maxValue.$params.max,
51
70
  });
52
- else if (v.value.maxLength?.$invalid)
71
+ else if (validation.maxLength?.$invalid)
53
72
  validationText = t('validation.maxLength', {
54
- max: v.value.maxLength.$params.max,
73
+ max: validation.maxLength.$params.max,
55
74
  });
56
- else if (v.value.sipAccountValidator?.$invalid)
75
+ else if (validation.sipAccountValidator?.$invalid)
57
76
  validationText = t('validation.sipAccountValidator');
58
- else if (v.value.minLength?.$invalid)
77
+ else if (validation.minLength?.$invalid)
59
78
  validationText = t('validation.minLength', {
60
- min: v.value.minLength.$params.min,
79
+ min: validation.minLength.$params.min,
61
80
  });
62
- else if (v.value.url?.$invalid) validationText = `${t('validation.url')}`;
63
- else if (v.value.regExpValidator?.$invalid)
81
+ else if (validation.url?.$invalid)
82
+ validationText = `${t('validation.url')}`;
83
+ else if (validation.regExpValidator?.$invalid)
64
84
  validationText = `${t('validation.regExpValidator')}`;
65
- else if (v.value.sameAs?.$invalid)
85
+ else if (validation.sameAs?.$invalid)
66
86
  validationText = `${t('validation.sameAs')}`;
67
- else if (v.value.domainValidator?.$invalid)
87
+ else if (validation.domainValidator?.$invalid)
68
88
  validationText = `${t('validation.domainValidator')}`;
69
- else if (v.value.decimalValidator?.$invalid)
70
- validationText = `${t('validation.decimalValidator')} ${v.value.decimalValidator.$params.count}`;
71
- else if (v.value.websocketValidator?.$invalid)
89
+ else if (validation.decimalValidator?.$invalid)
90
+ validationText = `${t('validation.decimalValidator')} ${validation.decimalValidator.$params.count}`;
91
+ else if (validation.websocketValidator?.$invalid)
72
92
  validationText = `${t('validation.websocketValidator')}`;
73
- else if (v.value.integer?.$invalid)
93
+ else if (validation.integer?.$invalid)
74
94
  validationText = `${t('validation.integer')}`;
75
- else if (v.value.regex?.$invalid)
95
+ else if (validation.regex?.$invalid)
76
96
  validationText =
77
- v.value.regex?.$message ||
78
- `${t('validation.isRegExpMatched')} ${v.value.regex?.$params?.regex}`;
79
- else if (v.value.nameAlreadyInUse?.$invalid) {
97
+ validation.regex?.$message ||
98
+ `${t('validation.isRegExpMatched')} ${validation.regex?.$params?.regex}`;
99
+ else if (validation.nameAlreadyInUse?.$invalid) {
80
100
  validationText = t('validation.nameAlreadyInUse');
81
- } else if (v.value.phoneNumberSymbolsValidator?.$invalid) {
101
+ } else if (validation.phoneNumberSymbolsValidator?.$invalid) {
82
102
  validationText = t('validation.phoneNumberSymbolsValidator');
83
103
  }
84
104
  }
85
105
 
86
- if (customValidators?.value) {
87
- for (const { name, text } of customValidators.value) {
88
- if (v.value[name]?.$invalid) validationText = text;
106
+ const resolvedCustomValidators = isRef(customValidators)
107
+ ? customValidators.value
108
+ : undefined;
109
+ if (resolvedCustomValidators) {
110
+ for (const { name, text } of resolvedCustomValidators) {
111
+ if (validation?.[name]?.$invalid) validationText = text;
89
112
  }
90
113
  return validationText;
91
114
  }
@@ -41,7 +41,7 @@ export function useCSVExport({ selected }: { selected: Ref<number[]> }) {
41
41
 
42
42
  async function exportCSV(exportParams?: Record<string, unknown>) {
43
43
  const routeQuery = route.query;
44
- const params = {
44
+ const params: Record<string, unknown> = {
45
45
  ...(exportParams || routeQuery),
46
46
  size: CSV_EXPORT_BATCH_SIZE,
47
47
  };
@@ -34,8 +34,7 @@
34
34
 
35
35
  <script setup lang="ts">
36
36
  import { WtVidstackPlayer } from '@webitel/ui-sdk/components';
37
- import { defineEmits, useAttrs } from 'vue';
38
-
37
+ import { useAttrs } from 'vue';
39
38
  import {
40
39
  RecordingIndicator,
41
40
  ScreenSharingControlsPanel,
@@ -5,12 +5,12 @@ export const domTraversal = (
5
5
  if (root instanceof Element) {
6
6
  visit(root);
7
7
  if (root.shadowRoot) {
8
- for (const child of root.shadowRoot.children) {
8
+ for (const child of Array.from(root.shadowRoot.children)) {
9
9
  domTraversal(child, visit);
10
10
  }
11
11
  }
12
12
  }
13
- for (const child of root.children) {
13
+ for (const child of Array.from(root.children)) {
14
14
  domTraversal(child, visit);
15
15
  }
16
16
  };
@@ -274,7 +274,7 @@ const emitKeys = {
274
274
  [VideoCallAction.Settings]: `action:${VideoCallAction.Settings}`,
275
275
  [VideoCallAction.Chat]: `action:${VideoCallAction.Chat}`,
276
276
  [VideoCallAction.Hangup]: `action:${VideoCallAction.Hangup}`,
277
- };
277
+ } as const;
278
278
 
279
279
  const { t } = useI18n();
280
280
 
@@ -1,4 +1,4 @@
1
- import { ScreenSharingSession } from './ScreenSharingSession';
2
- import { ScreenshotStatus } from './ScreenshotStatus';
1
+ import type { ScreenSharingSession } from './ScreenSharingSession';
2
+ import type { ScreenshotStatus } from './ScreenshotStatus';
3
3
 
4
- export { ScreenSharingSession, ScreenshotStatus };
4
+ export type { ScreenSharingSession, ScreenshotStatus };
@@ -20,7 +20,7 @@ const useUploadCsv = ({ props, emit, skipHeaders, separator }) => {
20
20
  const parsedFile = ref(null);
21
21
  const isParsingPreview = ref(false);
22
22
  const parseErrorStackTrace = ref('');
23
- const csvPreview = ref([
23
+ const csvPreview = ref<unknown[]>([
24
24
  [],
25
25
  ]);
26
26
 
@@ -1,6 +1,6 @@
1
1
  import { parse } from 'csv-parse/browser/esm';
2
2
 
3
- const parseCSV = (csvStr, options = {}) =>
3
+ const parseCSV = (csvStr, options = {}): Promise<unknown[]> =>
4
4
  new Promise((resolve, reject) => {
5
5
  parse(
6
6
  csvStr,
@@ -1,21 +1,24 @@
1
- import { ApiUserWarningId } from '@webitel/api-services/gen/models';
1
+ import {
2
+ type ApiUserWarning,
3
+ ApiUserWarningId,
4
+ } from '@webitel/api-services/gen/models';
2
5
  import type { NotificationsType } from '../types/UserNotifications';
3
6
 
4
7
  const HOURS_IN_DAY = 24;
5
8
 
6
9
  export const USER_NOTIFICATION_CONFIGS_MAP = new Map<
7
10
  ApiUserWarningId,
8
- (warningId: ApiUserWarningId) => NotificationsType
11
+ (warning: ApiUserWarning) => NotificationsType
9
12
  >([
10
13
  [
11
14
  ApiUserWarningId.PasswordExpiresSoon,
12
15
  ({ warningData: data }) => ({
13
16
  type: 'info',
14
- localeKey: data.passwordExpiry.daysRemaining
17
+ localeKey: data?.passwordExpiry?.daysRemaining
15
18
  ? 'passwordExpirationMessageDays'
16
19
  : 'passwordExpirationMessageHours',
17
20
  params: {
18
- amount: data.passwordExpiry.daysRemaining || HOURS_IN_DAY,
21
+ amount: data?.passwordExpiry?.daysRemaining || HOURS_IN_DAY,
19
22
  },
20
23
  }),
21
24
  ],
@@ -25,8 +28,8 @@ export const USER_NOTIFICATION_CONFIGS_MAP = new Map<
25
28
  type: 'info',
26
29
  localeKey: 'licenseExpirationSoonMessage',
27
30
  params: {
28
- amount: data.licenseExpiry.daysRemaining,
29
- name: data.licenseExpiry.licenseName,
31
+ amount: data?.licenseExpiry?.daysRemaining,
32
+ name: data?.licenseExpiry?.licenseName,
30
33
  },
31
34
  }),
32
35
  ],
@@ -36,7 +39,7 @@ export const USER_NOTIFICATION_CONFIGS_MAP = new Map<
36
39
  type: 'info',
37
40
  localeKey: 'licenseExpirationMessage',
38
41
  params: {
39
- name: data.licenseExpiry.licenseName,
42
+ name: data?.licenseExpiry?.licenseName,
40
43
  },
41
44
  }),
42
45
  ],
@@ -59,6 +59,7 @@ export const createUserNotificationsStore = () => {
59
59
  const mapNotifications = (array: ApiUserWarning[]) => {
60
60
  return array
61
61
  .map((warning) => {
62
+ if (!warning.id) return null;
62
63
  const map = USER_NOTIFICATION_CONFIGS_MAP.get(warning.id);
63
64
  if (!map) return null;
64
65
  return map(warning);
@@ -1,5 +1,6 @@
1
1
  interface UserNotificationsConfigsParams {
2
- amount?: number;
2
+ /** generated API types serialize int64 counters as strings */
3
+ amount?: number | string;
3
4
  name?: string;
4
5
  }
5
6
 
@@ -0,0 +1 @@
1
+ export declare const TIMEZONE_STORAGE_KEY = 'user-timezone-setting';
@@ -1,4 +1,4 @@
1
- import isEmpty from '../isEmpty.js';
1
+ import isEmpty from '../isEmpty';
2
2
 
3
3
  describe('isEmpty', () => {
4
4
  it('falsy cases (not empty)', () => {
@@ -1,7 +1,13 @@
1
1
  import type { FileFormat } from './fileFormat.types';
2
2
 
3
+ /** Minimal shape of the (axios-style) HTTP response consumed by `downloadFile`. */
4
+ export interface DownloadFileResponse {
5
+ data: BlobPart;
6
+ headers?: Record<string, string | undefined>;
7
+ }
8
+
3
9
  export interface DownloadFileOptions {
4
- response: never;
10
+ response: DownloadFileResponse;
5
11
  fileFormat: FileFormat;
6
12
  filename?: string;
7
13
  mimetype?: string;
@@ -22,7 +22,7 @@ import downloadFile from './downloadFile/downloadFile';
22
22
  import eventBus from './eventBus.js';
23
23
  import { getConnectionQuality } from './getConnectionQuality.ts';
24
24
  import { getEndOfDay, getStartOfDay } from './getDefaultFilterDate.js';
25
- import isEmpty from './isEmpty.js';
25
+ import isEmpty from './isEmpty';
26
26
  import { wtlog } from './logger.js';
27
27
  import {
28
28
  isRelativeDatetimeValue,
@@ -1,6 +1,15 @@
1
+ type EmptyValue =
2
+ | undefined
3
+ | null
4
+ | ''
5
+ | 0
6
+ | false
7
+ | never[]
8
+ | Record<PropertyKey, never>;
9
+
1
10
  // checks if value is Falsy,
2
11
  // including empty arrays or objects
3
- const isEmpty = (value) => {
12
+ const isEmpty = <T>(value: T): value is Extract<T, EmptyValue> => {
4
13
  if (Array.isArray(value)) return !value.length;
5
14
  if (typeof value === 'object') return !value || !Object.keys(value).length;
6
15
  return !value;
@@ -24,8 +24,10 @@ export type NormalizeDatetimeOptions = {
24
24
  round?: RelativeDatetimeRoundOption;
25
25
  };
26
26
 
27
- export const isRelativeDatetimeValue = (value: string): boolean => {
28
- return Object.values(RelativeDatetimeValue).includes(value);
27
+ export const isRelativeDatetimeValue = (
28
+ value: string,
29
+ ): value is RelativeDatetimeValue => {
30
+ return (Object.values(RelativeDatetimeValue) as string[]).includes(value);
29
31
  };
30
32
 
31
33
  const convertRelativeDatetimeToTimestamp = (
@@ -0,0 +1,2 @@
1
+ export declare const EMPTY_SYMBOL = '-';
2
+ export declare const displayText: (text: string) => string;
@@ -0,0 +1,10 @@
1
+ import type { FormatDateMode } from '../enums';
2
+ export declare function formatDate(
3
+ date: string | number | Date,
4
+ to: (typeof FormatDateMode)[keyof typeof FormatDateMode],
5
+ {
6
+ timezone,
7
+ }?: {
8
+ timezone?: string;
9
+ },
10
+ ): string;
@@ -0,0 +1,2 @@
1
+ export * from './displayText';
2
+ export * from './formatDate';