@webitel/ui-datalist 1.1.6 → 1.1.7
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/components/config/dynamic-view/dynamic-filter-config-view.vue +12 -1
- package/src/modules/filters/components/dynamic-filter-add-action.vue +37 -7
- package/types/modules/filters/components/config/dynamic-view/dynamic-filter-config-view.vue.d.ts +7 -5
- package/types/modules/filters/components/dynamic-filter-add-action.vue.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-datalist",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Toolkit for building data lists in webitel ui system",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"make-all": "npm version patch --git-tag-version false && ( npm run lint:fix || true) && (npm run build:types || true) && npm run utils:publish",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="dynamic-filter-config-view">
|
|
3
|
-
<wt-popover :disabled="props.disabled">
|
|
3
|
+
<wt-popover ref="popover" :disabled="props.disabled">
|
|
4
4
|
<template #activator="{ toggle }">
|
|
5
5
|
<slot
|
|
6
6
|
name="activator"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* and their styling
|
|
25
25
|
*/
|
|
26
26
|
import { WtPopover } from '@webitel/ui-sdk/components';
|
|
27
|
+
import { defineExpose, ref } from 'vue';
|
|
27
28
|
|
|
28
29
|
interface Props {
|
|
29
30
|
disabled?: boolean;
|
|
@@ -31,6 +32,16 @@ interface Props {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
const props = defineProps<Props>();
|
|
35
|
+
|
|
36
|
+
const popover = ref(null);
|
|
37
|
+
|
|
38
|
+
const hidePopover = () => {
|
|
39
|
+
popover.value?.hide();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
defineExpose({
|
|
43
|
+
hidePopover,
|
|
44
|
+
});
|
|
34
45
|
</script>
|
|
35
46
|
|
|
36
47
|
<style scoped></style>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<dynamic-filter-config-view
|
|
3
|
+
ref="dynamicFilterAddAction"
|
|
3
4
|
disable-click-away
|
|
4
5
|
class="dynamic-filter-add-action"
|
|
5
6
|
>
|
|
@@ -14,20 +15,24 @@
|
|
|
14
15
|
|
|
15
16
|
<template #content="{ hide }">
|
|
16
17
|
<slot name="form">
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
<div ref="popoverContentRef">
|
|
19
|
+
<dynamic-filter-config-form
|
|
20
|
+
:filter-configs="props.filterConfigs"
|
|
21
|
+
@cancel="hide"
|
|
22
|
+
@submit="
|
|
23
|
+
(payload) => submit(payload, { hide })
|
|
24
|
+
"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
24
27
|
</slot>
|
|
25
28
|
</template>
|
|
26
29
|
</dynamic-filter-config-view>
|
|
27
30
|
</template>
|
|
28
31
|
|
|
29
32
|
<script lang="ts" setup>
|
|
33
|
+
import { onClickOutside } from '@vueuse/core';
|
|
30
34
|
import { WtIconAction } from '@webitel/ui-sdk/components';
|
|
35
|
+
import { ref } from 'vue';
|
|
31
36
|
import { useI18n } from 'vue-i18n';
|
|
32
37
|
|
|
33
38
|
import { FilterInitParams } from '../classes/Filter';
|
|
@@ -54,6 +59,31 @@ const submit = (payload: FilterInitParams, { hide }) => {
|
|
|
54
59
|
emit('add:filter', payload);
|
|
55
60
|
hide();
|
|
56
61
|
};
|
|
62
|
+
|
|
63
|
+
const popoverContentRef = ref<HTMLElement | null>(null);
|
|
64
|
+
const dynamicFilterAddAction = ref<null>(null);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @author @Oleksandr Palonnyi
|
|
68
|
+
*
|
|
69
|
+
* [WTEL-8817](https://webitel.atlassian.net/browse/WTEL-8817)
|
|
70
|
+
*
|
|
71
|
+
* Close popover on outside click.
|
|
72
|
+
* Capture phase fixes PrimeVue bug where stopPropagation() (used by navbar menus)
|
|
73
|
+
* blocks default outside-click detection. Capture fires before the block.
|
|
74
|
+
* Ignore: .wt-chip (activator), .p-popover (popover content)
|
|
75
|
+
* */
|
|
76
|
+
onClickOutside(
|
|
77
|
+
popoverContentRef,
|
|
78
|
+
() => dynamicFilterAddAction.value?.hidePopover(),
|
|
79
|
+
{
|
|
80
|
+
capture: true, // Fix for PrimeVue stopPropagation bug
|
|
81
|
+
ignore: [
|
|
82
|
+
'.wt-chip',
|
|
83
|
+
'.p-popover',
|
|
84
|
+
], // Exclude activator and popover
|
|
85
|
+
},
|
|
86
|
+
);
|
|
57
87
|
</script>
|
|
58
88
|
|
|
59
89
|
<style lang="scss" scoped>
|
package/types/modules/filters/components/config/dynamic-view/dynamic-filter-config-view.vue.d.ts
CHANGED
|
@@ -2,18 +2,20 @@ interface Props {
|
|
|
2
2
|
disabled?: boolean;
|
|
3
3
|
disableClickAway?: boolean;
|
|
4
4
|
}
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_10: {
|
|
6
6
|
toggle: any;
|
|
7
7
|
disabled: boolean;
|
|
8
|
-
},
|
|
8
|
+
}, __VLS_13: {
|
|
9
9
|
hide: any;
|
|
10
10
|
};
|
|
11
11
|
type __VLS_Slots = {} & {
|
|
12
|
-
activator?: (props: typeof
|
|
12
|
+
activator?: (props: typeof __VLS_10) => any;
|
|
13
13
|
} & {
|
|
14
|
-
content?: (props: typeof
|
|
14
|
+
content?: (props: typeof __VLS_13) => any;
|
|
15
15
|
};
|
|
16
|
-
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
17
|
+
hidePopover: () => void;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
17
19
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
20
|
declare const _default: typeof __VLS_export;
|
|
19
21
|
export default _default;
|
|
@@ -4,9 +4,9 @@ interface Props {
|
|
|
4
4
|
filterConfigs: BaseFilterConfig[];
|
|
5
5
|
showLabel?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare var
|
|
7
|
+
declare var __VLS_16: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
|
-
form?: (props: typeof
|
|
9
|
+
form?: (props: typeof __VLS_16) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
"add:filter": (args_0: FilterInitParams) => any;
|