@graphcommerce/ecommerce-ui 9.0.0-canary.87 → 9.0.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
|
@@ -4,6 +4,8 @@ import React, { MouseEventHandler } from 'react'
|
|
|
4
4
|
|
|
5
5
|
export type ActionCardItemBase = Pick<ActionCardProps, 'value'>
|
|
6
6
|
|
|
7
|
+
export type ActionCardDisableDeselectOption = { disableDeselectOption?: boolean }
|
|
8
|
+
|
|
7
9
|
export type ActionCardItemRenderProps<T> = ActionCardProps & {
|
|
8
10
|
onReset: MouseEventHandler<HTMLElement>
|
|
9
11
|
} & T
|
|
@@ -15,7 +17,7 @@ export type ActionCardListFormProps<A, F extends FieldValues = FieldValues> = Om
|
|
|
15
17
|
Omit<ControllerProps<F>, 'render'> & {
|
|
16
18
|
items: A[]
|
|
17
19
|
render: React.FC<ActionCardItemRenderProps<A>>
|
|
18
|
-
}
|
|
20
|
+
} & ActionCardDisableDeselectOption
|
|
19
21
|
|
|
20
22
|
export function ActionCardListForm<
|
|
21
23
|
T extends ActionCardItemBase,
|
|
@@ -33,6 +35,7 @@ export function ActionCardListForm<
|
|
|
33
35
|
multiple,
|
|
34
36
|
disabled,
|
|
35
37
|
shouldUnregister,
|
|
38
|
+
disableDeselectOption,
|
|
36
39
|
...other
|
|
37
40
|
} = props
|
|
38
41
|
const RenderItem = render as React.FC<ActionCardItemRenderProps<ActionCardItemBase>>
|
|
@@ -76,7 +79,7 @@ export function ActionCardListForm<
|
|
|
76
79
|
selected={onSelect(item.value, value)}
|
|
77
80
|
onReset={(e) => {
|
|
78
81
|
e.preventDefault()
|
|
79
|
-
onChange(null)
|
|
82
|
+
if (!disableDeselectOption) onChange(null)
|
|
80
83
|
}}
|
|
81
84
|
/>
|
|
82
85
|
))}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/ecommerce-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.0-canary.
|
|
5
|
+
"version": "9.0.0-canary.89",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
|
16
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
|
17
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
|
18
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
|
19
|
-
"@graphcommerce/react-hook-form": "^9.0.0-canary.
|
|
20
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.89",
|
|
16
|
+
"@graphcommerce/graphql": "^9.0.0-canary.89",
|
|
17
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.89",
|
|
18
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.89",
|
|
19
|
+
"@graphcommerce/react-hook-form": "^9.0.0-canary.89",
|
|
20
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.89",
|
|
21
21
|
"@lingui/core": "^4.2.1",
|
|
22
22
|
"@lingui/macro": "^4.2.1",
|
|
23
23
|
"@lingui/react": "^4.2.1",
|