aio-popup 6.6.1 → 6.6.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/index.d.ts +6 -5
- package/index.js +3 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import './index.css';
|
|
3
3
|
export type AP_position = 'fullscreen' | 'center' | 'popover' | 'left' | 'right' | 'top' | 'bottom';
|
|
4
4
|
export type AP_attrsKey = 'backdrop' | 'modal' | 'header' | 'body' | 'footer';
|
|
5
|
-
export type AP_header =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export type AP_header = {
|
|
6
|
+
html?: ((p: {
|
|
7
|
+
removeModal: () => void;
|
|
8
|
+
state: any;
|
|
9
|
+
setState: any;
|
|
10
|
+
}) => ReactNode);
|
|
10
11
|
title?: string;
|
|
11
12
|
subtitle?: string;
|
|
12
13
|
before?: ReactNode;
|
package/index.js
CHANGED
|
@@ -388,8 +388,8 @@ const ModalHeader = () => {
|
|
|
388
388
|
}
|
|
389
389
|
let { setAttrs = () => { return {}; } } = modal;
|
|
390
390
|
let attrs = setAttrs('header') || {};
|
|
391
|
-
if (
|
|
392
|
-
return modal.header({ removeModal: removeModal, state, setState });
|
|
391
|
+
if (modal.header && modal.header.html) {
|
|
392
|
+
return modal.header.html({ removeModal: removeModal, state, setState });
|
|
393
393
|
}
|
|
394
394
|
if (typeof modal.header !== 'object') {
|
|
395
395
|
return null;
|
|
@@ -418,7 +418,7 @@ const ModalClose = () => {
|
|
|
418
418
|
return _jsx("div", { className: `aio-popup-header-close`, onClick: (e) => {
|
|
419
419
|
e.stopPropagation();
|
|
420
420
|
e.preventDefault();
|
|
421
|
-
if (typeof header.onClose === 'function') {
|
|
421
|
+
if (header && typeof header.onClose === 'function') {
|
|
422
422
|
header.onClose({ state, setState });
|
|
423
423
|
}
|
|
424
424
|
else {
|