@dr.pogodin/react-utils 1.36.2 → 1.38.0
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/build/development/shared/components/selectors/NativeDropdown/index.js +5 -2
- package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -1
- package/build/development/shared/components/selectors/common.js.map +1 -1
- package/build/development/style.css +11 -1
- package/build/development/web.bundle.js +2 -2
- package/build/production/shared/components/selectors/NativeDropdown/index.js +2 -2
- package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -1
- package/build/production/shared/components/selectors/common.js.map +1 -1
- package/build/production/style.css +1 -1
- package/build/production/style.css.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/shared/components/selectors/common.d.ts +1 -1
- package/build/types-scss/src/shared/components/selectors/NativeDropdown/theme.scss.d.ts +1 -0
- package/package.json +12 -12
- package/src/shared/components/selectors/NativeDropdown/index.tsx +4 -1
- package/src/shared/components/selectors/NativeDropdown/theme.scss +6 -1
- package/src/shared/components/selectors/common.ts +5 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from '@dr.pogodin/react-themes';
|
|
2
|
-
type ThemeKeyT = 'active' | 'arrow' | 'container' | 'dropdown' | 'hiddenOption' | 'label' | 'option' | 'select' | 'upward';
|
|
2
|
+
type ThemeKeyT = 'active' | 'arrow' | 'container' | 'dropdown' | 'hiddenOption' | 'label' | 'option' | 'select' | 'invalid' | 'upward';
|
|
3
3
|
export type ValueT = number | string;
|
|
4
4
|
export type OptionT<NameT> = {
|
|
5
5
|
name?: NameT | null;
|
|
@@ -6,6 +6,7 @@ export declare const context: string;
|
|
|
6
6
|
export declare const dropdown: string;
|
|
7
7
|
export declare const hiddenOption: string;
|
|
8
8
|
export declare const hoc: string;
|
|
9
|
+
export declare const invalid: string;
|
|
9
10
|
export declare const label: string;
|
|
10
11
|
export declare const option: string;
|
|
11
12
|
export declare const select: string;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.38.0",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"@dr.pogodin/babel-plugin-react-css-modules": "^6.13.2",
|
|
13
13
|
"@dr.pogodin/csurf": "^1.13.0",
|
|
14
14
|
"@dr.pogodin/js-utils": "^0.0.12",
|
|
15
|
-
"@dr.pogodin/react-global-state": "^0.
|
|
15
|
+
"@dr.pogodin/react-global-state": "^0.15.0",
|
|
16
16
|
"@dr.pogodin/react-themes": "^1.7.0",
|
|
17
17
|
"@jest/environment": "^29.7.0",
|
|
18
18
|
"axios": "^1.7.2",
|
|
19
19
|
"commander": "^12.1.0",
|
|
20
20
|
"compression": "^1.7.4",
|
|
21
|
-
"config": "^3.3.
|
|
21
|
+
"config": "^3.3.12",
|
|
22
22
|
"cookie": "^0.6.0",
|
|
23
23
|
"cookie-parser": "^1.4.6",
|
|
24
24
|
"cross-env": "^7.0.3",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"lodash": "^4.17.21",
|
|
31
31
|
"morgan": "^1.10.0",
|
|
32
32
|
"node-forge": "^1.3.1",
|
|
33
|
-
"qs": "^6.12.
|
|
33
|
+
"qs": "^6.12.2",
|
|
34
34
|
"raf": "^3.4.1",
|
|
35
35
|
"react": "^18.3.1",
|
|
36
36
|
"react-dom": "^18.3.1",
|
|
37
37
|
"react-helmet": "^6.1.0",
|
|
38
|
-
"react-router-dom": "^6.
|
|
38
|
+
"react-router-dom": "^6.24.1",
|
|
39
39
|
"request-ip": "^3.3.0",
|
|
40
40
|
"rimraf": "^5.0.7",
|
|
41
41
|
"serialize-javascript": "^6.0.2",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"@dr.pogodin/babel-plugin-transform-assets": "^1.2.2",
|
|
60
60
|
"@dr.pogodin/babel-preset-svgr": "^1.8.0",
|
|
61
61
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
|
|
62
|
-
"@testing-library/dom": "^10.
|
|
62
|
+
"@testing-library/dom": "^10.3.0",
|
|
63
63
|
"@testing-library/react": "^16.0.0",
|
|
64
64
|
"@testing-library/user-event": "^14.5.2",
|
|
65
|
-
"@tsconfig/recommended": "^1.0.
|
|
65
|
+
"@tsconfig/recommended": "^1.0.7",
|
|
66
66
|
"@types/compression": "^1.7.5",
|
|
67
67
|
"@types/config": "^3.3.4",
|
|
68
68
|
"@types/cookie": "^0.6.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/csurf": "^1.11.5",
|
|
71
71
|
"@types/express": "^4.17.21",
|
|
72
72
|
"@types/jest": "^29.5.12",
|
|
73
|
-
"@types/lodash": "^4.17.
|
|
73
|
+
"@types/lodash": "^4.17.6",
|
|
74
74
|
"@types/morgan": "^1.9.9",
|
|
75
75
|
"@types/node-forge": "^1.3.11",
|
|
76
76
|
"@types/pretty": "^2.0.3",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"mini-css-extract-plugin": "^2.9.0",
|
|
107
107
|
"mockdate": "^3.0.5",
|
|
108
108
|
"nodelist-foreach-polyfill": "^1.2.0",
|
|
109
|
-
"postcss": "^8.4.
|
|
109
|
+
"postcss": "^8.4.39",
|
|
110
110
|
"postcss-loader": "^8.1.1",
|
|
111
111
|
"postcss-scss": "^4.0.9",
|
|
112
112
|
"pretty": "^2.0.0",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"tsc-alias": "^1.8.10",
|
|
123
123
|
"tstyche": "^2.0.0",
|
|
124
124
|
"typed-scss-modules": "^8.0.1",
|
|
125
|
-
"typescript": "^5.5.
|
|
126
|
-
"typescript-eslint": "^7.
|
|
125
|
+
"typescript": "^5.5.3",
|
|
126
|
+
"typescript-eslint": "^7.15.0",
|
|
127
127
|
"webpack": "^5.92.1",
|
|
128
128
|
"webpack-dev-middleware": "^7.2.1",
|
|
129
129
|
"webpack-hot-middleware": "^2.26.1",
|
|
130
|
-
"webpack-merge": "^
|
|
130
|
+
"webpack-merge": "^6.0.1",
|
|
131
131
|
"workbox-core": "^7.1.0",
|
|
132
132
|
"workbox-precaching": "^7.1.0",
|
|
133
133
|
"workbox-webpack-plugin": "^7.1.0"
|
|
@@ -66,12 +66,15 @@ const Dropdown: React.FunctionComponent<PropsT<string>> = ({
|
|
|
66
66
|
</option>
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
+
let selectClassName = theme.select;
|
|
70
|
+
if (!isValidValue) selectClassName += ` ${theme.invalid}`;
|
|
71
|
+
|
|
69
72
|
return (
|
|
70
73
|
<div className={theme.container}>
|
|
71
74
|
{ label === undefined ? null : <div className={theme.label}>{label}</div> }
|
|
72
75
|
<div className={theme.dropdown}>
|
|
73
76
|
<select
|
|
74
|
-
className={
|
|
77
|
+
className={selectClassName}
|
|
75
78
|
onChange={onChange}
|
|
76
79
|
value={value}
|
|
77
80
|
>
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
.context,
|
|
5
5
|
.ad.hoc {
|
|
6
6
|
&.dropdown {
|
|
7
|
+
display: flex;
|
|
8
|
+
overflow: hidden;
|
|
7
9
|
position: relative;
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
margin: 0 0.6em 0 1.5em;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
&.option {
|
|
50
|
+
&.option { color: black; }
|
|
49
51
|
&.hiddenOption { display: none; }
|
|
50
52
|
|
|
51
53
|
&.select {
|
|
@@ -56,6 +58,7 @@
|
|
|
56
58
|
color: inherit;
|
|
57
59
|
cursor: pointer;
|
|
58
60
|
display: inline-block;
|
|
61
|
+
flex: 1;
|
|
59
62
|
font: inherit;
|
|
60
63
|
outline: none;
|
|
61
64
|
padding: 0.3em 3.3em calc(0.3em + 1px) 1.2em;
|
|
@@ -70,5 +73,7 @@
|
|
|
70
73
|
border-color: blue;
|
|
71
74
|
box-shadow: 0 0 3px 1px lightblue;
|
|
72
75
|
}
|
|
76
|
+
|
|
77
|
+
&.invalid { color: gray; }
|
|
73
78
|
}
|
|
74
79
|
}
|
|
@@ -12,6 +12,11 @@ type ThemeKeyT =
|
|
|
12
12
|
| 'option'
|
|
13
13
|
| 'select'
|
|
14
14
|
|
|
15
|
+
// TODO: This is currently only valid for (native) <Dropdown>,
|
|
16
|
+
// other kinds of selectors should be evaluated, and aligned with this
|
|
17
|
+
// feature, if appropriate.
|
|
18
|
+
| 'invalid'
|
|
19
|
+
|
|
15
20
|
// TODO: This is only valid for <CustomDropdown>, thus we need to re-factor it
|
|
16
21
|
// into a separate theme spec for that component.
|
|
17
22
|
| 'upward';
|