@webitel/ui-datalist 1.0.9 → 1.0.11
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
CHANGED
package/src/filters/components/filter-options/has-attachment/has-attachment-filter-value-preview.vue
CHANGED
|
@@ -3,22 +3,13 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import {
|
|
7
|
-
import { useI18n } from 'vue-i18n';
|
|
8
|
-
|
|
9
|
-
import { BooleanOptions } from '../../../enums/boolean-options';
|
|
6
|
+
import { usePrettifyBooleanValuePreview } from '../_shared/composables/booleanFilterToolkit';
|
|
10
7
|
|
|
11
8
|
const props = defineProps<{
|
|
12
9
|
value: boolean;
|
|
13
10
|
}>();
|
|
14
|
-
const { t } = useI18n();
|
|
15
11
|
|
|
16
|
-
const localeValue =
|
|
17
|
-
const match = BooleanOptions.find(
|
|
18
|
-
(el) => el.value === props.value.toString(),
|
|
19
|
-
);
|
|
20
|
-
return match ? t(match.locale) : '';
|
|
21
|
-
});
|
|
12
|
+
const { localeValue } = usePrettifyBooleanValuePreview(props.value);
|
|
22
13
|
</script>
|
|
23
14
|
|
|
24
15
|
<style scoped></style>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
{{ filter.label || t(`webitelUI.filters.${filter.name}`) }}
|
|
11
11
|
<wt-icon-btn
|
|
12
12
|
v-if="!filterConfig.notDeletable && !readonly"
|
|
13
|
+
color="on-primary"
|
|
13
14
|
icon="close--filled"
|
|
14
15
|
size="sm"
|
|
15
|
-
color="on-primary"
|
|
16
16
|
@mousedown.stop="deleteFilter"
|
|
17
17
|
/>
|
|
18
18
|
</wt-chip>
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
<template #default>
|
|
28
28
|
<slot name="info">
|
|
29
29
|
<wt-loader
|
|
30
|
-
v-if="!
|
|
30
|
+
v-if="!isRenderPreview"
|
|
31
31
|
size="sm"
|
|
32
32
|
/>
|
|
33
33
|
<component
|
|
34
34
|
:is="FilterOptionToPreviewComponentMap[filter.name]"
|
|
35
35
|
v-else
|
|
36
|
-
:value="localValue"
|
|
37
36
|
:filter="props.filter"
|
|
37
|
+
:value="localValue"
|
|
38
38
|
/>
|
|
39
39
|
</slot>
|
|
40
40
|
</template>
|
|
@@ -124,7 +124,6 @@ const fillLocalValue = async (filter = props.filter) => {
|
|
|
124
124
|
const filterValue = filter.value;
|
|
125
125
|
|
|
126
126
|
const valueSearchMethod = FilterOptionToPreviewApiSearchMethodMap[filterName];
|
|
127
|
-
|
|
128
127
|
if (valueSearchMethod) {
|
|
129
128
|
const { items } = await valueSearchMethod({ id: filterValue });
|
|
130
129
|
localValue.value = items;
|
|
@@ -133,6 +132,10 @@ const fillLocalValue = async (filter = props.filter) => {
|
|
|
133
132
|
}
|
|
134
133
|
};
|
|
135
134
|
|
|
135
|
+
// [https://webitel.atlassian.net/browse/WTEL-6732]
|
|
136
|
+
// if type filter is boolean and value = false, need display preview
|
|
137
|
+
const isRenderPreview = computed(() => localValue.value === false || localValue.value);
|
|
138
|
+
|
|
136
139
|
const submit = (filter: IFilter, { hide }) => {
|
|
137
140
|
emit('update:filter', filter);
|
|
138
141
|
fillLocalValue(filter);
|
|
@@ -147,8 +150,8 @@ const deleteFilter = () => {
|
|
|
147
150
|
<style lang="scss" scoped>
|
|
148
151
|
.wt-chip {
|
|
149
152
|
display: flex;
|
|
150
|
-
justify-content: center;
|
|
151
153
|
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
152
155
|
gap: var(--spacing-2xs);
|
|
153
156
|
}
|
|
154
157
|
|