@sb1/ffe-modals-react 0.4.4 → 0.4.6
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/es/Modal.js +0 -8
- package/lib/Modal.js +0 -8
- package/package.json +3 -4
package/es/Modal.js
CHANGED
|
@@ -24,7 +24,6 @@ import React, { useEffect, useImperativeHandle, useState, useRef } from 'react';
|
|
|
24
24
|
import { createPortal } from 'react-dom';
|
|
25
25
|
import classnames from 'classnames';
|
|
26
26
|
import { CloseButton } from './CloseButton';
|
|
27
|
-
import dialogPolyfill from 'dialog-polyfill';
|
|
28
27
|
export var Modal = React.forwardRef(function (_a, ref) {
|
|
29
28
|
var children = _a.children, onClick = _a.onClick, ariaLabelledby = _a.ariaLabelledby, className = _a.className, _b = _a.locale, locale = _b === void 0 ? 'nb' : _b, onClose = _a.onClose, _c = _a.portalContainer, portalContainer = _c === void 0 ? document.body : _c, rest = __rest(_a, ["children", "onClick", "ariaLabelledby", "className", "locale", "onClose", "portalContainer"]);
|
|
30
29
|
var _d = useState(false), isOpen = _d[0], setIsOpen = _d[1];
|
|
@@ -55,13 +54,6 @@ export var Modal = React.forwardRef(function (_a, ref) {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
}, [isOpen]);
|
|
58
|
-
useEffect(function () {
|
|
59
|
-
if (typeof window !== 'undefined' && // to support Gatsby build(server side rendering)
|
|
60
|
-
dialogRef.current &&
|
|
61
|
-
typeof dialogRef.current.showModal !== 'function') {
|
|
62
|
-
dialogPolyfill.registerDialog(dialogRef.current);
|
|
63
|
-
}
|
|
64
|
-
}, []);
|
|
65
57
|
return createPortal(
|
|
66
58
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
67
59
|
React.createElement("dialog", __assign({}, rest, { ref: dialogRef, className: classnames('ffe-modal', className), "aria-labelledby": ariaLabelledby, onClick: function (event) {
|
package/lib/Modal.js
CHANGED
|
@@ -53,7 +53,6 @@ var react_1 = __importStar(require("react"));
|
|
|
53
53
|
var react_dom_1 = require("react-dom");
|
|
54
54
|
var classnames_1 = __importDefault(require("classnames"));
|
|
55
55
|
var CloseButton_1 = require("./CloseButton");
|
|
56
|
-
var dialog_polyfill_1 = __importDefault(require("dialog-polyfill"));
|
|
57
56
|
exports.Modal = react_1.default.forwardRef(function (_a, ref) {
|
|
58
57
|
var children = _a.children, onClick = _a.onClick, ariaLabelledby = _a.ariaLabelledby, className = _a.className, _b = _a.locale, locale = _b === void 0 ? 'nb' : _b, onClose = _a.onClose, _c = _a.portalContainer, portalContainer = _c === void 0 ? document.body : _c, rest = __rest(_a, ["children", "onClick", "ariaLabelledby", "className", "locale", "onClose", "portalContainer"]);
|
|
59
58
|
var _d = (0, react_1.useState)(false), isOpen = _d[0], setIsOpen = _d[1];
|
|
@@ -84,13 +83,6 @@ exports.Modal = react_1.default.forwardRef(function (_a, ref) {
|
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
}, [isOpen]);
|
|
87
|
-
(0, react_1.useEffect)(function () {
|
|
88
|
-
if (typeof window !== 'undefined' && // to support Gatsby build(server side rendering)
|
|
89
|
-
dialogRef.current &&
|
|
90
|
-
typeof dialogRef.current.showModal !== 'function') {
|
|
91
|
-
dialog_polyfill_1.default.registerDialog(dialogRef.current);
|
|
92
|
-
}
|
|
93
|
-
}, []);
|
|
94
86
|
return (0, react_dom_1.createPortal)(
|
|
95
87
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
96
88
|
react_1.default.createElement("dialog", __assign({}, rest, { ref: dialogRef, className: (0, classnames_1.default)('ffe-modal', className), "aria-labelledby": ariaLabelledby, onClick: function (event) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-modals-react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "SpareBank 1",
|
|
6
6
|
"files": [
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@sb1/ffe-icons-react": "^11.0.1",
|
|
29
|
-
"@sb1/ffe-modals": "^0.2.7"
|
|
30
|
-
"dialog-polyfill": "^0.5.6"
|
|
29
|
+
"@sb1/ffe-modals": "^0.2.7"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@sb1/ffe-buildtool": "^0.7.0",
|
|
@@ -41,5 +40,5 @@
|
|
|
41
40
|
"publishConfig": {
|
|
42
41
|
"access": "public"
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "d6ca4caf17fc1c3b897bb0f6f967902ae35fdc41"
|
|
45
44
|
}
|