@karta.io/utils 1.0.0-beta.39 → 1.0.0-beta.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/dist/index.cjs +72 -286
- package/dist/index.d.ts +13 -56
- package/dist/index.mjs +73 -281
- package/package.json +34 -33
- package/dist/index.d.cts +0 -393
- package/dist/index.d.mts +0 -393
package/package.json
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karta.io/utils",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.4",
|
|
4
4
|
"description": "karta.io utils for admin and application",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"homepage": "",
|
|
8
5
|
"author": "Vitaly Blokhin <karambafe@gmail.com>",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"module": "./dist/index.mjs",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
6
|
+
"homepage": "",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"type": "module",
|
|
15
10
|
"exports": {
|
|
16
11
|
".": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
12
|
"require": "./dist/index.cjs",
|
|
19
13
|
"import": "./dist/index.mjs"
|
|
20
14
|
},
|
|
21
15
|
"./*": "./*"
|
|
22
16
|
},
|
|
23
|
-
"
|
|
17
|
+
"main": "./dist/index.cjs",
|
|
18
|
+
"module": "./dist/index.mjs",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
24
23
|
"peerDependencies": {
|
|
25
|
-
"vue": "3.x"
|
|
24
|
+
"vue": "3.3.x"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
|
-
"@karta.io/common-data": "^1.0.0-beta.
|
|
29
|
-
"@tanstack/vue-query": "
|
|
30
|
-
"@vueuse/core": "
|
|
27
|
+
"@karta.io/common-data": "^1.0.0-beta.4",
|
|
28
|
+
"@tanstack/vue-query": "4.33.1",
|
|
29
|
+
"@vueuse/core": "10.7.0",
|
|
31
30
|
"async-validator": "4.2.5",
|
|
32
|
-
"axios": "1.
|
|
33
|
-
"dayjs": "1.11.
|
|
31
|
+
"axios": "1.4.0",
|
|
32
|
+
"dayjs": "1.11.8",
|
|
34
33
|
"detect-browser": "5.3.0",
|
|
35
|
-
"libphonenumber-js": "1.
|
|
34
|
+
"libphonenumber-js": "1.10.36",
|
|
36
35
|
"lodash": "4.17.21",
|
|
37
36
|
"logdown": "3.3.1",
|
|
38
|
-
"qs": "6.
|
|
39
|
-
"vue-router": "4.
|
|
37
|
+
"qs": "6.11.2",
|
|
38
|
+
"vue-router": "4.x.x"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"eslint": "
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
41
|
+
"@qvant/prettier-config": "0.1.0",
|
|
42
|
+
"@types/lodash": "4.14.195",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "5.60.1",
|
|
44
|
+
"@typescript-eslint/parser": "5.60.1",
|
|
45
|
+
"eslint": "8.43.0",
|
|
46
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
47
|
+
"eslint-plugin-import": "2.27.5",
|
|
48
|
+
"prettier": "3.0.1",
|
|
49
|
+
"typescript": "5.1.6",
|
|
50
|
+
"unbuild": "1.2.1",
|
|
51
|
+
"vitest": "0.32.2",
|
|
52
|
+
"vue": "3.3.4"
|
|
51
53
|
},
|
|
52
|
-
"prettier": "@karta.io/prettier-config",
|
|
53
54
|
"scripts": {
|
|
54
55
|
"dev": "vitest",
|
|
55
56
|
"build": "unbuild",
|
|
56
|
-
"lint": "eslint
|
|
57
|
-
"lint:fix": "eslint
|
|
57
|
+
"lint": "eslint \"**/*.{ts,js}\"",
|
|
58
|
+
"lint:fix": "eslint --fix \"**/*.{ts,js}\"",
|
|
58
59
|
"test": "pnpm lint && vitest run",
|
|
59
60
|
"prettier": "prettier --check --ignore-unknown \"**/*\"",
|
|
60
61
|
"prettier:fix": "prettier --write --ignore-unknown \"**/*\"",
|
package/dist/index.d.cts
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
import * as vue from 'vue';
|
|
2
|
-
import { MaybeRef, Component, EmitsOptions, VNode, Ref } from 'vue';
|
|
3
|
-
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
export { AxiosError as HttpError, AxiosPromise as HttpPromise, AxiosRequestConfig as HttpRequestConfig, AxiosResponse as HttpResponse } from 'axios';
|
|
5
|
-
import { MaybeRef as MaybeRef$1 } from '@vueuse/core';
|
|
6
|
-
import dayjs from 'dayjs';
|
|
7
|
-
import { Browser } from 'detect-browser';
|
|
8
|
-
import logdown from 'logdown';
|
|
9
|
-
import { RuleItem } from 'async-validator';
|
|
10
|
-
|
|
11
|
-
interface AppComponentsResolverOptions {
|
|
12
|
-
prefix?: string;
|
|
13
|
-
}
|
|
14
|
-
declare function AppComponentsResolver(options?: AppComponentsResolverOptions): any;
|
|
15
|
-
|
|
16
|
-
interface Dictionary {
|
|
17
|
-
[keys: string | number]: any;
|
|
18
|
-
}
|
|
19
|
-
interface ResponseError {
|
|
20
|
-
status: number;
|
|
21
|
-
statusMessage: string;
|
|
22
|
-
message: string;
|
|
23
|
-
data: Record<string, string | string[]> | null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
declare function camelizeKeys<T extends Record<string, any> = Dictionary>(object: Dictionary): T;
|
|
27
|
-
|
|
28
|
-
interface Options$3 {
|
|
29
|
-
labelType: 'key' | 'value';
|
|
30
|
-
}
|
|
31
|
-
declare function convertEnumToOptions(obj: any, options?: Options$3): {
|
|
32
|
-
value: unknown;
|
|
33
|
-
label: unknown;
|
|
34
|
-
}[];
|
|
35
|
-
|
|
36
|
-
interface EnrichErrorParams {
|
|
37
|
-
message: string;
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}
|
|
40
|
-
declare class EnrichError extends Error {
|
|
41
|
-
constructor(data: EnrichErrorParams);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
declare function getStatusMessage(status: number): string;
|
|
45
|
-
declare function formatErrorDataMessage(data?: Record<string, string | string[]>): string;
|
|
46
|
-
declare function formatErrorForNotify(error: Error | ResponseError | any): {
|
|
47
|
-
title: string;
|
|
48
|
-
message: any;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
interface Options$2 extends Intl.NumberFormatOptions {
|
|
52
|
-
locale?: string;
|
|
53
|
-
defaultValue?: string | number;
|
|
54
|
-
}
|
|
55
|
-
declare function formatMoney(value: string | number | null | undefined, currency?: string, options?: Options$2): string | number;
|
|
56
|
-
|
|
57
|
-
declare function genHash(hashLength: number): string;
|
|
58
|
-
|
|
59
|
-
declare function genRandomNumber(min: number, max: number): number;
|
|
60
|
-
|
|
61
|
-
declare function genUUID(): string;
|
|
62
|
-
|
|
63
|
-
interface Options$1 {
|
|
64
|
-
hasOnlyLast4: boolean;
|
|
65
|
-
isHidden: boolean;
|
|
66
|
-
dot: string;
|
|
67
|
-
}
|
|
68
|
-
declare function getCardNumber(number: string, options?: Partial<Options$1>): string;
|
|
69
|
-
|
|
70
|
-
declare function getCountryFromPhone(phone: string): string;
|
|
71
|
-
|
|
72
|
-
declare function isElementIgnored({ ignoredClasses, event, }?: {
|
|
73
|
-
ignoredClasses?: string[];
|
|
74
|
-
event?: Event;
|
|
75
|
-
}): boolean;
|
|
76
|
-
|
|
77
|
-
declare function isEmptyObject(object: object): boolean;
|
|
78
|
-
|
|
79
|
-
declare function isHtml(data: string): boolean;
|
|
80
|
-
|
|
81
|
-
interface MapOptions {
|
|
82
|
-
labelKey?: string;
|
|
83
|
-
valueKey?: string;
|
|
84
|
-
excludedItems?: any[];
|
|
85
|
-
}
|
|
86
|
-
declare function mapDataObjectForFilters<T extends Record<string, any>>(data: T, options?: MapOptions): {
|
|
87
|
-
label: string;
|
|
88
|
-
value: any;
|
|
89
|
-
}[];
|
|
90
|
-
|
|
91
|
-
declare function getPaginationParams({ page, limit, }: {
|
|
92
|
-
page: string | number;
|
|
93
|
-
limit: string | number;
|
|
94
|
-
}): {
|
|
95
|
-
limit: number;
|
|
96
|
-
offset: number;
|
|
97
|
-
};
|
|
98
|
-
declare function getPaginationLimit({ limit, }: {
|
|
99
|
-
limit: string | number;
|
|
100
|
-
}): number;
|
|
101
|
-
declare function getPaginationOffset({ page, limit, }: {
|
|
102
|
-
page: string | number;
|
|
103
|
-
limit: string | number;
|
|
104
|
-
}): number;
|
|
105
|
-
declare function getPaginationPages({ count, limit, }: {
|
|
106
|
-
count: number;
|
|
107
|
-
limit: string | number;
|
|
108
|
-
}): number;
|
|
109
|
-
|
|
110
|
-
declare function parsePhone(phone: string | null | undefined): string;
|
|
111
|
-
|
|
112
|
-
type SnakelizeKeysProp = Record<string | number, any>;
|
|
113
|
-
declare function snakelizeKeys<T extends Record<string, any> = SnakelizeKeysProp>(prop: SnakelizeKeysProp): T;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Принимает на вход число в виде строки или числа,
|
|
117
|
-
* возвращает корректное значение типа Number (убирает лишние пробелы и запятые)
|
|
118
|
-
* @example
|
|
119
|
-
* // returns 1000
|
|
120
|
-
* unformatNumber('1 000');
|
|
121
|
-
* @example
|
|
122
|
-
* // returns 1000
|
|
123
|
-
* unformatNumber('1,000')
|
|
124
|
-
* @example
|
|
125
|
-
* // returns 1000.123
|
|
126
|
-
* unformatNummber('1 000,123')
|
|
127
|
-
* @example
|
|
128
|
-
* // returns 1000.123
|
|
129
|
-
* unformatNummber('1,000.123')
|
|
130
|
-
* @param value
|
|
131
|
-
* @return number
|
|
132
|
-
*/
|
|
133
|
-
declare function unformatNumber(value: string | number): string | number;
|
|
134
|
-
|
|
135
|
-
declare function validateNumber(value: string | number, defaultValue: number): number;
|
|
136
|
-
|
|
137
|
-
interface UiComponentsResolverOptions {
|
|
138
|
-
prefix?: string;
|
|
139
|
-
}
|
|
140
|
-
declare function UiComponentsResolver(options?: UiComponentsResolverOptions): any;
|
|
141
|
-
|
|
142
|
-
declare function useAbortController<T extends (...args: any[]) => any>(callback: T): {
|
|
143
|
-
call(...args: Parameters<T>): Promise<Awaited<ReturnType<T>>>;
|
|
144
|
-
abort(): void;
|
|
145
|
-
isAborted(error: ResponseError): boolean;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
declare function useAsyncItems<T extends (...args: any[]) => any>({ apiMethod, queryKey, params, config, }: {
|
|
149
|
-
apiMethod: T;
|
|
150
|
-
queryKey: string;
|
|
151
|
-
params: MaybeRef<Parameters<T>[0]>;
|
|
152
|
-
config?: AxiosRequestConfig;
|
|
153
|
-
}): {
|
|
154
|
-
isLoading: vue.Ref<boolean> | vue.Ref<false> | vue.Ref<true>;
|
|
155
|
-
isFetching: vue.Ref<boolean>;
|
|
156
|
-
isError: vue.Ref<false> | vue.Ref<true>;
|
|
157
|
-
data: vue.Ref<any> | vue.Ref<undefined>;
|
|
158
|
-
error: vue.Ref<Error> | vue.Ref<null>;
|
|
159
|
-
items: vue.ComputedRef<Awaited<ReturnType<T>>["results"]>;
|
|
160
|
-
count: vue.Ref<number>;
|
|
161
|
-
refetch: () => void;
|
|
162
|
-
reload: () => void;
|
|
163
|
-
abort: () => void;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
interface ReactiveData$1 {
|
|
167
|
-
search: string;
|
|
168
|
-
page: number;
|
|
169
|
-
selectedValues?: any[];
|
|
170
|
-
params?: any;
|
|
171
|
-
}
|
|
172
|
-
declare function useAsyncMultiselect<T extends (...args: any[]) => any, K extends (params: any) => any>({ apiMethod, mapOptionCallback, selectedValues, params, queryKey, dataItemsKey, dataItemIdKey, dataCountKey, delay, onUpdated, }: {
|
|
173
|
-
apiMethod: T;
|
|
174
|
-
mapOptionCallback?: K;
|
|
175
|
-
selectedValues?: MaybeRef$1<Parameters<T>[0]['includedIds']>;
|
|
176
|
-
params?: MaybeRef$1<Partial<Parameters<T>[0]>>;
|
|
177
|
-
queryKey: string;
|
|
178
|
-
dataItemsKey?: string;
|
|
179
|
-
dataItemIdKey?: string;
|
|
180
|
-
dataCountKey?: string;
|
|
181
|
-
delay?: number;
|
|
182
|
-
onUpdated?: (data: ReactiveData$1) => void;
|
|
183
|
-
}): {
|
|
184
|
-
items: vue.ComputedRef<any[]>;
|
|
185
|
-
options: vue.ComputedRef<ReturnType<K>[]>;
|
|
186
|
-
search: vue.Ref<string>;
|
|
187
|
-
hasNextPage: vue.ComputedRef<boolean>;
|
|
188
|
-
isFetching: vue.Ref<boolean>;
|
|
189
|
-
isLoading: vue.Ref<boolean> | vue.Ref<false> | vue.Ref<true>;
|
|
190
|
-
loadPage: (newPage?: number) => void;
|
|
191
|
-
updateSearch: (value: string) => void;
|
|
192
|
-
refetch: () => void;
|
|
193
|
-
reload: () => void;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
interface ReactiveData {
|
|
197
|
-
search: string;
|
|
198
|
-
page: number;
|
|
199
|
-
selectedValue?: any[];
|
|
200
|
-
params?: any;
|
|
201
|
-
}
|
|
202
|
-
declare function useAsyncSelect<T extends (...args: any[]) => any, K extends (params: any) => any>({ apiMethod, mapOptionCallback, selectedValue, params, queryKey, dataItemsKey, dataCountKey, delay, onUpdated, }: {
|
|
203
|
-
apiMethod: T;
|
|
204
|
-
mapOptionCallback?: K;
|
|
205
|
-
selectedValue?: MaybeRef$1<Parameters<T>[0]['includedIds']>;
|
|
206
|
-
params?: MaybeRef$1<Partial<Parameters<T>[0]>>;
|
|
207
|
-
queryKey: string;
|
|
208
|
-
dataItemsKey?: string;
|
|
209
|
-
dataCountKey?: string;
|
|
210
|
-
delay?: number;
|
|
211
|
-
onUpdated?: (data: ReactiveData) => void;
|
|
212
|
-
}): {
|
|
213
|
-
items: vue.ComputedRef<any[]>;
|
|
214
|
-
options: vue.ComputedRef<ReturnType<K>[]>;
|
|
215
|
-
search: vue.Ref<string>;
|
|
216
|
-
hasNextPage: vue.ComputedRef<boolean>;
|
|
217
|
-
isFetching: vue.Ref<boolean>;
|
|
218
|
-
isLoading: vue.Ref<boolean> | vue.Ref<false> | vue.Ref<true>;
|
|
219
|
-
loadPage: (newPage?: number) => void;
|
|
220
|
-
updateSearch: (value: string) => void;
|
|
221
|
-
refetch: () => void;
|
|
222
|
-
reload: () => void;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
declare function useBreakpoint(): {
|
|
226
|
-
isMobile: vue.Ref<boolean>;
|
|
227
|
-
isDesktop: vue.Ref<boolean>;
|
|
228
|
-
isGreaterXxs: vue.Ref<boolean>;
|
|
229
|
-
isGreaterXs: vue.Ref<boolean>;
|
|
230
|
-
isGreaterSm: vue.Ref<boolean>;
|
|
231
|
-
isGreaterMd: vue.Ref<boolean>;
|
|
232
|
-
isGreaterLg: vue.Ref<boolean>;
|
|
233
|
-
isGreaterXl: vue.Ref<boolean>;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
declare function useClassName(block: string): {
|
|
237
|
-
b: (blockSuffix?: string) => string;
|
|
238
|
-
e: (element?: string) => string;
|
|
239
|
-
m: (modifier?: string, condition?: boolean) => string;
|
|
240
|
-
em: (element?: string, modifier?: string, condition?: boolean) => string;
|
|
241
|
-
mv: (modifier: string, modifierValue: string, condition?: boolean) => string;
|
|
242
|
-
cssVar: (object: Record<string, string | number>) => Record<string, string | number>;
|
|
243
|
-
cssVarName: (name: string) => string;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Обертка над dayjs, позволяющая задавать timezone
|
|
248
|
-
* @see https://day.js.org/en/
|
|
249
|
-
*
|
|
250
|
-
* Использовать параметр timezone нужно крайне аккуратно,
|
|
251
|
-
* может привести к утечкам памяти
|
|
252
|
-
* @todo Подумать как сделать оптимальнее
|
|
253
|
-
*/
|
|
254
|
-
declare function useDayjs(timezone?: string): (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean) => dayjs.Dayjs;
|
|
255
|
-
|
|
256
|
-
interface BrowserInfo {
|
|
257
|
-
isDeprecated?: boolean;
|
|
258
|
-
name?: string;
|
|
259
|
-
version?: string;
|
|
260
|
-
os?: string;
|
|
261
|
-
type?: string;
|
|
262
|
-
options?: any;
|
|
263
|
-
}
|
|
264
|
-
type VersionsList = {
|
|
265
|
-
[key in Browser]?: string | boolean;
|
|
266
|
-
};
|
|
267
|
-
declare function useDetectBrowser(versions: VersionsList, userAgent?: any): BrowserInfo;
|
|
268
|
-
|
|
269
|
-
interface VNodeCustom$1 extends VNode {
|
|
270
|
-
close: () => void;
|
|
271
|
-
}
|
|
272
|
-
interface Dialog {
|
|
273
|
-
uuid: string;
|
|
274
|
-
name?: string;
|
|
275
|
-
vnode: VNodeCustom$1;
|
|
276
|
-
layer: number;
|
|
277
|
-
}
|
|
278
|
-
interface DialogOptions {
|
|
279
|
-
hashPrefix?: string;
|
|
280
|
-
}
|
|
281
|
-
interface DialogParseHashResult {
|
|
282
|
-
name: string;
|
|
283
|
-
layer: number;
|
|
284
|
-
[key: string]: any;
|
|
285
|
-
}
|
|
286
|
-
declare function useDialog(options?: DialogOptions): {
|
|
287
|
-
open: ({ layer, component, props, }: {
|
|
288
|
-
component: Component;
|
|
289
|
-
props?: any;
|
|
290
|
-
layer?: number;
|
|
291
|
-
}) => string;
|
|
292
|
-
getInstance: (uuid: string) => VNodeCustom$1;
|
|
293
|
-
getLayer: (uuid: string) => number;
|
|
294
|
-
close: (uuid: string) => void;
|
|
295
|
-
closeAll: () => void;
|
|
296
|
-
showConfirm: (text?: string) => boolean;
|
|
297
|
-
isOnTop: (uuid: string) => boolean;
|
|
298
|
-
genHash: ({ layer, componentName, props, }: {
|
|
299
|
-
componentName: string;
|
|
300
|
-
props?: any;
|
|
301
|
-
layer?: number;
|
|
302
|
-
}) => string;
|
|
303
|
-
parseHash: (hash: string, componentName: string) => DialogParseHashResult | undefined;
|
|
304
|
-
clearHash: () => void;
|
|
305
|
-
openByHash: ({ layer, component, props, }: {
|
|
306
|
-
component: Component;
|
|
307
|
-
props?: any;
|
|
308
|
-
layer?: number;
|
|
309
|
-
}) => void;
|
|
310
|
-
watchHash: ({ component, events, }: {
|
|
311
|
-
component: Component;
|
|
312
|
-
events?: EmitsOptions;
|
|
313
|
-
}) => any;
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
declare function useGlobalScroll(): {
|
|
317
|
-
isLocked: vue.Ref<boolean>;
|
|
318
|
-
lock: () => void;
|
|
319
|
-
unlock: () => void;
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
declare function useFilters<T extends Record<string, any>, K extends Record<string, any>>({ config, initialFilters }: {
|
|
323
|
-
config: T;
|
|
324
|
-
initialFilters: K;
|
|
325
|
-
}): {
|
|
326
|
-
isOpen: Ref<boolean>;
|
|
327
|
-
filtersModel: Ref<K>;
|
|
328
|
-
filtersFromQuery: vue.ComputedRef<{}>;
|
|
329
|
-
filtersCount: vue.ComputedRef<number>;
|
|
330
|
-
updateOne: (key: keyof K, value: any) => void;
|
|
331
|
-
updateMany: (filters: Record<string, any>) => void;
|
|
332
|
-
open: () => void;
|
|
333
|
-
clear: () => void;
|
|
334
|
-
setQueryFromFilters: (filters: Record<string, any>) => void;
|
|
335
|
-
getValidatedParams: (query: Record<string, any>) => {
|
|
336
|
-
filters: any;
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* @see https://github.com/caiogondim/logdown.js#readme
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
interface Options {
|
|
345
|
-
tag?: string;
|
|
346
|
-
color?: string;
|
|
347
|
-
debug?: boolean;
|
|
348
|
-
}
|
|
349
|
-
declare function useLogger(scope: string, options?: Options): logdown.Logger;
|
|
350
|
-
|
|
351
|
-
interface VNodeCustom extends VNode {
|
|
352
|
-
close: () => void;
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* @deprecated use useDialog
|
|
356
|
-
*/
|
|
357
|
-
declare function usePanel(): {
|
|
358
|
-
open: ({ layer, component, props, }: {
|
|
359
|
-
component: Component;
|
|
360
|
-
props?: any;
|
|
361
|
-
layer?: number;
|
|
362
|
-
}) => string;
|
|
363
|
-
getInstance: (uuid: string) => VNodeCustom;
|
|
364
|
-
close: (uuid: string) => void;
|
|
365
|
-
closeAll: () => void;
|
|
366
|
-
openByHash: ({ layer, component, props, }: {
|
|
367
|
-
component: Component;
|
|
368
|
-
props?: any;
|
|
369
|
-
layer?: number;
|
|
370
|
-
}) => void;
|
|
371
|
-
watchHash: ({ component, events, }: {
|
|
372
|
-
component: Component;
|
|
373
|
-
events?: EmitsOptions;
|
|
374
|
-
}) => any;
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
declare function validatePhone(rule: string, value: string): boolean;
|
|
378
|
-
|
|
379
|
-
declare function isRequired(value?: boolean, message?: string): RuleItem;
|
|
380
|
-
declare function isMax(value?: number, message?: string): {
|
|
381
|
-
max: number;
|
|
382
|
-
message: string;
|
|
383
|
-
};
|
|
384
|
-
declare function isMin(value?: number, message?: string): {
|
|
385
|
-
min: number;
|
|
386
|
-
message: string;
|
|
387
|
-
};
|
|
388
|
-
declare function isTypeEmail(message?: string): RuleItem;
|
|
389
|
-
declare function isTypeUrl(message?: string): RuleItem;
|
|
390
|
-
declare function isTypeNumber(value?: number, message?: string): RuleItem;
|
|
391
|
-
declare function isStrictLength(value?: number, message?: string): RuleItem;
|
|
392
|
-
|
|
393
|
-
export { AppComponentsResolver, type BrowserInfo, type Dialog, type DialogOptions, type DialogParseHashResult, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|