linear-react-components-ui 1.1.24-beta.2 → 1.1.25-rc.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/lib/@types/ColorStyles.d.ts +1 -2
- package/lib/@types/Position.d.ts +1 -2
- package/lib/assets/styles/calendar.scss +137 -32
- package/lib/assets/styles/colorpicker.scss +6 -1
- package/lib/assets/styles/colors.scss +12 -48
- package/lib/assets/styles/file.scss +8 -0
- package/lib/buttons/ActivateButton.d.ts +0 -1
- package/lib/buttons/AddButton.d.ts +0 -1
- package/lib/buttons/Button.d.ts +0 -1
- package/lib/buttons/CancelButton.d.ts +0 -1
- package/lib/buttons/DangerButton.d.ts +0 -1
- package/lib/buttons/DefaultButton.d.ts +0 -1
- package/lib/buttons/DefaultButton.js +11 -16
- package/lib/buttons/DestroyButton.d.ts +0 -1
- package/lib/buttons/EditButton.d.ts +0 -1
- package/lib/buttons/InactivateButton.d.ts +0 -1
- package/lib/buttons/InfoButton.d.ts +0 -1
- package/lib/buttons/PrimaryButton.d.ts +0 -1
- package/lib/buttons/RestoreButton.d.ts +0 -1
- package/lib/buttons/SaveButton.d.ts +0 -1
- package/lib/buttons/SuccessButton.d.ts +0 -1
- package/lib/buttons/WarningButton.d.ts +0 -1
- package/lib/buttons/index.d.ts +0 -1
- package/lib/buttons/split_button/index.d.ts +0 -1
- package/lib/buttons/types.d.ts +5 -2
- package/lib/calendar/base/index.js +113 -40
- package/lib/dialog/base/index.js +1 -1
- package/lib/form/Field.d.ts +1 -1
- package/lib/form/FieldArray.d.ts +1 -1
- package/lib/form/FieldNumber.d.ts +1 -1
- package/lib/form/FieldPeriod.d.ts +1 -1
- package/lib/form/helpers.d.ts +1 -1
- package/lib/form/index.d.ts +1 -1
- package/lib/form/types.d.ts +1 -1
- package/lib/form/withFieldHOC.d.ts +1 -1
- package/lib/form/withFormSecurity.d.ts +1 -1
- package/lib/icons/index.d.ts +6 -4
- package/lib/icons/index.js +9 -14
- package/lib/icons/types.d.ts +6 -3
- package/lib/index.d.ts +0 -1
- package/lib/inputs/base/InputTextBase.d.ts +1 -1
- package/lib/inputs/base/InputTextBase.js +6 -14
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +1 -1
- package/lib/inputs/base/types.d.ts +16 -5
- package/lib/inputs/color/index.js +1 -1
- package/lib/inputs/date/Dialog.d.ts +1 -1
- package/lib/inputs/date/Dropdown.d.ts +1 -1
- package/lib/inputs/date/index.d.ts +1 -1
- package/lib/inputs/date/types.d.ts +1 -1
- package/lib/inputs/errorMessage/index.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.js +26 -26
- package/lib/inputs/file/DragDropFile.d.ts +1 -1
- package/lib/inputs/file/File.d.ts +1 -1
- package/lib/inputs/file/File.js +1 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -1
- package/lib/inputs/file/FileButtonSettings.js +0 -1
- package/lib/inputs/file/helpers.d.ts +1 -1
- package/lib/inputs/file/index.d.ts +1 -1
- package/lib/inputs/file/types.d.ts +1 -1
- package/lib/inputs/inputHOC.d.ts +1 -1
- package/lib/inputs/mask/BaseMask.d.ts +1 -1
- package/lib/inputs/mask/Cnpj.d.ts +1 -1
- package/lib/inputs/mask/Cpf.d.ts +1 -1
- package/lib/inputs/mask/Phone.d.ts +1 -1
- package/lib/inputs/mask/ZipCode.d.ts +1 -1
- package/lib/inputs/mask/helpers.d.ts +1 -1
- package/lib/inputs/mask/index.d.ts +1 -1
- package/lib/inputs/mask/types.d.ts +1 -1
- package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -1
- package/lib/inputs/multiSelect/Dropdown.d.ts +1 -1
- package/lib/inputs/multiSelect/helper.d.ts +1 -1
- package/lib/inputs/multiSelect/index.d.ts +1 -1
- package/lib/inputs/multiSelect/types.d.ts +1 -1
- package/lib/inputs/number/BaseNumber.d.ts +1 -1
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Decimal.d.ts +1 -1
- package/lib/inputs/number/index.d.ts +1 -1
- package/lib/inputs/number/types.d.ts +1 -1
- package/lib/inputs/period/Dialog.d.ts +1 -1
- package/lib/inputs/period/Dropdown.d.ts +1 -1
- package/lib/inputs/period/PeriodList.d.ts +1 -1
- package/lib/inputs/period/helper.d.ts +1 -1
- package/lib/inputs/period/index.d.ts +1 -1
- package/lib/inputs/period/index.js +10 -8
- package/lib/inputs/period/types.d.ts +5 -2
- package/lib/inputs/search/index.d.ts +1 -1
- package/lib/inputs/select/ActionButtons.d.ts +1 -1
- package/lib/inputs/select/Dropdown.d.ts +1 -1
- package/lib/inputs/select/helper.d.ts +1 -1
- package/lib/inputs/select/index.d.ts +1 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
- package/lib/inputs/select/multiple/index.d.ts +1 -1
- package/lib/inputs/select/simple/index.d.ts +1 -1
- package/lib/inputs/select/types.d.ts +1 -1
- package/lib/inputs/text/index.d.ts +1 -1
- package/lib/inputs/text/types.d.ts +3 -2
- package/lib/inputs/textarea/index.d.ts +1 -1
- package/lib/inputs/textarea/types.d.ts +1 -1
- package/lib/inputs/types.d.ts +1 -1
- package/lib/internals/types.d.ts +17 -1
- package/lib/internals/withTooltip.d.ts +12 -0
- package/lib/internals/withTooltip.js +172 -0
- package/lib/labels/DangerLabel.d.ts +0 -1
- package/lib/labels/DefaultLabel.d.ts +5 -3
- package/lib/labels/DefaultLabel.js +7 -15
- package/lib/labels/InfoLabel.d.ts +0 -1
- package/lib/labels/PrimaryLabel.d.ts +0 -1
- package/lib/labels/SuccessLabel.d.ts +0 -1
- package/lib/labels/WarningLabel.d.ts +0 -1
- package/lib/labels/index.d.ts +2 -3
- package/lib/labels/types.d.ts +5 -2
- package/lib/list/Header.d.ts +0 -1
- package/lib/list/Item.d.ts +5 -3
- package/lib/list/Item.js +12 -17
- package/lib/list/helpers.d.ts +0 -1
- package/lib/list/index.d.ts +0 -1
- package/lib/list/types.d.ts +6 -4
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -2
- package/lib/menus/sidenav/MenuLink.d.ts +7 -4
- package/lib/menus/sidenav/MenuLink.js +11 -20
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -2
- package/lib/menus/sidenav/NavMenuItem.d.ts +7 -4
- package/lib/menus/sidenav/NavMenuItem.js +12 -16
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -2
- package/lib/menus/sidenav/helpers.d.ts +2 -2
- package/lib/menus/sidenav/index.d.ts +2 -2
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -2
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -2
- package/lib/menus/sidenav/types.d.ts +6 -6
- package/lib/textContent/index.d.ts +11 -6
- package/lib/textContent/index.js +11 -20
- package/lib/tooltip/index.d.ts +3 -4
- package/lib/tooltip/index.js +53 -36
- package/lib/tooltip/types.d.ts +3 -25
- package/package.json +2 -3
- package/lib/BaseMask-4885b7c4.d.ts +0 -24
- package/lib/BaseNumber-ba047ec3.d.ts +0 -23
- package/lib/Cnpj-501f8fed.d.ts +0 -18
- package/lib/Cpf-0e03d85a.d.ts +0 -18
- package/lib/Currency-d8dae30c.d.ts +0 -18
- package/lib/Decimal-deda637f.d.ts +0 -13
- package/lib/Number-4783f0de.d.ts +0 -20
- package/lib/Phone-99e92c22.d.ts +0 -18
- package/lib/ZipCode-3d092264.d.ts +0 -13
- package/lib/assets/styles/checkbox2.scss +0 -199
- package/lib/assets/styles/datepicker2.scss +0 -338
- package/lib/assets/styles/radiofield.scss +0 -185
- package/lib/assets/styles/selectfield.scss +0 -409
- package/lib/assets/styles/slot.scss +0 -34
- package/lib/assets/styles/textfield.scss +0 -147
- package/lib/calendar/base/Day.d.ts +0 -8
- package/lib/calendar/base/Day.js +0 -36
- package/lib/calendar/base/Month.d.ts +0 -8
- package/lib/calendar/base/Month.js +0 -39
- package/lib/calendar/base/Week.d.ts +0 -8
- package/lib/calendar/base/Week.js +0 -35
- package/lib/form2/helpers.d.ts +0 -8
- package/lib/form2/helpers.js +0 -41
- package/lib/form2/index.d.ts +0 -9
- package/lib/form2/index.js +0 -36
- package/lib/form2/types.d.ts +0 -125
- package/lib/form2/types.js +0 -5
- package/lib/form2/useForm/index.d.ts +0 -5
- package/lib/form2/useForm/index.js +0 -203
- package/lib/index-368f781f.d.ts +0 -15
- package/lib/index-6f287e6c.d.ts +0 -23
- package/lib/index-a0c1207e.d.ts +0 -15
- package/lib/index-a68cfaf7.d.ts +0 -23
- package/lib/index-c9247c1f.d.ts +0 -15
- package/lib/index-f6f0d3a8.d.ts +0 -44
- package/lib/index-f9981b49.d.ts +0 -41
- package/lib/inputs2/checkboxfield/index.d.ts +0 -7
- package/lib/inputs2/checkboxfield/index.js +0 -142
- package/lib/inputs2/colorfield/index.d.ts +0 -9
- package/lib/inputs2/colorfield/index.js +0 -119
- package/lib/inputs2/date/base/constants.d.ts +0 -7
- package/lib/inputs2/date/base/constants.js +0 -43
- package/lib/inputs2/date/base/index.d.ts +0 -12
- package/lib/inputs2/date/base/index.js +0 -175
- package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -7
- package/lib/inputs2/date/datefield/calendarbox.js +0 -115
- package/lib/inputs2/date/datefield/context.d.ts +0 -14
- package/lib/inputs2/date/datefield/context.js +0 -15
- package/lib/inputs2/date/datefield/index.d.ts +0 -10
- package/lib/inputs2/date/datefield/index.js +0 -336
- package/lib/inputs2/date/datefield/triggers.d.ts +0 -8
- package/lib/inputs2/date/datefield/triggers.js +0 -47
- package/lib/inputs2/date/datefield/types.d.ts +0 -63
- package/lib/inputs2/date/datefield/types.js +0 -5
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -7
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -164
- package/lib/inputs2/date/dateperiodfield/context.d.ts +0 -14
- package/lib/inputs2/date/dateperiodfield/context.js +0 -17
- package/lib/inputs2/date/dateperiodfield/index.d.ts +0 -10
- package/lib/inputs2/date/dateperiodfield/index.js +0 -593
- package/lib/inputs2/date/dateperiodfield/triggers.d.ts +0 -6
- package/lib/inputs2/date/dateperiodfield/triggers.js +0 -120
- package/lib/inputs2/date/dateperiodfield/types.d.ts +0 -101
- package/lib/inputs2/date/dateperiodfield/types.js +0 -19
- package/lib/inputs2/date/helpers.d.ts +0 -21
- package/lib/inputs2/date/helpers.js +0 -62
- package/lib/inputs2/date/types.d.ts +0 -60
- package/lib/inputs2/date/types.js +0 -19
- package/lib/inputs2/index.d.ts +0 -32
- package/lib/inputs2/index.js +0 -40
- package/lib/inputs2/mask/BaseMask.d.ts +0 -10
- package/lib/inputs2/mask/BaseMask.js +0 -95
- package/lib/inputs2/mask/Cnpj.d.ts +0 -11
- package/lib/inputs2/mask/Cnpj.js +0 -57
- package/lib/inputs2/mask/Cpf.d.ts +0 -11
- package/lib/inputs2/mask/Cpf.js +0 -53
- package/lib/inputs2/mask/Phone.d.ts +0 -11
- package/lib/inputs2/mask/Phone.js +0 -26
- package/lib/inputs2/mask/ZipCode.d.ts +0 -11
- package/lib/inputs2/mask/ZipCode.js +0 -23
- package/lib/inputs2/mask/helpers.d.ts +0 -4
- package/lib/inputs2/mask/helpers.js +0 -57
- package/lib/inputs2/number/BaseNumber.d.ts +0 -10
- package/lib/inputs2/number/BaseNumber.js +0 -86
- 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.d.ts +0 -9
- 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/radiofield/index.d.ts +0 -9
- package/lib/inputs2/radiofield/index.js +0 -143
- package/lib/inputs2/radiofield/types.d.ts +0 -33
- package/lib/inputs2/radiofield/types.js +0 -5
- package/lib/inputs2/selectfield/context.d.ts +0 -38
- package/lib/inputs2/selectfield/context.js +0 -15
- package/lib/inputs2/selectfield/helpers.d.ts +0 -6
- package/lib/inputs2/selectfield/helpers.js +0 -25
- package/lib/inputs2/selectfield/index.d.ts +0 -10
- package/lib/inputs2/selectfield/index.js +0 -489
- package/lib/inputs2/selectfield/item.d.ts +0 -11
- package/lib/inputs2/selectfield/item.js +0 -85
- package/lib/inputs2/selectfield/listbox.d.ts +0 -7
- package/lib/inputs2/selectfield/listbox.js +0 -103
- package/lib/inputs2/selectfield/search.d.ts +0 -7
- package/lib/inputs2/selectfield/search.js +0 -71
- package/lib/inputs2/selectfield/selections.d.ts +0 -10
- package/lib/inputs2/selectfield/selections.js +0 -86
- package/lib/inputs2/selectfield/triggers.d.ts +0 -8
- package/lib/inputs2/selectfield/triggers.js +0 -100
- package/lib/inputs2/selectfield/types.d.ts +0 -54
- package/lib/inputs2/selectfield/types.js +0 -21
- package/lib/inputs2/slot/index.d.ts +0 -14
- package/lib/inputs2/slot/index.js +0 -47
- package/lib/inputs2/textfield/index.d.ts +0 -8
- package/lib/inputs2/textfield/index.js +0 -156
- package/lib/tooltip/TooltipContent.d.ts +0 -7
- package/lib/tooltip/TooltipContent.js +0 -65
- package/lib/tooltip/useTooltip.d.ts +0 -30
- package/lib/tooltip/useTooltip.js +0 -128
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '../../BaseMask-4885b7c4.js';
|
|
3
|
-
export { a as CpfFieldProps, I as Input } from '../../Cpf-0e03d85a.js';
|
|
4
|
-
import '../../index-f6f0d3a8.js';
|
|
5
|
-
import '../../@types/Align.js';
|
|
6
|
-
import '../../@types/ColorStyles.js';
|
|
7
|
-
import '../../@types/Position.js';
|
|
8
|
-
import '../../@types/PermissionAttr.js';
|
|
9
|
-
import '../slot/index.js';
|
|
10
|
-
import '../../tooltip/types.js';
|
|
11
|
-
import 'imask';
|
package/lib/inputs2/mask/Cpf.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _helpers = require("./helpers");
|
|
9
|
-
var _BaseMask = require("./BaseMask");
|
|
10
|
-
const _excluded = ["onValidate", "onBlur", "onChange", "errors"];
|
|
11
|
-
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); }
|
|
12
|
-
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
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
const CPF_INVALID_MESSAGE = 'CPF inválido';
|
|
17
|
-
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
18
|
-
const {
|
|
19
|
-
onValidate,
|
|
20
|
-
onBlur,
|
|
21
|
-
onChange,
|
|
22
|
-
errors: externalErrors = []
|
|
23
|
-
} = props,
|
|
24
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
25
|
-
const validateCpf = raw => {
|
|
26
|
-
const hasCpfError = externalErrors.includes(CPF_INVALID_MESSAGE);
|
|
27
|
-
const isValid = (0, _helpers.CPFValidation)(raw);
|
|
28
|
-
if (!isValid && hasCpfError) {
|
|
29
|
-
onValidate?.([CPF_INVALID_MESSAGE]);
|
|
30
|
-
}
|
|
31
|
-
if (isValid && !hasCpfError) {
|
|
32
|
-
onValidate?.([]);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const handleChange = e => {
|
|
36
|
-
const rawValue = e.target.value.replace(/\D/g, '');
|
|
37
|
-
validateCpf(rawValue);
|
|
38
|
-
onChange?.(e);
|
|
39
|
-
};
|
|
40
|
-
return /*#__PURE__*/_react.default.createElement(_BaseMask.Input, _extends({}, rest, {
|
|
41
|
-
type: "text",
|
|
42
|
-
ref: ref,
|
|
43
|
-
maskOptions: {
|
|
44
|
-
mask: '000.000.000-00',
|
|
45
|
-
placeholderChar: '_',
|
|
46
|
-
lazy: false
|
|
47
|
-
},
|
|
48
|
-
onChange: handleChange,
|
|
49
|
-
errors: externalErrors,
|
|
50
|
-
onBlur: onBlur
|
|
51
|
-
}));
|
|
52
|
-
});
|
|
53
|
-
Input.displayName = 'CpfInputField';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '../../BaseMask-4885b7c4.js';
|
|
3
|
-
export { I as Input, a as PhoneFieldProps } from '../../Phone-99e92c22.js';
|
|
4
|
-
import '../../index-f6f0d3a8.js';
|
|
5
|
-
import '../../@types/Align.js';
|
|
6
|
-
import '../../@types/ColorStyles.js';
|
|
7
|
-
import '../../@types/Position.js';
|
|
8
|
-
import '../../@types/PermissionAttr.js';
|
|
9
|
-
import '../slot/index.js';
|
|
10
|
-
import '../../tooltip/types.js';
|
|
11
|
-
import 'imask';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _BaseMask = require("./BaseMask");
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
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); }
|
|
12
|
-
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
13
|
-
const {
|
|
14
|
-
isCellphone = false
|
|
15
|
-
} = props;
|
|
16
|
-
return /*#__PURE__*/_react.default.createElement(_BaseMask.Input, _extends({}, props, {
|
|
17
|
-
type: "text",
|
|
18
|
-
maskOptions: {
|
|
19
|
-
mask: isCellphone ? '(00) 00000-0000' : '(00) 0000-0000',
|
|
20
|
-
placeholderChar: '_',
|
|
21
|
-
lazy: false
|
|
22
|
-
},
|
|
23
|
-
ref: ref
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
Input.displayName = 'PhoneInputField';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '../../BaseMask-4885b7c4.js';
|
|
3
|
-
export { I as Input } from '../../ZipCode-3d092264.js';
|
|
4
|
-
import '../../index-f6f0d3a8.js';
|
|
5
|
-
import '../../@types/Align.js';
|
|
6
|
-
import '../../@types/ColorStyles.js';
|
|
7
|
-
import '../../@types/Position.js';
|
|
8
|
-
import '../../@types/PermissionAttr.js';
|
|
9
|
-
import '../slot/index.js';
|
|
10
|
-
import '../../tooltip/types.js';
|
|
11
|
-
import 'imask';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _BaseMask = require("./BaseMask");
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
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); }
|
|
12
|
-
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
13
|
-
return /*#__PURE__*/_react.default.createElement(_BaseMask.Input, _extends({}, props, {
|
|
14
|
-
type: "text",
|
|
15
|
-
maskOptions: {
|
|
16
|
-
mask: '00000-000',
|
|
17
|
-
placeholderChar: '_',
|
|
18
|
-
lazy: false
|
|
19
|
-
},
|
|
20
|
-
ref: ref
|
|
21
|
-
}));
|
|
22
|
-
});
|
|
23
|
-
Input.displayName = 'ZipCodeInputField';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CNPJValidation = CNPJValidation;
|
|
7
|
-
exports.CPFValidation = CPFValidation;
|
|
8
|
-
var _lodash = require("lodash");
|
|
9
|
-
const allEqualDigits = input => input.split('').every(char => char === input[0]);
|
|
10
|
-
function CPFValidation(cpf) {
|
|
11
|
-
const stringCpf = cpf ? cpf.replace(/[^\d]+/g, '') : '';
|
|
12
|
-
let sum = 0;
|
|
13
|
-
let split;
|
|
14
|
-
if (stringCpf === '' || stringCpf.length < 11) return false;
|
|
15
|
-
if (allEqualDigits(stringCpf)) return false;
|
|
16
|
-
for (let i = 0; i < 9; i++) {
|
|
17
|
-
sum += (0, _lodash.parseInt)(stringCpf.charAt(i), 10) * (10 - i);
|
|
18
|
-
}
|
|
19
|
-
split = sum * 10 % 11;
|
|
20
|
-
if (split === 10 || split === 11) split = 0;
|
|
21
|
-
if (split !== (0, _lodash.parseInt)(stringCpf.charAt(9), 10)) return false;
|
|
22
|
-
sum = 0;
|
|
23
|
-
for (let i = 0; i < 10; i++) {
|
|
24
|
-
sum += (0, _lodash.parseInt)(stringCpf.charAt(i), 10) * (11 - i);
|
|
25
|
-
}
|
|
26
|
-
split = sum * 10 % 11;
|
|
27
|
-
if (split === 10 || split === 11) split = 0;
|
|
28
|
-
if (split !== (0, _lodash.parseInt)(stringCpf.charAt(10), 10)) return false;
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
function CNPJValidation(cnpj) {
|
|
32
|
-
const stringCnpj = cnpj ? cnpj.replace(/[^\d]+/g, '') : '';
|
|
33
|
-
if (stringCnpj === '' || stringCnpj.length !== 14) return false;
|
|
34
|
-
if (allEqualDigits(stringCnpj)) return false;
|
|
35
|
-
let length = stringCnpj.length - 2;
|
|
36
|
-
let numbers = stringCnpj.substring(0, length);
|
|
37
|
-
const digits = stringCnpj.substring(length);
|
|
38
|
-
let sum = 0;
|
|
39
|
-
let pos = length - 7;
|
|
40
|
-
for (let i = length; i >= 1; i--) {
|
|
41
|
-
sum += (0, _lodash.parseInt)(numbers.charAt(length - i), 10) * pos--;
|
|
42
|
-
if (pos < 2) pos = 9;
|
|
43
|
-
}
|
|
44
|
-
let result = sum % 11 < 2 ? 0 : 11 - sum % 11;
|
|
45
|
-
if (result.toString() !== digits.charAt(0)) return false;
|
|
46
|
-
length += 1;
|
|
47
|
-
numbers = stringCnpj.substring(0, length);
|
|
48
|
-
sum = 0;
|
|
49
|
-
pos = length - 7;
|
|
50
|
-
for (let i = length; i >= 1; i--) {
|
|
51
|
-
sum += (0, _lodash.parseInt)(numbers.charAt(length - i), 10) * pos--;
|
|
52
|
-
if (pos < 2) pos = 9;
|
|
53
|
-
}
|
|
54
|
-
result = sum % 11 < 2 ? 0 : 11 - sum % 11;
|
|
55
|
-
if (result.toString() !== digits.charAt(1)) return false;
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import 'imask';
|
|
3
|
-
import '../../index-f6f0d3a8.js';
|
|
4
|
-
export { a as BaseNumberFieldProps, I as Input } from '../../BaseNumber-ba047ec3.js';
|
|
5
|
-
import '../../@types/Align.js';
|
|
6
|
-
import '../../@types/ColorStyles.js';
|
|
7
|
-
import '../../@types/Position.js';
|
|
8
|
-
import '../../@types/PermissionAttr.js';
|
|
9
|
-
import '../slot/index.js';
|
|
10
|
-
import '../../tooltip/types.js';
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactImask = require("react-imask");
|
|
9
|
-
var _textfield = require("../textfield");
|
|
10
|
-
var _helpers = require("../../form2/helpers");
|
|
11
|
-
var _format_number = require("./format_number");
|
|
12
|
-
const _excluded = ["name", "value", "onComplete", "onChange", "textAlign", "maskOptions"],
|
|
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; }
|
|
16
|
-
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
|
-
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
|
-
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; }
|
|
19
|
-
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; }
|
|
20
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
21
|
-
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
|
-
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
|
-
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 Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
25
|
-
const {
|
|
26
|
-
name,
|
|
27
|
-
value: valueFromProps,
|
|
28
|
-
onComplete,
|
|
29
|
-
onChange,
|
|
30
|
-
textAlign = 'right',
|
|
31
|
-
maskOptions
|
|
32
|
-
} = props,
|
|
33
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
34
|
-
const inputRef = (0, _react.useRef)(null);
|
|
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);
|
|
45
|
-
const {
|
|
46
|
-
value,
|
|
47
|
-
setValue: setMaskValue
|
|
48
|
-
} = (0, _reactImask.useIMask)(_objectSpread({
|
|
49
|
-
mask: Number,
|
|
50
|
-
scale,
|
|
51
|
-
thousandsSeparator,
|
|
52
|
-
radix,
|
|
53
|
-
normalizeZeros,
|
|
54
|
-
padFractionalZeros,
|
|
55
|
-
min
|
|
56
|
-
}, restMaskOptions), {
|
|
57
|
-
ref: inputRef,
|
|
58
|
-
onComplete: (__, maskRef) => {
|
|
59
|
-
onComplete?.(maskRef.value, maskRef);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
_react.default.useEffect(() => {
|
|
63
|
-
const currentValue = valueFromProps ?? '';
|
|
64
|
-
setMaskValue(currentValue);
|
|
65
|
-
}, [valueFromProps]);
|
|
66
|
-
return /*#__PURE__*/_react.default.createElement(_textfield.Input, _extends({}, rest, {
|
|
67
|
-
ref: (0, _helpers.mergeRefs)(ref, inputRef),
|
|
68
|
-
name: name,
|
|
69
|
-
type: "text",
|
|
70
|
-
onBlur: e => {
|
|
71
|
-
const event = {
|
|
72
|
-
target: {
|
|
73
|
-
name,
|
|
74
|
-
value: e.target.value ? (0, _format_number.numberToEnUS)(e.target.value) : ''
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
if (props.onBlur) props.onBlur(event);
|
|
78
|
-
},
|
|
79
|
-
onChange: e => {
|
|
80
|
-
if (onChange) onChange(e);
|
|
81
|
-
},
|
|
82
|
-
value: value,
|
|
83
|
-
textAlign: textAlign
|
|
84
|
-
}));
|
|
85
|
-
});
|
|
86
|
-
Input.displayName = 'MaskNumberInputField';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '../../BaseNumber-ba047ec3.js';
|
|
3
|
-
export { I as Input } from '../../Currency-d8dae30c.js';
|
|
4
|
-
import 'imask';
|
|
5
|
-
import '../../index-f6f0d3a8.js';
|
|
6
|
-
import '../../@types/Align.js';
|
|
7
|
-
import '../../@types/ColorStyles.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
|
-
import '../../@types/PermissionAttr.js';
|
|
10
|
-
import '../slot/index.js';
|
|
11
|
-
import '../../tooltip/types.js';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _slot = require("../slot");
|
|
9
|
-
var _BaseNumber = require("./BaseNumber");
|
|
10
|
-
const _excluded = ["currencySymbol", "min", "max", "maskOptions"];
|
|
11
|
-
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); }
|
|
12
|
-
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
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
17
|
-
const {
|
|
18
|
-
currencySymbol = 'R$',
|
|
19
|
-
min,
|
|
20
|
-
max,
|
|
21
|
-
maskOptions = {
|
|
22
|
-
scale: 2,
|
|
23
|
-
thousandsSeparator: '',
|
|
24
|
-
radix: ',',
|
|
25
|
-
normalizeZeros: false,
|
|
26
|
-
padFractionalZeros: true,
|
|
27
|
-
min: 0
|
|
28
|
-
}
|
|
29
|
-
} = props,
|
|
30
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_BaseNumber.Input, _extends({}, rest, {
|
|
32
|
-
ref: ref,
|
|
33
|
-
min: min,
|
|
34
|
-
max: max,
|
|
35
|
-
maskOptions: maskOptions
|
|
36
|
-
}), /*#__PURE__*/_react.default.createElement(_slot.LeftSlot, {
|
|
37
|
-
style: {
|
|
38
|
-
placeContent: 'center'
|
|
39
|
-
}
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
41
|
-
style: {
|
|
42
|
-
padding: '0 5px'
|
|
43
|
-
},
|
|
44
|
-
className: "currency-symbol"
|
|
45
|
-
}, currencySymbol)));
|
|
46
|
-
});
|
|
47
|
-
Input.displayName = 'CurrencyInputField';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '../../BaseNumber-ba047ec3.js';
|
|
3
|
-
export { I as Input } from '../../Decimal-deda637f.js';
|
|
4
|
-
import 'imask';
|
|
5
|
-
import '../../index-f6f0d3a8.js';
|
|
6
|
-
import '../../@types/Align.js';
|
|
7
|
-
import '../../@types/ColorStyles.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
|
-
import '../../@types/PermissionAttr.js';
|
|
10
|
-
import '../slot/index.js';
|
|
11
|
-
import '../../tooltip/types.js';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _BaseNumber = require("./BaseNumber");
|
|
9
|
-
const _excluded = ["min", "max", "maskOptions"];
|
|
10
|
-
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); }
|
|
11
|
-
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; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
16
|
-
const {
|
|
17
|
-
min,
|
|
18
|
-
max,
|
|
19
|
-
maskOptions = {
|
|
20
|
-
scale: 2,
|
|
21
|
-
normalizeZeros: false,
|
|
22
|
-
padFractionalZeros: true,
|
|
23
|
-
thousandsSeparator: '',
|
|
24
|
-
radix: ',',
|
|
25
|
-
min: 0
|
|
26
|
-
}
|
|
27
|
-
} = props,
|
|
28
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(_BaseNumber.Input, _extends({}, rest, {
|
|
30
|
-
ref: ref,
|
|
31
|
-
min: min,
|
|
32
|
-
max: max,
|
|
33
|
-
maskOptions: maskOptions
|
|
34
|
-
}));
|
|
35
|
-
});
|
|
36
|
-
Input.displayName = 'DecimalInputField';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '../../index-f6f0d3a8.js';
|
|
3
|
-
export { I as Input, a as NumberFieldProps } from '../../Number-4783f0de.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';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Input = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactImask = require("react-imask");
|
|
9
|
-
var _textfield = require("../textfield");
|
|
10
|
-
const _excluded = ["min", "max", "name", "defaultValue", "children"];
|
|
11
|
-
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); }
|
|
12
|
-
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
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
17
|
-
const {
|
|
18
|
-
min,
|
|
19
|
-
max,
|
|
20
|
-
name,
|
|
21
|
-
defaultValue,
|
|
22
|
-
children = ''
|
|
23
|
-
} = props,
|
|
24
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
25
|
-
const defaultMaskOptions = {
|
|
26
|
-
min: min,
|
|
27
|
-
max: max,
|
|
28
|
-
mask: Number,
|
|
29
|
-
scale: 0,
|
|
30
|
-
normalizeZeros: false,
|
|
31
|
-
padFractionalZeros: false
|
|
32
|
-
};
|
|
33
|
-
const {
|
|
34
|
-
ref: maskInputRef
|
|
35
|
-
} = (0, _reactImask.useIMask)(defaultMaskOptions, {
|
|
36
|
-
defaultValue: defaultValue?.toString()
|
|
37
|
-
});
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_textfield.Input, _extends({}, rest, {
|
|
39
|
-
type: "text",
|
|
40
|
-
name: name,
|
|
41
|
-
textAlign: "right",
|
|
42
|
-
ref: el => {
|
|
43
|
-
if (maskInputRef) maskInputRef.current = el;
|
|
44
|
-
if (typeof ref === 'function') ref(el);else if (ref) ref.current = el;
|
|
45
|
-
},
|
|
46
|
-
defaultValue: defaultValue
|
|
47
|
-
}), children);
|
|
48
|
-
});
|
|
49
|
-
Input.displayName = 'NumberInputField';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const numberToPtBR: (value?: string | number) => string | undefined;
|
|
2
|
-
declare const numberToEnUS: (value: string | number) => string | number;
|
|
3
|
-
declare const formatOnlyNumbers: (value: string) => string;
|
|
4
|
-
|
|
5
|
-
export { formatOnlyNumbers, numberToEnUS, numberToPtBR };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.numberToPtBR = exports.numberToEnUS = exports.formatOnlyNumbers = void 0;
|
|
7
|
-
const ptBRRegex = /\b\d{1,3}(?:\.\d{3})*,\d+\b/;
|
|
8
|
-
const numberToPtBR = value => {
|
|
9
|
-
if (value !== undefined && typeof value === 'number') {
|
|
10
|
-
return value.toLocaleString('pt-BR');
|
|
11
|
-
}
|
|
12
|
-
return value;
|
|
13
|
-
};
|
|
14
|
-
exports.numberToPtBR = numberToPtBR;
|
|
15
|
-
const numberToEnUS = value => {
|
|
16
|
-
let formattedNumber;
|
|
17
|
-
const isPTBR = ptBRRegex.test(String(value));
|
|
18
|
-
if (isPTBR) {
|
|
19
|
-
formattedNumber = String(value).replaceAll('.', '').replaceAll(',', '.');
|
|
20
|
-
return formattedNumber;
|
|
21
|
-
}
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
24
|
-
exports.numberToEnUS = numberToEnUS;
|
|
25
|
-
const formatOnlyNumbers = value => {
|
|
26
|
-
const teste = value.replace(/[._\-/()\s+]/g, '');
|
|
27
|
-
return teste;
|
|
28
|
-
};
|
|
29
|
-
exports.formatOnlyNumbers = formatOnlyNumbers;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
export { RadioFieldInputProps } from './types.js';
|
|
3
|
-
export { I as Input } from '../../index-a0c1207e.js';
|
|
4
|
-
import '../../@types/Size.js';
|
|
5
|
-
import '../../@types/Align.js';
|
|
6
|
-
import '../../@types/ColorStyles.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
|
-
import '../../@types/PermissionAttr.js';
|