linear-react-components-ui 1.1.24-beta.0 → 1.1.24-beta.10
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-0c14ef51.d.ts +24 -0
- package/lib/Cnpj-bde01dd0.d.ts +18 -0
- package/lib/Cpf-3fa496ad.d.ts +18 -0
- package/lib/Phone-2bb0b397.d.ts +18 -0
- package/lib/ZipCode-09460e18.d.ts +13 -0
- package/lib/alerts/AlertProvider.js +1 -2
- package/lib/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +2 -3
- package/lib/alerts/withAlert.js +1 -2
- package/lib/assets/styles/calendar.scss +140 -35
- package/lib/assets/styles/datepicker2.scss +3 -9
- package/lib/assets/styles/file.scss +8 -0
- package/lib/assets/styles/filefield.scss +42 -0
- package/lib/assets/styles/numberfield.scss +18 -0
- package/lib/assets/styles/periodpicker.scss +1 -1
- package/lib/assets/styles/radiofield.scss +185 -0
- package/lib/assets/styles/selectfield.scss +1 -3
- package/lib/assets/styles/table.scss +6 -0
- package/lib/assets/styles/textfield.scss +61 -27
- package/lib/avatar/index.js +9 -11
- package/lib/badge/index.js +4 -4
- package/lib/buttons/Button.js +1 -2
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +22 -21
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +2 -2
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +123 -44
- package/lib/checkbox/index.js +2 -3
- package/lib/dialog/Custom.js +2 -3
- package/lib/dialog/Question.js +5 -4
- package/lib/dialog/base/Content.js +5 -6
- package/lib/dialog/base/Header.js +3 -4
- package/lib/dialog/base/index.js +33 -23
- package/lib/dialog/form/index.js +52 -12
- package/lib/dialog/types.d.ts +4 -0
- package/lib/dialog/wizard/index.js +1 -2
- package/lib/dialog/wizard/progressbar.js +1 -1
- package/lib/dialog/wizard/step.js +1 -1
- package/lib/dialog/wizard/useWizard.js +1 -2
- package/lib/drawer/Content.js +1 -2
- package/lib/drawer/Drawer.js +6 -7
- package/lib/drawer/Header.js +2 -3
- package/lib/dropdown/Popup.js +7 -7
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/withDropdown.js +3 -4
- package/lib/fieldset/index.js +8 -9
- package/lib/form/Field.js +2 -3
- package/lib/form/FieldArray.js +2 -3
- package/lib/form/FieldNumber.js +4 -5
- package/lib/form/FieldPeriod.js +3 -4
- package/lib/form/index.js +3 -4
- package/lib/form/withFieldHOC.js +1 -2
- package/lib/form/withFormSecurity.js +1 -2
- package/lib/form2/helpers.js +1 -1
- package/lib/form2/index.d.ts +1 -1
- package/lib/form2/types.d.ts +7 -3
- package/lib/form2/useForm/index.js +22 -15
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +1 -4
- package/lib/hint/index.js +1 -7
- package/lib/icons/helper.d.ts +16 -0
- package/lib/icons/helper.js +16 -0
- package/lib/icons/index.js +9 -9
- package/lib/index-208e7f62.d.ts +44 -0
- package/lib/index-3b70931d.d.ts +44 -0
- package/lib/index-442d51a2.d.ts +15 -0
- package/lib/index-4e511971.d.ts +26 -0
- package/lib/index-7dfa8924.d.ts +22 -0
- package/lib/index-9e576346.d.ts +23 -0
- package/lib/index-d3b6a19a.d.ts +41 -0
- package/lib/index-ecafc8c6.d.ts +30 -0
- package/lib/inputs/base/InputTextBase.js +9 -8
- package/lib/inputs/base/helpers.js +3 -7
- package/lib/inputs/base/types.d.ts +1 -1
- package/lib/inputs/color/index.js +2 -3
- package/lib/inputs/date/Dropdown.js +6 -4
- package/lib/inputs/date/index.js +34 -22
- package/lib/inputs/errorMessage/index.js +2 -3
- package/lib/inputs/file/DefaultFile.js +31 -31
- package/lib/inputs/file/DragDropFile.js +18 -17
- package/lib/inputs/file/File.js +6 -5
- package/lib/inputs/file/FileButtonSettings.js +0 -1
- package/lib/inputs/file/index.js +0 -1
- package/lib/inputs/inputHOC.js +1 -2
- package/lib/inputs/mask/BaseMask.js +1 -2
- package/lib/inputs/mask/Cnpj.js +1 -2
- package/lib/inputs/mask/Cpf.js +1 -2
- package/lib/inputs/multiSelect/ActionButtons.js +1 -2
- package/lib/inputs/multiSelect/Dropdown.js +11 -11
- package/lib/inputs/multiSelect/helper.js +2 -1
- package/lib/inputs/multiSelect/index.js +10 -9
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/index.js +3 -3
- package/lib/inputs/period/Dropdown.js +7 -4
- package/lib/inputs/period/PeriodList.js +3 -12
- package/lib/inputs/period/helper.js +1 -3
- package/lib/inputs/period/index.js +116 -113
- package/lib/inputs/period/types.d.ts +4 -1
- package/lib/inputs/search/index.js +8 -5
- package/lib/inputs/select/ActionButtons.js +1 -1
- package/lib/inputs/select/Dropdown.js +3 -4
- package/lib/inputs/select/helper.js +13 -10
- package/lib/inputs/select/multiple/Selecteds.js +2 -2
- package/lib/inputs/select/multiple/index.js +14 -11
- package/lib/inputs/select/simple/index.js +19 -13
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/inputs/types.d.ts +1 -0
- package/lib/inputs2/checkboxfield/index.d.ts +1 -1
- package/lib/inputs2/checkboxfield/index.js +18 -15
- package/lib/inputs2/colorfield/index.d.ts +2 -2
- package/lib/inputs2/colorfield/index.js +5 -5
- package/lib/inputs2/date/base/constants.js +2 -1
- package/lib/inputs2/date/base/index.js +6 -8
- package/lib/inputs2/date/datefield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/datefield/calendarbox.js +3 -2
- 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 +44 -33
- package/lib/inputs2/date/datefield/triggers.js +1 -2
- 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 +8 -6
- 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 +66 -48
- package/lib/inputs2/date/dateperiodfield/triggers.js +19 -14
- 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/{number/Number.d.ts → filefield/index.d.ts} +2 -2
- package/lib/inputs2/filefield/index.js +174 -0
- package/lib/inputs2/index.d.ts +20 -14
- package/lib/inputs2/index.js +10 -11
- package/lib/inputs2/mask/BaseMask.d.ts +2 -2
- package/lib/inputs2/mask/BaseMask.js +7 -7
- package/lib/inputs2/mask/Cnpj.d.ts +3 -3
- package/lib/inputs2/mask/Cnpj.js +4 -5
- package/lib/inputs2/mask/Cpf.d.ts +3 -3
- package/lib/inputs2/mask/Cpf.js +4 -5
- package/lib/inputs2/mask/Phone.d.ts +3 -3
- package/lib/inputs2/mask/Phone.js +1 -2
- package/lib/inputs2/mask/ZipCode.d.ts +3 -3
- package/lib/inputs2/mask/ZipCode.js +1 -2
- package/lib/inputs2/numberfield/currency.d.ts +13 -0
- package/lib/inputs2/numberfield/currency.js +91 -0
- package/lib/inputs2/numberfield/decimal.d.ts +13 -0
- package/lib/inputs2/{number/BaseNumber.js → numberfield/decimal.js} +57 -58
- 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/BaseNumber.d.ts → radiofield/index.d.ts} +4 -5
- package/lib/inputs2/radiofield/index.js +144 -0
- package/lib/inputs2/radiofield/types.d.ts +33 -0
- package/lib/inputs2/radiofield/types.js +5 -0
- package/lib/inputs2/selectfield/context.d.ts +1 -0
- package/lib/inputs2/selectfield/index.d.ts +2 -1
- package/lib/inputs2/selectfield/index.js +118 -58
- package/lib/inputs2/selectfield/item.d.ts +2 -1
- package/lib/inputs2/selectfield/item.js +8 -4
- package/lib/inputs2/selectfield/listbox.d.ts +1 -1
- package/lib/inputs2/selectfield/listbox.js +24 -10
- package/lib/inputs2/selectfield/options.d.ts +9 -0
- package/lib/inputs2/selectfield/options.js +26 -0
- package/lib/inputs2/selectfield/search.d.ts +1 -1
- package/lib/inputs2/selectfield/search.js +3 -4
- package/lib/inputs2/selectfield/selections.d.ts +1 -1
- package/lib/inputs2/selectfield/selections.js +3 -2
- package/lib/inputs2/selectfield/triggers.js +17 -8
- package/lib/inputs2/selectfield/types.d.ts +0 -1
- package/lib/inputs2/slot/index.d.ts +2 -2
- package/lib/inputs2/{number/Decimal.d.ts → textareafield/index.d.ts} +2 -5
- package/lib/inputs2/textareafield/index.js +194 -0
- package/lib/inputs2/textfield/index.d.ts +1 -1
- package/lib/inputs2/textfield/index.js +18 -17
- package/lib/labelMessages/index.js +4 -6
- package/lib/labels/DefaultLabel.js +2 -6
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.js +10 -12
- package/lib/list/index.js +2 -4
- package/lib/menus/float/MenuItem.js +3 -4
- package/lib/menus/float/SubMenuContainer.js +2 -3
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/MenuLink.js +1 -2
- package/lib/menus/sidenav/NavMenuGroup.js +2 -3
- package/lib/menus/sidenav/NavMenuItem.js +10 -9
- package/lib/menus/sidenav/NavSubMenuItem.js +2 -3
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +6 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +1 -2
- package/lib/panel/Content.js +9 -8
- package/lib/panel/Default.js +3 -4
- package/lib/panel/Header.js +4 -5
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/PopoverText.js +1 -2
- package/lib/popover/index.js +2 -1
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.js +3 -4
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +1 -2
- package/lib/skeleton/index.js +1 -4
- package/lib/spinner/index.js +3 -4
- package/lib/split/Split.js +2 -3
- package/lib/split/SplitSide.js +4 -5
- package/lib/table/Body.js +4 -5
- package/lib/table/Header.js +9 -7
- package/lib/table/HeaderColumn.js +2 -3
- package/lib/table/Row.js +4 -5
- package/lib/table/RowColumn.js +2 -3
- package/lib/table/index.js +20 -16
- package/lib/table/types.d.ts +1 -0
- package/lib/tabs/DropdownTabs.js +2 -3
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +4 -9
- package/lib/tabs/Panel.js +8 -7
- package/lib/tabs/context.js +7 -5
- package/lib/tabs/index.js +1 -2
- package/lib/textContent/index.js +2 -3
- package/lib/toolbar/ButtonBar.js +2 -3
- package/lib/toolbar/LabelBar.js +1 -2
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/TooltipContent.js +8 -9
- package/lib/tooltip/useTooltip.js +8 -8
- package/lib/treetable/Body.js +2 -3
- package/lib/treetable/Header.js +3 -4
- package/lib/treetable/Row.js +9 -10
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -6
- package/lib/treeview/index.js +5 -6
- package/lib/uitour/index.js +9 -8
- package/package.json +1 -1
- package/lib/BaseMask-3d5d581d.d.ts +0 -24
- package/lib/BaseNumber-797088d7.d.ts +0 -23
- package/lib/Cnpj-1602be21.d.ts +0 -18
- package/lib/Cpf-4d6b9079.d.ts +0 -18
- package/lib/Currency-b33d3a22.d.ts +0 -18
- package/lib/Decimal-55e836d5.d.ts +0 -13
- package/lib/Number-9c6aceff.d.ts +0 -20
- package/lib/Phone-79e5e3b4.d.ts +0 -18
- package/lib/ZipCode-8c2e9d8b.d.ts +0 -13
- 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/index-18a64236.d.ts +0 -23
- package/lib/index-43ad8140.d.ts +0 -41
- package/lib/index-772f9f1a.d.ts +0 -44
- package/lib/index-8a59cf4b.d.ts +0 -23
- package/lib/inputs2/number/Currency.d.ts +0 -11
- package/lib/inputs2/number/Currency.js +0 -47
- 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,18 @@
|
|
|
1
|
-
export { i as TextField } from '../index-
|
|
1
|
+
export { i as TextField } from '../index-3b70931d.js';
|
|
2
|
+
export { i as TextAreaField } from '../index-208e7f62.js';
|
|
3
|
+
export { i as NumberField } from '../index-ecafc8c6.js';
|
|
2
4
|
export { i as DateField } from '../index-368f781f.js';
|
|
3
|
-
export { i as
|
|
4
|
-
export { i as
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { C as
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { P as PhoneField } from '../Phone-79e5e3b4.js';
|
|
13
|
-
export { Z as ZipCodeField } from '../ZipCode-8c2e9d8b.js';
|
|
14
|
-
export { i as CheckboxField } from '../index-43ad8140.js';
|
|
5
|
+
export { i as RadioField } from '../index-442d51a2.js';
|
|
6
|
+
export { i as SelectField } from '../index-4e511971.js';
|
|
7
|
+
export { i as ColorField } from '../index-9e576346.js';
|
|
8
|
+
export { B as MaskField } from '../BaseMask-0c14ef51.js';
|
|
9
|
+
export { C as CpfField } from '../Cpf-3fa496ad.js';
|
|
10
|
+
export { C as CnpjField } from '../Cnpj-bde01dd0.js';
|
|
11
|
+
export { P as PhoneField } from '../Phone-2bb0b397.js';
|
|
12
|
+
export { Z as ZipCodeField } from '../ZipCode-09460e18.js';
|
|
13
|
+
export { i as CheckboxField } from '../index-d3b6a19a.js';
|
|
15
14
|
export { i as DatePeriodField } from '../index-c9247c1f.js';
|
|
15
|
+
export { i as FileField } from '../index-7dfa8924.js';
|
|
16
16
|
import 'react';
|
|
17
17
|
import '../@types/Align.js';
|
|
18
18
|
import '../@types/ColorStyles.js';
|
|
@@ -20,10 +20,16 @@ import '../@types/Position.js';
|
|
|
20
20
|
import '../@types/PermissionAttr.js';
|
|
21
21
|
import './slot/index.js';
|
|
22
22
|
import '../tooltip/types.js';
|
|
23
|
+
import './numberfield/decimal.js';
|
|
24
|
+
import './numberfield/types.js';
|
|
25
|
+
import './numberfield/currency.js';
|
|
23
26
|
import './date/datefield/types.js';
|
|
24
27
|
import 'moment';
|
|
28
|
+
import './date/types.js';
|
|
29
|
+
import './radiofield/types.js';
|
|
30
|
+
import '../@types/Size.js';
|
|
31
|
+
import './selectfield/options.js';
|
|
25
32
|
import './selectfield/item.js';
|
|
26
33
|
import './selectfield/types.js';
|
|
27
34
|
import 'imask';
|
|
28
|
-
import '../@types/Size.js';
|
|
29
35
|
import './date/dateperiodfield/types.js';
|
package/lib/inputs2/index.js
CHANGED
|
@@ -3,23 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ZipCodeField = exports.TextField = exports.SelectField = exports.PhoneField = exports.NumberField = exports.MaskField = exports.
|
|
6
|
+
exports.ZipCodeField = exports.TextField = exports.TextAreaField = exports.SelectField = exports.RadioField = exports.PhoneField = exports.NumberField = exports.MaskField = exports.FileField = 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 TextAreaField = _interopRequireWildcard(require("./textareafield"));
|
|
10
|
+
exports.TextAreaField = TextAreaField;
|
|
11
|
+
var NumberField = _interopRequireWildcard(require("./numberfield"));
|
|
12
|
+
exports.NumberField = NumberField;
|
|
9
13
|
var DateField = _interopRequireWildcard(require("./date/datefield"));
|
|
10
14
|
exports.DateField = DateField;
|
|
15
|
+
var RadioField = _interopRequireWildcard(require("./radiofield"));
|
|
16
|
+
exports.RadioField = RadioField;
|
|
11
17
|
var SelectField = _interopRequireWildcard(require("./selectfield"));
|
|
12
18
|
exports.SelectField = SelectField;
|
|
13
19
|
var ColorField = _interopRequireWildcard(require("./colorfield"));
|
|
14
20
|
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
21
|
var MaskField = _interopRequireWildcard(require("./mask/BaseMask"));
|
|
24
22
|
exports.MaskField = MaskField;
|
|
25
23
|
var CpfField = _interopRequireWildcard(require("./mask/Cpf"));
|
|
@@ -34,5 +32,6 @@ var CheckboxField = _interopRequireWildcard(require("./checkboxfield"));
|
|
|
34
32
|
exports.CheckboxField = CheckboxField;
|
|
35
33
|
var DatePeriodField = _interopRequireWildcard(require("./date/dateperiodfield"));
|
|
36
34
|
exports.DatePeriodField = DatePeriodField;
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
var FileField = _interopRequireWildcard(require("./filefield/index"));
|
|
36
|
+
exports.FileField = FileField;
|
|
37
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../index-
|
|
2
|
+
import '../../index-3b70931d.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-0c14ef51.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -9,8 +9,7 @@ var _reactImask = require("react-imask");
|
|
|
9
9
|
var _textfield = require("../textfield");
|
|
10
10
|
var _helpers = require("../../form2/helpers");
|
|
11
11
|
const _excluded = ["maskOptions", "autoCompleteMask", "name", "value", "onComplete", "onChange", "onBlur", "onAccept"];
|
|
12
|
-
function
|
|
13
|
-
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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
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); }
|
|
15
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; }
|
|
16
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; }
|
|
@@ -39,7 +38,7 @@ const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
|
|
|
39
38
|
} = (0, _reactImask.useIMask)(maskOptions, {
|
|
40
39
|
ref: inputRef,
|
|
41
40
|
onComplete: (__, maskRef) => {
|
|
42
|
-
onComplete
|
|
41
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete(maskRef.value, maskRef);
|
|
43
42
|
},
|
|
44
43
|
onAccept: (__, maskRef) => {
|
|
45
44
|
const syntheticEvent = {
|
|
@@ -48,12 +47,12 @@ const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
|
|
|
48
47
|
value: maskRef.unmaskedValue
|
|
49
48
|
}
|
|
50
49
|
};
|
|
51
|
-
onChange
|
|
52
|
-
onAccept
|
|
50
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(syntheticEvent);
|
|
51
|
+
onAccept === null || onAccept === void 0 ? void 0 : onAccept(maskRef.value);
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
_react.default.useEffect(() => {
|
|
56
|
-
const currentValue = valueFromProps
|
|
55
|
+
const currentValue = valueFromProps !== null && valueFromProps !== void 0 ? valueFromProps : '';
|
|
57
56
|
if (currentValue === '') {
|
|
58
57
|
if (refMask.current) {
|
|
59
58
|
refMask.current.value = '';
|
|
@@ -68,8 +67,9 @@ const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
|
|
|
68
67
|
value: value,
|
|
69
68
|
onBlur: e => {
|
|
70
69
|
if (unmaskedValue.trim().length && autoCompleteMask) {
|
|
70
|
+
var _maskOptions$mask;
|
|
71
71
|
const currentValue = unmaskedValue;
|
|
72
|
-
const sizeMask = maskOptions
|
|
72
|
+
const sizeMask = maskOptions === null || maskOptions === void 0 ? void 0 : (_maskOptions$mask = maskOptions.mask) === null || _maskOptions$mask === void 0 ? void 0 : _maskOptions$mask.toString().replace(/\D+/g, '').length;
|
|
73
73
|
if (sizeMask && sizeMask > currentValue.length) {
|
|
74
74
|
switch (autoCompleteMask) {
|
|
75
75
|
case 'left':
|
|
@@ -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-0c14ef51.js';
|
|
3
|
+
export { a as CnpjFieldProps, I as Input } from '../../Cnpj-bde01dd0.js';
|
|
4
|
+
import '../../index-3b70931d.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
package/lib/inputs2/mask/Cnpj.js
CHANGED
|
@@ -9,8 +9,7 @@ var _helpers = require("../../../lib/form2/helpers");
|
|
|
9
9
|
var _helpers2 = require("./helpers");
|
|
10
10
|
var _BaseMask = require("./BaseMask");
|
|
11
11
|
const _excluded = ["name", "onValidate", "onChange", "onBlur", "errors"];
|
|
12
|
-
function
|
|
13
|
-
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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
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); }
|
|
15
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; }
|
|
16
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; }
|
|
@@ -29,16 +28,16 @@ const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
|
|
|
29
28
|
const hasCnpjError = externalErrors.includes(CNPJ_INVALID_MESSAGE);
|
|
30
29
|
const isValid = (0, _helpers2.CNPJValidation)(raw);
|
|
31
30
|
if (!isValid && hasCnpjError) {
|
|
32
|
-
onValidate
|
|
31
|
+
onValidate === null || onValidate === void 0 ? void 0 : onValidate([CNPJ_INVALID_MESSAGE]);
|
|
33
32
|
}
|
|
34
33
|
if (isValid && !hasCnpjError) {
|
|
35
|
-
onValidate
|
|
34
|
+
onValidate === null || onValidate === void 0 ? void 0 : onValidate([]);
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
const handleChange = e => {
|
|
39
38
|
const rawValue = e.target.value.replace(/\D/g, '');
|
|
40
39
|
validateCnpj(rawValue);
|
|
41
|
-
onChange
|
|
40
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
42
41
|
};
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement(_BaseMask.Input, _extends({}, rest, {
|
|
44
43
|
type: "text",
|
|
@@ -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-0c14ef51.js';
|
|
3
|
+
export { a as CpfFieldProps, I as Input } from '../../Cpf-3fa496ad.js';
|
|
4
|
+
import '../../index-3b70931d.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
package/lib/inputs2/mask/Cpf.js
CHANGED
|
@@ -8,8 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _helpers = require("./helpers");
|
|
9
9
|
var _BaseMask = require("./BaseMask");
|
|
10
10
|
const _excluded = ["onValidate", "onBlur", "onChange", "errors"];
|
|
11
|
-
function
|
|
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; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
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); }
|
|
14
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; }
|
|
15
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; }
|
|
@@ -26,16 +25,16 @@ const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
|
|
|
26
25
|
const hasCpfError = externalErrors.includes(CPF_INVALID_MESSAGE);
|
|
27
26
|
const isValid = (0, _helpers.CPFValidation)(raw);
|
|
28
27
|
if (!isValid && hasCpfError) {
|
|
29
|
-
onValidate
|
|
28
|
+
onValidate === null || onValidate === void 0 ? void 0 : onValidate([CPF_INVALID_MESSAGE]);
|
|
30
29
|
}
|
|
31
30
|
if (isValid && !hasCpfError) {
|
|
32
|
-
onValidate
|
|
31
|
+
onValidate === null || onValidate === void 0 ? void 0 : onValidate([]);
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
const handleChange = e => {
|
|
36
35
|
const rawValue = e.target.value.replace(/\D/g, '');
|
|
37
36
|
validateCpf(rawValue);
|
|
38
|
-
onChange
|
|
37
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
39
38
|
};
|
|
40
39
|
return /*#__PURE__*/_react.default.createElement(_BaseMask.Input, _extends({}, rest, {
|
|
41
40
|
type: "text",
|
|
@@ -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-0c14ef51.js';
|
|
3
|
+
export { I as Input, a as PhoneFieldProps } from '../../Phone-2bb0b397.js';
|
|
4
|
+
import '../../index-3b70931d.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Input = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _BaseMask = require("./BaseMask");
|
|
9
|
-
function
|
|
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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
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
11
|
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
13
12
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '../../BaseMask-
|
|
3
|
-
export { I as Input } from '../../ZipCode-
|
|
4
|
-
import '../../index-
|
|
2
|
+
import '../../BaseMask-0c14ef51.js';
|
|
3
|
+
export { I as Input } from '../../ZipCode-09460e18.js';
|
|
4
|
+
import '../../index-3b70931d.js';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/ColorStyles.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Input = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _BaseMask = require("./BaseMask");
|
|
9
|
-
function
|
|
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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
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
11
|
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
13
12
|
return /*#__PURE__*/_react.default.createElement(_BaseMask.Input, _extends({}, props, {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { CurrencyFieldInputProps } from './types.js';
|
|
3
|
+
import '../../index-3b70931d.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 };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Currency = void 0;
|
|
7
|
+
require("../../assets/styles/numberfield.scss");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
+
var _reactImask = require("react-imask");
|
|
11
|
+
var _2 = require("..");
|
|
12
|
+
var _helpers = require("../../form2/helpers");
|
|
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 }; }
|
|
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); }
|
|
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; }
|
|
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
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); }
|
|
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; }
|
|
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; }
|
|
23
|
+
const Currency = exports.Currency = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
24
|
+
const {
|
|
25
|
+
min = undefined,
|
|
26
|
+
max = undefined,
|
|
27
|
+
to = undefined,
|
|
28
|
+
from = undefined,
|
|
29
|
+
enum: interval = undefined,
|
|
30
|
+
onChange = null,
|
|
31
|
+
allowNegative = true,
|
|
32
|
+
textAlign = 'right',
|
|
33
|
+
children = null,
|
|
34
|
+
scale = 2,
|
|
35
|
+
normalizeZeros = false,
|
|
36
|
+
padFractionalZeros = true,
|
|
37
|
+
currencySymbol = 'R$'
|
|
38
|
+
} = props,
|
|
39
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
40
|
+
const numberInputRef = _react.default.useRef(null);
|
|
41
|
+
const {
|
|
42
|
+
value: maskedValue,
|
|
43
|
+
setValue: setMaskedValue,
|
|
44
|
+
unmaskedValue
|
|
45
|
+
} = (0, _reactImask.useIMask)({
|
|
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,
|
|
56
|
+
scale,
|
|
57
|
+
normalizeZeros,
|
|
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 === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, event), {}, {
|
|
65
|
+
target: _objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.target), {}, {
|
|
66
|
+
name: props === null || props === void 0 ? void 0 : props.name,
|
|
67
|
+
value: valueToReturn
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
_react.default.useEffect(() => {
|
|
73
|
+
const valueToString = _lodash.default.toString(props === null || props === void 0 ? void 0 : props.value);
|
|
74
|
+
if (!_lodash.default.isNil(props === null || props === void 0 ? void 0 : props.value) && !_lodash.default.isEqual(parseFloat(valueToString), parseFloat(unmaskedValue))) {
|
|
75
|
+
setMaskedValue(parseFloat(valueToString).toLocaleString('pt-BR'));
|
|
76
|
+
}
|
|
77
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_2.TextField.Input, _extends({}, rest, {
|
|
79
|
+
ref: (0, _helpers.mergeRefs)(ref, numberInputRef),
|
|
80
|
+
type: "text",
|
|
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);
|
|
90
|
+
});
|
|
91
|
+
Currency.displayName = 'CurrencyFieldInput';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { DecimalFieldInputProps } from './types.js';
|
|
3
|
+
import '../../index-3b70931d.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 };
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var _react =
|
|
6
|
+
exports.Decimal = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
9
|
var _reactImask = require("react-imask");
|
|
9
|
-
var
|
|
10
|
+
var _2 = require("..");
|
|
10
11
|
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; }
|
|
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 }; }
|
|
16
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); }
|
|
17
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; }
|
|
18
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; }
|
|
@@ -21,66 +19,67 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
21
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); }
|
|
22
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; }
|
|
23
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; }
|
|
24
|
-
const
|
|
22
|
+
const Decimal = exports.Decimal = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
25
23
|
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
min = undefined,
|
|
25
|
+
max = undefined,
|
|
26
|
+
to = undefined,
|
|
27
|
+
from = undefined,
|
|
28
|
+
enum: interval = undefined,
|
|
29
|
+
onChange = null,
|
|
30
|
+
allowNegative = true,
|
|
30
31
|
textAlign = 'right',
|
|
31
|
-
|
|
32
|
+
children = null,
|
|
33
|
+
scale = 2,
|
|
34
|
+
normalizeZeros = false,
|
|
35
|
+
padFractionalZeros = true
|
|
32
36
|
} = props,
|
|
33
37
|
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);
|
|
38
|
+
const numberInputRef = _react.default.useRef(null);
|
|
45
39
|
const {
|
|
46
|
-
value,
|
|
47
|
-
setValue:
|
|
48
|
-
|
|
40
|
+
value: maskedValue,
|
|
41
|
+
setValue: setMaskedValue,
|
|
42
|
+
unmaskedValue
|
|
43
|
+
} = (0, _reactImask.useIMask)({
|
|
49
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,
|
|
50
54
|
scale,
|
|
51
|
-
thousandsSeparator,
|
|
52
|
-
radix,
|
|
53
55
|
normalizeZeros,
|
|
54
|
-
padFractionalZeros
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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 === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, event), {}, {
|
|
63
|
+
target: _objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.target), {}, {
|
|
64
|
+
name: props === null || props === void 0 ? void 0 : props.name,
|
|
65
|
+
value: valueToReturn
|
|
66
|
+
})
|
|
67
|
+
}));
|
|
60
68
|
}
|
|
61
69
|
});
|
|
62
70
|
_react.default.useEffect(() => {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
const valueToString = _lodash.default.toString(props === null || props === void 0 ? void 0 : props.value);
|
|
72
|
+
if (!_lodash.default.isNil(props === null || props === void 0 ? void 0 : props.value) && !_lodash.default.isEqual(parseFloat(valueToString), parseFloat(unmaskedValue))) {
|
|
73
|
+
setMaskedValue(parseFloat(valueToString).toLocaleString('pt-BR'));
|
|
74
|
+
}
|
|
75
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_2.TextField.Input, _extends({}, rest, {
|
|
77
|
+
ref: (0, _helpers.mergeRefs)(ref, numberInputRef),
|
|
69
78
|
type: "text",
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
}));
|
|
79
|
+
inputMode: "numeric",
|
|
80
|
+
value: maskedValue,
|
|
81
|
+
textAlign: textAlign,
|
|
82
|
+
onChange: () => {}
|
|
83
|
+
}), children);
|
|
85
84
|
});
|
|
86
|
-
|
|
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 };
|