linear-react-components-ui 1.1.24-beta.1 → 1.1.24-beta.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/lib/BaseMask-ce8dedc1.d.ts +24 -0
- package/lib/Cnpj-aa8c3e13.d.ts +18 -0
- package/lib/Cpf-d58b5482.d.ts +18 -0
- package/lib/Phone-8a912d9e.d.ts +18 -0
- package/lib/ZipCode-d4a08d23.d.ts +13 -0
- package/lib/assets/styles/numberfield.scss +18 -0
- package/lib/assets/styles/radiofield.scss +185 -0
- package/lib/assets/styles/textfield.scss +0 -1
- package/lib/buttons/DefaultButton.js +7 -17
- package/lib/dialog/base/index.js +1 -1
- package/lib/form2/index.d.ts +1 -1
- package/lib/form2/useForm/index.js +3 -4
- package/lib/icons/helper.d.ts +0 -4
- package/lib/icons/helper.js +0 -4
- package/lib/index-287b0453.d.ts +23 -0
- package/lib/index-35ba9ed8.d.ts +15 -0
- package/lib/index-4529c2ba.d.ts +44 -0
- package/lib/index-474db0eb.d.ts +23 -0
- package/lib/index-5b2c554c.d.ts +41 -0
- package/lib/index-ecafc8c6.d.ts +30 -0
- package/lib/inputs/base/InputTextBase.js +2 -4
- package/lib/inputs/base/types.d.ts +1 -1
- package/lib/inputs/color/types.d.ts +1 -1
- package/lib/inputs/date/types.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.js +1 -1
- package/lib/inputs/mask/types.d.ts +1 -1
- package/lib/inputs/multiSelect/types.d.ts +1 -1
- package/lib/inputs/number/types.d.ts +2 -2
- package/lib/inputs2/checkboxfield/index.d.ts +1 -1
- package/lib/inputs2/checkboxfield/index.js +2 -6
- package/lib/inputs2/colorfield/index.d.ts +2 -2
- package/lib/inputs2/date/base/index.js +2 -6
- package/lib/inputs2/date/datefield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/datefield/context.d.ts +1 -0
- package/lib/inputs2/date/datefield/index.d.ts +1 -0
- package/lib/inputs2/date/datefield/index.js +6 -4
- package/lib/inputs2/date/datefield/types.d.ts +2 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +28 -0
- package/lib/inputs2/date/dateperiodfield/context.d.ts +1 -0
- package/lib/inputs2/date/dateperiodfield/index.d.ts +1 -0
- package/lib/inputs2/date/dateperiodfield/index.js +8 -7
- package/lib/inputs2/date/dateperiodfield/types.d.ts +2 -0
- package/lib/inputs2/date/helpers.d.ts +1 -0
- package/lib/inputs2/date/types.d.ts +2 -1
- package/lib/inputs2/index.d.ts +18 -15
- package/lib/inputs2/index.js +9 -13
- package/lib/inputs2/mask/BaseMask.d.ts +2 -2
- package/lib/inputs2/mask/Cnpj.d.ts +3 -3
- package/lib/inputs2/mask/Cpf.d.ts +3 -3
- package/lib/inputs2/mask/Phone.d.ts +3 -3
- package/lib/inputs2/mask/ZipCode.d.ts +3 -3
- package/lib/inputs2/numberfield/currency.d.ts +13 -0
- package/lib/inputs2/{number/BaseNumber.js → numberfield/currency.js} +63 -58
- package/lib/inputs2/numberfield/decimal.d.ts +13 -0
- package/lib/inputs2/numberfield/decimal.js +85 -0
- package/lib/inputs2/numberfield/helpers.d.ts +30 -0
- package/lib/inputs2/numberfield/helpers.js +53 -0
- package/lib/inputs2/numberfield/index.d.ts +12 -0
- package/lib/inputs2/numberfield/index.js +104 -0
- package/lib/inputs2/numberfield/types.d.ts +36 -0
- package/lib/inputs2/numberfield/types.js +5 -0
- package/lib/inputs2/{number/Number.d.ts → radiofield/index.d.ts} +4 -4
- package/lib/inputs2/radiofield/index.js +143 -0
- package/lib/inputs2/radiofield/types.d.ts +33 -0
- package/lib/inputs2/radiofield/types.js +5 -0
- package/lib/inputs2/selectfield/index.d.ts +1 -1
- package/lib/inputs2/selectfield/index.js +8 -10
- package/lib/inputs2/selectfield/item.d.ts +1 -1
- package/lib/inputs2/selectfield/listbox.d.ts +1 -1
- package/lib/inputs2/selectfield/search.d.ts +1 -1
- package/lib/inputs2/selectfield/selections.d.ts +1 -1
- package/lib/inputs2/selectfield/types.d.ts +1 -2
- package/lib/inputs2/slot/index.d.ts +2 -2
- package/lib/inputs2/textfield/index.d.ts +1 -1
- package/lib/inputs2/textfield/index.js +9 -12
- package/lib/popover/PopoverText.js +2 -11
- package/lib/popover/index.js +1 -1
- package/lib/popover/types.d.ts +0 -1
- package/package.json +1 -1
- package/lib/BaseMask-04df8f20.d.ts +0 -24
- package/lib/BaseNumber-c609c5a0.d.ts +0 -23
- package/lib/Cnpj-5471cb1f.d.ts +0 -18
- package/lib/Cpf-71c4f0f4.d.ts +0 -18
- package/lib/Currency-38d14ff7.d.ts +0 -18
- package/lib/Decimal-85d45244.d.ts +0 -13
- package/lib/Number-db3c092d.d.ts +0 -20
- package/lib/Phone-4c4142e4.d.ts +0 -18
- package/lib/ZipCode-dc7dd4da.d.ts +0 -13
- package/lib/index-379b7504.d.ts +0 -44
- package/lib/index-7cb5e8b3.d.ts +0 -41
- package/lib/index-809a7899.d.ts +0 -23
- package/lib/index-de21a05e.d.ts +0 -23
- package/lib/inputs2/number/BaseNumber.d.ts +0 -10
- package/lib/inputs2/number/Currency.d.ts +0 -11
- package/lib/inputs2/number/Currency.js +0 -47
- package/lib/inputs2/number/Decimal.d.ts +0 -11
- package/lib/inputs2/number/Decimal.js +0 -36
- package/lib/inputs2/number/Number.js +0 -49
- package/lib/inputs2/number/format_number.d.ts +0 -5
- package/lib/inputs2/number/format_number.js +0 -29
package/lib/inputs2/index.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
export { i as TextField } from '../index-
|
|
1
|
+
export { i as TextField } from '../index-4529c2ba.js';
|
|
2
|
+
export { i as NumberField } from '../index-ecafc8c6.js';
|
|
2
3
|
export { i as DateField } from '../index-368f781f.js';
|
|
3
|
-
export { i as
|
|
4
|
-
export { i as
|
|
5
|
-
export {
|
|
6
|
-
export { N as NumberField } from '../Number-db3c092d.js';
|
|
7
|
-
export { D as DecimalField } from '../Decimal-85d45244.js';
|
|
8
|
-
export { C as CurrencyField } from '../Currency-38d14ff7.js';
|
|
9
|
-
export { B as MaskField } from '../BaseMask-04df8f20.js';
|
|
10
|
-
export { C as CpfField } from '../Cpf-71c4f0f4.js';
|
|
11
|
-
export { C as CnpjField } from '../Cnpj-5471cb1f.js';
|
|
12
|
-
export { P as PhoneField } from '../Phone-4c4142e4.js';
|
|
13
|
-
export { Z as ZipCodeField } from '../ZipCode-dc7dd4da.js';
|
|
14
|
-
export { i as CheckboxField } from '../index-7cb5e8b3.js';
|
|
4
|
+
export { i as RadioField } from '../index-35ba9ed8.js';
|
|
5
|
+
export { i as SelectField } from '../index-474db0eb.js';
|
|
6
|
+
export { i as CheckboxField } from '../index-5b2c554c.js';
|
|
15
7
|
export { i as DatePeriodField } from '../index-c9247c1f.js';
|
|
8
|
+
export { i as ColorField } from '../index-287b0453.js';
|
|
9
|
+
export { B as MaskField } from '../BaseMask-ce8dedc1.js';
|
|
10
|
+
export { C as CpfField } from '../Cpf-d58b5482.js';
|
|
11
|
+
export { C as CnpjField } from '../Cnpj-aa8c3e13.js';
|
|
12
|
+
export { P as PhoneField } from '../Phone-8a912d9e.js';
|
|
13
|
+
export { Z as ZipCodeField } from '../ZipCode-d4a08d23.js';
|
|
16
14
|
import 'react';
|
|
17
15
|
import '../@types/Align.js';
|
|
18
16
|
import '../@types/ColorStyles.js';
|
|
@@ -20,10 +18,15 @@ import '../@types/Position.js';
|
|
|
20
18
|
import '../@types/PermissionAttr.js';
|
|
21
19
|
import './slot/index.js';
|
|
22
20
|
import '../tooltip/types.js';
|
|
21
|
+
import './numberfield/decimal.js';
|
|
22
|
+
import './numberfield/types.js';
|
|
23
|
+
import './numberfield/currency.js';
|
|
23
24
|
import './date/datefield/types.js';
|
|
24
25
|
import 'moment';
|
|
26
|
+
import './date/types.js';
|
|
27
|
+
import './radiofield/types.js';
|
|
28
|
+
import '../@types/Size.js';
|
|
25
29
|
import './selectfield/item.js';
|
|
26
30
|
import './selectfield/types.js';
|
|
27
|
-
import 'imask';
|
|
28
|
-
import '../@types/Size.js';
|
|
29
31
|
import './date/dateperiodfield/types.js';
|
|
32
|
+
import 'imask';
|
package/lib/inputs2/index.js
CHANGED
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ZipCodeField = exports.TextField = exports.SelectField = exports.
|
|
6
|
+
exports.ZipCodeField = exports.TextField = exports.SelectField = exports.RadioField = exports.PhoneField = exports.NumberField = exports.MaskField = exports.DatePeriodField = exports.DateField = exports.CpfField = exports.ColorField = exports.CnpjField = exports.CheckboxField = void 0;
|
|
7
7
|
var TextField = _interopRequireWildcard(require("./textfield"));
|
|
8
8
|
exports.TextField = TextField;
|
|
9
|
+
var NumberField = _interopRequireWildcard(require("./numberfield"));
|
|
10
|
+
exports.NumberField = NumberField;
|
|
9
11
|
var DateField = _interopRequireWildcard(require("./date/datefield"));
|
|
10
12
|
exports.DateField = DateField;
|
|
13
|
+
var RadioField = _interopRequireWildcard(require("./radiofield"));
|
|
14
|
+
exports.RadioField = RadioField;
|
|
11
15
|
var SelectField = _interopRequireWildcard(require("./selectfield"));
|
|
12
16
|
exports.SelectField = SelectField;
|
|
17
|
+
var CheckboxField = _interopRequireWildcard(require("./checkboxfield"));
|
|
18
|
+
exports.CheckboxField = CheckboxField;
|
|
19
|
+
var DatePeriodField = _interopRequireWildcard(require("./date/dateperiodfield"));
|
|
20
|
+
exports.DatePeriodField = DatePeriodField;
|
|
13
21
|
var ColorField = _interopRequireWildcard(require("./colorfield"));
|
|
14
22
|
exports.ColorField = ColorField;
|
|
15
|
-
var BaseMaskNumber = _interopRequireWildcard(require("./number/BaseNumber"));
|
|
16
|
-
exports.BaseMaskNumber = BaseMaskNumber;
|
|
17
|
-
var NumberField = _interopRequireWildcard(require("./number/Number"));
|
|
18
|
-
exports.NumberField = NumberField;
|
|
19
|
-
var DecimalField = _interopRequireWildcard(require("./number/Decimal"));
|
|
20
|
-
exports.DecimalField = DecimalField;
|
|
21
|
-
var CurrencyField = _interopRequireWildcard(require("./number/Currency"));
|
|
22
|
-
exports.CurrencyField = CurrencyField;
|
|
23
23
|
var MaskField = _interopRequireWildcard(require("./mask/BaseMask"));
|
|
24
24
|
exports.MaskField = MaskField;
|
|
25
25
|
var CpfField = _interopRequireWildcard(require("./mask/Cpf"));
|
|
@@ -30,9 +30,5 @@ var PhoneField = _interopRequireWildcard(require("./mask/Phone"));
|
|
|
30
30
|
exports.PhoneField = PhoneField;
|
|
31
31
|
var ZipCodeField = _interopRequireWildcard(require("./mask/ZipCode"));
|
|
32
32
|
exports.ZipCodeField = ZipCodeField;
|
|
33
|
-
var CheckboxField = _interopRequireWildcard(require("./checkboxfield"));
|
|
34
|
-
exports.CheckboxField = CheckboxField;
|
|
35
|
-
var DatePeriodField = _interopRequireWildcard(require("./date/dateperiodfield"));
|
|
36
|
-
exports.DatePeriodField = DatePeriodField;
|
|
37
33
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
38
34
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../index-
|
|
2
|
+
import '../../index-4529c2ba.js';
|
|
3
3
|
import 'imask';
|
|
4
|
-
export { I as Input, M as MaskFieldProps } from '../../BaseMask-
|
|
4
|
+
export { I as Input, M as MaskFieldProps } from '../../BaseMask-ce8dedc1.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../BaseMask-
|
|
3
|
-
export { a as CnpjFieldProps, I as Input } from '../../Cnpj-
|
|
4
|
-
import '../../index-
|
|
2
|
+
import '../../BaseMask-ce8dedc1.js';
|
|
3
|
+
export { a as CnpjFieldProps, I as Input } from '../../Cnpj-aa8c3e13.js';
|
|
4
|
+
import '../../index-4529c2ba.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../BaseMask-
|
|
3
|
-
export { a as CpfFieldProps, I as Input } from '../../Cpf-
|
|
4
|
-
import '../../index-
|
|
2
|
+
import '../../BaseMask-ce8dedc1.js';
|
|
3
|
+
export { a as CpfFieldProps, I as Input } from '../../Cpf-d58b5482.js';
|
|
4
|
+
import '../../index-4529c2ba.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../BaseMask-
|
|
3
|
-
export { I as Input, a as PhoneFieldProps } from '../../Phone-
|
|
4
|
-
import '../../index-
|
|
2
|
+
import '../../BaseMask-ce8dedc1.js';
|
|
3
|
+
export { I as Input, a as PhoneFieldProps } from '../../Phone-8a912d9e.js';
|
|
4
|
+
import '../../index-4529c2ba.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../BaseMask-
|
|
3
|
-
export { I as Input } from '../../ZipCode-
|
|
4
|
-
import '../../index-
|
|
2
|
+
import '../../BaseMask-ce8dedc1.js';
|
|
3
|
+
export { I as Input } from '../../ZipCode-d4a08d23.js';
|
|
4
|
+
import '../../index-4529c2ba.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { CurrencyFieldInputProps } from './types.js';
|
|
3
|
+
import '../../index-4529c2ba.js';
|
|
4
|
+
import '../../@types/Align.js';
|
|
5
|
+
import '../../@types/ColorStyles.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/PermissionAttr.js';
|
|
8
|
+
import '../slot/index.js';
|
|
9
|
+
import '../../tooltip/types.js';
|
|
10
|
+
|
|
11
|
+
declare const Currency: React__default.ForwardRefExoticComponent<CurrencyFieldInputProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
|
|
13
|
+
export { Currency };
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.Currency = void 0;
|
|
7
|
+
require("../../assets/styles/numberfield.scss");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
10
|
var _reactImask = require("react-imask");
|
|
9
|
-
var
|
|
11
|
+
var _2 = require("..");
|
|
10
12
|
var _helpers = require("../../form2/helpers");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_excluded2 = ["scale", "thousandsSeparator", "radix", "normalizeZeros", "padFractionalZeros", "min"];
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
const _excluded = ["min", "max", "to", "from", "enum", "onChange", "allowNegative", "textAlign", "children", "scale", "normalizeZeros", "padFractionalZeros", "currencySymbol"];
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -21,66 +20,72 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
21
20
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
22
21
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23
22
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
24
|
-
const
|
|
23
|
+
const Currency = exports.Currency = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
25
24
|
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
min = undefined,
|
|
26
|
+
max = undefined,
|
|
27
|
+
to = undefined,
|
|
28
|
+
from = undefined,
|
|
29
|
+
enum: interval = undefined,
|
|
30
|
+
onChange = null,
|
|
31
|
+
allowNegative = true,
|
|
30
32
|
textAlign = 'right',
|
|
31
|
-
|
|
33
|
+
children = null,
|
|
34
|
+
scale = 2,
|
|
35
|
+
normalizeZeros = false,
|
|
36
|
+
padFractionalZeros = true,
|
|
37
|
+
currencySymbol = 'R$'
|
|
32
38
|
} = props,
|
|
33
39
|
rest = _objectWithoutProperties(props, _excluded);
|
|
34
|
-
const
|
|
35
|
-
const _ref = maskOptions,
|
|
36
|
-
{
|
|
37
|
-
scale = 0,
|
|
38
|
-
thousandsSeparator = '',
|
|
39
|
-
radix = ',',
|
|
40
|
-
normalizeZeros = false,
|
|
41
|
-
padFractionalZeros = false,
|
|
42
|
-
min = 0
|
|
43
|
-
} = _ref,
|
|
44
|
-
restMaskOptions = _objectWithoutProperties(_ref, _excluded2);
|
|
40
|
+
const numberInputRef = _react.default.useRef(null);
|
|
45
41
|
const {
|
|
46
|
-
value,
|
|
47
|
-
setValue:
|
|
48
|
-
|
|
42
|
+
value: maskedValue,
|
|
43
|
+
setValue: setMaskedValue,
|
|
44
|
+
unmaskedValue
|
|
45
|
+
} = (0, _reactImask.useIMask)({
|
|
49
46
|
mask: Number,
|
|
47
|
+
unmask: true,
|
|
48
|
+
min: !_lodash.default.isNil(min) ? min : allowNegative ? undefined : 0,
|
|
49
|
+
enum: interval,
|
|
50
|
+
radix: ',',
|
|
51
|
+
mapToRadix: ['.'],
|
|
52
|
+
thousandsSeparator: '.',
|
|
53
|
+
max,
|
|
54
|
+
to,
|
|
55
|
+
from,
|
|
50
56
|
scale,
|
|
51
|
-
thousandsSeparator,
|
|
52
|
-
radix,
|
|
53
57
|
normalizeZeros,
|
|
54
|
-
padFractionalZeros
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
padFractionalZeros
|
|
59
|
+
}, {
|
|
60
|
+
ref: numberInputRef,
|
|
61
|
+
onAccept: (__, options, event) => {
|
|
62
|
+
const parsedValueToFloat = parseFloat(options.unmaskedValue);
|
|
63
|
+
const valueToReturn = !_lodash.default.isNaN(parsedValueToFloat) ? parsedValueToFloat : 0;
|
|
64
|
+
onChange?.(_objectSpread(_objectSpread({}, event), {}, {
|
|
65
|
+
target: _objectSpread(_objectSpread({}, event?.target), {}, {
|
|
66
|
+
name: props?.name,
|
|
67
|
+
value: valueToReturn
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
60
70
|
}
|
|
61
71
|
});
|
|
62
72
|
_react.default.useEffect(() => {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
const valueToString = _lodash.default.toString(props?.value);
|
|
74
|
+
if (!_lodash.default.isNil(props?.value) && !_lodash.default.isEqual(parseFloat(valueToString), parseFloat(unmaskedValue))) {
|
|
75
|
+
setMaskedValue(parseFloat(valueToString).toLocaleString('pt-BR'));
|
|
76
|
+
}
|
|
77
|
+
}, [props?.value]);
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_2.TextField.Input, _extends({}, rest, {
|
|
79
|
+
ref: (0, _helpers.mergeRefs)(ref, numberInputRef),
|
|
69
80
|
type: "text",
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
onChange: e => {
|
|
80
|
-
if (onChange) onChange(e);
|
|
81
|
-
},
|
|
82
|
-
value: value,
|
|
83
|
-
textAlign: textAlign
|
|
84
|
-
}));
|
|
81
|
+
inputMode: "numeric",
|
|
82
|
+
value: maskedValue,
|
|
83
|
+
textAlign: textAlign,
|
|
84
|
+
onChange: () => {}
|
|
85
|
+
}), /*#__PURE__*/_react.default.createElement(_2.TextField.LeftSlot, {
|
|
86
|
+
className: "currency-left-elements"
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
88
|
+
className: "currency-symbol"
|
|
89
|
+
}, currencySymbol)), children);
|
|
85
90
|
});
|
|
86
|
-
|
|
91
|
+
Currency.displayName = 'CurrencyFieldInput';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { DecimalFieldInputProps } from './types.js';
|
|
3
|
+
import '../../index-4529c2ba.js';
|
|
4
|
+
import '../../@types/Align.js';
|
|
5
|
+
import '../../@types/ColorStyles.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/PermissionAttr.js';
|
|
8
|
+
import '../slot/index.js';
|
|
9
|
+
import '../../tooltip/types.js';
|
|
10
|
+
|
|
11
|
+
declare const Decimal: React__default.ForwardRefExoticComponent<DecimalFieldInputProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
|
|
13
|
+
export { Decimal };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Decimal = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
+
var _reactImask = require("react-imask");
|
|
10
|
+
var _2 = require("..");
|
|
11
|
+
var _helpers = require("../../form2/helpers");
|
|
12
|
+
const _excluded = ["min", "max", "to", "from", "enum", "onChange", "allowNegative", "textAlign", "children", "scale", "normalizeZeros", "padFractionalZeros"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
22
|
+
const Decimal = exports.Decimal = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
23
|
+
const {
|
|
24
|
+
min = undefined,
|
|
25
|
+
max = undefined,
|
|
26
|
+
to = undefined,
|
|
27
|
+
from = undefined,
|
|
28
|
+
enum: interval = undefined,
|
|
29
|
+
onChange = null,
|
|
30
|
+
allowNegative = true,
|
|
31
|
+
textAlign = 'right',
|
|
32
|
+
children = null,
|
|
33
|
+
scale = 2,
|
|
34
|
+
normalizeZeros = false,
|
|
35
|
+
padFractionalZeros = true
|
|
36
|
+
} = props,
|
|
37
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
38
|
+
const numberInputRef = _react.default.useRef(null);
|
|
39
|
+
const {
|
|
40
|
+
value: maskedValue,
|
|
41
|
+
setValue: setMaskedValue,
|
|
42
|
+
unmaskedValue
|
|
43
|
+
} = (0, _reactImask.useIMask)({
|
|
44
|
+
mask: Number,
|
|
45
|
+
unmask: true,
|
|
46
|
+
min: !_lodash.default.isNil(min) ? min : allowNegative ? undefined : 0,
|
|
47
|
+
enum: interval,
|
|
48
|
+
radix: ',',
|
|
49
|
+
mapToRadix: ['.'],
|
|
50
|
+
thousandsSeparator: '.',
|
|
51
|
+
max,
|
|
52
|
+
to,
|
|
53
|
+
from,
|
|
54
|
+
scale,
|
|
55
|
+
normalizeZeros,
|
|
56
|
+
padFractionalZeros
|
|
57
|
+
}, {
|
|
58
|
+
ref: numberInputRef,
|
|
59
|
+
onAccept: (__, options, event) => {
|
|
60
|
+
const parsedValueToFloat = parseFloat(options.unmaskedValue);
|
|
61
|
+
const valueToReturn = !_lodash.default.isNaN(parsedValueToFloat) ? parsedValueToFloat : 0;
|
|
62
|
+
onChange?.(_objectSpread(_objectSpread({}, event), {}, {
|
|
63
|
+
target: _objectSpread(_objectSpread({}, event?.target), {}, {
|
|
64
|
+
name: props?.name,
|
|
65
|
+
value: valueToReturn
|
|
66
|
+
})
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
_react.default.useEffect(() => {
|
|
71
|
+
const valueToString = _lodash.default.toString(props?.value);
|
|
72
|
+
if (!_lodash.default.isNil(props?.value) && !_lodash.default.isEqual(parseFloat(valueToString), parseFloat(unmaskedValue))) {
|
|
73
|
+
setMaskedValue(parseFloat(valueToString).toLocaleString('pt-BR'));
|
|
74
|
+
}
|
|
75
|
+
}, [props?.value]);
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_2.TextField.Input, _extends({}, rest, {
|
|
77
|
+
ref: (0, _helpers.mergeRefs)(ref, numberInputRef),
|
|
78
|
+
type: "text",
|
|
79
|
+
inputMode: "numeric",
|
|
80
|
+
value: maskedValue,
|
|
81
|
+
textAlign: textAlign,
|
|
82
|
+
onChange: () => {}
|
|
83
|
+
}), children);
|
|
84
|
+
});
|
|
85
|
+
Decimal.displayName = 'DecimalFieldInput';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converte um valor string para um número seguro ou retorna como string limpa.
|
|
3
|
+
*
|
|
4
|
+
* Esta função sanitiza a entrada removendo todos os caracteres não-dígitos exceto hífens,
|
|
5
|
+
* e então converte para número se estiver dentro do intervalo seguro de inteiros do JavaScript.
|
|
6
|
+
* Se o valor exceder o intervalo seguro ou a conversão falhar, retorna a string limpa.
|
|
7
|
+
*
|
|
8
|
+
* @param stringValue - A string de entrada a ser convertida. Pode conter qualquer caractere.
|
|
9
|
+
* @param returnAsString - Se true, retorna a string limpa sem tentar conversão para número. Se false,
|
|
10
|
+
* tenta converter para número dentro dos limites seguros de inteiros.
|
|
11
|
+
*
|
|
12
|
+
* @returns {number | string} Retorna:
|
|
13
|
+
* - String vazia ('') ou 0 se a entrada estiver vazia/nula (baseado na prop "returnAsString")
|
|
14
|
+
* - String limpa se "returnAsString" for true
|
|
15
|
+
* - Número se a conversão for bem-sucedida e dentro do intervalo seguro de inteiros
|
|
16
|
+
* - String limpa se o número exceder o intervalo seguro ou a conversão falhar
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* convertToSafeNumber("123abc", false); // Retorna: 123
|
|
21
|
+
* convertToSafeNumber("123abc", true); // Retorna: "123"
|
|
22
|
+
* convertToSafeNumber("-456def", false); // Retorna: -456
|
|
23
|
+
* convertToSafeNumber("999999999999999999999", false); // Retorna: "999999999999999999999" (excede intervalo seguro)
|
|
24
|
+
* convertToSafeNumber("", false); // Retorna: 0
|
|
25
|
+
* convertToSafeNumber("", true); // Retorna: ""
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const convertToSafeNumber: (stringValue: string, returnAsString: boolean) => number | string;
|
|
29
|
+
|
|
30
|
+
export { convertToSafeNumber };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.convertToSafeNumber = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Converte um valor string para um número seguro ou retorna como string limpa.
|
|
9
|
+
*
|
|
10
|
+
* Esta função sanitiza a entrada removendo todos os caracteres não-dígitos exceto hífens,
|
|
11
|
+
* e então converte para número se estiver dentro do intervalo seguro de inteiros do JavaScript.
|
|
12
|
+
* Se o valor exceder o intervalo seguro ou a conversão falhar, retorna a string limpa.
|
|
13
|
+
*
|
|
14
|
+
* @param stringValue - A string de entrada a ser convertida. Pode conter qualquer caractere.
|
|
15
|
+
* @param returnAsString - Se true, retorna a string limpa sem tentar conversão para número. Se false,
|
|
16
|
+
* tenta converter para número dentro dos limites seguros de inteiros.
|
|
17
|
+
*
|
|
18
|
+
* @returns {number | string} Retorna:
|
|
19
|
+
* - String vazia ('') ou 0 se a entrada estiver vazia/nula (baseado na prop "returnAsString")
|
|
20
|
+
* - String limpa se "returnAsString" for true
|
|
21
|
+
* - Número se a conversão for bem-sucedida e dentro do intervalo seguro de inteiros
|
|
22
|
+
* - String limpa se o número exceder o intervalo seguro ou a conversão falhar
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* convertToSafeNumber("123abc", false); // Retorna: 123
|
|
27
|
+
* convertToSafeNumber("123abc", true); // Retorna: "123"
|
|
28
|
+
* convertToSafeNumber("-456def", false); // Retorna: -456
|
|
29
|
+
* convertToSafeNumber("999999999999999999999", false); // Retorna: "999999999999999999999" (excede intervalo seguro)
|
|
30
|
+
* convertToSafeNumber("", false); // Retorna: 0
|
|
31
|
+
* convertToSafeNumber("", true); // Retorna: ""
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
const convertToSafeNumber = (stringValue, returnAsString) => {
|
|
35
|
+
if (!stringValue || stringValue === '') return returnAsString ? '' : 0;
|
|
36
|
+
const cleanValue = stringValue.replace(/[^\d-]/g, '');
|
|
37
|
+
if (returnAsString) {
|
|
38
|
+
return cleanValue;
|
|
39
|
+
}
|
|
40
|
+
const {
|
|
41
|
+
MAX_SAFE_INTEGER
|
|
42
|
+
} = Number;
|
|
43
|
+
try {
|
|
44
|
+
const numValue = BigInt(cleanValue);
|
|
45
|
+
if (numValue > BigInt(MAX_SAFE_INTEGER) || numValue < BigInt(-MAX_SAFE_INTEGER)) {
|
|
46
|
+
return cleanValue;
|
|
47
|
+
}
|
|
48
|
+
return Number(cleanValue);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
return cleanValue;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.convertToSafeNumber = convertToSafeNumber;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
export { LeftSlot, RightSlot } from '../slot/index.js';
|
|
3
|
+
export { Decimal } from './decimal.js';
|
|
4
|
+
export { Currency } from './currency.js';
|
|
5
|
+
export { CurrencyFieldInputProps, DecimalFieldInputProps, NumberFieldInputProps } from './types.js';
|
|
6
|
+
export { I as Input } from '../../index-ecafc8c6.js';
|
|
7
|
+
import '../../index-4529c2ba.js';
|
|
8
|
+
import '../../@types/Align.js';
|
|
9
|
+
import '../../@types/ColorStyles.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
11
|
+
import '../../@types/PermissionAttr.js';
|
|
12
|
+
import '../../tooltip/types.js';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Currency", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _currency.Currency;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Decimal", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _decimal.Decimal;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.Input = void 0;
|
|
19
|
+
Object.defineProperty(exports, "LeftSlot", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _slot.LeftSlot;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "RightSlot", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _slot.RightSlot;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var _react = _interopRequireDefault(require("react"));
|
|
32
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
33
|
+
var _reactImask = require("react-imask");
|
|
34
|
+
var _2 = require("..");
|
|
35
|
+
var _helpers = require("../../form2/helpers");
|
|
36
|
+
var _slot = require("../slot");
|
|
37
|
+
var _decimal = require("./decimal");
|
|
38
|
+
var _currency = require("./currency");
|
|
39
|
+
var _helpers2 = require("./helpers");
|
|
40
|
+
const _excluded = ["min", "max", "to", "from", "enum", "onChange", "allowNegative", "returnAsString", "textAlign", "children"];
|
|
41
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
42
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
43
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
44
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
45
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
46
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
47
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
48
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
49
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
50
|
+
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
51
|
+
const {
|
|
52
|
+
min = undefined,
|
|
53
|
+
max = undefined,
|
|
54
|
+
to = undefined,
|
|
55
|
+
from = undefined,
|
|
56
|
+
enum: interval = undefined,
|
|
57
|
+
onChange = null,
|
|
58
|
+
allowNegative = true,
|
|
59
|
+
returnAsString = false,
|
|
60
|
+
textAlign = 'right',
|
|
61
|
+
children = null
|
|
62
|
+
} = props,
|
|
63
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
64
|
+
const numberInputRef = _react.default.useRef(null);
|
|
65
|
+
const {
|
|
66
|
+
value: maskedValue,
|
|
67
|
+
setValue: setMaskedValue,
|
|
68
|
+
unmaskedValue
|
|
69
|
+
} = (0, _reactImask.useIMask)({
|
|
70
|
+
mask: Number,
|
|
71
|
+
scale: 0,
|
|
72
|
+
min: !_lodash.default.isNil(min) ? min : allowNegative ? undefined : 0,
|
|
73
|
+
enum: interval,
|
|
74
|
+
max,
|
|
75
|
+
to,
|
|
76
|
+
from
|
|
77
|
+
}, {
|
|
78
|
+
ref: numberInputRef,
|
|
79
|
+
onAccept: (value, __, event) => {
|
|
80
|
+
const parsedValue = (0, _helpers2.convertToSafeNumber)(value, returnAsString);
|
|
81
|
+
onChange?.(_objectSpread(_objectSpread({}, event), {}, {
|
|
82
|
+
target: _objectSpread(_objectSpread({}, event?.target), {}, {
|
|
83
|
+
name: props?.name,
|
|
84
|
+
value: parsedValue
|
|
85
|
+
})
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
_react.default.useEffect(() => {
|
|
90
|
+
const floatUnmaskedValue = Number(unmaskedValue || '0');
|
|
91
|
+
if (!_lodash.default.isNil(props?.value) && (!_lodash.default.isEqual(props?.value, floatUnmaskedValue) || _lodash.default.isEqual(props?.value, 0))) {
|
|
92
|
+
setMaskedValue(_lodash.default.toString(props?.value));
|
|
93
|
+
}
|
|
94
|
+
}, [props?.value]);
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_2.TextField.Input, _extends({}, rest, {
|
|
96
|
+
ref: (0, _helpers.mergeRefs)(ref, numberInputRef),
|
|
97
|
+
type: "text",
|
|
98
|
+
inputMode: "numeric",
|
|
99
|
+
value: maskedValue,
|
|
100
|
+
textAlign: textAlign,
|
|
101
|
+
onChange: () => {}
|
|
102
|
+
}), children);
|
|
103
|
+
});
|
|
104
|
+
Input.displayName = 'NumberFieldInput';
|