@webitel/ui-datalist 1.1.74 → 1.1.76
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.
- package/package.json +4 -1
- package/src/modules/card/composables/__tests__/useCardValidation.spec.ts +67 -0
- package/src/modules/card/composables/useCardListNavigation.ts +30 -0
- package/src/modules/card/composables/useCardTabs.ts +38 -0
- package/src/modules/card/index.ts +2 -0
- package/src/modules/filters/modules/filterConfig/components/_shared/string-filter/string-filter-value-field.vue +57 -0
- package/src/modules/filters/modules/filterConfig/components/_shared/string-filter/string-filter-value-preview.vue +11 -0
- package/src/modules/filters/modules/filterConfig/components/bucket/bucket-filter-value-field.vue +81 -0
- package/src/modules/filters/modules/filterConfig/components/bucket/bucket-filter-value-preview.vue +13 -0
- package/src/modules/filters/modules/filterConfig/components/bucket/index.ts +25 -0
- package/src/modules/filters/modules/filterConfig/components/call-reporting-result/call-reporting-result-filter-value-field.vue +81 -0
- package/src/modules/filters/modules/filterConfig/components/call-reporting-result/call-reporting-result-filter-value-preview.vue +35 -0
- package/src/modules/filters/modules/filterConfig/components/index.ts +46 -0
- package/src/modules/filters/modules/filterConfig/components/stop-cause/stop-cause-filter-value-field.vue +81 -0
- package/src/modules/filters/modules/filterConfig/components/stop-cause/stop-cause-filter-value-preview.vue +35 -0
- package/src/modules/filters/modules/filterConfig/components/tags/index.ts +25 -0
- package/src/modules/filters/modules/filterConfig/components/tags/tags-filter-value-field.vue +97 -0
- package/src/modules/filters/modules/filterConfig/components/tags/tags-filter-value-preview.vue +19 -0
- package/src/modules/filters/modules/filterConfig/composables/useCallReportingResultOptions.ts +21 -0
- package/src/modules/filters/modules/filterConfig/composables/useStopCauseOptions.ts +22 -0
- package/src/modules/filters/modules/filterConfig/enums/FilterOption.ts +12 -0
- package/types/.tsbuildinfo +1 -1
- package/types/modules/card/composables/useCardListNavigation.d.ts +10 -0
- package/types/modules/card/composables/useCardTabs.d.ts +9 -0
- package/types/modules/card/index.d.ts +2 -0
- package/types/modules/filter-presets/stores/createFilterPresetsStore.d.ts +3 -0
- package/types/modules/filters/components/config/dynamic-view/dynamic-filter-config-form.vue.d.ts +2 -2
- package/types/modules/filters/modules/filterConfig/components/_shared/date-time-filter/date-time-options/date-time-options-filter-value-field.vue.d.ts +2 -8
- package/types/modules/filters/modules/filterConfig/components/_shared/string-filter/string-filter-value-field.vue.d.ts +13 -0
- package/types/modules/filters/modules/filterConfig/components/_shared/string-filter/string-filter-value-preview.vue.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/components/bucket/bucket-filter-value-field.vue.d.ts +19 -0
- package/types/modules/filters/modules/filterConfig/components/bucket/bucket-filter-value-preview.vue.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/components/bucket/index.d.ts +32 -0
- package/types/modules/filters/modules/filterConfig/components/call-reporting-result/call-reporting-result-filter-value-field.vue.d.ts +18 -0
- package/types/modules/filters/modules/filterConfig/components/call-reporting-result/call-reporting-result-filter-value-preview.vue.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/components/index.d.ts +75 -1
- package/types/modules/filters/modules/filterConfig/components/stop-cause/stop-cause-filter-value-field.vue.d.ts +18 -0
- package/types/modules/filters/modules/filterConfig/components/stop-cause/stop-cause-filter-value-preview.vue.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/components/tags/index.d.ts +32 -0
- package/types/modules/filters/modules/filterConfig/components/tags/tags-filter-value-field.vue.d.ts +19 -0
- package/types/modules/filters/modules/filterConfig/components/tags/tags-filter-value-preview.vue.d.ts +7 -0
- package/types/modules/filters/modules/filterConfig/composables/useCallReportingResultOptions.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/composables/useQueueTypeOptions.d.ts +1 -1
- package/types/modules/filters/modules/filterConfig/composables/useStopCauseOptions.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/enums/FilterOption.d.ts +12 -0
- package/types/modules/headers/createTableHeadersStore.d.ts +6 -0
- package/types/modules/permissions-page/stores/createPermissionsStore.d.ts +6 -0
- package/types/modules/table/createTableStore.store.d.ts +6 -0
|
@@ -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 { computed } from 'vue';
|
|
14
|
+
|
|
15
|
+
import { useStopCauseOptions } from '../../composables/useStopCauseOptions';
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
value?: string[];
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const { options } = useStopCauseOptions();
|
|
22
|
+
|
|
23
|
+
const arrayLabels = computed(() =>
|
|
24
|
+
options.value.reduce<Record<string, string>>((acc, { value, label }) => {
|
|
25
|
+
acc[value] = label;
|
|
26
|
+
return acc;
|
|
27
|
+
}, {}),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const arrayValues = computed(() =>
|
|
31
|
+
(props.value ?? []).map((v) => arrayLabels.value[v] || v),
|
|
32
|
+
);
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style scoped></style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { QueuesAPI } from '@webitel/api-services/api';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type FilterConfigBaseParams,
|
|
5
|
+
WtSysTypeFilterConfig,
|
|
6
|
+
} from '../../classes/FilterConfig';
|
|
7
|
+
import { FilterOption } from '../../enums/FilterOption';
|
|
8
|
+
import TagsFilterValueField from './tags-filter-value-field.vue';
|
|
9
|
+
import TagsFilterValuePreview from './tags-filter-value-preview.vue';
|
|
10
|
+
|
|
11
|
+
class QueueTagsFilterConfig extends WtSysTypeFilterConfig {
|
|
12
|
+
readonly name = FilterOption.QueueTags;
|
|
13
|
+
valueInputComponent = TagsFilterValueField;
|
|
14
|
+
valuePreviewComponent = TagsFilterValuePreview;
|
|
15
|
+
|
|
16
|
+
searchRecords(params: object): Promise<{
|
|
17
|
+
items: unknown[];
|
|
18
|
+
next?: boolean;
|
|
19
|
+
}> {
|
|
20
|
+
return QueuesAPI.getQueuesTags(params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const createQueueTagsFilterConfig = (params?: FilterConfigBaseParams) =>
|
|
25
|
+
new QueueTagsFilterConfig(params);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-multi-select
|
|
3
|
+
:label="labelValue"
|
|
4
|
+
:search-method="props.filterConfig.searchRecords"
|
|
5
|
+
:model-value="selectedOptions"
|
|
6
|
+
:v="!disableValidation && v$.model"
|
|
7
|
+
chips-view
|
|
8
|
+
data-key="name"
|
|
9
|
+
option-label="name"
|
|
10
|
+
@update:model-value="handleInput"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { useVuelidate } from '@vuelidate/core';
|
|
16
|
+
import { required } from '@vuelidate/validators';
|
|
17
|
+
import { WtMultiSelect } 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
|
+
/**
|
|
24
|
+
* Queue tags are free-form strings, so the filter stores names rather than ids
|
|
25
|
+
* and there is nothing to look up on restore — a name is its own label.
|
|
26
|
+
*/
|
|
27
|
+
interface TagOption {
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type ModelValue = string[];
|
|
32
|
+
|
|
33
|
+
const props = defineProps<{
|
|
34
|
+
filterConfig: WtSysTypeFilterConfig;
|
|
35
|
+
disableValidation?: boolean;
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
const model = defineModel<ModelValue>();
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits<{
|
|
41
|
+
'update:invalid': [
|
|
42
|
+
boolean,
|
|
43
|
+
];
|
|
44
|
+
}>();
|
|
45
|
+
const { t } = useI18n();
|
|
46
|
+
|
|
47
|
+
const labelValue = computed(() =>
|
|
48
|
+
t(
|
|
49
|
+
`webitelUI.filters.${
|
|
50
|
+
props?.filterConfig?.showFilterName
|
|
51
|
+
? props?.filterConfig.name
|
|
52
|
+
: 'filterValue'
|
|
53
|
+
}`,
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const selectedOptions = computed<TagOption[]>(() =>
|
|
58
|
+
(model.value ?? []).map((name) => ({
|
|
59
|
+
name,
|
|
60
|
+
})),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const v$ = useVuelidate(
|
|
64
|
+
computed(() => ({
|
|
65
|
+
model: {
|
|
66
|
+
required,
|
|
67
|
+
},
|
|
68
|
+
})),
|
|
69
|
+
{
|
|
70
|
+
model,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
$autoDirty: true,
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
v$.value.$touch();
|
|
77
|
+
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
if (!props?.disableValidation) v$.value.$touch();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
watch(
|
|
83
|
+
() => v$.value.$invalid,
|
|
84
|
+
(invalid) => {
|
|
85
|
+
emit('update:invalid', invalid);
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
immediate: true,
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const handleInput = (value: Array<TagOption | string>) => {
|
|
93
|
+
model.value = value.map((tag) => (typeof tag === 'string' ? tag : tag.name));
|
|
94
|
+
};
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style scoped></style>
|
package/src/modules/filters/modules/filterConfig/components/tags/tags-filter-value-preview.vue
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul v-if="value?.length">
|
|
3
|
+
<li
|
|
4
|
+
v-for="(tag, index) of value"
|
|
5
|
+
:key="index"
|
|
6
|
+
>
|
|
7
|
+
{{ tag }}
|
|
8
|
+
</li>
|
|
9
|
+
</ul>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
defineProps<{
|
|
14
|
+
/** tag names — this filter stores strings, not lookup objects */
|
|
15
|
+
value?: string[];
|
|
16
|
+
}>();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<style scoped></style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CallReportingStatus } from '@webitel/api-services/enums';
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { useI18n } from 'vue-i18n';
|
|
4
|
+
|
|
5
|
+
export function useCallReportingResultOptions() {
|
|
6
|
+
const { t } = useI18n();
|
|
7
|
+
|
|
8
|
+
const mapResultToLabel = (value: string) =>
|
|
9
|
+
t(`objects.callReportingResult.${value}`);
|
|
10
|
+
|
|
11
|
+
const options = computed(() =>
|
|
12
|
+
Object.values(CallReportingStatus).map((value) => ({
|
|
13
|
+
value,
|
|
14
|
+
label: mapResultToLabel(value),
|
|
15
|
+
})),
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
options,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MemberStopCause } from '@webitel/api-services/enums';
|
|
2
|
+
import { camelCase } from 'change-case';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import { useI18n } from 'vue-i18n';
|
|
5
|
+
|
|
6
|
+
export function useStopCauseOptions() {
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
|
|
9
|
+
const mapStopCauseToLabel = (value: string) =>
|
|
10
|
+
t(`objects.stopCause.${camelCase(value)}`);
|
|
11
|
+
|
|
12
|
+
const options = computed(() =>
|
|
13
|
+
Object.values(MemberStopCause).map((value) => ({
|
|
14
|
+
value,
|
|
15
|
+
label: mapStopCauseToLabel(value),
|
|
16
|
+
})),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
options,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -12,9 +12,11 @@ export const FilterOption = {
|
|
|
12
12
|
HasFile: 'hasFile',
|
|
13
13
|
Score: 'score',
|
|
14
14
|
Tag: 'tag',
|
|
15
|
+
QueueTags: 'tags',
|
|
15
16
|
TalkDuration: 'talkDuration',
|
|
16
17
|
Team: 'team',
|
|
17
18
|
TotalDuration: 'totalDuration',
|
|
19
|
+
AttemptDuration: 'duration',
|
|
18
20
|
HasTranscription: 'hasTranscription',
|
|
19
21
|
User: 'user',
|
|
20
22
|
Variable: 'variable',
|
|
@@ -48,6 +50,16 @@ export const FilterOption = {
|
|
|
48
50
|
Auditor: 'auditor',
|
|
49
51
|
Region: 'region',
|
|
50
52
|
UtilizationProgress: 'utilizationProgress',
|
|
53
|
+
Bucket: 'bucket',
|
|
54
|
+
JoinedAt: 'joinedAt',
|
|
55
|
+
LeavingAt: 'leavingAt',
|
|
56
|
+
OfferingAt: 'offeringAt',
|
|
57
|
+
StopCause: 'stopCause',
|
|
58
|
+
MemberPriority: 'memberPriority',
|
|
59
|
+
MemberAttempts: 'attempts',
|
|
60
|
+
MemberName: 'name',
|
|
61
|
+
MemberDestination: 'destination',
|
|
62
|
+
CallReportingResult: 'result' /** queue attempt CallReportingStatus */,
|
|
51
63
|
} as const;
|
|
52
64
|
|
|
53
65
|
/**
|