@mmb-digital/ds-lilly 0.10.57 → 0.10.59
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/dist/ds-lilly.js
CHANGED
|
@@ -105998,16 +105998,11 @@ var Modal = function (_a) {
|
|
|
105998
105998
|
|
|
105999
105999
|
|
|
106000
106000
|
var focusableModalElementsSelector = 'a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select';
|
|
106001
|
-
|
|
106002
|
-
|
|
106003
|
-
* @param onHide Custom functions to be called together with internal handle hide
|
|
106004
|
-
* @param onShow Custom functions to be called together with internal handle show
|
|
106005
|
-
*/
|
|
106006
|
-
var useModal = function (disableCloseByOutsideClick, onHide, onShow) {
|
|
106007
|
-
if (disableCloseByOutsideClick === void 0) { disableCloseByOutsideClick = false; }
|
|
106001
|
+
var useModal = function (_a) {
|
|
106002
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.disableCloseByEscape, disableCloseByEscape = _c === void 0 ? false : _c, _d = _b.disableCloseByOutsideClick, disableCloseByOutsideClick = _d === void 0 ? false : _d, onHide = _b.onHide, onShow = _b.onShow;
|
|
106008
106003
|
var identification = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return "modal_" + cuid_default()(); }, []);
|
|
106009
|
-
var
|
|
106010
|
-
var
|
|
106004
|
+
var _e = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isVisible = _e[0], setIsVisible = _e[1];
|
|
106005
|
+
var _f = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isFocused = _f[0], setIsFocused = _f[1];
|
|
106011
106006
|
var reference = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["createRef"])();
|
|
106012
106007
|
var handleHideWithCallbacks = function () {
|
|
106013
106008
|
onHide && onHide();
|
|
@@ -106056,7 +106051,7 @@ var useModal = function (disableCloseByOutsideClick, onHide, onShow) {
|
|
|
106056
106051
|
}
|
|
106057
106052
|
};
|
|
106058
106053
|
var handleEscKey = function () {
|
|
106059
|
-
!
|
|
106054
|
+
!disableCloseByEscape && handleHideWithCallbacks();
|
|
106060
106055
|
};
|
|
106061
106056
|
var keyListenersMap = new Map([
|
|
106062
106057
|
[KEYS.Escape, handleEscKey],
|
|
@@ -12,10 +12,16 @@ export interface ModalHookType {
|
|
|
12
12
|
/** Internal props thats need to pe passed to <Modal> component. */
|
|
13
13
|
modalProps: ModalContextType;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
interface UseModalPropsType {
|
|
16
|
+
/** Disable closing dialog by clicks outside popUp. */
|
|
17
|
+
disableCloseByOutsideClick?: boolean;
|
|
18
|
+
/** Disable closing dialog by ESC key. */
|
|
19
|
+
disableCloseByEscape?: boolean;
|
|
20
|
+
/** Custom functions to be called together with internal handle hide */
|
|
21
|
+
onHide?: () => void;
|
|
22
|
+
/** Custom functions to be called together with internal handle show */
|
|
23
|
+
onShow?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useModal: ({ disableCloseByEscape, disableCloseByOutsideClick, onHide, onShow }?: UseModalPropsType) => ModalHookType;
|
|
26
|
+
export {};
|
|
21
27
|
//# sourceMappingURL=Modal.hook.d.ts.map
|