@webitel/ui-sdk 24.12.101 → 24.12.115

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 (87) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{plyr.min-ClXVuhkx.js → plyr.min-BRLz1cd6.js} +1 -1
  3. package/dist/ui-sdk.css +1 -1
  4. package/dist/ui-sdk.js +9716 -9471
  5. package/dist/ui-sdk.umd.cjs +19 -19
  6. package/package.json +1 -1
  7. package/src/api/clients/roles/roles.js +1 -1
  8. package/src/components/wt-table/wt-table.vue +31 -2
  9. package/src/components/wt-tooltip/wt-tooltip.vue +10 -6
  10. package/src/composables/useAccessControl/v2/createUserAccessControl.ts +16 -6
  11. package/src/composables/useAccessControl/v2/types/CreateUserAccessControl.d.ts +2 -1
  12. package/src/composables/useWtTable/useWtTable.js +19 -20
  13. package/src/css/styleguide/placeholder/_placeholder.scss +0 -2
  14. package/src/enums/index.js +7 -7
  15. package/src/locale/en/en.js +80 -0
  16. package/src/locale/ru/ru.js +97 -0
  17. package/src/locale/ua/ua.js +97 -0
  18. package/src/modules/Filters/v2/filters/classes/FiltersManager.ts +3 -3
  19. package/src/modules/Filters/v2/filters/components/config/dynamic-filter-config-form-label.vue +2 -2
  20. package/src/modules/Filters/v2/filters/components/config/dynamic-filter-config-form.vue +13 -10
  21. package/src/modules/Filters/v2/filters/components/dynamic-filter-add-action.vue +17 -8
  22. package/src/modules/Filters/v2/filters/components/enums/amd-result-options.ts +38 -0
  23. package/src/modules/Filters/v2/filters/components/enums/boolean-options.ts +16 -0
  24. package/src/modules/Filters/v2/filters/components/enums/direction-options.ts +20 -0
  25. package/src/modules/Filters/v2/filters/components/enums/hangup-cause-options.ts +265 -0
  26. package/src/modules/Filters/v2/filters/components/enums/tag-options.ts +8 -0
  27. package/src/modules/Filters/v2/filters/components/preview/dynamic-filter-preview-info.vue +14 -27
  28. package/src/modules/Filters/v2/filters/components/preview/dynamic-filter-preview.vue +15 -6
  29. package/src/modules/Filters/v2/filters/components/values/_shared/durations/duration-filter-value-field.vue +48 -0
  30. package/src/modules/Filters/v2/filters/components/values/_shared/has-options/has-option-filter-value-field.vue +29 -0
  31. package/src/modules/Filters/v2/filters/components/values/agent/agent-filter-value-field.vue +57 -0
  32. package/src/modules/Filters/v2/filters/components/values/agent/agent-filter-value-preview.vue +32 -0
  33. package/src/modules/Filters/v2/filters/components/values/agent/config.js +4 -0
  34. package/src/modules/Filters/v2/filters/components/values/amd-result/amd-result-filter-value-field.vue +52 -0
  35. package/src/modules/Filters/v2/filters/components/values/amd-result/amd-result-filter-value-preview.vue +20 -0
  36. package/src/modules/Filters/v2/filters/components/values/cause/cause-filter-value-field.vue +52 -0
  37. package/src/modules/Filters/v2/filters/components/values/cause/cause-filter-value-preview.vue +19 -0
  38. package/src/modules/Filters/v2/filters/components/values/contact/config.js +4 -0
  39. package/src/modules/Filters/v2/filters/components/values/contact/contact-filter-value-field.vue +56 -0
  40. package/src/modules/Filters/v2/filters/components/values/contact/contact-filter-value-preview.vue +32 -0
  41. package/src/modules/Filters/v2/filters/components/values/created-at-from/created-at-from-filter-value-field.vue +23 -0
  42. package/src/modules/Filters/v2/filters/components/values/created-at-from/created-at-from-filter-value-preview.vue +15 -0
  43. package/src/modules/Filters/v2/filters/components/values/created-at-to/created-at-to-filter-value-field.vue +23 -0
  44. package/src/modules/Filters/v2/filters/components/values/created-at-to/created-at-to-filter-value-preview.vue +15 -0
  45. package/src/modules/Filters/v2/filters/components/values/direction/direction-filter-value-field.vue +51 -0
  46. package/src/modules/Filters/v2/filters/components/values/direction/direction-filter-value-preview.vue +17 -0
  47. package/src/modules/Filters/v2/filters/components/values/gateway/config.js +4 -0
  48. package/src/modules/Filters/v2/filters/components/values/gateway/gateway-filter-value-field.vue +56 -0
  49. package/src/modules/Filters/v2/filters/components/values/gateway/gateway-filter-value-preview.vue +32 -0
  50. package/src/modules/Filters/v2/filters/components/values/grantee/config.js +4 -0
  51. package/src/modules/Filters/v2/filters/components/values/grantee/grantee-filter-value-field.vue +56 -0
  52. package/src/modules/Filters/v2/filters/components/values/grantee/grantee-filter-value-preview.vue +32 -0
  53. package/src/modules/Filters/v2/filters/components/values/has-file/has-file-filter-value-field.vue +43 -0
  54. package/src/modules/Filters/v2/filters/components/values/has-file/has-file-filter-value-preview.vue +22 -0
  55. package/src/modules/Filters/v2/filters/components/values/has-transcription/has-transcription-filter-value-field.vue +43 -0
  56. package/src/modules/Filters/v2/filters/components/values/has-transcription/has-transcription-filter-value-preview.vue +22 -0
  57. package/src/modules/Filters/v2/filters/components/values/index.js +87 -0
  58. package/src/modules/Filters/v2/filters/components/values/queue/config.js +4 -0
  59. package/src/modules/Filters/v2/filters/components/values/queue/queue-filter-value-field.vue +56 -0
  60. package/src/modules/Filters/v2/filters/components/values/queue/queue-filter-value-preview.vue +32 -0
  61. package/src/modules/Filters/v2/filters/components/values/rated/rated-filter-value-field.vue +43 -0
  62. package/src/modules/Filters/v2/filters/components/values/rated/rated-filter-value-preview.vue +22 -0
  63. package/src/modules/Filters/v2/filters/components/values/rated-by/config.js +4 -0
  64. package/src/modules/Filters/v2/filters/components/values/rated-by/rated-by-filter-value-field.vue +56 -0
  65. package/src/modules/Filters/v2/filters/components/values/rated-by/rated-by-filter-value-preview.vue +32 -0
  66. package/src/modules/Filters/v2/filters/components/values/score/score-from-to-filter-value-field.vue +99 -0
  67. package/src/modules/Filters/v2/filters/components/values/score/score-from-to-filter-value-preview.vue +37 -0
  68. package/src/modules/Filters/v2/filters/components/values/tag/tag-filter-value-field.vue +52 -0
  69. package/src/modules/Filters/v2/filters/components/values/tag/tag-filter-value-preview.vue +18 -0
  70. package/src/modules/Filters/v2/filters/components/values/talk-duration/talk-duration-filter-value-field.vue +19 -0
  71. package/src/modules/Filters/v2/filters/components/values/talk-duration/talk-duration-filter-value-preview.vue +44 -0
  72. package/src/modules/Filters/v2/filters/components/values/team/config.js +4 -0
  73. package/src/modules/Filters/v2/filters/components/values/team/team-filter-value-field.vue +56 -0
  74. package/src/modules/Filters/v2/filters/components/values/team/team-filter-value-preview.vue +32 -0
  75. package/src/modules/Filters/v2/filters/components/values/total-duration/total-duration-filter-value-field.vue +19 -0
  76. package/src/modules/Filters/v2/filters/components/values/total-duration/total-duration-filter-value-preview.vue +44 -0
  77. package/src/modules/Filters/v2/filters/components/values/user/config.js +4 -0
  78. package/src/modules/Filters/v2/filters/components/values/user/user-filter-value-field.vue +56 -0
  79. package/src/modules/Filters/v2/filters/components/values/user/user-filter-value-preview.vue +32 -0
  80. package/src/modules/Filters/v2/filters/components/values/variable/variable-filter-value-field.vue +51 -0
  81. package/src/modules/Filters/v2/filters/components/values/variable/variable-filter-value-preview.vue +36 -0
  82. package/src/modules/Filters/v2/filters/types/Filter.d.ts +5 -0
  83. package/src/modules/Filters/v2/table/createTableStore.store.ts +12 -1
  84. package/src/modules/Filters/v2/types/tableStore.types.ts +1 -0
  85. package/src/modules/Filters/v2/filters/components/values/users/config.js +0 -4
  86. package/src/modules/Filters/v2/filters/components/values/users/user-filter-value-field.vue +0 -35
  87. package/src/modules/Filters/v2/filters/components/values/users/user-filter-value-preview.vue +0 -13
