@webitel/ui-datalist 1.1.55 → 1.1.56
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 +1 -1
- package/src/modules/filters/modules/filterConfig/components/amd-result/amd-result-filter-value-field.vue +33 -4
- package/src/modules/filters/modules/filterConfig/enums/options/AMDResultOptions.ts +8 -0
- package/types/.tsbuildinfo +1 -1
- package/types/modules/filters/modules/filterConfig/components/amd-result/amd-result-filter-value-field.vue.d.ts +3 -3
package/package.json
CHANGED
|
@@ -2,25 +2,54 @@
|
|
|
2
2
|
<wt-multi-select
|
|
3
3
|
:label="t('webitelUI.filters.filterValue')"
|
|
4
4
|
:options="AmdResultOptions"
|
|
5
|
-
v-model:model-value="
|
|
5
|
+
v-model:model-value="selectValue"
|
|
6
6
|
:v="v$.model"
|
|
7
7
|
data-key="value"
|
|
8
8
|
option-value="value"
|
|
9
9
|
/>
|
|
10
|
+
<wt-checkbox
|
|
11
|
+
:label="t('webitelUI.filters.showEmptyAmdResult')"
|
|
12
|
+
:value="AMD_RESULT_EMPTY_VALUE"
|
|
13
|
+
v-model:selected="isEmptySelected"
|
|
14
|
+
/>
|
|
10
15
|
</template>
|
|
11
16
|
|
|
12
17
|
<script lang="ts" setup>
|
|
13
18
|
import { useVuelidate } from '@vuelidate/core';
|
|
14
19
|
import { required } from '@vuelidate/validators';
|
|
15
|
-
import { WtMultiSelect } from '@webitel/ui-sdk/components';
|
|
16
|
-
import { computed, watch } from 'vue';
|
|
20
|
+
import { WtCheckbox, WtMultiSelect } from '@webitel/ui-sdk/components';
|
|
21
|
+
import { computed, ref, watch } from 'vue';
|
|
17
22
|
import { useI18n } from 'vue-i18n';
|
|
18
23
|
|
|
19
24
|
import { AmdResultOptions } from '../../enums/options/AMDResultOptions';
|
|
20
25
|
|
|
21
|
-
const
|
|
26
|
+
const AMD_RESULT_EMPTY_VALUE = 'EMPTY';
|
|
27
|
+
|
|
28
|
+
const model = defineModel<string[]>();
|
|
22
29
|
const { t } = useI18n();
|
|
23
30
|
|
|
31
|
+
// keeps the select's own model limited to real AmdResultOptions values,
|
|
32
|
+
// so it never treats EMPTY as a missing/custom option to reconcile
|
|
33
|
+
const selectValue = ref(
|
|
34
|
+
(model.value || []).filter((value) => value !== AMD_RESULT_EMPTY_VALUE),
|
|
35
|
+
);
|
|
36
|
+
const isEmptySelected = ref(!!model.value?.includes(AMD_RESULT_EMPTY_VALUE));
|
|
37
|
+
|
|
38
|
+
watch(
|
|
39
|
+
[
|
|
40
|
+
selectValue,
|
|
41
|
+
isEmptySelected,
|
|
42
|
+
],
|
|
43
|
+
([select, isEmpty]) => {
|
|
44
|
+
model.value = isEmpty
|
|
45
|
+
? [
|
|
46
|
+
...select,
|
|
47
|
+
AMD_RESULT_EMPTY_VALUE,
|
|
48
|
+
]
|
|
49
|
+
: select;
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
24
53
|
const v$ = useVuelidate(
|
|
25
54
|
computed(() => ({
|
|
26
55
|
model: {
|