@mtes-mct/monitor-ui 2.9.1 → 2.9.3
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 +18 -0
- package/index.js +11 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [2.9.2](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.1...v2.9.2) (2023-01-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **fields:** set MutliSelect initial isOpen to false ([06fc475](https://github.com/MTES-MCT/monitor-ui/commit/06fc475fcd41e00e5e79a5636ba0e720899e3a1f))
|
|
7
|
+
|
|
8
|
+
## [2.9.1](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.0...v2.9.1) (2023-01-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **fields:** fix DateRangePicker calendar selection update ([4fb68f8](https://github.com/MTES-MCT/monitor-ui/commit/4fb68f86278094e8fb8255b1f2bf9ce531bbc721))
|
|
14
|
+
* **fields:** fix MultiSelect closing behavior ([1e832e6](https://github.com/MTES-MCT/monitor-ui/commit/1e832e6042cf7734f2084074672ea52220fb9fa8))
|
|
15
|
+
* **fields:** fix Select not closing on selection ([c132a1f](https://github.com/MTES-MCT/monitor-ui/commit/c132a1f153a3e51eb59cf2cfd363e873604efe29))
|
|
16
|
+
* **fields:** make MultiSelect width 100% of parent width ([aa38376](https://github.com/MTES-MCT/monitor-ui/commit/aa38376d0a57961bcdd385165e842b101cd037b1))
|
|
17
|
+
* **fields:** make Select width 100% of parent width ([9aa3f71](https://github.com/MTES-MCT/monitor-ui/commit/9aa3f71f9e258ca66989ef24860dceb4333348b9))
|
|
18
|
+
|
|
1
19
|
# [2.9.0](https://github.com/MTES-MCT/monitor-ui/compare/v2.8.1...v2.9.0) (2023-01-25)
|
|
2
20
|
|
|
3
21
|
|
package/index.js
CHANGED
|
@@ -1877,7 +1877,7 @@ function ThemeProvider({ children, theme = {} }) {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
|
|
1879
1879
|
function Item({ Icon, ...originalProps }) {
|
|
1880
|
-
const icon = useMemo(() => (Icon ? jsx(Icon, { size:
|
|
1880
|
+
const icon = useMemo(() => (Icon ? jsx(Icon, { size: 20 }) : undefined), [Icon]);
|
|
1881
1881
|
const hasIcon = useMemo(() => Boolean(Icon), [Icon]);
|
|
1882
1882
|
return jsx(StyledDropdownItem, { "$hasIcon": hasIcon, icon: icon, ...originalProps });
|
|
1883
1883
|
}
|
|
@@ -1888,15 +1888,20 @@ const StyledDropdownItem = styled(Dropdown$1.Item) `
|
|
|
1888
1888
|
font-size: 13px;
|
|
1889
1889
|
line-height: 1;
|
|
1890
1890
|
padding: 12px;
|
|
1891
|
-
padding: ${p => (p.$hasIcon ? '
|
|
1891
|
+
padding: ${p => (p.$hasIcon ? '7px' : '11px')} 12px ${p => (p.$hasIcon ? '9px' : '14px')};
|
|
1892
1892
|
|
|
1893
1893
|
&:not(:last-child) {
|
|
1894
1894
|
border-bottom: 1px solid var(--lightGray);
|
|
1895
1895
|
}
|
|
1896
|
+
|
|
1897
|
+
/* SVG Icon Components are wrapped within a <div /> */
|
|
1898
|
+
> div {
|
|
1899
|
+
margin-top: 1px;
|
|
1900
|
+
}
|
|
1896
1901
|
`;
|
|
1897
1902
|
|
|
1898
1903
|
function RawDropdown({ Icon, ...originalProps }) {
|
|
1899
|
-
const icon = useMemo(() => (Icon ? jsx(Icon, { size:
|
|
1904
|
+
const icon = useMemo(() => (Icon ? jsx(Icon, { size: 20 }) : undefined), [Icon]);
|
|
1900
1905
|
const hasIcon = useMemo(() => Boolean(Icon), [Icon]);
|
|
1901
1906
|
return jsx(StyledDropdown, { "$hasIcon": hasIcon, icon: icon, ...originalProps });
|
|
1902
1907
|
}
|
|
@@ -1909,7 +1914,7 @@ const StyledDropdown = styled(Dropdown$1) `
|
|
|
1909
1914
|
color: ${p => p.theme.color.gainsboro};
|
|
1910
1915
|
display: flex;
|
|
1911
1916
|
font-size: 13px;
|
|
1912
|
-
padding: ${p => (p.$hasIcon ? '
|
|
1917
|
+
padding: ${p => (p.$hasIcon ? '4px' : '5px')} 12px ${p => (p.$hasIcon ? '5px' : '7px')};
|
|
1913
1918
|
|
|
1914
1919
|
:hover {
|
|
1915
1920
|
background-color: ${p => p.theme.color.blueYonder['100']};
|
|
@@ -1931,7 +1936,7 @@ const StyledDropdown = styled(Dropdown$1) `
|
|
|
1931
1936
|
|
|
1932
1937
|
/* SVG Icon Components are wrapped within a <div /> */
|
|
1933
1938
|
> div {
|
|
1934
|
-
margin
|
|
1939
|
+
margin: 1px 8px 0 0;
|
|
1935
1940
|
}
|
|
1936
1941
|
|
|
1937
1942
|
> svg {
|
|
@@ -5022,7 +5027,7 @@ function MultiSelect({ baseContainer, error, fixedWidth, isLabelHidden = false,
|
|
|
5022
5027
|
searchable = false, ...originalProps }) {
|
|
5023
5028
|
// eslint-disable-next-line no-null/no-null
|
|
5024
5029
|
const boxRef = useRef(null);
|
|
5025
|
-
const [isOpen, setIsOpen] = useState(
|
|
5030
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
5026
5031
|
const controlledError = useMemo(() => normalizeString(error), [error]);
|
|
5027
5032
|
const hasError = useMemo(() => Boolean(controlledError), [controlledError]);
|
|
5028
5033
|
const key = useMemo(() => `${originalProps.name}-${JSON.stringify(originalProps.defaultValue)}`, [originalProps.defaultValue, originalProps.name]);
|