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
package/lib/drawer/Content.js
CHANGED
|
@@ -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
|
});
|
|
@@ -8,19 +9,17 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
9
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
9
10
|
var _noPermission = _interopRequireDefault(require("../noPermission"));
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
hideContent
|
|
20
|
-
} = (0, _react.useContext)(_helpers.default);
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
var Content = function Content(_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
style = _ref.style;
|
|
17
|
+
var _useContext = (0, _react.useContext)(_helpers.default),
|
|
18
|
+
hideContent = _useContext.hideContent;
|
|
21
19
|
return hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : /*#__PURE__*/_react.default.createElement("div", {
|
|
22
20
|
className: "drawerbody",
|
|
23
21
|
style: style
|
|
24
22
|
}, children);
|
|
25
23
|
};
|
|
26
|
-
var _default =
|
|
24
|
+
var _default = Content;
|
|
25
|
+
exports.default = _default;
|
package/lib/drawer/Drawer.js
CHANGED
|
@@ -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
|
});
|
|
@@ -10,53 +11,62 @@ var _helpers = _interopRequireDefault(require("./helpers"));
|
|
|
10
11
|
var _permissionValidations = require("../permissionValidations");
|
|
11
12
|
var _ = require(".");
|
|
12
13
|
var _spinner = _interopRequireDefault(require("../spinner"));
|
|
13
|
-
|
|
14
|
+
var _excluded = ["position", "customClass", "children", "style", "customClassForContent", "targetId", "closeOnEsc", "overlay", "permissionAttr", "skeletonize", "handlerClose", "customClassForDrawer", "content", "title", "isWaiting"];
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
17
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
|
-
function
|
|
19
|
-
function
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
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."); }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
20
27
|
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; }
|
|
21
|
-
function _toPropertyKey(
|
|
22
|
-
function _toPrimitive(
|
|
28
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
|
+
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); }
|
|
23
30
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
var BaseDrawer = function BaseDrawer(_ref) {
|
|
33
|
+
var _ref$position = _ref.position,
|
|
34
|
+
position = _ref$position === void 0 ? 'left' : _ref$position,
|
|
35
|
+
_ref$customClass = _ref.customClass,
|
|
36
|
+
customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
|
|
37
|
+
children = _ref.children,
|
|
38
|
+
style = _ref.style,
|
|
39
|
+
_ref$customClassForCo = _ref.customClassForContent,
|
|
40
|
+
customClassForContent = _ref$customClassForCo === void 0 ? '' : _ref$customClassForCo,
|
|
41
|
+
targetId = _ref.targetId,
|
|
42
|
+
closeOnEsc = _ref.closeOnEsc,
|
|
43
|
+
overlay = _ref.overlay,
|
|
44
|
+
permissionAttr = _ref.permissionAttr,
|
|
45
|
+
skeletonize = _ref.skeletonize,
|
|
46
|
+
handlerClose = _ref.handlerClose,
|
|
47
|
+
_ref$customClassForDr = _ref.customClassForDrawer,
|
|
48
|
+
customClassForDrawer = _ref$customClassForDr === void 0 ? '' : _ref$customClassForDr,
|
|
49
|
+
content = _ref.content,
|
|
50
|
+
title = _ref.title,
|
|
51
|
+
_ref$isWaiting = _ref.isWaiting,
|
|
52
|
+
isWaiting = _ref$isWaiting === void 0 ? false : _ref$isWaiting,
|
|
43
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
-
|
|
45
|
-
title
|
|
54
|
+
var headerProps = _objectSpread(_objectSpread({}, rest), {}, {
|
|
55
|
+
title: title
|
|
46
56
|
});
|
|
47
|
-
|
|
57
|
+
var drawerContainerEl = (0, _react.useRef)(document.createElement('div'));
|
|
48
58
|
drawerContainerEl.current.className = 'drawercontainer';
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
var drawerComponentEl = (0, _react.useRef)();
|
|
60
|
+
var hideContent = _permissionValidations.OPTIONS_ON_DENIED.hideContent;
|
|
61
|
+
var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)([hideContent], permissionAttr)),
|
|
62
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
63
|
+
onDenied = _useState2[0];
|
|
64
|
+
var overlayStyle = isWaiting ? {
|
|
55
65
|
opacity: 0.4,
|
|
56
66
|
pointerEvent: 'none',
|
|
57
67
|
placeContent: 'center'
|
|
58
68
|
} : {};
|
|
59
|
-
|
|
69
|
+
var getSpinner = function getSpinner() {
|
|
60
70
|
if (!isWaiting) return null;
|
|
61
71
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
72
|
className: "waitingspinner"
|
|
@@ -67,29 +77,28 @@ const BaseDrawer = _ref => {
|
|
|
67
77
|
delayTime: 0
|
|
68
78
|
}));
|
|
69
79
|
};
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
var setDrawerComponent = function setDrawerComponent(body, randonId) {
|
|
81
|
+
var componentEl = document.createElement('div');
|
|
72
82
|
componentEl.className = 'drawer-component';
|
|
73
83
|
componentEl.id = String(randonId);
|
|
74
84
|
body.appendChild(componentEl);
|
|
75
85
|
componentEl.appendChild(drawerContainerEl.current);
|
|
76
86
|
drawerComponentEl.current = componentEl;
|
|
77
87
|
};
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
var setDrawerOverlay = function setDrawerOverlay(body) {
|
|
89
|
+
var drawerOverlay = document.createElement('div');
|
|
80
90
|
drawerOverlay.className = 'drawer-overlay';
|
|
81
91
|
drawerOverlay.dataset.testid = 'drawer-overlay';
|
|
82
92
|
body.appendChild(drawerOverlay);
|
|
83
93
|
};
|
|
84
|
-
|
|
85
|
-
if (closeOnEsc && e.key === '
|
|
94
|
+
var closeDrawerOnEsc = function closeDrawerOnEsc(e) {
|
|
95
|
+
if (closeOnEsc && (e.keyCode === 27 || e.key === 'ESC')) {
|
|
86
96
|
handlerClose === null || handlerClose === void 0 ? void 0 : handlerClose();
|
|
87
|
-
e.stopPropagation();
|
|
88
97
|
}
|
|
89
98
|
};
|
|
90
|
-
(0, _react.useEffect)(()
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
(0, _react.useEffect)(function () {
|
|
100
|
+
var body;
|
|
101
|
+
var randonId = Math.round(+new Date() / 1000);
|
|
93
102
|
if (targetId === undefined) {
|
|
94
103
|
body = document.getElementsByTagName('body')[0];
|
|
95
104
|
} else {
|
|
@@ -97,11 +106,11 @@ const BaseDrawer = _ref => {
|
|
|
97
106
|
}
|
|
98
107
|
if (body) setDrawerComponent(body, randonId);
|
|
99
108
|
if (overlay && !targetId && body) setDrawerOverlay(body);
|
|
100
|
-
return ()
|
|
101
|
-
|
|
102
|
-
if (closeOnEsc) document.body.removeEventListener('
|
|
109
|
+
return function () {
|
|
110
|
+
var drawerOverlay = document.getElementsByClassName('drawer-overlay')[0];
|
|
111
|
+
if (closeOnEsc) document.body.removeEventListener('keyup', closeDrawerOnEsc);
|
|
103
112
|
if (targetId) {
|
|
104
|
-
|
|
113
|
+
var drawerComponentTarget = document.getElementById(targetId);
|
|
105
114
|
if (drawerComponentTarget && drawerComponentEl.current) {
|
|
106
115
|
drawerComponentTarget.removeChild(drawerComponentEl.current);
|
|
107
116
|
}
|
|
@@ -109,30 +118,35 @@ const BaseDrawer = _ref => {
|
|
|
109
118
|
if (drawerOverlay && !targetId && body) body.removeChild(drawerOverlay);
|
|
110
119
|
};
|
|
111
120
|
}, []);
|
|
112
|
-
(0, _react.useEffect)(()
|
|
121
|
+
(0, _react.useEffect)(function () {
|
|
113
122
|
if (closeOnEsc) {
|
|
114
|
-
document.body.addEventListener('
|
|
123
|
+
document.body.addEventListener('keyup', closeDrawerOnEsc);
|
|
115
124
|
}
|
|
116
|
-
return ()
|
|
125
|
+
return function () {
|
|
126
|
+
return document.body.removeEventListener('keyup', closeDrawerOnEsc);
|
|
127
|
+
};
|
|
117
128
|
}, [closeOnEsc]);
|
|
118
|
-
|
|
119
|
-
handlerClose,
|
|
129
|
+
var contextValues = {
|
|
130
|
+
handlerClose: handlerClose,
|
|
120
131
|
hideContent: onDenied.hideContent,
|
|
121
|
-
skeletonize
|
|
132
|
+
skeletonize: skeletonize
|
|
133
|
+
};
|
|
134
|
+
var drawerContent = function drawerContent() {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_helpers.default.Provider, {
|
|
136
|
+
value: contextValues
|
|
137
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
+
"data-testid": "drawercontainer-component",
|
|
139
|
+
className: "".concat(position, " ").concat(customClass),
|
|
140
|
+
style: style
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
+
style: overlayStyle,
|
|
143
|
+
"data-testid": "drawercontent",
|
|
144
|
+
className: "drawercontent ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClassForContent)
|
|
145
|
+
}, title && /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({}, headerProps, {
|
|
146
|
+
customClass: customClassForDrawer
|
|
147
|
+
})), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children, getSpinner())));
|
|
122
148
|
};
|
|
123
|
-
const drawerContent = () => /*#__PURE__*/_react.default.createElement(_helpers.default.Provider, {
|
|
124
|
-
value: contextValues
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
-
"data-testid": "drawercontainer-component",
|
|
127
|
-
className: "".concat(position, " ").concat(customClass),
|
|
128
|
-
style: style
|
|
129
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
-
style: overlayStyle,
|
|
131
|
-
"data-testid": "drawercontent",
|
|
132
|
-
className: "drawercontent ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClassForContent)
|
|
133
|
-
}, title && /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({}, headerProps, {
|
|
134
|
-
customClass: customClassForDrawer
|
|
135
|
-
})), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children, getSpinner())));
|
|
136
149
|
return /*#__PURE__*/_reactDom.default.createPortal(drawerContent(), drawerContainerEl.current);
|
|
137
150
|
};
|
|
138
|
-
var _default =
|
|
151
|
+
var _default = BaseDrawer;
|
|
152
|
+
exports.default = _default;
|
package/lib/drawer/Header.js
CHANGED
|
@@ -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
|
});
|
|
@@ -8,23 +9,24 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
9
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
9
10
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
var getCloseButton = function getCloseButton(handlerClose) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
16
|
+
"data-testid": "header-closebutton",
|
|
17
|
+
className: "closebutton",
|
|
18
|
+
onClick: handlerClose,
|
|
19
|
+
onKeyPress: undefined,
|
|
20
|
+
role: "button",
|
|
21
|
+
tabIndex: 0
|
|
22
|
+
}, "X");
|
|
23
|
+
};
|
|
24
|
+
var getIcon = function getIcon(titleIcon, icon) {
|
|
23
25
|
if (titleIcon || icon) {
|
|
24
26
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
25
27
|
"data-testid": "icon-header",
|
|
26
28
|
className: "icon-header"
|
|
27
|
-
}, icon ||
|
|
29
|
+
}, icon || /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
28
30
|
name: titleIcon,
|
|
29
31
|
color: "#000",
|
|
30
32
|
size: 24
|
|
@@ -32,34 +34,34 @@ const getIcon = (titleIcon, icon) => {
|
|
|
32
34
|
}
|
|
33
35
|
return /*#__PURE__*/_react.default.createElement("noscript", null);
|
|
34
36
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
showCloseButton = true,
|
|
38
|
-
title,
|
|
39
|
-
subTitle,
|
|
40
|
-
icon,
|
|
41
|
-
titleIcon,
|
|
42
|
-
customClass,
|
|
43
|
-
titleContent,
|
|
44
|
-
subTitleContent,
|
|
45
|
-
titleRightContent
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = (0, _react.useContext)(_helpers.default);
|
|
50
|
-
const renderTitle = () => {
|
|
37
|
+
var Header = function Header(_ref) {
|
|
38
|
+
var _ref$showCloseButton = _ref.showCloseButton,
|
|
39
|
+
showCloseButton = _ref$showCloseButton === void 0 ? true : _ref$showCloseButton,
|
|
40
|
+
title = _ref.title,
|
|
41
|
+
subTitle = _ref.subTitle,
|
|
42
|
+
icon = _ref.icon,
|
|
43
|
+
titleIcon = _ref.titleIcon,
|
|
44
|
+
customClass = _ref.customClass,
|
|
45
|
+
titleContent = _ref.titleContent,
|
|
46
|
+
subTitleContent = _ref.subTitleContent,
|
|
47
|
+
titleRightContent = _ref.titleRightContent;
|
|
48
|
+
var _useContext = (0, _react.useContext)(_helpers.default),
|
|
49
|
+
handlerClose = _useContext.handlerClose;
|
|
50
|
+
var renderTitle = function renderTitle() {
|
|
51
51
|
if (titleContent) return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, titleContent);
|
|
52
52
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, icon ? getIcon(titleIcon, icon) : getIcon(titleIcon, null), /*#__PURE__*/_react.default.createElement("h2", {
|
|
53
53
|
className: "drawer-title"
|
|
54
54
|
}, title), titleRightContent);
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
var renderSubtitle = function renderSubtitle() {
|
|
57
57
|
if (subTitleContent) return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, subTitleContent);
|
|
58
58
|
return subTitle && /*#__PURE__*/_react.default.createElement("h3", {
|
|
59
59
|
className: "drawer-subtitle"
|
|
60
60
|
}, subTitle);
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
var checkHandlerClose = function checkHandlerClose() {
|
|
63
|
+
return handlerClose ? handlerClose() : undefined;
|
|
64
|
+
};
|
|
63
65
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
66
|
className: "drawerheader ".concat(customClass),
|
|
65
67
|
"data-testid": "drawerheader"
|
|
@@ -69,8 +71,9 @@ const Header = _ref => {
|
|
|
69
71
|
className: "title-subtitle"
|
|
70
72
|
}, renderTitle()), renderSubtitle()), /*#__PURE__*/_react.default.createElement("div", {
|
|
71
73
|
className: "right"
|
|
72
|
-
}, showCloseButton && getCloseButton(()
|
|
74
|
+
}, showCloseButton && getCloseButton(function () {
|
|
73
75
|
checkHandlerClose();
|
|
74
76
|
})));
|
|
75
77
|
};
|
|
76
|
-
var _default =
|
|
78
|
+
var _default = Header;
|
|
79
|
+
exports.default = _default;
|
package/lib/drawer/helpers.js
CHANGED
|
@@ -6,5 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
|
|
10
|
-
var _default =
|
|
9
|
+
var DrawerContext = /*#__PURE__*/_react.default.createContext({});
|
|
10
|
+
var _default = DrawerContext;
|
|
11
|
+
exports.default = _default;
|
package/lib/drawer/index.js
CHANGED
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "DrawerContent", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function () {
|
|
8
|
+
get: function get() {
|
|
9
9
|
return _Content.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "DrawerHeader", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () {
|
|
14
|
+
get: function get() {
|
|
15
15
|
return _Header.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -22,4 +22,5 @@ var _Content = _interopRequireDefault(require("./Content"));
|
|
|
22
22
|
require("../assets/styles/drawers.scss");
|
|
23
23
|
var _withFormSecurity = _interopRequireDefault(require("../form/withFormSecurity"));
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
var _default =
|
|
25
|
+
var _default = (0, _withFormSecurity.default)(_Drawer.default);
|
|
26
|
+
exports.default = _default;
|
package/lib/dropdown/Popup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IPopUpProps } from './types.js';
|
|
3
3
|
|
|
4
|
-
declare const DropdownPopup: ({
|
|
4
|
+
declare const DropdownPopup: ({ customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, ...props }: IPopUpProps) => React.ReactPortal;
|
|
5
5
|
|
|
6
6
|
export { DropdownPopup as default };
|
package/lib/dropdown/Popup.js
CHANGED
|
@@ -6,21 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
|
-
var
|
|
10
|
-
const _excluded = ["id", "customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth"];
|
|
9
|
+
var _excluded = ["customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth"];
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
23
|
-
let style = "top: ".concat(topPosition + (isFloatMenu ? 6 : 2), "px; min-width: ").concat(minWidth, "px;");
|
|
13
|
+
var getCalendarDropdownStyle = function getCalendarDropdownStyle(_ref) {
|
|
14
|
+
var topPosition = _ref.topPosition,
|
|
15
|
+
leftPosition = _ref.leftPosition,
|
|
16
|
+
rightPosition = _ref.rightPosition,
|
|
17
|
+
align = _ref.align,
|
|
18
|
+
isFloatMenu = _ref.isFloatMenu,
|
|
19
|
+
minWidth = _ref.minWidth;
|
|
20
|
+
var style = "top: ".concat(topPosition + (isFloatMenu ? 6 : 2), "px; min-width: ").concat(minWidth, "px;");
|
|
24
21
|
if (align === 'left') {
|
|
25
22
|
style += "left: ".concat(leftPosition, "px;");
|
|
26
23
|
} else if (align === 'right') {
|
|
@@ -28,42 +25,46 @@ const getCalendarDropdownStyle = _ref => {
|
|
|
28
25
|
}
|
|
29
26
|
return style;
|
|
30
27
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
var body = document.getElementsByTagName('body')[0];
|
|
29
|
+
var DropdownPopup = function DropdownPopup(_ref2) {
|
|
30
|
+
var _ref2$customClassForD = _ref2.customClassForDropdown,
|
|
31
|
+
customClassForDropdown = _ref2$customClassForD === void 0 ? '' : _ref2$customClassForD,
|
|
32
|
+
_ref2$align = _ref2.align,
|
|
33
|
+
align = _ref2$align === void 0 ? 'left' : _ref2$align,
|
|
34
|
+
_ref2$isFloatMenu = _ref2.isFloatMenu,
|
|
35
|
+
isFloatMenu = _ref2$isFloatMenu === void 0 ? false : _ref2$isFloatMenu,
|
|
36
|
+
_ref2$topPosition = _ref2.topPosition,
|
|
37
|
+
topPosition = _ref2$topPosition === void 0 ? 0 : _ref2$topPosition,
|
|
38
|
+
_ref2$leftPosition = _ref2.leftPosition,
|
|
39
|
+
leftPosition = _ref2$leftPosition === void 0 ? 0 : _ref2$leftPosition,
|
|
40
|
+
_ref2$rightPosition = _ref2.rightPosition,
|
|
41
|
+
rightPosition = _ref2$rightPosition === void 0 ? 0 : _ref2$rightPosition,
|
|
42
|
+
_ref2$minWidth = _ref2.minWidth,
|
|
43
|
+
minWidth = _ref2$minWidth === void 0 ? 0 : _ref2$minWidth,
|
|
43
44
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
44
|
-
|
|
45
|
+
var popup = (0, _react.useRef)(document.createElement('div'));
|
|
45
46
|
popup.current.className = "dropdown-component ".concat(customClassForDropdown);
|
|
46
47
|
popup.current.dataset.testid = 'dropdown-component';
|
|
47
48
|
popup.current.style.cssText = getCalendarDropdownStyle({
|
|
48
|
-
topPosition,
|
|
49
|
-
leftPosition,
|
|
50
|
-
rightPosition,
|
|
51
|
-
align,
|
|
52
|
-
isFloatMenu,
|
|
53
|
-
minWidth
|
|
49
|
+
topPosition: topPosition,
|
|
50
|
+
leftPosition: leftPosition,
|
|
51
|
+
rightPosition: rightPosition,
|
|
52
|
+
align: align,
|
|
53
|
+
isFloatMenu: isFloatMenu,
|
|
54
|
+
minWidth: minWidth
|
|
54
55
|
});
|
|
55
56
|
if (popup && popup.current) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
popup.current.style.zIndex = "".concat(modalContainers.length ?
|
|
57
|
+
var modalContainers = document.body.getElementsByClassName('modalcontainer');
|
|
58
|
+
var lastModalContainer = modalContainers[modalContainers.length - 1];
|
|
59
|
+
popup.current.style.zIndex = "".concat(modalContainers.length ? lastModalContainer.style.zIndex : 99999);
|
|
59
60
|
}
|
|
60
|
-
(0, _react.useEffect)(()
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
61
62
|
body.appendChild(popup.current);
|
|
62
|
-
|
|
63
|
-
return () => {
|
|
63
|
+
return function () {
|
|
64
64
|
body.removeChild(popup.current);
|
|
65
65
|
};
|
|
66
66
|
}, []);
|
|
67
67
|
return /*#__PURE__*/_reactDom.default.createPortal(props.children, popup.current);
|
|
68
68
|
};
|
|
69
|
-
var _default =
|
|
69
|
+
var _default = DropdownPopup;
|
|
70
|
+
exports.default = _default;
|
package/lib/dropdown/helper.js
CHANGED
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDropdownItemCssClass = exports.contentClass = void 0;
|
|
7
|
-
|
|
7
|
+
var contentClass = function contentClass(showClearButton) {
|
|
8
|
+
return "content ".concat(showClearButton ? '' : 'noclear');
|
|
9
|
+
};
|
|
8
10
|
exports.contentClass = contentClass;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
var getDropdownItemCssClass = function getDropdownItemCssClass(selected, disabled, striped) {
|
|
12
|
+
var className = 'item';
|
|
11
13
|
className += selected && !disabled ? ' -selected ' : '';
|
|
12
14
|
className += disabled ? ' -disabled' : '';
|
|
13
15
|
className += !selected && !disabled && striped ? ' -striped ' : '';
|