aio-popup 6.0.0 → 6.0.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.css +2 -3
- package/index.d.ts +3 -2
- package/index.js +5 -6
- package/package.json +1 -1
package/index.css
CHANGED
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
overflow-y: auto;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
.aio-popup-alert-
|
|
356
|
+
.aio-popup-alert-title {
|
|
357
357
|
display: flex;
|
|
358
358
|
align-items: center;
|
|
359
359
|
justify-content: center;
|
|
@@ -362,9 +362,8 @@
|
|
|
362
362
|
margin-bottom: 12px;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
.aio-popup-alert-
|
|
365
|
+
.aio-popup-alert-text {
|
|
366
366
|
font-size: 12px;
|
|
367
|
-
|
|
368
367
|
}
|
|
369
368
|
|
|
370
369
|
.aio-popup-alert-footer {
|
package/index.d.ts
CHANGED
|
@@ -33,10 +33,11 @@ export type AP_modal = {
|
|
|
33
33
|
setAttrs?: AP_setAttrs;
|
|
34
34
|
};
|
|
35
35
|
export type AP_alert = {
|
|
36
|
+
align?: 'left' | 'right' | 'center';
|
|
36
37
|
icon?: false | ReactNode;
|
|
37
38
|
type: 'success' | 'error' | 'warning' | 'info';
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
title?: ReactNode;
|
|
40
|
+
text: string;
|
|
40
41
|
time?: number;
|
|
41
42
|
className?: string;
|
|
42
43
|
closeText?: string;
|
package/index.js
CHANGED
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
12
11
|
import { createRef, useEffect, useState, createContext, useContext, useRef } from 'react';
|
|
13
12
|
import * as ReactDOMServer from 'react-dom/server';
|
|
14
13
|
import ReactDOM from 'react-dom';
|
|
@@ -216,7 +215,7 @@ const usePopup = (props) => {
|
|
|
216
215
|
}
|
|
217
216
|
promptTexts.current = newPromptTexts;
|
|
218
217
|
}
|
|
219
|
-
}),
|
|
218
|
+
}), children: submitText })] }))
|
|
220
219
|
};
|
|
221
220
|
addModal(config);
|
|
222
221
|
};
|
|
@@ -517,7 +516,7 @@ const SnackebarBar = () => {
|
|
|
517
516
|
return _jsx("div", { className: 'aio-popup-snackebar-bar', style: { transition: `${item.time || 8}s linear` } });
|
|
518
517
|
};
|
|
519
518
|
export function Alert(props) {
|
|
520
|
-
let { icon, type = '',
|
|
519
|
+
let { icon, type = '', title = '', text = '', time = 10, className, closeText = 'Close', onClose, align = 'left' } = props;
|
|
521
520
|
let $$ = {
|
|
522
521
|
id: '',
|
|
523
522
|
time: 0,
|
|
@@ -536,8 +535,8 @@ export function Alert(props) {
|
|
|
536
535
|
<div class='aio-popup-alert aio-popup-alert-${type}'>
|
|
537
536
|
<div class='aio-popup-alert-header'>${$$.getIcon()}</div>
|
|
538
537
|
<div class='aio-popup-alert-body aio-popup-scroll'>
|
|
539
|
-
<div class='aio-popup-alert-
|
|
540
|
-
<div class='aio-popup-alert-
|
|
538
|
+
<div class='aio-popup-alert-title'>${ReactDOMServer.renderToStaticMarkup(title)}</div>
|
|
539
|
+
<div class='aio-popup-alert-text' style="text-align:${align}">${text}</div>
|
|
541
540
|
</div>
|
|
542
541
|
<div class='aio-popup-alert-footer'>
|
|
543
542
|
<button class='aio-popup-alert-close ${$$.id}'>${closeText}</button>
|
|
@@ -800,4 +799,4 @@ export class Loading {
|
|
|
800
799
|
this.loader = loader;
|
|
801
800
|
}
|
|
802
801
|
}
|
|
803
|
-
}
|
|
802
|
+
}
|