@webitel/ui-datalist 1.0.82 → 1.0.83

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 (43) hide show
  1. package/package.json +1 -1
  2. package/src/modules/filters/modules/filterConfig/components/agent-status/agent-status-filter-value-field.vue +68 -0
  3. package/src/modules/filters/modules/filterConfig/components/agent-status/agent-status-filter-value-preview.vue +35 -0
  4. package/src/modules/filters/modules/filterConfig/components/auditor/auditor-filter-value-field.vue +69 -0
  5. package/src/modules/filters/modules/filterConfig/components/auditor/auditor-filter-value-preview.vue +15 -0
  6. package/src/modules/filters/modules/filterConfig/components/auditor/index.ts +21 -0
  7. package/src/modules/filters/modules/filterConfig/components/index.ts +44 -0
  8. package/src/modules/filters/modules/filterConfig/components/queue-period/queue-period-filter-value-field.vue +1 -0
  9. package/src/modules/filters/modules/filterConfig/components/queue-type/queue-type-filter-value-field.vue +1 -0
  10. package/src/modules/filters/modules/filterConfig/components/region/index.ts +20 -0
  11. package/src/modules/filters/modules/filterConfig/components/region/region-filter-value-field.vue +69 -0
  12. package/src/modules/filters/modules/filterConfig/components/region/region-filter-value-preview.vue +15 -0
  13. package/src/modules/filters/modules/filterConfig/components/skill/index.ts +21 -0
  14. package/src/modules/filters/modules/filterConfig/components/skill/skill-filter-value-field.vue +69 -0
  15. package/src/modules/filters/modules/filterConfig/components/skill/skill-filter-value-preview.vue +15 -0
  16. package/src/modules/filters/modules/filterConfig/components/supervisor/index.ts +21 -0
  17. package/src/modules/filters/modules/filterConfig/components/supervisor/supervisor-filter-value-field.vue +69 -0
  18. package/src/modules/filters/modules/filterConfig/components/supervisor/supervisor-filter-value-preview.vue +15 -0
  19. package/src/modules/filters/modules/filterConfig/components/utilization-progress/utilization-progress-filter-value-field.vue +66 -0
  20. package/src/modules/filters/modules/filterConfig/components/utilization-progress/utilization-progress-filter-value-preview.vue +19 -0
  21. package/src/modules/filters/modules/filterConfig/composables/useAgentStatusOptions.ts +23 -0
  22. package/src/modules/filters/modules/filterConfig/enums/FilterOption.ts +7 -1
  23. package/src/modules/filters/modules/filterConfig/enums/options/UtilizationProgressOptions.ts +20 -0
  24. package/types/modules/filters/modules/filterConfig/components/agent-status/agent-status-filter-value-field.vue.d.ts +16 -0
  25. package/types/modules/filters/modules/filterConfig/components/agent-status/agent-status-filter-value-preview.vue.d.ts +5 -0
  26. package/types/modules/filters/modules/filterConfig/components/auditor/auditor-filter-value-field.vue.d.ts +17 -0
  27. package/types/modules/filters/modules/filterConfig/components/auditor/auditor-filter-value-preview.vue.d.ts +6 -0
  28. package/types/modules/filters/modules/filterConfig/components/auditor/index.d.ts +32 -0
  29. package/types/modules/filters/modules/filterConfig/components/index.d.ts +145 -1
  30. package/types/modules/filters/modules/filterConfig/components/region/index.d.ts +32 -0
  31. package/types/modules/filters/modules/filterConfig/components/region/region-filter-value-field.vue.d.ts +17 -0
  32. package/types/modules/filters/modules/filterConfig/components/region/region-filter-value-preview.vue.d.ts +6 -0
  33. package/types/modules/filters/modules/filterConfig/components/skill/index.d.ts +32 -0
  34. package/types/modules/filters/modules/filterConfig/components/skill/skill-filter-value-field.vue.d.ts +17 -0
  35. package/types/modules/filters/modules/filterConfig/components/skill/skill-filter-value-preview.vue.d.ts +6 -0
  36. package/types/modules/filters/modules/filterConfig/components/supervisor/index.d.ts +32 -0
  37. package/types/modules/filters/modules/filterConfig/components/supervisor/supervisor-filter-value-field.vue.d.ts +17 -0
  38. package/types/modules/filters/modules/filterConfig/components/supervisor/supervisor-filter-value-preview.vue.d.ts +6 -0
  39. package/types/modules/filters/modules/filterConfig/components/utilization-progress/utilization-progress-filter-value-field.vue.d.ts +16 -0
  40. package/types/modules/filters/modules/filterConfig/components/utilization-progress/utilization-progress-filter-value-preview.vue.d.ts +5 -0
  41. package/types/modules/filters/modules/filterConfig/composables/useAgentStatusOptions.d.ts +6 -0
  42. package/types/modules/filters/modules/filterConfig/enums/FilterOption.d.ts +6 -0
  43. package/types/modules/filters/modules/filterConfig/enums/options/UtilizationProgressOptions.d.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-datalist",
