@graphcommerce/magento-search 3.5.4 → 3.5.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/CHANGELOG.md +22 -0
- package/CategorySearchResult/index.tsx +0 -1
- package/SearchButton/index.tsx +2 -4
- package/SearchForm/index.tsx +8 -13
- package/index.ts +0 -1
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.5.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-search@3.5.7...@graphcommerce/magento-search@3.5.8) (2021-12-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* search page ([85cf721](https://github.com/ho-nl/m2-pwa/commit/85cf72130bce4c3d2c392a3745adf05bca8618b1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [3.5.5](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-search@3.5.4...@graphcommerce/magento-search@3.5.5) (2021-12-01)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* ios zoom bug when using search. Fontsize should always be > 16 ([22abcd4](https://github.com/ho-nl/m2-pwa/commit/22abcd499b152448b3c38f84325debe07d2b9a68))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [3.5.4](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-search@3.5.3...@graphcommerce/magento-search@3.5.4) (2021-11-27)
|
|
7
29
|
|
|
8
30
|
|
package/SearchButton/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { iconSearch, responsiveVal, SvgImageSimple, UseStyles } from '@graphcommerce/next-ui'
|
|
2
2
|
import { makeStyles, TextField, TextFieldProps, Theme } from '@material-ui/core'
|
|
3
|
-
import React from 'react'
|
|
4
3
|
import clsx from 'clsx'
|
|
4
|
+
import React from 'react'
|
|
5
5
|
|
|
6
6
|
const useStyles = makeStyles(
|
|
7
7
|
(theme: Theme) => ({
|
|
@@ -16,9 +16,7 @@ const useStyles = makeStyles(
|
|
|
16
16
|
marginRight: 0,
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
|
-
inputRoot: {
|
|
20
|
-
...theme.typography.body2,
|
|
21
|
-
},
|
|
19
|
+
inputRoot: {},
|
|
22
20
|
fullWidth: {
|
|
23
21
|
width: '100%',
|
|
24
22
|
marginRight: 0,
|
package/SearchForm/index.tsx
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormRow,
|
|
3
|
-
UseStyles,
|
|
4
|
-
SvgImage,
|
|
5
|
-
iconClose,
|
|
6
|
-
iconSearch,
|
|
7
|
-
SvgImageSimple,
|
|
8
|
-
} from '@graphcommerce/next-ui'
|
|
1
|
+
import { FormRow, UseStyles, iconClose, iconSearch, SvgImageSimple } from '@graphcommerce/next-ui'
|
|
9
2
|
import { useForm, useFormAutoSubmit, useFormMuiRegister } from '@graphcommerce/react-hook-form'
|
|
10
|
-
import {
|
|
3
|
+
import { t, Plural } from '@lingui/macro'
|
|
4
|
+
import { IconButton, makeStyles, TextField, TextFieldProps, Theme } from '@material-ui/core'
|
|
11
5
|
import { useRouter } from 'next/router'
|
|
12
6
|
import React from 'react'
|
|
13
7
|
|
|
@@ -29,10 +23,11 @@ export type SearchFormProps = {
|
|
|
29
23
|
search?: string
|
|
30
24
|
urlHandle?: string
|
|
31
25
|
autoFocus?: boolean
|
|
26
|
+
textFieldProps?: TextFieldProps
|
|
32
27
|
} & UseStyles<typeof useStyles>
|
|
33
28
|
|
|
34
29
|
export default function SearchForm(props: SearchFormProps) {
|
|
35
|
-
const { totalResults = 0, search = '', urlHandle = 'search',
|
|
30
|
+
const { totalResults = 0, search = '', urlHandle = 'search', textFieldProps } = props
|
|
36
31
|
const classes = useStyles(props)
|
|
37
32
|
const router = useRouter()
|
|
38
33
|
|
|
@@ -62,7 +57,7 @@ export default function SearchForm(props: SearchFormProps) {
|
|
|
62
57
|
<>
|
|
63
58
|
{totalResults > 0 && (
|
|
64
59
|
<div className={classes.totalProducts}>
|
|
65
|
-
{totalResults}
|
|
60
|
+
<Plural value={totalResults} zero='' one='# result' other='# results' />
|
|
66
61
|
</div>
|
|
67
62
|
)}
|
|
68
63
|
<IconButton onClick={handleReset} size='small'>
|
|
@@ -86,13 +81,13 @@ export default function SearchForm(props: SearchFormProps) {
|
|
|
86
81
|
<TextField
|
|
87
82
|
variant='outlined'
|
|
88
83
|
type='text'
|
|
89
|
-
|
|
90
|
-
placeholder='Search'
|
|
84
|
+
placeholder={t`Search`}
|
|
91
85
|
defaultValue={search}
|
|
92
86
|
error={formState.isSubmitted && !!formState.errors.search}
|
|
93
87
|
helperText={formState.isSubmitted && formState.errors.search?.message}
|
|
94
88
|
{...muiRegister('search', { required: true, minLength: 2 })}
|
|
95
89
|
InputProps={{ endAdornment }}
|
|
90
|
+
{...textFieldProps}
|
|
96
91
|
/>
|
|
97
92
|
</FormRow>
|
|
98
93
|
</form>
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-search",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.8",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -14,21 +14,22 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.6",
|
|
18
18
|
"@graphcommerce/prettier-config-pwa": "^3.0.4",
|
|
19
19
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
20
20
|
"@playwright/test": "^1.16.2"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@graphcommerce/graphql": "^2.105.
|
|
24
|
-
"@graphcommerce/image": "^2.105.
|
|
25
|
-
"@graphcommerce/next-ui": "^3.
|
|
26
|
-
"@graphcommerce/react-hook-form": "^2.104.
|
|
23
|
+
"@graphcommerce/graphql": "^2.105.6",
|
|
24
|
+
"@graphcommerce/image": "^2.105.5",
|
|
25
|
+
"@graphcommerce/next-ui": "^3.20.1",
|
|
26
|
+
"@graphcommerce/react-hook-form": "^2.104.1",
|
|
27
27
|
"@lingui/macro": "^3.12.1",
|
|
28
28
|
"@material-ui/core": "^4.12.3",
|
|
29
|
+
"clsx": "^1.1.1",
|
|
29
30
|
"next": "^12.0.3",
|
|
30
31
|
"react": "^17.0.2",
|
|
31
32
|
"react-dom": "^17.0.2"
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b4bdc1cd365ebdd0bad8e1ed6afd374123bb2908"
|
|
34
35
|
}
|