@@ -5,8 +5,10 @@
5
5
  :label="t('webitelUI.filters.filterName')"
6
6
  :options="options"
7
7
  :value="filterName"
8
- use-value-from-options-by-prop="id"
9
- @input="filterName = $event"
8
+ :clearable="false"
9
+ track-by="value"
10
+ use-value-from-options-by-prop="value"
11
+ @input="onFilterNameUpdate($event)"
10
12
  />
11
13
 
12
14
  <slot
@@ -22,7 +24,7 @@
22
24
 
23
25
  <dynamic-filter-config-form-label
24
26
  :value="filterLabel"
25
- @update:value="onLabelValueUpdate"
27
+ @update:model-value="onLabelValueUpdate"
26
28
  @update:invalid="(v) => (invalid = v)"
27
29
  />
28
30
 
@@ -51,13 +53,9 @@ import deepcopy from 'deep-copy';
51
53
  import { ref, watch } from 'vue';
52
54
  import { useI18n } from 'vue-i18n';
53
55
 
54
- import WtButton from '../../../../../../../components/wt-button/wt-button.vue';
55
- import WtSelect from '../../../../../../../components/wt-select/wt-select.vue';
56
- import type {
57
- FilterInitParams,
58
- FilterName,
59
- IFilter,
60
- } from '../../../types/Filter';
56
+ import WtButton from '../../../../../../components/wt-button/wt-button.vue';
57
+ import WtSelect from '../../../../../../components/wt-select/wt-select.vue';
58
+ import type { FilterInitParams, FilterName, IFilter } from '../../types/Filter';
61
59
  import DynamicFilterConfigFormLabel from './dynamic-filter-config-form-label.vue';
