@schwarzdavid/ui-kit 0.0.1-alpha.5 → 0.0.1-alpha.7

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.
@@ -1 +1 @@
1
- .toast-entry[data-v-59807b44]{pointer-events:all}.toast-entry[data-v-59807b44] .v-alert__prepend{align-self:center}.toast-outlet[data-v-ba5c8268]{position:fixed;z-index:9999;bottom:8px;right:8px;left:8px;display:flex;flex-direction:column;row-gap:8px;pointer-events:none}.toast-outlet--desktop[data-v-ba5c8268]{left:unset;max-width:500px;width:100%}.fade-move[data-v-ba5c8268],.fade-enter-active[data-v-ba5c8268],.fade-leave-active[data-v-ba5c8268]{transition:all .3s cubic-bezier(.4,0,.2,1)}.fade-enter-from[data-v-ba5c8268],.fade-leave-to[data-v-ba5c8268]{opacity:0;transform:translate(50%) scaleY(.5)}.fade-leave-active[data-v-ba5c8268]{position:absolute}.info-dialog-card[data-v-48bbcd24]>.v-card-text{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-card[data-v-aa6b77b6]>.v-card-item{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-toolbar-slot[data-v-aa6b77b6]{display:contents}.confirm-dialog-card[data-v-e571516e]>.v-card-text{padding-left:16px!important;padding-right:16px!important}
1
+ .toast-entry[data-v-7b5e0267]{pointer-events:all}.toast-entry[data-v-7b5e0267] .v-alert__prepend{align-self:center}.toast-outlet[data-v-ba5c8268]{position:fixed;z-index:9999;bottom:8px;right:8px;left:8px;display:flex;flex-direction:column;row-gap:8px;pointer-events:none}.toast-outlet--desktop[data-v-ba5c8268]{left:unset;max-width:500px;width:100%}.fade-move[data-v-ba5c8268],.fade-enter-active[data-v-ba5c8268],.fade-leave-active[data-v-ba5c8268]{transition:all .3s cubic-bezier(.4,0,.2,1)}.fade-enter-from[data-v-ba5c8268],.fade-leave-to[data-v-ba5c8268]{opacity:0;transform:translate(50%) scaleY(.5)}.fade-leave-active[data-v-ba5c8268]{position:absolute}.info-dialog-card[data-v-0bb08e28]>.v-card-text{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-card[data-v-6cec23a5]>.v-card-item{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-toolbar-slot[data-v-6cec23a5]{display:contents}.confirm-dialog-card[data-v-3e8b3358]>.v-card-text{padding-left:16px!important;padding-right:16px!important}
package/dist/ui-kit.d.ts CHANGED
@@ -5,18 +5,32 @@ import { ComponentProvideOptions } from 'vue';
5
5
  import { ComponentPublicInstance } from 'vue';
6
6
  import { ComputedOptions } from 'vue';
7
7
  import { DefineComponent } from 'vue';
8
+ import { EmitFn } from 'vue';
8
9
  import { FunctionPlugin } from 'vue';
10
+ import { IfEmptyObject } from 'type-fest';
9
11
  import { MaybeRefOrGetter } from 'vue';
10
12
  import { MethodOptions } from 'vue';
11
13
  import { PartialDeep } from 'type-fest';
14
+ import { Promisable } from 'type-fest';
12
15
  import { PublicProps } from 'vue';
13
16
  import { Ref } from 'vue';
17
+ import { ValidationRuleWithoutParams } from '@vuelidate/core';
18
+ import { ValidationRuleWithParams } from '@vuelidate/core';
19
+
20
+ export declare const alpha: ValidationRuleWithoutParams<any>;
21
+
22
+ export declare const alphaNum: ValidationRuleWithoutParams<any>;
23
+
24
+ export declare const between: (min: number | Ref<number>, max: number | Ref<number>) => ValidationRuleWithParams< {
25
+ min: number;
26
+ max: number;
27
+ }>;
14
28
 
15
29
  declare interface ConfirmDialogBaseProps {
16
30
  title: string;
17
31
  translateTitle?: boolean;
18
- confirmCta?: Partial<ConfirmDialogCta>;
19
- rejectCta?: Partial<ConfirmDialogCta>;
32
+ confirmCta?: Partial<DialogCta>;
33
+ rejectCta?: Partial<DialogCta>;
20
34
  throwOnReject?: boolean;
21
35
  permanent?: boolean;
22
36
  maxWidth?: number | string;
@@ -24,15 +38,9 @@ declare interface ConfirmDialogBaseProps {
24
38
  level?: ConfirmDialogLevel;
25
39
  }
26
40
 
27
- export declare interface ConfirmDialogComponentContent<C extends Component = Component> extends ConfirmDialogBaseProps {
41
+ export declare type ConfirmDialogComponentContent<C extends Component = Component> = DialogProps<ComponentProps<C>> & ConfirmDialogBaseProps & {
28
42
  component: C;
29
- props: ComponentProps<C>;
30
- }
31
-
32
- export declare interface ConfirmDialogCta {
33
- text: string;
34
- translateText?: boolean;
35
- }
43
+ };
36
44
 
37
45
  export declare enum ConfirmDialogLevel {
38
46
  DEFAULT = "primary",
@@ -49,37 +57,70 @@ export declare interface ConfirmDialogTextContent extends ConfirmDialogBaseProps
49
57
 
50
58
  export declare function createUIKit(options?: PartialDeep<PluginOptions>): FunctionPlugin<void>;
51
59
 
60
+ export declare const decimal: ValidationRuleWithoutParams<any>;
61
+
62
+ declare interface DialogActionCta extends DialogCta {
63
+ action(): unknown;
64
+ }
65
+
52
66
  export declare interface DialogComposable {
53
67
  info(title: string, content: string): Promise<null>;
54
68
  info<T = void, C extends Component = Component>(options: InfoDialogProps<T, C>): Promise<T extends void ? null : (T | null)>;
55
69
  prompt<T, R extends boolean = false, C extends PromptDialogComponent<T> = PromptDialogComponent<T>>(options: PromptDialogProps<T, R, C>): Promise<R extends true ? T : T | null>;
56
70
  confirm(title: string, content: string, level?: ConfirmDialogLevel): Promise<boolean>;
57
71
  confirm<C extends Component = Component>(options: ConfirmDialogProps<C>): Promise<boolean>;
72
+ form<T, R = T>(options: FormDialogProps<T, R>): Promise<R>;
58
73
  }
59
74
 
60
- export declare interface InfoDialogActionCta extends InfoDialogBaseCta {
61
- action(): unknown;
75
+ declare interface DialogCta {
76
+ text: string;
77
+ translateText: boolean;
62
78
  }
63
79
 
64
- export declare interface InfoDialogBaseCta {
65
- text: string;
66
- translateText?: boolean;
80
+ declare type DialogProps<T extends object> = IfEmptyObject<T, object, {
81
+ props: T;
82
+ }>;
83
+
84
+ declare interface DialogValueCta<T> extends DialogCta {
85
+ value: T;
86
+ }
87
+
88
+ export declare const email: ValidationRuleWithoutParams<any>;
89
+
90
+ declare type FormDialogAction<T, R> = (value: T) => Promise<R>;
91
+
92
+ declare type FormDialogComponent<T> = new () => Omit<ComponentPublicInstance, '$emit'> & FormDialogComponentExposed<T> & {
93
+ $emit: EmitFn<FormDialogComponentEmits>;
94
+ };
95
+
96
+ declare type FormDialogComponentEmits = {
97
+ save: [];
98
+ };
99
+
100
+ declare interface FormDialogComponentExposed<T> {
101
+ finish(): Promisable<T>;
67
102
  }
68
103
 
104
+ declare type FormDialogProps<R, T = R, C extends FormDialogComponent<T> = FormDialogComponent<T>, P extends object = ComponentProps<C>> = DialogProps<P> & {
105
+ title: string;
106
+ translateTitle?: string;
107
+ saveCta?: Partial<DialogCta>;
108
+ abortCta?: Partial<DialogCta>;
109
+ component: C;
110
+ action?: FormDialogAction<T, R>;
111
+ };
112
+
69
113
  declare interface InfoDialogBaseProps<T> {
70
114
  title: string;
71
115
  translateTitle?: boolean;
72
- additionalCta?: InfoDialogCta<T>[];
73
- defaultCta?: Partial<InfoDialogCta<T>> | false;
116
+ additionalCta?: InteractiveDialogCta<T>[];
117
+ defaultCta?: Partial<InteractiveDialogCta<T>> | false;
74
118
  width?: number | string;
75
119
  }
76
120
 
77
- export declare interface InfoDialogComponentContent<T = void, C extends Component = Component> extends InfoDialogBaseProps<T> {
121
+ export declare type InfoDialogComponentContent<T = void, C extends Component = Component> = DialogProps<ComponentProps<C>> & InfoDialogBaseProps<T> & {
78
122
  component: C;
79
- props: ComponentProps<C>;
80
- }
81
-
82
- export declare type InfoDialogCta<T> = InfoDialogActionCta | InfoDialogValueCta<T>;
123
+ };
83
124
 
84
125
  export declare type InfoDialogProps<T = void, C extends Component = Component> = InfoDialogComponentContent<T, C> | InfoDialogTextContent<T>;
85
126
 
@@ -88,9 +129,11 @@ export declare interface InfoDialogTextContent<T> extends InfoDialogBaseProps<T>
88
129
  translateContent?: boolean;
89
130
  }
90
131
 
91
- export declare interface InfoDialogValueCta<T> extends InfoDialogBaseCta {
92
- value: T;
93
- }
132
+ export declare const integer: ValidationRuleWithoutParams<any>;
133
+
134
+ declare type InteractiveDialogCta<T> = DialogActionCta | DialogValueCta<T>;
135
+
136
+ export declare const ipAddress: ValidationRuleWithoutParams<any>;
94
137
 
95
138
  export declare type LoadingAction = (...args: any) => any | Promise<any>;
96
139
 
@@ -99,18 +142,32 @@ export declare interface LoadingComposable<A extends LoadingAction> {
99
142
  action(...args: Parameters<A>): Promise<Awaited<ReturnType<A>>>;
100
143
  }
101
144
 
102
- declare interface PluginDialogOptions {
103
- confirm: {
104
- confirmCta: ConfirmDialogCta;
105
- rejectCta: ConfirmDialogCta;
106
- };
107
- info: {
108
- defaultCta: InfoDialogCta<null>;
109
- };
110
- prompt: {
111
- abortCta: PromptDialogCta;
112
- saveCta: PromptDialogCta;
113
- };
145
+ export declare const maxAddress: (separator: string | Ref<string>) => ValidationRuleWithoutParams;
146
+
147
+ export declare const maxLength: (max: number | Ref<number>) => ValidationRuleWithParams< {
148
+ max: number;
149
+ }>;
150
+
151
+ export declare const maxValue: (max: number | Ref<number> | string | Ref<string>) => ValidationRuleWithParams< {
152
+ max: number;
153
+ }>;
154
+
155
+ export declare const minLength: (min: number | Ref<number>) => ValidationRuleWithParams< {
156
+ min: number;
157
+ }>;
158
+
159
+ export declare const minValue: (min: number | Ref<number> | string | Ref<string>) => ValidationRuleWithParams< {
160
+ min: number;
161
+ }>;
162
+
163
+ export declare const numeric: ValidationRuleWithoutParams<any>;
164
+
165
+ export declare const oneOf: (values: Record<string, string> | string[]) => ValidationRuleWithParams<object, any>;
166
+
167
+ declare type PluginI18nMessageKey = 'save' | 'cancel' | 'close' | 'yes' | 'no';
168
+
169
+ declare interface PluginI18nOptions {
170
+ messages: Record<PluginI18nMessageKey, string>;
114
171
  }
115
172
 
116
173
  declare interface PluginLoadingOptions {
@@ -120,8 +177,8 @@ declare interface PluginLoadingOptions {
120
177
 
121
178
  declare interface PluginOptions {
122
179
  loading: PluginLoadingOptions;
123
- dialog: PluginDialogOptions;
124
180
  toast: PluginToastOptions;
181
+ i18n: PluginI18nOptions;
125
182
  }
126
183
 
127
184
  declare interface PluginToastOptions {
@@ -137,28 +194,33 @@ export declare interface PromptDialogComponentProps<T> {
137
194
  toolbar: HTMLElement;
138
195
  }
139
196
 
140
- export declare interface PromptDialogCta {
141
- text: string;
142
- translateText?: boolean;
143
- }
144
-
145
- export declare interface PromptDialogProps<T, R extends boolean = false, C extends PromptDialogComponent<T> = PromptDialogComponent<T>> {
197
+ export declare type PromptDialogProps<T, R extends boolean = false, C extends PromptDialogComponent<T> = PromptDialogComponent<T>> = DialogProps<Omit<ComponentProps<C>, keyof PromptDialogComponentProps<T>>> & {
146
198
  title: string;
147
199
  translateTitle?: boolean;
148
- saveCta?: Partial<PromptDialogCta>;
149
- abortCta?: Partial<PromptDialogCta>;
200
+ saveCta?: Partial<DialogCta>;
201
+ abortCta?: Partial<DialogCta>;
150
202
  initialValue?: MaybeRefOrGetter<T>;
151
203
  size?: PromptDialogSize;
152
204
  required?: R;
153
205
  component: C;
154
- props: Omit<ComponentProps<C>, keyof PromptDialogComponentProps<T>>;
155
- }
206
+ };
156
207
 
157
208
  export declare enum PromptDialogSize {
158
209
  SMALL = "sm",
159
210
  LARGE = "lg"
160
211
  }
161
212
 
213
+ export declare const required: ValidationRuleWithoutParams<any>;
214
+
215
+ export declare const requiredIf: (prop: boolean | Ref<boolean> | string | (() => boolean | Promise<boolean>)) => ValidationRuleWithoutParams;
216
+
217
+ export declare const requiredUnless: (prop: boolean | Ref<boolean> | string | (() => boolean | Promise<boolean>)) => ValidationRuleWithoutParams;
218
+
219
+ export declare const sameAs: <E = unknown>(equalTo: E | Ref<E>, otherName?: string) => ValidationRuleWithParams< {
220
+ equalTo: E;
221
+ otherName: string;
222
+ }>;
223
+
162
224
  export declare interface ToastComposable {
163
225
  info(message: string, options?: Partial<ToastOptions>): Promise<void>;
164
226
  warn(message: string, options?: Partial<ToastOptions>): Promise<void>;
@@ -166,13 +228,15 @@ export declare interface ToastComposable {
166
228
  success(message: string, options?: Partial<ToastOptions>): Promise<void>;
167
229
  }
168
230
 
169
- export declare interface ToastOptions {
231
+ declare interface ToastOptions {
170
232
  timeout: number;
171
233
  translateMessage: boolean;
172
234
  }
173
235
 
174
236
  export declare const UiKitOutlet: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
175
237
 
238
+ export declare const url: ValidationRuleWithoutParams<any>;
239
+
176
240
  export declare function useDialog(): DialogComposable;
177
241
 
178
242
  export declare function useLoading<A extends LoadingAction>(actionCallback: A, options?: Partial<PluginLoadingOptions>): LoadingComposable<A>;