@elliemae/ds-dialog 2.3.0-next.6 → 2.3.0-next.7

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/cjs/DSDialog.js CHANGED
@@ -28,7 +28,8 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
28
28
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
29
29
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
30
30
 
31
- const _excluded = ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"];
31
+ const _excluded = ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"],
32
+ _excluded2 = ["className"];
32
33
 
33
34
  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; }
34
35
 
@@ -60,13 +61,19 @@ const DSDialog = props => {
60
61
  const handleOutsideClick = react.useCallback(e => {
61
62
  if (e.target.dataset.portalbg) onClickOutside();
62
63
  }, [onClickOutside]);
63
- const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefault, {
64
- onClick: handleOutsideClick
65
- });
66
64
  const handleOnKeyDown = react.useCallback(e => {
67
65
  if (e.key === 'Escape') onClose();
68
- if (globalAttributes.onKeyDown) globalAttributes.onKeyDown(e);
69
- }, [globalAttributes, onClose]);
66
+ }, [onClose]);
67
+
68
+ const _useGetGlobalAttribut = dsPropsHelpers.useGetGlobalAttributes(propsWithDefault, {
69
+ onClick: handleOutsideClick,
70
+ onKeyDown: handleOnKeyDown
71
+ }),
72
+ {
73
+ className
74
+ } = _useGetGlobalAttribut,
75
+ restOfGlobalAttributes = _objectWithoutProperties__default["default"](_useGetGlobalAttribut, _excluded2);
76
+
70
77
  react.useEffect(() => {
71
78
  var _window$getComputedSt;
72
79
 
@@ -93,6 +100,7 @@ const DSDialog = props => {
93
100
 
94
101
  if (isOpen) {
95
102
  return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/_jsx__default["default"](styles.StyledDialogBackground, {
103
+ className: className,
96
104
  onClick: handleOutsideClick,
97
105
  "data-portalbg": true,
98
106
  "data-testid": DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
@@ -108,8 +116,7 @@ const DSDialog = props => {
108
116
  size: size,
109
117
  centered: centered,
110
118
  "data-testid": DSDialogDatatestid.DSDialogDatatestid.CONTAINER
111
- }, globalAttributes), {}, {
112
- onKeyDown: handleOnKeyDown,
119
+ }, restOfGlobalAttributes), {}, {
113
120
  children: children
114
121
  }))), document.getElementsByTagName('body')[0]);
115
122
  }
package/esm/DSDialog.js CHANGED
@@ -17,7 +17,8 @@ import { getSpaceProps } from './utils.js';
17
17
  import { DSDialogDatatestid } from './DSDialogDatatestid.js';
18
18
  import { jsx } from 'react/jsx-runtime';
19
19
 
20
- const _excluded = ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"];
20
+ const _excluded = ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"],
21
+ _excluded2 = ["className"];
21
22
 
22
23
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
24
 
@@ -49,13 +50,19 @@ const DSDialog = props => {
49
50
  const handleOutsideClick = useCallback(e => {
50
51
  if (e.target.dataset.portalbg) onClickOutside();
51
52
  }, [onClickOutside]);
52
- const globalAttributes = useGetGlobalAttributes(propsWithDefault, {
53
- onClick: handleOutsideClick
54
- });
55
53
  const handleOnKeyDown = useCallback(e => {
56
54
  if (e.key === 'Escape') onClose();
57
- if (globalAttributes.onKeyDown) globalAttributes.onKeyDown(e);
58
- }, [globalAttributes, onClose]);
55
+ }, [onClose]);
56
+
57
+ const _useGetGlobalAttribut = useGetGlobalAttributes(propsWithDefault, {
58
+ onClick: handleOutsideClick,
59
+ onKeyDown: handleOnKeyDown
60
+ }),
61
+ {
62
+ className
63
+ } = _useGetGlobalAttribut,
64
+ restOfGlobalAttributes = _objectWithoutProperties(_useGetGlobalAttribut, _excluded2);
65
+
59
66
  useEffect(() => {
60
67
  var _window$getComputedSt;
61
68
 
@@ -82,6 +89,7 @@ const DSDialog = props => {
82
89
 
83
90
  if (isOpen) {
84
91
  return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsx(StyledDialogBackground, {
92
+ className: className,
85
93
  onClick: handleOutsideClick,
86
94
  "data-portalbg": true,
87
95
  "data-testid": DSDialogDatatestid.BACKGROUND,
@@ -97,8 +105,7 @@ const DSDialog = props => {
97
105
  size: size,
98
106
  centered: centered,
99
107
  "data-testid": DSDialogDatatestid.CONTAINER
100
- }, globalAttributes), {}, {
101
- onKeyDown: handleOnKeyDown,
108
+ }, restOfGlobalAttributes), {}, {
102
109
  children: children
103
110
  }))), document.getElementsByTagName('body')[0]);
104
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-dialog",
3
- "version": "2.3.0-next.6",
3
+ "version": "2.3.0-next.7",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Dialog",
6
6
  "module": "./esm/index.js",
@@ -60,8 +60,8 @@
60
60
  "build": "node ../../scripts/build/build.js"
61
61
  },
62
62
  "dependencies": {
63
- "@elliemae/ds-props-helpers": "2.3.0-next.6",
64
- "@elliemae/ds-system": "2.3.0-next.6",
63
+ "@elliemae/ds-props-helpers": "2.3.0-next.7",
64
+ "@elliemae/ds-system": "2.3.0-next.7",
65
65
  "@xstyled/styled-components": "~3.1.1",
66
66
  "react-desc": "~4.1.3"
67
67
  },