@elliemae/ds-dialog 2.2.0-alpha.4 → 3.0.0-next.2
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 +101 -83
- package/cjs/DSDialogDatatestid.js +8 -36
- package/cjs/DSDialogInternalTypes.d.js +2 -27
- package/cjs/DSDialogTypes.js +2 -27
- package/cjs/defaultProps.js +11 -38
- package/cjs/index.js +70 -47
- package/cjs/propTypes.js +31 -45
- package/cjs/styles.js +119 -148
- package/cjs/utils.js +30 -50
- package/esm/DSDialog.js +80 -45
- package/esm/DSDialogDatatestid.js +4 -7
- package/esm/DSDialogInternalTypes.d.js +1 -2
- package/esm/DSDialogTypes.js +1 -2
- package/esm/defaultProps.js +6 -8
- package/esm/index.js +46 -28
- package/esm/propTypes.js +23 -16
- package/esm/styles.js +100 -120
- package/esm/utils.js +23 -21
- package/package.json +4 -7
- package/types/DSDialog.d.ts +2166 -3
- package/types/index.d.ts +148 -1
- package/types/propTypes.d.ts +2166 -3
- package/types/styles.d.ts +13 -12
- package/cjs/DSDialog.js.map +0 -7
- package/cjs/DSDialogDatatestid.js.map +0 -7
- package/cjs/DSDialogInternalTypes.d.js.map +0 -7
- package/cjs/DSDialogTypes.js.map +0 -7
- package/cjs/defaultProps.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/DSDialog.js.map +0 -7
- package/esm/DSDialogDatatestid.js.map +0 -7
- package/esm/DSDialogInternalTypes.d.js.map +0 -7
- package/esm/DSDialogTypes.js.map +0 -7
- package/esm/defaultProps.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styles.js.map +0 -7
- package/esm/utils.js.map +0 -7
package/cjs/DSDialog.js
CHANGED
|
@@ -1,94 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
+
var ReactDOM = require('react-dom');
|
|
15
|
+
var react = require('react');
|
|
16
|
+
var reactDesc = require('react-desc');
|
|
17
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
18
|
+
var styles = require('./styles.js');
|
|
19
|
+
var propTypes = require('./propTypes.js');
|
|
20
|
+
var defaultProps = require('./defaultProps.js');
|
|
21
|
+
var utils = require('./utils.js');
|
|
22
|
+
var DSDialogDatatestid = require('./DSDialogDatatestid.js');
|
|
23
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
24
|
+
|
|
25
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
|
+
|
|
27
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
28
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
29
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
30
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
31
|
+
|
|
32
|
+
const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus", "zIndex"];
|
|
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; }
|
|
35
|
+
|
|
36
|
+
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__default["default"](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; }
|
|
37
|
+
|
|
38
|
+
const DSDialog = props => {
|
|
39
|
+
var _FixedBody;
|
|
40
|
+
|
|
41
|
+
const propsWithDefault = dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps.defaultProps);
|
|
42
|
+
const [isBodyOverflow, setIsBodyOverflow] = react.useState(false);
|
|
43
|
+
dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefault, propTypes.propTypes);
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
children,
|
|
47
|
+
isOpen,
|
|
48
|
+
onClickOutside,
|
|
49
|
+
centered,
|
|
50
|
+
size,
|
|
51
|
+
removeAutoFocus,
|
|
52
|
+
zIndex
|
|
53
|
+
} = propsWithDefault,
|
|
54
|
+
rest = _objectWithoutProperties__default["default"](propsWithDefault, _excluded);
|
|
55
|
+
|
|
56
|
+
const containerRef = react.useRef(null);
|
|
57
|
+
const handleOutsideClick = react.useCallback(e => {
|
|
58
|
+
if (e.target.dataset.portalbg) onClickOutside();
|
|
52
59
|
}, [onClickOutside]);
|
|
53
|
-
const handleOnKeyDown =
|
|
54
|
-
if (e.key ===
|
|
55
|
-
onClickOutside();
|
|
60
|
+
const handleOnKeyDown = react.useCallback(e => {
|
|
61
|
+
if (e.key === 'Escape') onClickOutside();
|
|
56
62
|
}, [onClickOutside]);
|
|
57
|
-
|
|
58
|
-
const body = document.getElementsByTagName(
|
|
59
|
-
const {
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
react.useEffect(() => {
|
|
64
|
+
const body = document.getElementsByTagName('body')[0];
|
|
65
|
+
const {
|
|
66
|
+
offsetHeight,
|
|
67
|
+
scrollHeight
|
|
68
|
+
} = body;
|
|
69
|
+
if (!isOpen) return setIsBodyOverflow(false);
|
|
62
70
|
return setIsBodyOverflow(offsetHeight < scrollHeight);
|
|
63
71
|
}, [isOpen]);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
react.useEffect(() => {
|
|
73
|
+
var _containerRef$current;
|
|
74
|
+
|
|
75
|
+
if (isOpen && !removeAutoFocus) containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.focus();
|
|
67
76
|
}, [isOpen, removeAutoFocus]);
|
|
77
|
+
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefault, {
|
|
78
|
+
onClick: handleOutsideClick
|
|
79
|
+
});
|
|
80
|
+
|
|
68
81
|
if (isOpen) {
|
|
69
|
-
return
|
|
82
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/jsxRuntime.jsxs(styles.StyledDialogBackground, _objectSpread(_objectSpread({
|
|
70
83
|
onClick: handleOutsideClick,
|
|
71
84
|
"data-portalbg": true,
|
|
72
|
-
"data-testid":
|
|
73
|
-
zIndex
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
"data-testid": DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
86
|
+
zIndex: zIndex
|
|
87
|
+
}, globalAttributes), {}, {
|
|
88
|
+
children: [_FixedBody || (_FixedBody = /*#__PURE__*/_jsx__default["default"](styles.FixedBody, {
|
|
89
|
+
isBodyOverflow: isBodyOverflow
|
|
90
|
+
})), /*#__PURE__*/jsxRuntime.jsx(styles.StyledDialogContainer, _objectSpread(_objectSpread({
|
|
91
|
+
role: "dialog",
|
|
92
|
+
"aria-modal": true,
|
|
93
|
+
ref: containerRef,
|
|
94
|
+
tabIndex: !removeAutoFocus ? 0 : undefined,
|
|
95
|
+
onKeyDown: handleOnKeyDown
|
|
96
|
+
}, utils.getSpaceProps(rest)), {}, {
|
|
97
|
+
size: size,
|
|
98
|
+
centered: centered,
|
|
99
|
+
"data-testid": DSDialogDatatestid.DSDialogDatatestid.CONTAINER,
|
|
100
|
+
children: children
|
|
101
|
+
}))]
|
|
102
|
+
})), document.getElementsByTagName('body')[0]);
|
|
87
103
|
}
|
|
104
|
+
|
|
88
105
|
return null;
|
|
89
106
|
};
|
|
90
|
-
|
|
91
|
-
const DSDialogWithSchema =
|
|
92
|
-
DSDialogWithSchema.propTypes =
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
|
|
108
|
+
const DSDialogWithSchema = reactDesc.describe(DSDialog);
|
|
109
|
+
DSDialogWithSchema.propTypes = propTypes.propTypes;
|
|
110
|
+
|
|
111
|
+
exports.DSDialog = DSDialog;
|
|
112
|
+
exports.DSDialogWithSchema = DSDialogWithSchema;
|
|
@@ -1,38 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var DSDialogDatatestid_exports = {};
|
|
29
|
-
__export(DSDialogDatatestid_exports, {
|
|
30
|
-
DSDialogDatatestid: () => DSDialogDatatestid
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
33
5
|
const DSDialogDatatestid = {
|
|
34
|
-
CONTAINER:
|
|
35
|
-
BACKGROUND:
|
|
6
|
+
CONTAINER: 'ds-dialog-container',
|
|
7
|
+
BACKGROUND: 'ds-dialog-background'
|
|
36
8
|
};
|
|
37
|
-
|
|
38
|
-
|
|
9
|
+
|
|
10
|
+
exports.DSDialogDatatestid = DSDialogDatatestid;
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var DSDialogInternalTypes_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(DSDialogInternalTypes_d_exports);
|
|
27
|
-
//# sourceMappingURL=DSDialogInternalTypes.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/DSDialogTypes.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var DSDialogTypes_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(DSDialogTypes_exports);
|
|
27
|
-
//# sourceMappingURL=DSDialogTypes.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/defaultProps.js
CHANGED
|
@@ -1,45 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var defaultProps_exports = {};
|
|
29
|
-
__export(defaultProps_exports, {
|
|
30
|
-
defaultProps: () => defaultProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_utils = require("./utils");
|
|
34
|
-
const noop = () => {
|
|
35
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils = require('./utils.js');
|
|
6
|
+
|
|
7
|
+
const noop = () => {};
|
|
8
|
+
|
|
36
9
|
const defaultProps = {
|
|
37
10
|
isOpen: false,
|
|
38
11
|
centered: false,
|
|
39
|
-
size:
|
|
12
|
+
size: utils.DSDialogSizes.DEFAULT,
|
|
40
13
|
removeAutoFocus: false,
|
|
41
14
|
onClickOutside: noop,
|
|
42
15
|
zIndex: 10
|
|
43
16
|
};
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
|
|
18
|
+
exports.defaultProps = defaultProps;
|
package/cjs/index.js
CHANGED
|
@@ -1,47 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
7
|
+
var styles = require('./styles.js');
|
|
8
|
+
var DSDialog = require('./DSDialog.js');
|
|
9
|
+
var DSDialogDatatestid = require('./DSDialogDatatestid.js');
|
|
10
|
+
var utils = require('./utils.js');
|
|
11
|
+
|
|
12
|
+
styles.DSDialogBody.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
13
|
+
styles.DSDialogHeader.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
14
|
+
styles.DSDialogFooter.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
15
|
+
styles.DSDialogSeparator.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
16
|
+
styles.DSDialogTitle.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
17
|
+
styles.DSDialogAddon.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
18
|
+
styles.DSDialogDefaultLayout.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
19
|
+
styles.DSDialogPrimaryMessage.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
20
|
+
styles.DSDialogSecondaryMessage.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
21
|
+
styles.DSDialogBody.displayName = 'DSDialogBody';
|
|
22
|
+
styles.DSDialogHeader.displayName = 'DSDialogHeader';
|
|
23
|
+
styles.DSDialogFooter.displayName = 'DSDialogFooter';
|
|
24
|
+
styles.DSDialogSeparator.displayName = 'DSDialogSeparator';
|
|
25
|
+
styles.DSDialogTitle.displayName = 'DSDialogTitle';
|
|
26
|
+
styles.DSDialogAddon.displayName = 'DSDialogAddon';
|
|
27
|
+
styles.DSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';
|
|
28
|
+
styles.DSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';
|
|
29
|
+
styles.DSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';
|
|
30
|
+
const DSDialogBodyWithSchema = reactDesc.describe(styles.DSDialogBody);
|
|
31
|
+
const DSDialogHeaderWithSchema = reactDesc.describe(styles.DSDialogHeader);
|
|
32
|
+
const DSDialogFooterWithSchema = reactDesc.describe(styles.DSDialogFooter);
|
|
33
|
+
const DSDialogSeparatorWithSchema = reactDesc.describe(styles.DSDialogSeparator);
|
|
34
|
+
const DSDialogTitleWithSchema = reactDesc.describe(styles.DSDialogTitle);
|
|
35
|
+
const DSDialogAddonWithSchema = reactDesc.describe(styles.DSDialogAddon);
|
|
36
|
+
const DSDialogDefaultLayoutWithSchema = reactDesc.describe(styles.DSDialogDefaultLayout);
|
|
37
|
+
const DSDialogPrimaryMessageWithSchema = reactDesc.describe(styles.DSDialogPrimaryMessage);
|
|
38
|
+
const DSDialogSecondaryMessageWithSchema = reactDesc.describe(styles.DSDialogSecondaryMessage);
|
|
39
|
+
DSDialogBodyWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
40
|
+
DSDialogHeaderWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
41
|
+
DSDialogFooterWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
42
|
+
DSDialogSeparatorWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
43
|
+
DSDialogTitleWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
44
|
+
DSDialogAddonWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
45
|
+
DSDialogDefaultLayoutWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
46
|
+
DSDialogPrimaryMessageWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
47
|
+
DSDialogSecondaryMessageWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
48
|
+
|
|
49
|
+
exports.DSDialogAddon = styles.DSDialogAddon;
|
|
50
|
+
exports.DSDialogBody = styles.DSDialogBody;
|
|
51
|
+
exports.DSDialogDefaultLayout = styles.DSDialogDefaultLayout;
|
|
52
|
+
exports.DSDialogFooter = styles.DSDialogFooter;
|
|
53
|
+
exports.DSDialogHeader = styles.DSDialogHeader;
|
|
54
|
+
exports.DSDialogPrimaryMessage = styles.DSDialogPrimaryMessage;
|
|
55
|
+
exports.DSDialogSecondaryMessage = styles.DSDialogSecondaryMessage;
|
|
56
|
+
exports.DSDialogSeparator = styles.DSDialogSeparator;
|
|
57
|
+
exports.DSDialogTitle = styles.DSDialogTitle;
|
|
58
|
+
exports.DSDialog = DSDialog.DSDialog;
|
|
59
|
+
exports.DSDialogWithSchema = DSDialog.DSDialogWithSchema;
|
|
60
|
+
exports.DSDialogDatatestid = DSDialogDatatestid.DSDialogDatatestid;
|
|
61
|
+
exports.DSDialogSizes = utils.DSDialogSizes;
|
|
62
|
+
exports.DSDialogAddonWithSchema = DSDialogAddonWithSchema;
|
|
63
|
+
exports.DSDialogBodyWithSchema = DSDialogBodyWithSchema;
|
|
64
|
+
exports.DSDialogDefaultLayoutWithSchema = DSDialogDefaultLayoutWithSchema;
|
|
65
|
+
exports.DSDialogFooterWithSchema = DSDialogFooterWithSchema;
|
|
66
|
+
exports.DSDialogHeaderWithSchema = DSDialogHeaderWithSchema;
|
|
67
|
+
exports.DSDialogPrimaryMessageWithSchema = DSDialogPrimaryMessageWithSchema;
|
|
68
|
+
exports.DSDialogSecondaryMessageWithSchema = DSDialogSecondaryMessageWithSchema;
|
|
69
|
+
exports.DSDialogSeparatorWithSchema = DSDialogSeparatorWithSchema;
|
|
70
|
+
exports.DSDialogTitleWithSchema = DSDialogTitleWithSchema;
|
package/cjs/propTypes.js
CHANGED
|
@@ -1,45 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react_desc = require("react-desc");
|
|
34
|
-
var import_utils = require("./utils");
|
|
35
|
-
const propTypes = {
|
|
36
|
-
isOpen: import_react_desc.PropTypes.bool.description("Wether the Dialog is open or not.").defaultValue(false),
|
|
37
|
-
children: import_react_desc.PropTypes.node.description("Nested components.").isRequired,
|
|
38
|
-
centered: import_react_desc.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
39
|
-
size: import_react_desc.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT),
|
|
40
|
-
removeAutoFocus: import_react_desc.PropTypes.bool.description("Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.").defaultValue(false),
|
|
41
|
-
onClickOutside: import_react_desc.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.").defaultValue(() => {
|
|
42
|
-
})
|
|
43
|
-
};
|
|
44
|
-
module.exports = __toCommonJS(propTypes_exports);
|
|
45
|
-
//# sourceMappingURL=propTypes.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var reactDesc = require('react-desc');
|
|
12
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
13
|
+
var utils = require('./utils.js');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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__default["default"](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; }
|
|
22
|
+
const propTypes = _objectSpread({
|
|
23
|
+
isOpen: reactDesc.PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),
|
|
24
|
+
children: reactDesc.PropTypes.node.description('Nested components.').isRequired,
|
|
25
|
+
centered: reactDesc.PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
|
|
26
|
+
size: reactDesc.PropTypes.oneOf(utils.DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(utils.DSDialogSizes.DEFAULT),
|
|
27
|
+
removeAutoFocus: reactDesc.PropTypes.bool.description('Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.').defaultValue(false),
|
|
28
|
+
onClickOutside: reactDesc.PropTypes.func.description('Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.').defaultValue(() => {})
|
|
29
|
+
}, dsPropsHelpers.globalAttributesPropTypes);
|
|
30
|
+
|
|
31
|
+
exports.propTypes = propTypes;
|