@windwalker-io/unicorn-next 0.1.0
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/.editorconfig +18 -0
- package/.gulp.json +7 -0
- package/bin/release.mjs +47 -0
- package/dist/chunks/_arrayPush.js +168 -0
- package/dist/chunks/_arrayPush.js.map +1 -0
- package/dist/chunks/_baseRest.js +73 -0
- package/dist/chunks/_baseRest.js.map +1 -0
- package/dist/chunks/_commonjsHelpers.js +7 -0
- package/dist/chunks/_commonjsHelpers.js.map +1 -0
- package/dist/chunks/_getPrototype.js +130 -0
- package/dist/chunks/_getPrototype.js.map +1 -0
- package/dist/chunks/button-radio.js +147 -0
- package/dist/chunks/button-radio.js.map +1 -0
- package/dist/chunks/checkboxes-multi-select.js +44 -0
- package/dist/chunks/checkboxes-multi-select.js.map +1 -0
- package/dist/chunks/cloneDeep.js +287 -0
- package/dist/chunks/cloneDeep.js.map +1 -0
- package/dist/chunks/cropper.min.js +5 -0
- package/dist/chunks/cropper.min.js.map +1 -0
- package/dist/chunks/field-cascade-select.js +256 -0
- package/dist/chunks/field-cascade-select.js.map +1 -0
- package/dist/chunks/field-file-drag.js +218 -0
- package/dist/chunks/field-file-drag.js.map +1 -0
- package/dist/chunks/field-flatpickr.js +893 -0
- package/dist/chunks/field-flatpickr.js.map +1 -0
- package/dist/chunks/field-modal-select.js +403 -0
- package/dist/chunks/field-modal-select.js.map +1 -0
- package/dist/chunks/field-modal-tree.js +790 -0
- package/dist/chunks/field-modal-tree.js.map +1 -0
- package/dist/chunks/field-multi-uploader.js +256 -0
- package/dist/chunks/field-multi-uploader.js.map +1 -0
- package/dist/chunks/field-repeatable.js +132 -0
- package/dist/chunks/field-repeatable.js.map +1 -0
- package/dist/chunks/field-single-image-drag.js +338 -0
- package/dist/chunks/field-single-image-drag.js.map +1 -0
- package/dist/chunks/form.js +154 -0
- package/dist/chunks/form.js.map +1 -0
- package/dist/chunks/grid.js +345 -0
- package/dist/chunks/grid.js.map +1 -0
- package/dist/chunks/http-client.js +229 -0
- package/dist/chunks/http-client.js.map +1 -0
- package/dist/chunks/iframe-modal.js +124 -0
- package/dist/chunks/iframe-modal.js.map +1 -0
- package/dist/chunks/index.js +309 -0
- package/dist/chunks/index.js.map +1 -0
- package/dist/chunks/isArguments.js +146 -0
- package/dist/chunks/isArguments.js.map +1 -0
- package/dist/chunks/keep-tab.js +101 -0
- package/dist/chunks/keep-tab.js.map +1 -0
- package/dist/chunks/legacy.js +210 -0
- package/dist/chunks/legacy.js.map +1 -0
- package/dist/chunks/list-dependent.js +231 -0
- package/dist/chunks/list-dependent.js.map +1 -0
- package/dist/chunks/s3-multipart-uploader.js +172 -0
- package/dist/chunks/s3-multipart-uploader.js.map +1 -0
- package/dist/chunks/s3-uploader.js +136 -0
- package/dist/chunks/s3-uploader.js.map +1 -0
- package/dist/chunks/show-on.js +237 -0
- package/dist/chunks/show-on.js.map +1 -0
- package/dist/chunks/tinymce.js +196 -0
- package/dist/chunks/tinymce.js.map +1 -0
- package/dist/chunks/ui-bootstrap5.js +71 -0
- package/dist/chunks/ui-bootstrap5.js.map +1 -0
- package/dist/chunks/unicorn.js +2202 -0
- package/dist/chunks/unicorn.js.map +1 -0
- package/dist/chunks/validation.js +854 -0
- package/dist/chunks/validation.js.map +1 -0
- package/dist/editor.css +1 -0
- package/dist/index.d.ts +1427 -0
- package/dist/multi-level-menu.css +1 -0
- package/dist/switcher.css +1 -0
- package/dist/unicorn-next.css +12 -0
- package/dist/unicorn.js +125 -0
- package/dist/unicorn.js.map +1 -0
- package/fusionfile.mjs +155 -0
- package/images/ajax-loader.gif +0 -0
- package/images/placeholder/avatar.png +0 -0
- package/images/placeholder/image-16x10.png +0 -0
- package/images/placeholder/image-16x9.png +0 -0
- package/images/placeholder/image-1x1.png +0 -0
- package/images/placeholder/image-4x3.png +0 -0
- package/package.json +102 -0
- package/scss/bootstrap/multi-level-menu.scss +121 -0
- package/scss/editor.scss +116 -0
- package/scss/field/file-drag.scss +102 -0
- package/scss/field/single-image-drag.scss +88 -0
- package/scss/field/vue-drag-uploader.scss +160 -0
- package/scss/switcher.scss +156 -0
- package/src/app.ts +128 -0
- package/src/bootstrap/button-radio.ts +208 -0
- package/src/bootstrap/keep-tab.ts +155 -0
- package/src/composable/index.ts +21 -0
- package/src/composable/useCheckboxesMultiSelect.ts +22 -0
- package/src/composable/useFieldCascadeSelect.ts +9 -0
- package/src/composable/useFieldFileDrag.ts +9 -0
- package/src/composable/useFieldFlatpickr.ts +3 -0
- package/src/composable/useFieldModalSelect.ts +6 -0
- package/src/composable/useFieldModalTree.ts +3 -0
- package/src/composable/useFieldMultiUploader.ts +3 -0
- package/src/composable/useFieldRepeatable.ts +9 -0
- package/src/composable/useFieldSingleImageDrag.ts +5 -0
- package/src/composable/useForm.ts +43 -0
- package/src/composable/useGrid.ts +57 -0
- package/src/composable/useHttp.ts +8 -0
- package/src/composable/useIframeModal.ts +9 -0
- package/src/composable/useListDependent.ts +26 -0
- package/src/composable/useQueue.ts +13 -0
- package/src/composable/useS3Uploader.ts +32 -0
- package/src/composable/useShowOn.ts +9 -0
- package/src/composable/useStack.ts +13 -0
- package/src/composable/useTinymce.ts +29 -0
- package/src/composable/useTomSelect.ts +72 -0
- package/src/composable/useUIBootstrap5.ts +48 -0
- package/src/composable/useUniDirective.ts +32 -0
- package/src/composable/useValidation.ts +39 -0
- package/src/data.ts +36 -0
- package/src/events.ts +73 -0
- package/src/legacy/legacy.ts +186 -0
- package/src/legacy/loader.ts +125 -0
- package/src/module/checkboxes-multi-select.ts +54 -0
- package/src/module/field-cascade-select.ts +292 -0
- package/src/module/field-file-drag.ts +292 -0
- package/src/module/field-flatpickr.ts +127 -0
- package/src/module/field-modal-select.ts +174 -0
- package/src/module/field-modal-tree.ts +27 -0
- package/src/module/field-multi-uploader.ts +361 -0
- package/src/module/field-repeatable.ts +202 -0
- package/src/module/field-single-image-drag.ts +468 -0
- package/src/module/form.ts +223 -0
- package/src/module/grid.ts +465 -0
- package/src/module/http-client.ts +243 -0
- package/src/module/iframe-modal.ts +167 -0
- package/src/module/list-dependent.ts +321 -0
- package/src/module/s3-multipart-uploader.ts +300 -0
- package/src/module/s3-uploader.ts +234 -0
- package/src/module/show-on.ts +173 -0
- package/src/module/tinymce.ts +263 -0
- package/src/module/ui-bootstrap5.ts +107 -0
- package/src/module/validation.ts +1019 -0
- package/src/plugin/index.ts +1 -0
- package/src/plugin/php-adapter.ts +65 -0
- package/src/polyfill/form-request-submit.ts +31 -0
- package/src/polyfill/index.ts +9 -0
- package/src/service/animate.ts +58 -0
- package/src/service/crypto.ts +27 -0
- package/src/service/dom-watcher.ts +62 -0
- package/src/service/dom.ts +265 -0
- package/src/service/helper.ts +48 -0
- package/src/service/index.ts +10 -0
- package/src/service/lang.ts +122 -0
- package/src/service/loader.ts +152 -0
- package/src/service/router.ts +118 -0
- package/src/service/ui.ts +497 -0
- package/src/service/uri.ts +106 -0
- package/src/types/base.ts +9 -0
- package/src/types/index.ts +4 -0
- package/src/types/modal-tree.ts +12 -0
- package/src/types/plugin.ts +6 -0
- package/src/types/shims.d.ts +18 -0
- package/src/types/ui.ts +6 -0
- package/src/unicorn.ts +63 -0
- package/src/utilities/arr.ts +25 -0
- package/src/utilities/base.ts +9 -0
- package/src/utilities/data.ts +48 -0
- package/src/utilities/index.ts +5 -0
- package/src/utilities/tree.ts +20 -0
- package/src/vue/components/ModalTree/ModalTreeApp.vue +175 -0
- package/src/vue/components/ModalTree/TreeItem.vue +262 -0
- package/src/vue/components/ModalTree/TreeModal.vue +225 -0
- package/tests/test.js +4 -0
- package/tsconfig.js.json +25 -0
- package/tsconfig.json +17 -0
- package/vite.assets.config.ts +61 -0
- package/vite.config.test.ts +36 -0
- package/vite.config.ts +112 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1427 @@
|
|
|
1
|
+
import { AlertAdapter } from '@lyrasoft/ts-toolkit/generic';
|
|
2
|
+
import { Alpine as Alpine_2 } from 'alpinejs';
|
|
3
|
+
import { AxiosError } from 'axios';
|
|
4
|
+
import { AxiosInstance } from 'axios';
|
|
5
|
+
import { AxiosProgressEvent } from 'axios';
|
|
6
|
+
import { AxiosRequestConfig } from 'axios';
|
|
7
|
+
import { AxiosResponse } from 'axios';
|
|
8
|
+
import * as bootstrap_2 from 'bootstrap';
|
|
9
|
+
import { Class } from 'ts-mixer/dist/types/types';
|
|
10
|
+
import { CreateAxiosDefaults } from 'axios';
|
|
11
|
+
import { default as default_2 } from 'cropperjs';
|
|
12
|
+
import { default as default_3 } from 'web-directive';
|
|
13
|
+
import { deleteConfirm } from '@lyrasoft/ts-toolkit/generic';
|
|
14
|
+
import { Editor } from 'tinymce';
|
|
15
|
+
import { EditorOptions } from 'tinymce';
|
|
16
|
+
import { isAxiosError } from 'axios';
|
|
17
|
+
import { isCancel } from 'axios';
|
|
18
|
+
import { Modal } from 'bootstrap';
|
|
19
|
+
import { randomBytes } from '@lyrasoft/ts-toolkit/generic';
|
|
20
|
+
import { randomBytesString } from '@lyrasoft/ts-toolkit/generic';
|
|
21
|
+
import { simpleAlert } from '@lyrasoft/ts-toolkit/generic';
|
|
22
|
+
import { simpleConfirm } from '@lyrasoft/ts-toolkit/generic';
|
|
23
|
+
import { sleep } from '@lyrasoft/ts-toolkit/generic';
|
|
24
|
+
import { SpectrumOptions } from 'spectrum-vanilla/dist/types/types';
|
|
25
|
+
import { Stack } from '@lyrasoft/ts-toolkit/generic';
|
|
26
|
+
import { TaskQueue } from '@lyrasoft/ts-toolkit/generic';
|
|
27
|
+
import { tid } from '@lyrasoft/ts-toolkit/generic';
|
|
28
|
+
import { TinyMCE } from 'tinymce';
|
|
29
|
+
import { Tooltip } from 'bootstrap';
|
|
30
|
+
import { uid } from '@lyrasoft/ts-toolkit/generic';
|
|
31
|
+
import { WebDirectiveHandler } from 'web-directive/src/types';
|
|
32
|
+
import { WebDirectiveOptions } from 'web-directive/src/types';
|
|
33
|
+
|
|
34
|
+
export declare function __(id: string, ...args: any[]): string;
|
|
35
|
+
|
|
36
|
+
export declare function addGlobalValidator(name: string, validator: ValidationHandler, options?: Record<string, any>): Promise<void>;
|
|
37
|
+
|
|
38
|
+
declare function addHook(handler: ((tinymce: TinyMCE) => MaybePromise<any>)): void;
|
|
39
|
+
|
|
40
|
+
export declare function addQuery(url: string, query?: Record<string, any>): string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Add a route.
|
|
44
|
+
*/
|
|
45
|
+
export declare function addRoute(route: string, url: string): void;
|
|
46
|
+
|
|
47
|
+
export declare function addUriBase(uri: string, type?: string): string;
|
|
48
|
+
|
|
49
|
+
export { AlertAdapter }
|
|
50
|
+
|
|
51
|
+
declare type AlpinePrepareCallback = (Alpine: Alpine_2) => MaybePromise<any>;
|
|
52
|
+
|
|
53
|
+
export declare function animateTo(element: HTMLElement, styles: Partial<Record<keyof CSSStyleDeclaration, any>>, options?: number | KeyframeAnimationOptions): Animation;
|
|
54
|
+
|
|
55
|
+
declare interface ApiReturn<T = any> {
|
|
56
|
+
success: boolean;
|
|
57
|
+
message?: string;
|
|
58
|
+
code: number;
|
|
59
|
+
status: number;
|
|
60
|
+
data: T;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare type AssetTypes = 'root' | 'path';
|
|
64
|
+
|
|
65
|
+
export declare type AttributeMutationCallback<T extends HTMLElement = HTMLElement> = (el: T, name: string, value: any, oldValue: any) => void;
|
|
66
|
+
|
|
67
|
+
export declare class AttributeMutationObserver<T extends HTMLElement> {
|
|
68
|
+
protected element: T;
|
|
69
|
+
callback?: ((el: T, name: string, value: any, oldValue: any) => void) | undefined;
|
|
70
|
+
observer: MutationObserver;
|
|
71
|
+
watches: Record<string, (AttributeWatcher<T>)[]>;
|
|
72
|
+
constructor(element: T, callback?: ((el: T, name: string, value: any, oldValue: any) => void) | undefined);
|
|
73
|
+
watch(name: string, callback: AttributeWatcher<T>): () => void;
|
|
74
|
+
observe(): void;
|
|
75
|
+
disconnect(): void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export declare type AttributeWatcher<T extends HTMLElement = HTMLElement> = (el: T, value: any, oldValue: any) => void;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Base64 URL decode
|
|
82
|
+
*/
|
|
83
|
+
export declare function base64UrlDecode(string: string): string;
|
|
84
|
+
|
|
85
|
+
export declare function base64UrlEncode(string: string): string;
|
|
86
|
+
|
|
87
|
+
export declare function buildQuery(query: Record<string, any>): string;
|
|
88
|
+
|
|
89
|
+
declare class ButtonRadio {
|
|
90
|
+
wrapper: HTMLElement;
|
|
91
|
+
element: HTMLElement;
|
|
92
|
+
radios: HTMLInputElement[];
|
|
93
|
+
inputs: HTMLInputElement[];
|
|
94
|
+
buttons: HTMLButtonElement[];
|
|
95
|
+
colors: string[];
|
|
96
|
+
options: Required<ButtonRadioOptions>;
|
|
97
|
+
static handle(el: HTMLElement | string, options?: ButtonRadioOptions): any;
|
|
98
|
+
constructor(selector: HTMLElement | string, options?: ButtonRadioOptions);
|
|
99
|
+
prepareButton(radio: HTMLInputElement, exists?: boolean): HTMLButtonElement;
|
|
100
|
+
syncState(): void;
|
|
101
|
+
parseClasses(...className: string[]): string[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare interface ButtonRadioModule {
|
|
105
|
+
ButtonRadio: typeof ButtonRadio;
|
|
106
|
+
ready: typeof ready_7;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare interface ButtonRadioOptions {
|
|
110
|
+
selector?: string;
|
|
111
|
+
buttonClass?: string;
|
|
112
|
+
activeClass?: string;
|
|
113
|
+
color?: {
|
|
114
|
+
'default'?: string;
|
|
115
|
+
green?: string;
|
|
116
|
+
red?: string;
|
|
117
|
+
blue?: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare interface CascadeSelectModule {
|
|
122
|
+
ready: typeof ready;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare class CheckboxesMultiSelect {
|
|
126
|
+
defaultOptions: {
|
|
127
|
+
duration: number;
|
|
128
|
+
inputSelector: string;
|
|
129
|
+
};
|
|
130
|
+
$element: HTMLElement;
|
|
131
|
+
options: any;
|
|
132
|
+
boxes: HTMLInputElement[];
|
|
133
|
+
last: HTMLInputElement | false;
|
|
134
|
+
static handle(selector: any, options?: any): any[];
|
|
135
|
+
constructor(selector: any, options?: {});
|
|
136
|
+
select(box: HTMLInputElement, event: MouseEvent): void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare function clearHooks(): void;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Clear messages.
|
|
143
|
+
*/
|
|
144
|
+
export declare function clearMessages(): void;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Clear notifies.
|
|
148
|
+
*/
|
|
149
|
+
export declare function clearNotifies(): void;
|
|
150
|
+
|
|
151
|
+
declare type Conditions = Record<string, any>;
|
|
152
|
+
|
|
153
|
+
declare type Constructor<T> = new (...args: any[]) => T;
|
|
154
|
+
|
|
155
|
+
declare function createCallback(type: 'list' | 'single', selector: string, modalSelector: string): ModalSelectCallback;
|
|
156
|
+
|
|
157
|
+
declare function createHttpClient(config?: CreateAxiosDefaults | AxiosInstance): {
|
|
158
|
+
axios: AxiosInstance;
|
|
159
|
+
request: <T = any, D = any>(options: AxiosRequestConfig) => Promise<AxiosResponse<T, D>>;
|
|
160
|
+
get: <T = any, D = any>(url: string, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
161
|
+
post: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
162
|
+
put: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
163
|
+
patch: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
164
|
+
delete: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
165
|
+
head: <T = any, D = any>(url: string, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
166
|
+
options: <T = any, D = any>(url: string, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
167
|
+
requestMiddleware: (callback: Parameters<AxiosInstance["interceptors"]["request"]["use"]>[0]) => number;
|
|
168
|
+
responseMiddleware: (callback: Parameters<AxiosInstance["interceptors"]["response"]["use"]>[0]) => number;
|
|
169
|
+
isCancel: typeof isCancel;
|
|
170
|
+
AxiosError: typeof AxiosError;
|
|
171
|
+
isAxiosError: typeof isAxiosError;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export declare function createQueue(maxRunning?: number): TaskQueue;
|
|
175
|
+
|
|
176
|
+
export declare function createStack<T = any>(store?: any[]): Stack<T>;
|
|
177
|
+
|
|
178
|
+
export declare function createUnicorn(): UnicornApp;
|
|
179
|
+
|
|
180
|
+
export declare function createUnicornWithPlugins(): UnicornApp;
|
|
181
|
+
|
|
182
|
+
export declare function data(name: string, data: any): any;
|
|
183
|
+
|
|
184
|
+
export declare function data(name: string): any;
|
|
185
|
+
|
|
186
|
+
export declare function data(ele: Element, name: string): any;
|
|
187
|
+
|
|
188
|
+
export declare function data(ele: Element, name: string, data?: any): any;
|
|
189
|
+
|
|
190
|
+
export declare function debounce<T extends Function = Function>(handler: T, wait?: number): T;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Pure JS version of jQuery delegate()
|
|
194
|
+
*
|
|
195
|
+
* @see https://gist.github.com/iagobruno/4db2ed62dc40fa841bb9a5c7de92f5f8
|
|
196
|
+
*/
|
|
197
|
+
export declare function delegate(wrapper: Element | string, selector: string, eventName: string, callback: (e: Event) => void): () => void;
|
|
198
|
+
|
|
199
|
+
export { deleteConfirm }
|
|
200
|
+
|
|
201
|
+
declare function destroy(selector: string): void;
|
|
202
|
+
|
|
203
|
+
declare interface Dictionary<T = any> {
|
|
204
|
+
[key: string]: T;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export declare function doImport<T = any>(src: string): Promise<T>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @see https://stackoverflow.com/a/9899701
|
|
211
|
+
*/
|
|
212
|
+
export declare function domready(callback?: ((value: any) => any)): Promise<void>;
|
|
213
|
+
|
|
214
|
+
declare type EndEventHandler = () => void;
|
|
215
|
+
|
|
216
|
+
export declare interface EventAwareInterface {
|
|
217
|
+
on(event: string | string[], handler: EventHandler): this;
|
|
218
|
+
once(event: string | string[], handler: EventHandler): this;
|
|
219
|
+
off(event: string, handler?: EventHandler): this;
|
|
220
|
+
trigger(event: string | string[], ...args: any[]): this;
|
|
221
|
+
listeners(event: string): EventHandler[];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare type EventHandler = ((...event: any[]) => void) & {
|
|
225
|
+
once?: boolean;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export declare abstract class EventMixin implements EventAwareInterface {
|
|
229
|
+
_listeners: Record<string, EventHandler[]>;
|
|
230
|
+
on(event: string | string[], handler: EventHandler): this;
|
|
231
|
+
once(event: string | string[], handler: EventHandler): this;
|
|
232
|
+
off(event: string, handler?: EventHandler): this;
|
|
233
|
+
trigger(event: string | string[], ...args: any[]): this;
|
|
234
|
+
listeners(event: string): EventHandler[];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export declare function fadeIn(selector: string | HTMLElement, duration?: number, display?: string): Promise<Animation | void>;
|
|
238
|
+
|
|
239
|
+
export declare function fadeOut(selector: string | HTMLElement, duration?: number): Promise<Animation | void>;
|
|
240
|
+
|
|
241
|
+
declare interface FieldValidationOptions {
|
|
242
|
+
validClass: string;
|
|
243
|
+
errorSelector: string;
|
|
244
|
+
inputOptions: boolean;
|
|
245
|
+
inputOptionsSelector: string;
|
|
246
|
+
formSelector: string;
|
|
247
|
+
selector: string;
|
|
248
|
+
inputOptionsWrapperSelector: string;
|
|
249
|
+
events: string[];
|
|
250
|
+
invalidClass: string;
|
|
251
|
+
errorMessageClass: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare class FileDragElement extends HTMLElement {
|
|
255
|
+
static is: string;
|
|
256
|
+
element: HTMLInputElement;
|
|
257
|
+
overlayLabel: HTMLLabelElement;
|
|
258
|
+
button: HTMLButtonElement;
|
|
259
|
+
options: FileDragOptions;
|
|
260
|
+
get inputSelector(): string;
|
|
261
|
+
get multiple(): boolean;
|
|
262
|
+
connectedCallback(): void;
|
|
263
|
+
bindEvent(): void;
|
|
264
|
+
prepareElements(): void;
|
|
265
|
+
createElementsLayout(): void;
|
|
266
|
+
onChange(evt?: Event): void;
|
|
267
|
+
checkFileType(accepted: string[], file: File): void;
|
|
268
|
+
compareMimeType(accepted: string, mime: string): boolean;
|
|
269
|
+
alert(title: string, text?: string, type?: string): Promise<void>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
declare interface FileDragModule {
|
|
273
|
+
FileDragElement: typeof FileDragElement;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare interface FileDragOptions {
|
|
277
|
+
maxFiles: number | undefined;
|
|
278
|
+
maxSize: number | undefined;
|
|
279
|
+
placeholder: string;
|
|
280
|
+
height: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare function forceArray<T>(item: T | T[]): T[];
|
|
284
|
+
|
|
285
|
+
declare interface FormValidationOptions {
|
|
286
|
+
scroll: boolean;
|
|
287
|
+
validatedClass: null;
|
|
288
|
+
fieldSelector: null;
|
|
289
|
+
scrollOffset: number;
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare function get(selector: string, options?: Record<string, any>): Promise<TinymceController>;
|
|
294
|
+
|
|
295
|
+
export declare function getBoundedInstance<T = any, E = Element>(selector: E, name: string, callback?: ((el: E) => any)): T;
|
|
296
|
+
|
|
297
|
+
export declare function getBoundedInstance<T = any, E extends Element = Element>(selector: string | E, name: string, callback?: ((el: E) => any)): T | null;
|
|
298
|
+
|
|
299
|
+
export declare function getBoundedInstanceList<T = any, E extends Element = Element>(selector: string | NodeListOf<E>, name: string, callback?: ((el: E) => any)): (T | null)[];
|
|
300
|
+
|
|
301
|
+
export declare function h<T extends keyof HTMLElementTagNameMap>(element: T, attrs?: Record<string, any>, content?: any): HTMLElementTagNameMap[T];
|
|
302
|
+
|
|
303
|
+
export declare function hasRoute(route: string): boolean;
|
|
304
|
+
|
|
305
|
+
export declare function highlight(selector: string | HTMLElement, color?: string, duration?: number): Promise<Animation | void>;
|
|
306
|
+
|
|
307
|
+
export declare function html<T extends Element = HTMLElement>(html: string): T;
|
|
308
|
+
|
|
309
|
+
declare type HTMLInputTypes = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
310
|
+
|
|
311
|
+
declare class IFrameModalElement extends HTMLElement {
|
|
312
|
+
static is: string;
|
|
313
|
+
options: IFrameModalOptions;
|
|
314
|
+
modalElement: HTMLDivElement;
|
|
315
|
+
modal: Modal;
|
|
316
|
+
iframe: HTMLIFrameElement;
|
|
317
|
+
template(): string;
|
|
318
|
+
get selector(): string;
|
|
319
|
+
getBootstrapModal(): Promise<Modal>;
|
|
320
|
+
connectedCallback(): void;
|
|
321
|
+
bindEvents(): void;
|
|
322
|
+
open(href: string, options?: IFrameModalOptions): Promise<void>;
|
|
323
|
+
close(): Promise<void>;
|
|
324
|
+
resize(iframe: HTMLIFrameElement): void;
|
|
325
|
+
getModalId(): string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
declare interface IframeModalModule {
|
|
329
|
+
IFrameModalElement: typeof IFrameModalElement;
|
|
330
|
+
ready: typeof ready_3;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
declare interface IFrameModalOptions {
|
|
334
|
+
id?: string;
|
|
335
|
+
size?: string;
|
|
336
|
+
resize?: boolean;
|
|
337
|
+
height?: string;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export declare function initAlpineComponent(directive: string): Promise<void>;
|
|
341
|
+
|
|
342
|
+
export declare function injectCssToDocument(doc: Document, ...css: (string | CSSStyleSheet)[]): CSSStyleSheet[];
|
|
343
|
+
|
|
344
|
+
export declare function injectCssToDocument(...css: (string | CSSStyleSheet)[]): CSSStyleSheet[];
|
|
345
|
+
|
|
346
|
+
declare type InjectionKey<T = any> = string | symbol | Constructor<T>;
|
|
347
|
+
|
|
348
|
+
declare type InputElements = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
349
|
+
|
|
350
|
+
export declare function isDebug(): boolean;
|
|
351
|
+
|
|
352
|
+
declare class KeepTab {
|
|
353
|
+
$element: HTMLElement;
|
|
354
|
+
tabButtons: NodeListOf<HTMLElement>;
|
|
355
|
+
storageKey: string;
|
|
356
|
+
options: any;
|
|
357
|
+
constructor(selector: HTMLElement | string, options?: KeepTabOptions);
|
|
358
|
+
protected init(uid: string): Promise<void>;
|
|
359
|
+
bindEvents(): void;
|
|
360
|
+
getButtonHref(button: HTMLAnchorElement): string;
|
|
361
|
+
findTabButtonByHref(href: string): HTMLAnchorElement | undefined;
|
|
362
|
+
activateTab(href: string): void;
|
|
363
|
+
hasTab(href: string): boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Switch tab.
|
|
366
|
+
*
|
|
367
|
+
* @returns {boolean}
|
|
368
|
+
*/
|
|
369
|
+
switchTab(): true | undefined;
|
|
370
|
+
/**
|
|
371
|
+
* Hash code.
|
|
372
|
+
*/
|
|
373
|
+
hashCode(text: string): Promise<string>;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
declare interface KeepTabModule {
|
|
377
|
+
KeepTab: typeof KeepTab;
|
|
378
|
+
ready: typeof ready_6;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
declare interface KeepTabOptions {
|
|
382
|
+
uid?: string;
|
|
383
|
+
delay?: number;
|
|
384
|
+
tabItemSelector?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare class ListDependent {
|
|
388
|
+
element: HTMLSelectElement;
|
|
389
|
+
dependent: HTMLSelectElement;
|
|
390
|
+
options: ListDependentOptions;
|
|
391
|
+
abortController: AbortController | null;
|
|
392
|
+
static handle(el: string | HTMLSelectElement, dependent?: string | HTMLSelectElement, options?: Partial<ListDependentOptions>): ListDependent;
|
|
393
|
+
constructor(element: string | HTMLSelectElement, dependent?: string | HTMLSelectElement, options?: Partial<ListDependentOptions>);
|
|
394
|
+
/**
|
|
395
|
+
* Bind events.
|
|
396
|
+
*/
|
|
397
|
+
bindEvents(): void;
|
|
398
|
+
/**
|
|
399
|
+
* Update the list elements.
|
|
400
|
+
*
|
|
401
|
+
* @param {*} value
|
|
402
|
+
* @param {bool} initial
|
|
403
|
+
*/
|
|
404
|
+
changeList(value: string, initial?: boolean): void;
|
|
405
|
+
/**
|
|
406
|
+
* Update list by source.
|
|
407
|
+
*/
|
|
408
|
+
sourceUpdate(value: string, initial?: boolean): void;
|
|
409
|
+
/**
|
|
410
|
+
* Do ajax.
|
|
411
|
+
*
|
|
412
|
+
* @param {string} value
|
|
413
|
+
*/
|
|
414
|
+
ajaxUpdate(value: string): Promise<void>;
|
|
415
|
+
abort(): void;
|
|
416
|
+
updateListElements(items: MaybeGroupedListItems): void;
|
|
417
|
+
appendOptionTo(item: any, parent: any): void;
|
|
418
|
+
isSelected(value: string): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Before hook.
|
|
421
|
+
*/
|
|
422
|
+
beforeHook(value: string, element: HTMLSelectElement, dependent: HTMLSelectElement): any;
|
|
423
|
+
/**
|
|
424
|
+
* After hook.
|
|
425
|
+
*/
|
|
426
|
+
afterHook(value: string, element: HTMLSelectElement, dependent: HTMLSelectElement): any;
|
|
427
|
+
mergeOptions(options: Partial<ListDependentOptions>): ListDependentOptions;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
declare type ListDependentModule = {
|
|
431
|
+
ListDependent: typeof ListDependent;
|
|
432
|
+
ready: typeof ready_4;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
declare interface ListDependentOptions {
|
|
436
|
+
ajax: {
|
|
437
|
+
url: string | null | ((self: ListDependent) => string);
|
|
438
|
+
value_field: string;
|
|
439
|
+
data: Record<string, any> | ((data: Record<string, any>, self: ListDependent) => Record<string, any>);
|
|
440
|
+
};
|
|
441
|
+
source?: Record<string, any>;
|
|
442
|
+
text_field: string;
|
|
443
|
+
value_field: string;
|
|
444
|
+
first_option?: Record<string, any>;
|
|
445
|
+
default_value: any;
|
|
446
|
+
initial_load: boolean;
|
|
447
|
+
empty_mark: string;
|
|
448
|
+
hooks: {
|
|
449
|
+
before_request: (value: any, element: HTMLSelectElement, dependent: HTMLSelectElement) => any;
|
|
450
|
+
after_request: (value: any, element: HTMLSelectElement, dependent: HTMLSelectElement) => any;
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
declare type ListItems = Record<string, any>[];
|
|
455
|
+
|
|
456
|
+
export declare function loadAlpine(callback?: Nullable<AlpinePrepareCallback>): Promise<Alpine_2>;
|
|
457
|
+
|
|
458
|
+
export declare function mark(selector?: string | HTMLElement, keyword?: string, options?: Record<string, any>): Promise<any>;
|
|
459
|
+
|
|
460
|
+
declare type MaybeGroupedListItems = Record<string, ListItems> | ListItems;
|
|
461
|
+
|
|
462
|
+
declare type MaybePromise<T> = T | Promise<T>;
|
|
463
|
+
|
|
464
|
+
declare type ModalSelectCallback = (item: any) => void;
|
|
465
|
+
|
|
466
|
+
declare interface ModalSelectModule {
|
|
467
|
+
createCallback: typeof createCallback;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
declare function module_2<T = any, E extends Element = Element>(ele: string, name: string, callback?: ((el: E) => any)): (T | null)[];
|
|
471
|
+
|
|
472
|
+
declare function module_2<T = any, E extends Element = Element>(ele: NodeListOf<Element>, name: string, callback?: ((el: E) => any)): (T | null)[];
|
|
473
|
+
|
|
474
|
+
declare function module_2<T = any, E extends Element = Element>(ele: Element, name: string, callback?: ((el: E) => any)): T | null;
|
|
475
|
+
|
|
476
|
+
declare function module_2<T = any, E extends Element = Element>(ele: string | Element | NodeListOf<Element>, name: string, callback?: ((el: E) => any)): (T | null)[] | T | null;
|
|
477
|
+
export { module_2 as module }
|
|
478
|
+
|
|
479
|
+
export declare function nextTick(callback?: () => any): Promise<any>;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Show notify.
|
|
483
|
+
*/
|
|
484
|
+
export declare function notify(messages: string | string[], type?: string): void;
|
|
485
|
+
|
|
486
|
+
declare type Nullable<T> = T | null | undefined;
|
|
487
|
+
|
|
488
|
+
export declare function parseQuery<T = Record<string, any>>(queryString: string): T;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Before Alpine init
|
|
492
|
+
*/
|
|
493
|
+
export declare function prepareAlpine(callback: AlpinePrepareCallback): Promise<void>;
|
|
494
|
+
|
|
495
|
+
export declare function prepareAlpineDefer(callback: AlpinePrepareCallback): Promise<void>;
|
|
496
|
+
|
|
497
|
+
declare type ProgressEvent_2 = {
|
|
498
|
+
percentage: number;
|
|
499
|
+
loaded: number;
|
|
500
|
+
total: number;
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
declare type ProgressEventHandler = (total: number, e: AxiosProgressEvent) => void;
|
|
504
|
+
|
|
505
|
+
declare type ProgressEventHandler_2 = (e: ProgressEvent_2) => void;
|
|
506
|
+
|
|
507
|
+
export declare function pushUnicornToGlobal(app?: UnicornApp): void;
|
|
508
|
+
|
|
509
|
+
export { randomBytes }
|
|
510
|
+
|
|
511
|
+
export { randomBytesString }
|
|
512
|
+
|
|
513
|
+
declare const ready: Promise<void>;
|
|
514
|
+
|
|
515
|
+
declare const ready_2: Promise<void>;
|
|
516
|
+
|
|
517
|
+
declare const ready_3: Promise<void>;
|
|
518
|
+
|
|
519
|
+
declare const ready_4: Promise<void>;
|
|
520
|
+
|
|
521
|
+
declare const ready_5: Promise<void>;
|
|
522
|
+
|
|
523
|
+
declare const ready_6: Promise<void>;
|
|
524
|
+
|
|
525
|
+
declare const ready_7: Promise<void>;
|
|
526
|
+
|
|
527
|
+
export declare function removeData(name: string): any;
|
|
528
|
+
|
|
529
|
+
export declare function removeData(ele: Element, name: string): any;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Render Messages.
|
|
533
|
+
*/
|
|
534
|
+
export declare function renderMessage(messages: string | string[], type?: string): void;
|
|
535
|
+
|
|
536
|
+
declare interface RepeatableModule {
|
|
537
|
+
ready: typeof ready_2;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
declare type RequestHandler = <T = Record<string, any>>(action: RouteActions, data: Record<string, any>) => Promise<T>;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Get route.
|
|
544
|
+
*/
|
|
545
|
+
export declare function route(route: string, query?: Record<string, any>): string;
|
|
546
|
+
|
|
547
|
+
declare type RouteActions = 'init' | 'sign' | 'complete' | 'abort';
|
|
548
|
+
|
|
549
|
+
declare type RoutingOptions = {
|
|
550
|
+
init: string;
|
|
551
|
+
sign: string;
|
|
552
|
+
complete: string;
|
|
553
|
+
abort: string;
|
|
554
|
+
} | ((action: RouteActions) => MaybePromise<string>);
|
|
555
|
+
|
|
556
|
+
declare class S3MultipartUploader extends S3MultipartUploader_base {
|
|
557
|
+
options: S3MultipartUploaderOptions;
|
|
558
|
+
constructor(options: Partial<S3MultipartUploaderOptions>);
|
|
559
|
+
upload(file: string | File | Blob, path: string, options?: S3MultipartUploaderRequestOptions): Promise<{
|
|
560
|
+
url: string;
|
|
561
|
+
}>;
|
|
562
|
+
protected uploadPart(file: File, payload: {
|
|
563
|
+
id: string;
|
|
564
|
+
path: string;
|
|
565
|
+
partNumber: number;
|
|
566
|
+
chunkSize: number;
|
|
567
|
+
onUploadProgress: (e: AxiosProgressEvent) => void;
|
|
568
|
+
}): Promise<{
|
|
569
|
+
blob: Blob;
|
|
570
|
+
etag: string;
|
|
571
|
+
}>;
|
|
572
|
+
protected request<T = Record<string, any>>(action: RouteActions, body: Record<string, any>): Promise<T>;
|
|
573
|
+
abort(id: string, path: string): Promise<void>;
|
|
574
|
+
updateProgress(loaded: number, total: number, options: S3MultipartUploaderRequestOptions): void;
|
|
575
|
+
resolveRoute(action: RouteActions): Promise<string>;
|
|
576
|
+
setChunkSize(size: number): this;
|
|
577
|
+
setChunkSizeInMiB(size: number): this;
|
|
578
|
+
replaceExt(path: string, file: File | Blob): string;
|
|
579
|
+
on(event: 'start', handler: (file: File, data: {
|
|
580
|
+
path: string;
|
|
581
|
+
extra: Record<string, any>;
|
|
582
|
+
[name: string]: any;
|
|
583
|
+
}) => void): this;
|
|
584
|
+
on(event: 'success', handler: (url: string) => void): this;
|
|
585
|
+
on(event: 'progress', handler: (event: ProgressEvent_2) => void): this;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
declare const S3MultipartUploader_base: Class<any[], EventMixin, typeof EventMixin>;
|
|
589
|
+
|
|
590
|
+
declare interface S3MultipartUploaderModule {
|
|
591
|
+
S3MultipartUploader: typeof S3MultipartUploader;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
declare interface S3MultipartUploaderOptions {
|
|
595
|
+
profile?: string;
|
|
596
|
+
chunkSize: number;
|
|
597
|
+
concurrency: number;
|
|
598
|
+
routes: RoutingOptions;
|
|
599
|
+
requestHandler?: RequestHandler;
|
|
600
|
+
onProgress?: ProgressEventHandler_2;
|
|
601
|
+
ACL?: string;
|
|
602
|
+
extra?: Record<string, any>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
declare interface S3MultipartUploaderRequestOptions {
|
|
606
|
+
onProgress?: ProgressEventHandler_2;
|
|
607
|
+
filename?: string;
|
|
608
|
+
ContentType?: string;
|
|
609
|
+
ContentDisposition?: string;
|
|
610
|
+
ACL?: string;
|
|
611
|
+
extra?: Record<string, any>;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
declare class S3Uploader extends S3Uploader_base implements EventAwareInterface {
|
|
615
|
+
protected name: string;
|
|
616
|
+
options: S3UploaderGlobalOptions;
|
|
617
|
+
http?: UnicornHttpClient;
|
|
618
|
+
constructor(name: string, options?: Partial<S3UploaderGlobalOptions>);
|
|
619
|
+
getHttpClient(): Promise<{
|
|
620
|
+
axios: AxiosInstance;
|
|
621
|
+
request: <T = any, D = any>(options: AxiosRequestConfig) => Promise<AxiosResponse<T, D>>;
|
|
622
|
+
get: <T = any, D = any>(url: string, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
623
|
+
post: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
624
|
+
put: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
625
|
+
patch: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
626
|
+
delete: <T = any, D = any>(url: string, data?: any, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
627
|
+
head: <T = any, D = any>(url: string, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
628
|
+
options: <T = any, D = any>(url: string, options?: Partial<AxiosRequestConfig>) => Promise<AxiosResponse<T, D>>;
|
|
629
|
+
requestMiddleware: (callback: Parameters<AxiosInstance["interceptors"]["request"]["use"]>[0]) => number;
|
|
630
|
+
responseMiddleware: (callback: Parameters<AxiosInstance["interceptors"]["response"]["use"]>[0]) => number;
|
|
631
|
+
isCancel: isCancel;
|
|
632
|
+
AxiosError: AxiosError;
|
|
633
|
+
isAxiosError: isAxiosError;
|
|
634
|
+
}>;
|
|
635
|
+
/**
|
|
636
|
+
* Do upload.
|
|
637
|
+
*/
|
|
638
|
+
upload(file: string | File | Blob, path: string, options?: Partial<S3UploaderRequestOptions>): Promise<S3UploaderResponse>;
|
|
639
|
+
replaceExt(path: string, file: File | Blob): string;
|
|
640
|
+
on(event: 'start', handler: StartEventHandler): this;
|
|
641
|
+
on(event: 'success', handler: SuccessEventHandler): this;
|
|
642
|
+
on(event: 'end', handler: EndEventHandler): this;
|
|
643
|
+
on(event: 'upload-progress', handler: UploadProgressEventHandler): this;
|
|
644
|
+
on(event: 'progress', handler: ProgressEventHandler): this;
|
|
645
|
+
onStart(handler: StartEventHandler): this;
|
|
646
|
+
onSuccess(handler: SuccessEventHandler): this;
|
|
647
|
+
onEnd(handler: EndEventHandler): this;
|
|
648
|
+
onProgress(handler: UploadProgressEventHandler): this;
|
|
649
|
+
onProgressWithTotal(handler: ProgressEventHandler): this;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
declare const S3Uploader_base: Class<any[], EventMixin, typeof EventMixin>;
|
|
653
|
+
|
|
654
|
+
declare interface S3UploaderGlobalOptions {
|
|
655
|
+
endpoint?: string;
|
|
656
|
+
subfolder?: string;
|
|
657
|
+
viewerHost?: string;
|
|
658
|
+
starts_with: any[];
|
|
659
|
+
formInputs?: {
|
|
660
|
+
acl: string;
|
|
661
|
+
bucket: string;
|
|
662
|
+
key: string;
|
|
663
|
+
Policy: string;
|
|
664
|
+
'X-Amz-Algorithm': string;
|
|
665
|
+
'X-Amz-Credential': string;
|
|
666
|
+
'X-Amz-Date': string;
|
|
667
|
+
'X-Amz-Signature': string;
|
|
668
|
+
[name: string]: any;
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
declare interface S3UploaderModule {
|
|
673
|
+
get(name: string, options?: Partial<S3UploaderGlobalOptions>): S3Uploader;
|
|
674
|
+
create(name: string, options?: Partial<S3UploaderGlobalOptions>): S3Uploader;
|
|
675
|
+
destroy(name: string): void;
|
|
676
|
+
S3Uploader: typeof S3Uploader;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
declare interface S3UploaderRequestOptions {
|
|
680
|
+
formInputs?: {
|
|
681
|
+
[name: string]: any;
|
|
682
|
+
};
|
|
683
|
+
onUploadProgress?: (e: AxiosProgressEvent) => void;
|
|
684
|
+
'Content-Type'?: string;
|
|
685
|
+
'Content-Disposition'?: string;
|
|
686
|
+
key?: string;
|
|
687
|
+
[name: string]: any;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
declare interface S3UploaderResponse extends AxiosResponse {
|
|
691
|
+
url: string;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export declare function selectAll<E extends Element = Element>(ele: string, callback?: ((ele: E) => any)): E[];
|
|
695
|
+
|
|
696
|
+
export declare function selectAll<E extends Element = Element>(ele: NodeListOf<E> | E[], callback?: ((ele: E) => any)): E[];
|
|
697
|
+
|
|
698
|
+
export declare function selectAll<E extends Element = Element>(ele: string | NodeListOf<E> | E[], callback?: ((ele: E) => any)): E[];
|
|
699
|
+
|
|
700
|
+
export declare function selectAll<E extends keyof HTMLElementTagNameMap>(ele: E, callback?: ((ele: HTMLElementTagNameMap[E]) => any)): HTMLElementTagNameMap[E][];
|
|
701
|
+
|
|
702
|
+
export declare function selectOne<K extends keyof HTMLElementTagNameMap>(ele: K): HTMLElementTagNameMap[K] | null;
|
|
703
|
+
|
|
704
|
+
export declare function selectOne<E extends Element = Element>(ele: string): E | null;
|
|
705
|
+
|
|
706
|
+
export declare function selectOne<E extends Element = Element>(ele: E): E;
|
|
707
|
+
|
|
708
|
+
export declare function selectOne<E extends Element = Element>(ele: string | E): E | null;
|
|
709
|
+
|
|
710
|
+
export declare function serial(): number;
|
|
711
|
+
|
|
712
|
+
declare class ShowOn {
|
|
713
|
+
el: HTMLElement;
|
|
714
|
+
input: HTMLInputTypes;
|
|
715
|
+
conditions: Conditions;
|
|
716
|
+
targets: {};
|
|
717
|
+
defaultReadonly: boolean;
|
|
718
|
+
initialDisplay: string;
|
|
719
|
+
constructor(el: HTMLElement, conditions: Conditions);
|
|
720
|
+
init(): void;
|
|
721
|
+
updateShowState(target: HTMLElement, value: any, duration?: number): void;
|
|
722
|
+
isValueMatched(target: HTMLElement, value: any): boolean;
|
|
723
|
+
/**
|
|
724
|
+
* @see https://github.com/nickjackson/val/blob/master/index.js#L55
|
|
725
|
+
* @param el
|
|
726
|
+
* @returns {string}
|
|
727
|
+
*/
|
|
728
|
+
nodeType(el: HTMLElement): "select" | "textarea" | "checkbox" | "input" | "radio";
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
declare interface ShowOnModule {
|
|
732
|
+
ShowOn: typeof ShowOn;
|
|
733
|
+
ready: typeof ready_5;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export { simpleAlert }
|
|
737
|
+
|
|
738
|
+
export { simpleConfirm }
|
|
739
|
+
|
|
740
|
+
declare class SingleImageDragElement extends HTMLElement {
|
|
741
|
+
static is: string;
|
|
742
|
+
currentImage: string;
|
|
743
|
+
currentFile: File | undefined;
|
|
744
|
+
lastZoom: number;
|
|
745
|
+
valueBackup: string;
|
|
746
|
+
private options;
|
|
747
|
+
private valueInput;
|
|
748
|
+
private fileInput;
|
|
749
|
+
private selectButton;
|
|
750
|
+
private pasteButton;
|
|
751
|
+
private dragarea;
|
|
752
|
+
private previewImage;
|
|
753
|
+
private removeCheckbox;
|
|
754
|
+
private modalElement;
|
|
755
|
+
private modal;
|
|
756
|
+
private cropContainer;
|
|
757
|
+
private savebutton;
|
|
758
|
+
private modalToolbarButtons;
|
|
759
|
+
private cropper;
|
|
760
|
+
constructor();
|
|
761
|
+
connectedCallback(): void;
|
|
762
|
+
bindEvents(): void;
|
|
763
|
+
getInputAccept(): string;
|
|
764
|
+
handleFileSelect(file: File): void;
|
|
765
|
+
saveCropped(): Promise<void>;
|
|
766
|
+
getCropper(): Promise<default_2>;
|
|
767
|
+
toolbarClicked(button: HTMLButtonElement, event: MouseEvent): Promise<void>;
|
|
768
|
+
checkFile(file: File): boolean;
|
|
769
|
+
compareMimeType(accept: string, mime: string): boolean;
|
|
770
|
+
checkSize(image: HTMLImageElement): boolean;
|
|
771
|
+
alert(title: string, text?: string, type?: string): Promise<void>;
|
|
772
|
+
saveImage(file: File): Promise<void>;
|
|
773
|
+
uploadImage(file: File): Promise<AxiosResponse<ApiReturn<{
|
|
774
|
+
url: string;
|
|
775
|
+
}>, any, {}>>;
|
|
776
|
+
storeValue(url: string, preview: string): void;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
declare interface SingleImageDragModule {
|
|
780
|
+
SingleImageDragElement: typeof SingleImageDragElement;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export { sleep }
|
|
784
|
+
|
|
785
|
+
export declare function slideDown(target: string | HTMLElement, duration?: number, display?: string): Promise<Animation | void>;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* slideToggle
|
|
789
|
+
*/
|
|
790
|
+
export declare function slideToggle(target: string | HTMLElement, duration?: number, display?: string): Promise<Animation | void>;
|
|
791
|
+
|
|
792
|
+
export declare function slideUp(target: string | HTMLElement, duration?: number): Promise<Animation | void>;
|
|
793
|
+
|
|
794
|
+
declare type StartEventHandler = (fileData: FormData) => void;
|
|
795
|
+
|
|
796
|
+
declare type SuccessEventHandler = (url: string, res: S3UploaderResponse) => void;
|
|
797
|
+
|
|
798
|
+
export declare function throttle<T extends Function = Function>(handler: T, wait?: number): T;
|
|
799
|
+
|
|
800
|
+
export { tid }
|
|
801
|
+
|
|
802
|
+
declare class TinymceController {
|
|
803
|
+
protected tinymce: TinyMCE;
|
|
804
|
+
element: HTMLElement;
|
|
805
|
+
editor?: Editor;
|
|
806
|
+
options: Record<string, any>;
|
|
807
|
+
constructor(tinymce: TinyMCE, element: HTMLElement, options: Record<string, any>);
|
|
808
|
+
prepareOptions(options: Record<string, any>, version?: string): Record<string, any>;
|
|
809
|
+
insert(text: string): void;
|
|
810
|
+
getValue(): string;
|
|
811
|
+
setValue(text: string): void;
|
|
812
|
+
imageUploadHandler(blobInfo: UploadHandlerParams[0], progress: UploadHandlerParams[1]): Promise<any>;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
declare interface TinymceModule {
|
|
816
|
+
get: typeof get;
|
|
817
|
+
destroy: typeof destroy;
|
|
818
|
+
addHook: typeof addHook;
|
|
819
|
+
clearHooks: typeof clearHooks;
|
|
820
|
+
TinymceController: typeof TinymceController;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
export declare function trans(id: string, ...args: any[]): string;
|
|
824
|
+
|
|
825
|
+
declare class UIBootstrap5 implements UIThemeInterface {
|
|
826
|
+
static instance: UIBootstrap5 | null;
|
|
827
|
+
bootstrap: typeof bootstrap_2;
|
|
828
|
+
static get(): UIBootstrap5;
|
|
829
|
+
renderMessage(messages: string | string[], type?: string): void;
|
|
830
|
+
clearMessages(): void;
|
|
831
|
+
keepTab(): Promise<KeepTabModule>;
|
|
832
|
+
keepTab(selector?: string | HTMLElement, options?: KeepTabOptions): Promise<KeepTab>;
|
|
833
|
+
buttonRadio(): Promise<ButtonRadioModule>;
|
|
834
|
+
buttonRadio(selector?: string | HTMLElement, options?: ButtonRadioOptions): Promise<ButtonRadio>;
|
|
835
|
+
tooltip(selector?: NodeListOf<Element> | Element | string, config?: Partial<Tooltip.Options>): Tooltip[];
|
|
836
|
+
protected selectAsArray(selector: NodeListOf<Element> | Element | string): Element[];
|
|
837
|
+
getMajorVersion(module: any): number;
|
|
838
|
+
pushBootstrapToGlobal(): void;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
export { uid }
|
|
842
|
+
|
|
843
|
+
declare interface UIThemeInterface {
|
|
844
|
+
renderMessage(messages: string | string[], type?: string): void;
|
|
845
|
+
clearMessages(): void;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export declare interface UnicornApp extends EventAwareInterface {
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export declare class UnicornApp extends UnicornApp_base implements EventAwareInterface {
|
|
852
|
+
registry: Map<any, any>;
|
|
853
|
+
plugins: Map<any, any>;
|
|
854
|
+
waits: Promise<any>[];
|
|
855
|
+
options: Record<string, any>;
|
|
856
|
+
defaultOptions: Record<string, any>;
|
|
857
|
+
domready: typeof domready;
|
|
858
|
+
data: typeof data;
|
|
859
|
+
constructor(options?: {});
|
|
860
|
+
use(plugin: UnicornPlugin, options?: Record<string, any>): this;
|
|
861
|
+
detach(plugin: any): this;
|
|
862
|
+
inject<T>(id: InjectionKey<T>): T;
|
|
863
|
+
inject<T>(id: InjectionKey<T>, def: T): T;
|
|
864
|
+
inject<T>(id: InjectionKey<T>, def?: T): T;
|
|
865
|
+
provide<T>(id: InjectionKey<T>, value: any): this;
|
|
866
|
+
wait(callback: Function): Promise<any>;
|
|
867
|
+
completed(): Promise<any[]>;
|
|
868
|
+
macro(name: string, callback: Function): this;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
declare const UnicornApp_base: Class<any[], EventMixin, typeof EventMixin>;
|
|
872
|
+
|
|
873
|
+
export declare class UnicornAssetUri {
|
|
874
|
+
static instance: UnicornAssetUri;
|
|
875
|
+
static get(): UnicornAssetUri;
|
|
876
|
+
path(path?: string): string;
|
|
877
|
+
root(path?: string): string;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
declare class UnicornFieldValidation {
|
|
881
|
+
protected el: HTMLElement;
|
|
882
|
+
$input: InputElements | undefined;
|
|
883
|
+
options: FieldValidationOptions;
|
|
884
|
+
static is: string;
|
|
885
|
+
constructor(el: HTMLElement, options?: Partial<FieldValidationOptions>);
|
|
886
|
+
mergeOptions(options: Partial<FieldValidationOptions>): FieldValidationOptions;
|
|
887
|
+
get $form(): HTMLFormElement;
|
|
888
|
+
get errorSelector(): string;
|
|
889
|
+
get selector(): string;
|
|
890
|
+
get validClass(): string;
|
|
891
|
+
get invalidClass(): string;
|
|
892
|
+
get isVisible(): boolean;
|
|
893
|
+
get isInputOptions(): boolean;
|
|
894
|
+
get validationMessage(): string;
|
|
895
|
+
get validity(): ValidityState | undefined;
|
|
896
|
+
selectInput(): InputElements | undefined;
|
|
897
|
+
init(): void;
|
|
898
|
+
bindEvents(): void;
|
|
899
|
+
prepareWrapper(): void;
|
|
900
|
+
checkValidity(): boolean;
|
|
901
|
+
runCustomValidity(): boolean;
|
|
902
|
+
checkValidityAsync(): Promise<boolean>;
|
|
903
|
+
runCustomValidityAsync(): Promise<boolean>;
|
|
904
|
+
checkCustomDataAttributeValidity(): boolean;
|
|
905
|
+
checkInputOptionsValidity(): boolean;
|
|
906
|
+
/**
|
|
907
|
+
* @param valid {boolean}
|
|
908
|
+
*/
|
|
909
|
+
updateValidClass(valid: Boolean): void;
|
|
910
|
+
getFormValidation(element?: Nullable<HTMLFormElement>): UnicornFormValidation | null;
|
|
911
|
+
getValidator(name: string): [Validator, Record<string, any>] | null;
|
|
912
|
+
handleCustomResult(result: boolean | string | undefined, validator?: Nullable<Validator>): boolean;
|
|
913
|
+
handleAsyncCustomResult(result: boolean, validator?: Nullable<Validator>): boolean;
|
|
914
|
+
raiseCustomErrorState(validator: Validator): void;
|
|
915
|
+
setAsInvalidAndReport(error: string): void;
|
|
916
|
+
setCustomValidity(error: string): void;
|
|
917
|
+
reportValidity(): void;
|
|
918
|
+
showInvalidResponse(): void;
|
|
919
|
+
getErrorElement(): Element | null;
|
|
920
|
+
createHelpElement(): HTMLElement;
|
|
921
|
+
/**
|
|
922
|
+
* @see https://stackoverflow.com/a/17888178
|
|
923
|
+
*/
|
|
924
|
+
parseSelector(subselector: string): {
|
|
925
|
+
tags: string[];
|
|
926
|
+
classes: string[];
|
|
927
|
+
ids: string[];
|
|
928
|
+
attrs: string[][];
|
|
929
|
+
};
|
|
930
|
+
setAsValidAndClearResponse(): void;
|
|
931
|
+
clearInvalidResponse(): void;
|
|
932
|
+
getForm(): HTMLFormElement;
|
|
933
|
+
findLabel(): Element | null;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
declare class UnicornFormElement {
|
|
937
|
+
element: HTMLFormElement | undefined;
|
|
938
|
+
options: Record<string, any>;
|
|
939
|
+
constructor(selector?: string | Element, element?: HTMLFormElement, options?: Record<string, any>);
|
|
940
|
+
initComponent(store?: string, custom?: {}): Promise<Alpine_2>;
|
|
941
|
+
useState(custom?: {}): Record<string, any>;
|
|
942
|
+
getElement(): HTMLFormElement | undefined;
|
|
943
|
+
submit(url?: Nullable<string>, data?: Nullable<Record<string, any>>, method?: Nullable<string>, customMethod?: Nullable<string>): boolean;
|
|
944
|
+
injectInput(name: string, value: any): HTMLInputElement;
|
|
945
|
+
/**
|
|
946
|
+
* Make a GET request.
|
|
947
|
+
*/
|
|
948
|
+
get(url?: Nullable<string>, data?: Nullable<Record<string, any>>, customMethod?: Nullable<string>): boolean;
|
|
949
|
+
/**
|
|
950
|
+
* Post form.
|
|
951
|
+
*/
|
|
952
|
+
post(url?: Nullable<string>, data?: Nullable<Record<string, any>>, customMethod?: Nullable<string>): boolean;
|
|
953
|
+
/**
|
|
954
|
+
* Make a PUT request.
|
|
955
|
+
*/
|
|
956
|
+
put(url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
957
|
+
/**
|
|
958
|
+
* Make a PATCH request.
|
|
959
|
+
*/
|
|
960
|
+
patch(url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
961
|
+
/**
|
|
962
|
+
* Make a DELETE request.
|
|
963
|
+
*/
|
|
964
|
+
delete(url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
965
|
+
/**
|
|
966
|
+
* @see https://stackoverflow.com/a/53739792
|
|
967
|
+
*
|
|
968
|
+
* @param {Object} ob
|
|
969
|
+
* @returns {Object}
|
|
970
|
+
*/
|
|
971
|
+
static flattenObject(ob: Record<string, any>): Record<string, any>;
|
|
972
|
+
static buildFieldName(field: string): string;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
declare class UnicornFormValidation {
|
|
976
|
+
presetFields: HTMLElement[];
|
|
977
|
+
static globalValidators: Record<string, Validator>;
|
|
978
|
+
validators: Record<string, Validator>;
|
|
979
|
+
options: FormValidationOptions;
|
|
980
|
+
$form: HTMLElement;
|
|
981
|
+
static is: string;
|
|
982
|
+
constructor(el: HTMLElement, options?: Partial<FormValidationOptions>);
|
|
983
|
+
mergeOptions(options: Partial<FormValidationOptions>): FormValidationOptions;
|
|
984
|
+
get scrollEnabled(): boolean;
|
|
985
|
+
get scrollOffset(): number;
|
|
986
|
+
get fieldSelector(): string;
|
|
987
|
+
get validatedClass(): string;
|
|
988
|
+
init(): void;
|
|
989
|
+
findDOMFields(): HTMLElement[];
|
|
990
|
+
prepareFields(inputs: HTMLElement[]): Promise<void>;
|
|
991
|
+
prepareFieldWrapper(input: HTMLElement): HTMLElement | null;
|
|
992
|
+
findFields(containsPresets?: boolean): HTMLElement[];
|
|
993
|
+
getFieldComponent(input: HTMLElement): UnicornFieldValidation | null;
|
|
994
|
+
validateAll(fields?: Nullable<HTMLElement[]>): boolean;
|
|
995
|
+
validateAllAsync(fields?: Nullable<HTMLElement[]>): Promise<boolean>;
|
|
996
|
+
scrollTo(element: HTMLElement): void;
|
|
997
|
+
markFormAsValidated(): void;
|
|
998
|
+
markFormAsUnvalidated(): void;
|
|
999
|
+
addField(field: HTMLElement): this;
|
|
1000
|
+
registerDefaultValidators(): void;
|
|
1001
|
+
/**
|
|
1002
|
+
* Add validator handler.
|
|
1003
|
+
*/
|
|
1004
|
+
addValidator(name: string, handler: ValidationHandler, options?: Record<string, any>): this;
|
|
1005
|
+
/**
|
|
1006
|
+
* Add validator handler.
|
|
1007
|
+
*/
|
|
1008
|
+
static addGlobalValidator(name: string, handler: ValidationHandler, options?: Record<string, any>): typeof UnicornFormValidation;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
declare class UnicornGridElement {
|
|
1012
|
+
element: HTMLElement;
|
|
1013
|
+
form: UnicornFormElement;
|
|
1014
|
+
options: Record<string, any>;
|
|
1015
|
+
ordering: string;
|
|
1016
|
+
state: {};
|
|
1017
|
+
constructor(selector: string, element: HTMLElement, form: UnicornFormElement, options?: Record<string, any>);
|
|
1018
|
+
bindEvents(): void;
|
|
1019
|
+
initComponent(store?: string, custom?: Record<string, string>): Promise<Alpine_2>;
|
|
1020
|
+
useState(this: any, custom?: Record<string, any>): Partial<Record<string, any>> & Record<string, any>;
|
|
1021
|
+
getElement(): HTMLElement;
|
|
1022
|
+
sendFilter($event?: Event, method?: string): void;
|
|
1023
|
+
clearFilters(element: HTMLElement, method?: Nullable<string>): void;
|
|
1024
|
+
toggleFilters(open: boolean, filterForm: HTMLElement): Promise<void>;
|
|
1025
|
+
sort($el: HTMLElement): boolean;
|
|
1026
|
+
/**
|
|
1027
|
+
* Sort two items.
|
|
1028
|
+
*/
|
|
1029
|
+
sortBy(ordering: Nullable<string>): boolean;
|
|
1030
|
+
isSortActive($el: HTMLElement): boolean;
|
|
1031
|
+
getDirection($el: HTMLElement): "ASC" | "DESC" | null;
|
|
1032
|
+
orderingEquals(a: Nullable<string>, b: Nullable<string>): boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* Check a row's checkbox.
|
|
1035
|
+
*/
|
|
1036
|
+
checkRow(row: number, value?: boolean): void;
|
|
1037
|
+
getCheckboxByRow(row: number): Nullable<HTMLInputElement>;
|
|
1038
|
+
/**
|
|
1039
|
+
* Update a row.
|
|
1040
|
+
*/
|
|
1041
|
+
updateRow(row: number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1042
|
+
/**
|
|
1043
|
+
* Update an item by id.
|
|
1044
|
+
*/
|
|
1045
|
+
updateItem(id: string | number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1046
|
+
/**
|
|
1047
|
+
* Update a item with batch task.
|
|
1048
|
+
*/
|
|
1049
|
+
updateItemByTask(task: string, id: string | number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1050
|
+
/**
|
|
1051
|
+
* @deprecated Use updateItemByTask() instead.
|
|
1052
|
+
*/
|
|
1053
|
+
doTask(task: string, id: number | string, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1054
|
+
/**
|
|
1055
|
+
* Update a row with batch task.
|
|
1056
|
+
*/
|
|
1057
|
+
updateRowByTask(task: string, row: number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1058
|
+
/**
|
|
1059
|
+
* Batch update items.
|
|
1060
|
+
*/
|
|
1061
|
+
updateListByTask(task: string, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1062
|
+
/**
|
|
1063
|
+
* Copy a row.
|
|
1064
|
+
*/
|
|
1065
|
+
copyItem(id: string | number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1066
|
+
/**
|
|
1067
|
+
* Copy a row.
|
|
1068
|
+
*/
|
|
1069
|
+
copyRow(row: number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1070
|
+
/**
|
|
1071
|
+
* Delete checked items.
|
|
1072
|
+
*/
|
|
1073
|
+
deleteList(message?: Nullable<string> | false, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1074
|
+
/**
|
|
1075
|
+
* Delete an item by row.
|
|
1076
|
+
*/
|
|
1077
|
+
deleteRow(row: number, msg?: Nullable<string>, url?: Nullable<string>, data?: Nullable<Record<string, any>>): Promise<boolean>;
|
|
1078
|
+
/**
|
|
1079
|
+
* Delete an item.
|
|
1080
|
+
*/
|
|
1081
|
+
deleteItem(id: string, msg?: Nullable<string>, url?: Nullable<string>, data?: Nullable<Record<string, any>>): Promise<boolean>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Toggle all checkboxes.
|
|
1084
|
+
*/
|
|
1085
|
+
toggleAll(value: boolean): this;
|
|
1086
|
+
disableAllCheckboxes(): void;
|
|
1087
|
+
/**
|
|
1088
|
+
* Count checked checkboxes.
|
|
1089
|
+
*/
|
|
1090
|
+
countChecked(): number;
|
|
1091
|
+
/**
|
|
1092
|
+
* Get Checked boxes.
|
|
1093
|
+
*/
|
|
1094
|
+
getChecked(): HTMLInputElement[];
|
|
1095
|
+
getCheckedValues(): string[];
|
|
1096
|
+
/**
|
|
1097
|
+
* Validate there has one or more checked boxes.
|
|
1098
|
+
*/
|
|
1099
|
+
validateChecked(event?: Event, callback?: (grid: UnicornGridElement) => any, msg?: string): this;
|
|
1100
|
+
hasChecked(): boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Reorder all.
|
|
1103
|
+
*/
|
|
1104
|
+
reorderAll(url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Reorder items.
|
|
1107
|
+
*/
|
|
1108
|
+
moveItem(id: number | string, delta: number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1109
|
+
moveUp(id: string | number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1110
|
+
moveDown(id: string | number, url?: Nullable<string>, data?: Nullable<Record<string, any>>): boolean;
|
|
1111
|
+
getId(suffix?: string): string;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
declare type UnicornHttpClient = ReturnType<typeof createHttpClient>;
|
|
1115
|
+
|
|
1116
|
+
declare class UnicornLang {
|
|
1117
|
+
/**
|
|
1118
|
+
* Translate a string.
|
|
1119
|
+
*/
|
|
1120
|
+
trans(id: string, ...args: any[]): string;
|
|
1121
|
+
protected replace(str: string, args: any[]): string;
|
|
1122
|
+
/**
|
|
1123
|
+
* Find text.
|
|
1124
|
+
*/
|
|
1125
|
+
get(id: string): string | null;
|
|
1126
|
+
/**
|
|
1127
|
+
* Has language key.
|
|
1128
|
+
*/
|
|
1129
|
+
has(key: string): boolean;
|
|
1130
|
+
/**
|
|
1131
|
+
* Add language key.
|
|
1132
|
+
*/
|
|
1133
|
+
add(key: string, value: string): this;
|
|
1134
|
+
/**
|
|
1135
|
+
* Replace all symbols to dot(.).
|
|
1136
|
+
*/
|
|
1137
|
+
protected normalize(text: string): string;
|
|
1138
|
+
protected wrapDebug(text: string, success: boolean): string;
|
|
1139
|
+
getStrings(): Record<string, string>;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export declare class UnicornPhpAdapter {
|
|
1143
|
+
static install(app: UnicornApp): void;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
declare interface UnicornPlugin {
|
|
1147
|
+
install?(app: UnicornApp, options?: Record<string, any>): void;
|
|
1148
|
+
uninstall?(app: UnicornApp): void;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
export declare class UnicornSystemUri extends URL {
|
|
1152
|
+
static instance: UnicornSystemUri;
|
|
1153
|
+
static get(): UnicornSystemUri;
|
|
1154
|
+
path(path?: string): string;
|
|
1155
|
+
root(path?: string): string;
|
|
1156
|
+
current(): string;
|
|
1157
|
+
full(): string;
|
|
1158
|
+
route(): string;
|
|
1159
|
+
script(): string;
|
|
1160
|
+
routeWithQuery(): string;
|
|
1161
|
+
routeAndQuery(): string[];
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
export declare class UnicornUI {
|
|
1165
|
+
theme?: any;
|
|
1166
|
+
aliveHandle?: any;
|
|
1167
|
+
static get defaultOptions(): {
|
|
1168
|
+
messageSelector: string;
|
|
1169
|
+
};
|
|
1170
|
+
installTheme(theme: any): void;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
declare type UploadHandlerParams = Parameters<NonNullable<EditorOptions['images_upload_handler']>>;
|
|
1174
|
+
|
|
1175
|
+
declare type UploadProgressEventHandler = (e: AxiosProgressEvent) => void;
|
|
1176
|
+
|
|
1177
|
+
declare type UriTypes = 'full' | 'path' | 'root' | 'current' | 'route' | 'script';
|
|
1178
|
+
|
|
1179
|
+
export declare function useAssetUri(): UnicornAssetUri;
|
|
1180
|
+
|
|
1181
|
+
export declare function useAssetUri(type?: AssetTypes, path?: string): string;
|
|
1182
|
+
|
|
1183
|
+
export declare const useBs5ButtonRadio: typeof UIBootstrap5.prototype.buttonRadio;
|
|
1184
|
+
|
|
1185
|
+
export declare const useBs5KeepTab: typeof UIBootstrap5.prototype.keepTab;
|
|
1186
|
+
|
|
1187
|
+
export declare function useBs5Tooltip(selector?: NodeListOf<Element> | Element | string, config?: Partial<Tooltip.Options>): Promise<Tooltip[]>;
|
|
1188
|
+
|
|
1189
|
+
export declare function useCheckboxesMultiSelect(): Promise<any>;
|
|
1190
|
+
|
|
1191
|
+
export declare function useCheckboxesMultiSelect(selector?: Nullable<string | HTMLElement>, options?: Record<string, any>): Promise<CheckboxesMultiSelect>;
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Color Picker.
|
|
1195
|
+
*/
|
|
1196
|
+
export declare function useColorPicker(selector?: Nullable<string | HTMLElement | NodeListOf<HTMLElement>>, options?: Partial<SpectrumOptions>): Promise<any>;
|
|
1197
|
+
|
|
1198
|
+
export declare function useCssImport(...hrefs: string[]): Promise<CSSStyleSheet[]>;
|
|
1199
|
+
|
|
1200
|
+
export declare function useCssIncludes(...hrefs: string[]): Promise<void[]>;
|
|
1201
|
+
|
|
1202
|
+
export declare function useDisableIfStackNotEmpty(buttonSelector?: string, stackName?: string): void;
|
|
1203
|
+
|
|
1204
|
+
export declare function useDisableOnSubmit(formSelector?: string | HTMLFormElement, buttonSelector?: string, options?: Record<string, any>): void;
|
|
1205
|
+
|
|
1206
|
+
export declare function useFieldCascadeSelect(): Promise<CascadeSelectModule>;
|
|
1207
|
+
|
|
1208
|
+
export declare function useFieldFileDrag(): Promise<FileDragModule>;
|
|
1209
|
+
|
|
1210
|
+
export declare function useFieldFlatpickr(): Promise<any>;
|
|
1211
|
+
|
|
1212
|
+
export declare function useFieldModalSelect(): Promise<ModalSelectModule>;
|
|
1213
|
+
|
|
1214
|
+
export declare function useFieldModalTree(): void;
|
|
1215
|
+
|
|
1216
|
+
declare function useFieldMultiUploader(): Promise<void>;
|
|
1217
|
+
|
|
1218
|
+
export declare function useFieldRepeatable(): Promise<RepeatableModule>;
|
|
1219
|
+
|
|
1220
|
+
export declare function useFieldSingleImageDrag(): Promise<SingleImageDragModule>;
|
|
1221
|
+
|
|
1222
|
+
export declare function useFieldValidationSync(selector: string | Element): UnicornFieldValidation | null;
|
|
1223
|
+
|
|
1224
|
+
export declare function useForm(): UnicornFormElement;
|
|
1225
|
+
|
|
1226
|
+
export declare function useForm(ele?: string | Element, options?: Record<string, any>): UnicornFormElement | null;
|
|
1227
|
+
|
|
1228
|
+
export declare function useFormAsync(): Promise<UnicornFormElement>;
|
|
1229
|
+
|
|
1230
|
+
export declare function useFormAsync(ele?: string | Element, options?: Record<string, any>): Promise<UnicornFormElement | null>;
|
|
1231
|
+
|
|
1232
|
+
export declare function useFormComponent(ele?: string | Element, options?: Record<string, any>): Promise<UnicornFormElement | null>;
|
|
1233
|
+
|
|
1234
|
+
export declare function useFormValidation(): Promise<ValidationModule>;
|
|
1235
|
+
|
|
1236
|
+
export declare function useFormValidation(selector: string | Element): Promise<UnicornFormValidation | null>;
|
|
1237
|
+
|
|
1238
|
+
export declare function useFormValidationSync(selector: string | Element): UnicornFormValidation | null;
|
|
1239
|
+
|
|
1240
|
+
export declare function useGrid(ele: string | HTMLElement, options?: Record<string, any> | undefined): UnicornGridElement | null;
|
|
1241
|
+
|
|
1242
|
+
export declare function useGridAsync(ele?: string | HTMLElement, options?: Record<string, any> | undefined): Promise<UnicornGridElement | null>;
|
|
1243
|
+
|
|
1244
|
+
export declare function useGridComponent(ele: string | HTMLElement, options?: Record<string, any> | undefined): Promise<UnicornGridElement | null>;
|
|
1245
|
+
|
|
1246
|
+
export declare function useHttpClient(config?: CreateAxiosDefaults | AxiosInstance): Promise<UnicornHttpClient>;
|
|
1247
|
+
|
|
1248
|
+
export declare function useIframeModal(): Promise<IframeModalModule>;
|
|
1249
|
+
|
|
1250
|
+
export declare function useImport(...src: any[]): Promise<any>;
|
|
1251
|
+
|
|
1252
|
+
export declare function useImport<T extends any[]>(...src: string[]): Promise<T>;
|
|
1253
|
+
|
|
1254
|
+
export declare function useImport<T = any>(src: string): Promise<{
|
|
1255
|
+
default: T;
|
|
1256
|
+
}>;
|
|
1257
|
+
|
|
1258
|
+
export declare function useImport<D = any, C = any>(src: string): Promise<{
|
|
1259
|
+
default: D;
|
|
1260
|
+
} & Dictionary<C>>;
|
|
1261
|
+
|
|
1262
|
+
export declare const useInject: typeof UnicornApp.prototype.inject;
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* Keep alive.
|
|
1266
|
+
*/
|
|
1267
|
+
export declare function useKeepAlive(url: string, time?: number): () => void;
|
|
1268
|
+
|
|
1269
|
+
export declare function useLang(): UnicornLang;
|
|
1270
|
+
|
|
1271
|
+
export declare function useLegacy(app?: UnicornApp): Promise<UnicornApp>;
|
|
1272
|
+
|
|
1273
|
+
export declare function useListDependent(): Promise<ListDependentModule>;
|
|
1274
|
+
|
|
1275
|
+
export declare function useListDependent(element: string | HTMLSelectElement, dependent?: Nullable<string | HTMLSelectElement>, options?: Partial<ListDependentOptions>): Promise<ListDependent>;
|
|
1276
|
+
|
|
1277
|
+
export declare function useMacro(name: string, handler: (...args: any[]) => any): void;
|
|
1278
|
+
|
|
1279
|
+
export declare function useQueue(name?: string, maxRunning?: number): TaskQueue;
|
|
1280
|
+
|
|
1281
|
+
export declare function useS3MultipartUploader(): Promise<S3MultipartUploaderModule>;
|
|
1282
|
+
|
|
1283
|
+
export declare function useS3MultipartUploader(options: Partial<S3MultipartUploaderOptions>): Promise<S3MultipartUploader>;
|
|
1284
|
+
|
|
1285
|
+
export declare function useS3Uploader(): Promise<S3UploaderModule>;
|
|
1286
|
+
|
|
1287
|
+
export declare function useS3Uploader(name: string, options?: Partial<S3UploaderGlobalOptions>): Promise<S3Uploader>;
|
|
1288
|
+
|
|
1289
|
+
export declare function useScriptImport(src: string, attrs?: Record<string, string>): Promise<void>;
|
|
1290
|
+
|
|
1291
|
+
export declare function useSeriesImport(...src: any[]): Promise<any>;
|
|
1292
|
+
|
|
1293
|
+
export declare function useSeriesImport<T extends any[]>(...src: string[]): Promise<T>;
|
|
1294
|
+
|
|
1295
|
+
export declare function useSeriesImport<T = any>(src: string): Promise<{
|
|
1296
|
+
default: T;
|
|
1297
|
+
}>;
|
|
1298
|
+
|
|
1299
|
+
export declare function useSeriesImport<D = any, C = any>(src: string): Promise<{
|
|
1300
|
+
default: D;
|
|
1301
|
+
} & Dictionary<C>>;
|
|
1302
|
+
|
|
1303
|
+
export declare function useShowOn(): Promise<ShowOnModule>;
|
|
1304
|
+
|
|
1305
|
+
export declare function useStack<T = any>(name?: string, store?: any[]): Stack<T>;
|
|
1306
|
+
|
|
1307
|
+
export declare function useSystemUri(): UnicornSystemUri;
|
|
1308
|
+
|
|
1309
|
+
export declare function useSystemUri(type: UriTypes): string;
|
|
1310
|
+
|
|
1311
|
+
declare function useTinymce(): Promise<TinymceModule>;
|
|
1312
|
+
|
|
1313
|
+
declare function useTinymce(selector?: string, options?: Record<string, any>): Promise<TinymceController>;
|
|
1314
|
+
|
|
1315
|
+
/**
|
|
1316
|
+
* @see https://tom-select.js.org/
|
|
1317
|
+
*/
|
|
1318
|
+
export declare function useTomSelect(selector?: Nullable<string | HTMLElement | NodeListOf<HTMLElement>>, options?: Record<string, any>, theme?: string): Promise<any>;
|
|
1319
|
+
|
|
1320
|
+
export declare function useUI(instance?: UnicornUI): UnicornUI;
|
|
1321
|
+
|
|
1322
|
+
export declare function useUIBootstrap5(install?: boolean, pushToGlobal?: boolean): Promise<UIBootstrap5>;
|
|
1323
|
+
|
|
1324
|
+
export declare function useUITheme<T extends UIThemeInterface>(theme?: T | Constructor<T>): T;
|
|
1325
|
+
|
|
1326
|
+
export declare function useUnicorn(instance?: UnicornApp): UnicornApp;
|
|
1327
|
+
|
|
1328
|
+
export declare function useUnicornPhpAdapter(app?: UnicornApp): {
|
|
1329
|
+
repeatable: typeof useFieldRepeatable;
|
|
1330
|
+
flatpickr: typeof useFieldFlatpickr;
|
|
1331
|
+
fileDrag: typeof useFieldFileDrag;
|
|
1332
|
+
modalField: typeof useFieldModalSelect;
|
|
1333
|
+
cascadeSelect: typeof useFieldCascadeSelect;
|
|
1334
|
+
sid: typeof useFieldSingleImageDrag;
|
|
1335
|
+
tinymce: {
|
|
1336
|
+
init: typeof useTinymce;
|
|
1337
|
+
};
|
|
1338
|
+
s3Uploader: typeof useS3Uploader;
|
|
1339
|
+
iframeModal: typeof useIframeModal;
|
|
1340
|
+
initShowOn: typeof useShowOn;
|
|
1341
|
+
modalTree: typeof useFieldModalTree;
|
|
1342
|
+
multiUploader: typeof useFieldMultiUploader;
|
|
1343
|
+
tomSelect: typeof useTomSelect;
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1346
|
+
export declare function useUniDirective<T extends Element = HTMLElement>(name: string, handler: WebDirectiveHandler<T>, wdInstance?: default_3 | string): Promise<void>;
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Vue component field.
|
|
1350
|
+
*/
|
|
1351
|
+
export declare function useVueComponentField(selector?: Nullable<string | HTMLElement>, value?: any, options?: Record<string, any>): Promise<any>;
|
|
1352
|
+
|
|
1353
|
+
export declare function useWebDirective(name?: string, options?: Partial<WebDirectiveOptions>): Promise<default_3>;
|
|
1354
|
+
|
|
1355
|
+
declare type ValidationHandler = (value: any, input: HTMLElement, options?: Record<string, any>, fv?: UnicornFieldValidation) => any;
|
|
1356
|
+
|
|
1357
|
+
declare interface ValidationModule {
|
|
1358
|
+
UnicornFormValidation: typeof UnicornFormValidation;
|
|
1359
|
+
UnicornFieldValidation: typeof UnicornFieldValidation;
|
|
1360
|
+
ready: Promise<any>;
|
|
1361
|
+
validators: typeof validatorHandlers;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
declare type Validator = {
|
|
1365
|
+
handler: ValidationHandler;
|
|
1366
|
+
options?: Record<string, any>;
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1369
|
+
declare const validatorHandlers: Record<string, ValidationHandler>;
|
|
1370
|
+
|
|
1371
|
+
export declare function wait<T extends readonly unknown[]>(...promisee: {
|
|
1372
|
+
[K in keyof T]: PromiseLike<T[K]> | T[K];
|
|
1373
|
+
}): Promise<Awaited<T>>;
|
|
1374
|
+
|
|
1375
|
+
export declare function watchAttributes<T extends HTMLElement>(el: T, callback?: AttributeMutationCallback<T>): AttributeMutationObserver<T>;
|
|
1376
|
+
|
|
1377
|
+
export { }
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
declare global {
|
|
1381
|
+
interface Node {
|
|
1382
|
+
__unicorn?: any;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
declare module '@windwalker-io/unicorn-next' {
|
|
1388
|
+
interface UnicornApp {
|
|
1389
|
+
/** @deprecated Only for code generator use. */
|
|
1390
|
+
$ui: typeof methods;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
declare global {
|
|
1396
|
+
var Alpine: AlpineGlobal;
|
|
1397
|
+
var TomSelect: typeof TomSelectGlobal;
|
|
1398
|
+
var Spectrum: typeof SpectrumGlobal;
|
|
1399
|
+
var Mark: any;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
declare global {
|
|
1403
|
+
var S: any;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
declare global {
|
|
1408
|
+
export interface Window {
|
|
1409
|
+
bootstrap: typeof bootstrap;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
declare module 'axios' {
|
|
1415
|
+
interface AxiosRequestConfig {
|
|
1416
|
+
vars?: Record<string, any>;
|
|
1417
|
+
methodSimulate?: string;
|
|
1418
|
+
methodSimulateByHeader?: boolean;
|
|
1419
|
+
}
|
|
1420
|
+
interface CreateAxiosDefaults {
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
declare global {
|
|
1426
|
+
var tinymce: TinyMCE;
|
|
1427
|
+
}
|