@graphcommerce/react-hook-form 6.2.0-canary.87 → 6.2.0-canary.89
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/react-hook-form",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.89",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"react-hook-form": "7.44.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
20
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
21
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
19
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.89",
|
|
20
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.89",
|
|
21
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.89",
|
|
22
22
|
"@testing-library/react": "^14.0.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
2
1
|
import { cloneDeep } from '@apollo/client/utilities'
|
|
2
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3
3
|
import { useMemoObject } from '@graphcommerce/next-ui/hooks/useMemoObject'
|
|
4
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
5
|
import { debounce } from '@mui/material'
|
|
5
6
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
6
7
|
import {
|
|
@@ -101,21 +102,27 @@ export type FormAutoSubmitProps<
|
|
|
101
102
|
TFieldValues extends FieldValues = FieldValues,
|
|
102
103
|
TFieldNames extends readonly FieldPath<TFieldValues>[] = readonly FieldPath<TFieldValues>[],
|
|
103
104
|
> = {
|
|
105
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
104
106
|
control: Control<TFieldValues>
|
|
105
107
|
/** Autosubmit only when these field names update */
|
|
108
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
106
109
|
name?: readonly [...TFieldNames]
|
|
107
110
|
|
|
111
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
108
112
|
disabled?: boolean
|
|
109
113
|
|
|
114
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
110
115
|
exact?: boolean
|
|
111
116
|
|
|
112
117
|
/** SubmitHandler */
|
|
118
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
113
119
|
submit: ReturnType<UseFormReturn<TFieldValues>['handleSubmit']>
|
|
114
120
|
|
|
115
121
|
/**
|
|
116
122
|
* When a current submission is already in flight, should we wait for it to finish before
|
|
117
123
|
* submitting again?
|
|
118
124
|
*/
|
|
125
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
119
126
|
parallel?: boolean
|
|
120
127
|
} & DebounceOptions
|
|
121
128
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
1
2
|
import useEventCallback from '@mui/utils/useEventCallback'
|
|
2
3
|
import { useEffect, useRef } from 'react'
|
|
3
4
|
import debounce, { DebounceOptions } from './debounce'
|
|
@@ -6,7 +7,7 @@ export function useDebouncedCallback<T extends (...args: unknown[]) => unknown>(
|
|
|
6
7
|
callback: T,
|
|
7
8
|
{ initialWait, maxWait, wait }: DebounceOptions = {},
|
|
8
9
|
): T {
|
|
9
|
-
const func = useEventCallback(callback)
|
|
10
|
+
const func = useEventCallback(callback)
|
|
10
11
|
|
|
11
12
|
const debounced = useRef(debounce({ func, initialWait, maxWait, wait }))
|
|
12
13
|
|