linear-react-components-ui 1.0.10-beta.2 → 1.0.10-beta.21
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 +1 -0
- package/.vscode/settings.json +1 -1
- package/README.md +19 -12
- package/lib/@types/Align.d.ts +2 -1
- package/lib/alerts/AlertContainer.d.ts +2 -0
- package/lib/alerts/AlertProvider.d.ts +2 -0
- package/lib/alerts/BaseAlert.d.ts +2 -0
- package/lib/alerts/Message.d.ts +2 -0
- package/lib/alerts/Message.js +1 -1
- package/lib/alerts/alert.spec.js +133 -0
- package/lib/alerts/helpers.d.ts +2 -0
- package/lib/alerts/index.d.ts +2 -0
- package/lib/alerts/types.d.ts +3 -1
- package/lib/alerts/withAlert.d.ts +2 -0
- package/lib/assets/styles/dialog.scss +9 -6
- package/lib/assets/styles/drawers.scss +9 -0
- package/lib/assets/styles/effects.scss +2 -2
- package/lib/assets/styles/radio.scss +52 -8
- package/lib/assets/styles/table.scss +30 -0
- package/lib/assets/styles/tooltip.scss +42 -2
- package/lib/avatar/avatar.spec.js +190 -0
- package/lib/badge/badge.spec.js +127 -0
- package/lib/buttons/ActivateButton.d.ts +2 -0
- package/lib/buttons/AddButton.d.ts +2 -0
- package/lib/buttons/Button.d.ts +2 -0
- package/lib/buttons/CancelButton.d.ts +2 -0
- package/lib/buttons/DangerButton.d.ts +2 -0
- package/lib/buttons/DefaultButton.d.ts +2 -0
- package/lib/buttons/DefaultButton.js +14 -4
- package/lib/buttons/DestroyButton.d.ts +2 -0
- package/lib/buttons/EditButton.d.ts +2 -0
- package/lib/buttons/InactivateButton.d.ts +2 -0
- package/lib/buttons/InfoButton.d.ts +2 -0
- package/lib/buttons/PrimaryButton.d.ts +2 -0
- package/lib/buttons/RestoreButton.d.ts +2 -0
- package/lib/buttons/SaveButton.d.ts +2 -0
- package/lib/buttons/SpinnerLoading.js +230 -0
- package/lib/buttons/SuccessButton.d.ts +2 -0
- package/lib/buttons/WarningButton.d.ts +2 -0
- package/lib/buttons/buttons.spec.js +504 -0
- package/lib/buttons/index.d.ts +2 -0
- package/lib/buttons/split_button/index.d.ts +2 -0
- package/lib/buttons/types.d.ts +6 -2
- package/lib/calendar/calendar.spec.js +171 -0
- package/lib/checkbox/checkbox.spec.js +215 -0
- package/lib/dialog/Alert.d.ts +3 -0
- package/lib/dialog/Custom.d.ts +3 -0
- package/lib/dialog/Custom.js +1 -1
- package/lib/dialog/Error.d.ts +3 -0
- package/lib/dialog/Information.d.ts +3 -0
- package/lib/dialog/Question.d.ts +3 -0
- package/lib/dialog/Warning.d.ts +3 -0
- package/lib/dialog/base/Content.d.ts +3 -0
- package/lib/dialog/base/Footer.d.ts +3 -0
- package/lib/dialog/base/Header.d.ts +3 -0
- package/lib/dialog/base/Header.js +12 -1
- package/lib/dialog/base/index.d.ts +3 -0
- package/lib/dialog/base/index.js +78 -16
- package/lib/dialog/dialog.spec.js +488 -0
- package/lib/dialog/form/index.d.ts +7 -3
- package/lib/dialog/form/index.js +11 -4
- package/lib/dialog/index.d.ts +3 -0
- package/lib/dialog/types.d.ts +10 -4
- package/lib/drawer/Content.d.ts +2 -0
- package/lib/drawer/Drawer.d.ts +3 -1
- package/lib/drawer/Drawer.js +22 -2
- package/lib/drawer/Drawer.spec.js +258 -0
- package/lib/drawer/Header.d.ts +2 -0
- package/lib/drawer/helpers.d.ts +2 -0
- package/lib/drawer/index.d.ts +2 -0
- package/lib/drawer/types.d.ts +4 -1
- package/lib/dropdown/Popup.js +5 -0
- package/lib/dropdown/dropdown.spec.js +169 -0
- package/lib/fieldset/fieldset.spec.js +329 -0
- package/lib/form/Field.d.ts +2 -1
- package/lib/form/Field.js +33 -24
- package/lib/form/FieldArray.d.ts +1 -0
- package/lib/form/FieldArray.js +41 -4
- package/lib/form/FieldNumber.d.ts +1 -0
- package/lib/form/FieldNumber.js +24 -5
- package/lib/form/FieldPeriod.d.ts +1 -0
- package/lib/form/FieldPeriod.js +16 -2
- package/lib/form/form.spec.js +293 -0
- package/lib/form/helpers.d.ts +2 -1
- package/lib/form/helpers.js +2 -2
- package/lib/form/index.d.ts +4 -2
- package/lib/form/index.js +72 -35
- package/lib/form/types.d.ts +25 -6
- package/lib/form/withFieldHOC.d.ts +1 -0
- package/lib/form/withFieldHOC.js +1 -0
- package/lib/form/withFormSecurity.d.ts +1 -0
- package/lib/form/withFormSecurity.js +2 -1
- package/lib/gridlayout/gridLayout.spec.js +169 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/icons/icons.spec.js +86 -0
- package/lib/icons/index.d.ts +2 -0
- package/lib/icons/types.d.ts +3 -1
- package/lib/index.d.ts +4 -1
- package/lib/inputs/base/InputTextBase.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.js +10 -2
- package/lib/inputs/base/base.spec.js +690 -0
- package/lib/inputs/base/helpers.d.ts +2 -1
- package/lib/inputs/base/index.js +1 -0
- package/lib/inputs/base/types.d.ts +2 -1
- package/lib/inputs/color/color_input.spec.js +174 -0
- package/lib/inputs/date/Dialog.d.ts +1 -0
- package/lib/inputs/date/Dropdown.d.ts +1 -0
- package/lib/inputs/date/date.spec.js +354 -0
- package/lib/inputs/date/helpers.d.ts +2 -1
- package/lib/inputs/date/helpers.js +3 -2
- package/lib/inputs/date/index.d.ts +1 -0
- package/lib/inputs/date/index.js +24 -9
- package/lib/inputs/date/types.d.ts +3 -1
- package/lib/inputs/file/DefaultFile.d.ts +1 -0
- package/lib/inputs/file/DragDropFile.d.ts +1 -0
- package/lib/inputs/file/File.d.ts +1 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -0
- package/lib/inputs/file/helpers.d.ts +1 -0
- package/lib/inputs/file/index.d.ts +1 -0
- package/lib/inputs/file/types.d.ts +1 -0
- package/lib/inputs/inputHOC.d.ts +3 -0
- package/lib/inputs/mask/BaseMask.d.ts +1 -0
- package/lib/inputs/mask/BaseMask.js +20 -5
- package/lib/inputs/mask/Cnpj.d.ts +1 -0
- package/lib/inputs/mask/Cpf.d.ts +1 -0
- package/lib/inputs/mask/Cpf.js +4 -4
- package/lib/inputs/mask/Phone.d.ts +1 -0
- package/lib/inputs/mask/ZipCode.d.ts +1 -0
- package/lib/inputs/mask/helpers.d.ts +3 -0
- package/lib/inputs/mask/helpers.js +1 -1
- package/lib/inputs/mask/imaskHOC.d.ts +3 -0
- package/lib/inputs/mask/imaskHOC.js +16 -12
- package/lib/inputs/mask/index.d.ts +1 -0
- package/lib/inputs/mask/input_mask.spec.js +607 -0
- package/lib/inputs/mask/types.d.ts +2 -1
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -1
- package/lib/inputs/multiSelect/ActionButtons.js +4 -1
- package/lib/inputs/multiSelect/Dropdown.d.ts +1 -0
- package/lib/inputs/multiSelect/Dropdown.js +4 -4
- package/lib/inputs/multiSelect/helper.d.ts +8 -6
- package/lib/inputs/multiSelect/helper.js +5 -1
- package/lib/inputs/multiSelect/index.d.ts +1 -0
- package/lib/inputs/multiSelect/index.js +15 -11
- package/lib/inputs/multiSelect/types.d.ts +16 -6
- package/lib/inputs/number/BaseNumber.d.ts +3 -0
- package/lib/inputs/number/BaseNumber.js +1 -2
- package/lib/inputs/number/Currency.d.ts +3 -0
- package/lib/inputs/number/Decimal.d.ts +3 -0
- package/lib/inputs/number/format_number.d.ts +2 -1
- package/lib/inputs/number/format_number.js +8 -3
- package/lib/inputs/number/index.d.ts +3 -0
- package/lib/inputs/number/numberfield.spec.js +215 -0
- package/lib/inputs/number/types.d.ts +3 -1
- package/lib/inputs/period/Dialog.d.ts +1 -0
- package/lib/inputs/period/Dropdown.d.ts +1 -0
- package/lib/inputs/period/PeriodList.d.ts +1 -0
- package/lib/inputs/period/helper.d.ts +1 -0
- package/lib/inputs/period/index.d.ts +1 -0
- package/lib/inputs/period/index.js +8 -9
- package/lib/inputs/period/types.d.ts +3 -2
- package/lib/inputs/search/index.d.ts +3 -0
- package/lib/inputs/search/search_input.spec.js +209 -0
- package/lib/inputs/select/ActionButtons.d.ts +3 -0
- package/lib/inputs/select/Dropdown.d.ts +3 -0
- package/lib/inputs/select/Dropdown.js +1 -1
- package/lib/inputs/select/helper.d.ts +7 -9
- package/lib/inputs/select/helper.js +11 -2
- package/lib/inputs/select/index.d.ts +1 -0
- package/lib/inputs/select/index.js +6 -5
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -0
- package/lib/inputs/select/multiple/Selecteds.js +1 -1
- package/lib/inputs/select/multiple/index.d.ts +1 -0
- package/lib/inputs/select/multiple/index.js +13 -10
- package/lib/inputs/select/select.spec.js +395 -0
- package/lib/inputs/select/simple/index.d.ts +1 -0
- package/lib/inputs/select/simple/index.js +35 -18
- package/lib/inputs/select/types.d.ts +22 -7
- package/lib/inputs/text/index.d.ts +1 -0
- package/lib/inputs/text/textfield.spec.js +215 -0
- package/lib/inputs/text/types.d.ts +1 -1
- package/lib/inputs/textarea/index.d.ts +1 -0
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/inputs/textarea/textarea.spec.js +59 -0
- package/lib/inputs/textarea/types.d.ts +1 -0
- package/lib/inputs/types.d.ts +7 -3
- package/lib/internals/types.d.ts +1 -0
- package/lib/internals/withTooltip.js +13 -6
- package/lib/labelMessages/index.d.ts +2 -0
- package/lib/labelMessages/index.js +3 -4
- package/lib/labelMessages/labelMessages.spec.js +176 -0
- package/lib/labelMessages/types.d.ts +3 -1
- package/lib/labels/DangerLabel.d.ts +2 -0
- package/lib/labels/DefaultLabel.d.ts +2 -0
- package/lib/labels/InfoLabel.d.ts +2 -0
- package/lib/labels/PrimaryLabel.d.ts +2 -0
- package/lib/labels/SuccessLabel.d.ts +2 -0
- package/lib/labels/WarningLabel.d.ts +2 -0
- package/lib/labels/index.d.ts +2 -0
- package/lib/labels/label.spec.js +162 -0
- package/lib/labels/types.d.ts +3 -1
- package/lib/list/Header.d.ts +2 -0
- package/lib/list/Item.d.ts +2 -0
- package/lib/list/helpers.d.ts +2 -0
- package/lib/list/index.d.ts +2 -0
- package/lib/list/list.spec.js +769 -0
- package/lib/list/types.d.ts +4 -2
- package/lib/menus/float/MenuItem.d.ts +2 -0
- package/lib/menus/float/float-menu.spec.js +221 -0
- package/lib/menus/float/helpers.d.ts +2 -0
- package/lib/menus/float/index.d.ts +2 -0
- package/lib/menus/float/types.d.ts +3 -1
- package/lib/menus/index.d.ts +2 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -0
- package/lib/menus/sidenav/MenuLink.d.ts +2 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +2 -0
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -0
- package/lib/menus/sidenav/helpers.d.ts +2 -0
- package/lib/menus/sidenav/index.d.ts +2 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -0
- package/lib/menus/sidenav/sidenav.spec.js +379 -0
- package/lib/menus/sidenav/types.d.ts +4 -2
- package/lib/panel/Content.d.ts +3 -1
- package/lib/panel/DangerPanel.d.ts +3 -1
- package/lib/panel/Default.d.ts +3 -1
- package/lib/panel/Header.d.ts +3 -1
- package/lib/panel/Header.js +3 -4
- package/lib/panel/InfoPanel.d.ts +3 -1
- package/lib/panel/PrimaryPanel.d.ts +3 -1
- package/lib/panel/SuccessPanel.d.ts +3 -1
- package/lib/panel/ToolBar.d.ts +3 -1
- package/lib/panel/WarningPanel.d.ts +3 -1
- package/lib/panel/helpers.d.ts +3 -1
- package/lib/panel/index.d.ts +3 -1
- package/lib/panel/panel.spec.js +216 -0
- package/lib/panel/types.d.ts +3 -1
- package/lib/popover/PopoverText.d.ts +2 -0
- package/lib/popover/PopoverTitle.d.ts +2 -0
- package/lib/popover/index.d.ts +2 -0
- package/lib/popover/index.js +1 -2
- package/lib/popover/popover.spec.js +146 -0
- package/lib/popover/types.d.ts +3 -1
- package/lib/progress/progress.spec.js +94 -0
- package/lib/radio/index.d.ts +2 -1
- package/lib/radio/index.js +5 -1
- package/lib/radio/radio.spec.js +189 -0
- package/lib/radio/types.d.ts +4 -1
- package/lib/spinner/spinner.spec.js +152 -0
- package/lib/split/split.spec.js +163 -0
- package/lib/table/Body.js +9 -12
- package/lib/table/Header.js +19 -16
- package/lib/table/Row.js +20 -3
- package/lib/table/index.js +1 -0
- package/lib/table/table.spec.js +352 -0
- package/lib/table/types.d.ts +7 -0
- package/lib/tabs/DropdownItems.d.ts +2 -0
- package/lib/tabs/Menu.d.ts +2 -0
- package/lib/tabs/MenuItems.d.ts +2 -0
- package/lib/tabs/Panel.d.ts +2 -0
- package/lib/tabs/index.d.ts +2 -0
- package/lib/tabs/tabHelpers.d.ts +2 -0
- package/lib/tabs/tabs.spec.js +321 -0
- package/lib/tabs/types.d.ts +3 -1
- package/lib/toolbar/ButtonBar.d.ts +2 -0
- package/lib/toolbar/LabelBar.d.ts +2 -0
- package/lib/toolbar/ToolBarGroup.d.ts +2 -0
- package/lib/toolbar/helpers.d.ts +2 -0
- package/lib/toolbar/index.d.ts +2 -0
- package/lib/toolbar/toolbar.spec.js +394 -0
- package/lib/toolbar/types.d.ts +4 -2
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/index.js +5 -1
- package/lib/tooltip/tooltip.spec.js +215 -0
- package/lib/tooltip/types.d.ts +1 -0
- package/lib/treeview/index.js +1 -0
- package/lib/treeview/treeview.spec.js +279 -0
- package/lib/{types-90c43ae1.d.ts → types-c1e2d0c9.d.ts} +2 -1
- package/lib/uitour/uitour.spec.js +176 -0
- package/package.json +67 -64
package/lib/dialog/form/index.js
CHANGED
|
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.default = exports.FormDialogContext = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
10
10
|
var _base = _interopRequireDefault(require("../base"));
|
|
@@ -18,6 +18,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
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); }
|
|
19
19
|
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; }
|
|
20
20
|
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); }
|
|
21
|
+
var FormDialogContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
22
|
+
exports.FormDialogContext = FormDialogContext;
|
|
21
23
|
var ModalForm = function ModalForm(props) {
|
|
22
24
|
var _props$showFooter = props.showFooter,
|
|
23
25
|
showFooter = _props$showFooter === void 0 ? true : _props$showFooter,
|
|
@@ -29,11 +31,12 @@ var ModalForm = function ModalForm(props) {
|
|
|
29
31
|
height = _props$height === void 0 ? '50%' : _props$height,
|
|
30
32
|
content = props.content,
|
|
31
33
|
children = props.children;
|
|
34
|
+
var headerRef = (0, _react.useRef)(null);
|
|
35
|
+
var context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
32
36
|
var overlayStyle = isWaiting ? {
|
|
33
37
|
opacity: 0.4,
|
|
34
38
|
pointerEvent: 'none'
|
|
35
39
|
} : {};
|
|
36
|
-
var context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
37
40
|
var getSpinner = function getSpinner() {
|
|
38
41
|
if (!isWaiting) return null;
|
|
39
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -45,7 +48,11 @@ var ModalForm = function ModalForm(props) {
|
|
|
45
48
|
delayTime: 0
|
|
46
49
|
}));
|
|
47
50
|
};
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(FormDialogContext.Provider, {
|
|
52
|
+
value: {
|
|
53
|
+
headerRef: headerRef
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_base.default, _extends({
|
|
49
56
|
width: width,
|
|
50
57
|
height: height
|
|
51
58
|
}, props, {
|
|
@@ -68,7 +75,7 @@ var ModalForm = function ModalForm(props) {
|
|
|
68
75
|
return /*#__PURE__*/_react.default.cloneElement(button, {
|
|
69
76
|
key: "button-".concat(_uuid.default.v1())
|
|
70
77
|
});
|
|
71
|
-
}))));
|
|
78
|
+
})))));
|
|
72
79
|
};
|
|
73
80
|
var _default = (0, _withFormSecurity.default)(ModalForm);
|
|
74
81
|
exports.default = _default;
|
package/lib/dialog/index.d.ts
CHANGED
package/lib/dialog/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import { TextAlign } from '../@types/Align.js';
|
|
3
|
+
import { IconNames } from '../@types/Icon.js';
|
|
4
|
+
import '../icons/helper.js';
|
|
2
5
|
|
|
3
6
|
interface IContentProps {
|
|
4
7
|
children: ReactNode | ReactNode[];
|
|
@@ -12,7 +15,7 @@ interface IHeaderProps {
|
|
|
12
15
|
showCloseButton?: boolean;
|
|
13
16
|
title?: string;
|
|
14
17
|
icon?: JSX.Element;
|
|
15
|
-
titleIcon?:
|
|
18
|
+
titleIcon?: IconNames;
|
|
16
19
|
}
|
|
17
20
|
interface IBaseProps {
|
|
18
21
|
wrapperClassName: string;
|
|
@@ -23,7 +26,7 @@ interface IBaseProps {
|
|
|
23
26
|
closeOnEsc?: boolean;
|
|
24
27
|
closeOnOutsideClick?: boolean;
|
|
25
28
|
overlay?: boolean;
|
|
26
|
-
textAlign?:
|
|
29
|
+
textAlign?: TextAlign;
|
|
27
30
|
zIndex?: string;
|
|
28
31
|
}
|
|
29
32
|
interface IFormProps {
|
|
@@ -63,7 +66,10 @@ interface ICustomProps {
|
|
|
63
66
|
text?: string;
|
|
64
67
|
height?: string;
|
|
65
68
|
width?: string;
|
|
66
|
-
iconName?:
|
|
69
|
+
iconName?: IconNames | null;
|
|
70
|
+
}
|
|
71
|
+
interface IFormDialogContext {
|
|
72
|
+
headerRef?: React.RefObject<HTMLDivElement>;
|
|
67
73
|
}
|
|
68
74
|
|
|
69
|
-
export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormProps, IHeaderProps, IQuestionProps };
|
|
75
|
+
export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps };
|
package/lib/drawer/Content.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { IDrawerProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Icon.js';
|
|
6
|
+
import '../icons/helper.js';
|
|
5
7
|
|
|
6
8
|
declare const Content: ({ children, style }: IDrawerProps) => JSX.Element;
|
|
7
9
|
|
package/lib/drawer/Drawer.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import React__default from 'react';
|
|
|
2
2
|
import { IDrawerProps } from './types.js';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Icon.js';
|
|
6
|
+
import '../icons/helper.js';
|
|
5
7
|
|
|
6
|
-
declare const BaseDrawer: ({ position, customClass, children, style, customClassForContent, targetId, closeOnEsc, overlay, permissionAttr, skeletonize, handlerClose, customClassForDrawer, content, title, ...rest }: IDrawerProps) => React__default.ReactPortal;
|
|
8
|
+
declare const BaseDrawer: ({ position, customClass, children, style, customClassForContent, targetId, closeOnEsc, overlay, permissionAttr, skeletonize, handlerClose, customClassForDrawer, content, title, isWaiting, ...rest }: IDrawerProps) => React__default.ReactPortal;
|
|
7
9
|
|
|
8
10
|
export { BaseDrawer as default };
|
package/lib/drawer/Drawer.js
CHANGED
|
@@ -10,7 +10,8 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
10
10
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
11
11
|
var _permissionValidations = require("../permissionValidations");
|
|
12
12
|
var _ = require(".");
|
|
13
|
-
var
|
|
13
|
+
var _spinner = _interopRequireDefault(require("../spinner"));
|
|
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
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); }
|
|
16
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; }
|
|
@@ -42,6 +43,8 @@ var BaseDrawer = function BaseDrawer(_ref) {
|
|
|
42
43
|
customClassForDrawer = _ref$customClassForDr === void 0 ? '' : _ref$customClassForDr,
|
|
43
44
|
content = _ref.content,
|
|
44
45
|
title = _ref.title,
|
|
46
|
+
_ref$isWaiting = _ref.isWaiting,
|
|
47
|
+
isWaiting = _ref$isWaiting === void 0 ? false : _ref$isWaiting,
|
|
45
48
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
49
|
var headerProps = _extends({}, rest, {
|
|
47
50
|
title: title
|
|
@@ -53,6 +56,22 @@ var BaseDrawer = function BaseDrawer(_ref) {
|
|
|
53
56
|
var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)([hideContent], permissionAttr)),
|
|
54
57
|
_useState2 = _slicedToArray(_useState, 1),
|
|
55
58
|
onDenied = _useState2[0];
|
|
59
|
+
var overlayStyle = isWaiting ? {
|
|
60
|
+
opacity: 0.4,
|
|
61
|
+
pointerEvent: 'none',
|
|
62
|
+
placeContent: 'center'
|
|
63
|
+
} : {};
|
|
64
|
+
var getSpinner = function getSpinner() {
|
|
65
|
+
if (!isWaiting) return null;
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
+
className: "waitingspinner"
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
69
|
+
style: {
|
|
70
|
+
width: 60
|
|
71
|
+
},
|
|
72
|
+
delayTime: 0
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
56
75
|
var setDrawerComponent = function setDrawerComponent(body, randonId) {
|
|
57
76
|
var componentEl = document.createElement('div');
|
|
58
77
|
componentEl.className = 'drawer-component';
|
|
@@ -115,11 +134,12 @@ var BaseDrawer = function BaseDrawer(_ref) {
|
|
|
115
134
|
className: "".concat(position, " ").concat(customClass),
|
|
116
135
|
style: style
|
|
117
136
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
137
|
+
style: overlayStyle,
|
|
118
138
|
"data-testid": "drawercontent",
|
|
119
139
|
className: "drawercontent ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClassForContent)
|
|
120
140
|
}, title && /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({}, headerProps, {
|
|
121
141
|
customClass: customClassForDrawer
|
|
122
|
-
})), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children)));
|
|
142
|
+
})), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children, getSpinner())));
|
|
123
143
|
};
|
|
124
144
|
return /*#__PURE__*/_reactDom.default.createPortal(drawerContent(), drawerContainerEl.current);
|
|
125
145
|
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
9
|
+
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
+
|
|
11
|
+
require("babel-polyfill");
|
|
12
|
+
|
|
13
|
+
var _ = _interopRequireWildcard(require("."));
|
|
14
|
+
|
|
15
|
+
var _icons = _interopRequireDefault(require("../icons"));
|
|
16
|
+
|
|
17
|
+
var _avatar = _interopRequireDefault(require("../avatar"));
|
|
18
|
+
|
|
19
|
+
var _storageMock = _interopRequireWildcard(require("../../../config/jest/storageMock"));
|
|
20
|
+
|
|
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
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
|
|
27
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
28
|
+
|
|
29
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
30
|
+
|
|
31
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
32
|
+
|
|
33
|
+
var drawerMock = function drawerMock(drawerProps, drawerHeaderProps) {
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
35
|
+
position: "right",
|
|
36
|
+
customClass: "customMockClass",
|
|
37
|
+
customClassForContent: "CustomContentMockClass",
|
|
38
|
+
style: {
|
|
39
|
+
backgroundColor: '#FFF'
|
|
40
|
+
},
|
|
41
|
+
overlay: true
|
|
42
|
+
}, drawerProps), /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({
|
|
43
|
+
title: "Header Test",
|
|
44
|
+
subTitle: "Subtitle test",
|
|
45
|
+
titleIcon: "user",
|
|
46
|
+
customClass: "customMockHeaderClass",
|
|
47
|
+
showCloseButton: true
|
|
48
|
+
}, drawerHeaderProps)), /*#__PURE__*/_react.default.createElement(_.DrawerContent, {
|
|
49
|
+
style: {
|
|
50
|
+
background: '#333',
|
|
51
|
+
marginTop: 10
|
|
52
|
+
}
|
|
53
|
+
}, "DrawerContent", /*#__PURE__*/_react.default.createElement(_avatar.default, null)));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
describe('Drawer', function () {
|
|
57
|
+
describe('Drawer Container', function () {
|
|
58
|
+
var DrawerTestId = 'drawercontainer-component';
|
|
59
|
+
var DrawerContentTestId = 'drawercontent';
|
|
60
|
+
it('should render the drawer component with children', function () {
|
|
61
|
+
var _render = (0, _react2.render)(drawerMock()),
|
|
62
|
+
getByTestId = _render.getByTestId;
|
|
63
|
+
|
|
64
|
+
expect(getByTestId(DrawerTestId)).toHaveTextContent('DrawerContent');
|
|
65
|
+
});
|
|
66
|
+
it('should change the position of Drawer', function () {
|
|
67
|
+
var _render2 = (0, _react2.render)(drawerMock()),
|
|
68
|
+
getByTestId = _render2.getByTestId;
|
|
69
|
+
|
|
70
|
+
expect(getByTestId(DrawerTestId)).toHaveClass('right');
|
|
71
|
+
});
|
|
72
|
+
it('should apply customClass', function () {
|
|
73
|
+
var _render3 = (0, _react2.render)(drawerMock()),
|
|
74
|
+
getByTestId = _render3.getByTestId;
|
|
75
|
+
|
|
76
|
+
expect(getByTestId(DrawerTestId)).toHaveClass('customMockClass');
|
|
77
|
+
});
|
|
78
|
+
it('should apply customClassContent', function () {
|
|
79
|
+
var _render4 = (0, _react2.render)(drawerMock()),
|
|
80
|
+
getByTestId = _render4.getByTestId;
|
|
81
|
+
|
|
82
|
+
expect(getByTestId(DrawerContentTestId)).toHaveClass('CustomContentMockClass');
|
|
83
|
+
});
|
|
84
|
+
it('should apply inline style', function () {
|
|
85
|
+
var _render5 = (0, _react2.render)(drawerMock()),
|
|
86
|
+
getByTestId = _render5.getByTestId;
|
|
87
|
+
|
|
88
|
+
expect(getByTestId(DrawerTestId)).toHaveStyle('background-color: #FFF');
|
|
89
|
+
});
|
|
90
|
+
it('should render overlay over the page', function () {
|
|
91
|
+
(0, _react2.render)(drawerMock());
|
|
92
|
+
expect(_react2.screen.getByTestId('drawer-overlay')).toBeInTheDocument();
|
|
93
|
+
});
|
|
94
|
+
it('should close the Drawer when press Escape', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
95
|
+
var mockHandlerClose, _render6, container;
|
|
96
|
+
|
|
97
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
98
|
+
while (1) {
|
|
99
|
+
switch (_context.prev = _context.next) {
|
|
100
|
+
case 0:
|
|
101
|
+
mockHandlerClose = jest.fn();
|
|
102
|
+
_render6 = (0, _react2.render)(drawerMock({
|
|
103
|
+
handlerClose: mockHandlerClose,
|
|
104
|
+
closeOnEsc: true
|
|
105
|
+
})), container = _render6.container;
|
|
106
|
+
|
|
107
|
+
_react2.fireEvent.keyUp(container, {
|
|
108
|
+
key: 'Escape',
|
|
109
|
+
code: 'Escape',
|
|
110
|
+
keyCode: 27,
|
|
111
|
+
charCode: 27
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
expect(mockHandlerClose).toHaveBeenCalled();
|
|
115
|
+
|
|
116
|
+
case 4:
|
|
117
|
+
case "end":
|
|
118
|
+
return _context.stop();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, _callee);
|
|
122
|
+
})));
|
|
123
|
+
});
|
|
124
|
+
describe('Drawer Header', function () {
|
|
125
|
+
var CloseButtonTestId = 'header-closebutton';
|
|
126
|
+
var mockHandlerClose = jest.fn();
|
|
127
|
+
|
|
128
|
+
var mockImage = /*#__PURE__*/_react.default.createElement("img", {
|
|
129
|
+
src: "https://devfront.erplinear.com.br/auth/static/media/auth_bg.96d98c39.jpg",
|
|
130
|
+
alt: "imagem teste"
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
var DrawerHeaderMock = drawerMock({
|
|
134
|
+
handlerClose: mockHandlerClose
|
|
135
|
+
});
|
|
136
|
+
it('should renders correctly DrawerHeader', function () {
|
|
137
|
+
var _render7 = (0, _react2.render)(DrawerHeaderMock),
|
|
138
|
+
getByText = _render7.getByText;
|
|
139
|
+
|
|
140
|
+
expect(getByText('Header Test')).toBeInTheDocument();
|
|
141
|
+
});
|
|
142
|
+
it('should render titleContent', function () {
|
|
143
|
+
var _render8 = (0, _react2.render)(drawerMock({}, {
|
|
144
|
+
titleContent: mockImage
|
|
145
|
+
})),
|
|
146
|
+
getByAltText = _render8.getByAltText;
|
|
147
|
+
|
|
148
|
+
expect(getByAltText('imagem teste')).toBeInTheDocument();
|
|
149
|
+
});
|
|
150
|
+
it('should render titleRightContent', function () {
|
|
151
|
+
var _render9 = (0, _react2.render)(drawerMock({}, {
|
|
152
|
+
titleRightContent: mockImage
|
|
153
|
+
})),
|
|
154
|
+
getByAltText = _render9.getByAltText;
|
|
155
|
+
|
|
156
|
+
expect(getByAltText('imagem teste')).toBeInTheDocument();
|
|
157
|
+
});
|
|
158
|
+
it('should render subtitle', function () {
|
|
159
|
+
var _render10 = (0, _react2.render)(DrawerHeaderMock),
|
|
160
|
+
getByText = _render10.getByText;
|
|
161
|
+
|
|
162
|
+
expect(getByText('Subtitle test')).toBeInTheDocument();
|
|
163
|
+
});
|
|
164
|
+
it('should render subTitleContent', function () {
|
|
165
|
+
var _render11 = (0, _react2.render)(drawerMock({}, {
|
|
166
|
+
subTitleContent: mockImage
|
|
167
|
+
})),
|
|
168
|
+
getByAltText = _render11.getByAltText;
|
|
169
|
+
|
|
170
|
+
expect(getByAltText('imagem teste')).toBeInTheDocument();
|
|
171
|
+
});
|
|
172
|
+
it('should render title icon', function () {
|
|
173
|
+
var _render12 = (0, _react2.render)(DrawerHeaderMock),
|
|
174
|
+
getByTestId = _render12.getByTestId;
|
|
175
|
+
|
|
176
|
+
expect(getByTestId('icon-header')).toBeInTheDocument();
|
|
177
|
+
expect(getByTestId('icon-header')).toHaveClass('icon-header');
|
|
178
|
+
});
|
|
179
|
+
it('should render icon', function () {
|
|
180
|
+
var _render13 = (0, _react2.render)(drawerMock({}, {
|
|
181
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
182
|
+
name: "user"
|
|
183
|
+
}),
|
|
184
|
+
showCloseButton: true
|
|
185
|
+
})),
|
|
186
|
+
getByTestId = _render13.getByTestId;
|
|
187
|
+
|
|
188
|
+
expect(getByTestId('icon-header')).toBeInTheDocument();
|
|
189
|
+
expect(getByTestId('icon-header')).toHaveClass('icon-header');
|
|
190
|
+
});
|
|
191
|
+
it('should render close button', function () {
|
|
192
|
+
var _render14 = (0, _react2.render)(DrawerHeaderMock),
|
|
193
|
+
getByTestId = _render14.getByTestId;
|
|
194
|
+
|
|
195
|
+
expect(getByTestId(CloseButtonTestId)).toBeInTheDocument();
|
|
196
|
+
expect(getByTestId(CloseButtonTestId)).toHaveClass('closebutton');
|
|
197
|
+
});
|
|
198
|
+
it('should fire click in close button', function () {
|
|
199
|
+
var _render15 = (0, _react2.render)(DrawerHeaderMock),
|
|
200
|
+
getByTestId = _render15.getByTestId;
|
|
201
|
+
|
|
202
|
+
_react2.fireEvent.click(getByTestId(CloseButtonTestId));
|
|
203
|
+
|
|
204
|
+
expect(mockHandlerClose).toHaveBeenCalledTimes(1);
|
|
205
|
+
});
|
|
206
|
+
it('should apply customClass', function () {
|
|
207
|
+
var _render16 = (0, _react2.render)(DrawerHeaderMock),
|
|
208
|
+
getByTestId = _render16.getByTestId;
|
|
209
|
+
|
|
210
|
+
expect(getByTestId('drawerheader')).toHaveClass('customMockHeaderClass');
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
describe('Drawer Content', function () {
|
|
214
|
+
it('should DrawerContent renders correctly', function () {
|
|
215
|
+
var _render17 = (0, _react2.render)(drawerMock()),
|
|
216
|
+
getByText = _render17.getByText,
|
|
217
|
+
getByTestId = _render17.getByTestId;
|
|
218
|
+
|
|
219
|
+
expect(getByText('DrawerContent')).toBeInTheDocument();
|
|
220
|
+
expect(getByTestId('avatar')).toBeInTheDocument();
|
|
221
|
+
});
|
|
222
|
+
it('should apply inline style', function () {
|
|
223
|
+
var _render18 = (0, _react2.render)(drawerMock()),
|
|
224
|
+
getByText = _render18.getByText;
|
|
225
|
+
|
|
226
|
+
expect(getByText('DrawerContent')).toHaveStyle('background-color: #333; margin-top: 10px;');
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
describe('Permissions', function () {
|
|
230
|
+
var defineStorageMock = function defineStorageMock() {
|
|
231
|
+
Object.defineProperty(window, 'sessionStorage', {
|
|
232
|
+
value: (0, _storageMock.default)()
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
it('should check permission', function () {
|
|
237
|
+
defineStorageMock();
|
|
238
|
+
|
|
239
|
+
var _render19 = (0, _react2.render)(drawerMock({
|
|
240
|
+
permissionAttr: (0, _storageMock.permissionAttrMockAuthorized)('hideContent')
|
|
241
|
+
})),
|
|
242
|
+
container = _render19.container;
|
|
243
|
+
|
|
244
|
+
expect(container.querySelector('.no-permission-component')).not.toBeInTheDocument();
|
|
245
|
+
});
|
|
246
|
+
it('should render non-permission', function () {
|
|
247
|
+
defineStorageMock();
|
|
248
|
+
|
|
249
|
+
var _render20 = (0, _react2.render)(drawerMock({
|
|
250
|
+
permissionAttr: (0, _storageMock.permissionAttrMockUnauthorized)('hideContent')
|
|
251
|
+
})),
|
|
252
|
+
getByText = _render20.getByText;
|
|
253
|
+
|
|
254
|
+
expect(getByText('Acesso Negado')).toBeInTheDocument();
|
|
255
|
+
expect(getByText('Você não tem permissão para acessar este conteúdo. Consulte o Administrador do sistema!')).toBeInTheDocument();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
});
|
package/lib/drawer/Header.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { IDrawerHeaderProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Icon.js';
|
|
6
|
+
import '../icons/helper.js';
|
|
5
7
|
|
|
6
8
|
declare const Header: ({ showCloseButton, title, subTitle, icon, titleIcon, customClass, titleContent, subTitleContent, titleRightContent, }: IDrawerHeaderProps) => JSX.Element;
|
|
7
9
|
|
package/lib/drawer/helpers.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import React__default from 'react';
|
|
|
2
2
|
import { IDrawerContext } from './types.js';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Icon.js';
|
|
6
|
+
import '../icons/helper.js';
|
|
5
7
|
|
|
6
8
|
declare const DrawerContext: React__default.Context<IDrawerContext>;
|
|
7
9
|
|
package/lib/drawer/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { default as DrawerContent } from './Content.js';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../@types/PermissionAttr.js';
|
|
6
6
|
import '../@types/Position.js';
|
|
7
|
+
import '../@types/Icon.js';
|
|
8
|
+
import '../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const _default: (props: IDrawerProps) => JSX.Element;
|
|
9
11
|
|
package/lib/drawer/types.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React__default, { ReactNode, ReactElement } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
3
3
|
import { Position } from '../@types/Position.js';
|
|
4
|
+
import { IconNames } from '../@types/Icon.js';
|
|
5
|
+
import '../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
6
8
|
overlay?: boolean;
|
|
@@ -17,6 +19,7 @@ interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
|
17
19
|
closeOnOutsideClick?: boolean;
|
|
18
20
|
content?: string;
|
|
19
21
|
title?: string;
|
|
22
|
+
isWaiting?: boolean;
|
|
20
23
|
}
|
|
21
24
|
interface IDrawerHeaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
22
25
|
showCloseButton?: boolean;
|
|
@@ -27,7 +30,7 @@ interface IDrawerHeaderProps extends React__default.HTMLAttributes<HTMLDivElemen
|
|
|
27
30
|
subTitle?: string;
|
|
28
31
|
subTitleContent?: ReactElement;
|
|
29
32
|
icon?: ReactElement;
|
|
30
|
-
titleIcon?:
|
|
33
|
+
titleIcon?: IconNames;
|
|
31
34
|
}
|
|
32
35
|
interface IDrawerContext {
|
|
33
36
|
handlerClose?: () => void;
|
package/lib/dropdown/Popup.js
CHANGED
|
@@ -53,6 +53,11 @@ var DropdownPopup = function DropdownPopup(_ref2) {
|
|
|
53
53
|
isFloatMenu: isFloatMenu,
|
|
54
54
|
minWidth: minWidth
|
|
55
55
|
});
|
|
56
|
+
if (popup && popup.current) {
|
|
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);
|
|
60
|
+
}
|
|
56
61
|
(0, _react.useEffect)(function () {
|
|
57
62
|
body.appendChild(popup.current);
|
|
58
63
|
return function () {
|