@xaypay/tui 0.2.4 → 0.2.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/dist/index.es.js +19 -11
- package/dist/index.js +19 -11
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import styled, { keyframes, css } from 'styled-components';
|
|
7
|
-
import ReactDOM from 'react-dom';
|
|
7
|
+
import ReactDOM from 'react-dom/client';
|
|
8
8
|
|
|
9
9
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
10
10
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -5268,17 +5268,22 @@ Toast.propTypes = {
|
|
|
5268
5268
|
type: PropTypes.oneOf(Object.values(ToasterType)).isRequired
|
|
5269
5269
|
};
|
|
5270
5270
|
|
|
5271
|
-
let toastify;
|
|
5271
|
+
let toastify = document.getElementById('toastify');
|
|
5272
5272
|
let path = window.location.href;
|
|
5273
5273
|
let wWidth = window.innerWidth;
|
|
5274
5274
|
const removeToast = ref => {
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5275
|
+
if (ref.current) {
|
|
5276
|
+
const node = ref.current;
|
|
5277
|
+
const removeElem = node.parentNode;
|
|
5278
|
+
const parent = removeElem.parentNode;
|
|
5279
|
+
if (parent && parent.contains(removeElem)) {
|
|
5280
|
+
parent.removeChild(removeElem);
|
|
5281
|
+
}
|
|
5282
|
+
if (!parent.hasChildNodes()) {
|
|
5283
|
+
if (toastify && toastify.contains(parent)) {
|
|
5284
|
+
toastify.removeChild(parent);
|
|
5285
|
+
}
|
|
5286
|
+
}
|
|
5282
5287
|
}
|
|
5283
5288
|
};
|
|
5284
5289
|
const createToast = ({
|
|
@@ -5292,7 +5297,9 @@ const createToast = ({
|
|
|
5292
5297
|
}) => {
|
|
5293
5298
|
let toastParentBlock;
|
|
5294
5299
|
if (!toastify) {
|
|
5295
|
-
toastify = document.
|
|
5300
|
+
toastify = document.createElement('div');
|
|
5301
|
+
toastify.setAttribute('id', 'toastify');
|
|
5302
|
+
document.body.appendChild(toastify);
|
|
5296
5303
|
}
|
|
5297
5304
|
const toastBlock = document.createElement('div');
|
|
5298
5305
|
toastBlock.style.position = 'relative';
|
|
@@ -5403,7 +5410,8 @@ const Toaster = ({
|
|
|
5403
5410
|
window.addEventListener('popstate', () => {
|
|
5404
5411
|
if (path !== window.location.href) {
|
|
5405
5412
|
if (!toastify) {
|
|
5406
|
-
toastify = document.
|
|
5413
|
+
toastify = document.createElement('div');
|
|
5414
|
+
toastify.setAttribute('id', 'toastify');
|
|
5407
5415
|
}
|
|
5408
5416
|
if (toastify.hasChildNodes()) {
|
|
5409
5417
|
toastify.innerHTML = '';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var PropTypes = require('prop-types');
|
|
|
7
7
|
var classnames = require('classnames');
|
|
8
8
|
var _ = require('lodash');
|
|
9
9
|
var styled = require('styled-components');
|
|
10
|
-
var ReactDOM = require('react-dom');
|
|
10
|
+
var ReactDOM = require('react-dom/client');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
@@ -5299,17 +5299,22 @@ Toast.propTypes = {
|
|
|
5299
5299
|
type: PropTypes__default["default"].oneOf(Object.values(ToasterType)).isRequired
|
|
5300
5300
|
};
|
|
5301
5301
|
|
|
5302
|
-
let toastify;
|
|
5302
|
+
let toastify = document.getElementById('toastify');
|
|
5303
5303
|
let path = window.location.href;
|
|
5304
5304
|
let wWidth = window.innerWidth;
|
|
5305
5305
|
const removeToast = ref => {
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5306
|
+
if (ref.current) {
|
|
5307
|
+
const node = ref.current;
|
|
5308
|
+
const removeElem = node.parentNode;
|
|
5309
|
+
const parent = removeElem.parentNode;
|
|
5310
|
+
if (parent && parent.contains(removeElem)) {
|
|
5311
|
+
parent.removeChild(removeElem);
|
|
5312
|
+
}
|
|
5313
|
+
if (!parent.hasChildNodes()) {
|
|
5314
|
+
if (toastify && toastify.contains(parent)) {
|
|
5315
|
+
toastify.removeChild(parent);
|
|
5316
|
+
}
|
|
5317
|
+
}
|
|
5313
5318
|
}
|
|
5314
5319
|
};
|
|
5315
5320
|
const createToast = ({
|
|
@@ -5323,7 +5328,9 @@ const createToast = ({
|
|
|
5323
5328
|
}) => {
|
|
5324
5329
|
let toastParentBlock;
|
|
5325
5330
|
if (!toastify) {
|
|
5326
|
-
toastify = document.
|
|
5331
|
+
toastify = document.createElement('div');
|
|
5332
|
+
toastify.setAttribute('id', 'toastify');
|
|
5333
|
+
document.body.appendChild(toastify);
|
|
5327
5334
|
}
|
|
5328
5335
|
const toastBlock = document.createElement('div');
|
|
5329
5336
|
toastBlock.style.position = 'relative';
|
|
@@ -5434,7 +5441,8 @@ const Toaster = ({
|
|
|
5434
5441
|
window.addEventListener('popstate', () => {
|
|
5435
5442
|
if (path !== window.location.href) {
|
|
5436
5443
|
if (!toastify) {
|
|
5437
|
-
toastify = document.
|
|
5444
|
+
toastify = document.createElement('div');
|
|
5445
|
+
toastify.setAttribute('id', 'toastify');
|
|
5438
5446
|
}
|
|
5439
5447
|
if (toastify.hasChildNodes()) {
|
|
5440
5448
|
toastify.innerHTML = '';
|