@webitel/ui-datalist 1.0.17 → 1.0.19

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-datalist",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Toolkit for building data lists in webitel ui system",
5
5
  "scripts": {
6
6
  "build:types": "vue-tsc -p ./tsconfig.build.json",
@@ -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="nameAlreadyExistsError = false"
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>
@@ -129,7 +130,7 @@ const filtersManager = computed(() => {
129
130
  const editMode = ref(false);
130
131
 
131
132
  /**
132
- * updating request in progress flag
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
- text-overflow: ellipsis;
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>
@@ -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
  />
@@ -0,0 +1,77 @@
1
+ import { sysTypes } from '@webitel/ui-sdk/api/clients/index';
2
+ import { WtTypeExtensionFieldKind } from '@webitel/ui-sdk/enums';
3
+ import { WebitelProtoDataField } from 'webitel-sdk';
4
+
5
+ import { FilterConfig } from '../../classes/FilterConfig';
6
+ import { CustomFilterOption } from '../../enums/FilterOption';
7
+ import {
8
+ BaseFilterConfig,
9
+ FilterConfigBaseParams,
10
+ IWtSysTypeFilterConfig,
11
+ } from '../../types/FilterConfig';
12
+ import TypeExtensionFilterValueField from './type-extension-filter-value-field.vue';
13
+ import TypeExtensionFilterValuePreview from './type-extension-filter-value-preview.vue';
14
+
15
+ export interface ITypeExtensionFilterConfig extends BaseFilterConfig {
16
+ readonly field: WebitelProtoDataField;
17
+ }
18
+
19
+ class TypeExtensionFilterConfig
20
+ extends FilterConfig
21
+ implements ITypeExtensionFilterConfig
22
+ {
23
+ readonly field: WebitelProtoDataField;
24
+
25
+ constructor(
26
+ { name }: FilterConfigBaseParams,
27
+ { field }: { field: WebitelProtoDataField },
28
+ ) {
29
+ super({
30
+ name,
31
+ valueInputComponent: TypeExtensionFilterValueField,
32
+ valuePreviewComponent: TypeExtensionFilterValuePreview,
33
+ });
34
+
35
+ this.label = field.name;
36
+ this.field = field;
37
+ }
38
+ }
39
+
40
+ class TypeExtensionWtSysTypeFieldFilterConfig
41
+ extends TypeExtensionFilterConfig
42
+ implements IWtSysTypeFilterConfig
43
+ {
44
+ searchRecords(
45
+ { id: filterValue, ...rest },
46
+ // {
47
+ // filterValue,
48
+ // }: {
49
+ // filterValue: unknown;
50
+ // },
51
+ ): Promise<{ items: unknown[]; next?: boolean }> {
52
+ return sysTypes.getLookup({
53
+ ...rest,
54
+ ...this.field.lookup,
55
+ id: filterValue,
56
+ });
57
+ }
58
+ }
59
+
60
+ export type {
61
+ TypeExtensionFilterConfig,
62
+ TypeExtensionWtSysTypeFieldFilterConfig,
63
+ };
64
+
65
+ export const createTypeExtensionFilterConfig = (
66
+ name: CustomFilterOption,
67
+ { field }: { field: WebitelProtoDataField },
68
+ ) => {
69
+ switch (field.kind) {
70
+ case WtTypeExtensionFieldKind.Select:
71
+ return new TypeExtensionWtSysTypeFieldFilterConfig(name, { field });
72
+ case WtTypeExtensionFieldKind.Multiselect:
73
+ return new TypeExtensionWtSysTypeFieldFilterConfig(name, { field });
74
+ default:
75
+ return new TypeExtensionFilterConfig(name, { field });
76
+ }
77
+ };
@@ -1,72 +1,11 @@
1
- import { sysTypes } from '@webitel/ui-sdk/api/clients/index';
2
- import { WtTypeExtensionFieldKind } from '@webitel/ui-sdk/enums';
3
- import { WebitelProtoDataField } from 'webitel-sdk';
4
-
5
- import { FilterConfig } from '../../classes/FilterConfig';
6
- import { CustomFilterOption } from '../../enums/FilterOption';
7
- import {
8
- BaseFilterConfig,
9
- FilterConfigBaseParams,
10
- IWtSysTypeFilterConfig,
11
- } from '../../types/FilterConfig';
1
+ import { createTypeExtensionFilterConfig } from './filterConfig';
12
2
  import TypeExtensionFilterValueField from './type-extension-filter-value-field.vue';
13
3
  import TypeExtensionFilterValuePreview from './type-extension-filter-value-preview.vue';
14
4
 
15
- export interface ITypeExtensionFilterConfig extends BaseFilterConfig {
16
- readonly field: WebitelProtoDataField;
17
- }
18
-
19
- class TypeExtensionFilterConfig
20
- extends FilterConfig
21
- implements ITypeExtensionFilterConfig
22
- {
23
- readonly field: WebitelProtoDataField;
24
-
25
- constructor(
26
- { name }: FilterConfigBaseParams,
27
- { field }: { field: WebitelProtoDataField },
28
- ) {
29
- super({
30
- name,
31
- valueInputComponent: TypeExtensionFilterValueField,
32
- valuePreviewComponent: TypeExtensionFilterValuePreview,
33
- });
34
-
35
- this.label = field.name;
36
- this.field = field;
37
- }
38
- }
39
-
40
- class TypeExtensionWtSysTypeFieldFilterConfig
41
- extends TypeExtensionFilterConfig
42
- implements IWtSysTypeFilterConfig
43
- {
44
- searchRecords(
45
- { id: filterValue, ...rest },
46
- // {
47
- // filterValue,
48
- // }: {
49
- // filterValue: unknown;
50
- // },
51
- ): Promise<{ items: unknown[]; next?: boolean }> {
52
- return sysTypes.getLookup({
53
- ...rest,
54
- ...this.field.lookup,
55
- id: filterValue,
56
- });
57
- }
58
- }
59
-
60
- export const createTypeExtensionFilterConfig = (
61
- name: CustomFilterOption,
62
- { field }: { field: WebitelProtoDataField },
63
- ) => {
64
- switch (field.kind) {
65
- case WtTypeExtensionFieldKind.Select:
66
- return new TypeExtensionWtSysTypeFieldFilterConfig(name, { field });
67
- case WtTypeExtensionFieldKind.Multiselect:
68
- return new TypeExtensionWtSysTypeFieldFilterConfig(name, { field });
69
- default:
70
- return new TypeExtensionFilterConfig(name, { field });
71
- }
5
+ export {
6
+ createTypeExtensionFilterConfig,
7
+ TypeExtensionFilterValueField,
8
+ TypeExtensionFilterValuePreview,
72
9
  };
10
+
11
+ export type * from './filterConfig';
@@ -0,0 +1,32 @@
1
+ import { contacts as ContactsAPI } from '@webitel/ui-sdk/api/clients/index';
2
+
3
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
4
+ import { FilterOption } from '../../enums/FilterOption';
5
+ import CaseAssigneeFilterValueField from './case-assignee-filter-value-field.vue';
6
+ import CaseAssigneeFilterValuePreview from './case-assignee-filter-value-preview.vue';
7
+
8
+ class CaseAssigneeFilterConfig extends WtSysTypeFilterConfig {
9
+ readonly name = FilterOption.CaseAssignee;
10
+ valueInputComponent = CaseAssigneeFilterValueField;
11
+ valuePreviewComponent = CaseAssigneeFilterValuePreview;
12
+
13
+ searchRecords(
14
+ params: object,
15
+ { filterValue } = {},
16
+ ): Promise<{ items: unknown[]; next?: boolean }> {
17
+ const id =
18
+ params.id?.list /* general logic from dynamic-filter-preview.vue*/ ||
19
+ params.id /* wt-select options loadings */ ||
20
+ filterValue?.list; /* newest and coolest, but not implemented on all filters 🥲 */
21
+
22
+ return ContactsAPI.getLookup({
23
+ ...params,
24
+ id,
25
+ });
26
+ }
27
+ }
28
+
29
+ export type { CaseAssigneeFilterConfig };
30
+
31
+ export const createCaseAssigneeFilterConfig = (params) =>
32
+ new CaseAssigneeFilterConfig(params);
@@ -1,30 +1,11 @@
1
- import { contacts as ContactsAPI } from '@webitel/ui-sdk/api/clients/index';
2
-
3
- import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
4
- import { FilterOption } from '../../enums/FilterOption';
5
1
  import CaseAssigneeFilterValueField from './case-assignee-filter-value-field.vue';
6
2
  import CaseAssigneeFilterValuePreview from './case-assignee-filter-value-preview.vue';
3
+ import { createCaseAssigneeFilterConfig } from './filterConfig';
7
4
 
8
- class CaseAssigneeFilterConfig extends WtSysTypeFilterConfig {
9
- readonly name = FilterOption.CaseAssignee;
10
- valueInputComponent = CaseAssigneeFilterValueField;
11
- valuePreviewComponent = CaseAssigneeFilterValuePreview;
12
-
13
- searchRecords(
14
- params: object,
15
- { filterValue } = {},
16
- ): Promise<{ items: unknown[]; next?: boolean }> {
17
- const id =
18
- params.id?.list /* general logic from dynamic-filter-preview.vue*/ ||
19
- params.id /* wt-select options loadings */ ||
20
- filterValue?.list; /* newest and coolest, but not implemented on all filters 🥲 */
21
-
22
- return ContactsAPI.getLookup({
23
- ...params,
24
- id,
25
- });
26
- }
27
- }
5
+ export {
6
+ CaseAssigneeFilterValueField,
7
+ CaseAssigneeFilterValuePreview,
8
+ createCaseAssigneeFilterConfig,
9
+ };
28
10
 
29
- export const createCaseAssigneeFilterConfig = () =>
30
- new CaseAssigneeFilterConfig();
11
+ export type * from './filterConfig';
@@ -0,0 +1,26 @@
1
+ import { WebitelProtoDataField } from 'webitel-sdk';
2
+ import { FilterConfig } from '../../classes/FilterConfig';
3
+ import { CustomFilterOption } from '../../enums/FilterOption';
4
+ import { BaseFilterConfig, FilterConfigBaseParams, IWtSysTypeFilterConfig } from '../../types/FilterConfig';
5
+ export interface ITypeExtensionFilterConfig extends BaseFilterConfig {
6
+ readonly field: WebitelProtoDataField;
7
+ }
8
+ declare class TypeExtensionFilterConfig extends FilterConfig implements ITypeExtensionFilterConfig {
9
+ readonly field: WebitelProtoDataField;
10
+ constructor({ name }: FilterConfigBaseParams, { field }: {
11
+ field: WebitelProtoDataField;
12
+ });
13
+ }
14
+ declare class TypeExtensionWtSysTypeFieldFilterConfig extends TypeExtensionFilterConfig implements IWtSysTypeFilterConfig {
15
+ searchRecords({ id: filterValue, ...rest }: {
16
+ [x: string]: any;
17
+ id: any;
18
+ }): Promise<{
19
+ items: unknown[];
20
+ next?: boolean;
21
+ }>;
22
+ }
23
+ export type { TypeExtensionFilterConfig, TypeExtensionWtSysTypeFieldFilterConfig, };
24
+ export declare const createTypeExtensionFilterConfig: (name: CustomFilterOption, { field }: {
25
+ field: WebitelProtoDataField;
26
+ }) => TypeExtensionFilterConfig;
@@ -1,17 +1,5 @@
1
- import { WebitelProtoDataField } from 'webitel-sdk';
2
- import { FilterConfig } from '../../classes/FilterConfig';
3
- import { CustomFilterOption } from '../../enums/FilterOption';
4
- import { BaseFilterConfig, FilterConfigBaseParams } from '../../types/FilterConfig';
5
- export interface ITypeExtensionFilterConfig extends BaseFilterConfig {
6
- readonly field: WebitelProtoDataField;
7
- }
8
- declare class TypeExtensionFilterConfig extends FilterConfig implements ITypeExtensionFilterConfig {
9
- readonly field: WebitelProtoDataField;
10
- constructor({ name }: FilterConfigBaseParams, { field }: {
11
- field: WebitelProtoDataField;
12
- });
13
- }
14
- export declare const createTypeExtensionFilterConfig: (name: CustomFilterOption, { field }: {
15
- field: WebitelProtoDataField;
16
- }) => TypeExtensionFilterConfig;
17
- export {};
1
+ import { createTypeExtensionFilterConfig } from './filterConfig';
2
+ import TypeExtensionFilterValueField from './type-extension-filter-value-field.vue';
3
+ import TypeExtensionFilterValuePreview from './type-extension-filter-value-preview.vue';
4
+ export { createTypeExtensionFilterConfig, TypeExtensionFilterValueField, TypeExtensionFilterValuePreview, };
5
+ export type * from './filterConfig';
@@ -0,0 +1,44 @@
1
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
2
+ declare class CaseAssigneeFilterConfig extends WtSysTypeFilterConfig {
3
+ readonly name: "assignee";
4
+ valueInputComponent: import("vue").DefineComponent<{
5
+ filterConfig: WtSysTypeFilterConfig;
6
+ } & {
7
+ modelValue?: {
8
+ list: string[];
9
+ unassigned: boolean;
10
+ };
11
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:modelValue": (value: {
13
+ list: string[];
14
+ unassigned: boolean;
15
+ }) => any;
16
+ "update:invalid": (args_0: boolean) => any;
17
+ }, string, import("vue").PublicProps, Readonly<{
18
+ filterConfig: WtSysTypeFilterConfig;
19
+ } & {
20
+ modelValue?: {
21
+ list: string[];
22
+ unassigned: boolean;
23
+ };
24
+ }> & Readonly<{
25
+ "onUpdate:modelValue"?: (value: {
26
+ list: string[];
27
+ unassigned: boolean;
28
+ }) => any;
29
+ "onUpdate:invalid"?: (args_0: boolean) => any;
30
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ valuePreviewComponent: import("vue").DefineComponent<{
32
+ value: import("webitel-sdk").WebitelContactsContact[];
33
+ filter: import("../../../..").IFilter;
34
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
35
+ value: import("webitel-sdk").WebitelContactsContact[];
36
+ filter: import("../../../..").IFilter;
37
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ searchRecords(params: object, { filterValue }?: {}): Promise<{
39
+ items: unknown[];
40
+ next?: boolean;
41
+ }>;
42
+ }
43
+ export type { CaseAssigneeFilterConfig };
44
+ export declare const createCaseAssigneeFilterConfig: (params: any) => CaseAssigneeFilterConfig;
@@ -1,44 +1,5 @@
1
- import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
2
- declare class CaseAssigneeFilterConfig extends WtSysTypeFilterConfig {
3
- readonly name: "assignee";
4
- valueInputComponent: import("vue").DefineComponent<{
5
- filterConfig: WtSysTypeFilterConfig;
6
- } & {
7
- modelValue?: {
8
- list: string[];
9
- unassigned: boolean;
10
- };
11
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
- "update:modelValue": (value: {
13
- list: string[];
14
- unassigned: boolean;
15
- }) => any;
16
- "update:invalid": (args_0: boolean) => any;
17
- }, string, import("vue").PublicProps, Readonly<{
18
- filterConfig: WtSysTypeFilterConfig;
19
- } & {
20
- modelValue?: {
21
- list: string[];
22
- unassigned: boolean;
23
- };
24
- }> & Readonly<{
25
- "onUpdate:modelValue"?: (value: {
26
- list: string[];
27
- unassigned: boolean;
28
- }) => any;
29
- "onUpdate:invalid"?: (args_0: boolean) => any;
30
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
- valuePreviewComponent: import("vue").DefineComponent<{
32
- value: import("webitel-sdk").WebitelContactsContact[];
33
- filter: import("../../../..").IFilter;
34
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
35
- value: import("webitel-sdk").WebitelContactsContact[];
36
- filter: import("../../../..").IFilter;
37
- }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
- searchRecords(params: object, { filterValue }?: {}): Promise<{
39
- items: unknown[];
40
- next?: boolean;
41
- }>;
42
- }
43
- export declare const createCaseAssigneeFilterConfig: () => CaseAssigneeFilterConfig;
44
- export {};
1
+ import CaseAssigneeFilterValueField from './case-assignee-filter-value-field.vue';
2
+ import CaseAssigneeFilterValuePreview from './case-assignee-filter-value-preview.vue';
3
+ import { createCaseAssigneeFilterConfig } from './filterConfig';
4
+ export { CaseAssigneeFilterValueField, CaseAssigneeFilterValuePreview, createCaseAssigneeFilterConfig, };
5
+ export type * from './filterConfig';
@@ -80,47 +80,5 @@ export declare const FilterOptionToPreviewApiSearchMethodMap: Record<FilterOptio
80
80
  items: any;
81
81
  }>;
82
82
  export declare const FilterOptionToFilterConfigCreatorMap: {
83
- assignee: () => {
84
- readonly name: "assignee";
85
- valueInputComponent: import("vue").DefineComponent<{
86
- filterConfig: import("..").WtSysTypeFilterConfig;
87
- } & {
88
- modelValue?: {
89
- list: string[];
90
- unassigned: boolean;
91
- };
92
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
93
- "update:modelValue": (value: {
94
- list: string[];
95
- unassigned: boolean;
96
- }) => any;
97
- "update:invalid": (args_0: boolean) => any;
98
- }, string, import("vue").PublicProps, Readonly<{
99
- filterConfig: import("..").WtSysTypeFilterConfig;
100
- } & {
101
- modelValue?: {
102
- list: string[];
103
- unassigned: boolean;
104
- };
105
- }> & Readonly<{
106
- "onUpdate:modelValue"?: (value: {
107
- list: string[];
108
- unassigned: boolean;
109
- }) => any;
110
- "onUpdate:invalid"?: (args_0: boolean) => any;
111
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
112
- valuePreviewComponent: import("vue").DefineComponent<{
113
- value: import("webitel-sdk").WebitelContactsContact[];
114
- filter: import("../../..").IFilter;
115
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
116
- value: import("webitel-sdk").WebitelContactsContact[];
117
- filter: import("../../..").IFilter;
118
- }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
119
- searchRecords(params: object, { filterValue }?: {}): Promise<{
120
- items: unknown[];
121
- next?: boolean;
122
- }>;
123
- label?: ReturnType<import("vue-i18n").MessageResolver> | string;
124
- notDeletable: boolean;
125
- };
83
+ assignee: (params: any) => import("./case-assignee").CaseAssigneeFilterConfig;
126
84
  };