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