3
- "version": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "description": "Toolkit for building data lists in webitel ui system",
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && ( npm run lint:fix || true) && (npm run build:types || true) && npm run utils:publish",
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <wt-select
3
+ :label="labelValue"
4
+ :options="options"
5
+ :value="model"
6
+ :v="!disableValidation && v$.model"
7
+ track-by="value"
8
+ multiple
9
+ option-label="label"
10
+ use-value-from-options-by-prop="value"
11
+ @input="model = $event"
12
+ />
13
+ </template>
14
+
15
+ <script lang="ts" setup>
16
+ import { useVuelidate } from '@vuelidate/core';
17
+ import { required } from '@vuelidate/validators';
18
+ import { WtSelect } from '@webitel/ui-sdk/components';
19
+ import { computed, onMounted, watch } from 'vue';
20
+ import { useI18n } from 'vue-i18n';
21
+
22
+ import { useAgentStatusOptions } from '../../composables/useAgentStatusOptions';
23
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
24
+
25
+ const model = defineModel<string>();
26
+ const { t } = useI18n();
27
+
28
+ const props = defineProps<{
29
+ filterConfig?: WtSysTypeFilterConfig,
30
+ disableValidation?: boolean;
31
+ }>();
32
+
33
+ const v$ = useVuelidate(
34
+ computed(() => ({
35
+ model: {
36
+ required,
37
+ },
38
+ })),
39
+ { model },
40
+ { $autoDirty: true },
41
+ );
42
+
43
+ v$.value.$touch();
44
+
45
+ const emit = defineEmits<{
46
+ 'update:invalid': [boolean];
47
+ }>();
48
+
49
+ const labelValue = computed(() =>
50
+ t(`webitelUI.filters.${props?.filterConfig?.showFilterName ?
51
+ props?.filterConfig.name : 'filterValue'}`));
52
+
53
+ const { options } = useAgentStatusOptions();
54
+
55
+ onMounted(() => {
56
+ if (!props?.disableValidation) v$.value.$touch();
57
+ });
58
+
59
+ watch(
60
+ () => v$.value.$invalid,
61
+ (invalid) => {
62
+ emit('update:invalid', invalid);
63
+ },
64
+ { immediate: true },
65
+ );
66
+ </script>
67
+
68
+ <style scoped></style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <ul>
3
+ <li
4
+ v-for="({ label }, index) of arrayValues"
5
+ :key="index"
6
+ >
7
+ {{ label }}
8
+ </li>
9
+ </ul>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import { useAgentStatusOptions } from '../../composables/useAgentStatusOptions';
14
+ import { computed } from 'vue';
15
+
16
+ const props = defineProps<{
17
+ value: number[];
18
+ }>();
19
+
20
+ const { options } = useAgentStatusOptions();
21
+
22
+ const arrayLabels = computed(() =>
23
+ options.value.reduce((acc, { value, label }) => {
24
+ acc[value] = label;
25
+ return acc;
26
+ }, {})
27
+ );
28
+
29
+ const arrayValues = computed(() =>
30
+ props.value.map((v) => arrayLabels.value[v] || v)
31
+ );
32
+
33
+ </script>
34
+
35
+ <style scoped></style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <wt-select
3
+ :close-on-select="false"
4
+ :label="labelValue"
5
+ :search-method="props.filterConfig.searchRecords"
6
+ :value="model"
7
+ :v="!disableValidation && 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 { WtSelect } from '@webitel/ui-sdk/components';
18
+ import { computed, onMounted, watch } from 'vue';
19
+ import { useI18n } from 'vue-i18n';
20
+
21
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
22
+
23
+ type ModelValue = number[];
24
+
25
+ const props = defineProps<{
26
+ filterConfig: WtSysTypeFilterConfig;
27
+ disableValidation?: boolean;
28
+ }>();
29
+
30
+ const model = defineModel<ModelValue>();
31
+
32
+ const emit = defineEmits<{
33
+ 'update:invalid': [boolean];
34
+ }>();
35
+ const { t } = useI18n();
36
+
37
+ const labelValue = computed(() =>
38
+ t(`webitelUI.filters.${props?.filterConfig?.showFilterName ?
39
+ props?.filterConfig.name : 'filterValue'}`))
40
+
41
+ const v$ = useVuelidate(
42
+ computed(() => ({
43
+ model: {
44
+ required,
45
+ },
46
+ })),
47
+ { model },
48
+ { $autoDirty: true },
49
+ );
50
+ v$.value.$touch();
51
+
52
+ onMounted(() => {
53
+ if (!props?.disableValidation) v$.value.$touch();
54
+ });
55
+
56
+ watch(
57
+ () => v$.value.$invalid,
58
+ (invalid) => {
59
+ emit('update:invalid', invalid);
60
+ },
61
+ { immediate: true },
62
+ );
63
+
64
+ const handleInput = (value: ModelValue) => {
65
+ model.value = value;
66
+ };
67
+ </script>
68
+
69
+ <style scoped></style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <lookup-filter-value-preview v-bind="props" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import type { EngineQueue } from 'webitel-sdk';
7
+
8
+ import LookupFilterValuePreview from '../_shared/lookup-filter-preview/lookup-filter-value-preview.vue';
9
+
10
+ const props = defineProps<{
11
+ value: EngineQueue[];
12
+ }>();
13
+ </script>
14
+
15
+ <style scoped></style>
@@ -0,0 +1,21 @@
1
+ import { UsersAPI } from '@webitel/api-services/api';
2
+
3
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
4
+ import { FilterOption } from '../../enums/FilterOption';
5
+ import AuditorFilterValueField from './auditor-filter-value-field.vue';
6
+ import AuditorFilterValuePreview from './auditor-filter-value-preview.vue';
7
+
8
+ class AuditorFilterConfig extends WtSysTypeFilterConfig {
9
+ readonly name = FilterOption.Auditor;
10
+ valueInputComponent = AuditorFilterValueField;
11
+ valuePreviewComponent = AuditorFilterValuePreview;
12
+
13
+ searchRecords(
14
+ params: object
15
+ ): Promise<{ items: unknown[]; next?: boolean }> {
16
+ return UsersAPI.getLookup(params);
17
+ }
18
+ }
19
+
20
+ export const createAuditorFilterConfig = (params) =>
21
+ new AuditorFilterConfig(params);
@@ -111,10 +111,38 @@ import VariableFilter from './variable/variable-filter-value-field.vue';
111
111
  import VariableFilterPreview from './variable/variable-filter-value-preview.vue';
