@webitel/ui-datalist 1.1.6 → 1.1.8
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/src/modules/headers/createTableHeadersStore.ts +10 -2
- package/types/modules/filter-presets/stores/createFilterPresetsStore.d.ts +7 -2
- 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/types/modules/headers/createTableHeadersStore.d.ts +7 -2
- package/types/modules/table/createTableStore.store.d.ts +7 -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.8",
|
|
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>
|
|
@@ -130,7 +130,12 @@ export const tableHeadersStoreBody = ({
|
|
|
130
130
|
]);
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
const updateSort = (
|
|
133
|
+
const updateSort = (
|
|
134
|
+
column,
|
|
135
|
+
options: {
|
|
136
|
+
order?: SortSymbols;
|
|
137
|
+
} = {},
|
|
138
|
+
) => {
|
|
134
139
|
const getNextSortOrder = (sort) => {
|
|
135
140
|
switch (sort) {
|
|
136
141
|
case SortSymbols.NONE:
|
|
@@ -162,7 +167,10 @@ export const tableHeadersStoreBody = ({
|
|
|
162
167
|
});
|
|
163
168
|
};
|
|
164
169
|
|
|
165
|
-
const order =
|
|
170
|
+
const order =
|
|
171
|
+
options.order !== undefined
|
|
172
|
+
? options.order
|
|
173
|
+
: getNextSortOrder(column.sort);
|
|
166
174
|
|
|
167
175
|
headers.value = changeHeadersSort({
|
|
168
176
|
headers: headers.value,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EnginePresetQuery } from 'webitel-sdk';
|
|
1
2
|
export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
2
3
|
presetId: import("vue").Ref<any, any>;
|
|
3
4
|
setupPresetPersistence: () => Promise<void>;
|
|
@@ -97,7 +98,9 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
|
97
98
|
updateSearchMode: (newSearch: string) => void;
|
|
98
99
|
updatePage: (newPage: number) => void;
|
|
99
100
|
updateSize: (newSize: number) => void;
|
|
100
|
-
updateSort: (column: any
|
|
101
|
+
updateSort: (column: any, options?: {
|
|
102
|
+
order?: EnginePresetQuery;
|
|
103
|
+
}) => void;
|
|
101
104
|
columnResize: ({ columnName, columnWidth }: {
|
|
102
105
|
columnName: any;
|
|
103
106
|
columnWidth: any;
|
|
@@ -208,7 +211,9 @@ export declare const createFilterPresetsStore: (namespace: string) => () => {
|
|
|
208
211
|
updateSearchMode: (newSearch: string) => void;
|
|
209
212
|
updatePage: (newPage: number) => void;
|
|
210
213
|
updateSize: (newSize: number) => void;
|
|
211
|
-
updateSort: (column: any
|
|
214
|
+
updateSort: (column: any, options?: {
|
|
215
|
+
order?: EnginePresetQuery;
|
|
216
|
+
}) => void;
|
|
212
217
|
columnResize: ({ columnName, columnWidth }: {
|
|
213
218
|
columnName: any;
|
|
214
219
|
columnWidth: any;
|
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WtTableHeader } from '@webitel/ui-sdk/components/wt-table/types/WtTable';
|
|
2
|
+
import { SortSymbols } from '@webitel/ui-sdk/scripts/sortQueryAdapters';
|
|
2
3
|
import { useTableStoreConfig } from '../types/tableStore.types';
|
|
3
4
|
interface TableHeadersStoreBodyParams {
|
|
4
5
|
rawHeaders: WtTableHeader[];
|
|
@@ -12,7 +13,9 @@ export declare const tableHeadersStoreBody: ({ rawHeaders, id, }: TableHeadersSt
|
|
|
12
13
|
columnWidths: import("vue").ComputedRef<any>;
|
|
13
14
|
isReorderingColumn: import("vue").Ref<boolean, boolean>;
|
|
14
15
|
updateShownHeaders: (value: any) => void;
|
|
15
|
-
updateSort: (column: any
|
|
16
|
+
updateSort: (column: any, options?: {
|
|
17
|
+
order?: SortSymbols;
|
|
18
|
+
}) => void;
|
|
16
19
|
columnResize: ({ columnName, columnWidth }: {
|
|
17
20
|
columnName: any;
|
|
18
21
|
columnWidth: any;
|
|
@@ -31,7 +34,9 @@ export declare const createTableHeadersStore: <Entity>(namespace: string, config
|
|
|
31
34
|
columnWidths: import("vue").ComputedRef<any>;
|
|
32
35
|
isReorderingColumn: import("vue").Ref<boolean, boolean>;
|
|
33
36
|
updateShownHeaders: (value: any) => void;
|
|
34
|
-
updateSort: (column: any
|
|
37
|
+
updateSort: (column: any, options?: {
|
|
38
|
+
order?: SortSymbols;
|
|
39
|
+
}) => void;
|
|
35
40
|
columnResize: ({ columnName, columnWidth }: {
|
|
36
41
|
columnName: any;
|
|
37
42
|
columnWidth: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import deepEqual from 'deep-equal';
|
|
1
2
|
import { type Ref } from 'vue';
|
|
2
3
|
import { PatchItemPropertyParams, useTableStoreConfig } from '../types/tableStore.types';
|
|
3
4
|
export declare const tableStoreBody: <Entity extends {
|
|
@@ -99,7 +100,9 @@ export declare const tableStoreBody: <Entity extends {
|
|
|
99
100
|
updateSearchMode: (newSearch: string) => void;
|
|
100
101
|
updatePage: (newPage: number) => void;
|
|
101
102
|
updateSize: (newSize: number) => void;
|
|
102
|
-
updateSort: (column: any
|
|
103
|
+
updateSort: (column: any, options?: {
|
|
104
|
+
order?: deepEqual;
|
|
105
|
+
}) => void;
|
|
103
106
|
columnResize: ({ columnName, columnWidth }: {
|
|
104
107
|
columnName: any;
|
|
105
108
|
columnWidth: any;
|
|
@@ -210,7 +213,9 @@ export declare const createTableStore: <Entity extends {
|
|
|
210
213
|
updateSearchMode: (newSearch: string) => void;
|
|
211
214
|
updatePage: (newPage: number) => void;
|
|
212
215
|
updateSize: (newSize: number) => void;
|
|
213
|
-
updateSort: (column: any
|
|
216
|
+
updateSort: (column: any, options?: {
|
|
217
|
+
order?: deepEqual;
|
|
218
|
+
}) => void;
|
|
214
219
|
columnResize: ({ columnName, columnWidth }: {
|
|
215
220
|
columnName: any;
|
|
216
221
|
columnWidth: any;
|