foorm 0.0.2-alpha.7 → 0.0.2-alpha.8
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/index.cjs +3 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.mjs +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -85,6 +85,9 @@ class Foorm {
|
|
|
85
85
|
validators.unshift(this.fns.getFn('entry.optional || !!v || "Required"'));
|
|
86
86
|
return validators;
|
|
87
87
|
}
|
|
88
|
+
supportsAltAction(altAction) {
|
|
89
|
+
return !!this.entries.find(e => e.altAction === altAction);
|
|
90
|
+
}
|
|
88
91
|
getFormValidator() {
|
|
89
92
|
if (!this.fns)
|
|
90
93
|
this.fns = new ftring$1.FtringsPool();
|
package/dist/index.d.ts
CHANGED
|
@@ -98,13 +98,12 @@ declare class Foorm {
|
|
|
98
98
|
entries: TFoormEntryExecutable[];
|
|
99
99
|
};
|
|
100
100
|
prepareValidators(_validators: TFoormEntry['validators']): TFoormValidatorFn<string>[];
|
|
101
|
+
supportsAltAction(altAction: string): boolean;
|
|
101
102
|
getFormValidator(): (inputs: Record<string, unknown>) => {
|
|
102
103
|
passed: boolean;
|
|
103
104
|
errors: Record<string, string>;
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
|
-
type TFoormExecutableMeta = ReturnType<Foorm['executable']>;
|
|
107
|
-
type TFoormExecutableEntry = TFoormExecutableMeta['entries'][number];
|
|
108
107
|
declare function validate<T = string>(opts: TFoormFnScope<T> & {
|
|
109
108
|
validators: TFoormValidatorFn<T>[];
|
|
110
109
|
}): {
|
|
@@ -118,4 +117,4 @@ declare function validate<T = string>(opts: TFoormFnScope<T> & {
|
|
|
118
117
|
declare function isFtring(input: unknown): input is TFtring;
|
|
119
118
|
declare function ftring(strings: TemplateStringsArray, __type__?: TFtring['__type__']): TFtring;
|
|
120
119
|
|
|
121
|
-
export { Foorm, type ObjSOF, type StringOrFtring, type TFoormEntry, type TFoormEntryExecutable, type
|
|
120
|
+
export { Foorm, type ObjSOF, type StringOrFtring, type TFoormEntry, type TFoormEntryExecutable, type TFoormFn, type TFoormFnScope, type TFoormOptions, type TFoormSubmit, type TFoormValidatorFn, type TFtring, ftring, isFtring, validate };
|
package/dist/index.mjs
CHANGED
|
@@ -83,6 +83,9 @@ class Foorm {
|
|
|
83
83
|
validators.unshift(this.fns.getFn('entry.optional || !!v || "Required"'));
|
|
84
84
|
return validators;
|
|
85
85
|
}
|
|
86
|
+
supportsAltAction(altAction) {
|
|
87
|
+
return !!this.entries.find(e => e.altAction === altAction);
|
|
88
|
+
}
|
|
86
89
|
getFormValidator() {
|
|
87
90
|
if (!this.fns)
|
|
88
91
|
this.fns = new FtringsPool();
|