@webitel/ui-datalist 1.0.0 → 1.0.1
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/Readme.md +19 -0
- package/package.json +3 -1
- package/src/filter-presets/api/PresetQuery.api.ts +123 -0
- package/src/filter-presets/components/_shared/input-fields/preset-description-field.vue +33 -0
- package/src/filter-presets/components/_shared/input-fields/preset-name-field.vue +29 -0
- package/src/filter-presets/components/_shared/preset-filters-preview.vue +45 -0
- package/src/filter-presets/components/apply-preset/apply-preset-action.vue +234 -0
- package/src/filter-presets/components/apply-preset/preset-preview.vue +210 -0
- package/src/filter-presets/components/save-preset/overwrite-preset-popup.vue +64 -0
- package/src/filter-presets/components/save-preset/save-preset-action.vue +139 -0
- package/src/filter-presets/components/save-preset/save-preset-popup.vue +136 -0
- package/src/filter-presets/index.ts +5 -0
- package/src/filter-presets/stores/createFilterPresetsStore.ts +17 -0
- package/src/filter-presets/stores/headers/headers.ts +24 -0
- package/src/filters/classes/Filter.ts +30 -0
- package/src/filters/classes/FilterStorage.ts +34 -0
- package/src/filters/classes/FilterStorageOptions.d.ts +6 -0
- package/src/filters/classes/FiltersManager.ts +189 -0
- package/src/filters/components/config/dynamic-filter-config-form-label.vue +50 -0
- package/src/filters/components/config/dynamic-filter-config-form.vue +140 -0
- package/src/filters/components/config/dynamic-filter-config-view.vue +40 -0
- package/src/filters/components/dynamic-filter-add-action.vue +54 -0
- package/src/filters/components/dynamic-filter-panel-wrapper.vue +57 -0
- package/src/filters/components/dynamic-filter-search.vue +61 -0
- package/src/filters/components/filter-options/_shared/composables/booleanFilterToolkit.ts +39 -0
- package/src/filters/components/filter-options/_shared/composables/useFromToSecToPreviewTime.ts +41 -0
- package/src/filters/components/filter-options/_shared/date-time-filter/date-time-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/_shared/durations/duration-filter-value-field.vue +84 -0
- package/src/filters/components/filter-options/_shared/has-options/has-option-filter-value-field.vue +38 -0
- package/src/filters/components/filter-options/_shared/types/BooleanFilter.ts +1 -0
- package/src/filters/components/filter-options/actual-reaction-time/actual-reaction-time-filter-value-field.vue +18 -0
- package/src/filters/components/filter-options/actual-reaction-time/actual-reaction-time-filter-value-preview.vue +44 -0
- package/src/filters/components/filter-options/actual-resolution-time/actual-resolution-time-filter-value-field.vue +18 -0
- package/src/filters/components/filter-options/actual-resolution-time/actual-resolution-time-filter-value-preview.vue +44 -0
- package/src/filters/components/filter-options/agent/agent-filter-value-field.vue +58 -0
- package/src/filters/components/filter-options/agent/agent-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/agent/config.js +4 -0
- package/src/filters/components/filter-options/amd-result/amd-result-filter-value-field.vue +52 -0
- package/src/filters/components/filter-options/amd-result/amd-result-filter-value-preview.vue +18 -0
- package/src/filters/components/filter-options/assignee/assignee-filter-value-field.vue +74 -0
- package/src/filters/components/filter-options/assignee/assignee-filter-value-preview.vue +36 -0
- package/src/filters/components/filter-options/assignee/config.js +4 -0
- package/src/filters/components/filter-options/author/author-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/author/author-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/author/config.js +4 -0
- package/src/filters/components/filter-options/cause/cause-filter-value-field.vue +52 -0
- package/src/filters/components/filter-options/cause/cause-filter-value-preview.vue +18 -0
- package/src/filters/components/filter-options/close-reason-groups-case/close-reason-groups-case-filter-value-field.vue +102 -0
- package/src/filters/components/filter-options/close-reason-groups-case/close-reason-groups-case-filter-value-preview.vue +34 -0
- package/src/filters/components/filter-options/close-reason-groups-case/config.js +7 -0
- package/src/filters/components/filter-options/contact/config.js +4 -0
- package/src/filters/components/filter-options/contact/contact-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/contact/contact-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/contact-group/config.js +4 -0
- package/src/filters/components/filter-options/contact-group/contact-group-filter-value-field.vue +74 -0
- package/src/filters/components/filter-options/contact-group/contact-group-filter-value-preview.vue +38 -0
- package/src/filters/components/filter-options/created-at-from/created-at-from-filter-value-field.vue +24 -0
- package/src/filters/components/filter-options/created-at-from/created-at-from-filter-value-preview.vue +15 -0
- package/src/filters/components/filter-options/created-at-to/created-at-to-filter-value-field.vue +24 -0
- package/src/filters/components/filter-options/created-at-to/created-at-to-filter-value-preview.vue +15 -0
- package/src/filters/components/filter-options/direction/direction-filter-value-field.vue +51 -0
- package/src/filters/components/filter-options/direction/direction-filter-value-preview.vue +17 -0
- package/src/filters/components/filter-options/gateway/config.js +4 -0
- package/src/filters/components/filter-options/gateway/gateway-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/gateway/gateway-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/grantee/config.js +4 -0
- package/src/filters/components/filter-options/grantee/grantee-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/grantee/grantee-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/has-attachment/has-attachment-filter-value-field.vue +43 -0
- package/src/filters/components/filter-options/has-attachment/has-attachment-filter-value-preview.vue +24 -0
- package/src/filters/components/filter-options/has-file/has-file-filter-value-field.vue +33 -0
- package/src/filters/components/filter-options/has-file/has-file-filter-value-preview.vue +15 -0
- package/src/filters/components/filter-options/has-rating/has-rating-filter-value-field.vue +33 -0
- package/src/filters/components/filter-options/has-rating/has-rating-filter-value-preview.vue +15 -0
- package/src/filters/components/filter-options/has-transcription/has-transcription-filter-value-field.vue +33 -0
- package/src/filters/components/filter-options/has-transcription/has-transcription-filter-value-preview.vue +15 -0
- package/src/filters/components/filter-options/impacted/config.js +4 -0
- package/src/filters/components/filter-options/impacted/impacted-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/impacted/impacted-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/index.ts +250 -0
- package/src/filters/components/filter-options/priority-case/config.js +4 -0
- package/src/filters/components/filter-options/priority-case/priority-case-filter-value-field.vue +57 -0
- package/src/filters/components/filter-options/priority-case/priority-case-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/queue/config.js +4 -0
- package/src/filters/components/filter-options/queue/queue-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/queue/queue-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/rated-by/config.js +4 -0
- package/src/filters/components/filter-options/rated-by/rated-by-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/rated-by/rated-by-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/rating/rating-from-to-filter-value-field.vue +101 -0
- package/src/filters/components/filter-options/rating/rating-from-to-filter-value-preview.vue +39 -0
- package/src/filters/components/filter-options/reaction-time/reaction-time-filter-value-field.vue +18 -0
- package/src/filters/components/filter-options/reaction-time/reaction-time-filter-value-preview.vue +44 -0
- package/src/filters/components/filter-options/reporter/config.js +4 -0
- package/src/filters/components/filter-options/reporter/reporter-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/reporter/reporter-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/resolution-time/resolution-time-filter-value-field.vue +18 -0
- package/src/filters/components/filter-options/resolution-time/resolution-time-filter-value-preview.vue +44 -0
- package/src/filters/components/filter-options/score/score-from-to-filter-value-field.vue +100 -0
- package/src/filters/components/filter-options/score/score-from-to-filter-value-preview.vue +39 -0
- package/src/filters/components/filter-options/service-case/config.js +6 -0
- package/src/filters/components/filter-options/service-case/service-case-filter-value-field.vue +82 -0
- package/src/filters/components/filter-options/service-case/service-case-filter-value-preview.vue +34 -0
- package/src/filters/components/filter-options/sla/config.js +4 -0
- package/src/filters/components/filter-options/sla/sla-filter-value-field.vue +57 -0
- package/src/filters/components/filter-options/sla/sla-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/sla-condition/config.js +6 -0
- package/src/filters/components/filter-options/sla-condition/sla-condition-filter-value-field.vue +98 -0
- package/src/filters/components/filter-options/sla-condition/sla-condition-filter-value-preview.vue +37 -0
- package/src/filters/components/filter-options/source-case/config.js +4 -0
- package/src/filters/components/filter-options/source-case/source-case-filter-value-field.vue +57 -0
- package/src/filters/components/filter-options/source-case/source-case-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/status-case/config.js +7 -0
- package/src/filters/components/filter-options/status-case/status-case-filter-value-field.vue +102 -0
- package/src/filters/components/filter-options/status-case/status-case-filter-value-preview.vue +37 -0
- package/src/filters/components/filter-options/tag/tag-filter-value-field.vue +52 -0
- package/src/filters/components/filter-options/tag/tag-filter-value-preview.vue +38 -0
- package/src/filters/components/filter-options/talk-duration/TalkDurationFilter.d.ts +4 -0
- package/src/filters/components/filter-options/talk-duration/talk-duration-filter-value-field.vue +19 -0
- package/src/filters/components/filter-options/talk-duration/talk-duration-filter-value-preview.vue +44 -0
- package/src/filters/components/filter-options/team/config.js +4 -0
- package/src/filters/components/filter-options/team/team-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/team/team-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/total-duration/TotalDurationFilter.d.ts +4 -0
- package/src/filters/components/filter-options/total-duration/total-duration-filter-value-field.vue +19 -0
- package/src/filters/components/filter-options/total-duration/total-duration-filter-value-preview.vue +44 -0
- package/src/filters/components/filter-options/user/config.js +4 -0
- package/src/filters/components/filter-options/user/user-filter-value-field.vue +56 -0
- package/src/filters/components/filter-options/user/user-filter-value-preview.vue +31 -0
- package/src/filters/components/filter-options/variable/variable-filter-value-field.vue +50 -0
- package/src/filters/components/filter-options/variable/variable-filter-value-preview.vue +39 -0
- package/src/filters/components/preview/dynamic-filter-preview-info.vue +35 -0
- package/src/filters/components/preview/dynamic-filter-preview.vue +76 -0
- package/src/filters/components/table-filters-panel.vue +87 -0
- package/src/filters/createTableFiltersStore.ts +81 -0
- package/src/filters/enums/FilterOption.ts +43 -0
- package/src/filters/enums/amd-result-options.ts +38 -0
- package/src/filters/enums/boolean-options.ts +16 -0
- package/src/filters/enums/direction-options.ts +20 -0
- package/src/filters/enums/hangup-cause-options.ts +265 -0
- package/src/filters/enums/tag-options.ts +8 -0
- package/src/filters/index.ts +27 -0
- package/src/filters/scripts/utils.ts +31 -0
- package/src/filters/types/Filter.d.ts +46 -0
- package/src/filters/types/FiltersManager.d.ts +76 -0
- package/src/headers/createTableHeadersStore.ts +140 -0
- package/src/index.d.ts +0 -0
- package/src/index.ts +3 -0
- package/src/pagination/createTablePaginationStore.ts +64 -0
- package/src/persist/PersistedStorage.types.ts +51 -0
- package/src/persist/useLocalStoragePersistedStorage.ts +37 -0
- package/src/persist/usePersistedStorage.ts +151 -0
- package/src/persist/useRoutePersistedStorage.ts +41 -0
- package/src/table/createTableStore.store.ts +206 -0
- package/src/types/tableStore.types.ts +61 -0
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
const { t } = useI18n();
|
|
31
|
+
|
|
32
|
+
const v$ = useVuelidate(
|
|
33
|
+
computed(() => ({
|
|
34
|
+
model: {
|
|
35
|
+
required,
|
|
36
|
+
},
|
|
37
|
+
})),
|
|
38
|
+
{ model },
|
|
39
|
+
{ $autoDirty: true },
|
|
40
|
+
);
|
|
41
|
+
v$.value.$touch();
|
|
42
|
+
|
|
43
|
+
watch(
|
|
44
|
+
() => v$.value.$invalid,
|
|
45
|
+
(invalid) => {
|
|
46
|
+
emit('update:invalid', invalid);
|
|
47
|
+
},
|
|
48
|
+
{ immediate: true },
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const handleInput = (value: ModelValue) => {
|
|
52
|
+
model.value = value;
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul v-if="localValue">
|
|
3
|
+
<li
|
|
4
|
+
v-for="({ name }, index) of localValue"
|
|
5
|
+
:key="index"
|
|
6
|
+
>
|
|
7
|
+
{{ name }}
|
|
8
|
+
</li>
|
|
9
|
+
</ul>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
|
|
15
|
+
import { searchMethod } from './config.js';
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
value: number[];
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const localValue = ref([]);
|
|
22
|
+
|
|
23
|
+
const getLocalValue = async () => {
|
|
24
|
+
const { items } = await searchMethod({ id: props.value });
|
|
25
|
+
localValue.value = items;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
getLocalValue();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/contact-group/contact-group-filter-value-field.vue
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-select
|
|
3
|
+
:close-on-select="false"
|
|
4
|
+
:label="t('webitelUI.filters.filterValue')"
|
|
5
|
+
:search-method="searchMethod"
|
|
6
|
+
:v="v$.model.list"
|
|
7
|
+
:value="model?.list"
|
|
8
|
+
multiple
|
|
9
|
+
track-by="id"
|
|
10
|
+
use-value-from-options-by-prop="id"
|
|
11
|
+
@input="model.list = $event"
|
|
12
|
+
/>
|
|
13
|
+
<wt-checkbox
|
|
14
|
+
:label="t('reusable.showUnassigned')"
|
|
15
|
+
:selected="model?.unassigned"
|
|
16
|
+
:v="v$.model.unassigned"
|
|
17
|
+
@change="model.unassigned = $event"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
import { useVuelidate } from '@vuelidate/core';
|
|
23
|
+
import { requiredIf } from '@vuelidate/validators';
|
|
24
|
+
import { computed, onMounted, watch } from 'vue';
|
|
25
|
+
import { useI18n } from 'vue-i18n';
|
|
26
|
+
|
|
27
|
+
import WtCheckbox from '../../../../../../../components/wt-checkbox/wt-checkbox.vue';
|
|
28
|
+
import WtSelect from '../../../../../../../components/wt-select/wt-select.vue';
|
|
29
|
+
import { searchMethod } from './config.js';
|
|
30
|
+
|
|
31
|
+
type ModelValue = {
|
|
32
|
+
list: string[];
|
|
33
|
+
unassigned: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const model = defineModel<ModelValue>();
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits<{
|
|
39
|
+
'update:invalid': [boolean];
|
|
40
|
+
}>();
|
|
41
|
+
const { t } = useI18n();
|
|
42
|
+
|
|
43
|
+
const initModel = () => {
|
|
44
|
+
if (!model.value) {
|
|
45
|
+
model.value = {
|
|
46
|
+
list: [],
|
|
47
|
+
unassigned: false,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
onMounted(() => initModel());
|
|
52
|
+
|
|
53
|
+
const v$ = useVuelidate(
|
|
54
|
+
computed(() => ({
|
|
55
|
+
model: {
|
|
56
|
+
list: { required: requiredIf(() => !model.value.unassigned) },
|
|
57
|
+
unassigned: { required: requiredIf(() => !model.value.list.length) },
|
|
58
|
+
},
|
|
59
|
+
})),
|
|
60
|
+
{ model },
|
|
61
|
+
{ $autoDirty: true },
|
|
62
|
+
);
|
|
63
|
+
v$.value.$touch();
|
|
64
|
+
|
|
65
|
+
watch(
|
|
66
|
+
() => v$.value.$invalid,
|
|
67
|
+
(invalid) => {
|
|
68
|
+
emit('update:invalid', invalid);
|
|
69
|
+
},
|
|
70
|
+
{ immediate: true },
|
|
71
|
+
);
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/contact-group/contact-group-filter-value-preview.vue
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<p v-if="props.value.unassigned">{{ t('reusable.unassigned') }}</p>
|
|
4
|
+
<ul v-if="localValue">
|
|
5
|
+
<li
|
|
6
|
+
v-for="({ name }, index) of localValue"
|
|
7
|
+
:key="index"
|
|
8
|
+
>
|
|
9
|
+
{{ name }}
|
|
10
|
+
</li>
|
|
11
|
+
</ul>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { ref } from 'vue';
|
|
17
|
+
import { useI18n } from 'vue-i18n';
|
|
18
|
+
|
|
19
|
+
import { searchMethod } from './config.js';
|
|
20
|
+
|
|
21
|
+
const props = defineProps<{
|
|
22
|
+
value: number[];
|
|
23
|
+
}>();
|
|
24
|
+
|
|
25
|
+
const localValue = ref([]);
|
|
26
|
+
const { t } = useI18n();
|
|
27
|
+
|
|
28
|
+
const getLocalValue = async () => {
|
|
29
|
+
const { items } = await searchMethod({
|
|
30
|
+
id: props.value.list,
|
|
31
|
+
});
|
|
32
|
+
localValue.value = items;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
getLocalValue();
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/created-at-from/created-at-from-filter-value-field.vue
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-datepicker
|
|
3
|
+
v-if="model"
|
|
4
|
+
:value="model"
|
|
5
|
+
:label="`${t('webitelUI.filters.filterValue')}`"
|
|
6
|
+
mode="datetime"
|
|
7
|
+
@input="model = $event"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { startOfToday } from 'date-fns';
|
|
13
|
+
import { useI18n } from 'vue-i18n';
|
|
14
|
+
|
|
15
|
+
const model = defineModel<number>();
|
|
16
|
+
|
|
17
|
+
const { t } = useI18n();
|
|
18
|
+
|
|
19
|
+
if (!model.value) {
|
|
20
|
+
model.value = startOfToday().getTime();
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>{{ date }}</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import { ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
value: number[];
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const date = ref(new Date(+props.value).toLocaleString());
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/created-at-to/created-at-to-filter-value-field.vue
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-datepicker
|
|
3
|
+
v-if="model"
|
|
4
|
+
:label="`${t('webitelUI.filters.filterValue')}`"
|
|
5
|
+
:value="model"
|
|
6
|
+
mode="datetime"
|
|
7
|
+
@input="model = $event"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { endOfToday } from 'date-fns';
|
|
13
|
+
import { useI18n } from 'vue-i18n';
|
|
14
|
+
|
|
15
|
+
const model = defineModel<number>();
|
|
16
|
+
|
|
17
|
+
const { t } = useI18n();
|
|
18
|
+
|
|
19
|
+
if (!model.value) {
|
|
20
|
+
model.value = endOfToday().getTime();
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/created-at-to/created-at-to-filter-value-preview.vue
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>{{ date }}</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import { ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
value: number[];
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const date = ref(new Date(+props.value).toLocaleString());
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-select
|
|
3
|
+
:clearable="false"
|
|
4
|
+
:label="t('webitelUI.filters.filterValue')"
|
|
5
|
+
:options="DirectionOptions"
|
|
6
|
+
:value="model"
|
|
7
|
+
:v="v$.model"
|
|
8
|
+
track-by="value"
|
|
9
|
+
use-value-from-options-by-prop="value"
|
|
10
|
+
@input="model = $event"
|
|
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 { DirectionOptions } from '../../../enums/direction-options';
|
|
22
|
+
|
|
23
|
+
const model = defineModel<string>();
|
|
24
|
+
const { t } = useI18n();
|
|
25
|
+
|
|
26
|
+
const v$ = useVuelidate(
|
|
27
|
+
computed(() => ({
|
|
28
|
+
model: {
|
|
29
|
+
required,
|
|
30
|
+
},
|
|
31
|
+
})),
|
|
32
|
+
{ model },
|
|
33
|
+
{ $autoDirty: true },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
v$.value.$touch();
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits<{
|
|
39
|
+
'update:invalid': [boolean];
|
|
40
|
+
}>();
|
|
41
|
+
|
|
42
|
+
watch(
|
|
43
|
+
() => v$.value.$invalid,
|
|
44
|
+
(invalid) => {
|
|
45
|
+
emit('update:invalid', invalid);
|
|
46
|
+
},
|
|
47
|
+
{ immediate: true },
|
|
48
|
+
);
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
{{ t(`calls.direction.${value}`) }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { useI18n } from 'vue-i18n';
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
value: number[];
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const { t } = useI18n();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
const { t } = useI18n();
|
|
31
|
+
|
|
32
|
+
const v$ = useVuelidate(
|
|
33
|
+
computed(() => ({
|
|
34
|
+
model: {
|
|
35
|
+
required,
|
|
36
|
+
},
|
|
37
|
+
})),
|
|
38
|
+
{ model },
|
|
39
|
+
{ $autoDirty: true },
|
|
40
|
+
);
|
|
41
|
+
v$.value.$touch();
|
|
42
|
+
|
|
43
|
+
watch(
|
|
44
|
+
() => v$.value.$invalid,
|
|
45
|
+
(invalid) => {
|
|
46
|
+
emit('update:invalid', invalid);
|
|
47
|
+
},
|
|
48
|
+
{ immediate: true },
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const handleInput = (value: ModelValue) => {
|
|
52
|
+
model.value = value;
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul v-if="localValue">
|
|
3
|
+
<li
|
|
4
|
+
v-for="({ name }, index) of localValue"
|
|
5
|
+
:key="index"
|
|
6
|
+
>
|
|
7
|
+
{{ name }}
|
|
8
|
+
</li>
|
|
9
|
+
</ul>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
|
|
15
|
+
import { searchMethod } from './config.js';
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
value: number[];
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const localValue = ref([]);
|
|
22
|
+
|
|
23
|
+
const getLocalValue = async () => {
|
|
24
|
+
const { items } = await searchMethod({ id: props.value });
|
|
25
|
+
localValue.value = items;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
getLocalValue();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
const { t } = useI18n();
|
|
31
|
+
|
|
32
|
+
const v$ = useVuelidate(
|
|
33
|
+
computed(() => ({
|
|
34
|
+
model: {
|
|
35
|
+
required,
|
|
36
|
+
},
|
|
37
|
+
})),
|
|
38
|
+
{ model },
|
|
39
|
+
{ $autoDirty: true },
|
|
40
|
+
);
|
|
41
|
+
v$.value.$touch();
|
|
42
|
+
|
|
43
|
+
watch(
|
|
44
|
+
() => v$.value.$invalid,
|
|
45
|
+
(invalid) => {
|
|
46
|
+
emit('update:invalid', invalid);
|
|
47
|
+
},
|
|
48
|
+
{ immediate: true },
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const handleInput = (value: ModelValue) => {
|
|
52
|
+
model.value = value;
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul v-if="localValue">
|
|
3
|
+
<li
|
|
4
|
+
v-for="({ name }, index) of localValue"
|
|
5
|
+
:key="index"
|
|
6
|
+
>
|
|
7
|
+
{{ name }}
|
|
8
|
+
</li>
|
|
9
|
+
</ul>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
|
|
15
|
+
import { searchMethod } from './config.js';
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
value: number[];
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const localValue = ref([]);
|
|
22
|
+
|
|
23
|
+
const getLocalValue = async () => {
|
|
24
|
+
const { items } = await searchMethod({ ids: props.value });
|
|
25
|
+
localValue.value = items;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
getLocalValue();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/has-attachment/has-attachment-filter-value-field.vue
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<has-option-filter-value-field
|
|
3
|
+
:model-value="model"
|
|
4
|
+
:v="v$.model"
|
|
5
|
+
@update:model-value="model = $event"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { useVuelidate } from '@vuelidate/core';
|
|
11
|
+
import { required } from '@vuelidate/validators';
|
|
12
|
+
import { computed, watch } from 'vue';
|
|
13
|
+
|
|
14
|
+
import HasOptionFilterValueField from '../_shared/has-options/has-option-filter-value-field.vue';
|
|
15
|
+
|
|
16
|
+
const model = defineModel<string>();
|
|
17
|
+
|
|
18
|
+
const v$ = useVuelidate(
|
|
19
|
+
computed(() => ({
|
|
20
|
+
model: {
|
|
21
|
+
required,
|
|
22
|
+
},
|
|
23
|
+
})),
|
|
24
|
+
{ model },
|
|
25
|
+
{ $autoDirty: true },
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
v$.value.$touch();
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits<{
|
|
31
|
+
'update:invalid': [boolean];
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
watch(
|
|
35
|
+
() => v$.value.$invalid,
|
|
36
|
+
(invalid) => {
|
|
37
|
+
emit('update:invalid', invalid);
|
|
38
|
+
},
|
|
39
|
+
{ immediate: true },
|
|
40
|
+
);
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="scss" scoped></style>
|
package/src/filters/components/filter-options/has-attachment/has-attachment-filter-value-preview.vue
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>{{ localeValue }}</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import { computed } from 'vue';
|
|
7
|
+
import { useI18n } from 'vue-i18n';
|
|
8
|
+
|
|
9
|
+
import { BooleanOptions } from '../../../enums/boolean-options';
|
|
10
|
+
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
value: boolean;
|
|
13
|
+
}>();
|
|
14
|
+
const { t } = useI18n();
|
|
15
|
+
|
|
16
|
+
const localeValue = computed(() => {
|
|
17
|
+
const match = BooleanOptions.find(
|
|
18
|
+
(el) => el.value === props.value.toString(),
|
|
19
|
+
);
|
|
20
|
+
return match ? t(match.locale) : '';
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<has-option-filter-value-field
|
|
3
|
+
:model-value="model"
|
|
4
|
+
:v="v$.model"
|
|
5
|
+
@update:model-value="model = $event"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { watch } from 'vue';
|
|
11
|
+
|
|
12
|
+
import { useBooleanFilterValueValidation } from '../_shared/composables/booleanFilterToolkit';
|
|
13
|
+
import HasOptionFilterValueField from '../_shared/has-options/has-option-filter-value-field.vue';
|
|
14
|
+
import { BooleanFilterModelValue } from '../_shared/types/BooleanFilter';
|
|
15
|
+
|
|
16
|
+
const model = defineModel<BooleanFilterModelValue>();
|
|
17
|
+
|
|
18
|
+
const { v$ } = useBooleanFilterValueValidation<BooleanFilterModelValue>(model);
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
'update:invalid': [boolean];
|
|
22
|
+
}>();
|
|
23
|
+
|
|
24
|
+
watch(
|
|
25
|
+
() => v$.value.$invalid,
|
|
26
|
+
(invalid) => {
|
|
27
|
+
emit('update:invalid', invalid);
|
|
28
|
+
},
|
|
29
|
+
{ immediate: true },
|
|
30
|
+
);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>{{ localeValue }}</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import { usePrettifyBooleanValuePreview } from '../_shared/composables/booleanFilterToolkit';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
value: boolean;
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const { localeValue } = usePrettifyBooleanValuePreview(props.value);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped></style>
|