@griddo/ax 11.4.9 → 11.4.10
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/package.json +102 -108
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.test.tsx +1 -0
- package/src/api/navigation.tsx +4 -4
- package/src/api/utils.tsx +6 -5
- package/src/components/Fields/AsyncSelect/index.tsx +4 -4
- package/src/components/Fields/AsyncSelect/style.tsx +2 -3
- package/src/components/Fields/DateField/style.tsx +6 -0
- package/src/components/Fields/Select/index.tsx +2 -2
- package/src/components/Fields/Select/style.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "11.4.
|
|
4
|
+
"version": "11.4.10",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
|
-
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
8
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
9
8
|
"Francis Vega <francis.vega@secuoyas.com>",
|
|
10
9
|
"Gonzalo Hernández <gonzalo.hernandez@secuoyas.com>",
|
|
@@ -41,153 +40,148 @@
|
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@atlaskit/tree": "8.12.0",
|
|
44
|
-
"@
|
|
45
|
-
"@babel/preset-react": "^7.14.5",
|
|
46
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.0-rc.0",
|
|
43
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
|
|
47
44
|
"@styled-system/prop-types": "5.1.5",
|
|
48
45
|
"@styled-system/theme-get": "5.1.2",
|
|
49
46
|
"@svgr/webpack": "5.5.0",
|
|
50
|
-
"@testing-library/jest-dom": "
|
|
51
|
-
"@testing-library/react": "
|
|
52
|
-
"@testing-library/user-event": "
|
|
53
|
-
"@types/compress.js": "
|
|
54
|
-
"@types/draft-js": "
|
|
55
|
-
"@types/lodash.isequal": "
|
|
56
|
-
"@types/markdown-draft-js": "
|
|
47
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
48
|
+
"@testing-library/react": "13.4.0",
|
|
49
|
+
"@testing-library/user-event": "14.6.1",
|
|
50
|
+
"@types/compress.js": "1.1.3",
|
|
51
|
+
"@types/draft-js": "0.11.18",
|
|
52
|
+
"@types/lodash.isequal": "4.5.8",
|
|
53
|
+
"@types/markdown-draft-js": "2.2.7",
|
|
57
54
|
"@types/node": "20.17.10",
|
|
58
|
-
"@types/react": "18.2.
|
|
59
|
-
"@types/react-beautiful-dnd": "
|
|
60
|
-
"@types/react-datepicker": "
|
|
61
|
-
"@types/react-dom": "18.
|
|
62
|
-
"@types/react-draft-wysiwyg": "
|
|
63
|
-
"@types/react-redux": "
|
|
55
|
+
"@types/react": "18.2.79",
|
|
56
|
+
"@types/react-beautiful-dnd": "13.1.3",
|
|
57
|
+
"@types/react-datepicker": "4.19.6",
|
|
58
|
+
"@types/react-dom": "18.2.25",
|
|
59
|
+
"@types/react-draft-wysiwyg": "1.13.8",
|
|
60
|
+
"@types/react-redux": "7.1.25",
|
|
64
61
|
"@types/react-router-dom": "5.3.3",
|
|
65
|
-
"@types/react-
|
|
66
|
-
"@types/react-slick": "^0.23.10",
|
|
62
|
+
"@types/react-slick": "0.23.13",
|
|
67
63
|
"@types/react-test-renderer": "17.0.1",
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/styled-components": "^5.1.25",
|
|
64
|
+
"@types/styled-components": "5.1.26",
|
|
70
65
|
"@types/uuid": "8.3.4",
|
|
71
|
-
"@types/webpack-env": "
|
|
72
|
-
"
|
|
73
|
-
"@typescript-eslint/parser": "7.18.0",
|
|
74
|
-
"add": "^2.0.6",
|
|
66
|
+
"@types/webpack-env": "1.18.0",
|
|
67
|
+
"add": "2.0.6",
|
|
75
68
|
"axios": "0.19.0",
|
|
76
|
-
"babel-eslint": "10.0.3",
|
|
77
69
|
"babel-loader": "8.2.2",
|
|
78
|
-
"babel-plugin-named-asset-import": "
|
|
79
|
-
"babel-plugin-require-context-hook": "
|
|
80
|
-
"babel-plugin-root-import": "
|
|
81
|
-
"babel-plugin-styled-components": "
|
|
82
|
-
"babel-preset-react-app": "
|
|
70
|
+
"babel-plugin-named-asset-import": "0.3.8",
|
|
71
|
+
"babel-plugin-require-context-hook": "1.0.0",
|
|
72
|
+
"babel-plugin-root-import": "6.6.0",
|
|
73
|
+
"babel-plugin-styled-components": "2.1.4",
|
|
74
|
+
"babel-preset-react-app": "10.1.0",
|
|
83
75
|
"case-sensitive-paths-webpack-plugin": "2.4.0",
|
|
84
|
-
"compress.js": "
|
|
85
|
-
"connected-react-router": "
|
|
86
|
-
"css-loader": "
|
|
76
|
+
"compress.js": "1.2.2",
|
|
77
|
+
"connected-react-router": "6.9.3",
|
|
78
|
+
"css-loader": "4.3.0",
|
|
87
79
|
"css-minimizer-webpack-plugin": "3.0.2",
|
|
88
|
-
"date-fns": "
|
|
80
|
+
"date-fns": "2.30.0",
|
|
89
81
|
"dotenv": "6.2.0",
|
|
90
82
|
"dotenv-expand": "5.1.0",
|
|
91
|
-
"draft-js": "
|
|
92
|
-
"draft-js-import-html": "
|
|
93
|
-
"draftjs-to-html": "
|
|
94
|
-
"enhanced-resolve": "
|
|
95
|
-
"env-cmd": "
|
|
96
|
-
"file-loader": "
|
|
97
|
-
"find-up": "
|
|
83
|
+
"draft-js": "0.11.7",
|
|
84
|
+
"draft-js-import-html": "1.4.1",
|
|
85
|
+
"draftjs-to-html": "0.9.1",
|
|
86
|
+
"enhanced-resolve": "5.18.1",
|
|
87
|
+
"env-cmd": "10.1.0",
|
|
88
|
+
"file-loader": "6.2.0",
|
|
89
|
+
"find-up": "5.0.0",
|
|
98
90
|
"fs-extra": "7.0.1",
|
|
99
|
-
"html-to-draftjs": "
|
|
100
|
-
"html-to-image": "
|
|
91
|
+
"html-to-draftjs": "1.5.0",
|
|
92
|
+
"html-to-image": "1.11.7",
|
|
101
93
|
"html-webpack-plugin": "4.5.0",
|
|
102
94
|
"identity-obj-proxy": "3.0.0",
|
|
103
|
-
"ignore-loader": "
|
|
104
|
-
"is-wsl": "
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"jest-resolve": "24.9.0",
|
|
108
|
-
"jest-watch-typeahead": "0.4.0",
|
|
109
|
-
"jsdom": "^19.0.0",
|
|
110
|
-
"jsdom-global": "^3.0.2",
|
|
95
|
+
"ignore-loader": "0.1.2",
|
|
96
|
+
"is-wsl": "3.1.0",
|
|
97
|
+
"jsdom": "20.0.3",
|
|
98
|
+
"jsdom-global": "3.0.2",
|
|
111
99
|
"lodash.isequal": "4.5.0",
|
|
112
|
-
"markdown-draft-js": "
|
|
113
|
-
"masonic": "
|
|
100
|
+
"markdown-draft-js": "2.4.0",
|
|
101
|
+
"masonic": "4.1.0",
|
|
114
102
|
"mini-css-extract-plugin": "0.11.3",
|
|
115
|
-
"optimize-css-assets-webpack-plugin": "
|
|
116
|
-
"pkg-dir": "
|
|
117
|
-
"pnp-webpack-plugin": "
|
|
103
|
+
"optimize-css-assets-webpack-plugin": "6.0.1",
|
|
104
|
+
"pkg-dir": "5.0.0",
|
|
105
|
+
"pnp-webpack-plugin": "1.7.0",
|
|
118
106
|
"polished": "3.4.1",
|
|
119
|
-
"postcss": "
|
|
107
|
+
"postcss": "8.5.3",
|
|
120
108
|
"postcss-flexbugs-fixes": "4.1.0",
|
|
121
109
|
"postcss-loader": "3.0.0",
|
|
122
110
|
"postcss-normalize": "7.0.1",
|
|
123
111
|
"postcss-preset-env": "6.7.0",
|
|
124
|
-
"postcss-safe-parser": "
|
|
125
|
-
"react": "18.
|
|
126
|
-
"react-app-polyfill": "
|
|
127
|
-
"react-beautiful-dnd": "
|
|
128
|
-
"react-datepicker": "
|
|
129
|
-
"react-dev-utils": "
|
|
130
|
-
"react-dom": "18.
|
|
131
|
-
"react-draft-wysiwyg": "
|
|
112
|
+
"postcss-safe-parser": "6.0.0",
|
|
113
|
+
"react": "18.2.0",
|
|
114
|
+
"react-app-polyfill": "1.0.6",
|
|
115
|
+
"react-beautiful-dnd": "13.1.1",
|
|
116
|
+
"react-datepicker": "4.25.0",
|
|
117
|
+
"react-dev-utils": "11.0.4",
|
|
118
|
+
"react-dom": "18.2.0",
|
|
119
|
+
"react-draft-wysiwyg": "1.15.0",
|
|
132
120
|
"react-error-boundary": "4.0.13",
|
|
133
|
-
"react-
|
|
134
|
-
"react-
|
|
135
|
-
"react-
|
|
136
|
-
"react-refresh": "^0.10.0",
|
|
121
|
+
"react-froala-wysiwyg": "3.2.7",
|
|
122
|
+
"react-redux": "7.2.9",
|
|
123
|
+
"react-refresh": "0.14.2",
|
|
137
124
|
"react-router-dom": "5.1.2",
|
|
138
|
-
"react-select": "
|
|
139
|
-
"react-slick": "
|
|
140
|
-
"react-textarea-autosize": "
|
|
141
|
-
"redux": "4.
|
|
142
|
-
"redux-devtools-extension": "2.13.
|
|
125
|
+
"react-select": "5.10.1",
|
|
126
|
+
"react-slick": "0.30.3",
|
|
127
|
+
"react-textarea-autosize": "8.5.9",
|
|
128
|
+
"redux": "4.2.1",
|
|
129
|
+
"redux-devtools-extension": "2.13.9",
|
|
143
130
|
"redux-persist": "6.0.0",
|
|
144
|
-
"redux-thunk": "^2.4.1",
|
|
145
131
|
"reflect-metadata": "0.1.13",
|
|
146
|
-
"resolve": "
|
|
147
|
-
"resolve-url-loader": "
|
|
148
|
-
"sass-alias": "
|
|
149
|
-
"sass-loader": "
|
|
132
|
+
"resolve": "1.22.10",
|
|
133
|
+
"resolve-url-loader": "4.0.0",
|
|
134
|
+
"sass-alias": "1.0.5",
|
|
135
|
+
"sass-loader": "10.4.1",
|
|
150
136
|
"semver": "7.6.3",
|
|
151
137
|
"slick-carousel": "1.8.1",
|
|
152
|
-
"source-map-loader": "
|
|
153
|
-
"string-replace-loader": "
|
|
154
|
-
"style-loader": "
|
|
155
|
-
"styled-components": "
|
|
138
|
+
"source-map-loader": "1.1.3",
|
|
139
|
+
"string-replace-loader": "3.1.0",
|
|
140
|
+
"style-loader": "1.3.0",
|
|
141
|
+
"styled-components": "5.3.11",
|
|
156
142
|
"styled-reset": "4.0.1",
|
|
157
143
|
"styled-system": "5.1.5",
|
|
158
144
|
"terser-webpack-plugin": "1.4.1",
|
|
159
145
|
"ts-pnp": "1.1.4",
|
|
160
|
-
"typescript": "^4.6.3",
|
|
161
146
|
"url-loader": "4.1.1",
|
|
162
147
|
"uuid": "8.3.2",
|
|
163
|
-
"webpack": "4.
|
|
148
|
+
"webpack": "4.47.0",
|
|
164
149
|
"webpack-dev-server": "3.11.1",
|
|
165
150
|
"webpack-manifest-plugin": "2.2.0",
|
|
166
151
|
"workbox-webpack-plugin": "5.1.4"
|
|
167
152
|
},
|
|
168
153
|
"devDependencies": {
|
|
169
|
-
"@babel/core": "
|
|
170
|
-
"@babel/
|
|
171
|
-
"@babel/preset-
|
|
172
|
-
"@
|
|
173
|
-
"@
|
|
174
|
-
"
|
|
175
|
-
"
|
|
154
|
+
"@babel/core": "7.26.10",
|
|
155
|
+
"@babel/plugin-transform-optional-chaining": "7.25.9",
|
|
156
|
+
"@babel/preset-env": "7.26.9",
|
|
157
|
+
"@babel/preset-react": "7.26.3",
|
|
158
|
+
"@babel/preset-typescript": "7.26.0",
|
|
159
|
+
"@types/jest": "27.5.2",
|
|
160
|
+
"@types/redux-mock-store": "1.0.3",
|
|
161
|
+
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
162
|
+
"@typescript-eslint/parser": "7.18.0",
|
|
163
|
+
"axios-mock-adapter": "1.22.0",
|
|
164
|
+
"babel-eslint": "10.0.3",
|
|
165
|
+
"babel-jest": "27.5.1",
|
|
176
166
|
"eslint": "8.57.1",
|
|
177
|
-
"eslint-
|
|
178
|
-
"eslint-plugin-
|
|
179
|
-
"eslint-plugin-
|
|
180
|
-
"eslint-plugin-react": "
|
|
181
|
-
"
|
|
182
|
-
"jest": "
|
|
183
|
-
"jest-
|
|
184
|
-
"jest-
|
|
167
|
+
"eslint-plugin-import": "2.31.0",
|
|
168
|
+
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
169
|
+
"eslint-plugin-react": "7.37.5",
|
|
170
|
+
"eslint-plugin-react-hooks": "4.6.2",
|
|
171
|
+
"jest": "27.5.1",
|
|
172
|
+
"jest-environment-jsdom": "27.5.1",
|
|
173
|
+
"jest-environment-jsdom-fourteen": "0.1.0",
|
|
174
|
+
"jest-mock-extended": "2.0.9",
|
|
175
|
+
"jest-resolve": "24.9.0",
|
|
176
|
+
"jest-styled-components": "7.1.1",
|
|
177
|
+
"jest-watch-typeahead": "0.4.0",
|
|
185
178
|
"prettier": "3.4.2",
|
|
186
|
-
"react-test-
|
|
187
|
-
"
|
|
188
|
-
"redux-
|
|
189
|
-
"ts-jest": "
|
|
190
|
-
"ts-node": "
|
|
179
|
+
"react-test-renderer": "18.2.0",
|
|
180
|
+
"redux-mock-store": "1.5.5",
|
|
181
|
+
"redux-thunk": "2.4.2",
|
|
182
|
+
"ts-jest": "27.1.5",
|
|
183
|
+
"ts-node": "10.9.2",
|
|
184
|
+
"typescript": "4.9.5"
|
|
191
185
|
},
|
|
192
186
|
"babel": {
|
|
193
187
|
"presets": [
|
|
@@ -226,5 +220,5 @@
|
|
|
226
220
|
"publishConfig": {
|
|
227
221
|
"access": "public"
|
|
228
222
|
},
|
|
229
|
-
"gitHead": "
|
|
223
|
+
"gitHead": "54b82fbf4b274ca6ba913f5fda750ed6b6b37962"
|
|
230
224
|
}
|
package/src/api/navigation.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { template } from "./config";
|
|
2
|
-
import { IServiceConfig, sendRequest } from "./utils";
|
|
2
|
+
import { IServiceConfig, sendRequest, sendUploadRequest } from "./utils";
|
|
3
3
|
|
|
4
4
|
const SERVICES: { [key: string]: IServiceConfig } = {
|
|
5
5
|
GET_NAVIGATION: {
|
|
@@ -113,14 +113,14 @@ const getFooters = (siteID: number, params?: any) => {
|
|
|
113
113
|
return sendRequest(SERVICES.GET_FOOTERS);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
const createNavigation = (data:
|
|
116
|
+
const createNavigation = (data: FormData) => sendUploadRequest(SERVICES.CREATE_NAVIGATION, data);
|
|
117
117
|
|
|
118
|
-
const updateNavigation = (navID: number, data:
|
|
118
|
+
const updateNavigation = (navID: number, data: FormData) => {
|
|
119
119
|
const { host, endpoint } = SERVICES.UPDATE_NAVIGATION;
|
|
120
120
|
|
|
121
121
|
SERVICES.UPDATE_NAVIGATION.dynamicUrl = `${host}${endpoint}${navID}`;
|
|
122
122
|
|
|
123
|
-
return
|
|
123
|
+
return sendUploadRequest(SERVICES.UPDATE_NAVIGATION, data);
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
const deleteNavigation = (navID: number) => {
|
package/src/api/utils.tsx
CHANGED
|
@@ -31,7 +31,7 @@ const getLang = (): Record<string, unknown> => {
|
|
|
31
31
|
return { lang };
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const getHeaders = (headers: Record<string, unknown>, hasToken: boolean)
|
|
34
|
+
const getHeaders = (headers: Record<string, unknown>, hasToken: boolean) => {
|
|
35
35
|
return hasToken
|
|
36
36
|
? {
|
|
37
37
|
...headers,
|
|
@@ -57,7 +57,7 @@ const wrapConfig = (serviceConfig: IServiceConfig): AxiosRequestConfig => {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
class RequestCache {
|
|
60
|
+
/*class RequestCache {
|
|
61
61
|
private _cacheTime = 1; // SECONDS
|
|
62
62
|
private _cache: { [key: string]: { timestamp: number; value: string } } = {};
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ class RequestCache {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const requestCache = new RequestCache()
|
|
83
|
+
const requestCache = new RequestCache();*/
|
|
84
84
|
|
|
85
85
|
export const sendInitialRequest = async (
|
|
86
86
|
serviceConfig: IServiceConfig,
|
|
@@ -118,9 +118,10 @@ export const sendRequest = async (
|
|
|
118
118
|
dataHeader?: Record<string, unknown>
|
|
119
119
|
): Promise<AxiosResponse> => {
|
|
120
120
|
let config = wrapConfig(serviceConfig);
|
|
121
|
+
const headers = { ...config.headers, ...dataHeader };
|
|
121
122
|
|
|
122
123
|
if (dataHeader) {
|
|
123
|
-
config = { ...config, headers
|
|
124
|
+
config = { ...config, headers };
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
try {
|
|
@@ -164,7 +165,7 @@ export const sendUploadRequest = async (
|
|
|
164
165
|
if (setProgress) {
|
|
165
166
|
requestConfig = {
|
|
166
167
|
...requestConfig,
|
|
167
|
-
onUploadProgress: (progressEvent:
|
|
168
|
+
onUploadProgress: (progressEvent: ProgressEvent) => {
|
|
168
169
|
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
|
169
170
|
setProgress(percentCompleted);
|
|
170
171
|
},
|
|
@@ -94,8 +94,8 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
|
|
|
94
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
95
|
}, [entity, site, lang, selectedContent, entityId, mandatory, placeholder, filter, isCategories, isPage, options]);
|
|
96
96
|
|
|
97
|
-
const handleChange = (selectedValue:
|
|
98
|
-
const newValue = selectedValue ? selectedValue.value :
|
|
97
|
+
const handleChange = (selectedValue: unknown | null) => {
|
|
98
|
+
const newValue = selectedValue ? (selectedValue as ICheck | IOption).value : null;
|
|
99
99
|
onChange(newValue);
|
|
100
100
|
};
|
|
101
101
|
|
|
@@ -141,8 +141,8 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
|
|
|
141
141
|
error={error}
|
|
142
142
|
isDisabled={disabled}
|
|
143
143
|
className={className}
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
required={mandatory}
|
|
145
|
+
isClearable={state.hasEmptyOption}
|
|
146
146
|
isSearchable={searchable}
|
|
147
147
|
maxWidth={maxWidth}
|
|
148
148
|
inputValue={state.inputText}
|
|
@@ -68,8 +68,8 @@ export const StyledSelect = styled(AsyncSelect)<{
|
|
|
68
68
|
padding: ${(p) => `13px ${p.theme.spacing.s} 12px ${p.theme.spacing.s}`};
|
|
69
69
|
&:first-child {
|
|
70
70
|
${(p) =>
|
|
71
|
-
!p.
|
|
72
|
-
p.
|
|
71
|
+
!p.required &&
|
|
72
|
+
p.isClearable &&
|
|
73
73
|
css`
|
|
74
74
|
font-style: italic;
|
|
75
75
|
color: ${(p) => p.theme.color.textLowEmphasis};
|
|
@@ -103,7 +103,6 @@ export const StyledSelect = styled(AsyncSelect)<{
|
|
|
103
103
|
background: transparent;
|
|
104
104
|
border: none;
|
|
105
105
|
height: auto;
|
|
106
|
-
justify-content: ${(p) => (p.alignRight ? "flex-end" : "flex-start")};
|
|
107
106
|
min-width: auto;
|
|
108
107
|
|
|
109
108
|
.react-select__value-container {
|
|
@@ -49,14 +49,20 @@ export const DatePickerWrapper = styled.div`
|
|
|
49
49
|
border: none;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.react-datepicker__navigation-icon {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
&.react-datepicker__navigation--next {
|
|
53
57
|
background-image: url(/img/icons/Right-arrow.svg);
|
|
54
58
|
margin-right: ${(p) => p.theme.spacing.s};
|
|
59
|
+
margin-top: ${(p) => p.theme.spacing.xs};
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
&.react-datepicker__navigation--previous {
|
|
58
63
|
background-image: url(/img/icons/Left-arrow.svg);
|
|
59
64
|
margin-left: ${(p) => p.theme.spacing.s};
|
|
65
|
+
margin-top: ${(p) => p.theme.spacing.xs};
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
|
|
@@ -27,7 +27,7 @@ const Select = (props: ISelectProps): JSX.Element => {
|
|
|
27
27
|
|
|
28
28
|
const optionValues: IOptionProps[] = hasEmptyOption ? [emptyOption, ...options] : options;
|
|
29
29
|
|
|
30
|
-
const handleChange = (selectedValue:
|
|
30
|
+
const handleChange = (selectedValue: unknown) => onChange((selectedValue as IOptionProps).value);
|
|
31
31
|
|
|
32
32
|
const handleInputChange = (inputText: string, meta: InputActionMeta) => {
|
|
33
33
|
if (meta.action !== "input-blur" && meta.action !== "menu-close") {
|
|
@@ -57,7 +57,7 @@ const Select = (props: ISelectProps): JSX.Element => {
|
|
|
57
57
|
error={error}
|
|
58
58
|
onChange={handleChange}
|
|
59
59
|
isSearchable={searchable}
|
|
60
|
-
|
|
60
|
+
isClearable={hasEmptyOption}
|
|
61
61
|
onInputChange={handleInputChange}
|
|
62
62
|
alignRight={alignRight}
|
|
63
63
|
aria-label={name}
|
|
@@ -68,7 +68,7 @@ export const StyledSelect = styled(Select)<{
|
|
|
68
68
|
padding: ${(p) => `13px ${p.theme.spacing.s} 12px ${p.theme.spacing.s}`};
|
|
69
69
|
&:first-child {
|
|
70
70
|
${(p) =>
|
|
71
|
-
p.
|
|
71
|
+
p.isClearable &&
|
|
72
72
|
css`
|
|
73
73
|
font-style: italic;
|
|
74
74
|
color: ${(p) => p.theme.color.textLowEmphasis};
|