112
112
  import { createTeamFilterConfig } from './team';
113
113
  import { createQueueFilterConfig } from './queue';
114
+ import AgentStatusFilter from './agent-status/agent-status-filter-value-field.vue';
115
+ import AgentStatusFilterPreview from './agent-status/agent-status-filter-value-preview.vue';
116
+ import SkillFilter from './skill/skill-filter-value-field.vue';
117
+ import SkillFilterPreview from './skill/skill-filter-value-preview.vue';
118
+ import { createSkillFilterConfig } from './skill';
119
+ import SupervisorFilter from './supervisor/supervisor-filter-value-field.vue';
120
+ import SupervisorFilterPreview from './supervisor/supervisor-filter-value-preview.vue';
121
+ import { createSupervisorFilterConfig } from './supervisor';
122
+ import AuditorFilter from './auditor/auditor-filter-value-field.vue';
123
+ import AuditorFilterPreview from './auditor/auditor-filter-value-preview.vue';
124
+ import { createAuditorFilterConfig } from './auditor';
125
+ import RegionFilter from './region/region-filter-value-field.vue';
126
+ import RegionFilterPreview from './region/region-filter-value-preview.vue';
127
+ import { createRegionFilterConfig } from './region';
128
+ import UtilizationProgressFilter from './utilization-progress/utilization-progress-filter-value-field.vue';
129
+ import UtilizationProgressFilterPreview from './utilization-progress/utilization-progress-filter-value-preview.vue';
114
130
 
