@dynamicforms/vuetify-inputs 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.
@@ -0,0 +1,394 @@
1
+ import { Action as Action_2 } from '@dynamicforms/vue-forms';
2
+ import { App } from 'vue';
3
+ import { ComponentOptionsMixin } from 'vue';
4
+ import { ComponentProvideOptions } from 'vue';
5
+ import { ComputedRef } from 'vue';
6
+ import { CreateComponentPublicInstanceWithMixins } from 'vue';
7
+ import { default as default_2 } from '@dynamicforms/vue-forms';
8
+ import { DefineComponent } from 'vue';
9
+ import { Editor } from '@ckeditor/ckeditor5-core';
10
+ import { ExecuteAction } from '@dynamicforms/vue-forms';
11
+ import { GlobalComponents } from 'vue';
12
+ import { GlobalDirectives } from 'vue';
13
+ import { PublicProps } from 'vue';
14
+ import { Ref } from 'vue';
15
+ import { ValidationError } from '@dynamicforms/vue-forms';
16
+ import { WritableComputedRef } from 'vue';
17
+
18
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
19
+ "update:modelValue": (value: any) => any;
20
+ "click:clear": () => any;
21
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
23
+ "onClick:clear"?: (() => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
25
+
26
+ declare type __VLS_Props = BaseProps;
27
+
28
+ declare function __VLS_template(): {
29
+ attrs: Partial<{}>;
30
+ slots: {
31
+ default?(_: {}): any;
32
+ };
33
+ refs: {};
34
+ rootEl: any;
35
+ };
36
+
37
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
38
+
39
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
44
+
45
+ export declare class Action {
46
+ readonly name: string;
47
+ displayStyle: ResponsiveRenderOptions;
48
+ formAction: Action_2;
49
+ constructor(data: ActionJSON, formAction: Action_2);
50
+ get label(): string | undefined;
51
+ get labelAvailable(): boolean;
52
+ get icon(): string | undefined;
53
+ get iconAvailable(): boolean;
54
+ static actionFormName(actionName: string): string;
55
+ private static makeFormAction;
56
+ static closeAction(data: ActionJSON, actionOrExecuteHandler?: Action_2 | ExecuteAction): Action;
57
+ static yesAction(data: ActionJSON, actionOrExecuteHandler?: Action_2 | ExecuteAction): Action;
58
+ static noAction(data: ActionJSON, actionOrExecuteHandler?: Action_2 | ExecuteAction): Action;
59
+ }
60
+
61
+ declare interface ActionComponentProps {
62
+ actions: Action[] | Ref<Action[]>;
63
+ buttonSize?: string | number;
64
+ showAsGroup?: ShowAsGroup;
65
+ }
66
+
67
+ /**
68
+ * DisplayMode enum provides an enumeration for supported ways of rendering a particular object in the DOM
69
+ */
70
+ export declare enum ActionDisplayStyle {
71
+ BUTTON = 0,// action should render as a button
72
+ TEXT = 1
73
+ }
74
+
75
+ export declare namespace ActionDisplayStyle {
76
+ export function fromString(mode: string): ActionDisplayStyle;
77
+ export function fromAny(mode: any): ActionDisplayStyle;
78
+ export function isDefined(mode: number | string): boolean;
79
+ }
80
+
81
+ export declare interface ActionJSON {
82
+ name?: string;
83
+ label?: string;
84
+ icon?: string;
85
+ displayStyle?: BreakpointsJSON;
86
+ field_name?: string;
87
+ }
88
+
89
+ export declare interface ActionsJSON {
90
+ [key: string]: ActionJSON;
91
+ }
92
+
93
+ export declare interface BaseEmits<T = any> {
94
+ (e: 'update:modelValue', value: T): void;
95
+ (e: 'click:clear'): void;
96
+ }
97
+
98
+ export declare interface BaseProps<T = any> {
99
+ control?: default_2.IField<T>;
100
+ modelValue?: T;
101
+ label?: string;
102
+ errors?: string[];
103
+ placeholder?: string;
104
+ helpText?: string;
105
+ hint?: string;
106
+ enabled?: boolean;
107
+ visibility?: default_2.DisplayMode;
108
+ cssClass?: string;
109
+ clearable?: boolean;
110
+ }
111
+
112
+ export declare interface BreakpointJSON {
113
+ renderAs?: ActionDisplayStyle;
114
+ showLabel?: boolean;
115
+ showIcon?: boolean;
116
+ label?: string;
117
+ }
118
+
119
+ export declare type BreakpointNames = 'xl' | 'lg' | 'md' | 'sm' | 'xs';
120
+
121
+ export declare interface BreakpointsJSON extends BreakpointJSON, Partial<Record<BreakpointNames, BreakpointJSON>> {
122
+ }
123
+
124
+ export declare const defaultBaseProps: {
125
+ enabled: undefined;
126
+ };
127
+
128
+ export declare const defaultDisplayStyle = ActionDisplayStyle.BUTTON;
129
+
130
+ export declare const DfActions: DefineComponent<ActionComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ActionComponentProps> & Readonly<{}>, {
131
+ buttonSize: string | number;
132
+ showAsGroup: ShowAsGroup;
133
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
134
+
135
+ export declare const DfCheckbox: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
136
+ "update:modelValue": (value: any) => any;
137
+ "click:clear": () => any;
138
+ }, string, PublicProps, Readonly<Props> & Readonly<{
139
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
140
+ "onClick:clear"?: (() => any) | undefined;
141
+ }>, {
142
+ enabled: boolean;
143
+ allowNull: boolean;
144
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
145
+
146
+ export declare const DfColor: DefineComponent<Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
147
+ "update:modelValue": (value: any) => any;
148
+ "click:clear": () => any;
149
+ }, string, PublicProps, Readonly<Props_2> & Readonly<{
150
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
151
+ "onClick:clear"?: (() => any) | undefined;
152
+ }>, {
153
+ enabled: boolean;
154
+ allowNull: boolean;
155
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
156
+
157
+ export declare const DfDateTime: DefineComponent<Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
158
+ "update:modelValue": (value: any) => any;
159
+ "click:clear": () => any;
160
+ }, string, PublicProps, Readonly<Props_3> & Readonly<{
161
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
162
+ "onClick:clear"?: (() => any) | undefined;
163
+ }>, {
164
+ enabled: boolean;
165
+ inputType: "datetime" | "date" | "time";
166
+ displayFormatDate: string;
167
+ displayFormatTime: string;
168
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
169
+
170
+ export declare const DfFile: DefineComponent<Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
171
+ "update:modelValue": (value: any) => any;
172
+ "click:clear": () => any;
173
+ }, string, PublicProps, Readonly<Props_4> & Readonly<{
174
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
175
+ "onClick:clear"?: (() => any) | undefined;
176
+ }>, {
177
+ enabled: boolean;
178
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
179
+
180
+ export declare const DfInput: DefineComponent<Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
181
+ "update:modelValue": (value: any) => any;
182
+ "click:clear": () => any;
183
+ }, string, PublicProps, Readonly<Props_5> & Readonly<{
184
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
185
+ "onClick:clear"?: (() => any) | undefined;
186
+ }>, {
187
+ enabled: boolean;
188
+ max: number;
189
+ min: number;
190
+ step: number;
191
+ inputType: "text" | "password" | "email" | "url" | "number";
192
+ precision: number;
193
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
194
+
195
+ export declare const DfRtfEditor: DefineComponent<Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
196
+ "update:modelValue": (value: any) => any;
197
+ "click:clear": () => any;
198
+ }, string, PublicProps, Readonly<Props_6> & Readonly<{
199
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
200
+ "onClick:clear"?: (() => any) | undefined;
201
+ }>, {
202
+ enabled: boolean;
203
+ minHeight: string;
204
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
205
+ $editor: CreateComponentPublicInstanceWithMixins<Readonly<{
206
+ modelValue: string;
207
+ minHeight?: string;
208
+ disabled?: boolean;
209
+ }> & Readonly<{
210
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
211
+ }>, {
212
+ onEditorReady: (editorReady: Editor) => void;
213
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
214
+ "update:modelValue": (value: string) => any;
215
+ }, PublicProps, {
216
+ modelValue: string;
217
+ disabled: boolean;
218
+ minHeight: string;
219
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
220
+ editorElement: HTMLDivElement;
221
+ }, HTMLDivElement, ComponentProvideOptions, {
222
+ P: {};
223
+ B: {};
224
+ D: {};
225
+ C: {};
226
+ M: {};
227
+ Defaults: {};
228
+ }, Readonly<{
229
+ modelValue: string;
230
+ minHeight?: string;
231
+ disabled?: boolean;
232
+ }> & Readonly<{
233
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
234
+ }>, {
235
+ onEditorReady: (editorReady: Editor) => void;
236
+ }, {}, {}, {}, {
237
+ modelValue: string;
238
+ disabled: boolean;
239
+ minHeight: string;
240
+ }> | null;
241
+ }, any>;
242
+
243
+ export declare const DfSelect: DefineComponent<Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
244
+ "update:modelValue": (value: any) => any;
245
+ "click:clear": () => any;
246
+ "update:modelValueDisplay": (value: SelectChoice[]) => any;
247
+ }, string, PublicProps, Readonly<Props_7> & Readonly<{
248
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
249
+ "onClick:clear"?: (() => any) | undefined;
250
+ "onUpdate:modelValueDisplay"?: ((value: SelectChoice[]) => any) | undefined;
251
+ }>, {
252
+ enabled: boolean;
253
+ allowNull: boolean;
254
+ multiple: boolean;
255
+ choices: SelectChoice[];
256
+ allowTags: boolean;
257
+ fetchChoices: SelectFetchChoices;
258
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
259
+
260
+ export declare const DfTextArea: DefineComponent<Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
261
+ "update:modelValue": (value: any) => any;
262
+ "click:clear": () => any;
263
+ }, string, PublicProps, Readonly<Props_8> & Readonly<{
264
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
265
+ "onClick:clear"?: (() => any) | undefined;
266
+ }>, {
267
+ enabled: boolean;
268
+ rows: number;
269
+ maxRows: number;
270
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
271
+
272
+ export declare const ErrorsWidget: DefineComponent<Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props_9> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
273
+
274
+ export declare interface FileComms {
275
+ /**
276
+ * upload is called when a file is added to the input and needs to be uploaded to the backend for storage
277
+ * the component will then set its modelValue to the file identifier returned by this function. when the form
278
+ * is posted, only the identifier will be sent to the backend
279
+ *
280
+ * the method may throw an exception which will mean upload failure
281
+ *
282
+ * @param file the file to be uploaded
283
+ * @param progressCallback callback function to call with current upload progress data.
284
+ * See e.g. axios onUploadProgress for axios post method
285
+ * @return file id
286
+ */
287
+ upload: (file: File, progressCallback?: FileProgressCallback) => Promise<string>;
288
+ /**
289
+ * delete is called when the file is removed from the input and needs to be deleted at the backend
290
+ * @param fileIdentifier the identifier that was returned by upload
291
+ */
292
+ delete: (fileIdentifier: string) => Promise<void>;
293
+ /**
294
+ * touch is called once per minute to let the backend know that the file is still in play and must not be discarded
295
+ * @param fileIdentifier the identifier that was returned by upload
296
+ */
297
+ touch: (fileIdentifier: string) => Promise<void>;
298
+ }
299
+
300
+ export declare type FileProgressCallback = (loaded: number, total: number) => void;
301
+
302
+ export declare const InputBase: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
303
+
304
+ declare interface Props extends BaseProps {
305
+ allowNull?: boolean;
306
+ }
307
+
308
+ declare interface Props_2 extends BaseProps {
309
+ allowNull?: boolean;
310
+ }
311
+
312
+ declare interface Props_3 extends BaseProps {
313
+ inputType?: 'datetime' | 'date' | 'time';
314
+ displayFormatDate?: string;
315
+ displayFormatTime?: string;
316
+ }
317
+
318
+ declare interface Props_4 extends BaseProps {
319
+ comms: FileComms;
320
+ }
321
+
322
+ declare interface Props_5 extends BaseProps {
323
+ inputType?: 'text' | 'password' | 'email' | 'url' | 'number';
324
+ precision?: number;
325
+ step?: number;
326
+ min?: number;
327
+ max?: number;
328
+ }
329
+
330
+ declare interface Props_6 extends BaseProps {
331
+ minHeight?: string;
332
+ }
333
+
334
+ declare interface Props_7 extends BaseProps {
335
+ choices?: SelectChoice[];
336
+ multiple?: boolean;
337
+ allowTags?: boolean;
338
+ allowNull?: boolean;
339
+ fetchChoices?: SelectFetchChoices;
340
+ }
341
+
342
+ declare interface Props_8 extends BaseProps {
343
+ rows?: number;
344
+ maxRows?: number;
345
+ }
346
+
347
+ declare interface Props_9 {
348
+ errors: ValidationError[];
349
+ }
350
+
351
+ declare class ResponsiveRenderOptions {
352
+ private readonly _value;
353
+ constructor(data: BreakpointsJSON | undefined, label?: string);
354
+ getOptionsForBreakpoint(breakpoint: BreakpointNames): BreakpointJSON;
355
+ private static cleanBreakpoint;
356
+ }
357
+
358
+ export declare interface SelectChoice {
359
+ id: any;
360
+ text: any;
361
+ icon?: string;
362
+ }
363
+
364
+ export declare type SelectFetchChoices<T1 = any, T2 = any> = (queryValue?: T1, idValue?: T2) => Promise<SelectChoice[]>;
365
+
366
+ declare type ShowAsGroup = 'no' | 'grouped' | 'grouped-no-borders';
367
+
368
+ export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmits<T>): {
369
+ value: WritableComputedRef<T, T>;
370
+ valid: ComputedRef<boolean>;
371
+ enabled: ComputedRef<boolean>;
372
+ errors: ComputedRef<default_2.ValidationError[]>;
373
+ visibility: ComputedRef<default_2.DisplayMode>;
374
+ vuetifyBindings: ComputedRef< {
375
+ name: string | undefined;
376
+ class: string;
377
+ label: string;
378
+ messages: string | undefined;
379
+ readonly: boolean;
380
+ disabled: boolean;
381
+ placeholder: string;
382
+ 'persistent-placeholder': boolean;
383
+ hint: string;
384
+ persistentHint: boolean;
385
+ hideDetails: boolean | "auto" | undefined;
386
+ helpText: string;
387
+ }>;
388
+ };
389
+
390
+ export declare const VuetifyInputs: {
391
+ install: (app: App) => void;
392
+ };
393
+
394
+ export { }