@topvisor/ui 1.4.1-projectSelector.2 → 1.4.1-projectSelector.4
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/.chunks/policy.vue_vue_type_style_index_0_lang-BkKOPt0o.amd.js +2 -0
- package/.chunks/{policy.vue_vue_type_style_index_0_lang-CO-f4TwZ.amd.js.map → policy.vue_vue_type_style_index_0_lang-BkKOPt0o.amd.js.map} +1 -1
- package/.chunks/{policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js → policy.vue_vue_type_style_index_0_lang-CaEdkGWd.es.js} +178 -167
- package/.chunks/{policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js.map → policy.vue_vue_type_style_index_0_lang-CaEdkGWd.es.js.map} +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +33 -33
- package/formsExt/formsExt.js.map +1 -1
- package/icomoon/Read Me.txt +1 -1
- package/icomoon/Topvisor icons.json +361 -131
- package/icomoon/demo.html +141 -1
- package/icomoon/fonts/Topvisor-2.eot +0 -0
- package/icomoon/fonts/Topvisor-2.svg +11 -1
- package/icomoon/fonts/Topvisor-2.ttf +0 -0
- package/icomoon/fonts/Topvisor-2.woff +0 -0
- package/icomoon/selection.json +1 -1
- package/icomoon/style.css +35 -5
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +808 -760
- package/project/project.js.map +1 -1
- package/src/components/formsExt/selector2/selector2.vue.d.ts +3 -0
- package/src/components/formsExt/selector2/types.d.ts +18 -4
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +10 -2
- package/src/components/project/projectSelector/cache.d.ts +4 -0
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +28 -18
- package/src/components/project/projectSelector/types.d.ts +1 -2
- package/src/components/project/projectSelector/utils.d.ts +7 -3
- package/.chunks/policy.vue_vue_type_style_index_0_lang-CO-f4TwZ.amd.js +0 -2
|
@@ -25,9 +25,11 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {
|
|
|
25
25
|
*/
|
|
26
26
|
resetCache: (resetAPICache?: boolean) => void;
|
|
27
27
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
28
|
+
open: () => any;
|
|
28
29
|
"update:modelValue": (value: Item | Item[]) => any;
|
|
29
30
|
appendItem: (item: Item) => any;
|
|
30
31
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
onOpen?: (() => any) | undefined;
|
|
31
33
|
"onUpdate:modelValue"?: ((value: Item | Item[]) => any) | undefined;
|
|
32
34
|
onAppendItem?: ((item: Item) => any) | undefined;
|
|
33
35
|
}>, {
|
|
@@ -36,6 +38,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {
|
|
|
36
38
|
items: Item[];
|
|
37
39
|
searchType: "none" | "inline" | "popup";
|
|
38
40
|
minLength: number;
|
|
41
|
+
closeAfterAppend: boolean;
|
|
39
42
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
40
43
|
popupRef: ShallowUnwrapRef<{
|
|
41
44
|
id: string;
|
|
@@ -47,6 +47,12 @@ export interface Props {
|
|
|
47
47
|
* Текст для placeholder поля поиска
|
|
48
48
|
*/
|
|
49
49
|
placeholder?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Добавить кнопку `Отменить` к виджету поиска. Клик по ней закрывает popup
|
|
52
|
+
*
|
|
53
|
+
* Только для `searchType` = `popup`
|
|
54
|
+
*/
|
|
55
|
+
hasCloserBtn?: boolean;
|
|
50
56
|
/**
|
|
51
57
|
* Если указан, будет выполнена загрузка результатов через API
|
|
52
58
|
*
|
|
@@ -93,6 +99,14 @@ export interface Props {
|
|
|
93
99
|
* Будет вызван только если `appendSearchToResult = true`
|
|
94
100
|
*/
|
|
95
101
|
appendSearchToResultCond?: (search: string) => boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Закрыть `popup` после добавления элемента
|
|
104
|
+
*
|
|
105
|
+
* По умолчанию, `popup` не закрывается на десктопе, если `multiselect` = `true`
|
|
106
|
+
*
|
|
107
|
+
* Будет вызван только если `appendSearchToResult = true`
|
|
108
|
+
*/
|
|
109
|
+
closeAfterAppend?: boolean;
|
|
96
110
|
/**
|
|
97
111
|
* Режим выбора нескольких вариантов
|
|
98
112
|
*
|
|
@@ -159,10 +173,6 @@ export interface Slots {
|
|
|
159
173
|
item?(props: {
|
|
160
174
|
item: Item;
|
|
161
175
|
}): any;
|
|
162
|
-
/**
|
|
163
|
-
* Слот для добавления элементов к виджету поиска
|
|
164
|
-
*/
|
|
165
|
-
widgetAction?(props: {}): any;
|
|
166
176
|
}
|
|
167
177
|
export type Emits = {
|
|
168
178
|
/**
|
|
@@ -171,6 +181,10 @@ export type Emits = {
|
|
|
171
181
|
* @see `props.appendSearchToResult`
|
|
172
182
|
*/
|
|
173
183
|
'appendItem': [item: Item];
|
|
184
|
+
/**
|
|
185
|
+
* Будет вызвано при открытии Popup
|
|
186
|
+
*/
|
|
187
|
+
open: [];
|
|
174
188
|
};
|
|
175
189
|
export interface PropsItemMulti {
|
|
176
190
|
id: Item['id'];
|
|
@@ -38,18 +38,21 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
38
38
|
readonly openByFocusInput?: boolean | undefined;
|
|
39
39
|
readonly searchType?: "none" | "inline" | "popup" | undefined;
|
|
40
40
|
readonly placeholder?: string | undefined;
|
|
41
|
+
readonly hasCloserBtn?: boolean | undefined;
|
|
41
42
|
readonly api?: (Api.ClientRequest<any> | Api.ClientRequestCustom<any, any, any>) | undefined;
|
|
42
43
|
readonly apiSetSearchParams?: ((api: NonNullable< Props["api"]>, search: string) => void) | undefined;
|
|
43
44
|
readonly minLength?: number | undefined;
|
|
44
45
|
readonly useCache?: boolean | undefined;
|
|
45
46
|
readonly appendSearchToResult?: boolean | undefined;
|
|
46
47
|
readonly appendSearchToResultCond?: ((search: string) => boolean) | undefined;
|
|
48
|
+
readonly closeAfterAppend?: boolean | undefined;
|
|
47
49
|
readonly multiselect?: boolean | undefined;
|
|
48
50
|
readonly useAllItem?: boolean | string | undefined;
|
|
49
51
|
readonly addChanger?: boolean | undefined;
|
|
50
52
|
readonly buttonProps?: Props | undefined;
|
|
51
53
|
readonly selectedAsPlaceholder?: boolean | undefined;
|
|
52
54
|
readonly openerShortcut?: string | undefined;
|
|
55
|
+
readonly onOpen?: (() => any) | undefined;
|
|
53
56
|
readonly "onUpdate:modelValue"?: ((value: SelectorItem | SelectorItem[]) => any) | undefined;
|
|
54
57
|
readonly onAppendItem?: ((item: SelectorItem) => any) | undefined;
|
|
55
58
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -70,16 +73,18 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
70
73
|
$root: ComponentPublicInstance | null;
|
|
71
74
|
$parent: ComponentPublicInstance | null;
|
|
72
75
|
$host: Element | null;
|
|
73
|
-
$emit: ((event: "update:modelValue", value: SelectorItem | SelectorItem[]) => void) & ((event: "appendItem", item: SelectorItem) => void);
|
|
76
|
+
$emit: ((event: "open") => void) & ((event: "update:modelValue", value: SelectorItem | SelectorItem[]) => void) & ((event: "appendItem", item: SelectorItem) => void);
|
|
74
77
|
$el: any;
|
|
75
78
|
$options: ComponentOptionsBase<Readonly<{
|
|
76
79
|
modelValue: Props["modelValue"];
|
|
77
80
|
} & Props> & Readonly<{
|
|
81
|
+
onOpen?: (() => any) | undefined;
|
|
78
82
|
"onUpdate:modelValue"?: ((value: SelectorItem | SelectorItem[]) => any) | undefined;
|
|
79
83
|
onAppendItem?: ((item: SelectorItem) => any) | undefined;
|
|
80
84
|
}>, {
|
|
81
85
|
resetCache: (resetAPICache?: boolean) => void;
|
|
82
86
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
87
|
+
open: () => any;
|
|
83
88
|
"update:modelValue": (value: SelectorItem | SelectorItem[]) => any;
|
|
84
89
|
appendItem: (item: SelectorItem) => any;
|
|
85
90
|
}, string, {
|
|
@@ -88,6 +93,7 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
88
93
|
items: SelectorItem[];
|
|
89
94
|
searchType: "none" | "inline" | "popup";
|
|
90
95
|
minLength: number;
|
|
96
|
+
closeAfterAppend: boolean;
|
|
91
97
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
92
98
|
beforeCreate?: (() => void) | (() => void)[];
|
|
93
99
|
created?: (() => void) | (() => void)[];
|
|
@@ -114,12 +120,14 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
114
120
|
items: SelectorItem[];
|
|
115
121
|
searchType: "none" | "inline" | "popup";
|
|
116
122
|
minLength: number;
|
|
123
|
+
closeAfterAppend: boolean;
|
|
117
124
|
}> & Omit<Readonly<{
|
|
118
125
|
modelValue: Props["modelValue"];
|
|
119
126
|
} & Props> & Readonly<{
|
|
127
|
+
onOpen?: (() => any) | undefined;
|
|
120
128
|
"onUpdate:modelValue"?: ((value: SelectorItem | SelectorItem[]) => any) | undefined;
|
|
121
129
|
onAppendItem?: ((item: SelectorItem) => any) | undefined;
|
|
122
|
-
}>, "resetCache" | ("size" | "openByFocusInput" | "items" | "searchType" | "minLength")> & ShallowUnwrapRef<{
|
|
130
|
+
}>, "resetCache" | ("size" | "openByFocusInput" | "items" | "searchType" | "minLength" | "closeAfterAppend")> & ShallowUnwrapRef<{
|
|
123
131
|
resetCache: (resetAPICache?: boolean) => void;
|
|
124
132
|
}> & {} & ComponentCustomProperties & {} & {
|
|
125
133
|
$slots: Readonly< Slots> & Slots;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Props } from './types';
|
|
2
|
-
import { Item
|
|
2
|
+
import { Item, Props, Size, Slots } from '../../formsExt/selector2/types';
|
|
3
3
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef, Slot, ComponentPublicInstance, ComponentOptionsBase, GlobalComponents, GlobalDirectives, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ComponentCustomProperties } from 'vue';
|
|
4
4
|
import { Props } from '../../forms/button/types';
|
|
5
5
|
import { TopLibPopup } from '../../popup/lib/popup';
|
|
@@ -8,20 +8,22 @@ type __VLS_Props = Props;
|
|
|
8
8
|
type __VLS_PublicProps = {
|
|
9
9
|
'project'?: NonNullable<Props['project']>;
|
|
10
10
|
} & __VLS_Props;
|
|
11
|
-
declare const _default: DefineComponent<__VLS_PublicProps, {
|
|
12
|
-
|
|
11
|
+
declare const _default: DefineComponent<__VLS_PublicProps, {
|
|
12
|
+
resetCache: () => void;
|
|
13
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
14
|
+
"update:project": (value: Item) => any;
|
|
13
15
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
-
"onUpdate:project"?: ((value:
|
|
16
|
+
"onUpdate:project"?: ((value: Item) => any) | undefined;
|
|
15
17
|
}>, {
|
|
16
|
-
addLinksToProjects: boolean;
|
|
17
18
|
userId: number;
|
|
19
|
+
addLinksToProjects: boolean;
|
|
18
20
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
19
21
|
refSelector: ({
|
|
20
22
|
$: ComponentInternalInstance;
|
|
21
23
|
$data: {};
|
|
22
24
|
$props: {
|
|
23
25
|
readonly modelValue: Props["modelValue"];
|
|
24
|
-
readonly items?:
|
|
26
|
+
readonly items?: Item[] | undefined;
|
|
25
27
|
readonly title?: string | undefined;
|
|
26
28
|
readonly disabled?: boolean | undefined;
|
|
27
29
|
readonly icon?: string | undefined;
|
|
@@ -31,20 +33,23 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
31
33
|
readonly openByFocusInput?: boolean | undefined;
|
|
32
34
|
readonly searchType?: "none" | "inline" | "popup" | undefined;
|
|
33
35
|
readonly placeholder?: string | undefined;
|
|
36
|
+
readonly hasCloserBtn?: boolean | undefined;
|
|
34
37
|
readonly api?: (Api.ClientRequest<any> | Api.ClientRequestCustom<any, any, any>) | undefined;
|
|
35
38
|
readonly apiSetSearchParams?: ((api: NonNullable< Props["api"]>, search: string) => void) | undefined;
|
|
36
39
|
readonly minLength?: number | undefined;
|
|
37
40
|
readonly useCache?: boolean | undefined;
|
|
38
41
|
readonly appendSearchToResult?: boolean | undefined;
|
|
39
42
|
readonly appendSearchToResultCond?: ((search: string) => boolean) | undefined;
|
|
43
|
+
readonly closeAfterAppend?: boolean | undefined;
|
|
40
44
|
readonly multiselect?: boolean | undefined;
|
|
41
45
|
readonly useAllItem?: boolean | string | undefined;
|
|
42
46
|
readonly addChanger?: boolean | undefined;
|
|
43
47
|
readonly buttonProps?: Props | undefined;
|
|
44
48
|
readonly selectedAsPlaceholder?: boolean | undefined;
|
|
45
49
|
readonly openerShortcut?: string | undefined;
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
50
|
+
readonly onOpen?: (() => any) | undefined;
|
|
51
|
+
readonly "onUpdate:modelValue"?: ((value: Item | Item[]) => any) | undefined;
|
|
52
|
+
readonly onAppendItem?: ((item: Item) => any) | undefined;
|
|
48
53
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
49
54
|
$attrs: {
|
|
50
55
|
[x: string]: unknown;
|
|
@@ -63,24 +68,27 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
63
68
|
$root: ComponentPublicInstance | null;
|
|
64
69
|
$parent: ComponentPublicInstance | null;
|
|
65
70
|
$host: Element | null;
|
|
66
|
-
$emit: ((event: "update:modelValue", value:
|
|
71
|
+
$emit: ((event: "open") => void) & ((event: "update:modelValue", value: Item | Item[]) => void) & ((event: "appendItem", item: Item) => void);
|
|
67
72
|
$el: any;
|
|
68
73
|
$options: ComponentOptionsBase<Readonly<{
|
|
69
74
|
modelValue: Props["modelValue"];
|
|
70
75
|
} & Props> & Readonly<{
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
onOpen?: (() => any) | undefined;
|
|
77
|
+
"onUpdate:modelValue"?: ((value: Item | Item[]) => any) | undefined;
|
|
78
|
+
onAppendItem?: ((item: Item) => any) | undefined;
|
|
73
79
|
}>, {
|
|
74
80
|
resetCache: (resetAPICache?: boolean) => void;
|
|
75
81
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
open: () => any;
|
|
83
|
+
"update:modelValue": (value: Item | Item[]) => any;
|
|
84
|
+
appendItem: (item: Item) => any;
|
|
78
85
|
}, string, {
|
|
79
86
|
size: Size;
|
|
80
87
|
openByFocusInput: boolean;
|
|
81
|
-
items:
|
|
88
|
+
items: Item[];
|
|
82
89
|
searchType: "none" | "inline" | "popup";
|
|
83
90
|
minLength: number;
|
|
91
|
+
closeAfterAppend: boolean;
|
|
84
92
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
85
93
|
beforeCreate?: (() => void) | (() => void)[];
|
|
86
94
|
created?: (() => void) | (() => void)[];
|
|
@@ -104,15 +112,17 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
104
112
|
} & Readonly<{
|
|
105
113
|
size: Size;
|
|
106
114
|
openByFocusInput: boolean;
|
|
107
|
-
items:
|
|
115
|
+
items: Item[];
|
|
108
116
|
searchType: "none" | "inline" | "popup";
|
|
109
117
|
minLength: number;
|
|
118
|
+
closeAfterAppend: boolean;
|
|
110
119
|
}> & Omit<Readonly<{
|
|
111
120
|
modelValue: Props["modelValue"];
|
|
112
121
|
} & Props> & Readonly<{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
onOpen?: (() => any) | undefined;
|
|
123
|
+
"onUpdate:modelValue"?: ((value: Item | Item[]) => any) | undefined;
|
|
124
|
+
onAppendItem?: ((item: Item) => any) | undefined;
|
|
125
|
+
}>, "resetCache" | ("size" | "openByFocusInput" | "items" | "searchType" | "minLength" | "closeAfterAppend")> & ShallowUnwrapRef<{
|
|
116
126
|
resetCache: (resetAPICache?: boolean) => void;
|
|
117
127
|
}> & {} & ComponentCustomProperties & {} & {
|
|
118
128
|
$slots: Readonly< Slots> & Slots;
|
|
@@ -13,7 +13,6 @@ export interface Props {
|
|
|
13
13
|
* id пользователя
|
|
14
14
|
*/
|
|
15
15
|
userId: number;
|
|
16
|
-
icon?: string;
|
|
17
16
|
/**
|
|
18
17
|
* Не отображать проект с этим id в списке
|
|
19
18
|
*/
|
|
@@ -47,5 +46,5 @@ export interface Props {
|
|
|
47
46
|
*
|
|
48
47
|
* @const
|
|
49
48
|
*/
|
|
50
|
-
client
|
|
49
|
+
client: Api.Client<Api.TV.Paths, true>;
|
|
51
50
|
}
|
|
@@ -16,11 +16,11 @@ export declare const genProjectExternalLink: (url: string) => string;
|
|
|
16
16
|
/**
|
|
17
17
|
* Создать API запрос на получение списка проектов
|
|
18
18
|
*
|
|
19
|
-
* Данные после загрузки преобразуются
|
|
19
|
+
* Данные после загрузки преобразуются с помощью `prepareProjects()`
|
|
20
20
|
*
|
|
21
21
|
* @see prepareProjects
|
|
22
22
|
*/
|
|
23
|
-
export declare const genApiGetProjects: (client: Api.Client<Api.TV.Paths, true>,
|
|
23
|
+
export declare const genApiGetProjects: (client: Api.Client<Api.TV.Paths, true>, excludeProjectId?: number, userId?: number, addLinksToProjects?: boolean, params?: Record<string, number>) => Api.ClientRequest<Api.ClientRequestContext< paths, "/get/projects_2/projects/", true>, ("name" | "id" | "on" | "right" | "url" | "user_id")[], Api.Params<Api.ClientRequestContext< paths, "/get/projects_2/projects/", true>, undefined, {
|
|
24
24
|
"COUNT(*)"?: any;
|
|
25
25
|
"IS_YOUTUBE()"?: any;
|
|
26
26
|
"IS_APP_STORE()"?: any;
|
|
@@ -108,7 +108,11 @@ export declare const genApiGetProjects: (client: Api.Client<Api.TV.Paths, true>,
|
|
|
108
108
|
filters?: components["schemas"]["TV.API.Params.FiltersTrait"]["filters"];
|
|
109
109
|
id?: components["schemas"]["TV.API.Params.FiltersTrait"]["id"];
|
|
110
110
|
limit?: components["schemas"]["TV.API.Params.LimitTrait"]["limit"];
|
|
111
|
-
offset?: components["schemas"]["TV.API.Params.OffsetTrait"]
|
|
111
|
+
offset?: components["schemas"]["TV.API.Params.OffsetTrait"] /**
|
|
112
|
+
* Добавить к данным проектов `listItemProps`
|
|
113
|
+
*
|
|
114
|
+
* @see Item
|
|
115
|
+
*/["offset"];
|
|
112
116
|
}>, Api.ModelFields<{
|
|
113
117
|
"COUNT(*)"?: any;
|
|
114
118
|
"IS_YOUTUBE()"?: any;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
define(["require","exports","vue","./forms-B_v2vU59.amd","./popupHint.vue_vue_type_style_index_0_lang-CdIajfDS.amd","./widgetInput.vue_vue_type_script_setup_true_lang-C4wFo0AR.amd","../utils/keyboard.amd","./field-Cvv0SRcJ.amd","../require/css.amd!../assets/policy.css"],(function(re,L,e,T,P,q,K,W){"use strict";if(typeof e>"u")var e=window.Vue;const O={key:0,class:"top-menu_selectAll"},z=e.defineComponent({__name:"menu",props:e.mergeModels({modelValue:{},items:{},isMultiple:{type:Boolean},canBeEmptyMultiple:{type:Boolean},styling:{default:"default"},selectAllItem:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const r=t,n=e.useModel(t,"modelValue"),l=e.ref();!r.isMultiple&&typeof n.value!="string"&&typeof n.value!="number"&&console.warn('Type check failed for prop "modelValue". Expected String: '+typeof n.value),r.isMultiple&&!Array.isArray(n.value)&&console.warn('Type check failed for prop "modelValue". Expected Array: '+typeof n.value),r.isMultiple&&!r.canBeEmptyMultiple&&Array.isArray(n.value)&&!n.value.length&&r.items[0]&&(n.value=[r.items[0]?.href??r.items[0]?.value]);const u=s=>Array.isArray(n.value)?n.value.includes(s.value):s.value===n.value,C=(s,d=!1)=>{if(Array.isArray(n.value)){let i=n.value.slice();if(d){i.length||(i=r.items.map(h=>h.value));const g=i.indexOf(s.value);g===-1?i.push(s.value):i.splice(g,1)}else i.length===1&&i[0]===s.value?i=[]:i=[s.value];!r.canBeEmptyMultiple&&!i.length&&(i=[s.value]),n.value=i;return}n.value=s.value},p=s=>{if(l.value.scrollWidth<=l.value.offsetWidth||s.shiftKey||Math.abs(s.deltaY)<50)return;s.preventDefault();const d=s.deltaY>0?30:-30;l.value.scrollLeft=l.value.scrollLeft+d},c=(s=!0)=>{const d=l.value.querySelector(".top-active");if(!d)return;const i=24,g=d.offsetLeft-l.value.offsetLeft-i,h=d.offsetLeft-l.value.offsetLeft+d.clientWidth+i,y=l.value.scrollLeft,w=l.value.clientWidth+l.value.scrollLeft;let k;g<y&&(k=g),h>w&&(k=h-l.value.clientWidth),k!==void 0&&(T.isSafari()?T.Core.$?.(l.value).animate({scrollLeft:k},s?200:0):l.value.scrollTo({left:k,behavior:s?"smooth":"auto"}))},o=()=>{if(Array.isArray(n.value)){if(n.value.length===r.items.length){n.value=[r.items[0].href??r.items[0].value];return}n.value=r.items.map(s=>s.href??s.value)}};return e.onMounted(()=>c(!1)),e.onUpdated(()=>c(!0)),(s,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"el",ref:l,class:e.normalizeClass({"top-menu":!0,["top-style_"+t.styling]:!0}),onWheel:p},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,i=>(e.openBlock(),e.createBlock(T._sfc_main$1,e.mergeProps({ref_for:!0},i,{class:"top-menu_item",color:"theme",onClick:g=>C(i,g.ctrlKey||g.metaKey),isActive:u(i)}),e.createSlots({_:2},[i.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.content),1)]),key:"0"}:void 0]),1040,["onClick","isActive"]))),256)),Array.isArray(n.value)&&t.selectAllItem?(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(T._sfc_main$1,e.mergeProps(t.selectAllItem,{class:"top-menu_item",color:"theme",styling:"",onClick:d[0]||(d[0]=i=>o()),isActive:n.value.length===t.items.length}),e.createSlots({_:2},[t.selectAllItem.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.selectAllItem.content),1)]),key:"0"}:void 0]),1040,["isActive"])])):e.createCommentVNode("",!0)],34))}}),U={class:"top-selector2_itemMulti top-ellipsis"},Y=e.defineComponent({__name:"itemMulti",props:{id:{},name:{}},emits:["delete"],setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",U,[e.createTextVNode(e.toDisplayString(t.name)+" ",1),e.createElementVNode("span",{class:"top-selector2_itemMultiDelete","data-top-icon":"",onClick:n[0]||(n[0]=l=>r.$emit("delete",{id:t.id,name:t.name})),onMousedown:n[1]||(n[1]=e.withModifiers(()=>{},["stop"]))},null,32)]))}}),x=new Map,H=t=>{x.get(t)?.clear()},J=t=>{const r=window.mo?.user?.id;return JSON.stringify(t.params)+":"+t.url+":"+r},j=(t,r)=>x.get(r)?.get(t),G=(t,r,n)=>{x.has(r)||x.set(r,new Map),x.get(r)?.set(t,n)},Q=(t,r,n,l)=>{const u=e.ref([]),C=e.ref(!1),p=e.ref(0);let c="",o;t&&!t.params.limit&&(t.params.limit=100);const s=async()=>{if(!t)return;const h=l?J(t):void 0;if(h){const k=j(h,t.path);if(k)return t.abortByFingerprint(),k}const y=await t.call();if(y.errors)return;if(!Array.isArray(y.result)){console.warn("Array expected in `res.result`");return}const w=y.result.findIndex(k=>k.id===void 0||k.name===void 0);if(w!==-1){console.warn(`В result[${w}] нет id или name`);return}return h&&G(h,t.path,y),y},d=async h=>{if(!t)return;if(h){if(!o||C.value)return;t.params.offset=o}else t.params.offset=0;r?.(t,c),C.value=!0;const y=await s();C.value=!1,p.value++,y&&(o=y.nextOffset,h?u.value=u.value.concat(y.result):u.value=y.result)},i=T.debounce(()=>d(!1),200);return{apiRequest:t,items:u,isLoading:C,countLoading:p,load:d,setSearchTextAndLoad:(h,y=!0)=>{if(t){if(h.length<n){t.abortByFingerprint(),u.value=[];return}h===c&&u.value.length||(c=h,y?i():d(!1))}}}},V=0,b=null,F=(t,r,n=!0)=>n&&r.id===b?Array.isArray(t)?t.some(l=>l.id===r.id&&l.name===r.name):r.name===t.name:Array.isArray(t)?t.some(l=>l.id===r.id):r.id===t.id,X=(t,r,n)=>{let l=t.params.filters??[];l=l.filter(u=>u.name!==n),r&&l.push(W.genFieldFilter(n,"CONTAINS",[r])),t.changeParams({filters:l})},Z=(t,r,n,l,u,C,p,c,o,s)=>{const d=e.ref(""),i={id:V,name:T.useI18n().Common.All},g=()=>{d.value=""},h=()=>!(!s.apiRequest||d.value.length>=o),y=e.computed(()=>{const a=[];return!l&&u.value&&(typeof u.value=="string"&&(i.name=u.value),a.push(i)),n.value?.forEach(S=>a.push({...S})),a}),w=e.ref([]),k=()=>{w.value=N()},N=()=>{const a=d.value.toLowerCase(),S=K.invertKeyboardLayout(a),f=a.replace(/^https?:\/\/(www\.)?|\/$/g,"");let B=[],D;const I=[],$=()=>{I.at(-1)?.listItemProps?.type==="delimiter"&&I.pop(),I.length&&(D&&B.push(D),B.push(...I),I.length=0)};for(const A of y.value)switch(A.listItemProps?.type){case"title":$(),D=A;break;case"delimiter":if(I.length){let R=I.length;I.at(-1)?.listItemProps?.type==="delimiter"&&R--,I[R]=A}break;default:const E=A.name.toLowerCase();(String(A.id).includes(a)||E.includes(a)||E.includes(S)||E.includes(f))&&(E===a||E===S?I.unshift(A):I.push(A))}if($(),B.push(...s.items.value),C.value&&d.value&&(!p.value||p.value(a))&&!B.find(A=>A.name.toLowerCase()===a)){const A={id:b,name:d.value};B.push(A)}return l&&(B=B.filter(A=>!F(t.value,A))),B},m=a=>{a.listItemProps?.type==="title"||a.listItemProps?.type==="delimiter"||(l&&Array.isArray(t.value)?F(t.value,a)||(t.value=[...t.value,a]):t.value=a,a.id===b&&r("appendItem",a),setTimeout(()=>{g()}))};if(s.apiRequest){const a=[n,s.items];l&&a.push(t),e.watch(a,()=>{k()})}else e.watch([t,n,d],()=>{k()},{immediate:!0,deep:2});return{searchText:d,resetSearch:g,genIsShort:h,itemsForShow:w,selectItem:m,selectNextItem:()=>{if(Array.isArray(t.value))return;const a=w.value.filter(B=>!["title","delimiter"].includes(B.listItemProps?.type??"")),f=(a.findIndex(B=>B.id===t.value.id)+1)%a.length;t.value={...a[f]}},deleteItemByItem:async a=>{Array.isArray(t.value)&&(t.value=t.value.filter(S=>S.id!==a.id||S.name!==a.name))}}},_={key:0,class:"top-selector2_activeItems"},ee={key:1,class:"top-selector2_activeName top-ellipsis"},te={key:2,class:"top-selector2_placeholder top-ellipsis"},le={class:"top-selector2_searchWidget"},ne=e.defineComponent({__name:"selector2",props:e.mergeModels({modelValue:{},items:{default:()=>[]},title:{},disabled:{type:Boolean},icon:{},modificator:{},size:{default:"s"},isError:{type:Boolean},openByFocusInput:{type:Boolean,default:void 0},searchType:{default:"popup"},placeholder:{},api:{},apiSetSearchParams:{},minLength:{default:0},useCache:{type:Boolean},appendSearchToResult:{type:Boolean},appendSearchToResultCond:{},multiselect:{type:Boolean},useAllItem:{type:[Boolean,String]},addChanger:{type:Boolean},buttonProps:{},selectedAsPlaceholder:{type:Boolean},openerShortcut:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["appendItem"],["update:modelValue"]),setup(t,{expose:r,emit:n}){const l=t,u=e.useModel(t,"modelValue"),C=n;r({resetCache:(m=!1)=>{c.apiRequest&&(m&&H(c.apiRequest.path),c.items.value=[],c.countLoading.value=0,c.apiRequest.params.offset=0,requestAnimationFrame(()=>{o.itemsForShow.value=[]}),i()?.elPopup&&c.setSearchTextAndLoad(o.searchText.value))}});const p=e.computed(()=>l.searchType==="inline"&&l.multiselect||l.searchType==="inline"&&T.Core.state.isMobile?"popup":l.searchType),c=Q(l.api,l.apiSetSearchParams,l.minLength,l.useCache),o=Z(u,C,e.toRef(l,"items"),l.multiselect,e.toRef(l,"useAllItem"),e.toRef(l,"appendSearchToResult"),e.toRef(l,"appendSearchToResultCond"),p,l.minLength,c),s=e.computed(()=>l.buttonProps?"TopButton":p.value==="inline"?"TopInput":"div"),d=e.ref(null),i=()=>d.value?.popup;c.apiRequest&&e.watch(o.searchText,()=>{c.setSearchTextAndLoad(o.searchText.value)});const g=e.computed(()=>Array.isArray(u.value)||l.multiselect||!l.selectedAsPlaceholder&&p.value!=="inline"?l.placeholder:u.value?.name||l.placeholder),h=m=>{let v=!1;switch(m.key){case"Delete":case"Backspace":Array.isArray(u.value)&&(m.preventDefault(),m.stopPropagation(),u.value.pop());break;case"ArrowUp":case"ArrowRight":case"ArrowDown":case"ArrowLeft":case"Enter":case" ":v=!0;break;case"Escape":p.value==="inline"&&o.resetSearch();break}const M=m.key.length===1&&!m.ctrlKey&&!m.metaKey;(p.value==="popup"||p.value==="inline")&&M&&(v=!0),i()?.elPopup&&(v=!1),v&&(p.value==="popup"&&(m.preventDefault(),m.stopPropagation(),M&&(o.searchText.value||(o.searchText.value=m.key))),m.currentTarget?.click())},y=m=>{m.preventDefault(),o.selectNextItem()},w=()=>{c.apiRequest&&c.setSearchTextAndLoad(o.searchText.value,!1)},k=()=>{p.value==="popup"&&o.searchText.value&&o.resetSearch()},N=m=>{const v=m.target;v.scrollTop/(v.scrollHeight-v.offsetHeight)>.8&&c.load(!0)};return(m,v)=>{const M=e.resolveComponent("TopLoadbar"),a=e.resolveDirective("top-focus"),S=e.resolveDirective("top-shortcut");return e.openBlock(),e.createBlock(e.unref(P._sfc_main),{ref_key:"popupRef",ref:d,onOpen:v[3]||(v[3]=f=>w()),onClose:v[4]||(v[4]=f=>k()),onScrollContentList:v[5]||(v[5]=f=>e.unref(c)?N(f):void 0),notch:!1,transitionDuration:0,openByFocusInput:p.value==="inline"&&(t.openByFocusInput??!0),disabled:p.value==="inline"&&e.unref(o).genIsShort()},e.createSlots({opener:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),e.mergeProps(t.buttonProps,{class:{"top-selector2":!0,"top-selector2-multiselect":t.multiselect,["top-selector2-"+t.modificator]:!!t.modificator,"top-as-input":!t.buttonProps&&p.value!=="inline","top-as-selector":!0,["top-size_"+t.size]:!0,"top-disabled":t.disabled,"top-forms-focusable":!t.disabled,"top-error":t.isError},icon:t.icon,tabindex:"0",onKeydown:h,onBlur:v[0]||(v[0]=f=>p.value==="inline"&&e.unref(o).resetSearch()),placeholder:g.value,title:t.title,captionType:p.value==="inline"&&t.title!==void 0?"top":void 0,modelValue:e.unref(o).searchText.value,"onUpdate:modelValue":v[1]||(v[1]=f=>e.unref(o).searchText.value=f)}),{default:e.withCtx(()=>[t.multiselect?(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,f=>(e.openBlock(),e.createBlock(Y,{id:f.id,name:f.name,onDelete:e.unref(o).deleteItemByItem},null,8,["id","name","onDelete"]))),256))])):e.createCommentVNode("",!0),p.value!=="inline"&&!t.multiselect?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(Array.isArray(u.value)?"":u.value.name),1)):e.createCommentVNode("",!0),t.multiselect&&!u.value.length?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0),t.addChanger&&!t.buttonProps&&!t.multiselect&&e.unref(o).itemsForShow.value.length>1&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:3,class:"top-changer top-changer-selector","data-top-popup-disabled":"true",onClick:y})):e.createCommentVNode("",!0)]),_:1},16,["class","icon","placeholder","title","captionType","modelValue"])),[[a,t.isError,void 0,{onupdate:!0}],[S,t.openerShortcut]])]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).itemsForShow.value,f=>(e.openBlock(),e.createBlock(e.unref(P._sfc_main$2),e.mergeProps({key:f.id??void 0,class:{"top-active":!Array.isArray(u.value)&&!t.multiselect&&u.value.id===f.id&&u.value.name===f.name,"top-selector2_item-all":f.id===e.unref(V),"top-selector2_item-new":f.id===e.unref(b)}},{ref_for:!0},f.listItemProps,{closeByClick:!t.multiselect||e.unref(T.Core).state.isMobile,onClick:B=>e.unref(o).selectItem(f)}),{default:e.withCtx(()=>[m.$slots.item?e.renderSlot(m.$slots,"item",{key:0,item:f}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(f.name),1)],64))]),_:2},1040,["class","closeByClick","onClick"]))),128)),!e.unref(o).itemsForShow.value.length&&!e.unref(o).genIsShort()?(e.openBlock(),e.createBlock(e.unref(P._sfc_main$2),{key:0,type:"regular"},{default:e.withCtx(()=>[!e.unref(c).isLoading.value||e.unref(c).countLoading.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(m.$i18n.Common.No_results),1)],64)):(e.openBlock(),e.createBlock(e.unref(T._sfc_main$12),{key:1,type:"circles"}))]),_:1})):e.createCommentVNode("",!0),e.unref(c).countLoading.value&&e.unref(c).isLoading.value&&p.value==="inline"?(e.openBlock(),e.createBlock(M,{key:1})):e.createCommentVNode("",!0)]),_:2},[p.value==="popup"?{name:"widget",fn:e.withCtx(()=>[e.createElementVNode("div",le,[e.withDirectives(e.createVNode(e.unref(q._sfc_main),{title:"Поиск",icon:"",modelValue:e.unref(o).searchText.value,"onUpdate:modelValue":v[2]||(v[2]=f=>e.unref(o).searchText.value=f),isLoading:!!e.unref(c).countLoading.value&&e.unref(c).isLoading.value,placeholder:g.value},null,8,["modelValue","isLoading","placeholder"]),[[a,u.value,void 0,{onupdate:!0}]]),e.renderSlot(m.$slots,"widgetAction")])]),key:"0"}:void 0]),1032,["openByFocusInput","disabled"])}}});L.ITEM_ID_ALL=V,L.ITEM_ID_NEW=b,L._sfc_main=ne,L._sfc_main$1=z,L.apiSetSearchParamsFilter=X}));
|
|
2
|
-
//# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-CO-f4TwZ.amd.js.map
|