62
60
 
63
61
  interface FilterNameSelectRepresentation {
@@ -100,6 +98,11 @@ const onLabelValueUpdate = (val: string) => {
100
98
  touchedLabel.value = true;
101
99
  };
102
100
 
101
+ const onFilterNameUpdate = (val: string) => {
102
+ filterName.value = val;
103
+ filterValue.value = null;
104
+ };
105
+
103
106
  const submit = () => {
104
107
  emit('submit', {
105
108
  name: filterName.value,
@@ -9,8 +9,13 @@
9
9
  </div>
10
10
  </template>
11
11
 
12
- <template #content>
13
- <slot name="form"> filter form should be here</slot>
12
+ <template #content="slotScope">
13
+ <slot
14
+ name="form"
15
+ v-bind="slotScope"
16
+ >
17
+ filter form should be here
18
+ </slot>
14
19
  </template>
15
20
  </dynamic-filter-config-view>
16
21
  </template>
@@ -31,12 +36,16 @@ const { t } = useI18n();
31
36
  </script>
32
37
 
33
38
  <style lang="scss" scoped>
34
- .dynamic-filter-add-action-wrapper {
39
+ .dynamic-filter-add-action {
35
40
  display: flex;
36
- align-items: center;
37
- justify-content: center;
38
- width: fit-content;
39
- cursor: pointer;
40
- gap: var(--spacing-2xs);
41
+
42
+ &-wrapper {
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ width: fit-content;
47
+ cursor: pointer;
48
+ gap: var(--spacing-2xs);
49
+ }
41
50
  }
42
51
  </style>
@@ -0,0 +1,38 @@
1
+ import { FilterInitParams } from '../../types/Filter';
2
+
3
+ /**
4
+ * AMD Result to filter
5
+ * @enum
6
+ * @readonly
7
+ */
8
+
9
+ export const AmdResultOptions: Array<FilterInitParams> = [
10
+ {
11
+ name: 'NOTSURE',
12
+ value: 'NOTSURE',
13
+ },
14
+ {
15
+ name: 'HUMAN',
16
+ value: 'HUMAN',
17
+ },
18
+ {
19
+ name: 'MACHINE',
20
+ value: 'MACHINE',
21
+ },
22
+ {
23
+ name: 'CANCEL',
24
+ value: 'CANCEL',
25
+ },
26
+ {
27
+ name: 'SILENCE',
28
+ value: 'SILENCE',
29
+ },
30
+ {
31
+ name: 'VOICEMAIL',
32
+ value: 'VOICEMAIL',
33
+ },
34
+ {
35
+ name: 'RINGING',
36
+ value: 'RINGING',
37
+ },
38
+ ] as const;
@@ -0,0 +1,16 @@
1
+ /*
2
+ values are strings instead of booleans because restoration from url query
3
+ returns string for any type of value [DEV-3924]
4
+ */
5
+ import { FilterEnumOption } from '../../types/Filter.js';
6
+
7
+ export const BooleanOptions: Array<FilterEnumOption> = [
8
+ {
9
+ locale: 'vocabulary.yes',
10
+ value: true,
11
+ },
12
+ {
13
+ locale: 'vocabulary.no',
14
+ value: false,
15
+ },
16
+ ] as const;
@@ -0,0 +1,20 @@
1
+ import { CallDirection } from 'webitel-sdk';
2
+
3
+ export type CallDirectionType =
4
+ (typeof CallDirection)[keyof typeof CallDirection];
5
+
6
+ export type DirectionOption = {
7
+ locale: [string, number];
8
+ value: CallDirectionType;
9
+ };
10
+
11
+ export const DirectionOptions: readonly DirectionOption[] = [
12
+ {
13
+ locale: [`calls.direction.${CallDirection.Inbound}`, 2],
14
+ value: CallDirection.Inbound,
15
+ },
16
+ {
17
+ locale: [`calls.direction.${CallDirection.Outbound}`, 2],
18
+ value: CallDirection.Outbound,
19
+ },
20
+ ] as const;
@@ -0,0 +1,265 @@
1
+ import { FilterInitParams } from '../../types/Filter';
2
+
3
+ /**
4
+ * Hangup causes to filter
5
+ * @enum
6
+ * @readonly
7
+ */
8
+ export const HangupCauseOptions: Array<FilterInitParams> = [
9
+ {
10
+ name: 'UNSPECIFIED',
11
+ value: 'UNSPECIFIED',
12
+ },
13
+ {
14
+ name: 'UNALLOCATED_NUMBER',
15
+ value: 'UNALLOCATED_NUMBER',
16
+ },
17
+ {
18
+ name: 'NO_ROUTE_TRANSIT_NET',
19
+ value: 'NO_ROUTE_TRANSIT_NET',
20
+ },
21
+ {
22
+ name: 'NO_ROUTE_DESTINATION',
23
+ value: 'NO_ROUTE_DESTINATION',
24
+ },
25
+ {
26
+ name: 'CHANNEL_UNACCEPTABLE',
27
+ value: 'CHANNEL_UNACCEPTABLE',
28
+ },
29
+ {
30
+ name: 'CALL_AWARDED_DELIVERED',
31
+ value: 'CALL_AWARDED_DELIVERED',
32
+ },
33
+ {
34
+ name: 'NORMAL_CLEARING',
35
+ value: 'NORMAL_CLEARING',
36
+ },
37
+ {
38
+ name: 'USER_BUSY',
39
+ value: 'USER_BUSY',
40
+ },
41
+ {
42
+ name: 'NO_USER_RESPONSE',
43
+ value: 'NO_USER_RESPONSE',
44
+ },
45
+ {
46
+ name: 'NO_ANSWER',
47
+ value: 'NO_ANSWER',
48
+ },
49
+ {
50
+ name: 'SUBSCRIBER_ABSENT',
51
+ value: 'SUBSCRIBER_ABSENT',
52
+ },
53
+ {
54
+ name: 'CALL_REJECTED',
55
+ value: 'CALL_REJECTED',
56
+ },
57
+ {
58
+ name: 'NUMBER_CHANGED',
59
+ value: 'NUMBER_CHANGED',
60
+ },
61
+ {
62
+ name: 'REDIRECTION_TO_NEW_DESTINATION',
63
+ value: 'REDIRECTION_TO_NEW_DESTINATION',
64
+ },
65
+ {
66
+ name: 'EXCHANGE_ROUTING_ERROR',
67
+ value: 'EXCHANGE_ROUTING_ERROR',
68
+ },
69
+ {
70
+ name: 'DESTINATION_OUT_OF_ORDER',
71
+ value: 'DESTINATION_OUT_OF_ORDER',
72
+ },
73
+ {
74
+ name: 'INVALID_NUMBER_FORMAT',
75
+ value: 'INVALID_NUMBER_FORMAT',
76
+ },
77
+ {
78
+ name: 'FACILITY_REJECTED',
79
+ value: 'FACILITY_REJECTED',
80
+ },
81
+ {
82
+ name: 'RESPONSE_TO_STATUS_ENQUIRY',
83
+ value: 'RESPONSE_TO_STATUS_ENQUIRY',
84
+ },
85
+ {
86
+ name: 'NORMAL_UNSPECIFIED',
87
+ value: 'NORMAL_UNSPECIFIED',
88
+ },
89
+ {
90
+ name: 'NORMAL_CIRCUIT_CONGESTION',
91
+ value: 'NORMAL_CIRCUIT_CONGESTION',
92
+ },
93
+ {
94
+ name: 'NETWORK_OUT_OF_ORDER',
95
+ value: 'NETWORK_OUT_OF_ORDER',
96
+ },
97
+ {
98
+ name: 'NORMAL_TEMPORARY_FAILURE',
99
+ value: 'NORMAL_TEMPORARY_FAILURE',
100
+ },
101
+ {
102
+ name: 'SWITCH_CONGESTION',
103
+ value: 'SWITCH_CONGESTION',
104
+ },
105
+ {
106
+ name: 'ACCESS_INFO_DISCARDED',
107
+ value: 'ACCESS_INFO_DISCARDED',
108
+ },
109
+ {
110
+ name: 'REQUESTED_CHAN_UNAVAIL',
111
+ value: 'REQUESTED_CHAN_UNAVAIL',
112
+ },
113
+ {
114
+ name: 'PRE_EMPTED',
115
+ value: 'PRE_EMPTED',
116
+ },
117
+ {
118
+ name: 'FACILITY_NOT_SUBSCRIBED',
119
+ value: 'FACILITY_NOT_SUBSCRIBED',
120
+ },
121
+ {
122
+ name: 'OUTGOING_CALL_BARRED',
123
+ value: 'OUTGOING_CALL_BARRED',
124
+ },
125
+ {
126
+ name: 'INCOMING_CALL_BARRED',
127
+ value: 'INCOMING_CALL_BARRED',
128
+ },
129
+ {
130
+ name: 'BEARERCAPABILITY_NOTAUTH',
131
+ value: 'BEARERCAPABILITY_NOTAUTH',
132
+ },
133
+ {
134
+ name: 'BEARERCAPABILITY_NOTAVAIL',
135
+ value: 'BEARERCAPABILITY_NOTAVAIL',
136
+ },
137
+ {
138
+ name: 'SERVICE_UNAVAILABLE',
139
+ value: 'SERVICE_UNAVAILABLE',
140
+ },
141
+ {
142
+ name: 'BEARERCAPABILITY_NOTIMPL',
143
+ value: 'BEARERCAPABILITY_NOTIMPL',
144
+ },
145
+ {
146
+ name: 'CHAN_NOT_IMPLEMENTED',
147
+ value: 'CHAN_NOT_IMPLEMENTED',
148
+ },
149
+ {
150
+ name: 'FACILITY_NOT_IMPLEMENTED',
151
+ value: 'FACILITY_NOT_IMPLEMENTED',
152
+ },
153
+ {
154
+ name: 'SERVICE_NOT_IMPLEMENTED',
155
+ value: 'SERVICE_NOT_IMPLEMENTED',
156
+ },
157
+ {
158
+ name: 'INVALID_CALL_REFERENCE',
159
+ value: 'INVALID_CALL_REFERENCE',
160
+ },
161
+ {
162
+ name: 'INCOMPATIBLE_DESTINATION',
163
+ value: 'INCOMPATIBLE_DESTINATION',
164
+ },
165
+ {
166
+ name: 'INVALID_MSG_UNSPECIFIED',
167
+ value: 'INVALID_MSG_UNSPECIFIED',
168
+ },
169
+ {
170
+ name: 'MANDATORY_IE_MISSING',
171
+ value: 'MANDATORY_IE_MISSING',
172
+ },
173
+ {
174
+ name: 'MESSAGE_TYPE_NONEXIST',
175
+ value: 'MESSAGE_TYPE_NONEXIST',
176
+ },
177
+ {
178
+ name: 'WRONG_MESSAGE',
179
+ value: 'WRONG_MESSAGE',
180
+ },
181
+ {
182
+ name: 'IE_NONEXIST',
183
+ value: 'IE_NONEXIST',
184
+ },
185
+ {
186
+ name: 'INVALID_IE_CONTENTS',
187
+ value: 'INVALID_IE_CONTENTS',
188
+ },
189
+ {
190
+ name: 'WRONG_CALL_STATE',
191
+ value: 'WRONG_CALL_STATE',
192
+ },
193
+ {
194
+ name: 'RECOVERY_ON_TIMER_EXPIRE',
195
+ value: 'RECOVERY_ON_TIMER_EXPIRE',
196
+ },
197
+ {
198
+ name: 'MANDATORY_IE_LENGTH_ERROR',
199
+ value: 'MANDATORY_IE_LENGTH_ERROR',
200
+ },
201
+ {
202
+ name: 'PROTOCOL_ERROR',
203
+ value: 'PROTOCOL_ERROR',
204
+ },
205
+ {
206
+ name: 'INTERWORKING',
207
+ value: 'INTERWORKING',
208
+ },
209
+ {
210
+ name: 'ORIGINATOR_CANCEL',
211
+ value: 'ORIGINATOR_CANCEL',
212
+ },
213
+ {
214
+ name: 'CRASH',
215
+ value: 'CRASH',
216
+ },
217
+ {
218
+ name: 'SYSTEM_SHUTDOWN',
219
+ value: 'SYSTEM_SHUTDOWN',
220
+ },
221
+ {
222
+ name: 'LOSE_RACE',
223
+ value: 'LOSE_RACE',
224
+ },
225
+ {
226
+ name: 'MANAGER_REQUEST',
227
+ value: 'MANAGER_REQUEST',
228
+ },
229
+ {
230
+ name: 'BLIND_TRANSFER',
231
+ value: 'BLIND_TRANSFER',
232
+ },
233
+ {
234
+ name: 'ATTENDED_TRANSFER',
235
+ value: 'ATTENDED_TRANSFER',
236
+ },
237
+ {
238
+ name: 'ALLOTTED_TIMEOUT',
239
+ value: 'ALLOTTED_TIMEOUT',
240
+ },
241
+ {
242
+ name: 'USER_CHALLENGE',
243
+ value: 'USER_CHALLENGE',
244
+ },
245
+ {
246
+ name: 'MEDIA_TIMEOUT',
247
+ value: 'MEDIA_TIMEOUT',
248
+ },
249
+ {
250
+ name: 'PICKED_OFF',
251
+ value: 'PICKED_OFF',
252
+ },
253
+ {
254
+ name: 'USER_NOT_REGISTERED',
255
+ value: 'USER_NOT_REGISTERED',
256
+ },
257
+ {
258
+ name: 'PROGRESS_TIMEOUT',
259
+ value: 'PROGRESS_TIMEOUT',
260
+ },
261
+ {
262
+ name: 'GATEWAY_DOWN',
263
+ value: 'GATEWAY_DOWN',
264
+ },
265
+ ] as const;
@@ -0,0 +1,8 @@
1
+ import { FilterEnumOption } from '../../types/Filter.js';
2
+
3
+ export const TagOptions: Array<FilterEnumOption> = [
4
+ {
5
+ locale: 'filters.tag.options.vm',
6
+ value: 'vm',
7
+ },
8
+ ] as const;
@@ -1,38 +1,19 @@
1
1
  <template>
2
2
  <section class="dynamic-filter-preview-info">
3
- <header class="dynamic-filter-preview-info-header">
4
- {{ props.name }}
3
+ <header class="dynamic-filter-preview-info__header">
4
+ <slot name="header"/>
5
5
  </header>
6
6
 
7
7
  <wt-divider />
8
8
 
9
- <!-- TODO: how to visually represent id/value types? -->
10
- <ul v-if="isArrayValue">
11
- <li
12
- v-for="(el, index) of value"
13
- :key="index"
14
- >
15
- {{ el }}
16
- </li>
17
- </ul>
9
+ <div class="dynamic-filter-preview-info__body">
10
+ <slot name="default" />
11
+ </div>
18
12
 
19
- <article v-else>
20
- {{ props.value }}
21
- </article>
22
13
  </section>
23
14
  </template>
24
15
 
25
16
  <script lang="ts" setup>
26
- import type { FilterName, FilterValue } from '../../types/Filter';
27
-
28
- interface Props {
29
- name: FilterName;
30
- value: FilterValue;
31
- }
32
-
33
- const props = defineProps<Props>();
34
-
35
- const isArrayValue = Array.isArray(props.value);
36
17
  </script>
37
18
 
38
19
  <style lang="scss" scoped>
@@ -40,9 +21,15 @@ const isArrayValue = Array.isArray(props.value);
40
21
  display: flex;
41
22
  flex-direction: column;
42
23
  gap: var(--spacing-xs);
43
- }
44
24
 
45
- .dynamic-filter-preview-info-header {
46
- @extend %typo-subtitle-1;
25
+ &__header {
26
+ @extend %typo-subtitle-1;
27
+ }
28
+
29
+ &__body {
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: var(--spacing-xs);
33
+ }
47
34
  }
48
35
  </style>
@@ -4,7 +4,7 @@
4
4
  <wt-tooltip :disabled="configFormVisible">
5
5
  <template #activator>
6
6
  <wt-chip color="primary">
7
- {{ props.filter.label || props.filter.name }}
7
+ {{ props.filter.label || t(`webitelUI.filters.${props.filter.name}`) }}
8
8
  <wt-icon-btn
9
9
  icon="close--filled"
10
10
  size="sm"
@@ -14,10 +14,16 @@
14
14
  </template>
15
15
 
16
16
  <template #default>
17
- <dynamic-filter-preview-info
18
- :name="props.filter.name"
19
- :value="props.filter.value"
20
- />
17
+ <dynamic-filter-preview-info>
18
+ <template #header>
19
+ {{ t(`webitelUI.filters.${props.filter.name}`) }}
20
+ </template>
21
+
22
+ <template>
23
+ <slot name="info" />
24
+ </template>
25
+ </dynamic-filter-preview-info>
26
+
21
27
  </template>
22
28
  </wt-tooltip>
23
29
  </template>
@@ -34,12 +40,15 @@ import WtIconBtn from '../../../../../../components/wt-icon-btn/wt-icon-btn.vue'
34
40
  import WtTooltip from '../../../../../../components/wt-tooltip/wt-tooltip.vue';
35
41
  import type { IFilter } from '../../types/Filter';
36
42
  import DynamicFilterConfigView from '../config/dynamic-filter-config-view.vue';
37
- import DynamicFilterPreviewInfo from './dynamic-filter-preview-info.vue';
43
+ import DynamicFilterPreviewInfo from "./dynamic-filter-preview-info.vue";
44
+ import {useI18n} from "vue-i18n";
38
45
 
39
46
  interface Props {
40
47
  filter: IFilter;
41
48
  }
42
49
 
50
+ const { t } = useI18n();
51
+
43
52
  const props = defineProps<Props>();
44
53
 
45
54
  const emit = defineEmits<{
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div class="duration-filter">
3
+ <wt-timepicker
4
+ v-if="model"
5
+ :label="t('reusable.from')"
6
+ :value="model.from"
7
+ format="mm:ss"
8
+ @input="handleInput('from', $event)"
9
+ />
10
+ <wt-timepicker
11
+ v-if="model"
12
+ :label="t('reusable.to')"
13
+ :value="model.to"
14
+ format="mm:ss"
15
+ @input="handleInput('to', $event)"
16
+ />
17
+ </div>
18
+ </template>
19
+
20
+ <script lang="ts" setup>
21
+ import {useI18n} from "vue-i18n";
22
+
23
+ const {t} = useI18n();
24
+
25
+ type ModelValue = {
26
+ from: number;
27
+ to: number;
28
+ };
29
+
30
+ const model = defineModel<ModelValue>();
31
+
32
+ if (!model.value) {
33
+ model.value = {
34
+ from: 0,
35
+ to: 0,
36
+ };
37
+ }
38
+
39
+ const handleInput = (key: keyof ModelValue, value: number) => {
40
+ const newValue = { ...model.value };
41
+ newValue[key] = value;
42
+ model.value = newValue;
43
+ };
44
+ </script>
45
+
46
+ <style lang="scss" scoped>
47
+ //.duration-filter {}
48
+ </style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <wt-select
3
+ v-bind="attrs"
4
+ :clearable="false"
5
+ :options="BooleanOptions"
6
+ :value="model"
7
+ :label="t('webitelUI.filters.filterValue')"
8
+ class="has-option-filter-value-field"
9
+ track-by="value"
10
+ use-value-from-options-by-prop="value"
11
+ @input="model = $event"
12
+ />
13
+ </template>
14
+
15
+ <script lang="ts" setup>
16
+ import { useAttrs } from 'vue';
17
+ import { useI18n } from 'vue-i18n';
18
+
19
+ import WtSelect from '../../../../../../../../components/wt-select/wt-select.vue';
20
+ import { BooleanOptions } from '../../../enums/boolean-options';
21
+
22
+ const model = defineModel<string>();
23
+
24
+ const attrs = useAttrs();
25
+
26
+ const { t } = useI18n();
27
+ </script>
28
+
29
+ <style lang="scss" scoped></style>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <wt-select
3
+ :close-on-select="false"
4
+ :label="t('webitelUI.filters.filterValue')"
5
+ :search-method="searchMethod"
6
+ :value="model"
7
+ :v="v$.model"
8
+ multiple
9
+ use-value-from-options-by-prop="id"
10
+ @input="handleInput"
11
+ />
12
+ </template>
13
+
14
+ <script lang="ts" setup>
15
+ import { useVuelidate } from '@vuelidate/core';
16
+ import { required } from '@vuelidate/validators';
17
+ import { computed, watch } from 'vue';
18
+ import { useI18n } from 'vue-i18n';
19
+
20
+ import WtSelect from '../../../../../../../components/wt-select/wt-select.vue';
21
+ import { searchMethod } from './config.js';
22
+
23
+ type ModelValue = number[];
24
+
25
+ const model = defineModel<ModelValue>();
26
+
27
+ const emit = defineEmits<{
28
+ 'update:invalid': [boolean];
29
+ }>();
30
+
31
+ const { t } = useI18n();
32
+
33
+ const v$ = useVuelidate(
34
+ computed(() => ({
35
+ model: {
36
+ required,
37
+ },
38
+ })),
39
+ { model },
40
+ { $autoDirty: true },
41
+ );
42
+ v$.value.$touch();
43
+
44
+ watch(
45
+ () => v$.value.$invalid,
46
+ (invalid) => {
47
+ emit('update:invalid', invalid);
48
+ },
49
+ { immediate: true },
50
+ );
51
+
52
+ const handleInput = (value: ModelValue) => {
53
+ model.value = value;
54
+ };
55
+ </script>
56
+
57
+ <style lang="scss" scoped></style>