@webitel/ui-datalist 1.0.11 → 1.0.13
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 +7 -5
- package/src/index.ts +1 -1
- package/src/{filter-presets → modules/filter-presets}/components/_shared/preset-filters-preview.vue +16 -7
- package/src/{filter-presets → modules/filter-presets}/components/apply-preset/apply-preset-action.vue +9 -11
- package/src/{filter-presets → modules/filter-presets}/components/apply-preset/preset-preview.vue +13 -7
- package/src/{filter-presets → modules/filter-presets}/components/save-preset/save-preset-action.vue +8 -6
- package/src/{filter-presets → modules/filter-presets}/components/save-preset/save-preset-popup.vue +6 -1
- package/src/{filter-presets → modules/filter-presets}/stores/createFilterPresetsStore.ts +1 -1
- package/src/{filters/types/Filter.d.ts → modules/filters/classes/Filter.ts} +20 -3
- package/src/{filters → modules/filters}/classes/FiltersManager.ts +72 -5
- package/src/modules/filters/components/config/dynamic-filter-config-form-value-input.vue +27 -0
- package/src/{filters → modules/filters}/components/config/dynamic-filter-config-form.vue +46 -23
- package/src/{filters → modules/filters}/components/dynamic-filter-add-action.vue +4 -6
- package/src/{filters → modules/filters}/components/preview/dynamic-filter-preview.vue +29 -27
- package/src/{filters → modules/filters}/components/search-bar/dynamic-filter-search.vue +2 -2
- package/src/{filters → modules/filters}/components/search-bar/types/DynamicFilterSearch.d.ts +2 -2
- package/src/{filters → modules/filters}/components/table-filters-panel.vue +37 -44
- package/src/modules/filters/composables/useFilterConfigsToolkit.ts +136 -0
- package/src/{filters → modules/filters}/createTableFiltersStore.ts +4 -2
- package/src/{filters → modules/filters}/index.ts +12 -13
- package/src/modules/filters/modules/filterConfig/classes/FilterConfig.ts +75 -0
- package/src/modules/filters/modules/filterConfig/classes/createFilterConfig.ts +35 -0
- package/src/modules/filters/modules/filterConfig/components/_custom/Readme.md +9 -0
- package/src/modules/filters/modules/filterConfig/components/_custom/index.ts +69 -0
- package/src/modules/filters/modules/filterConfig/components/_custom/type-extension-filter-value-field.vue +61 -0
- package/src/modules/filters/modules/filterConfig/components/_custom/type-extension-filter-value-preview.vue +18 -0
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/_shared/has-options/has-option-filter-value-field.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/amd-result/amd-result-filter-value-field.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/call-direction/call-direction-filter-value-field.vue +2 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-assignee/case-assignee-filter-value-field.vue +7 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-assignee/case-assignee-filter-value-preview.vue +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-assignee/index.ts +30 -0
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/contact-group/contact-group-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/hangup-cause/hangup-cause-filter-value-field.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-attachment/has-attachment-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-file/has-file-filter-value-field.vue +3 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-file/has-file-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-rating/has-rating-filter-value-field.vue +3 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-rating/has-rating-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-transcription/has-transcription-filter-value-field.vue +3 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-transcription/has-transcription-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/index.ts +10 -14
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/tag/tag-filter-value-field.vue +2 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/tag/tag-filter-value-preview.vue +2 -2
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/talk-duration/talk-duration-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/total-duration/total-duration-filter-value-preview.vue +1 -1
- package/src/{filters/components/filter-options/_shared → modules/filters/modules/filterConfig}/composables/booleanFilterToolkit.ts +2 -1
- package/src/{filters → modules/filters/modules/filterConfig}/enums/FilterOption.ts +10 -10
- package/src/{filters/enums/amd-result-options.ts → modules/filters/modules/filterConfig/enums/options/AMDResultOptions.ts} +1 -1
- package/src/{filters/enums/boolean-options.ts → modules/filters/modules/filterConfig/enums/options/BooleanFilterOptions.ts} +2 -1
- package/src/{filters/enums/direction-options.ts → modules/filters/modules/filterConfig/enums/options/CallDirectionFilterOptions.ts} +1 -1
- package/src/modules/filters/modules/filterConfig/enums/options/CallHistoryTagFilterOptions.ts +8 -0
- package/src/{filters/enums/hangup-cause-options.ts → modules/filters/modules/filterConfig/enums/options/HangupCauseFilterOptions.ts} +1 -1
- package/src/{filters → modules/filters}/scripts/utils.ts +1 -1
- package/src/filters/classes/Filter.ts +0 -30
- package/src/filters/classes/FilterStorage.ts +0 -34
- package/src/filters/classes/FilterStorageOptions.d.ts +0 -6
- package/src/filters/components/filter-options/_shared/types/BooleanFilter.ts +0 -1
- package/src/filters/components/filter-options/contact/config.js +0 -3
- package/src/filters/enums/tag-options.ts +0 -8
- package/src/filters/types/FiltersManager.d.ts +0 -76
- /package/src/{filter-presets/api/PresetQuery.api.ts → modules/filter-presets/api/PresetQuery.ts} +0 -0
- /package/src/{filter-presets → modules/filter-presets}/components/_shared/input-fields/preset-description-field.vue +0 -0
- /package/src/{filter-presets → modules/filter-presets}/components/_shared/input-fields/preset-name-field.vue +0 -0
- /package/src/{filter-presets → modules/filter-presets}/components/save-preset/overwrite-preset-popup.vue +0 -0
- /package/src/{filter-presets → modules/filter-presets}/index.ts +0 -0
- /package/src/{filter-presets → modules/filter-presets}/stores/headers/headers.ts +0 -0
- /package/src/{filters → modules/filters}/components/config/dynamic-filter-config-form-label.vue +0 -0
- /package/src/{filters → modules/filters}/components/config/dynamic-filter-config-view.vue +0 -0
- /package/src/{filters → modules/filters}/components/dynamic-filter-panel-wrapper.vue +0 -0
- /package/src/{filters → modules/filters}/components/preview/dynamic-filter-preview-info.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/_shared/date-time-filter/date-time-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/_shared/durations/duration-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/_shared/lookup-filter-preview/lookup-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/agent/agent-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/agent/agent-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/agent/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/amd-result/amd-result-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/call-direction/call-direction-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-actual-reaction-time/case-actual-reaction-time-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-actual-reaction-time/case-actual-reaction-time-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-actual-resolution-time/case-actual-resolution-time-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-actual-resolution-time/case-actual-resolution-time-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-author/case-author-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-author/case-author-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-author/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-close-reason-groups/case-close-reason-groups-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-close-reason-groups/case-close-reason-groups-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-close-reason-groups/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-impacted/case-impacted-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-impacted/case-impacted-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options/case-assignee → modules/filters/modules/filterConfig/components/case-impacted}/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-priority/case-priority-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-priority/case-priority-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-priority/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-reaction-time/case-reaction-time-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-reaction-time/case-reaction-time-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-reporter/case-reporter-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-reporter/case-reporter-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options/case-impacted → modules/filters/modules/filterConfig/components/case-reporter}/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-resolution-time/case-resolution-time-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-resolution-time/case-resolution-time-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-service/case-service-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-service/case-service-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-service/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-sla/case-sla-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-sla/case-sla-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-sla/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-sla-condition/case-sla-condition-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-sla-condition/case-sla-condition-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-sla-condition/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-source/case-source-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-source/case-source-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-source/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-status/case-status-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-status/case-status-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/case-status/config.js +0 -0
- /package/src/{filters/components/filter-options/case-reporter → modules/filters/modules/filterConfig/components/contact}/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/contact/contact-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/contact/contact-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/contact-group/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/contact-group/contact-group-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/created-at/created-at-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/created-at/created-at-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/created-at-from/created-at-from-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/created-at-from/created-at-from-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/created-at-to/created-at-to-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/created-at-to/created-at-to-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/gateway/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/gateway/gateway-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/gateway/gateway-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/grantee/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/grantee/grantee-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/grantee/grantee-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/hangup-cause/hangup-cause-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/has-attachment/has-attachment-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/queue/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/queue/queue-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/queue/queue-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/rated-by/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/rated-by/rated-by-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/rated-by/rated-by-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/rating/rating-from-to-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/rating/rating-from-to-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/score/score-from-to-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/score/score-from-to-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/talk-duration/TalkDurationFilter.d.ts +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/talk-duration/talk-duration-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/team/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/team/team-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/team/team-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/total-duration/TotalDurationFilter.d.ts +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/total-duration/total-duration-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/user/config.js +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/user/user-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/user/user-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/variable/variable-filter-value-field.vue +0 -0
- /package/src/{filters/components/filter-options → modules/filters/modules/filterConfig/components}/variable/variable-filter-value-preview.vue +0 -0
- /package/src/{filters/components/filter-options/_shared → modules/filters/modules/filterConfig}/composables/useFromToSecToPreviewTime.ts +0 -0
- /package/src/{headers → modules/headers}/createTableHeadersStore.ts +0 -0
- /package/src/{pagination → modules/pagination}/createTablePaginationStore.ts +0 -0
- /package/src/{persist → modules/persist}/PersistedStorage.types.ts +0 -0
- /package/src/{persist → modules/persist}/useLocalStoragePersistedStorage.ts +0 -0
- /package/src/{persist → modules/persist}/usePersistedStorage.ts +0 -0
- /package/src/{persist → modules/persist}/useRoutePersistedStorage.ts +0 -0
- /package/src/{table → modules/table}/createTableStore.store.ts +0 -0
- /package/src/{types → modules/types}/tableStore.types.ts +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-type-extension-value-input
|
|
3
|
+
v-bind="attrs"
|
|
4
|
+
v-model:model-value="model"
|
|
5
|
+
:field="props.filterConfig.field"
|
|
6
|
+
>
|
|
7
|
+
<template #[ExtensionFieldType.Select]="{ defaultProps }">
|
|
8
|
+
<wt-select
|
|
9
|
+
v-bind="defaultProps"
|
|
10
|
+
:value="model ?? [] /* so that component won't break when model is nullish at init */"
|
|
11
|
+
:search-method="(...params) => props.filterConfig.searchRecords(...params)"
|
|
12
|
+
use-value-from-options-by-prop="id"
|
|
13
|
+
@input="model = $event"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
</wt-type-extension-value-input>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import {useVuelidate} from "@vuelidate/core";
|
|
21
|
+
import {required} from "@vuelidate/validators";
|
|
22
|
+
import { WtSelect, WtTypeExtensionValueInput } from '@webitel/ui-sdk/components';
|
|
23
|
+
import { WtTypeExtensionFieldKind } from '@webitel/ui-sdk/enums'; // DO NOT REMOVE THIS IMPORT!! : Webstorm lies you, import is used for dynamic slot computation
|
|
24
|
+
import {computed, useAttrs, watch} from "vue";
|
|
25
|
+
|
|
26
|
+
import {ITypeExtensionFilterConfig} from "./index";
|
|
27
|
+
|
|
28
|
+
const model = defineModel<unknown>();
|
|
29
|
+
|
|
30
|
+
const props = defineProps<{
|
|
31
|
+
filterConfig: ITypeExtensionFilterConfig;
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<{
|
|
35
|
+
'update:invalid': [boolean];
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
const attrs = useAttrs();
|
|
39
|
+
|
|
40
|
+
const v$ = useVuelidate(
|
|
41
|
+
computed(() => ({
|
|
42
|
+
model: {
|
|
43
|
+
required,
|
|
44
|
+
},
|
|
45
|
+
})),
|
|
46
|
+
{ model },
|
|
47
|
+
{ $autoDirty: true },
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
watch(
|
|
51
|
+
() => v$.value.$invalid,
|
|
52
|
+
(invalid) => {
|
|
53
|
+
emit('update:invalid', invalid);
|
|
54
|
+
},
|
|
55
|
+
{ immediate: true },
|
|
56
|
+
);
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style scoped>
|
|
60
|
+
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="type-extension-filter-value-preview">
|
|
3
|
+
213
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
const props = defineProps({});
|
|
9
|
+
|
|
10
|
+
const emit = defineEmits([]);
|
|
11
|
+
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<style scoped lang="scss">
|
|
15
|
+
.type-extension-filter-value-preview {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
@@ -17,7 +17,7 @@ import { WtSelect } from '@webitel/ui-sdk/components';
|
|
|
17
17
|
import { computed, useAttrs } from 'vue';
|
|
18
18
|
import { useI18n } from 'vue-i18n';
|
|
19
19
|
|
|
20
|
-
import { BooleanOptions } from '
|
|
20
|
+
import { BooleanOptions } from '../../../enums/options/BooleanFilterOptions';
|
|
21
21
|
|
|
22
22
|
const model = defineModel<boolean | null>();
|
|
23
23
|
|
|
@@ -19,7 +19,7 @@ import { WtSelect } from '@webitel/ui-sdk/components';
|
|
|
19
19
|
import { computed, watch } from 'vue';
|
|
20
20
|
import { useI18n } from 'vue-i18n';
|
|
21
21
|
|
|
22
|
-
import { AmdResultOptions } from '
|
|
22
|
+
import { AmdResultOptions } from '../../enums/options/AMDResultOptions';
|
|
23
23
|
|
|
24
24
|
const model = defineModel<string>();
|
|
25
25
|
const { t } = useI18n();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<wt-select
|
|
3
3
|
:clearable="false"
|
|
4
4
|
:label="t('webitelUI.filters.filterValue')"
|
|
5
|
-
:options="
|
|
5
|
+
:options="CallDirectionFilterOptions"
|
|
6
6
|
:value="model"
|
|
7
7
|
:v="v$.model"
|
|
8
8
|
track-by="value"
|
|
@@ -18,7 +18,7 @@ import { WtSelect } from '@webitel/ui-sdk/components';
|
|
|
18
18
|
import { computed, watch } from 'vue';
|
|
19
19
|
import { useI18n } from 'vue-i18n';
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { CallDirectionFilterOptions } from '../../enums/options/CallDirectionFilterOptions';
|
|
22
22
|
|
|
23
23
|
const model = defineModel<string>();
|
|
24
24
|
const { t } = useI18n();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<wt-select
|
|
3
3
|
:close-on-select="false"
|
|
4
4
|
:label="t('webitelUI.filters.filterValue')"
|
|
5
|
-
:search-method="
|
|
5
|
+
:search-method="props.filterConfig.searchRecords"
|
|
6
6
|
:v="v$.model.list"
|
|
7
7
|
:value="model?.list"
|
|
8
8
|
multiple
|
|
@@ -25,7 +25,7 @@ import { WtCheckbox, WtSelect } from '@webitel/ui-sdk/components';
|
|
|
25
25
|
import { computed, onMounted, watch } from 'vue';
|
|
26
26
|
import { useI18n } from 'vue-i18n';
|
|
27
27
|
|
|
28
|
-
import {
|
|
28
|
+
import {WtSysTypeFilterConfig} from "../../classes/FilterConfig";
|
|
29
29
|
|
|
30
30
|
type ModelValue = {
|
|
31
31
|
list: string[];
|
|
@@ -34,9 +34,14 @@ type ModelValue = {
|
|
|
34
34
|
|
|
35
35
|
const model = defineModel<ModelValue>();
|
|
36
36
|
|
|
37
|
+
const props = defineProps<{
|
|
38
|
+
filterConfig: WtSysTypeFilterConfig;
|
|
39
|
+
}>();
|
|
40
|
+
|
|
37
41
|
const emit = defineEmits<{
|
|
38
42
|
'update:invalid': [boolean];
|
|
39
43
|
}>();
|
|
44
|
+
|
|
40
45
|
const { t } = useI18n();
|
|
41
46
|
|
|
42
47
|
const initModel = () => {
|
|
@@ -7,8 +7,8 @@ import {computed} from "vue";
|
|
|
7
7
|
import { useI18n } from 'vue-i18n';
|
|
8
8
|
import { WebitelContactsContact } from 'webitel-sdk';
|
|
9
9
|
|
|
10
|
-
import {IFilter} from "../../../types/Filter";
|
|
11
10
|
import LookupFilterValuePreview from '../_shared/lookup-filter-preview/lookup-filter-value-preview.vue';
|
|
11
|
+
import {IFilter} from "../../../../classes/Filter";
|
|
12
12
|
|
|
13
13
|
const props = defineProps<{
|
|
14
14
|
value: WebitelContactsContact[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { contacts as ContactsAPI } from '@webitel/ui-sdk/api/clients/index';
|
|
2
|
+
|
|
3
|
+
import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
|
|
4
|
+
import { FilterOption } from '../../enums/FilterOption';
|
|
5
|
+
import CaseAssigneeFilterValueField from './case-assignee-filter-value-field.vue';
|
|
6
|
+
import CaseAssigneeFilterValuePreview from './case-assignee-filter-value-preview.vue';
|
|
7
|
+
|
|
8
|
+
class CaseAssigneeFilterConfig extends WtSysTypeFilterConfig {
|
|
9
|
+
readonly name = FilterOption.CaseAssignee;
|
|
10
|
+
valueInputComponent = CaseAssigneeFilterValueField;
|
|
11
|
+
valuePreviewComponent = CaseAssigneeFilterValuePreview;
|
|
12
|
+
|
|
13
|
+
searchRecords(
|
|
14
|
+
params: object,
|
|
15
|
+
{ filterValue } = {},
|
|
16
|
+
): Promise<{ items: unknown[]; next?: boolean }> {
|
|
17
|
+
const id =
|
|
18
|
+
params.id?.list /* general logic from dynamic-filter-preview.vue*/ ||
|
|
19
|
+
params.id /* wt-select options loadings */ ||
|
|
20
|
+
filterValue?.list; /* newest and coolest, but not implemented on all filters 🥲 */
|
|
21
|
+
|
|
22
|
+
return ContactsAPI.getLookup({
|
|
23
|
+
...params,
|
|
24
|
+
id,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const createCaseAssigneeFilterConfig = () =>
|
|
30
|
+
new CaseAssigneeFilterConfig();
|
|
@@ -7,8 +7,8 @@ import {computed} from "vue";
|
|
|
7
7
|
import { useI18n } from 'vue-i18n';
|
|
8
8
|
import { WebitelContactsContact } from 'webitel-sdk';
|
|
9
9
|
|
|
10
|
-
import {IFilter} from "../../../types/Filter";
|
|
11
10
|
import LookupFilterValuePreview from '../_shared/lookup-filter-preview/lookup-filter-value-preview.vue';
|
|
11
|
+
import {IFilter} from "../../../../classes/Filter";
|
|
12
12
|
|
|
13
13
|
const props = defineProps<{
|
|
14
14
|
value: WebitelContactsContact[];
|
|
@@ -19,7 +19,7 @@ import { WtSelect } from '@webitel/ui-sdk/components';
|
|
|
19
19
|
import { computed, watch } from 'vue';
|
|
20
20
|
import { useI18n } from 'vue-i18n';
|
|
21
21
|
|
|
22
|
-
import { HangupCauseOptions } from '
|
|
22
|
+
import { HangupCauseOptions } from '../../enums/options/HangupCauseFilterOptions';
|
|
23
23
|
|
|
24
24
|
const model = defineModel<string>();
|
|
25
25
|
const { t } = useI18n();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import { usePrettifyBooleanValuePreview } from '
|
|
6
|
+
import { usePrettifyBooleanValuePreview } from '../../composables/booleanFilterToolkit';
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
value: boolean;
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
10
|
import { watch } from 'vue';
|
|
11
11
|
|
|
12
|
-
import { useBooleanFilterValueValidation } from '
|
|
12
|
+
import { useBooleanFilterValueValidation } from '../../composables/booleanFilterToolkit';
|
|
13
13
|
import HasOptionFilterValueField from '../_shared/has-options/has-option-filter-value-field.vue';
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
import {BooleanFilterModelValue} from "../../enums/options/BooleanFilterOptions";
|
|
15
16
|
|
|
16
17
|
const model = defineModel<BooleanFilterModelValue>();
|
|
17
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import { usePrettifyBooleanValuePreview } from '
|
|
6
|
+
import { usePrettifyBooleanValuePreview } from '../../composables/booleanFilterToolkit';
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
value: boolean;
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
10
|
import { watch } from 'vue';
|
|
11
11
|
|
|
12
|
-
import { useBooleanFilterValueValidation } from '
|
|
12
|
+
import { useBooleanFilterValueValidation } from '../../composables/booleanFilterToolkit';
|
|
13
13
|
import HasOptionFilterValueField from '../_shared/has-options/has-option-filter-value-field.vue';
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
import {BooleanFilterModelValue} from "../../enums/options/BooleanFilterOptions";
|
|
15
16
|
|
|
16
17
|
const model = defineModel<BooleanFilterModelValue>();
|
|
17
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import { usePrettifyBooleanValuePreview } from '
|
|
6
|
+
import { usePrettifyBooleanValuePreview } from '../../composables/booleanFilterToolkit';
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
value: boolean;
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
10
|
import { watch } from 'vue';
|
|
11
11
|
|
|
12
|
-
import { useBooleanFilterValueValidation } from '
|
|
12
|
+
import { useBooleanFilterValueValidation } from '../../composables/booleanFilterToolkit';
|
|
13
13
|
import HasOptionFilterValueField from '../_shared/has-options/has-option-filter-value-field.vue';
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
import {BooleanFilterModelValue} from "../../enums/options/BooleanFilterOptions";
|
|
15
16
|
|
|
16
17
|
const model = defineModel<BooleanFilterModelValue>();
|
|
17
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import { usePrettifyBooleanValuePreview } from '
|
|
6
|
+
import { usePrettifyBooleanValuePreview } from '../../composables/booleanFilterToolkit';
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
value: boolean;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CustomFilterOption,
|
|
5
|
+
FilterOption,
|
|
6
|
+
FilterOptionName,
|
|
7
|
+
} from '../enums/FilterOption';
|
|
4
8
|
import AgentFilter from './agent/agent-filter-value-field.vue';
|
|
5
9
|
import AgentFilterPreview from './agent/agent-filter-value-preview.vue';
|
|
6
10
|
import { searchMethod as agentSearchMethod } from './agent/config';
|
|
@@ -12,9 +16,7 @@ import CaseActualReactionTimeFilterValueField from './case-actual-reaction-time/
|
|
|
12
16
|
import CaseActualReactionTimeFilterValuePreview from './case-actual-reaction-time/case-actual-reaction-time-filter-value-preview.vue';
|
|
13
17
|
import CaseActualResolutionTimeFilterValueField from './case-actual-resolution-time/case-actual-resolution-time-filter-value-field.vue';
|
|
14
18
|
import CaseActualResolutionTimeFilterValuePreview from './case-actual-resolution-time/case-actual-resolution-time-filter-value-preview.vue';
|
|
15
|
-
import
|
|
16
|
-
import CaseAssigneeFilterValuePreview from './case-assignee/case-assignee-filter-value-preview.vue';
|
|
17
|
-
import { searchMethod as caseAssigneeSearchMethod } from './case-assignee/config';
|
|
19
|
+
import { createCaseAssigneeFilterConfig } from './case-assignee';
|
|
18
20
|
import CaseAuthorFilterValueField from './case-author/case-author-filter-value-field.vue';
|
|
19
21
|
import CaseAuthorFilterValuePreview from './case-author/case-author-filter-value-preview.vue';
|
|
20
22
|
import { searchMethod as caseAuthorSearchMethod } from './case-author/config';
|
|
@@ -113,8 +115,6 @@ export {
|
|
|
113
115
|
CaseActualReactionTimeFilterValuePreview,
|
|
114
116
|
CaseActualResolutionTimeFilterValueField,
|
|
115
117
|
CaseActualResolutionTimeFilterValuePreview,
|
|
116
|
-
CaseAssigneeFilterValueField,
|
|
117
|
-
CaseAssigneeFilterValuePreview,
|
|
118
118
|
CaseAuthorFilterValueField,
|
|
119
119
|
CaseAuthorFilterValuePreview,
|
|
120
120
|
CaseCloseReasonGroupsFilterValueField,
|
|
@@ -216,7 +216,6 @@ export const FilterOptionToValueComponentMap: Record<
|
|
|
216
216
|
[FilterOption.CaseAuthor]: CaseAuthorFilterValueField,
|
|
217
217
|
[FilterOption.CaseReporter]: CaseReporterFilterValueField,
|
|
218
218
|
[FilterOption.CaseImpacted]: CaseImpactedFilterValueField,
|
|
219
|
-
[FilterOption.CaseAssignee]: CaseAssigneeFilterValueField,
|
|
220
219
|
[FilterOption.ContactGroup]: ContactGroupFilter,
|
|
221
220
|
[FilterOption.CasePriority]: CasePriorityFilterValueField,
|
|
222
221
|
[FilterOption.CaseCloseReasonGroups]: CaseCloseReasonGroupsFilterValueField,
|
|
@@ -263,7 +262,6 @@ export const FilterOptionToPreviewComponentMap: Record<
|
|
|
263
262
|
[FilterOption.CaseAuthor]: CaseAuthorFilterValuePreview,
|
|
264
263
|
[FilterOption.CaseReporter]: CaseReporterFilterValuePreview,
|
|
265
264
|
[FilterOption.CaseImpacted]: CaseImpactedFilterValuePreview,
|
|
266
|
-
[FilterOption.CaseAssignee]: CaseAssigneeFilterValuePreview,
|
|
267
265
|
[FilterOption.ContactGroup]: ContactGroupFilterPreview,
|
|
268
266
|
[FilterOption.CasePriority]: CasePriorityFilterValuePreview,
|
|
269
267
|
[FilterOption.CaseCloseReasonGroups]: CaseCloseReasonGroupsFilterValuePreview,
|
|
@@ -304,12 +302,6 @@ export const FilterOptionToPreviewApiSearchMethodMap: Record<
|
|
|
304
302
|
...rest,
|
|
305
303
|
});
|
|
306
304
|
},
|
|
307
|
-
[FilterOption.CaseAssignee]: ({ id: value }, ...rest) => {
|
|
308
|
-
return caseAssigneeSearchMethod({
|
|
309
|
-
id: value.list,
|
|
310
|
-
...rest,
|
|
311
|
-
});
|
|
312
|
-
},
|
|
313
305
|
[FilterOption.CaseAuthor]: caseAuthorSearchMethod,
|
|
314
306
|
[FilterOption.CasePriority]: casePrioritySearchMethod,
|
|
315
307
|
[FilterOption.CaseImpacted]: caseImpactedSearchMethod,
|
|
@@ -330,3 +322,7 @@ export const FilterOptionToPreviewApiSearchMethodMap: Record<
|
|
|
330
322
|
});
|
|
331
323
|
},
|
|
332
324
|
};
|
|
325
|
+
|
|
326
|
+
export const FilterOptionToFilterConfigCreatorMap = {
|
|
327
|
+
[FilterOption.CaseAssignee]: createCaseAssigneeFilterConfig,
|
|
328
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<wt-select
|
|
3
3
|
:clearable="false"
|
|
4
4
|
:label="t('webitelUI.filters.filterValue')"
|
|
5
|
-
:options="
|
|
5
|
+
:options="CallHistoryTagFilterOptions"
|
|
6
6
|
:value="model"
|
|
7
7
|
:v="v$.model"
|
|
8
8
|
multiple
|
|
@@ -19,7 +19,7 @@ import { WtSelect } from '@webitel/ui-sdk/components';
|
|
|
19
19
|
import { computed, watch } from 'vue';
|
|
20
20
|
import { useI18n } from 'vue-i18n';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { CallHistoryTagFilterOptions } from '../../enums/options/CallHistoryTagFilterOptions';
|
|
23
23
|
|
|
24
24
|
const model = defineModel<string>();
|
|
25
25
|
const { t } = useI18n();
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { computed } from 'vue';
|
|
14
14
|
import { useI18n } from 'vue-i18n';
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { CallHistoryTagFilterOptions } from '../../enums/options/CallHistoryTagFilterOptions';
|
|
17
17
|
|
|
18
18
|
const props = defineProps<{
|
|
19
19
|
value: string[];
|
|
@@ -22,7 +22,7 @@ const props = defineProps<{
|
|
|
22
22
|
const { t } = useI18n();
|
|
23
23
|
|
|
24
24
|
const tags = computed(() => {
|
|
25
|
-
const tagLocaleMap =
|
|
25
|
+
const tagLocaleMap = CallHistoryTagFilterOptions.reduce((acc, option) => {
|
|
26
26
|
return {
|
|
27
27
|
...acc,
|
|
28
28
|
[option.value]: option.locale,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script lang="ts" setup>
|
|
22
22
|
import { useI18n } from 'vue-i18n';
|
|
23
23
|
|
|
24
|
-
import { useFromToSecToPreviewTime } from '
|
|
24
|
+
import { useFromToSecToPreviewTime } from '../../composables/useFromToSecToPreviewTime';
|
|
25
25
|
import type { TalkDurationFilterModelValue } from './TalkDurationFilter.d.ts';
|
|
26
26
|
|
|
27
27
|
const props = defineProps<{
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script lang="ts" setup>
|
|
22
22
|
import { useI18n } from 'vue-i18n';
|
|
23
23
|
|
|
24
|
-
import { useFromToSecToPreviewTime } from '
|
|
24
|
+
import { useFromToSecToPreviewTime } from '../../composables/useFromToSecToPreviewTime';
|
|
25
25
|
import type { TalkDurationFilterModelValue } from '../talk-duration/TalkDurationFilter';
|
|
26
26
|
|
|
27
27
|
const props = defineProps<{
|
|
@@ -2,7 +2,8 @@ import { useVuelidate } from '@vuelidate/core';
|
|
|
2
2
|
import { computed, ModelRef, type Reactive, type Ref } from 'vue';
|
|
3
3
|
import { useI18n } from 'vue-i18n';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import {BooleanFilterModelValue} from "../enums/options/BooleanFilterOptions";
|
|
6
7
|
|
|
7
8
|
export const usePrettifyBooleanValuePreview = (
|
|
8
9
|
value: Reactive<boolean>,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { FilterName } from '../types/Filter';
|
|
2
|
-
|
|
3
1
|
export const FilterOption = {
|
|
4
2
|
Agent: 'agent',
|
|
5
3
|
AmdResult: 'amdResult',
|
|
@@ -41,13 +39,15 @@ export const FilterOption = {
|
|
|
41
39
|
CaseActualReactionTime: 'actualReactionTime',
|
|
42
40
|
CaseActualResolutionTime: 'actualResolutionTime',
|
|
43
41
|
HasAttachment: 'hasAttachment',
|
|
44
|
-
} as const
|
|
45
|
-
|
|
46
|
-
export type FilterOptionName = (typeof FilterOption)[keyof typeof FilterOption];
|
|
42
|
+
} as const;
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @description
|
|
47
|
+
* any custom lookup fields or type extensions
|
|
48
|
+
*/
|
|
49
|
+
export type CustomFilterOption = string;
|
|
52
50
|
|
|
53
|
-
export type FilterOption =
|
|
51
|
+
export type FilterOption =
|
|
52
|
+
| (typeof FilterOption)[keyof typeof FilterOption]
|
|
53
|
+
| CustomFilterOption;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
values are strings instead of booleans because restoration from url query
|
|
3
3
|
returns string for any type of value [DEV-3924]
|
|
4
4
|
*/
|
|
5
|
-
import { FilterEnumOption } from '
|
|
5
|
+
import { FilterEnumOption } from '../../../../classes/Filter';
|
|
6
6
|
|
|
7
7
|
export const BooleanOptions: Array<FilterEnumOption> = [
|
|
8
8
|
{
|
|
@@ -14,3 +14,4 @@ export const BooleanOptions: Array<FilterEnumOption> = [
|
|
|
14
14
|
value: 'false',
|
|
15
15
|
},
|
|
16
16
|
] as const;
|
|
17
|
+
export type BooleanFilterModelValue = boolean;
|
|
@@ -8,7 +8,7 @@ export type DirectionOption = {
|
|
|
8
8
|
value: CallDirectionType;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const CallDirectionFilterOptions: readonly DirectionOption[] = [
|
|
12
12
|
{
|
|
13
13
|
locale: [`calls.direction.${CallDirection.Inbound}`, 2],
|
|
14
14
|
value: CallDirection.Inbound,
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
FilterConfig,
|
|
3
|
-
FilterInitParams,
|
|
4
|
-
FilterLabel,
|
|
5
|
-
FilterName,
|
|
6
|
-
FilterValue,
|
|
7
|
-
IFilter,
|
|
8
|
-
} from '../types/Filter';
|
|
9
|
-
|
|
10
|
-
export class Filter implements IFilter {
|
|
11
|
-
readonly name: FilterName;
|
|
12
|
-
label: FilterLabel;
|
|
13
|
-
value: FilterValue;
|
|
14
|
-
|
|
15
|
-
constructor(
|
|
16
|
-
{ name, value, label }: FilterInitParams,
|
|
17
|
-
public payload: object | undefined,
|
|
18
|
-
public config: FilterConfig,
|
|
19
|
-
) {
|
|
20
|
-
this.name = name;
|
|
21
|
-
this.value = value;
|
|
22
|
-
this.label = label;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
set({ value, label }: { value?: FilterValue; label?: FilterLabel }): IFilter {
|
|
26
|
-
this.value = value;
|
|
27
|
-
this.label = label;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FilterValue } from '../types/Filter';
|
|
2
|
-
import type { FilterStorageOptions } from './FilterStorageOptions';
|
|
3
|
-
|
|
4
|
-
export class BrowserFilterStorage implements FilterStorageOptions {
|
|
5
|
-
constructor(private prefix: string) {}
|
|
6
|
-
|
|
7
|
-
get(name: string): FilterValue {
|
|
8
|
-
const value = localStorage.getItem(`filters:${this.prefix}:${name}`);
|
|
9
|
-
return value ? JSON.parse(value) : undefined;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
set(name: string, value: FilterValue): void {
|
|
13
|
-
localStorage.setItem(
|
|
14
|
-
`filters:${this.prefix}:${name}`,
|
|
15
|
-
JSON.stringify(value),
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class QueryFilterStorage implements FilterStorageOptions {
|
|
21
|
-
constructor(private prefix: string) {}
|
|
22
|
-
|
|
23
|
-
get(name: string): FilterValue {
|
|
24
|
-
const url = new URL(window.location.href);
|
|
25
|
-
const value = url.searchParams.get(`${this.prefix}:${name}`);
|
|
26
|
-
return value ? JSON.parse(value) : undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
set(name: string, value: FilterValue): void {
|
|
30
|
-
const url = new URL(window.location.href);
|
|
31
|
-
url.searchParams.set(`${this.prefix}:${name}`, JSON.stringify(value));
|
|
32
|
-
window.history.pushState({}, '', url.toString());
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type BooleanFilterModelValue = boolean;
|