@griddo/ax 11.4.8 → 11.4.9-rc.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.
- package/package.json +105 -111
- 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.9-rc.1",
|
|
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
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/draft-js": "^0.10.44",
|
|
55
|
-
"@types/lodash.isequal": "^4.5.5",
|
|
56
|
-
"@types/markdown-draft-js": "^2.2.2",
|
|
47
|
+
"@types/compress.js": "1.1.3",
|
|
48
|
+
"@types/draft-js": "0.11.18",
|
|
49
|
+
"@types/lodash.isequal": "4.5.8",
|
|
50
|
+
"@types/markdown-draft-js": "2.2.7",
|
|
57
51
|
"@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": "
|
|
52
|
+
"@types/react": "18.2.79",
|
|
53
|
+
"@types/react-beautiful-dnd": "13.1.3",
|
|
54
|
+
"@types/react-datepicker": "4.19.6",
|
|
55
|
+
"@types/react-dom": "18.2.25",
|
|
56
|
+
"@types/react-draft-wysiwyg": "1.13.8",
|
|
57
|
+
"@types/react-redux": "7.1.25",
|
|
64
58
|
"@types/react-router-dom": "5.3.3",
|
|
65
|
-
"@types/react-
|
|
66
|
-
"@types/react-slick": "^0.23.10",
|
|
59
|
+
"@types/react-slick": "0.23.13",
|
|
67
60
|
"@types/react-test-renderer": "17.0.1",
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/
|
|
70
|
-
"
|
|
71
|
-
"@types/webpack-env": "^1.14.1",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
73
|
-
"@typescript-eslint/parser": "7.18.0",
|
|
74
|
-
"add": "^2.0.6",
|
|
61
|
+
"@types/styled-components": "5.1.26",
|
|
62
|
+
"@types/webpack-env": "1.18.0",
|
|
63
|
+
"add": "2.0.6",
|
|
75
64
|
"axios": "0.19.0",
|
|
76
|
-
"babel-
|
|
77
|
-
"babel-loader": "8.2.2",
|
|
78
|
-
"babel-plugin-named-asset-import": "^0.3.7",
|
|
79
|
-
"babel-plugin-require-context-hook": "^1.0.0",
|
|
80
|
-
"babel-plugin-root-import": "^6.4.1",
|
|
81
|
-
"babel-plugin-styled-components": "^1.13.2",
|
|
82
|
-
"babel-preset-react-app": "^10.0.0",
|
|
65
|
+
"babel-preset-react-app": "10.1.0",
|
|
83
66
|
"case-sensitive-paths-webpack-plugin": "2.4.0",
|
|
84
|
-
"compress.js": "
|
|
85
|
-
"connected-react-router": "
|
|
86
|
-
"css-loader": "
|
|
67
|
+
"compress.js": "1.2.2",
|
|
68
|
+
"connected-react-router": "6.9.3",
|
|
69
|
+
"css-loader": "4.3.0",
|
|
87
70
|
"css-minimizer-webpack-plugin": "3.0.2",
|
|
88
|
-
"date-fns": "
|
|
71
|
+
"date-fns": "2.30.0",
|
|
89
72
|
"dotenv": "6.2.0",
|
|
90
73
|
"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": "
|
|
74
|
+
"draft-js": "0.11.7",
|
|
75
|
+
"draft-js-import-html": "1.4.1",
|
|
76
|
+
"draftjs-to-html": "0.9.1",
|
|
77
|
+
"enhanced-resolve": "5.18.1",
|
|
78
|
+
"env-cmd": "10.1.0",
|
|
79
|
+
"file-loader": "6.2.0",
|
|
80
|
+
"find-up": "5.0.0",
|
|
98
81
|
"fs-extra": "7.0.1",
|
|
99
|
-
"html-to-draftjs": "
|
|
100
|
-
"html-to-image": "
|
|
82
|
+
"html-to-draftjs": "1.5.0",
|
|
83
|
+
"html-to-image": "1.11.7",
|
|
101
84
|
"html-webpack-plugin": "4.5.0",
|
|
102
85
|
"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",
|
|
86
|
+
"ignore-loader": "0.1.2",
|
|
87
|
+
"is-wsl": "3.1.0",
|
|
88
|
+
"jsdom": "20.0.3",
|
|
89
|
+
"jsdom-global": "3.0.2",
|
|
111
90
|
"lodash.isequal": "4.5.0",
|
|
112
|
-
"markdown-draft-js": "
|
|
113
|
-
"masonic": "
|
|
91
|
+
"markdown-draft-js": "2.4.0",
|
|
92
|
+
"masonic": "4.1.0",
|
|
114
93
|
"mini-css-extract-plugin": "0.11.3",
|
|
115
|
-
"optimize-css-assets-webpack-plugin": "
|
|
116
|
-
"pkg-dir": "
|
|
117
|
-
"pnp-webpack-plugin": "
|
|
94
|
+
"optimize-css-assets-webpack-plugin": "6.0.1",
|
|
95
|
+
"pkg-dir": "5.0.0",
|
|
96
|
+
"pnp-webpack-plugin": "1.7.0",
|
|
118
97
|
"polished": "3.4.1",
|
|
119
|
-
"postcss": "
|
|
98
|
+
"postcss": "8.5.3",
|
|
120
99
|
"postcss-flexbugs-fixes": "4.1.0",
|
|
121
100
|
"postcss-loader": "3.0.0",
|
|
122
101
|
"postcss-normalize": "7.0.1",
|
|
123
102
|
"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": "
|
|
103
|
+
"postcss-safe-parser": "6.0.0",
|
|
104
|
+
"react": "18.2.0",
|
|
105
|
+
"react-app-polyfill": "1.0.6",
|
|
106
|
+
"react-beautiful-dnd": "13.1.1",
|
|
107
|
+
"react-datepicker": "4.25.0",
|
|
108
|
+
"react-dev-utils": "11.0.4",
|
|
109
|
+
"react-dom": "18.2.0",
|
|
110
|
+
"react-draft-wysiwyg": "1.15.0",
|
|
132
111
|
"react-error-boundary": "4.0.13",
|
|
133
|
-
"react-
|
|
134
|
-
"react-
|
|
135
|
-
"react-
|
|
136
|
-
"react-refresh": "^0.10.0",
|
|
112
|
+
"react-froala-wysiwyg": "3.2.7",
|
|
113
|
+
"react-redux": "7.2.9",
|
|
114
|
+
"react-refresh": "0.14.2",
|
|
137
115
|
"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.
|
|
116
|
+
"react-select": "5.10.1",
|
|
117
|
+
"react-slick": "0.30.3",
|
|
118
|
+
"react-textarea-autosize": "8.5.9",
|
|
119
|
+
"redux": "4.2.1",
|
|
120
|
+
"redux-devtools-extension": "2.13.9",
|
|
143
121
|
"redux-persist": "6.0.0",
|
|
144
|
-
"redux-thunk": "^2.4.1",
|
|
145
122
|
"reflect-metadata": "0.1.13",
|
|
146
|
-
"resolve": "
|
|
147
|
-
"resolve-url-loader": "
|
|
148
|
-
"sass-alias": "
|
|
149
|
-
"sass-loader": "
|
|
123
|
+
"resolve": "1.22.10",
|
|
124
|
+
"resolve-url-loader": "4.0.0",
|
|
125
|
+
"sass-alias": "1.0.5",
|
|
126
|
+
"sass-loader": "10.4.1",
|
|
150
127
|
"semver": "7.6.3",
|
|
151
128
|
"slick-carousel": "1.8.1",
|
|
152
|
-
"source-map-loader": "
|
|
153
|
-
"string-replace-loader": "
|
|
154
|
-
"style-loader": "
|
|
155
|
-
"styled-components": "
|
|
129
|
+
"source-map-loader": "1.1.3",
|
|
130
|
+
"string-replace-loader": "3.1.0",
|
|
131
|
+
"style-loader": "1.3.0",
|
|
132
|
+
"styled-components": "5.3.11",
|
|
156
133
|
"styled-reset": "4.0.1",
|
|
157
134
|
"styled-system": "5.1.5",
|
|
158
135
|
"terser-webpack-plugin": "1.4.1",
|
|
159
136
|
"ts-pnp": "1.1.4",
|
|
160
|
-
"typescript": "^4.6.3",
|
|
161
137
|
"url-loader": "4.1.1",
|
|
162
|
-
"
|
|
163
|
-
"webpack": "4.44.2",
|
|
138
|
+
"webpack": "4.47.0",
|
|
164
139
|
"webpack-dev-server": "3.11.1",
|
|
165
140
|
"webpack-manifest-plugin": "2.2.0",
|
|
166
141
|
"workbox-webpack-plugin": "5.1.4"
|
|
167
142
|
},
|
|
168
143
|
"devDependencies": {
|
|
169
|
-
"@babel/core": "
|
|
170
|
-
"@babel/
|
|
171
|
-
"@babel/preset-
|
|
172
|
-
"@
|
|
173
|
-
"@
|
|
174
|
-
"
|
|
175
|
-
"
|
|
144
|
+
"@babel/core": "7.26.10",
|
|
145
|
+
"@babel/plugin-transform-optional-chaining": "7.25.9",
|
|
146
|
+
"@babel/preset-env": "7.26.9",
|
|
147
|
+
"@babel/preset-react": "7.26.3",
|
|
148
|
+
"@babel/preset-typescript": "7.26.0",
|
|
149
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
150
|
+
"@testing-library/react": "13.4.0",
|
|
151
|
+
"@testing-library/user-event": "14.6.1",
|
|
152
|
+
"@types/jest": "27.5.2",
|
|
153
|
+
"@types/redux-mock-store": "1.0.3",
|
|
154
|
+
"@types/uuid": "8.3.4",
|
|
155
|
+
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
156
|
+
"@typescript-eslint/parser": "7.18.0",
|
|
157
|
+
"axios-mock-adapter": "1.22.0",
|
|
158
|
+
"babel-eslint": "10.0.3",
|
|
159
|
+
"babel-jest": "27.5.1",
|
|
160
|
+
"babel-loader": "8.2.2",
|
|
161
|
+
"babel-plugin-named-asset-import": "0.3.8",
|
|
162
|
+
"babel-plugin-require-context-hook": "1.0.0",
|
|
163
|
+
"babel-plugin-root-import": "6.6.0",
|
|
164
|
+
"babel-plugin-styled-components": "2.1.4",
|
|
176
165
|
"eslint": "8.57.1",
|
|
177
|
-
"eslint-
|
|
178
|
-
"eslint-plugin-
|
|
179
|
-
"eslint-plugin-
|
|
180
|
-
"eslint-plugin-react": "
|
|
181
|
-
"
|
|
182
|
-
"jest": "
|
|
183
|
-
"jest-
|
|
184
|
-
"jest-
|
|
166
|
+
"eslint-plugin-import": "2.31.0",
|
|
167
|
+
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
168
|
+
"eslint-plugin-react": "7.37.5",
|
|
169
|
+
"eslint-plugin-react-hooks": "4.6.2",
|
|
170
|
+
"jest": "27.5.1",
|
|
171
|
+
"jest-environment-jsdom": "27.5.1",
|
|
172
|
+
"jest-environment-jsdom-fourteen": "0.1.0",
|
|
173
|
+
"jest-mock-extended": "2.0.9",
|
|
174
|
+
"jest-resolve": "24.9.0",
|
|
175
|
+
"jest-styled-components": "7.1.1",
|
|
176
|
+
"jest-watch-typeahead": "0.4.0",
|
|
185
177
|
"prettier": "3.4.2",
|
|
186
|
-
"react-test-
|
|
187
|
-
"
|
|
188
|
-
"redux-
|
|
189
|
-
"ts-jest": "
|
|
190
|
-
"ts-node": "
|
|
178
|
+
"react-test-renderer": "18.2.0",
|
|
179
|
+
"redux-mock-store": "1.5.5",
|
|
180
|
+
"redux-thunk": "2.4.2",
|
|
181
|
+
"ts-jest": "27.1.5",
|
|
182
|
+
"ts-node": "10.9.2",
|
|
183
|
+
"typescript": "4.9.5",
|
|
184
|
+
"uuid": "8.3.2"
|
|
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": "73dad5d18cf5e1fced7493dd1d040e0cd63de47c"
|
|
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};
|