@webitel/ui-datalist 1.0.16 → 1.0.18
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/filter-presets/components/_shared/preset-filters-preview.vue +2 -2
- package/src/modules/filter-presets/components/apply-preset/apply-preset-action.vue +2 -2
- package/src/modules/filter-presets/components/apply-preset/preset-preview.vue +16 -11
- package/src/modules/filter-presets/components/save-preset/save-preset-action.vue +2 -2
- package/src/modules/filter-presets/components/save-preset/save-preset-popup.vue +2 -2
- package/src/modules/filters/components/config/dynamic-filter-config-form-value-input.vue +2 -2
- package/src/modules/filters/components/preview/dynamic-filter-preview.vue +2 -2
- package/src/modules/filters/components/table-filters-panel.vue +8 -7
- package/src/modules/filters/modules/filterConfig/classes/FilterConfig.ts +6 -2
- package/src/modules/filters/modules/filterConfig/classes/createFilterConfig.ts +9 -9
- package/src/modules/filters/modules/filterConfig/index.ts +2 -0
- package/src/modules/filters/modules/filterConfig/types/FilterConfigDefinition.ts +4 -0
- package/types/modules/filter-presets/components/_shared/preset-filters-preview.vue.d.ts +2 -2
- package/types/modules/filter-presets/components/apply-preset/apply-preset-action.vue.d.ts +2 -2
- package/types/modules/filter-presets/components/apply-preset/preset-preview.vue.d.ts +2 -2
- package/types/modules/filter-presets/components/save-preset/save-preset-action.vue.d.ts +2 -2
- package/types/modules/filter-presets/components/save-preset/save-preset-popup.vue.d.ts +2 -2
- package/types/modules/filters/components/config/dynamic-filter-config-form-value-input.vue.d.ts +2 -2
- package/types/modules/filters/components/preview/dynamic-filter-preview.vue.d.ts +2 -2
- package/types/modules/filters/components/table-filters-panel.vue.d.ts +2 -2
- package/types/modules/filters/modules/filterConfig/classes/FilterConfig.d.ts +5 -3
- package/types/modules/filters/modules/filterConfig/classes/createFilterConfig.d.ts +2 -2
- package/types/modules/filters/modules/filterConfig/components/index.d.ts +1 -1
- package/types/modules/filters/modules/filterConfig/index.d.ts +2 -0
- package/types/modules/filters/modules/filterConfig/types/FilterConfigDefinition.d.ts +3 -0
package/package.json
CHANGED
|
@@ -25,11 +25,11 @@ import type {IFiltersManager} from '../../../filters';
|
|
|
25
25
|
import DynamicFilterPanelWrapper from '../../../filters/components/dynamic-filter-panel-wrapper.vue';
|
|
26
26
|
import DynamicFilterPreview from '../../../filters/components/preview/dynamic-filter-preview.vue';
|
|
27
27
|
import { useFilterConfigsToolkit } from "../../../filters/composables/useFilterConfigsToolkit";
|
|
28
|
-
import {
|
|
28
|
+
import {AnyFilterConfig} from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
29
29
|
|
|
30
30
|
const props = defineProps<{
|
|
31
31
|
filtersManager: IFiltersManager;
|
|
32
|
-
filterConfigs:
|
|
32
|
+
filterConfigs: AnyFilterConfig[];
|
|
33
33
|
}>();
|
|
34
34
|
|
|
35
35
|
const { t } = useI18n();
|
|
@@ -83,7 +83,7 @@ import { computed, inject, ref, watch } from 'vue';
|
|
|
83
83
|
import { useI18n } from 'vue-i18n';
|
|
84
84
|
import { EnginePresetQuery } from 'webitel-sdk';
|
|
85
85
|
|
|
86
|
-
import {
|
|
86
|
+
import {AnyFilterConfig} from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
87
87
|
import PresetQueryAPI from '../../api/PresetQuery.ts';
|
|
88
88
|
import PresetPreview from './preset-preview.vue';
|
|
89
89
|
|
|
@@ -93,7 +93,7 @@ const props = defineProps<{
|
|
|
93
93
|
*/
|
|
94
94
|
namespace: string;
|
|
95
95
|
usePresetsStore: Store;
|
|
96
|
-
filterConfigs:
|
|
96
|
+
filterConfigs: AnyFilterConfig[];
|
|
97
97
|
}>();
|
|
98
98
|
|
|
99
99
|
const emit = defineEmits<{
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
<wt-icon-action
|
|
43
43
|
v-if="editMode"
|
|
44
|
-
:disabled="v$.$invalid"
|
|
44
|
+
:disabled="v$.$invalid || !editing"
|
|
45
45
|
action="save"
|
|
46
46
|
@click.stop="submitEdit"
|
|
47
47
|
/>
|
|
@@ -58,17 +58,18 @@
|
|
|
58
58
|
v-if="editMode"
|
|
59
59
|
v-model:model-value="editDraft.name"
|
|
60
60
|
:v="v$.name"
|
|
61
|
-
@update:model-value="
|
|
61
|
+
@update:model-value="updatePresetName"
|
|
62
62
|
/>
|
|
63
63
|
|
|
64
64
|
<preset-filters-preview
|
|
65
|
-
:filters-manager="filtersManager"
|
|
66
65
|
:filter-configs="props.filterConfigs"
|
|
66
|
+
:filters-manager="filtersManager"
|
|
67
67
|
/>
|
|
68
68
|
|
|
69
69
|
<preset-description-field
|
|
70
70
|
v-model:model-value="editDraft.description"
|
|
71
71
|
:preview-mode="!editMode"
|
|
72
|
+
@update:model-value="editing = true"
|
|
72
73
|
/>
|
|
73
74
|
</div>
|
|
74
75
|
</template>
|
|
@@ -89,7 +90,7 @@ import { computed, ref } from 'vue';
|
|
|
89
90
|
import { EnginePresetQuery } from 'webitel-sdk';
|
|
90
91
|
|
|
91
92
|
import { createFiltersManager } from '../../../filters';
|
|
92
|
-
import {
|
|
93
|
+
import {AnyFilterConfig} from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
93
94
|
import PresetDescriptionField from '../_shared/input-fields/preset-description-field.vue';
|
|
94
95
|
import PresetNameField from '../_shared/input-fields/preset-name-field.vue';
|
|
95
96
|
import PresetFiltersPreview from '../_shared/preset-filters-preview.vue';
|
|
@@ -98,7 +99,7 @@ type Props = {
|
|
|
98
99
|
preset: EnginePresetQuery;
|
|
99
100
|
isSelected: boolean;
|
|
100
101
|
collapsed: boolean;
|
|
101
|
-
filterConfigs:
|
|
102
|
+
filterConfigs: AnyFilterConfig[];
|
|
102
103
|
};
|
|
103
104
|
|
|
104
105
|
const props = defineProps<Props>();
|
|
@@ -129,7 +130,7 @@ const filtersManager = computed(() => {
|
|
|
129
130
|
const editMode = ref(false);
|
|
130
131
|
|
|
131
132
|
/**
|
|
132
|
-
*
|
|
133
|
+
* analogue _durty param in itemInstance
|
|
133
134
|
* */
|
|
134
135
|
const editing = ref(false);
|
|
135
136
|
|
|
@@ -169,7 +170,6 @@ const startEdit = ({ open: openExpansion }) => {
|
|
|
169
170
|
};
|
|
170
171
|
|
|
171
172
|
const clearEdit = () => {
|
|
172
|
-
editing.value = false;
|
|
173
173
|
editMode.value = false;
|
|
174
174
|
};
|
|
175
175
|
|
|
@@ -191,26 +191,31 @@ const submitEdit = () => {
|
|
|
191
191
|
onFailure,
|
|
192
192
|
});
|
|
193
193
|
};
|
|
194
|
+
|
|
195
|
+
const updatePresetName = () => {
|
|
196
|
+
nameAlreadyExistsError.value = false;
|
|
197
|
+
editing.value = true;
|
|
198
|
+
};
|
|
194
199
|
</script>
|
|
195
200
|
|
|
196
201
|
<style lang="scss" scoped>
|
|
197
202
|
.preset-preview-title-wrapper {
|
|
198
203
|
display: flex;
|
|
199
|
-
gap: var(--spacing-xs);
|
|
200
204
|
min-width: 0;
|
|
205
|
+
gap: var(--spacing-xs);
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
.preset-preview-name {
|
|
204
|
-
flex: 1 1 0;
|
|
205
209
|
overflow: hidden;
|
|
206
|
-
|
|
210
|
+
flex: 1 1 0;
|
|
207
211
|
white-space: nowrap;
|
|
212
|
+
text-overflow: ellipsis;
|
|
208
213
|
}
|
|
209
214
|
|
|
210
215
|
.preset-preview-content {
|
|
211
216
|
display: flex;
|
|
212
217
|
flex-direction: column;
|
|
213
|
-
gap: var(--spacing-xs);
|
|
214
218
|
padding: var(--spacing-xs);
|
|
219
|
+
gap: var(--spacing-xs);
|
|
215
220
|
}
|
|
216
221
|
</style>
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
createFiltersManager, FilterName,
|
|
42
42
|
IFiltersManager,
|
|
43
43
|
} from '../../../filters';
|
|
44
|
-
import {
|
|
44
|
+
import {AnyFilterConfig} from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
45
45
|
import {
|
|
46
46
|
addPreset,
|
|
47
47
|
getPresetList,
|
|
@@ -66,7 +66,7 @@ const props = defineProps<{
|
|
|
66
66
|
* include in preset only filter values related to filters panel
|
|
67
67
|
*/
|
|
68
68
|
filtersIncluded: FilterName[];
|
|
69
|
-
filterConfigs:
|
|
69
|
+
filterConfigs: AnyFilterConfig[];
|
|
70
70
|
}>();
|
|
71
71
|
|
|
72
72
|
const eventBus = inject('$eventBus');
|
|
@@ -57,7 +57,7 @@ import { useI18n } from 'vue-i18n';
|
|
|
57
57
|
import { EnginePresetQuery } from 'webitel-sdk';
|
|
58
58
|
|
|
59
59
|
import type { IFiltersManager } from '../../../filters';
|
|
60
|
-
import {
|
|
60
|
+
import {AnyFilterConfig} from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
61
61
|
import PresetDescriptionField from '../_shared/input-fields/preset-description-field.vue';
|
|
62
62
|
import PresetNameField from '../_shared/input-fields/preset-name-field.vue';
|
|
63
63
|
import PresetFiltersPreview from '../_shared/preset-filters-preview.vue';
|
|
@@ -74,7 +74,7 @@ const props = defineProps<{
|
|
|
74
74
|
* is needed here for `.toString()`
|
|
75
75
|
*/
|
|
76
76
|
filtersManager: IFiltersManager;
|
|
77
|
-
filterConfigs:
|
|
77
|
+
filterConfigs: AnyFilterConfig[];
|
|
78
78
|
}>();
|
|
79
79
|
|
|
80
80
|
const emit = defineEmits<{
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
|
-
import {
|
|
12
|
+
import {AnyFilterConfig} from "../../modules/filterConfig/classes/FilterConfig";
|
|
13
13
|
|
|
14
14
|
const filterValue = defineModel<unknown>();
|
|
15
15
|
|
|
16
16
|
const props = defineProps<{
|
|
17
|
-
filterConfig:
|
|
17
|
+
filterConfig: AnyFilterConfig;
|
|
18
18
|
label?: string;
|
|
19
19
|
}>();
|
|
20
20
|
|
|
@@ -73,7 +73,7 @@ import { computed,ref } from 'vue';
|
|
|
73
73
|
import { useI18n } from 'vue-i18n';
|
|
74
74
|
|
|
75
75
|
import {FilterData, IFilter} from "../../classes/Filter";
|
|
76
|
-
import {
|
|
76
|
+
import {AnyFilterConfig} from "../../modules/filterConfig/classes/FilterConfig";
|
|
77
77
|
import {
|
|
78
78
|
FilterOptionToPreviewApiSearchMethodMap,
|
|
79
79
|
} from '../../modules/filterConfig/components';
|
|
@@ -87,7 +87,7 @@ interface Props {
|
|
|
87
87
|
* @description
|
|
88
88
|
* this filter config
|
|
89
89
|
*/
|
|
90
|
-
filterConfig:
|
|
90
|
+
filterConfig: AnyFilterConfig;
|
|
91
91
|
readonly?: boolean;
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -12,29 +12,30 @@
|
|
|
12
12
|
/>
|
|
13
13
|
|
|
14
14
|
<dynamic-filter-add-action
|
|
15
|
-
:show-label="!appliedFilters.length"
|
|
16
15
|
:filter-configs="unAppliedFiltersConfigs"
|
|
16
|
+
:show-label="!appliedFilters.length"
|
|
17
17
|
@add:filter="emit('filter:add', $event)"
|
|
18
18
|
/>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<template #actions>
|
|
22
22
|
<apply-preset-action
|
|
23
|
+
:filter-configs="filterConfigs"
|
|
23
24
|
:namespace="props.presetNamespace"
|
|
24
25
|
:use-presets-store="props.usePresetsStore"
|
|
25
|
-
:filter-configs="filterConfigs"
|
|
26
26
|
@apply="emit('preset:apply', $event)"
|
|
27
27
|
/>
|
|
28
28
|
|
|
29
29
|
<save-preset-action
|
|
30
30
|
v-if="enablePresets"
|
|
31
|
-
:namespace="props.presetNamespace"
|
|
32
|
-
:filters-manager="props.filtersManager"
|
|
33
|
-
:filters-included="filtersIncluded"
|
|
34
31
|
:filter-configs="filterConfigs"
|
|
32
|
+
:filters-included="filtersIncluded"
|
|
33
|
+
:filters-manager="props.filtersManager"
|
|
34
|
+
:namespace="props.presetNamespace"
|
|
35
35
|
/>
|
|
36
36
|
|
|
37
37
|
<wt-icon-action
|
|
38
|
+
:disabled="!props.filtersManager.filters.size"
|
|
38
39
|
action="clear"
|
|
39
40
|
@click="emit('filter:reset-all')"
|
|
40
41
|
/>
|
|
@@ -57,7 +58,7 @@ import { ApplyPresetAction, SavePresetAction } from '../../filter-presets';
|
|
|
57
58
|
import {FilterData, IFilter} from "../classes/Filter";
|
|
58
59
|
import {IFiltersManager} from "../classes/FiltersManager";
|
|
59
60
|
import {useFilterConfigsToolkit} from "../composables/useFilterConfigsToolkit";
|
|
60
|
-
import {
|
|
61
|
+
import {AnyFilterConfig} from "../modules/filterConfig/classes/FilterConfig";
|
|
61
62
|
import { FilterOption } from '../modules/filterConfig/enums/FilterOption';
|
|
62
63
|
import DynamicFilterAddAction from './dynamic-filter-add-action.vue';
|
|
63
64
|
import DynamicFilterPanelWrapper from './dynamic-filter-panel-wrapper.vue';
|
|
@@ -68,7 +69,7 @@ type Props = {
|
|
|
68
69
|
* @description
|
|
69
70
|
* available filter options to set
|
|
70
71
|
*/
|
|
71
|
-
filterOptions: (FilterOption |
|
|
72
|
+
filterOptions: (FilterOption | AnyFilterConfig)[];
|
|
72
73
|
/**
|
|
73
74
|
* @description
|
|
74
75
|
* create local filters manager from snapshot
|
|
@@ -8,12 +8,14 @@ export interface BaseFilterConfig {
|
|
|
8
8
|
valueInputComponent: Component;
|
|
9
9
|
valuePreviewComponent: Component;
|
|
10
10
|
label?: ReturnType<MessageResolver> | string;
|
|
11
|
+
notDeletable?: boolean;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export type FilterConfigBaseParams = {
|
|
14
15
|
name?: FilterName;
|
|
15
16
|
valueInputComponent?: Component;
|
|
16
17
|
valuePreviewComponent?: Component;
|
|
18
|
+
notDeletable?: boolean;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
export interface IWtSysTypeFilterConfig extends BaseFilterConfig {
|
|
@@ -39,24 +41,26 @@ export type FilterConfigSearchMethodParams = [
|
|
|
39
41
|
},
|
|
40
42
|
];
|
|
41
43
|
|
|
42
|
-
export type
|
|
44
|
+
export type AnyFilterConfig = IWtSysTypeFilterConfig | BaseFilterConfig;
|
|
43
45
|
|
|
44
46
|
export class FilterConfig implements BaseFilterConfig {
|
|
45
47
|
name: FilterName;
|
|
46
48
|
valueInputComponent: Component;
|
|
47
49
|
valuePreviewComponent: Component;
|
|
48
50
|
label?: ReturnType<MessageResolver> | string;
|
|
49
|
-
notDeletable
|
|
51
|
+
notDeletable: boolean;
|
|
50
52
|
|
|
51
53
|
constructor({
|
|
52
54
|
name,
|
|
53
55
|
valueInputComponent,
|
|
54
56
|
valuePreviewComponent,
|
|
57
|
+
notDeletable,
|
|
55
58
|
}: FilterConfigBaseParams = {}) {
|
|
56
59
|
if (name) this.name = name;
|
|
57
60
|
if (valueInputComponent) this.valueInputComponent = valueInputComponent;
|
|
58
61
|
if (valuePreviewComponent)
|
|
59
62
|
this.valuePreviewComponent = valuePreviewComponent;
|
|
63
|
+
this.notDeletable = !!notDeletable;
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
|
|
@@ -9,22 +9,22 @@ import {
|
|
|
9
9
|
FilterConfigBaseParams,
|
|
10
10
|
} from './FilterConfig';
|
|
11
11
|
|
|
12
|
-
export const createFilterConfig = (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export const createFilterConfig = (
|
|
13
|
+
params: BaseFilterConfigParams &
|
|
14
|
+
Required<BaseFilterConfig, 'name'> &
|
|
15
|
+
Record<string, unknown>,
|
|
16
|
+
): BaseFilterConfig => {
|
|
17
|
+
const { name } = params;
|
|
18
|
+
|
|
16
19
|
const filterConfigClass = FilterOptionToFilterConfigCreatorMap[name];
|
|
17
20
|
|
|
18
21
|
if (filterConfigClass) {
|
|
19
|
-
return filterConfigClass();
|
|
22
|
+
return filterConfigClass(params);
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
/**
|
|
23
|
-
* @author @dlohvinov
|
|
24
|
-
* */
|
|
25
25
|
return new FilterConfig({
|
|
26
|
-
name,
|
|
27
26
|
valueInputComponent: FilterOptionToValueComponentMap[name],
|
|
28
27
|
valuePreviewComponent: FilterOptionToPreviewComponentMap[name],
|
|
28
|
+
...params,
|
|
29
29
|
});
|
|
30
30
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IFiltersManager } from '../../../filters';
|
|
2
|
-
import {
|
|
2
|
+
import { AnyFilterConfig } from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
filtersManager: IFiltersManager;
|
|
5
|
-
filterConfigs:
|
|
5
|
+
filterConfigs: AnyFilterConfig[];
|
|
6
6
|
};
|
|
7
7
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
8
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type Store } from 'pinia';
|
|
2
|
-
import {
|
|
2
|
+
import { AnyFilterConfig } from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
/**
|
|
5
5
|
* presets "section" namespace
|
|
6
6
|
*/
|
|
7
7
|
namespace: string;
|
|
8
8
|
usePresetsStore: Store;
|
|
9
|
-
filterConfigs:
|
|
9
|
+
filterConfigs: AnyFilterConfig[];
|
|
10
10
|
};
|
|
11
11
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
apply: (args_0: string) => any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AxiosError } from 'axios';
|
|
2
2
|
import { EnginePresetQuery } from 'webitel-sdk';
|
|
3
|
-
import {
|
|
3
|
+
import { AnyFilterConfig } from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
4
4
|
type Props = {
|
|
5
5
|
preset: EnginePresetQuery;
|
|
6
6
|
isSelected: boolean;
|
|
7
7
|
collapsed: boolean;
|
|
8
|
-
filterConfigs:
|
|
8
|
+
filterConfigs: AnyFilterConfig[];
|
|
9
9
|
};
|
|
10
10
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
11
|
"preset:select": (args_0: EnginePresetQuery) => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterName, IFiltersManager } from '../../../filters';
|
|
2
|
-
import {
|
|
2
|
+
import { AnyFilterConfig } from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
@@ -16,7 +16,7 @@ type __VLS_Props = {
|
|
|
16
16
|
* include in preset only filter values related to filters panel
|
|
17
17
|
*/
|
|
18
18
|
filtersIncluded: FilterName[];
|
|
19
|
-
filterConfigs:
|
|
19
|
+
filterConfigs: AnyFilterConfig[];
|
|
20
20
|
};
|
|
21
21
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EnginePresetQuery } from 'webitel-sdk';
|
|
2
2
|
import type { IFiltersManager } from '../../../filters';
|
|
3
|
-
import {
|
|
3
|
+
import { AnyFilterConfig } from "../../../filters/modules/filterConfig/classes/FilterConfig";
|
|
4
4
|
export type SubmitConfig = {
|
|
5
5
|
onSuccess?: () => void;
|
|
6
6
|
onFailure?: (err: Error) => void;
|
|
@@ -12,7 +12,7 @@ type __VLS_Props = {
|
|
|
12
12
|
* is needed here for `.toString()`
|
|
13
13
|
*/
|
|
14
14
|
filtersManager: IFiltersManager;
|
|
15
|
-
filterConfigs:
|
|
15
|
+
filterConfigs: AnyFilterConfig[];
|
|
16
16
|
};
|
|
17
17
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
18
|
submit: (args_0: EnginePresetQuery, args_1?: SubmitConfig) => any;
|
package/types/modules/filters/components/config/dynamic-filter-config-form-value-input.vue.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyFilterConfig } from "../../modules/filterConfig/classes/FilterConfig";
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
filterConfig:
|
|
3
|
+
filterConfig: AnyFilterConfig;
|
|
4
4
|
label?: string;
|
|
5
5
|
};
|
|
6
6
|
type __VLS_PublicProps = __VLS_Props & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WtChip, WtIconBtn, WtLoader, WtTooltip } from '@webitel/ui-sdk/components';
|
|
2
2
|
import { FilterData, IFilter } from "../../classes/Filter";
|
|
3
|
-
import {
|
|
3
|
+
import { AnyFilterConfig } from "../../modules/filterConfig/classes/FilterConfig";
|
|
4
4
|
import DynamicFilterConfigForm from '../config/dynamic-filter-config-form.vue';
|
|
5
5
|
import DynamicFilterConfigView from '../config/dynamic-filter-config-view.vue';
|
|
6
6
|
import DynamicFilterPreviewInfo from './dynamic-filter-preview-info.vue';
|
|
@@ -10,7 +10,7 @@ interface Props {
|
|
|
10
10
|
* @description
|
|
11
11
|
* this filter config
|
|
12
12
|
*/
|
|
13
|
-
filterConfig:
|
|
13
|
+
filterConfig: AnyFilterConfig;
|
|
14
14
|
readonly?: boolean;
|
|
15
15
|
}
|
|
16
16
|
declare const localValue: import("vue").Ref<any, any>;
|
|
@@ -2,14 +2,14 @@ import { Store } from 'pinia';
|
|
|
2
2
|
import { WebitelProtoDataField } from "webitel-sdk";
|
|
3
3
|
import { FilterData, IFilter } from "../classes/Filter";
|
|
4
4
|
import { IFiltersManager } from "../classes/FiltersManager";
|
|
5
|
-
import {
|
|
5
|
+
import { AnyFilterConfig } from "../modules/filterConfig/classes/FilterConfig";
|
|
6
6
|
import { FilterOption } from '../modules/filterConfig/enums/FilterOption';
|
|
7
7
|
type Props = {
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
10
|
* available filter options to set
|
|
11
11
|
*/
|
|
12
|
-
filterOptions: (FilterOption |
|
|
12
|
+
filterOptions: (FilterOption | AnyFilterConfig)[];
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
15
|
* create local filters manager from snapshot
|
|
@@ -6,11 +6,13 @@ export interface BaseFilterConfig {
|
|
|
6
6
|
valueInputComponent: Component;
|
|
7
7
|
valuePreviewComponent: Component;
|
|
8
8
|
label?: ReturnType<MessageResolver> | string;
|
|
9
|
+
notDeletable?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export type FilterConfigBaseParams = {
|
|
11
12
|
name?: FilterName;
|
|
12
13
|
valueInputComponent?: Component;
|
|
13
14
|
valuePreviewComponent?: Component;
|
|
15
|
+
notDeletable?: boolean;
|
|
14
16
|
};
|
|
15
17
|
export interface IWtSysTypeFilterConfig extends BaseFilterConfig {
|
|
16
18
|
searchRecords: (params: FilterConfigSearchMethodParams) => Promise<{
|
|
@@ -34,14 +36,14 @@ export type FilterConfigSearchMethodParams = [
|
|
|
34
36
|
filterConfig: BaseFilterConfig;
|
|
35
37
|
}
|
|
36
38
|
];
|
|
37
|
-
export type
|
|
39
|
+
export type AnyFilterConfig = IWtSysTypeFilterConfig | BaseFilterConfig;
|
|
38
40
|
export declare class FilterConfig implements BaseFilterConfig {
|
|
39
41
|
name: FilterName;
|
|
40
42
|
valueInputComponent: Component;
|
|
41
43
|
valuePreviewComponent: Component;
|
|
42
44
|
label?: ReturnType<MessageResolver> | string;
|
|
43
|
-
notDeletable
|
|
44
|
-
constructor({ name, valueInputComponent, valuePreviewComponent, }?: FilterConfigBaseParams);
|
|
45
|
+
notDeletable: boolean;
|
|
46
|
+
constructor({ name, valueInputComponent, valuePreviewComponent, notDeletable, }?: FilterConfigBaseParams);
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* @author @dlohvinov
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BaseFilterConfig
|
|
2
|
-
export declare const createFilterConfig: (
|
|
1
|
+
import { BaseFilterConfig } from './FilterConfig';
|
|
2
|
+
export declare const createFilterConfig: (params: BaseFilterConfigParams & Required<BaseFilterConfig, "name"> & Record<string, unknown>) => BaseFilterConfig;
|