115
131
  export {
116
132
  AgentFilter,
117
133
  AgentFilterPreview,
134
+ SkillFilter,
135
+ SkillFilterPreview,
136
+ SupervisorFilter,
137
+ SupervisorFilterPreview,
138
+ AuditorFilter,
139
+ AuditorFilterPreview,
140
+ RegionFilter,
141
+ RegionFilterPreview,
142
+ AgentStatusFilter,
143
+ AgentStatusFilterPreview,
144
+ UtilizationProgressFilter,
145
+ UtilizationProgressFilterPreview,
118
146
  AmdResultFilter,
119
147
  AmdResultFilterPreview,
120
148
  CallDirectionFilterValueField,
@@ -203,6 +231,12 @@ export const FilterOptionToValueComponentMap: Record<
203
231
  Component
204
232
  > = {
205
233
  [FilterOption.Agent]: AgentFilter,
234
+ [FilterOption.AgentStatus]: AgentStatusFilter,
235
+ [FilterOption.UtilizationProgress]: UtilizationProgressFilter,
236
+ [FilterOption.Skill]: SkillFilter,
237
+ [FilterOption.Region]: RegionFilter,
238
+ [FilterOption.Auditor]: AuditorFilter,
239
+ [FilterOption.Supervisor]: SupervisorFilter,
206
240
  [FilterOption.AmdResult]: AmdResultFilter,
207
241
  [FilterOption.Contact]: ContactFilter,
208
242
  [FilterOption.CallDirection]: CallDirectionFilterValueField,
@@ -250,6 +284,12 @@ export const FilterOptionToPreviewComponentMap: Record<
250
284
  > = {
251
285
  [FilterOption.CreatedAt]: DateTimeOptionsFilterValuePreview,
252
286
  [FilterOption.Agent]: AgentFilterPreview,
287
+ [FilterOption.Region]: RegionFilterPreview,
288
+ [FilterOption.UtilizationProgress]: UtilizationProgressFilterPreview,
289
+ [FilterOption.Auditor]: AuditorFilterPreview,
290
+ [FilterOption.Supervisor]: SupervisorFilterPreview,
291
+ [FilterOption.Skill]: SkillFilterPreview,
292
+ [FilterOption.AgentStatus]: AgentStatusFilterPreview,
253
293
  [FilterOption.AmdResult]: AmdResultFilterPreview,
254
294
  [FilterOption.Contact]: ContactFilterPreview,
255
295
  [FilterOption.CallDirection]: CallDirectionFilterValuePreview,
@@ -336,4 +376,8 @@ export const FilterOptionToFilterConfigCreatorMap = {
336
376
  [FilterOption.ContactGroup]: createContactGroupFilterConfig,
337
377
  [FilterOption.Team]: createTeamFilterConfig,
338
378
  [FilterOption.Queue]: createQueueFilterConfig,
379
+ [FilterOption.Skill]: createSkillFilterConfig,
380
+ [FilterOption.Supervisor]: createSupervisorFilterConfig,
381
+ [FilterOption.Auditor]: createAuditorFilterConfig,
382
+ [FilterOption.Region]: createRegionFilterConfig,
339
383
  };
@@ -5,6 +5,7 @@
5
5
  :value="model"
6
6
  :v="!disableValidation && v$.model"
7
7
  track-by="value"
8
+ multiple
8
9
  option-label="label"
9
10
  use-value-from-options-by-prop="value"
10
11
  @input="model = $event"
@@ -6,6 +6,7 @@
6
6
  :v="!disableValidation && v$.model"
7
7
  track-by="value"
8
8
  option-label="label"
9
+ multiple
9
10
  use-value-from-options-by-prop="value"
10
11
  @input="model = $event"
11
12
  />
@@ -0,0 +1,20 @@
1
+ import { RegionsAPI } from '@webitel/api-services/api';
2
+
3
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
4
+ import { FilterOption } from '../../enums/FilterOption';
5
+ import RegionFilterValueField from './region-filter-value-field.vue';
6
+ import RegionFilterValuePreview from './region-filter-value-preview.vue';
7
+
8
+ class RegionFilterConfig extends WtSysTypeFilterConfig {
9
+ readonly name = FilterOption.Region;
10
+ valueInputComponent = RegionFilterValueField;
11
+ valuePreviewComponent = RegionFilterValuePreview;
12
+ searchRecords(
13
+ params: object
14
+ ): Promise<{ items: unknown[]; next?: boolean }> {
15
+ return RegionsAPI.getLookup(params);
16
+ }
17
+ }
18
+
19
+ export const createRegionFilterConfig = (params) =>
20
+ new RegionFilterConfig(params);
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <wt-select
3
+ :close-on-select="false"
4
+ :label="labelValue"
5
+ :search-method="props.filterConfig.searchRecords"
6
+ :value="model"
7
+ :v="!disableValidation && 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 { WtSelect } from '@webitel/ui-sdk/components';
18
+ import { computed, onMounted, watch } from 'vue';
19
+ import { useI18n } from 'vue-i18n';
20
+
21
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
22
+
23
+ type ModelValue = number[];
24
+
25
+ const props = defineProps<{
26
+ filterConfig: WtSysTypeFilterConfig;
27
+ disableValidation?: boolean;
28
+ }>();
29
+
30
+ const model = defineModel<ModelValue>();
31
+
32
+ const emit = defineEmits<{
33
+ 'update:invalid': [boolean];
34
+ }>();
35
+ const { t } = useI18n();
36
+
37
+ const labelValue = computed(() =>
38
+ t(`webitelUI.filters.${props?.filterConfig?.showFilterName ?
39
+ props?.filterConfig.name : 'filterValue'}`))
40
+
41
+ const v$ = useVuelidate(
42
+ computed(() => ({
43
+ model: {
44
+ required,
45
+ },
46
+ })),
47
+ { model },
48
+ { $autoDirty: true },
49
+ );
50
+ v$.value.$touch();
51
+
52
+ onMounted(() => {
53
+ if (!props?.disableValidation) v$.value.$touch();
54
+ });
55
+
56
+ watch(
57
+ () => v$.value.$invalid,
58
+ (invalid) => {
59
+ emit('update:invalid', invalid);
60
+ },
61
+ { immediate: true },
62
+ );
63
+
64
+ const handleInput = (value: ModelValue) => {
65
+ model.value = value;
66
+ };
67
+ </script>
68
+
69
+ <style scoped></style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <lookup-filter-value-preview v-bind="props" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import type { EngineQueue } from 'webitel-sdk';
7
+
8
+ import LookupFilterValuePreview from '../_shared/lookup-filter-preview/lookup-filter-value-preview.vue';
9
+
10
+ const props = defineProps<{
11
+ value: EngineQueue[];
12
+ }>();
13
+ </script>
14
+
15
+ <style scoped></style>
@@ -0,0 +1,21 @@
1
+ import { SkillsAPI } from '@webitel/api-services/api';
2
+
3
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
4
+ import { FilterOption } from '../../enums/FilterOption';
5
+ import SkillFilterValueField from './skill-filter-value-field.vue';
6
+ import SkillFilterValuePreview from './skill-filter-value-preview.vue';
7
+
8
+ class SkillFilterConfig extends WtSysTypeFilterConfig {
9
+ readonly name = FilterOption.Skill;
10
+ valueInputComponent = SkillFilterValueField;
11
+ valuePreviewComponent = SkillFilterValuePreview;
12
+
13
+ searchRecords(
14
+ params: object
15
+ ): Promise<{ items: unknown[]; next?: boolean }> {
16
+ return SkillsAPI.getLookup(params);
17
+ }
18
+ }
19
+
20
+ export const createSkillFilterConfig = (params) =>
21
+ new SkillFilterConfig(params);
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <wt-select
3
+ :close-on-select="false"
4
+ :label="labelValue"
5
+ :search-method="props.filterConfig.searchRecords"
6
+ :value="model"
7
+ :v="!disableValidation && 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 { WtSelect } from '@webitel/ui-sdk/components';
18
+ import { computed, onMounted, watch } from 'vue';
19
+ import { useI18n } from 'vue-i18n';
20
+
21
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
22
+
23
+ type ModelValue = number[];
24
+
25
+ const props = defineProps<{
26
+ filterConfig: WtSysTypeFilterConfig;
27
+ disableValidation?: boolean;
28
+ }>();
29
+
30
+ const model = defineModel<ModelValue>();
31
+
32
+ const emit = defineEmits<{
33
+ 'update:invalid': [boolean];
34
+ }>();
35
+ const { t } = useI18n();
36
+
37
+ const labelValue = computed(() =>
38
+ t(`webitelUI.filters.${props?.filterConfig?.showFilterName ?
39
+ props?.filterConfig.name : 'filterValue'}`))
40
+
41
+ const v$ = useVuelidate(
42
+ computed(() => ({
43
+ model: {
44
+ required,
45
+ },
46
+ })),
47
+ { model },
48
+ { $autoDirty: true },
49
+ );
50
+ v$.value.$touch();
51
+
52
+ onMounted(() => {
53
+ if (!props?.disableValidation) v$.value.$touch();
54
+ });
55
+
56
+ watch(
57
+ () => v$.value.$invalid,
58
+ (invalid) => {
59
+ emit('update:invalid', invalid);
60
+ },
61
+ { immediate: true },
62
+ );
63
+
64
+ const handleInput = (value: ModelValue) => {
65
+ model.value = value;
66
+ };
67
+ </script>
68
+
69
+ <style scoped></style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <lookup-filter-value-preview v-bind="props" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import type { EngineQueue } from 'webitel-sdk';
7
+
8
+ import LookupFilterValuePreview from '../_shared/lookup-filter-preview/lookup-filter-value-preview.vue';
9
+
10
+ const props = defineProps<{
11
+ value: EngineQueue[];
12
+ }>();
13
+ </script>
14
+
15
+ <style scoped></style>
@@ -0,0 +1,21 @@
1
+ import { AgentsAPI } from '@webitel/api-services/api';
2
+
3
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
4
+ import { FilterOption } from '../../enums/FilterOption';
5
+ import SupervisorFilterValueField from './supervisor-filter-value-field.vue';
6
+ import SupervisorFilterValuePreview from './supervisor-filter-value-preview.vue';
7
+
8
+ class SupervisorFilterConfig extends WtSysTypeFilterConfig {
9
+ readonly name = FilterOption.Supervisor;
10
+ valueInputComponent = SupervisorFilterValueField;
11
+ valuePreviewComponent = SupervisorFilterValuePreview;
12
+
13
+ searchRecords(
14
+ params: object
15
+ ): Promise<{ items: unknown[]; next?: boolean }> {
16
+ return AgentsAPI.getSupervisorOptions(params);
17
+ }
18
+ }
19
+
20
+ export const createSupervisorFilterConfig = (params) =>
21
+ new SupervisorFilterConfig(params);
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <wt-select
3
+ :close-on-select="false"
4
+ :label="labelValue"
5
+ :search-method="props.filterConfig.searchRecords"
6
+ :value="model"
7
+ :v="!disableValidation && 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 { WtSelect } from '@webitel/ui-sdk/components';
18
+ import { computed, onMounted, watch } from 'vue';
19
+ import { useI18n } from 'vue-i18n';
20
+
21
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
22
+
23
+ type ModelValue = number[];
24
+
25
+ const props = defineProps<{
26
+ filterConfig: WtSysTypeFilterConfig;
27
+ disableValidation?: boolean;
28
+ }>();
29
+
30
+ const model = defineModel<ModelValue>();
31
+
32
+ const emit = defineEmits<{
33
+ 'update:invalid': [boolean];
34
+ }>();
35
+ const { t } = useI18n();
36
+
37
+ const labelValue = computed(() =>
38
+ t(`webitelUI.filters.${props?.filterConfig?.showFilterName ?
39
+ props?.filterConfig.name : 'filterValue'}`))
40
+
41
+ const v$ = useVuelidate(
42
+ computed(() => ({
43
+ model: {
44
+ required,
45
+ },
46
+ })),
47
+ { model },
48
+ { $autoDirty: true },
49
+ );
50
+ v$.value.$touch();
51
+
52
+ onMounted(() => {
53
+ if (!props?.disableValidation) v$.value.$touch();
54
+ });
55
+
56
+ watch(
57
+ () => v$.value.$invalid,
58
+ (invalid) => {
59
+ emit('update:invalid', invalid);
60
+ },
61
+ { immediate: true },
62
+ );
63
+
64
+ const handleInput = (value: ModelValue) => {
65
+ model.value = value;
66
+ };
67
+ </script>
68
+
69
+ <style scoped></style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <lookup-filter-value-preview v-bind="props" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import type { EngineQueue } from 'webitel-sdk';
7
+
8
+ import LookupFilterValuePreview from '../_shared/lookup-filter-preview/lookup-filter-value-preview.vue';
9
+
10
+ const props = defineProps<{
11
+ value: EngineQueue[];
12
+ }>();
13
+ </script>
14
+
15
+ <style scoped></style>