flipper-ui 0.30.3 → 0.30.5
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.
|
@@ -62,9 +62,8 @@ var renderEditMode = function renderEditMode(column, row, updateRow, errors) {
|
|
|
62
62
|
return /*#__PURE__*/_react["default"].createElement(_maskField["default"], {
|
|
63
63
|
fixedDecimalScale: true,
|
|
64
64
|
type: "text",
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} : undefined,
|
|
65
|
+
fullWidth: true,
|
|
66
|
+
error: hasError,
|
|
68
67
|
thousandSeparator: ".",
|
|
69
68
|
decimalSeparator: ",",
|
|
70
69
|
decimalScale: decimalScale,
|
|
@@ -1,54 +1,15 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export interface MaskFieldProps extends NumericFormatProps {
|
|
6
|
-
error?: boolean;
|
|
7
|
-
showEdit?: boolean;
|
|
8
|
-
hasClear?: boolean;
|
|
9
|
-
autoFocus?: boolean;
|
|
10
|
-
multiline?: boolean;
|
|
11
|
-
select?: boolean;
|
|
12
|
-
fullWidth?: boolean;
|
|
13
|
-
required?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
fixedDecimalScale?: boolean;
|
|
16
|
-
thousandSeparator?: boolean | string;
|
|
17
|
-
margin?: string;
|
|
18
|
-
id?: string;
|
|
19
|
-
name?: string;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextFieldProps } from '@/core/inputs/text-field';
|
|
3
|
+
import { NumberFormatProps } from 'react-number-format';
|
|
4
|
+
export interface MaskFieldProps extends NumberFormatProps {
|
|
20
5
|
mask?: string;
|
|
21
|
-
|
|
22
|
-
label?: string;
|
|
23
|
-
autoComplete?: string;
|
|
6
|
+
type?: 'text' | 'tel' | 'password';
|
|
24
7
|
decimalSeparator?: string;
|
|
25
|
-
format?: string
|
|
26
|
-
defaultValue?: string | number;
|
|
27
|
-
value?: string | number;
|
|
28
|
-
rows?: string | number;
|
|
29
|
-
rowsMax?: string | number;
|
|
8
|
+
format?: string;
|
|
30
9
|
decimalScale?: number;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
InputLabelProps?: object;
|
|
35
|
-
options?: IOption[] | string;
|
|
36
|
-
children?: React.ReactNode;
|
|
37
|
-
helperText?: React.ReactNode;
|
|
38
|
-
helperIcon?: React.ReactNode;
|
|
39
|
-
style?: React.CSSProperties;
|
|
40
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
41
|
-
type?: 'text' | 'tel' | 'password';
|
|
42
|
-
variant?: 'standard' | 'outlined' | 'filled';
|
|
43
|
-
color?: 'primary' | 'secondary' | undefined;
|
|
44
|
-
customInput?: React.ComponentType;
|
|
45
|
-
onClear?: () => void;
|
|
46
|
-
onBlur?: () => void;
|
|
47
|
-
onHelperClick?: () => void;
|
|
48
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
49
|
-
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
50
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
51
|
-
onPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
10
|
+
thousandSeparator?: boolean | string;
|
|
11
|
+
fixedDecimalScale?: boolean;
|
|
12
|
+
customInput?: React.ComponentType<TextFieldProps>;
|
|
52
13
|
}
|
|
53
14
|
export declare const MaskField: (props: MaskFieldProps) => React.JSX.Element;
|
|
54
15
|
export default MaskField;
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _textField = _interopRequireDefault(require("../text-field"));
|
|
12
|
-
var _reactNumberFormat = require("react-number-format");
|
|
12
|
+
var _reactNumberFormat = _interopRequireDefault(require("react-number-format"));
|
|
13
13
|
var _excluded = ["customInput"];
|
|
14
14
|
var MaskField = exports.MaskField = function MaskField(props) {
|
|
15
15
|
var customInput = props.customInput,
|
|
@@ -18,10 +18,9 @@ var MaskField = exports.MaskField = function MaskField(props) {
|
|
|
18
18
|
/*#__PURE__*/
|
|
19
19
|
// Although react-number-format allow use of additional props,
|
|
20
20
|
// shows problem with some props like have been do this
|
|
21
|
-
// actually on flipper-ui. (e.g. errors treatment
|
|
22
|
-
_react["default"].createElement(_reactNumberFormat
|
|
23
|
-
customInput: customInput || _textField["default"]
|
|
24
|
-
format: typeof otherProps.format === 'string' ? undefined : otherProps.format
|
|
21
|
+
// actually on flipper-ui. (e.g. errors treatment)
|
|
22
|
+
_react["default"].createElement(_reactNumberFormat["default"], (0, _extends2["default"])({}, otherProps, {
|
|
23
|
+
customInput: customInput || _textField["default"]
|
|
25
24
|
}))
|
|
26
25
|
);
|
|
27
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flipper-ui",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "https://flipper-ui.ngi.com.br/",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"nginformatica-styleguide": "1.0.2",
|
|
43
43
|
"ramda": "0.25.0",
|
|
44
44
|
"react-loading-skeleton": "3.3.1",
|
|
45
|
-
"react-number-format": "
|
|
45
|
+
"react-number-format": "4.4.1",
|
|
46
46
|
"sprintf-js": "1.1.3",
|
|
47
47
|
"styled-component": "2.8.0",
|
|
48
48
|
"uuid": "9.0.1"
|