linear-react-components-ui 1.1.14-beta.0 → 1.1.14-beta.1
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/.eslintrc.json +45 -77
- package/.gitlab-ci.yml +13 -5
- package/.nvmrc +1 -0
- package/.vscode/settings.json +12 -3
- package/babel.config.json +4 -4
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.js +48 -57
- package/lib/alerts/AlertProvider.js +36 -54
- package/lib/alerts/BaseAlert.js +12 -19
- package/lib/alerts/Message.d.ts +1 -1
- package/lib/alerts/Message.js +78 -45
- package/lib/alerts/helpers.js +2 -3
- package/lib/alerts/index.js +3 -4
- package/lib/alerts/types.d.ts +1 -0
- package/lib/alerts/withAlert.js +10 -11
- package/lib/assets/styles/alerts.scss +4 -7
- package/lib/assets/styles/button.scss +11 -9
- package/lib/assets/styles/checkbox.scss +45 -38
- package/lib/assets/styles/colors.scss +3 -1
- package/lib/assets/styles/commons.scss +1 -0
- package/lib/assets/styles/dialog.scss +37 -20
- package/lib/assets/styles/drawers.scss +9 -6
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +3 -0
- package/lib/assets/styles/gridlayout.scss +0 -2
- package/lib/assets/styles/hint.scss +21 -0
- package/lib/assets/styles/icon.scss +31 -4
- package/lib/assets/styles/input.scss +7 -7
- package/lib/assets/styles/multiSelect.scss +6 -1
- package/lib/assets/styles/radio.scss +37 -35
- package/lib/assets/styles/select.scss +13 -7
- package/lib/assets/styles/table.scss +9 -1
- package/lib/assets/styles/tabs.scss +28 -18
- package/lib/assets/styles/textContent.scss +9 -0
- package/lib/avatar/index.js +41 -41
- package/lib/badge/index.js +12 -14
- package/lib/buttons/ActivateButton.js +6 -9
- package/lib/buttons/AddButton.js +9 -12
- package/lib/buttons/Button.js +11 -12
- package/lib/buttons/ButtonGroups.js +6 -5
- package/lib/buttons/CancelButton.js +10 -9
- package/lib/buttons/DangerButton.js +10 -9
- package/lib/buttons/DefaultButton.js +90 -90
- package/lib/buttons/DestroyButton.js +10 -9
- package/lib/buttons/EditButton.js +6 -9
- package/lib/buttons/InactivateButton.js +6 -9
- package/lib/buttons/InfoButton.js +10 -9
- package/lib/buttons/PrimaryButton.js +10 -9
- package/lib/buttons/RestoreButton.js +6 -9
- package/lib/buttons/SaveButton.js +10 -9
- package/lib/buttons/SuccessButton.js +10 -9
- package/lib/buttons/WarningButton.js +10 -9
- package/lib/buttons/button_container/index.js +17 -21
- package/lib/buttons/index.js +16 -17
- package/lib/buttons/split_button/index.js +22 -25
- package/lib/buttons/types.d.ts +1 -0
- package/lib/calendar/DangerCalendar.js +10 -9
- package/lib/calendar/InfoCalendar.js +10 -9
- package/lib/calendar/PrimaryCalendar.js +10 -9
- package/lib/calendar/SuccessCalendar.js +10 -9
- package/lib/calendar/WarningCalendar.js +10 -9
- package/lib/calendar/base/Day.js +13 -12
- package/lib/calendar/base/Month.js +13 -18
- package/lib/calendar/base/Week.js +13 -18
- package/lib/calendar/base/helpers.js +12 -12
- package/lib/calendar/base/index.js +30 -44
- package/lib/calendar/index.js +7 -8
- package/lib/checkbox/Label.js +20 -10
- package/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox/index.js +83 -97
- package/lib/checkbox/types.d.ts +2 -1
- package/lib/dialog/Alert.js +5 -6
- package/lib/dialog/Custom.js +16 -18
- package/lib/dialog/Error.js +5 -6
- package/lib/dialog/Information.js +5 -6
- package/lib/dialog/Question.js +13 -14
- package/lib/dialog/Warning.js +7 -7
- package/lib/dialog/base/Content.js +8 -6
- package/lib/dialog/base/Footer.js +5 -8
- package/lib/dialog/base/Header.js +29 -29
- package/lib/dialog/base/index.d.ts +8 -2
- package/lib/dialog/base/index.js +109 -105
- package/lib/dialog/base/style.js +7 -10
- package/lib/dialog/form/index.js +31 -34
- package/lib/dialog/index.js +8 -9
- package/lib/dialog/types.d.ts +8 -13
- package/lib/drawer/Content.js +12 -11
- package/lib/drawer/Drawer.js +74 -88
- package/lib/drawer/Header.js +34 -37
- package/lib/drawer/helpers.js +3 -4
- package/lib/drawer/index.js +4 -5
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +41 -42
- package/lib/dropdown/helper.js +3 -5
- package/lib/dropdown/types.d.ts +1 -0
- package/lib/dropdown/withDropdown.js +39 -60
- package/lib/fieldset/index.js +52 -58
- package/lib/fieldset/types.d.ts +2 -0
- package/lib/form/Field.d.ts +2 -0
- package/lib/form/Field.js +73 -79
- package/lib/form/FieldArray.d.ts +2 -0
- package/lib/form/FieldArray.js +70 -94
- package/lib/form/FieldNumber.d.ts +2 -0
- package/lib/form/FieldNumber.js +39 -48
- package/lib/form/FieldPeriod.d.ts +2 -0
- package/lib/form/FieldPeriod.js +48 -54
- package/lib/form/helpers.d.ts +2 -0
- package/lib/form/helpers.js +22 -27
- package/lib/form/index.d.ts +2 -0
- package/lib/form/index.js +114 -146
- package/lib/form/types.d.ts +6 -2
- package/lib/form/withFieldHOC.d.ts +2 -0
- package/lib/form/withFieldHOC.js +32 -39
- package/lib/form/withFormSecurity.d.ts +2 -0
- package/lib/form/withFormSecurity.js +27 -35
- package/lib/gridlayout/GridCol.js +14 -14
- package/lib/gridlayout/GridRow.js +18 -12
- package/lib/gridlayout/index.js +3 -4
- package/lib/gridlayout/types.d.ts +1 -1
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +2 -1
- package/lib/hint/index.js +18 -29
- package/lib/hint/types.d.ts +3 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +7 -4
- package/lib/icons/index.d.ts +3 -2
- package/lib/icons/index.js +43 -48
- package/lib/icons/types.d.ts +22 -9
- package/lib/index.d.ts +2 -1
- package/lib/index.js +10 -10
- package/lib/inputs/base/InputTextBase.d.ts +2 -0
- package/lib/inputs/base/InputTextBase.js +149 -113
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +3 -2
- package/lib/inputs/base/helpers.js +21 -26
- package/lib/inputs/base/types.d.ts +17 -2
- package/lib/inputs/color/index.js +29 -40
- package/lib/inputs/date/Dialog.d.ts +2 -0
- package/lib/inputs/date/Dialog.js +9 -10
- package/lib/inputs/date/Dropdown.d.ts +2 -0
- package/lib/inputs/date/Dropdown.js +12 -11
- package/lib/inputs/date/helpers.d.ts +2 -0
- package/lib/inputs/date/helpers.js +14 -14
- package/lib/inputs/date/index.d.ts +2 -0
- package/lib/inputs/date/index.js +127 -152
- package/lib/inputs/date/types.d.ts +4 -1
- package/lib/inputs/{mask/imaskHOC.d.ts → errorMessage/index.d.ts} +5 -7
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.d.ts +2 -0
- package/lib/inputs/file/DefaultFile.js +47 -74
- package/lib/inputs/file/DragDropFile.d.ts +2 -0
- package/lib/inputs/file/DragDropFile.js +97 -149
- package/lib/inputs/file/File.d.ts +3 -1
- package/lib/inputs/file/File.js +26 -32
- package/lib/inputs/file/FileButtonSettings.d.ts +2 -0
- package/lib/inputs/file/FileButtonSettings.js +13 -13
- package/lib/inputs/file/helpers.d.ts +2 -0
- package/lib/inputs/file/helpers.js +4 -6
- package/lib/inputs/file/index.d.ts +2 -0
- package/lib/inputs/file/index.js +4 -5
- package/lib/inputs/file/types.d.ts +2 -0
- package/lib/inputs/inputHOC.d.ts +2 -1
- package/lib/inputs/inputHOC.js +21 -34
- package/lib/inputs/mask/BaseMask.d.ts +4 -5
- package/lib/inputs/mask/BaseMask.js +125 -37
- package/lib/inputs/mask/Cnpj.d.ts +2 -0
- package/lib/inputs/mask/Cnpj.js +18 -31
- package/lib/inputs/mask/Cpf.d.ts +2 -0
- package/lib/inputs/mask/Cpf.js +20 -37
- package/lib/inputs/mask/Phone.d.ts +2 -0
- package/lib/inputs/mask/Phone.js +7 -6
- package/lib/inputs/mask/ZipCode.d.ts +2 -0
- package/lib/inputs/mask/ZipCode.js +6 -9
- package/lib/inputs/mask/helpers.d.ts +50 -12
- package/lib/inputs/mask/helpers.js +77 -37
- package/lib/inputs/mask/index.d.ts +4 -2
- package/lib/inputs/mask/index.js +6 -7
- package/lib/inputs/mask/types.d.ts +18 -17
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -0
- package/lib/inputs/multiSelect/ActionButtons.js +23 -22
- package/lib/inputs/multiSelect/Dropdown.d.ts +2 -0
- package/lib/inputs/multiSelect/Dropdown.js +50 -67
- package/lib/inputs/multiSelect/helper.d.ts +2 -0
- package/lib/inputs/multiSelect/helper.js +8 -7
- package/lib/inputs/multiSelect/index.d.ts +2 -0
- package/lib/inputs/multiSelect/index.js +83 -135
- package/lib/inputs/multiSelect/types.d.ts +2 -0
- package/lib/inputs/number/BaseNumber.d.ts +2 -1
- package/lib/inputs/number/BaseNumber.js +25 -24
- package/lib/inputs/number/Currency.d.ts +2 -1
- package/lib/inputs/number/Currency.js +8 -8
- package/lib/inputs/number/Decimal.d.ts +2 -1
- package/lib/inputs/number/Decimal.js +3 -6
- package/lib/inputs/number/format_number.js +5 -5
- package/lib/inputs/number/index.d.ts +2 -1
- package/lib/inputs/number/index.js +20 -32
- package/lib/inputs/number/types.d.ts +2 -9
- package/lib/inputs/period/Dialog.d.ts +3 -1
- package/lib/inputs/period/Dialog.js +9 -10
- package/lib/inputs/period/Dropdown.d.ts +2 -0
- package/lib/inputs/period/Dropdown.js +8 -9
- package/lib/inputs/period/PeriodList.d.ts +2 -0
- package/lib/inputs/period/PeriodList.js +14 -13
- package/lib/inputs/period/helper.d.ts +2 -0
- package/lib/inputs/period/helper.js +34 -37
- package/lib/inputs/period/index.d.ts +2 -0
- package/lib/inputs/period/index.js +162 -196
- package/lib/inputs/period/types.d.ts +3 -1
- package/lib/inputs/search/index.d.ts +2 -1
- package/lib/inputs/search/index.js +45 -68
- package/lib/inputs/select/ActionButtons.d.ts +2 -1
- package/lib/inputs/select/ActionButtons.js +25 -35
- package/lib/inputs/select/Dropdown.d.ts +2 -1
- package/lib/inputs/select/Dropdown.js +41 -60
- package/lib/inputs/select/helper.d.ts +2 -1
- package/lib/inputs/select/helper.js +49 -43
- package/lib/inputs/select/index.d.ts +2 -0
- package/lib/inputs/select/index.js +13 -12
- package/lib/inputs/select/multiple/Selecteds.d.ts +3 -1
- package/lib/inputs/select/multiple/Selecteds.js +17 -22
- package/lib/inputs/select/multiple/index.d.ts +2 -0
- package/lib/inputs/select/multiple/index.js +125 -162
- package/lib/inputs/select/simple/index.d.ts +2 -0
- package/lib/inputs/select/simple/index.js +154 -179
- package/lib/inputs/select/types.d.ts +5 -2
- package/lib/inputs/text/index.js +3 -6
- package/lib/inputs/textarea/index.d.ts +2 -0
- package/lib/inputs/textarea/index.js +10 -10
- package/lib/inputs/textarea/types.d.ts +2 -0
- package/lib/inputs/types.d.ts +12 -9
- package/lib/internals/colorStyles.js +2 -3
- package/lib/internals/constants.js +2 -4
- package/lib/internals/types.d.ts +5 -2
- package/lib/internals/withTooltip.d.ts +3 -2
- package/lib/internals/withTooltip.js +76 -76
- package/lib/labelMessages/index.js +22 -42
- package/lib/labels/DangerLabel.js +10 -9
- package/lib/labels/DefaultLabel.js +26 -40
- package/lib/labels/InfoLabel.js +10 -9
- package/lib/labels/PrimaryLabel.js +10 -9
- package/lib/labels/SuccessLabel.js +10 -9
- package/lib/labels/WarningLabel.js +10 -9
- package/lib/labels/index.js +8 -9
- package/lib/labels/label_container/index.js +8 -8
- package/lib/list/Header.js +9 -8
- package/lib/list/Item.js +74 -70
- package/lib/list/Separator.js +5 -8
- package/lib/list/helpers.js +4 -6
- package/lib/list/index.js +74 -101
- package/lib/menus/float/MenuItem.js +19 -20
- package/lib/menus/float/SubMenuContainer.js +27 -33
- package/lib/menus/float/helpers.js +3 -4
- package/lib/menus/float/index.js +17 -18
- package/lib/menus/float/types.d.ts +1 -1
- package/lib/menus/index.js +2 -3
- package/lib/menus/sidenav/ExpandMenu.js +9 -8
- package/lib/menus/sidenav/MenuLink.js +10 -9
- package/lib/menus/sidenav/NavMenuGroup.js +12 -11
- package/lib/menus/sidenav/NavMenuItem.js +48 -62
- package/lib/menus/sidenav/NavSubMenuItem.js +20 -25
- package/lib/menus/sidenav/helpers.js +6 -9
- package/lib/menus/sidenav/index.js +85 -113
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +7 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
- package/lib/menus/sidenav/types.d.ts +1 -1
- package/lib/noPermission/index.js +14 -17
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +47 -60
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/DangerPanel.js +6 -9
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Default.js +45 -60
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +32 -30
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/InfoPanel.js +6 -9
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.js +6 -9
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.js +6 -9
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/ToolBar.js +6 -5
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/WarningPanel.js +6 -9
- package/lib/panel/helpers.d.ts +7 -2
- package/lib/panel/helpers.js +12 -24
- package/lib/panel/index.d.ts +1 -1
- package/lib/panel/index.js +9 -10
- package/lib/panel/types.d.ts +46 -5
- package/lib/permissionValidations.js +24 -29
- package/lib/popover/PopoverText.js +6 -5
- package/lib/popover/PopoverTitle.js +6 -5
- package/lib/popover/index.js +15 -19
- package/lib/progress/Bar.js +31 -37
- package/lib/progress/index.js +18 -20
- package/lib/radio/index.js +36 -57
- package/lib/shortcuts/index.js +10 -9
- package/lib/skeleton/SkeletonContainer.js +10 -11
- package/lib/skeleton/index.js +27 -34
- package/lib/spinner/SpinnerLoading.js +7 -8
- package/lib/spinner/index.js +23 -37
- package/lib/split/Split.js +95 -112
- package/lib/split/SplitSide.js +20 -19
- package/lib/split/helpers.js +3 -4
- package/lib/split/index.js +3 -4
- package/lib/table/Body.js +42 -45
- package/lib/table/Header.js +29 -32
- package/lib/table/HeaderColumn.d.ts +1 -1
- package/lib/table/HeaderColumn.js +35 -22
- package/lib/table/Row.js +45 -48
- package/lib/table/RowColumn.js +38 -39
- package/lib/table/helpers.js +7 -13
- package/lib/table/index.js +82 -102
- package/lib/table/types.d.ts +3 -0
- package/lib/tabs/DropdownTabs.d.ts +11 -0
- package/lib/tabs/DropdownTabs.js +71 -0
- package/lib/tabs/Menu.d.ts +1 -1
- package/lib/tabs/Menu.js +35 -23
- package/lib/tabs/{DropdownItems.d.ts → MenuTabs.d.ts} +3 -3
- package/lib/tabs/MenuTabs.js +82 -0
- package/lib/tabs/Panel.d.ts +1 -1
- package/lib/tabs/Panel.js +70 -66
- package/lib/tabs/context.d.ts +12 -0
- package/lib/tabs/context.js +130 -0
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/index.js +46 -225
- package/lib/tabs/tabHelpers.d.ts +4 -15
- package/lib/tabs/tabHelpers.js +37 -42
- package/lib/tabs/types.d.ts +48 -15
- package/lib/tabs/useTabs.d.ts +11 -0
- package/lib/tabs/useTabs.js +11 -0
- package/lib/textContent/index.d.ts +8 -0
- package/lib/textContent/index.js +30 -0
- package/lib/toolbar/ButtonBar.js +39 -43
- package/lib/toolbar/LabelBar.js +36 -40
- package/lib/toolbar/Separator.js +5 -8
- package/lib/toolbar/ToolBarGroup.js +7 -7
- package/lib/toolbar/helpers.js +2 -3
- package/lib/toolbar/index.js +23 -25
- package/lib/toolbar/types.d.ts +1 -0
- package/lib/tooltip/index.js +28 -33
- package/lib/treetable/Body.js +21 -33
- package/lib/treetable/Header.js +11 -14
- package/lib/treetable/Row.js +90 -142
- package/lib/treetable/helpers.js +15 -24
- package/lib/treetable/index.js +11 -13
- package/lib/treeview/Header.js +8 -7
- package/lib/treeview/Node.js +96 -136
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.js +150 -216
- package/lib/uitour/helpers.js +4 -7
- package/lib/uitour/index.d.ts +2 -1
- package/lib/uitour/index.js +113 -100
- package/lib/uitour/types.d.ts +9 -1
- package/package.json +77 -82
- package/tsconfig.json +1 -0
- package/.tool-versions +0 -1
- package/lib/inputs/mask/imaskHOC.js +0 -224
- package/lib/tabs/DropdownItems.js +0 -65
- package/lib/tabs/MenuItems.d.ts +0 -11
- package/lib/tabs/MenuItems.js +0 -76
- package/lib/treeview_old/Header.js +0 -28
- package/lib/treeview_old/Node.js +0 -88
- package/lib/treeview_old/index.js +0 -42
- package/lib/types-c2a0f035.d.ts +0 -50
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -17,83 +16,53 @@ var _Dialog = _interopRequireDefault(require("./Dialog"));
|
|
|
17
16
|
var _hint = _interopRequireDefault(require("../../hint"));
|
|
18
17
|
var helperBase = _interopRequireWildcard(require("../base/helpers"));
|
|
19
18
|
require("../../assets/styles/periodpicker.scss");
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
function
|
|
23
|
-
function
|
|
24
|
-
function
|
|
25
|
-
function
|
|
26
|
-
function
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_props$openOnFocus = props.openOnFocus,
|
|
38
|
-
openOnFocus = _props$openOnFocus === void 0 ? true : _props$openOnFocus,
|
|
39
|
-
_props$shouldCloseOnS = props.shouldCloseOnSelect,
|
|
40
|
-
shouldCloseOnSelect = _props$shouldCloseOnS === void 0 ? true : _props$shouldCloseOnS,
|
|
41
|
-
calendarColorStyle = props.calendarColorStyle,
|
|
42
|
-
_props$showCalendarIn = props.showCalendarInDialog,
|
|
43
|
-
showCalendarInDialog = _props$showCalendarIn === void 0 ? false : _props$showCalendarIn,
|
|
44
|
-
_props$dialogSize = props.dialogSize,
|
|
45
|
-
dialogSize = _props$dialogSize === void 0 ? {
|
|
19
|
+
var _errorMessage = require("../errorMessage");
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
27
|
+
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); }
|
|
28
|
+
const PeriodPicker = props => {
|
|
29
|
+
const {
|
|
30
|
+
showButtonOpen = true,
|
|
31
|
+
openOnFocus = true,
|
|
32
|
+
shouldCloseOnSelect = true,
|
|
33
|
+
calendarColorStyle,
|
|
34
|
+
showCalendarInDialog = false,
|
|
35
|
+
dialogSize = {
|
|
46
36
|
width: '350px',
|
|
47
37
|
height: '350px'
|
|
48
|
-
}
|
|
49
|
-
hint
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
showCalendarValueFinal = _useState10[0],
|
|
69
|
-
setShowCalendarValueFinal = _useState10[1];
|
|
70
|
-
var _useState11 = (0, _react.useState)(false),
|
|
71
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
72
|
-
showPeriodSelection = _useState12[0],
|
|
73
|
-
setShowPeriodSelection = _useState12[1];
|
|
74
|
-
var _useState13 = (0, _react.useState)(),
|
|
75
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
76
|
-
inputDimensions = _useState14[0],
|
|
77
|
-
setInputDimensions = _useState14[1];
|
|
78
|
-
var _useState15 = (0, _react.useState)(),
|
|
79
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
80
|
-
onDenied = _useState16[0],
|
|
81
|
-
setOnDenied = _useState16[1];
|
|
82
|
-
var wrapperBaseInputPeriodRef = (0, _react.useRef)(null);
|
|
83
|
-
var inputContainerRef = (0, _react.useRef)(null);
|
|
84
|
-
var inputInitialRef = (0, _react.useRef)(null);
|
|
85
|
-
var buttonOpenRef = (0, _react.useRef)(null);
|
|
86
|
-
var buttonSelectPeriodRef = (0, _react.useRef)(null);
|
|
87
|
-
var dropdownCalendarContainer = (0, _react.useRef)(null);
|
|
88
|
-
var dropdownPeriodContainer = (0, _react.useRef)(null);
|
|
89
|
-
var inputFinalRef = (0, _react.useRef)(null);
|
|
90
|
-
var onScreenResize = function onScreenResize() {
|
|
38
|
+
},
|
|
39
|
+
hint
|
|
40
|
+
} = props;
|
|
41
|
+
const [valueInitial, setValueInitial] = (0, _react.useState)(props.value && (0, _moment.default)(props.value.initial, 'DD/MM/YYYY'));
|
|
42
|
+
const [valueFinal, setValueFinal] = (0, _react.useState)(props.value && (0, _moment.default)(props.value.final, 'DD/MM/YYYY'));
|
|
43
|
+
const [valuePeriodSelection, setValuePeriodSelection] = (0, _react.useState)('week');
|
|
44
|
+
const [showCalendarValueInitial, setShowCalendarValueInitial] = (0, _react.useState)(false);
|
|
45
|
+
const [showCalendarValueFinal, setShowCalendarValueFinal] = (0, _react.useState)(false);
|
|
46
|
+
const [showPeriodSelection, setShowPeriodSelection] = (0, _react.useState)(false);
|
|
47
|
+
const [inputDimensions, setInputDimensions] = (0, _react.useState)();
|
|
48
|
+
const [onDenied, setOnDenied] = (0, _react.useState)();
|
|
49
|
+
const wrapperBaseInputPeriodRef = (0, _react.useRef)(null);
|
|
50
|
+
const inputContainerRef = (0, _react.useRef)(null);
|
|
51
|
+
const inputInitialRef = (0, _react.useRef)(null);
|
|
52
|
+
const buttonOpenRef = (0, _react.useRef)(null);
|
|
53
|
+
const buttonSelectPeriodRef = (0, _react.useRef)(null);
|
|
54
|
+
const dropdownCalendarContainer = (0, _react.useRef)(null);
|
|
55
|
+
const dropdownPeriodContainer = (0, _react.useRef)(null);
|
|
56
|
+
const inputFinalRef = (0, _react.useRef)(null);
|
|
57
|
+
const onScreenResize = () => {
|
|
91
58
|
var _inputContainerRef$cu;
|
|
92
|
-
|
|
59
|
+
const inputDimensionsAux = inputContainerRef === null || inputContainerRef === void 0 ? void 0 : (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 ? void 0 : _inputContainerRef$cu.getBoundingClientRect();
|
|
93
60
|
setInputDimensions(inputDimensionsAux);
|
|
94
61
|
};
|
|
95
|
-
|
|
96
|
-
|
|
62
|
+
const onClickOutside = event => {
|
|
63
|
+
const {
|
|
64
|
+
target
|
|
65
|
+
} = event;
|
|
97
66
|
if (target === inputContainerRef.current || target === inputInitialRef.current || target === inputFinalRef.current || target === buttonOpenRef.current || target === buttonSelectPeriodRef.current) {
|
|
98
67
|
return;
|
|
99
68
|
}
|
|
@@ -105,7 +74,7 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
105
74
|
setShowCalendarValueFinal(false);
|
|
106
75
|
setShowPeriodSelection(false);
|
|
107
76
|
};
|
|
108
|
-
|
|
77
|
+
const onCloseCalendarWithoutFocus = event => {
|
|
109
78
|
if (event.key === 'Tab') {
|
|
110
79
|
if (wrapperBaseInputPeriodRef.current && wrapperBaseInputPeriodRef.current.contains(document.activeElement) && document.activeElement instanceof HTMLInputElement) {
|
|
111
80
|
setShowCalendarValueInitial(false);
|
|
@@ -113,37 +82,25 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
113
82
|
}
|
|
114
83
|
}
|
|
115
84
|
};
|
|
116
|
-
(0, _react.useEffect)(
|
|
85
|
+
(0, _react.useEffect)(() => {
|
|
117
86
|
window.addEventListener('resize', onScreenResize);
|
|
118
87
|
document.addEventListener('click', onClickOutside);
|
|
119
88
|
document.addEventListener('keydown', onCloseCalendarWithoutFocus);
|
|
120
89
|
if (inputContainerRef.current) onScreenResize();
|
|
121
|
-
return
|
|
90
|
+
return () => {
|
|
122
91
|
window.removeEventListener('resize', onScreenResize);
|
|
123
92
|
document.removeEventListener('click', onClickOutside);
|
|
124
93
|
document.removeEventListener('keydown', onCloseCalendarWithoutFocus);
|
|
125
94
|
};
|
|
126
95
|
}, []);
|
|
127
|
-
(0, _react.useEffect)(
|
|
128
|
-
if (valueFinal && valueInitial && (0, _moment.default)(valueFinal).isBefore((0, _moment.default)(valueInitial))) {
|
|
129
|
-
setValueInitial(valueFinal);
|
|
130
|
-
setValueFinal(valueInitial);
|
|
131
|
-
} else if (props.onChange) {
|
|
132
|
-
var initial = valueInitial ? valueInitial.format('YYYY-MM-DD') : '';
|
|
133
|
-
var final = valueFinal ? valueFinal.format('YYYY-MM-DD') : '';
|
|
134
|
-
props.onChange(undefined, '', {
|
|
135
|
-
initial: initial,
|
|
136
|
-
final: final
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}, [valueInitial, valueFinal]);
|
|
140
|
-
(0, _react.useEffect)(function () {
|
|
96
|
+
(0, _react.useEffect)(() => {
|
|
141
97
|
if (props.value && !((0, _moment.default)(props.value.initial).isSame(valueInitial) || (0, _moment.default)(props.value.final).isSame(valueFinal))) {
|
|
142
|
-
|
|
143
|
-
valueInitialProp
|
|
144
|
-
valueFinalProp
|
|
145
|
-
|
|
146
|
-
|
|
98
|
+
const {
|
|
99
|
+
initial: valueInitialProp,
|
|
100
|
+
final: valueFinalProp
|
|
101
|
+
} = props.value;
|
|
102
|
+
let newValueInitial;
|
|
103
|
+
let newValueFinal;
|
|
147
104
|
if ((0, _moment.default)(valueInitialProp, 'YYYY-MM-DD', true).isValid()) {
|
|
148
105
|
newValueInitial = (0, _moment.default)(valueInitialProp, 'YYYY-MM-DD');
|
|
149
106
|
}
|
|
@@ -154,7 +111,7 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
154
111
|
setValueFinal(newValueFinal);
|
|
155
112
|
}
|
|
156
113
|
}, [props.value]);
|
|
157
|
-
|
|
114
|
+
const openCalendar = calendarName => {
|
|
158
115
|
if (calendarName === 'valueInitial') {
|
|
159
116
|
setShowCalendarValueFinal(false);
|
|
160
117
|
setShowCalendarValueInitial(true);
|
|
@@ -167,19 +124,21 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
167
124
|
setInputDimensions(inputContainerRef.current.getBoundingClientRect());
|
|
168
125
|
}
|
|
169
126
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
name
|
|
127
|
+
const onInputFocus = e => {
|
|
128
|
+
const {
|
|
129
|
+
name
|
|
130
|
+
} = e.target;
|
|
173
131
|
if (openOnFocus) openCalendar(name);
|
|
174
132
|
if (props.onFocus) props.onFocus(e);
|
|
175
133
|
};
|
|
176
|
-
|
|
134
|
+
const onInputBlur = e => {
|
|
177
135
|
if (props.onBlur) props.onBlur(e);
|
|
178
136
|
};
|
|
179
|
-
|
|
137
|
+
const onInputChange = (event, value) => {
|
|
180
138
|
if (event) {
|
|
181
|
-
|
|
182
|
-
changingAux
|
|
139
|
+
const {
|
|
140
|
+
name: changingAux
|
|
141
|
+
} = event.target;
|
|
183
142
|
if (value && value.replace(/\D/g, '').trim().length !== 0) {
|
|
184
143
|
if (changingAux === 'valueInitial') {
|
|
185
144
|
setValueInitial(undefined);
|
|
@@ -189,35 +148,67 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
189
148
|
}
|
|
190
149
|
}
|
|
191
150
|
};
|
|
192
|
-
|
|
151
|
+
const onDateChange = date => {
|
|
152
|
+
if (props.onChange) {
|
|
153
|
+
const initial = date.initial ? date.initial.format('YYYY-MM-DD') : '';
|
|
154
|
+
const final = date.final ? date.final.format('YYYY-MM-DD') : '';
|
|
155
|
+
props.onChange(undefined, '', {
|
|
156
|
+
initial,
|
|
157
|
+
final
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const setValue = function (event, value) {
|
|
193
162
|
var _inputInitialRef$curr, _inputFinalRef$curren;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
163
|
+
let shouldOpenDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
164
|
+
const valueDateName = event ? event.target.name : '';
|
|
165
|
+
const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
|
|
197
166
|
if (showCalendarValueInitial) (_inputInitialRef$curr = inputInitialRef.current) === null || _inputInitialRef$curr === void 0 ? void 0 : _inputInitialRef$curr.focus();
|
|
198
167
|
if (showCalendarValueFinal) (_inputFinalRef$curren = inputFinalRef.current) === null || _inputFinalRef$curren === void 0 ? void 0 : _inputFinalRef$curren.focus();
|
|
199
|
-
if (valueDateName === 'valueInitial
|
|
168
|
+
if (valueDateName === 'valueFinal' && valueInitial && dateObj.isBefore(valueInitial)) {
|
|
169
|
+
setValueInitial(dateObj);
|
|
170
|
+
setValueFinal(valueInitial);
|
|
171
|
+
onDateChange({
|
|
172
|
+
initial: dateObj,
|
|
173
|
+
final: valueInitial
|
|
174
|
+
});
|
|
175
|
+
} else if (valueDateName === 'valueInitial' && valueFinal && dateObj.isAfter(valueFinal)) {
|
|
176
|
+
setValueInitial(valueFinal);
|
|
177
|
+
setValueFinal(dateObj);
|
|
178
|
+
onDateChange({
|
|
179
|
+
initial: valueFinal,
|
|
180
|
+
final: dateObj
|
|
181
|
+
});
|
|
182
|
+
} else if (valueDateName === 'valueInitial') {
|
|
200
183
|
setValueInitial(dateObj);
|
|
184
|
+
onDateChange({
|
|
185
|
+
initial: dateObj,
|
|
186
|
+
final: valueFinal
|
|
187
|
+
});
|
|
201
188
|
} else {
|
|
202
189
|
setValueFinal(dateObj);
|
|
190
|
+
onDateChange({
|
|
191
|
+
initial: valueInitial,
|
|
192
|
+
final: dateObj
|
|
193
|
+
});
|
|
203
194
|
}
|
|
204
195
|
if (valueDateName === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
|
|
205
196
|
var _inputFinalRef$curren2;
|
|
206
197
|
(_inputFinalRef$curren2 = inputFinalRef.current) === null || _inputFinalRef$curren2 === void 0 ? void 0 : _inputFinalRef$curren2.focus();
|
|
207
|
-
setTimeout(
|
|
208
|
-
return setShowCalendarValueFinal(true);
|
|
209
|
-
}, 100);
|
|
198
|
+
setTimeout(() => setShowCalendarValueFinal(true), 100);
|
|
210
199
|
}
|
|
211
200
|
if (shouldCloseOnSelect) {
|
|
212
201
|
setShowCalendarValueInitial(false);
|
|
213
202
|
setShowCalendarValueFinal(false);
|
|
214
203
|
}
|
|
215
204
|
};
|
|
216
|
-
|
|
217
|
-
|
|
205
|
+
const shouldDisable = () => {
|
|
206
|
+
const {
|
|
207
|
+
disabled
|
|
208
|
+
} = props;
|
|
218
209
|
return disabled || onDenied && (onDenied.disabled || onDenied.hideContent);
|
|
219
210
|
};
|
|
220
|
-
|
|
211
|
+
const getButtonOpen = () => {
|
|
221
212
|
if (!showButtonOpen) return null;
|
|
222
213
|
return /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
223
214
|
key: "button-open",
|
|
@@ -225,26 +216,24 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
225
216
|
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
226
217
|
name: "calendar"
|
|
227
218
|
}),
|
|
228
|
-
onClick:
|
|
219
|
+
onClick: () => {
|
|
229
220
|
var _inputInitialRef$curr2;
|
|
230
221
|
(_inputInitialRef$curr2 = inputInitialRef.current) === null || _inputInitialRef$curr2 === void 0 ? void 0 : _inputInitialRef$curr2.focus();
|
|
231
222
|
openCalendar('valueInitial');
|
|
232
223
|
},
|
|
233
224
|
customClass: "calendar-button",
|
|
234
225
|
tabIndex: -1,
|
|
235
|
-
targetRef:
|
|
226
|
+
targetRef: ref => {
|
|
236
227
|
buttonOpenRef.current = ref;
|
|
237
228
|
},
|
|
238
229
|
disabled: shouldDisable()
|
|
239
230
|
});
|
|
240
231
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
};
|
|
247
|
-
var openPeriodSelecion = function openPeriodSelecion() {
|
|
232
|
+
const getPeriodSelection = (valuePeriodSelectionAux, setPeriodDates) => /*#__PURE__*/_react.default.createElement(_PeriodList.default, {
|
|
233
|
+
selected: valuePeriodSelectionAux,
|
|
234
|
+
handleOnSelect: setPeriodDates
|
|
235
|
+
});
|
|
236
|
+
const openPeriodSelecion = () => {
|
|
248
237
|
setShowCalendarValueFinal(false);
|
|
249
238
|
setShowCalendarValueInitial(false);
|
|
250
239
|
setShowPeriodSelection(true);
|
|
@@ -252,43 +241,33 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
252
241
|
setInputDimensions(inputContainerRef.current.getBoundingClientRect());
|
|
253
242
|
}
|
|
254
243
|
};
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return setValue({
|
|
283
|
-
target: {
|
|
284
|
-
name: valueDateName
|
|
285
|
-
}
|
|
286
|
-
}, date);
|
|
287
|
-
},
|
|
288
|
-
colorStyle: calendarColorStyleCalendar
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
var setPeriodDates = function setPeriodDates(selected, dates) {
|
|
244
|
+
const getButtonSelectPeriod = () => /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
245
|
+
key: "button-select-period",
|
|
246
|
+
boxShadow: false,
|
|
247
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
248
|
+
name: "more1"
|
|
249
|
+
}),
|
|
250
|
+
onBlur: () => setTimeout(() => setShowPeriodSelection(false), 100),
|
|
251
|
+
onClick: () => openPeriodSelecion(),
|
|
252
|
+
customClass: "calendar-button",
|
|
253
|
+
tabIndex: -1,
|
|
254
|
+
targetRef: ref => {
|
|
255
|
+
buttonSelectPeriodRef.current = ref;
|
|
256
|
+
},
|
|
257
|
+
disabled: shouldDisable()
|
|
258
|
+
});
|
|
259
|
+
const getCalendar = (value, calendarColorStyleCalendar, valueDateName) => /*#__PURE__*/_react.default.createElement(_calendar.default, {
|
|
260
|
+
currentDate: value !== undefined ? (0, _moment.default)(value) : (0, _moment.default)(),
|
|
261
|
+
onDateChange: date => {
|
|
262
|
+
setValue({
|
|
263
|
+
target: {
|
|
264
|
+
name: valueDateName
|
|
265
|
+
}
|
|
266
|
+
}, date);
|
|
267
|
+
},
|
|
268
|
+
colorStyle: calendarColorStyleCalendar
|
|
269
|
+
});
|
|
270
|
+
const setPeriodDates = (selected, dates) => {
|
|
292
271
|
if (selected === 'custom') {
|
|
293
272
|
var _inputInitialRef$curr3;
|
|
294
273
|
(_inputInitialRef$curr3 = inputInitialRef.current) === null || _inputInitialRef$curr3 === void 0 ? void 0 : _inputInitialRef$curr3.focus();
|
|
@@ -305,14 +284,12 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
305
284
|
setShowPeriodSelection(false);
|
|
306
285
|
}
|
|
307
286
|
};
|
|
308
|
-
|
|
287
|
+
const getWrapperComponentCalendarValueInitial = () => {
|
|
309
288
|
if (onDenied && onDenied.readOnly) return null;
|
|
310
289
|
if (showCalendarInDialog) {
|
|
311
290
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
312
291
|
dialogSize: dialogSize,
|
|
313
|
-
|
|
314
|
-
return setShowCalendarValueInitial(false);
|
|
315
|
-
}
|
|
292
|
+
onOpenChange: setShowCalendarValueInitial
|
|
316
293
|
}, getCalendar(valueInitial, calendarColorStyle, 'valueInitial'));
|
|
317
294
|
}
|
|
318
295
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
@@ -320,19 +297,17 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
320
297
|
topPosition: inputDimensions ? inputDimensions.top + inputDimensions.height + 5 : '',
|
|
321
298
|
leftPosition: inputDimensions ? inputDimensions.left : '',
|
|
322
299
|
width: inputDimensions ? inputDimensions.width : '',
|
|
323
|
-
dropdownRef:
|
|
300
|
+
dropdownRef: el => {
|
|
324
301
|
dropdownCalendarContainer.current = el;
|
|
325
302
|
}
|
|
326
303
|
}, getCalendar(valueInitial, calendarColorStyle, 'valueInitial'));
|
|
327
304
|
};
|
|
328
|
-
|
|
305
|
+
const getWrapperComponentCalendarValueFinal = () => {
|
|
329
306
|
if (onDenied && onDenied.readOnly) return null;
|
|
330
307
|
if (showCalendarInDialog) {
|
|
331
308
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
332
309
|
dialogSize: dialogSize,
|
|
333
|
-
|
|
334
|
-
return setShowCalendarValueFinal(false);
|
|
335
|
-
}
|
|
310
|
+
onOpenChange: setShowCalendarValueFinal
|
|
336
311
|
}, getCalendar(valueFinal, calendarColorStyle, 'valueFinal'));
|
|
337
312
|
}
|
|
338
313
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
@@ -340,18 +315,16 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
340
315
|
topPosition: inputDimensions ? inputDimensions.top + inputDimensions.height + 5 : '',
|
|
341
316
|
leftPosition: inputDimensions ? inputDimensions.left : '',
|
|
342
317
|
width: inputDimensions ? inputDimensions.width : '',
|
|
343
|
-
dropdownRef:
|
|
318
|
+
dropdownRef: el => {
|
|
344
319
|
dropdownCalendarContainer.current = el;
|
|
345
320
|
}
|
|
346
321
|
}, getCalendar(valueFinal, calendarColorStyle, 'valueFinal'));
|
|
347
322
|
};
|
|
348
|
-
|
|
323
|
+
const getWrapperComponentPeriodSelection = () => {
|
|
349
324
|
if (showCalendarInDialog) {
|
|
350
325
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
351
326
|
dialogSize: dialogSize,
|
|
352
|
-
|
|
353
|
-
return setShowPeriodSelection(false);
|
|
354
|
-
}
|
|
327
|
+
onOpenChange: setShowPeriodSelection
|
|
355
328
|
}, getPeriodSelection(valuePeriodSelection, setPeriodDates));
|
|
356
329
|
}
|
|
357
330
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
@@ -359,7 +332,7 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
359
332
|
topPosition: inputDimensions ? inputDimensions.top + inputDimensions.height + 5 : '',
|
|
360
333
|
leftPosition: inputDimensions ? inputDimensions.left : '',
|
|
361
334
|
width: inputDimensions ? inputDimensions.width : '',
|
|
362
|
-
dropdownRef:
|
|
335
|
+
dropdownRef: el => {
|
|
363
336
|
dropdownPeriodContainer.current = el;
|
|
364
337
|
}
|
|
365
338
|
}, getPeriodSelection(valuePeriodSelection, setPeriodDates));
|
|
@@ -385,19 +358,16 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
385
358
|
name: "valueInitial",
|
|
386
359
|
value: !valueInitial ? '' : (0, _moment.default)(valueInitial).format('DD/MM/YYYY'),
|
|
387
360
|
mask: "00/00/0000",
|
|
388
|
-
onComplete:
|
|
389
|
-
setValue(e,
|
|
361
|
+
onComplete: e => {
|
|
362
|
+
setValue(e, e.target.value, true);
|
|
390
363
|
},
|
|
391
364
|
onFocus: onInputFocus,
|
|
392
|
-
onBlur:
|
|
393
|
-
return onInputBlur(e);
|
|
394
|
-
},
|
|
395
|
-
isDateField: true,
|
|
365
|
+
onBlur: e => onInputBlur(e),
|
|
396
366
|
onChange: onInputChange,
|
|
397
|
-
inputRef:
|
|
367
|
+
inputRef: el => {
|
|
398
368
|
inputInitialRef.current = el;
|
|
399
369
|
},
|
|
400
|
-
handlerSetOnDenied:
|
|
370
|
+
handlerSetOnDenied: denied => {
|
|
401
371
|
setOnDenied(denied);
|
|
402
372
|
},
|
|
403
373
|
required: props.required
|
|
@@ -409,27 +379,23 @@ var PeriodPicker = function PeriodPicker(props) {
|
|
|
409
379
|
name: "valueFinal",
|
|
410
380
|
value: !valueFinal ? '' : (0, _moment.default)(valueFinal).format('DD/MM/YYYY'),
|
|
411
381
|
mask: "00/00/0000",
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
setValue(e, date, true);
|
|
382
|
+
onComplete: e => {
|
|
383
|
+
setValue(e, e.target.value, true);
|
|
415
384
|
},
|
|
416
385
|
onFocus: onInputFocus,
|
|
417
|
-
onBlur:
|
|
418
|
-
return onInputBlur(e);
|
|
419
|
-
},
|
|
386
|
+
onBlur: e => onInputBlur(e),
|
|
420
387
|
onChange: onInputChange,
|
|
421
|
-
inputRef:
|
|
388
|
+
inputRef: el => {
|
|
422
389
|
inputFinalRef.current = el;
|
|
423
390
|
},
|
|
424
|
-
handlerSetOnDenied:
|
|
425
|
-
return setOnDenied(denied);
|
|
426
|
-
},
|
|
391
|
+
handlerSetOnDenied: denied => setOnDenied(denied),
|
|
427
392
|
required: props.required
|
|
428
393
|
}), getButtonOpen(), getButtonSelectPeriod()), showCalendarValueInitial && getWrapperComponentCalendarValueInitial(), showCalendarValueFinal && getWrapperComponentCalendarValueFinal(), showPeriodSelection && getWrapperComponentPeriodSelection(), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
429
394
|
visible: !!hint,
|
|
430
395
|
customClass: "hint",
|
|
431
396
|
description: hint
|
|
432
|
-
}),
|
|
397
|
+
}), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
398
|
+
messages: props.errorMessages
|
|
399
|
+
}));
|
|
433
400
|
};
|
|
434
|
-
var _default = PeriodPicker;
|
|
435
|
-
exports.default = _default;
|
|
401
|
+
var _default = exports.default = PeriodPicker;
|
|
@@ -5,6 +5,8 @@ import { Period } from '../../@types/Period.js';
|
|
|
5
5
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
6
6
|
import { CustomInputEvent } from '../base/types.js';
|
|
7
7
|
import '../../@types/Align.js';
|
|
8
|
+
import '../../internals/types.js';
|
|
9
|
+
import '../../@types/Position.js';
|
|
8
10
|
|
|
9
11
|
type DateTypes = 'today' | 'week' | 'lastweek' | 'last15' | 'month' | 'lastmonth';
|
|
10
12
|
interface ChangeInputPeriodEvent {
|
|
@@ -19,7 +21,7 @@ interface IPeriodOptions {
|
|
|
19
21
|
}
|
|
20
22
|
interface IDialogProps {
|
|
21
23
|
children: ReactNode | ReactNode[];
|
|
22
|
-
|
|
24
|
+
onOpenChange: (open: boolean) => void;
|
|
23
25
|
dialogSize: {
|
|
24
26
|
width: string;
|
|
25
27
|
height: string;
|
|
@@ -5,8 +5,9 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../internals/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
|
+
import '../../drawer/types.js';
|
|
10
11
|
import '../../@types/Icon.js';
|
|
11
12
|
import '../../icons/helper.js';
|
|
12
13
|
|