@dynamicforms/vue-forms 0.5.1 → 0.6.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/dist/dynamicforms-vue-forms.js +535 -539
- package/dist/dynamicforms-vue-forms.js.map +1 -1
- package/dist/dynamicforms-vue-forms.umd.cjs +2 -2
- package/dist/dynamicforms-vue-forms.umd.cjs.map +1 -1
- package/dist/index.d.cts +603 -0
- package/dist/index.d.ts +103 -93
- package/package.json +14 -5
- package/readme.md +133 -43
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
|
-
import { ComputedRef } from 'vue';
|
|
4
3
|
import { DefineComponent } from 'vue';
|
|
5
4
|
import { PublicProps } from 'vue';
|
|
6
5
|
import { Ref } from 'vue';
|
|
@@ -9,9 +8,7 @@ export declare class AbortEventHandlingException extends Error {
|
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export declare class Action<T extends ActionValue = ActionValue> extends Field<T> {
|
|
12
|
-
constructor(guard?: symbol);
|
|
13
11
|
protected init(params?: Partial<IFieldConstructorParams<T>>): void;
|
|
14
|
-
static create<T extends ActionValue = ActionValue>(params?: Partial<IFieldConstructorParams<T>>): Action<T>;
|
|
15
12
|
get icon(): string | undefined;
|
|
16
13
|
set icon(newValue: string | undefined);
|
|
17
14
|
get label(): string | undefined;
|
|
@@ -19,17 +16,16 @@ export declare class Action<T extends ActionValue = ActionValue> extends Field<T
|
|
|
19
16
|
execute(params: any): void;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
|
-
declare type ActionExecutor = (field:
|
|
19
|
+
declare type ActionExecutor = (field: FieldBase, supr: FieldActionExecute, ...params: any[]) => any;
|
|
23
20
|
|
|
24
21
|
export declare class ActionsMap extends Map<symbol, FieldActionExecute> {
|
|
25
22
|
private readonly eagerActions;
|
|
26
23
|
private readonly registeredActions;
|
|
27
24
|
register(action: FieldActionBase): void;
|
|
28
|
-
trigger<T extends FieldActionBase>(ActionClass: {
|
|
29
|
-
new (...args: any[]): T;
|
|
25
|
+
trigger<T extends FieldActionBase>(ActionClass: (abstract new (...args: any[]) => T) & {
|
|
30
26
|
classIdentifier: symbol;
|
|
31
|
-
}, field:
|
|
32
|
-
triggerEager(field:
|
|
27
|
+
}, field: FieldBase, ...params: any[]): any;
|
|
28
|
+
triggerEager(field: FieldBase, ...params: any[]): any;
|
|
33
29
|
clone(): ActionsMap;
|
|
34
30
|
cloneWithoutValidators(): ActionsMap;
|
|
35
31
|
}
|
|
@@ -54,7 +50,7 @@ declare class CompareTo<T = any> extends Validator {
|
|
|
54
50
|
private otherField;
|
|
55
51
|
private isValidComparison;
|
|
56
52
|
private unregistered;
|
|
57
|
-
constructor(otherField:
|
|
53
|
+
constructor(otherField: FieldBase, isValidComparison: (myValue: T, otherValue: T) => boolean, message: RenderContentRef);
|
|
58
54
|
unregister(): void;
|
|
59
55
|
}
|
|
60
56
|
|
|
@@ -62,7 +58,7 @@ export declare class ConditionalEnabledAction extends ConditionalStatementAction
|
|
|
62
58
|
constructor(statement: Statement);
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
declare type ConditionalExecutorFn = (field:
|
|
61
|
+
declare type ConditionalExecutorFn = (field: FieldBase, currentResult: boolean, previousResult: boolean | undefined) => void;
|
|
66
62
|
|
|
67
63
|
export declare class ConditionalStatementAction extends ValueChangedAction {
|
|
68
64
|
private lastResult;
|
|
@@ -70,7 +66,7 @@ export declare class ConditionalStatementAction extends ValueChangedAction {
|
|
|
70
66
|
constructor(statement: Statement, executorFn: ConditionalExecutorFn);
|
|
71
67
|
static get classIdentifier(): symbol;
|
|
72
68
|
get eager(): boolean;
|
|
73
|
-
boundToField(field:
|
|
69
|
+
boundToField(field: FieldBase): void;
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
export declare class ConditionalValueAction<T> extends ConditionalStatementAction {
|
|
@@ -97,67 +93,80 @@ export declare namespace DisplayMode {
|
|
|
97
93
|
export function isDefined(mode: number | string): boolean;
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
export declare const EmptyField: Field<
|
|
96
|
+
export declare const EmptyField: Field<string>;
|
|
101
97
|
|
|
102
98
|
export declare class EnabledChangedAction extends FieldActionBase {
|
|
103
|
-
constructor(executorFn: (field:
|
|
99
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, newValue: boolean, oldValue: boolean) => void);
|
|
104
100
|
static get classIdentifier(): symbol;
|
|
105
|
-
execute(field:
|
|
101
|
+
execute(field: FieldBase, supr: FieldActionExecute, newValue: boolean, oldValue: boolean): void;
|
|
106
102
|
}
|
|
107
103
|
|
|
108
104
|
export declare class EnabledChangingAction extends FieldActionBase {
|
|
109
|
-
constructor(executorFn: (field:
|
|
105
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, newValue: boolean, oldValue: boolean) => boolean);
|
|
110
106
|
static get classIdentifier(): symbol;
|
|
111
|
-
execute(field:
|
|
107
|
+
execute(field: FieldBase, supr: FieldActionExecute, newValue: boolean, oldValue: boolean): boolean;
|
|
112
108
|
}
|
|
113
109
|
|
|
114
110
|
export declare class ExecuteAction extends FieldActionBase {
|
|
115
|
-
constructor(executorFn: (field:
|
|
111
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, params: any) => any);
|
|
116
112
|
static get classIdentifier(): symbol;
|
|
117
|
-
execute(field:
|
|
113
|
+
execute(field: FieldBase, supr: FieldActionExecute, params: any): any;
|
|
118
114
|
}
|
|
119
115
|
|
|
120
|
-
export declare class Field<T = any> extends FieldBase {
|
|
116
|
+
export declare class Field<T = any> extends FieldBase<T> {
|
|
121
117
|
protected _value: T;
|
|
122
118
|
protected _touched: boolean;
|
|
123
|
-
constructor(
|
|
124
|
-
protected init(params?: Partial<IFieldConstructorParams<T>>): void;
|
|
119
|
+
constructor(params?: Partial<IFieldConstructorParams<T>>);
|
|
125
120
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
121
|
+
* Applies the constructor parameters. It is a hook so that a subclass needing different parameter handling
|
|
122
|
+
* overrides one method instead of redeclaring the constructor - Action does exactly that.
|
|
123
|
+
*
|
|
124
|
+
* It is called from this constructor, so it runs before a subclass's own class field initializers, which
|
|
125
|
+
* only run once super() returns. An override must therefore work off its parameters alone: members the
|
|
126
|
+
* subclass initializes read as undefined inside it, and anything it writes to such a member is overwritten
|
|
127
|
+
* the moment the initializer runs.
|
|
129
128
|
*/
|
|
130
|
-
|
|
129
|
+
protected init(params?: Partial<IFieldConstructorParams<T>>): void;
|
|
131
130
|
get value(): T;
|
|
132
131
|
set value(newValue: T);
|
|
133
132
|
get touched(): boolean;
|
|
134
133
|
set touched(touched: boolean);
|
|
135
|
-
clone(overrides?: Partial<
|
|
134
|
+
clone(overrides?: Partial<IFieldConstructorParams<T>>): this;
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
export declare abstract class FieldActionBase
|
|
137
|
+
export declare abstract class FieldActionBase {
|
|
139
138
|
static get classIdentifier(): symbol;
|
|
140
139
|
get classIdentifier(): symbol;
|
|
141
140
|
private readonly executorFn;
|
|
142
141
|
constructor(executorFn: ActionExecutor);
|
|
143
|
-
execute(field:
|
|
142
|
+
execute(field: FieldBase, supr: FieldActionExecute, ...params: any[]): any;
|
|
144
143
|
get eager(): boolean;
|
|
145
|
-
boundToField(field:
|
|
144
|
+
boundToField(field: FieldBase): void;
|
|
146
145
|
unregister(): void;
|
|
147
146
|
}
|
|
148
147
|
|
|
149
|
-
export declare type FieldActionExecute<T = any> = (field:
|
|
148
|
+
export declare type FieldActionExecute<T = any> = (field: FieldBase<T>, ...params: any[]) => any;
|
|
150
149
|
|
|
151
|
-
export declare abstract class FieldBase<T = any>
|
|
150
|
+
export declare abstract class FieldBase<T = any> {
|
|
151
|
+
/**
|
|
152
|
+
* A field is a Vue reactive proxy from construction onwards: the base constructor returns the proxy, and a
|
|
153
|
+
* derived class's `this` is whatever super() returned, so every subclass constructor, field initializer and
|
|
154
|
+
* method sees the proxy. Consequence: plain `field.property = value` is tracked, with no wrapper in between.
|
|
155
|
+
*/
|
|
156
|
+
constructor();
|
|
152
157
|
abstract get value(): T;
|
|
153
158
|
abstract set value(newValue: T);
|
|
154
159
|
abstract get touched(): boolean;
|
|
155
160
|
abstract set touched(touched: boolean);
|
|
156
|
-
|
|
157
|
-
abstract clone(overrides?: Partial<IField<T>>): IField<T>;
|
|
161
|
+
abstract clone(overrides?: Partial<IFieldConstructorParams<T>>): FieldBase<T>;
|
|
158
162
|
originalValue: T;
|
|
159
|
-
|
|
160
|
-
|
|
163
|
+
private validatingCount;
|
|
164
|
+
/** true while at least one asynchronous validator is still running for this field */
|
|
165
|
+
get validating(): boolean;
|
|
166
|
+
/** announces the start of one asynchronous validation run; validators pair it with endValidating */
|
|
167
|
+
beginValidating(): void;
|
|
168
|
+
/** announces the end of one asynchronous validation run */
|
|
169
|
+
endValidating(): void;
|
|
161
170
|
protected _valid: boolean;
|
|
162
171
|
errors: ValidationError[];
|
|
163
172
|
parent?: Group;
|
|
@@ -173,13 +182,15 @@ export declare abstract class FieldBase<T = any> implements IField<T> {
|
|
|
173
182
|
get valid(): boolean;
|
|
174
183
|
get fullValue(): any;
|
|
175
184
|
get isChanged(): boolean;
|
|
176
|
-
registerAction(action:
|
|
177
|
-
triggerAction<T2 extends
|
|
185
|
+
registerAction(action: FieldActionBase): this;
|
|
186
|
+
triggerAction<T2 extends FieldActionBase>(actionClass: (abstract new (...args: any[]) => T2) & {
|
|
187
|
+
classIdentifier: symbol;
|
|
188
|
+
}, ...params: any[]): any;
|
|
178
189
|
clearValidators(): void;
|
|
179
190
|
}
|
|
180
191
|
|
|
181
|
-
declare type FieldsToValues<T extends GenericFieldsInterface> = {
|
|
182
|
-
[K in keyof T]: T[K]
|
|
192
|
+
export declare type FieldsToValues<T extends GenericFieldsInterface> = {
|
|
193
|
+
[K in keyof T]: T[K]['value'];
|
|
183
194
|
};
|
|
184
195
|
|
|
185
196
|
declare namespace Form {
|
|
@@ -210,16 +221,18 @@ declare namespace Form {
|
|
|
210
221
|
Field,
|
|
211
222
|
NullableField,
|
|
212
223
|
EmptyField,
|
|
213
|
-
IField,
|
|
214
224
|
IFieldConstructorActionsList,
|
|
215
225
|
IFieldConstructorParams,
|
|
216
226
|
AbortEventHandlingException,
|
|
217
227
|
FieldActionExecute,
|
|
218
|
-
IFieldAction,
|
|
219
228
|
FieldBase,
|
|
220
229
|
GenericFieldsInterface,
|
|
230
|
+
FieldsToValues,
|
|
231
|
+
GroupValue,
|
|
232
|
+
GroupValueInput,
|
|
221
233
|
Group,
|
|
222
234
|
NullableGroup,
|
|
235
|
+
ListValue,
|
|
223
236
|
List,
|
|
224
237
|
NullableList,
|
|
225
238
|
Validators,
|
|
@@ -253,61 +266,55 @@ declare interface FormsConfig {
|
|
|
253
266
|
useMarkdownInValidators: boolean;
|
|
254
267
|
}
|
|
255
268
|
|
|
256
|
-
export declare type GenericFieldsInterface = Record<string,
|
|
269
|
+
export declare type GenericFieldsInterface = Record<string, FieldBase>;
|
|
257
270
|
|
|
258
|
-
export declare class Group<T extends GenericFieldsInterface = GenericFieldsInterface> extends FieldBase {
|
|
271
|
+
export declare class Group<T extends GenericFieldsInterface = GenericFieldsInterface> extends FieldBase<GroupValue<T>> {
|
|
259
272
|
private readonly _fields;
|
|
260
273
|
private _value;
|
|
261
|
-
readonly reactiveValue: ComputedRef<FieldsToValues<T> | null>;
|
|
262
274
|
private suppressNotifyValueChanged;
|
|
263
|
-
constructor(fields: T, params?: Partial<IFieldConstructorParams
|
|
275
|
+
constructor(fields: T, params?: Partial<IFieldConstructorParams<GroupValueInput<T>>>);
|
|
264
276
|
private addField;
|
|
265
277
|
private static isValidFields;
|
|
266
278
|
static createFromFormData(data: Record<string, any> | null): Group;
|
|
267
279
|
field<K extends keyof T>(fieldName: K): T[K] | null;
|
|
268
280
|
get fields(): T;
|
|
269
|
-
get value():
|
|
270
|
-
set value(newValue:
|
|
281
|
+
get value(): GroupValue<T>;
|
|
282
|
+
set value(newValue: GroupValueInput<T>);
|
|
271
283
|
get touched(): boolean;
|
|
272
284
|
set touched(touched: boolean);
|
|
273
285
|
get fullValue(): Record<string, any>;
|
|
274
286
|
notifyValueChanged(): void;
|
|
275
287
|
get valid(): boolean;
|
|
276
288
|
validate(revalidate?: boolean): void;
|
|
277
|
-
clone(overrides?: Partial<
|
|
289
|
+
clone(overrides?: Partial<IFieldConstructorParams<GroupValueInput<T>>>): Group<T>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** what Group.value reads back: the full field map, or null when no field serializes */
|
|
293
|
+
export declare type GroupValue<T extends GenericFieldsInterface> = FieldsToValues<T> | null;
|
|
294
|
+
|
|
295
|
+
/** what Group.value and the Group constructor accept: keys left out are simply not assigned */
|
|
296
|
+
export declare type GroupValueInput<T extends GenericFieldsInterface> = Partial<FieldsToValues<T>> | null;
|
|
297
|
+
|
|
298
|
+
export declare interface IFieldConstructorActionsList {
|
|
299
|
+
actions?: FieldActionBase[];
|
|
300
|
+
validators?: FieldActionBase[];
|
|
278
301
|
}
|
|
279
302
|
|
|
280
|
-
|
|
303
|
+
/**
|
|
304
|
+
* Parameters accepted by field constructors and by clone overrides.
|
|
305
|
+
*
|
|
306
|
+
* Only writable members are listed. valid, validating, fullValue and isChanged are getter-only, so assigning
|
|
307
|
+
* them throws a TypeError. parent and fieldName are set by the container: until a Group or List installs them
|
|
308
|
+
* as non-configurable accessors, assigning them is silently accepted, which is why the type rejects them.
|
|
309
|
+
*/
|
|
310
|
+
export declare type IFieldConstructorParams<T = any> = {
|
|
281
311
|
value: T;
|
|
282
|
-
reactiveValue: ComputedRef<T>;
|
|
283
|
-
fullValue: T;
|
|
284
312
|
originalValue: T;
|
|
285
|
-
valid: boolean;
|
|
286
|
-
validating: boolean;
|
|
287
|
-
errors: ValidationError[];
|
|
288
313
|
enabled: boolean;
|
|
289
314
|
visibility: DisplayMode;
|
|
290
315
|
touched: boolean;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
clone(overrides?: Partial<IField<T>>): IField<T>;
|
|
294
|
-
registerAction(action: IFieldAction<T>): this;
|
|
295
|
-
triggerAction<T2 extends IFieldAction<T>>(actionClass: abstract new (...args: any[]) => T2, ...params: any[]): any;
|
|
296
|
-
validate(revalidate?: boolean): void;
|
|
297
|
-
clearValidators(): void;
|
|
298
|
-
isChanged: boolean;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export declare interface IFieldAction<T = any> {
|
|
302
|
-
execute(field: IField<T>, supr: FieldActionExecute<T>, ...params: any[]): any;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export declare interface IFieldConstructorActionsList<T = any> {
|
|
306
|
-
actions?: IFieldAction<T>[];
|
|
307
|
-
validators?: IFieldAction<T>[];
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export declare type IFieldConstructorParams<T = any> = IField<T> & IFieldConstructorActionsList<T>;
|
|
316
|
+
errors: ValidationError[];
|
|
317
|
+
} & IFieldConstructorActionsList;
|
|
311
318
|
|
|
312
319
|
declare class InAllowedValues<T = any> extends Validator {
|
|
313
320
|
constructor(allowedValues: T[], message?: RenderContentRef);
|
|
@@ -326,18 +333,18 @@ declare class LengthInRange<T = any> extends Validator {
|
|
|
326
333
|
constructor(minLength: number, maxLength: number, message?: RenderContentRef);
|
|
327
334
|
}
|
|
328
335
|
|
|
329
|
-
export declare class List<T extends GenericFieldsInterface = GenericFieldsInterface> extends FieldBase {
|
|
336
|
+
export declare class List<T extends GenericFieldsInterface = GenericFieldsInterface> extends FieldBase<ListValue> {
|
|
330
337
|
private _value;
|
|
331
338
|
private _itemTemplate?;
|
|
332
339
|
private _previousValue;
|
|
333
|
-
constructor(itemTemplate?: Group<T>, params?: Partial<IFieldConstructorParams
|
|
340
|
+
constructor(itemTemplate?: Group<T>, params?: Partial<IFieldConstructorParams<ListValue>>);
|
|
334
341
|
private processSetValueItem;
|
|
335
342
|
private setValueInternal;
|
|
336
|
-
get value():
|
|
343
|
+
get value(): ListValue;
|
|
337
344
|
set value(newValue: Record<string, any>[]);
|
|
338
345
|
get touched(): boolean;
|
|
339
346
|
set touched(touched: boolean);
|
|
340
|
-
clone(overrides?: Partial<
|
|
347
|
+
clone(overrides?: Partial<IFieldConstructorParams<ListValue>>): List<T>;
|
|
341
348
|
notifyValueChanged(): void;
|
|
342
349
|
get valid(): boolean;
|
|
343
350
|
validate(revalidate?: boolean): void;
|
|
@@ -350,17 +357,20 @@ export declare class List<T extends GenericFieldsInterface = GenericFieldsInterf
|
|
|
350
357
|
}
|
|
351
358
|
|
|
352
359
|
export declare class ListItemAddedAction extends FieldActionBase {
|
|
353
|
-
constructor(executorFn: (field:
|
|
360
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, item: any, index: number) => void);
|
|
354
361
|
static get classIdentifier(): symbol;
|
|
355
|
-
execute(field:
|
|
362
|
+
execute(field: FieldBase, supr: FieldActionExecute, item: any, index: number): void;
|
|
356
363
|
}
|
|
357
364
|
|
|
358
365
|
export declare class ListItemRemovedAction extends FieldActionBase {
|
|
359
|
-
constructor(executorFn: (field:
|
|
366
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, item: any, index: number) => void);
|
|
360
367
|
static get classIdentifier(): symbol;
|
|
361
|
-
execute(field:
|
|
368
|
+
execute(field: FieldBase, supr: FieldActionExecute, item: any, index: number): void;
|
|
362
369
|
}
|
|
363
370
|
|
|
371
|
+
/** what List.value reads back: one plain object per item, or null when the list is empty */
|
|
372
|
+
export declare type ListValue = Record<string, any>[] | null;
|
|
373
|
+
|
|
364
374
|
declare class MaxLength<T = any> extends Validator {
|
|
365
375
|
constructor(maxLength: number, message?: RenderContentRef);
|
|
366
376
|
}
|
|
@@ -396,7 +406,7 @@ export declare type NullableGroup = Group | null;
|
|
|
396
406
|
|
|
397
407
|
export declare type NullableList = List | null;
|
|
398
408
|
|
|
399
|
-
export declare type OperandType = any | Statement |
|
|
409
|
+
export declare type OperandType = any | Statement | FieldBase;
|
|
400
410
|
|
|
401
411
|
/**
|
|
402
412
|
* Operators provides us a functionality for backend to send us complex condition upon which we send
|
|
@@ -482,7 +492,7 @@ export declare class Statement {
|
|
|
482
492
|
* Recursively collects all fields used in this statement and its nested statements
|
|
483
493
|
* @returns A set of all fields used in this statement
|
|
484
494
|
*/
|
|
485
|
-
collectFields(): Set<
|
|
495
|
+
collectFields(): Set<FieldBase>;
|
|
486
496
|
}
|
|
487
497
|
|
|
488
498
|
/**
|
|
@@ -523,7 +533,7 @@ export declare class ValidationErrorText extends ValidationError {
|
|
|
523
533
|
get extraClasses(): ClassTypes;
|
|
524
534
|
}
|
|
525
535
|
|
|
526
|
-
export declare type ValidationFunction<T = any> = (newValue: T, oldValue: T, field:
|
|
536
|
+
export declare type ValidationFunction<T = any> = (newValue: T, oldValue: T, field: FieldBase<T>) => ValidationFunctionResult | Promise<ValidationFunctionResult>;
|
|
527
537
|
|
|
528
538
|
export declare type ValidationFunctionResult = ValidationError[] | null;
|
|
529
539
|
|
|
@@ -563,15 +573,15 @@ export declare namespace Validators {
|
|
|
563
573
|
}
|
|
564
574
|
|
|
565
575
|
export declare class ValidChangedAction extends FieldActionBase {
|
|
566
|
-
constructor(executorFn: (field:
|
|
576
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, newValue: boolean, oldValue: boolean) => void);
|
|
567
577
|
static get classIdentifier(): symbol;
|
|
568
|
-
execute(field:
|
|
578
|
+
execute(field: FieldBase, supr: FieldActionExecute, newValue: boolean, oldValue: boolean): void;
|
|
569
579
|
}
|
|
570
580
|
|
|
571
581
|
export declare class ValueChangedAction<T = any> extends FieldActionBase {
|
|
572
|
-
constructor(executorFn: (field:
|
|
582
|
+
constructor(executorFn: (field: FieldBase<T>, supr: FieldActionExecute<T>, newValue: T, oldValue: T) => void);
|
|
573
583
|
static get classIdentifier(): symbol;
|
|
574
|
-
execute(field:
|
|
584
|
+
execute(field: FieldBase<T>, supr: FieldActionExecute<T>, newValue: T, oldValue: T): void;
|
|
575
585
|
}
|
|
576
586
|
|
|
577
587
|
declare class ValueInRange<T = any> extends Validator {
|
|
@@ -579,15 +589,15 @@ declare class ValueInRange<T = any> extends Validator {
|
|
|
579
589
|
}
|
|
580
590
|
|
|
581
591
|
export declare class VisibilityChangedAction extends FieldActionBase {
|
|
582
|
-
constructor(executorFn: (field:
|
|
592
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, newValue: DisplayMode, oldValue: DisplayMode) => void);
|
|
583
593
|
static get classIdentifier(): symbol;
|
|
584
|
-
execute(field:
|
|
594
|
+
execute(field: FieldBase, supr: FieldActionExecute, newValue: DisplayMode, oldValue: DisplayMode): void;
|
|
585
595
|
}
|
|
586
596
|
|
|
587
597
|
export declare class VisibilityChangingAction extends FieldActionBase {
|
|
588
|
-
constructor(executorFn: (field:
|
|
598
|
+
constructor(executorFn: (field: FieldBase, supr: FieldActionExecute, newValue: DisplayMode, oldValue: DisplayMode) => DisplayMode);
|
|
589
599
|
static get classIdentifier(): symbol;
|
|
590
|
-
execute(field:
|
|
600
|
+
execute(field: FieldBase, supr: FieldActionExecute, newValue: DisplayMode, oldValue: DisplayMode): DisplayMode;
|
|
591
601
|
}
|
|
592
602
|
|
|
593
603
|
export { }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamicforms/vue-forms",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A lightweight Vue.js library for form state management with built-in validation, conditional logic, nested structures, and a rich event system. UI-agnostic and TypeScript-first.",
|
|
7
7
|
"author": "Jure Erznožnik",
|
|
@@ -12,17 +12,26 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/dynamicforms-vue-forms.js"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/index.d.cts",
|
|
21
|
+
"default": "./dist/dynamicforms-vue-forms.umd.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"./style.css": "./dist/dynamicforms-vue-forms.css",
|
|
25
|
+
"./package.json": "./package.json"
|
|
18
26
|
},
|
|
19
27
|
"workspaces": [
|
|
20
28
|
"docs"
|
|
21
29
|
],
|
|
22
30
|
"scripts": {
|
|
23
|
-
"build": "vite build",
|
|
31
|
+
"build": "vite build && node -e \"require('fs').copyFileSync('dist/index.d.ts', 'dist/index.d.cts')\"",
|
|
24
32
|
"test": "vitest run --coverage",
|
|
25
33
|
"lint": "eslint src --fix && vue-tsc --noEmit",
|
|
34
|
+
"lint:ci": "eslint src && vue-tsc --noEmit",
|
|
26
35
|
"docs:dev": "npm run docs:dev -w docs",
|
|
27
36
|
"docs:build": "npm run docs:build -w docs",
|
|
28
37
|
"docs:preview": "npm run docs:preview -w docs"
|