@mtes-mct/monitor-ui 10.18.0 → 10.19.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/CHANGELOG.md +12 -0
- package/fields/TextInput.d.ts +2 -1
- package/fields/TextInput.d.ts.map +1 -1
- package/index.js +45 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [10.18.0](https://github.com/MTES-MCT/monitor-ui/compare/v10.17.1...v10.18.0) (2024-01-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **cypress:** add callback to waitForLastRequest command ([aaded2d](https://github.com/MTES-MCT/monitor-ui/commit/aaded2d43f462a6bbcffc8fa32cad526da4e7413))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **e2e:** fix test with border effect ([97c82c9](https://github.com/MTES-MCT/monitor-ui/commit/97c82c9b64dfd72a95bda104bb077d78b216b81a))
|
|
12
|
+
|
|
1
13
|
## [10.17.1](https://github.com/MTES-MCT/monitor-ui/compare/v10.17.0...v10.17.1) (2024-01-04)
|
|
2
14
|
|
|
3
15
|
|
package/fields/TextInput.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'on
|
|
|
9
9
|
isErrorMessageHidden?: boolean | undefined;
|
|
10
10
|
isLabelHidden?: boolean | undefined;
|
|
11
11
|
isLight?: boolean | undefined;
|
|
12
|
+
isSearchInput?: boolean;
|
|
12
13
|
isUndefinedWhenDisabled?: boolean | undefined;
|
|
13
14
|
label: string;
|
|
14
15
|
name: string;
|
|
@@ -16,5 +17,5 @@ export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'on
|
|
|
16
17
|
size?: Size | undefined;
|
|
17
18
|
value?: string | undefined;
|
|
18
19
|
};
|
|
19
|
-
export declare function TextInput({ className, error, Icon, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, size, style, type, value, ...originalProps }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function TextInput({ className, error, Icon, isErrorMessageHidden, isLabelHidden, isLight, isSearchInput, isUndefinedWhenDisabled, label, onChange, size, style, type, value, ...originalProps }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/fields/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAA;AAIpE,OAAO,
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/fields/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAA;AAIpE,OAAO,EAAU,IAAI,EAAE,MAAM,cAAc,CAAA;AAW3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,cAAc,GAAG,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IAC5G,IAAI,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,uBAAuB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAA;IAC5E,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAA;AACD,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,KAAK,EACL,IAAI,EACJ,oBAA4B,EAC5B,aAAqB,EACrB,OAAe,EACf,aAAqB,EACrB,uBAA+B,EAC/B,KAAK,EACL,QAAQ,EACR,IAAkB,EAClB,KAAK,EACL,IAAa,EACb,KAAK,EACL,GAAG,aAAa,EACjB,EAAE,cAAc,2CA6EhB"}
|
package/index.js
CHANGED
|
@@ -55738,7 +55738,7 @@ function Search({ baseContainer, className, customSearch = undefined, customSear
|
|
|
55738
55738
|
onClick: clean,
|
|
55739
55739
|
size: Size.SMALL
|
|
55740
55740
|
}),
|
|
55741
|
-
isSearchIconVisible && /*#__PURE__*/ jsx(Separator, {
|
|
55741
|
+
isSearchIconVisible && /*#__PURE__*/ jsx(Separator$1, {
|
|
55742
55742
|
children: "|"
|
|
55743
55743
|
})
|
|
55744
55744
|
]
|
|
@@ -55765,7 +55765,7 @@ const StyledCloseButton = styled(IconButton)`
|
|
|
55765
55765
|
const StyledIconSearch = styled(Search$1)`
|
|
55766
55766
|
margin: 10px 10px 10px 8px;
|
|
55767
55767
|
`;
|
|
55768
|
-
const Separator = styled.div`
|
|
55768
|
+
const Separator$1 = styled.div`
|
|
55769
55769
|
height: 40px;
|
|
55770
55770
|
font-weight: 300;
|
|
55771
55771
|
color: ${(p)=>p.theme.color.lightGray};
|
|
@@ -70196,7 +70196,7 @@ const StyledInput$1 = styled(Input)`
|
|
|
70196
70196
|
}
|
|
70197
70197
|
`;
|
|
70198
70198
|
|
|
70199
|
-
function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isUndefinedWhenDisabled = false, label, onChange, size = Size.NORMAL, style, type = 'text', value, ...originalProps }) {
|
|
70199
|
+
function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isSearchInput = false, isUndefinedWhenDisabled = false, label, onChange, size = Size.NORMAL, style, type = 'text', value, ...originalProps }) {
|
|
70200
70200
|
const controlledClassname = useMemo(()=>classnames('Field-TextInput', className), [
|
|
70201
70201
|
className
|
|
70202
70202
|
]);
|
|
@@ -70210,6 +70210,14 @@ function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLab
|
|
|
70210
70210
|
originalProps.disabled,
|
|
70211
70211
|
originalProps.name
|
|
70212
70212
|
]);
|
|
70213
|
+
const clean = useCallback(()=>{
|
|
70214
|
+
if (!onChange) {
|
|
70215
|
+
return;
|
|
70216
|
+
}
|
|
70217
|
+
onChange(undefined);
|
|
70218
|
+
}, [
|
|
70219
|
+
onChange
|
|
70220
|
+
]);
|
|
70213
70221
|
const handleChange = useCallback((nextValue)=>{
|
|
70214
70222
|
if (!onChange) {
|
|
70215
70223
|
return;
|
|
@@ -70245,6 +70253,26 @@ function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLab
|
|
|
70245
70253
|
value: value || '',
|
|
70246
70254
|
...originalProps
|
|
70247
70255
|
}, key),
|
|
70256
|
+
isSearchInput && !Icon && /*#__PURE__*/ jsxs(IconsContainer, {
|
|
70257
|
+
$size: size,
|
|
70258
|
+
children: [
|
|
70259
|
+
value && /*#__PURE__*/ jsxs(Fragment, {
|
|
70260
|
+
children: [
|
|
70261
|
+
/*#__PURE__*/ jsx(IconButton, {
|
|
70262
|
+
accent: Accent.TERTIARY,
|
|
70263
|
+
color: THEME.color.slateGray,
|
|
70264
|
+
Icon: Close,
|
|
70265
|
+
onClick: clean,
|
|
70266
|
+
size: Size.SMALL
|
|
70267
|
+
}),
|
|
70268
|
+
/*#__PURE__*/ jsx(Separator, {})
|
|
70269
|
+
]
|
|
70270
|
+
}),
|
|
70271
|
+
/*#__PURE__*/ jsx(Search$1, {
|
|
70272
|
+
color: THEME.color.slateGray
|
|
70273
|
+
})
|
|
70274
|
+
]
|
|
70275
|
+
}),
|
|
70248
70276
|
Icon && /*#__PURE__*/ jsx(Icon, {
|
|
70249
70277
|
color: THEME.color.slateGray
|
|
70250
70278
|
})
|
|
@@ -70266,6 +70294,20 @@ const PADDING_WITH_ICON = {
|
|
|
70266
70294
|
[Size.NORMAL]: '3px 38px 6px 8px',
|
|
70267
70295
|
[Size.SMALL]: '3px 38px 6px 8px'
|
|
70268
70296
|
};
|
|
70297
|
+
const IconsContainer = styled.div`
|
|
70298
|
+
align-items: center;
|
|
70299
|
+
display: flex;
|
|
70300
|
+
position: absolute;
|
|
70301
|
+
right: 5px;
|
|
70302
|
+
top: ${(p)=>p.$size === Size.LARGE ? '10px' : '5px'};
|
|
70303
|
+
`;
|
|
70304
|
+
const Separator = styled.div`
|
|
70305
|
+
border-right: 1px solid ${(p)=>p.theme.color.lightGray};
|
|
70306
|
+
height: 20px;
|
|
70307
|
+
margin-left: 4px;
|
|
70308
|
+
margin-right: 6px;
|
|
70309
|
+
padding-top: 3px;
|
|
70310
|
+
`;
|
|
70269
70311
|
const StyledInput = styled(Input)`
|
|
70270
70312
|
background-color: ${(p)=>p.$isLight ? p.theme.color.white : p.theme.color.gainsboro};
|
|
70271
70313
|
border: solid 1px ${(p)=>p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro};
|
|
@@ -70294,7 +70336,6 @@ const StyledInput = styled(Input)`
|
|
|
70294
70336
|
const InputBox = styled.div`
|
|
70295
70337
|
position: relative;
|
|
70296
70338
|
width: 100%;
|
|
70297
|
-
|
|
70298
70339
|
> .Element-IconBox {
|
|
70299
70340
|
position: absolute;
|
|
70300
70341
|
right: 10px;
|