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
|
@@ -7,53 +7,55 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseMask = _interopRequireDefault(require("../mask/BaseMask"));
|
|
9
9
|
var _format_number = require("./format_number");
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
var returnEventFormattedValue = function returnEventFormattedValue(props, event) {
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
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); }
|
|
17
|
+
const returnEventFormattedValue = (props, event) => {
|
|
19
18
|
if (props.returnFormattedValueOnBlur || props.returnFormattedValueOnKeyDown) {
|
|
20
19
|
// Retornando um objeto com a mesma estrutura do Proxy original
|
|
21
20
|
// para recuperacao do valor formatado no padrão americano.
|
|
22
21
|
// O retorno poderá ser modificado conforme necessidade, desde que seja
|
|
23
22
|
// mantido o path até a propriedade value e name.
|
|
24
|
-
|
|
25
|
-
value
|
|
26
|
-
name
|
|
23
|
+
const {
|
|
24
|
+
value,
|
|
25
|
+
name
|
|
26
|
+
} = event.target;
|
|
27
27
|
return _objectSpread(_objectSpread({}, event), {}, {
|
|
28
28
|
target: {
|
|
29
29
|
value: (0, _format_number.numberToEnUS)(value),
|
|
30
|
-
name
|
|
30
|
+
name
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
return event;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const getEventProps = props => {
|
|
37
|
+
const {
|
|
38
|
+
returnFormattedValueOnBlur,
|
|
39
|
+
returnFormattedValueOnKeyDown
|
|
40
|
+
} = props;
|
|
39
41
|
if (props.isNumeric) return {};
|
|
40
42
|
return {
|
|
41
|
-
onBlur:
|
|
43
|
+
onBlur: e => {
|
|
42
44
|
if (props.onBlur) {
|
|
43
|
-
|
|
45
|
+
const formattedEvent = returnFormattedValueOnBlur ? returnEventFormattedValue(props, e) : e;
|
|
44
46
|
props.onBlur(formattedEvent);
|
|
45
47
|
}
|
|
46
48
|
},
|
|
47
|
-
onKeyDown:
|
|
49
|
+
onKeyDown: e => {
|
|
48
50
|
if (props.onKeyDown) {
|
|
49
|
-
|
|
51
|
+
const formattedEvent = returnFormattedValueOnKeyDown ? returnEventFormattedValue(props, e) : e;
|
|
50
52
|
props.onKeyDown(formattedEvent);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
const BaseNumber = props => {
|
|
58
|
+
const eventProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
57
59
|
returnFormattedValueOnBlur: true,
|
|
58
60
|
returnFormattedValueOnKeyDown: true
|
|
59
61
|
});
|
|
@@ -65,5 +67,4 @@ var BaseNumber = function BaseNumber(props) {
|
|
|
65
67
|
isNumeric: true
|
|
66
68
|
}, props, getEventProps(eventProps)));
|
|
67
69
|
};
|
|
68
|
-
var _default = BaseNumber;
|
|
69
|
-
exports.default = _default;
|
|
70
|
+
var _default = exports.default = BaseNumber;
|
|
@@ -4,10 +4,11 @@ import 'react';
|
|
|
4
4
|
import '../../@types/Align.js';
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../../internals/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
7
9
|
import '../types.js';
|
|
8
10
|
import '../../@types/DataCombo.js';
|
|
9
11
|
import '../../drawer/types.js';
|
|
10
|
-
import '../../@types/Position.js';
|
|
11
12
|
import '../../@types/Icon.js';
|
|
12
13
|
import '../../icons/helper.js';
|
|
13
14
|
|
|
@@ -6,17 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseNumber = _interopRequireDefault(require("./BaseNumber"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
currencySymbol =
|
|
14
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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); }
|
|
11
|
+
const CurrencyField = props => {
|
|
12
|
+
const {
|
|
13
|
+
currencySymbol = 'R$'
|
|
14
|
+
} = props;
|
|
15
|
+
const leftElements = props.displayCurrencySymbol ? /*#__PURE__*/_react.default.createElement("span", {
|
|
15
16
|
className: "currency-symbol"
|
|
16
17
|
}, currencySymbol) : [];
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement(_BaseNumber.default, _extends({}, props, {
|
|
18
19
|
leftElements: leftElements
|
|
19
20
|
}));
|
|
20
21
|
};
|
|
21
|
-
var _default = CurrencyField;
|
|
22
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = CurrencyField;
|
|
@@ -4,10 +4,11 @@ import 'react';
|
|
|
4
4
|
import '../../@types/Align.js';
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../../internals/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
7
9
|
import '../types.js';
|
|
8
10
|
import '../../@types/DataCombo.js';
|
|
9
11
|
import '../../drawer/types.js';
|
|
10
|
-
import '../../@types/Position.js';
|
|
11
12
|
import '../../@types/Icon.js';
|
|
12
13
|
import '../../icons/helper.js';
|
|
13
14
|
|
|
@@ -6,9 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseNumber = _interopRequireDefault(require("./BaseNumber"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
var _default = DecimalField;
|
|
14
|
-
exports.default = _default;
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const DecimalField = props => /*#__PURE__*/_react.default.createElement(_BaseNumber.default, props);
|
|
11
|
+
var _default = exports.default = DecimalField;
|
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.numberToPtBR = exports.numberToEnUS = exports.formatOnlyNumbers = void 0;
|
|
7
|
-
|
|
7
|
+
const numberToPtBR = value => {
|
|
8
8
|
if (value !== undefined && typeof value === 'number') {
|
|
9
9
|
return value.toLocaleString('pt-BR');
|
|
10
10
|
}
|
|
11
11
|
return value;
|
|
12
12
|
};
|
|
13
13
|
exports.numberToPtBR = numberToPtBR;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const numberToEnUS = value => {
|
|
15
|
+
let formattedNumber;
|
|
16
16
|
if (value) {
|
|
17
17
|
formattedNumber = value.replaceAll('.', '').replaceAll(',', '.');
|
|
18
18
|
return Number(formattedNumber);
|
|
@@ -20,8 +20,8 @@ var numberToEnUS = function numberToEnUS(value) {
|
|
|
20
20
|
return value;
|
|
21
21
|
};
|
|
22
22
|
exports.numberToEnUS = numberToEnUS;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const formatOnlyNumbers = value => {
|
|
24
|
+
const teste = value.replace(/[._\-/()\s+]/g, '');
|
|
25
25
|
return teste;
|
|
26
26
|
};
|
|
27
27
|
exports.formatOnlyNumbers = formatOnlyNumbers;
|
|
@@ -6,10 +6,11 @@ import 'react';
|
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
8
|
import '../../@types/PermissionAttr.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
import '../types.js';
|
|
10
12
|
import '../../@types/DataCombo.js';
|
|
11
13
|
import '../../drawer/types.js';
|
|
12
|
-
import '../../@types/Position.js';
|
|
13
14
|
import '../../@types/Icon.js';
|
|
14
15
|
import '../../icons/helper.js';
|
|
15
16
|
|
|
@@ -1,18 +1,17 @@
|
|
|
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
|
});
|
|
7
6
|
Object.defineProperty(exports, "CurrencyField", {
|
|
8
7
|
enumerable: true,
|
|
9
|
-
get: function
|
|
8
|
+
get: function () {
|
|
10
9
|
return _Currency.default;
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
Object.defineProperty(exports, "DecimalField", {
|
|
14
13
|
enumerable: true,
|
|
15
|
-
get: function
|
|
14
|
+
get: function () {
|
|
16
15
|
return _Decimal.default;
|
|
17
16
|
}
|
|
18
17
|
});
|
|
@@ -22,32 +21,22 @@ var _Currency = _interopRequireDefault(require("./Currency"));
|
|
|
22
21
|
var _Decimal = _interopRequireDefault(require("./Decimal"));
|
|
23
22
|
require("../../assets/styles/numbers.scss");
|
|
24
23
|
var _InputTextBase = _interopRequireDefault(require("../base/InputTextBase"));
|
|
25
|
-
function _interopRequireDefault(
|
|
26
|
-
function _getRequireWildcardCache(
|
|
27
|
-
function _interopRequireWildcard(
|
|
28
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value = _props$value === void 0 ? '' : _props$value,
|
|
42
|
-
_props$removeZeroLeft = props.removeZeroLeft,
|
|
43
|
-
removeZeroLeft = _props$removeZeroLeft === void 0 ? true : _props$removeZeroLeft;
|
|
44
|
-
var _useState = (0, _react.useState)(),
|
|
45
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
-
numberValue = _useState2[0],
|
|
47
|
-
setNumberValue = _useState2[1];
|
|
48
|
-
var onChange = function onChange(event) {
|
|
49
|
-
var inputValue = event.target.value;
|
|
50
|
-
var numericValue = inputValue.replace(/\D/g, '');
|
|
24
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
27
|
+
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); }
|
|
28
|
+
const NumberField = props => {
|
|
29
|
+
const {
|
|
30
|
+
textAlign = 'left',
|
|
31
|
+
min,
|
|
32
|
+
max,
|
|
33
|
+
value = '',
|
|
34
|
+
removeZeroLeft = true
|
|
35
|
+
} = props;
|
|
36
|
+
const [numberValue, setNumberValue] = (0, _react.useState)();
|
|
37
|
+
const onChange = event => {
|
|
38
|
+
const inputValue = event.target.value;
|
|
39
|
+
const numericValue = inputValue.replace(/\D/g, '');
|
|
51
40
|
if (min && parseInt(numericValue, 10) < min || max && parseInt(numericValue, 10) > max) {
|
|
52
41
|
return;
|
|
53
42
|
}
|
|
@@ -58,7 +47,7 @@ var NumberField = function NumberField(props) {
|
|
|
58
47
|
}
|
|
59
48
|
if (props.onChange) props.onChange(event);
|
|
60
49
|
};
|
|
61
|
-
(0, _react.useEffect)(
|
|
50
|
+
(0, _react.useEffect)(() => {
|
|
62
51
|
if (value && !numberValue) setNumberValue(value.toString());
|
|
63
52
|
}, [value]);
|
|
64
53
|
return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
|
|
@@ -68,5 +57,4 @@ var NumberField = function NumberField(props) {
|
|
|
68
57
|
type: "number"
|
|
69
58
|
}));
|
|
70
59
|
};
|
|
71
|
-
var _default = NumberField;
|
|
72
|
-
exports.default = _default;
|
|
60
|
+
var _default = exports.default = NumberField;
|
|
@@ -4,9 +4,10 @@ import 'react';
|
|
|
4
4
|
import '../../@types/Align.js';
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../../internals/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
7
9
|
import '../../@types/DataCombo.js';
|
|
8
10
|
import '../../drawer/types.js';
|
|
9
|
-
import '../../@types/Position.js';
|
|
10
11
|
import '../../@types/Icon.js';
|
|
11
12
|
import '../../icons/helper.js';
|
|
12
13
|
|
|
@@ -17,18 +18,10 @@ interface INumberFieldProps extends IMaskHOCProps {
|
|
|
17
18
|
interface IBaseNumberProps extends IMaskHOCProps {
|
|
18
19
|
returnFormattedValueOnBlur?: boolean;
|
|
19
20
|
returnFormattedValueOnKeyDown?: boolean;
|
|
20
|
-
onChange?: (e?: CustomInputEvent, maskValue?: string, date?: string | {
|
|
21
|
-
initial: string;
|
|
22
|
-
final: string;
|
|
23
|
-
}) => void;
|
|
24
21
|
}
|
|
25
22
|
interface ICurrencyProps extends IMaskHOCProps {
|
|
26
23
|
currencySymbol?: string;
|
|
27
24
|
displayCurrencySymbol?: boolean;
|
|
28
|
-
onChange?: (e?: CustomInputEvent, maskValue?: string, date?: string | {
|
|
29
|
-
initial: string;
|
|
30
|
-
final: string;
|
|
31
|
-
}) => void;
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
export { IBaseNumberProps, ICurrencyProps, INumberFieldProps };
|
|
@@ -6,7 +6,9 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
|
|
10
|
-
declare const Dialog: ({
|
|
12
|
+
declare const Dialog: ({ onOpenChange, children, dialogSize }: IDialogProps) => JSX.Element;
|
|
11
13
|
|
|
12
14
|
export { Dialog as default };
|
|
@@ -6,21 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _base = _interopRequireDefault(require("../../dialog/base"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const Dialog = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
onOpenChange,
|
|
13
|
+
children,
|
|
14
|
+
dialogSize
|
|
15
|
+
} = _ref;
|
|
14
16
|
return /*#__PURE__*/_react.default.createElement(_base.default, {
|
|
15
17
|
width: dialogSize.width,
|
|
16
18
|
height: dialogSize.height,
|
|
17
|
-
|
|
18
|
-
_handlerClose();
|
|
19
|
-
},
|
|
19
|
+
onOpenChange: onOpenChange,
|
|
20
20
|
closeOnOutsideClick: true,
|
|
21
21
|
closeOnEsc: true,
|
|
22
22
|
wrapperClassName: ""
|
|
23
23
|
}, children);
|
|
24
24
|
};
|
|
25
|
-
var _default = Dialog;
|
|
26
|
-
exports.default = _default;
|
|
25
|
+
var _default = exports.default = Dialog;
|
|
@@ -6,6 +6,8 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
|
|
10
12
|
declare const Dropdown: (props: IPeriodDropdownProps) => React.ReactPortal;
|
|
11
13
|
|
|
@@ -7,23 +7,22 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
9
|
var _helper = _interopRequireDefault(require("./helper"));
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(0, _react.useEffect)(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const body = document.getElementsByTagName('body')[0];
|
|
12
|
+
const Dropdown = props => {
|
|
13
|
+
const elementRef = (0, _react.useRef)(document.createElement('div'));
|
|
14
|
+
(0, _react.useEffect)(() => {
|
|
15
15
|
elementRef.current.className = 'datepicker-component';
|
|
16
16
|
elementRef.current.setAttribute('style', (0, _helper.default)(props));
|
|
17
17
|
body.appendChild(elementRef.current);
|
|
18
18
|
props.dropdownRef(elementRef.current);
|
|
19
|
-
return
|
|
19
|
+
return () => {
|
|
20
20
|
body.removeChild(elementRef.current);
|
|
21
21
|
};
|
|
22
22
|
}, []);
|
|
23
|
-
(0, _react.useEffect)(
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
24
|
elementRef.current.setAttribute('style', (0, _helper.default)(props));
|
|
25
25
|
}, [props]);
|
|
26
26
|
return /*#__PURE__*/_reactDom.default.createPortal(props.children, elementRef.current);
|
|
27
27
|
};
|
|
28
|
-
var _default = Dropdown;
|
|
29
|
-
exports.default = _default;
|
|
28
|
+
var _default = exports.default = Dropdown;
|
|
@@ -6,6 +6,8 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
|
|
10
12
|
declare const PeriodList: ({ selected, handleOnSelect }: IPeriodListProps) => JSX.Element;
|
|
11
13
|
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _helper = require("./helper");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const periodOptions = [{
|
|
11
11
|
id: 'today',
|
|
12
12
|
label: 'Hoje'
|
|
13
13
|
}, {
|
|
@@ -29,32 +29,33 @@ var periodOptions = [{
|
|
|
29
29
|
id: 'custom',
|
|
30
30
|
label: 'Customizar'
|
|
31
31
|
}];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const PeriodList = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
selected,
|
|
35
|
+
handleOnSelect
|
|
36
|
+
} = _ref;
|
|
35
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
38
|
className: "dropdown-period"
|
|
37
|
-
}, periodOptions.map(
|
|
38
|
-
|
|
39
|
+
}, periodOptions.map(item => {
|
|
40
|
+
const itemSelected = selected === item.id;
|
|
39
41
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
42
|
role: "button",
|
|
41
43
|
tabIndex: -1,
|
|
42
|
-
onKeyDown:
|
|
44
|
+
onKeyDown: () => {},
|
|
43
45
|
key: "item-".concat(item.id),
|
|
44
46
|
className: (0, _helper.getDropdownItemCssClass)(itemSelected),
|
|
45
|
-
onClick:
|
|
46
|
-
|
|
47
|
+
onClick: () => {
|
|
48
|
+
const dates = item.id !== 'custom' ? (0, _helper.CalcDatesByPeriod)(item.id) : null;
|
|
47
49
|
handleOnSelect(item.id, dates);
|
|
48
50
|
}
|
|
49
51
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
50
52
|
role: "button",
|
|
51
53
|
className: "menubutton",
|
|
52
54
|
tabIndex: -1,
|
|
53
|
-
onKeyPress:
|
|
55
|
+
onKeyPress: () => {}
|
|
54
56
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
55
57
|
className: "label"
|
|
56
58
|
}, item.label)));
|
|
57
59
|
}));
|
|
58
60
|
};
|
|
59
|
-
var _default = PeriodList;
|
|
60
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = PeriodList;
|
|
@@ -6,6 +6,8 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
|
|
10
12
|
declare const getCalendarDropdownStyle: ({ topPosition, leftPosition, width }: {
|
|
11
13
|
topPosition: number | string;
|
|
@@ -5,63 +5,60 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isDateValid = exports.getDropdownItemCssClass = exports.default = exports.CalcDatesByPeriod = void 0;
|
|
7
7
|
var _moment = _interopRequireDefault(require("moment"));
|
|
8
|
-
function _interopRequireDefault(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const getCalendarDropdownStyle = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
topPosition,
|
|
12
|
+
leftPosition,
|
|
13
|
+
width
|
|
14
|
+
} = _ref;
|
|
13
15
|
return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width:").concat(width, "px");
|
|
14
16
|
};
|
|
15
|
-
var _default = getCalendarDropdownStyle;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var className = 'item';
|
|
17
|
+
var _default = exports.default = getCalendarDropdownStyle;
|
|
18
|
+
const getDropdownItemCssClass = function () {
|
|
19
|
+
let selected = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
20
|
+
let disabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
21
|
+
let striped = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
22
|
+
let className = 'item';
|
|
22
23
|
className += selected && !disabled ? ' -selected ' : '';
|
|
23
24
|
className += disabled ? ' -disabled' : '';
|
|
24
25
|
className += !selected && !disabled && striped ? ' -striped ' : '';
|
|
25
26
|
return className;
|
|
26
27
|
};
|
|
27
28
|
exports.getDropdownItemCssClass = getDropdownItemCssClass;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
today:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var weekStart = currentDate.clone().startOf('week');
|
|
36
|
-
var weekEnd = currentDate.clone().endOf('week');
|
|
29
|
+
const CalcDatesByPeriod = dateType => {
|
|
30
|
+
const currentDate = (0, _moment.default)();
|
|
31
|
+
const dateTypes = {
|
|
32
|
+
today: () => [currentDate, currentDate],
|
|
33
|
+
week: () => {
|
|
34
|
+
const weekStart = currentDate.clone().startOf('week');
|
|
35
|
+
const weekEnd = currentDate.clone().endOf('week');
|
|
37
36
|
return [weekStart, weekEnd];
|
|
38
37
|
},
|
|
39
|
-
lastweek:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
lastweek: () => {
|
|
39
|
+
const lastWeek = currentDate.subtract(1, 'weeks');
|
|
40
|
+
const weekStart = lastWeek.clone().startOf('week');
|
|
41
|
+
const weekEnd = lastWeek.clone().endOf('week');
|
|
43
42
|
return [weekStart, weekEnd];
|
|
44
43
|
},
|
|
45
|
-
last15:
|
|
46
|
-
|
|
44
|
+
last15: () => {
|
|
45
|
+
const last15Day = (0, _moment.default)(currentDate);
|
|
47
46
|
return [last15Day.subtract(15, 'days'), currentDate];
|
|
48
47
|
},
|
|
49
|
-
month:
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
month: () => {
|
|
49
|
+
const monthStart = currentDate.clone().startOf('month');
|
|
50
|
+
const monthEnd = currentDate.clone().endOf('month');
|
|
52
51
|
return [monthStart, monthEnd];
|
|
53
52
|
},
|
|
54
|
-
lastmonth:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
lastmonth: () => {
|
|
54
|
+
const lastMonth = currentDate.subtract(1, 'months');
|
|
55
|
+
const monthStart = lastMonth.clone().startOf('month');
|
|
56
|
+
const monthEnd = lastMonth.clone().endOf('month');
|
|
58
57
|
return [monthStart, monthEnd];
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
return dateTypes[dateType]();
|
|
62
61
|
};
|
|
63
62
|
exports.CalcDatesByPeriod = CalcDatesByPeriod;
|
|
64
|
-
|
|
65
|
-
return date && (0, _moment.default)(date).isValid();
|
|
66
|
-
};
|
|
63
|
+
const isDateValid = date => date && (0, _moment.default)(date).isValid();
|
|
67
64
|
exports.isDateValid = isDateValid;
|
|
@@ -6,6 +6,8 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
|
|
10
12
|
declare const PeriodPicker: (props: IPeriodPickerProps) => JSX.Element | null;
|
|
11
13
|
|