@schwarzdavid/ui-kit 0.0.1-alpha.2 → 0.0.1-alpha.20
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/LICENSE.md +201 -201
- package/README.md +165 -1
- package/dist/main.d.ts +365 -0
- package/dist/main.js +1394 -0
- package/dist/styles.d.ts +1 -0
- package/dist/ui-kit.css +2 -0
- package/dist/validators.d.ts +91 -0
- package/dist/validators.js +61 -0
- package/dist/vuetify/settings.scss +32 -0
- package/dist/vuetify.d.ts +31 -0
- package/dist/vuetify.js +288 -0
- package/package.json +120 -87
- package/dist/favicon.ico +0 -0
- package/dist/style.css +0 -1
- package/dist/ui-kit.d.ts +0 -150
- package/dist/ui-kit.js +0 -691
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { AllowedComponentProps } from 'vue';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
import { ComponentCustomProps } from 'vue';
|
|
4
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
5
|
+
import { ComponentProps } from 'vue-component-type-helpers';
|
|
6
|
+
import { ComponentProvideOptions } from 'vue';
|
|
7
|
+
import { DefineComponent } from 'vue';
|
|
8
|
+
import { FunctionPlugin } from 'vue';
|
|
9
|
+
import { HasRequiredKeys } from 'type-fest';
|
|
10
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
11
|
+
import { PartialDeep } from 'type-fest';
|
|
12
|
+
import { Promisable } from 'type-fest';
|
|
13
|
+
import { PublicProps } from 'vue';
|
|
14
|
+
import { Ref } from 'vue';
|
|
15
|
+
import { VNodeProps } from 'vue';
|
|
16
|
+
|
|
17
|
+
declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
18
|
+
close: () => any;
|
|
19
|
+
submit: () => any;
|
|
20
|
+
"update:modelValue": (value: boolean) => any;
|
|
21
|
+
"update:stage": (stage: SheetStage) => any;
|
|
22
|
+
opened: () => any;
|
|
23
|
+
closed: () => any;
|
|
24
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
+
onClose?: (() => any) | undefined;
|
|
26
|
+
onSubmit?: (() => any) | undefined;
|
|
27
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
28
|
+
"onUpdate:stage"?: ((stage: SheetStage) => any) | undefined;
|
|
29
|
+
onOpened?: (() => any) | undefined;
|
|
30
|
+
onClosed?: (() => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
form: boolean;
|
|
33
|
+
title: string;
|
|
34
|
+
persistent: boolean;
|
|
35
|
+
stage: SheetStage;
|
|
36
|
+
translateTitle: boolean;
|
|
37
|
+
expandable: boolean;
|
|
38
|
+
closable: boolean;
|
|
39
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
|
|
41
|
+
declare const __VLS_base_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
42
|
+
close: () => any;
|
|
43
|
+
submit: () => any;
|
|
44
|
+
"update:modelValue": (value: boolean) => any;
|
|
45
|
+
"update:stage": (stage: SheetStage) => any;
|
|
46
|
+
opened: () => any;
|
|
47
|
+
closed: () => any;
|
|
48
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
49
|
+
onClose?: (() => any) | undefined;
|
|
50
|
+
onSubmit?: (() => any) | undefined;
|
|
51
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
52
|
+
"onUpdate:stage"?: ((stage: SheetStage) => any) | undefined;
|
|
53
|
+
onOpened?: (() => any) | undefined;
|
|
54
|
+
onClosed?: (() => any) | undefined;
|
|
55
|
+
}>, {
|
|
56
|
+
width: DialogWidth;
|
|
57
|
+
form: boolean;
|
|
58
|
+
persistent: boolean;
|
|
59
|
+
stage: SheetStage;
|
|
60
|
+
translateTitle: boolean;
|
|
61
|
+
expandable: boolean;
|
|
62
|
+
closable: boolean;
|
|
63
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
|
|
65
|
+
declare const __VLS_export: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
|
|
67
|
+
declare const __VLS_export_2: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
68
|
+
|
|
69
|
+
declare const __VLS_export_3: __VLS_WithSlots_2<typeof __VLS_base_2, __VLS_Slots_2>;
|
|
70
|
+
|
|
71
|
+
declare type __VLS_Props = {
|
|
72
|
+
modelValue: boolean;
|
|
73
|
+
stage?: SheetStage;
|
|
74
|
+
title?: string;
|
|
75
|
+
translateTitle?: boolean;
|
|
76
|
+
expandable?: boolean;
|
|
77
|
+
closable?: boolean;
|
|
78
|
+
persistent?: boolean;
|
|
79
|
+
form?: boolean;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare type __VLS_Props_2 = {
|
|
83
|
+
modelValue: boolean;
|
|
84
|
+
title: string;
|
|
85
|
+
translateTitle?: boolean;
|
|
86
|
+
width?: DialogWidth;
|
|
87
|
+
closable?: boolean;
|
|
88
|
+
persistent?: boolean;
|
|
89
|
+
form?: boolean;
|
|
90
|
+
expandable?: boolean;
|
|
91
|
+
stage?: SheetStage;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
declare type __VLS_Slots = {
|
|
95
|
+
default?: () => unknown;
|
|
96
|
+
preview?: () => unknown;
|
|
97
|
+
header?: () => unknown;
|
|
98
|
+
actions?: () => unknown;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare type __VLS_Slots_2 = {
|
|
102
|
+
default?: () => unknown;
|
|
103
|
+
preview?: () => unknown;
|
|
104
|
+
header?: () => unknown;
|
|
105
|
+
actions?: () => unknown;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
declare type __VLS_WithSlots<T, S> = T & {
|
|
109
|
+
new (): {
|
|
110
|
+
$slots: S;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
declare type __VLS_WithSlots_2<T, S> = T & {
|
|
115
|
+
new (): {
|
|
116
|
+
$slots: S;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
declare interface ConfirmDialogBaseProps {
|
|
121
|
+
title: string;
|
|
122
|
+
translateTitle?: boolean;
|
|
123
|
+
confirmCta?: Partial<DialogCta>;
|
|
124
|
+
rejectCta?: Partial<DialogCta>;
|
|
125
|
+
throwOnReject?: boolean;
|
|
126
|
+
permanent?: boolean;
|
|
127
|
+
width?: DialogWidth;
|
|
128
|
+
highlightCta?: 'confirm' | 'reject' | false;
|
|
129
|
+
level?: ConfirmDialogLevel;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare type ConfirmDialogComponentContent<C extends Component = Component> = DialogProps<ComponentProps<C>> & ConfirmDialogBaseProps & {
|
|
133
|
+
component: C;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export declare enum ConfirmDialogLevel {
|
|
137
|
+
DEFAULT = "primary",
|
|
138
|
+
WARNING = "warning",
|
|
139
|
+
DANGER = "error"
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export declare type ConfirmDialogProps<C extends Component = Component> = ConfirmDialogComponentContent<C> | ConfirmDialogTextContent;
|
|
143
|
+
|
|
144
|
+
export declare interface ConfirmDialogTextContent extends ConfirmDialogBaseProps {
|
|
145
|
+
content: string;
|
|
146
|
+
translateContent?: boolean;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare interface CreateToastQueueEntry {
|
|
150
|
+
type: ToastType;
|
|
151
|
+
message: string;
|
|
152
|
+
translateMessage: boolean;
|
|
153
|
+
timeout: number | false;
|
|
154
|
+
action?: ToastAction;
|
|
155
|
+
resolve(triggered: boolean): void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export declare function createUIKit(options?: CreateUIKitOptions): FunctionPlugin<unknown[]>;
|
|
159
|
+
|
|
160
|
+
export declare type CreateUIKitOptions = PartialDeep<Omit<PluginOptions, 'components'>> & {
|
|
161
|
+
components?: {
|
|
162
|
+
dialog?: Partial<PluginDialogComponentOptions>;
|
|
163
|
+
toast?: Component;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export declare interface DialogActionCta extends DialogCta {
|
|
168
|
+
action(): unknown;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export declare interface DialogComposable {
|
|
172
|
+
info(title: string, content: string): Promise<null>;
|
|
173
|
+
info<T = void, C extends Component = Component>(options: InfoDialogProps<T, C>): Promise<T extends void ? null : (T | null)>;
|
|
174
|
+
confirm(title: string, content: string, level?: ConfirmDialogLevel): Promise<boolean>;
|
|
175
|
+
confirm<C extends Component = Component>(options: ConfirmDialogProps<C>): Promise<boolean>;
|
|
176
|
+
form<T, R = T, Required extends boolean = false, C extends Component = Component>(options: FormDialogProps<T, R, Required, C>): Promise<Required extends true ? R : R | null>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare interface DialogCta {
|
|
180
|
+
text: string;
|
|
181
|
+
translateText: boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export declare interface DialogEntryContext<Data = unknown, Value = unknown> {
|
|
185
|
+
readonly id: string;
|
|
186
|
+
readonly data: Data;
|
|
187
|
+
resolve(value: Value): void;
|
|
188
|
+
reject(reason?: unknown): void;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export declare interface DialogFormContext {
|
|
192
|
+
submit(): Promise<void>;
|
|
193
|
+
loading: Readonly<Ref<boolean>>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare type DialogFormFinish<T> = () => Promisable<T>;
|
|
197
|
+
|
|
198
|
+
declare type DialogProps<T extends object> = PropsRequired<OwnProps<T>> extends true ? {
|
|
199
|
+
props: OwnProps<T>;
|
|
200
|
+
} : {
|
|
201
|
+
props?: OwnProps<T>;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export declare interface DialogValueCta<T> extends DialogCta {
|
|
205
|
+
value: T;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export declare type DialogWidth = 'sm' | 'md' | 'lg' | number;
|
|
209
|
+
|
|
210
|
+
export declare type FormDialogAction<T, R> = (value: T) => Promise<R>;
|
|
211
|
+
|
|
212
|
+
export declare interface FormDialogBaseProps<T, R = T, Required extends boolean = false, C extends Component = Component> {
|
|
213
|
+
title: string;
|
|
214
|
+
translateTitle?: boolean;
|
|
215
|
+
width?: DialogWidth;
|
|
216
|
+
saveCta?: Partial<DialogCta>;
|
|
217
|
+
abortCta?: Partial<DialogCta>;
|
|
218
|
+
component: C;
|
|
219
|
+
initialValue?: MaybeRefOrGetter<T>;
|
|
220
|
+
action?: FormDialogAction<T, R>;
|
|
221
|
+
required?: Required;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare type FormDialogInjectedProp = 'modelValue' | 'onUpdate:modelValue' | 'toolbar';
|
|
225
|
+
|
|
226
|
+
declare type FormDialogModelCheck<T, C extends Component> = unknown extends T ? unknown : 'modelValue' extends keyof ComponentProps<C> ? [T] extends [NonNullable<ComponentProps<C>['modelValue']>] ? unknown : {
|
|
227
|
+
component: never;
|
|
228
|
+
} : unknown;
|
|
229
|
+
|
|
230
|
+
export declare type FormDialogProps<T, R = T, Required extends boolean = false, C extends Component = Component> = DialogProps<Omit<ComponentProps<C>, FormDialogInjectedProp>> & FormDialogModelCheck<T, C> & FormDialogBaseProps<T, R, Required, C>;
|
|
231
|
+
|
|
232
|
+
declare interface InfoDialogBaseProps<T> {
|
|
233
|
+
title: string;
|
|
234
|
+
translateTitle?: boolean;
|
|
235
|
+
additionalCta?: InteractiveDialogCta<T>[];
|
|
236
|
+
defaultCta?: Partial<DialogCta> | false;
|
|
237
|
+
width?: DialogWidth;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export declare type InfoDialogComponentContent<T = void, C extends Component = Component> = DialogProps<ComponentProps<C>> & InfoDialogBaseProps<T> & {
|
|
241
|
+
component: C;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export declare type InfoDialogProps<T = void, C extends Component = Component> = InfoDialogComponentContent<T, C> | InfoDialogTextContent<T>;
|
|
245
|
+
|
|
246
|
+
export declare interface InfoDialogTextContent<T> extends InfoDialogBaseProps<T> {
|
|
247
|
+
content: string;
|
|
248
|
+
translateContent?: boolean;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export declare type InteractiveDialogCta<T> = DialogActionCta | DialogValueCta<T>;
|
|
252
|
+
|
|
253
|
+
export declare type LoadingAction = (...args: never[]) => unknown;
|
|
254
|
+
|
|
255
|
+
export declare interface LoadingComposable<A extends LoadingAction> {
|
|
256
|
+
loading: Readonly<Ref<boolean>>;
|
|
257
|
+
action(...args: Parameters<A>): Promise<Awaited<ReturnType<A>>>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare type OwnProps<T extends object> = Omit<T, keyof VNodeProps | keyof AllowedComponentProps | keyof ComponentCustomProps>;
|
|
261
|
+
|
|
262
|
+
export declare interface PluginComponentOptions {
|
|
263
|
+
dialog: PluginDialogComponentOptions;
|
|
264
|
+
toast: Component;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare interface PluginDialogComponentOptions {
|
|
268
|
+
info: Component;
|
|
269
|
+
confirm: Component;
|
|
270
|
+
form: Component;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export declare interface PluginDialogOptions {
|
|
274
|
+
closeOnOverlayClick: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export declare type PluginI18nMessageKey = 'save' | 'cancel' | 'close' | 'yes' | 'no' | 'saveFailed' | 'unknownError' | 'expand' | 'collapse';
|
|
278
|
+
|
|
279
|
+
export declare interface PluginI18nOptions {
|
|
280
|
+
messages: Record<PluginI18nMessageKey, string>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare interface PluginLoadingOptions {
|
|
284
|
+
delay: number | false;
|
|
285
|
+
overlay: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export declare interface PluginOptions {
|
|
289
|
+
loading: PluginLoadingOptions;
|
|
290
|
+
toast: PluginToastOptions;
|
|
291
|
+
dialog: PluginDialogOptions;
|
|
292
|
+
i18n: PluginI18nOptions;
|
|
293
|
+
components: PluginComponentOptions;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export declare interface PluginToastOptions {
|
|
297
|
+
timeout: number;
|
|
298
|
+
errorTimeout: number | false;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
declare type PropsRequired<P extends object> = string extends keyof P ? false : HasRequiredKeys<P>;
|
|
302
|
+
|
|
303
|
+
export declare type SheetStage = 'preview' | 'content' | 'fullscreen';
|
|
304
|
+
|
|
305
|
+
export declare interface ToastAction {
|
|
306
|
+
text: string;
|
|
307
|
+
translateText?: boolean;
|
|
308
|
+
handler?: () => unknown;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export declare interface ToastComposable {
|
|
312
|
+
info: ToastFunction;
|
|
313
|
+
warn: ToastFunction;
|
|
314
|
+
error: ToastFunction;
|
|
315
|
+
success: ToastFunction;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export declare interface ToastEntryContext {
|
|
319
|
+
readonly entry: ToastEntryData;
|
|
320
|
+
close(): void;
|
|
321
|
+
trigger(): void;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export declare type ToastEntryData = Omit<ToastQueueEntry, 'resolve'>;
|
|
325
|
+
|
|
326
|
+
export declare type ToastFunction = (message: string, options?: Partial<ToastOptions>) => Promise<boolean>;
|
|
327
|
+
|
|
328
|
+
export declare interface ToastOptions {
|
|
329
|
+
timeout: number | false;
|
|
330
|
+
translateMessage: boolean;
|
|
331
|
+
action?: ToastAction;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export declare interface ToastQueueEntry extends CreateToastQueueEntry {
|
|
335
|
+
id: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export declare enum ToastType {
|
|
339
|
+
SUCCESS = "success",
|
|
340
|
+
INFO = "info",
|
|
341
|
+
WARNING = "warning",
|
|
342
|
+
ERROR = "error"
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export declare const UiBottomSheet: typeof __VLS_export_2;
|
|
346
|
+
|
|
347
|
+
export declare const UiKitOutlet: typeof __VLS_export;
|
|
348
|
+
|
|
349
|
+
export declare const UiResponsiveDialog: typeof __VLS_export_3;
|
|
350
|
+
|
|
351
|
+
export declare function useDialog(): DialogComposable;
|
|
352
|
+
|
|
353
|
+
export declare function useDialogEntry<Data, Value = unknown>(): DialogEntryContext<Data, Value>;
|
|
354
|
+
|
|
355
|
+
export declare function useDialogForm<T>(finish: DialogFormFinish<T>): DialogFormContext;
|
|
356
|
+
|
|
357
|
+
export declare function useLoading<A extends LoadingAction>(actionCallback: A, options?: Partial<PluginLoadingOptions>): LoadingComposable<A>;
|
|
358
|
+
|
|
359
|
+
export declare function useLoadingOverlay(): Ref<boolean>;
|
|
360
|
+
|
|
361
|
+
export declare function useToast(): ToastComposable;
|
|
362
|
+
|
|
363
|
+
export declare function useToastEntry(): ToastEntryContext;
|
|
364
|
+
|
|
365
|
+
export { }
|