@form-observer/vue 0.6.2 → 0.7.1
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.
|
@@ -9,8 +9,9 @@ module.exports.default = createFormValidityObserver;
|
|
|
9
9
|
*
|
|
10
10
|
* @template {import("./index.d.cts").OneOrMany<import("./index.d.cts").EventType>} T
|
|
11
11
|
* @template [M=string]
|
|
12
|
+
* @template {import("./index.d.cts").ValidatableField} [E=import("./index.d.cts").ValidatableField]
|
|
12
13
|
* @param {T} types
|
|
13
|
-
* @param {import("./index.d.cts").FormValidityObserverOptions<M>} [options]
|
|
14
|
+
* @param {import("./index.d.cts").FormValidityObserverOptions<M, E>} [options]
|
|
14
15
|
* @returns {import("./types.d.cts").VueFormValidityObserver<M>}
|
|
15
16
|
*/
|
|
16
17
|
function createFormValidityObserver(types, options) {
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @template {import("./index.d.cts").OneOrMany<import("./index.d.cts").EventType>} T
|
|
5
5
|
* @template [M=string]
|
|
6
|
+
* @template {import("./index.d.cts").ValidatableField} [E=import("./index.d.cts").ValidatableField]
|
|
6
7
|
* @param {T} types
|
|
7
|
-
* @param {import("./index.d.cts").FormValidityObserverOptions<M>} [options]
|
|
8
|
+
* @param {import("./index.d.cts").FormValidityObserverOptions<M, E>} [options]
|
|
8
9
|
* @returns {import("./types.d.cts").VueFormValidityObserver<M>}
|
|
9
10
|
*/
|
|
10
|
-
export default function createFormValidityObserver<T extends import("@form-observer/core/types").OneOrMany<keyof DocumentEventMap>, M = string>(types: T, options?: import("@form-observer/core/FormValidityObserver").FormValidityObserverOptions<M> | undefined): import("./types.d.cts").VueFormValidityObserver<M>;
|
|
11
|
+
export default function createFormValidityObserver<T extends import("@form-observer/core/types").OneOrMany<keyof DocumentEventMap>, M = string, E extends import("@form-observer/core/types").ValidatableField = import("@form-observer/core/types").ValidatableField>(types: T, options?: import("@form-observer/core/FormValidityObserver").FormValidityObserverOptions<M, E> | undefined): import("./types.d.cts").VueFormValidityObserver<M>;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @template {import("./index.d.ts").OneOrMany<import("./index.d.ts").EventType>} T
|
|
5
5
|
* @template [M=string]
|
|
6
|
+
* @template {import("./index.d.ts").ValidatableField} [E=import("./index.d.ts").ValidatableField]
|
|
6
7
|
* @param {T} types
|
|
7
|
-
* @param {import("./index.d.ts").FormValidityObserverOptions<M>} [options]
|
|
8
|
+
* @param {import("./index.d.ts").FormValidityObserverOptions<M, E>} [options]
|
|
8
9
|
* @returns {import("./types.d.ts").VueFormValidityObserver<M>}
|
|
9
10
|
*/
|
|
10
|
-
export default function createFormValidityObserver<T extends import("@form-observer/core/types").OneOrMany<keyof DocumentEventMap>, M = string>(types: T, options?: import("@form-observer/core/FormValidityObserver").FormValidityObserverOptions<M> | undefined): import("./types.d.ts").VueFormValidityObserver<M>;
|
|
11
|
+
export default function createFormValidityObserver<T extends import("@form-observer/core/types").OneOrMany<keyof DocumentEventMap>, M = string, E extends import("@form-observer/core/types").ValidatableField = import("@form-observer/core/types").ValidatableField>(types: T, options?: import("@form-observer/core/FormValidityObserver").FormValidityObserverOptions<M, E> | undefined): import("./types.d.ts").VueFormValidityObserver<M>;
|
|
@@ -5,8 +5,9 @@ import FormValidityObserver from "@form-observer/core/FormValidityObserver";
|
|
|
5
5
|
*
|
|
6
6
|
* @template {import("./index.d.ts").OneOrMany<import("./index.d.ts").EventType>} T
|
|
7
7
|
* @template [M=string]
|
|
8
|
+
* @template {import("./index.d.ts").ValidatableField} [E=import("./index.d.ts").ValidatableField]
|
|
8
9
|
* @param {T} types
|
|
9
|
-
* @param {import("./index.d.ts").FormValidityObserverOptions<M>} [options]
|
|
10
|
+
* @param {import("./index.d.ts").FormValidityObserverOptions<M, E>} [options]
|
|
10
11
|
* @returns {import("./types.d.ts").VueFormValidityObserver<M>}
|
|
11
12
|
*/
|
|
12
13
|
export default function createFormValidityObserver(types, options) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@form-observer/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "Convenience functions for the `@form-observer/core` package, designed for Vue apps",
|
|
7
7
|
"exports": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@form-observer/core": "^0.
|
|
32
|
+
"@form-observer/core": "^0.7.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@testing-library/vue": "^8.0.
|
|
36
|
-
"@vitejs/plugin-vue": "^
|
|
35
|
+
"@testing-library/vue": "^8.0.2",
|
|
36
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
37
37
|
"vue": "^3.3.6"
|
|
38
38
|
},
|
|
39
39
|
"author": "Isaiah Thomason",
|
package/types.d.cts
CHANGED
|
@@ -6,7 +6,8 @@ export interface VueFormValidityObserver<M = string> extends Omit<FormValidityOb
|
|
|
6
6
|
* An enhanced version of {@link FormValidityObserver.configure} for `Vue`. In addition to configuring a field's
|
|
7
7
|
* error messages, it generates the props that should be applied to the field based on the provided arguments.
|
|
8
8
|
*
|
|
9
|
-
* Note: If the field is _only_ using the browser's default error messages,
|
|
9
|
+
* Note: If the field is _only_ using the configured `defaultErrors` and/or the browser's default error messages,
|
|
10
|
+
* it _does not_ need to be `configure`d.
|
|
10
11
|
*
|
|
11
12
|
* @param name The `name` of the form field
|
|
12
13
|
* @param errorMessages A `key`-`value` pair of validation constraints (key) and their corresponding
|
|
@@ -36,7 +37,7 @@ export interface VueFormValidityObserver<M = string> extends Omit<FormValidityOb
|
|
|
36
37
|
* <input name="first-name" type="textbox" required />
|
|
37
38
|
* </form>
|
|
38
39
|
*/
|
|
39
|
-
autoObserve(novalidate?: boolean): (formRef: HTMLFormElement) => void;
|
|
40
|
+
autoObserve(novalidate?: boolean): (formRef: HTMLFormElement | null) => void;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
export type VueFieldProps = Pick<
|
package/types.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export interface VueFormValidityObserver<M = string> extends Omit<FormValidityOb
|
|
|
6
6
|
* An enhanced version of {@link FormValidityObserver.configure} for `Vue`. In addition to configuring a field's
|
|
7
7
|
* error messages, it generates the props that should be applied to the field based on the provided arguments.
|
|
8
8
|
*
|
|
9
|
-
* Note: If the field is _only_ using the browser's default error messages,
|
|
9
|
+
* Note: If the field is _only_ using the configured `defaultErrors` and/or the browser's default error messages,
|
|
10
|
+
* it _does not_ need to be `configure`d.
|
|
10
11
|
*
|
|
11
12
|
* @param name The `name` of the form field
|
|
12
13
|
* @param errorMessages A `key`-`value` pair of validation constraints (key) and their corresponding
|
|
@@ -36,7 +37,7 @@ export interface VueFormValidityObserver<M = string> extends Omit<FormValidityOb
|
|
|
36
37
|
* <input name="first-name" type="textbox" required />
|
|
37
38
|
* </form>
|
|
38
39
|
*/
|
|
39
|
-
autoObserve(novalidate?: boolean): (formRef: HTMLFormElement) => void;
|
|
40
|
+
autoObserve(novalidate?: boolean): (formRef: HTMLFormElement | null) => void;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
export type VueFieldProps = Pick<
|