funda-ui 1.0.272
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/BackToTop/index.css +34 -0
- package/BackToTop/index.d.ts +11 -0
- package/BackToTop/index.js +458 -0
- package/CascadingSelect/index.css +159 -0
- package/CascadingSelect/index.d.ts +56 -0
- package/CascadingSelect/index.js +958 -0
- package/CascadingSelectE2E/index.css +159 -0
- package/CascadingSelectE2E/index.d.ts +60 -0
- package/CascadingSelectE2E/index.js +1126 -0
- package/Checkbox/index.d.ts +30 -0
- package/Checkbox/index.js +226 -0
- package/ColorPicker/index.css +38 -0
- package/ColorPicker/index.d.ts +27 -0
- package/ColorPicker/index.js +246 -0
- package/DigitalClock/index.d.ts +7 -0
- package/DigitalClock/index.js +208 -0
- package/DropdownMenu/index.css +127 -0
- package/DropdownMenu/index.d.ts +37 -0
- package/DropdownMenu/index.js +237 -0
- package/DynamicFields/index.d.ts +26 -0
- package/DynamicFields/index.js +412 -0
- package/File/index.d.ts +36 -0
- package/File/index.js +473 -0
- package/Input/index.d.ts +42 -0
- package/Input/index.js +286 -0
- package/LiveSearch/index.d.ts +37 -0
- package/LiveSearch/index.js +1195 -0
- package/ModalDialog/index.d.ts +60 -0
- package/ModalDialog/index.js +725 -0
- package/ModeSwitch/index.d.ts +17 -0
- package/ModeSwitch/index.js +202 -0
- package/MultiFuncSelect/index.css +178 -0
- package/MultiFuncSelect/index.d.ts +67 -0
- package/MultiFuncSelect/index.js +1826 -0
- package/MultilevelDropdownMenu/index.css +35 -0
- package/MultilevelDropdownMenu/index.d.ts +25 -0
- package/MultilevelDropdownMenu/index.js +464 -0
- package/Pagination/index.d.ts +49 -0
- package/Pagination/index.js +341 -0
- package/README.md +108 -0
- package/Radio/index.d.ts +31 -0
- package/Radio/index.js +246 -0
- package/RangeSlider/index.css +149 -0
- package/RangeSlider/index.d.ts +21 -0
- package/RangeSlider/index.js +730 -0
- package/ScrollReveal/index.css +23 -0
- package/ScrollReveal/index.d.ts +21 -0
- package/ScrollReveal/index.js +216 -0
- package/Scrollbar/index.css +168 -0
- package/Scrollbar/index.d.ts +15 -0
- package/Scrollbar/index.js +605 -0
- package/SearchBar/index.d.ts +32 -0
- package/SearchBar/index.js +246 -0
- package/Select/index.d.ts +34 -0
- package/Select/index.js +331 -0
- package/ShowMoreLess/index.css +23 -0
- package/ShowMoreLess/index.d.ts +30 -0
- package/ShowMoreLess/index.js +202 -0
- package/Switch/index.d.ts +29 -0
- package/Switch/index.js +211 -0
- package/Table/index.css +533 -0
- package/Table/index.d.ts +25 -0
- package/Table/index.js +2113 -0
- package/Tabs/index.d.ts +3 -0
- package/Tabs/index.js +323 -0
- package/TagInput/index.css +90 -0
- package/TagInput/index.d.ts +28 -0
- package/TagInput/index.js +370 -0
- package/Textarea/index.d.ts +30 -0
- package/Textarea/index.js +242 -0
- package/Toast/index.css +95 -0
- package/Toast/index.d.ts +35 -0
- package/Toast/index.js +340 -0
- package/Tooltip/index.css +240 -0
- package/Tooltip/index.d.ts +19 -0
- package/Tooltip/index.js +200 -0
- package/Tree/index.css +225 -0
- package/Tree/index.d.ts +37 -0
- package/Tree/index.js +1406 -0
- package/all.d.ts +33 -0
- package/all.js +35 -0
- package/lib/cjs/BackToTop/index.d.ts +11 -0
- package/lib/cjs/BackToTop/index.js +458 -0
- package/lib/cjs/CascadingSelect/index.d.ts +56 -0
- package/lib/cjs/CascadingSelect/index.js +958 -0
- package/lib/cjs/CascadingSelectE2E/index.d.ts +60 -0
- package/lib/cjs/CascadingSelectE2E/index.js +1126 -0
- package/lib/cjs/Checkbox/index.d.ts +30 -0
- package/lib/cjs/Checkbox/index.js +226 -0
- package/lib/cjs/ColorPicker/index.d.ts +27 -0
- package/lib/cjs/ColorPicker/index.js +246 -0
- package/lib/cjs/DigitalClock/index.d.ts +7 -0
- package/lib/cjs/DigitalClock/index.js +208 -0
- package/lib/cjs/DropdownMenu/index.d.ts +37 -0
- package/lib/cjs/DropdownMenu/index.js +237 -0
- package/lib/cjs/DynamicFields/index.d.ts +26 -0
- package/lib/cjs/DynamicFields/index.js +412 -0
- package/lib/cjs/File/index.d.ts +36 -0
- package/lib/cjs/File/index.js +473 -0
- package/lib/cjs/Input/index.d.ts +42 -0
- package/lib/cjs/Input/index.js +286 -0
- package/lib/cjs/LiveSearch/index.d.ts +37 -0
- package/lib/cjs/LiveSearch/index.js +1195 -0
- package/lib/cjs/ModalDialog/index.d.ts +60 -0
- package/lib/cjs/ModalDialog/index.js +725 -0
- package/lib/cjs/ModeSwitch/index.d.ts +17 -0
- package/lib/cjs/ModeSwitch/index.js +202 -0
- package/lib/cjs/MultiFuncSelect/index.d.ts +67 -0
- package/lib/cjs/MultiFuncSelect/index.js +1826 -0
- package/lib/cjs/MultilevelDropdownMenu/index.d.ts +25 -0
- package/lib/cjs/MultilevelDropdownMenu/index.js +464 -0
- package/lib/cjs/Pagination/index.d.ts +49 -0
- package/lib/cjs/Pagination/index.js +341 -0
- package/lib/cjs/Radio/index.d.ts +31 -0
- package/lib/cjs/Radio/index.js +246 -0
- package/lib/cjs/RangeSlider/index.d.ts +21 -0
- package/lib/cjs/RangeSlider/index.js +730 -0
- package/lib/cjs/ScrollReveal/index.d.ts +21 -0
- package/lib/cjs/ScrollReveal/index.js +216 -0
- package/lib/cjs/Scrollbar/index.d.ts +15 -0
- package/lib/cjs/Scrollbar/index.js +605 -0
- package/lib/cjs/SearchBar/index.d.ts +32 -0
- package/lib/cjs/SearchBar/index.js +246 -0
- package/lib/cjs/Select/index.d.ts +34 -0
- package/lib/cjs/Select/index.js +331 -0
- package/lib/cjs/ShowMoreLess/index.d.ts +30 -0
- package/lib/cjs/ShowMoreLess/index.js +202 -0
- package/lib/cjs/Switch/index.d.ts +29 -0
- package/lib/cjs/Switch/index.js +211 -0
- package/lib/cjs/Table/index.d.ts +25 -0
- package/lib/cjs/Table/index.js +2113 -0
- package/lib/cjs/Tabs/index.d.ts +3 -0
- package/lib/cjs/Tabs/index.js +323 -0
- package/lib/cjs/TagInput/index.d.ts +28 -0
- package/lib/cjs/TagInput/index.js +370 -0
- package/lib/cjs/Textarea/index.d.ts +30 -0
- package/lib/cjs/Textarea/index.js +242 -0
- package/lib/cjs/Toast/index.d.ts +35 -0
- package/lib/cjs/Toast/index.js +340 -0
- package/lib/cjs/Tooltip/index.d.ts +19 -0
- package/lib/cjs/Tooltip/index.js +200 -0
- package/lib/cjs/Tree/index.d.ts +37 -0
- package/lib/cjs/Tree/index.js +1406 -0
- package/lib/cjs/index.d.ts +33 -0
- package/lib/cjs/index.js +35 -0
- package/lib/css/BackToTop/index.css +34 -0
- package/lib/css/CascadingSelect/index.css +159 -0
- package/lib/css/CascadingSelectE2E/index.css +159 -0
- package/lib/css/ColorPicker/index.css +38 -0
- package/lib/css/DropdownMenu/index.css +127 -0
- package/lib/css/MultiFuncSelect/index.css +178 -0
- package/lib/css/MultilevelDropdownMenu/index.css +35 -0
- package/lib/css/RangeSlider/index.css +149 -0
- package/lib/css/ScrollReveal/index.css +23 -0
- package/lib/css/Scrollbar/index.css +168 -0
- package/lib/css/ShowMoreLess/index.css +23 -0
- package/lib/css/Table/index.css +533 -0
- package/lib/css/TagInput/index.css +90 -0
- package/lib/css/Toast/index.css +95 -0
- package/lib/css/Tooltip/index.css +240 -0
- package/lib/css/Tree/index.css +225 -0
- package/lib/esm/BackToTop/index.scss +47 -0
- package/lib/esm/BackToTop/index.tsx +182 -0
- package/lib/esm/BackToTop/utils/easing.js +200 -0
- package/lib/esm/BackToTop/utils/performance.js +52 -0
- package/lib/esm/CascadingSelect/Group.tsx +39 -0
- package/lib/esm/CascadingSelect/index.scss +214 -0
- package/lib/esm/CascadingSelect/index.tsx +922 -0
- package/lib/esm/CascadingSelect/utils/performance.js +52 -0
- package/lib/esm/CascadingSelectE2E/Group.tsx +39 -0
- package/lib/esm/CascadingSelectE2E/index.scss +214 -0
- package/lib/esm/CascadingSelectE2E/index.tsx +1091 -0
- package/lib/esm/CascadingSelectE2E/utils/performance.js +52 -0
- package/lib/esm/Checkbox/index.tsx +160 -0
- package/lib/esm/ColorPicker/index.scss +48 -0
- package/lib/esm/ColorPicker/index.tsx +187 -0
- package/lib/esm/DigitalClock/index.tsx +72 -0
- package/lib/esm/DigitalClock/utils/useInterval.js +43 -0
- package/lib/esm/DropdownMenu/Option.tsx +27 -0
- package/lib/esm/DropdownMenu/index.scss +180 -0
- package/lib/esm/DropdownMenu/index.tsx +148 -0
- package/lib/esm/DynamicFields/index.tsx +386 -0
- package/lib/esm/File/index.tsx +302 -0
- package/lib/esm/Input/index.tsx +233 -0
- package/lib/esm/LiveSearch/index.tsx +582 -0
- package/lib/esm/LiveSearch/utils/performance.js +52 -0
- package/lib/esm/LiveSearch/utils/useThrottle.js +36 -0
- package/lib/esm/ModalDialog/index.tsx +479 -0
- package/lib/esm/ModalDialog/plugins/BSL/bodyScrollLock.es6.js +262 -0
- package/lib/esm/ModalDialog/plugins/BSL/index.ts +2 -0
- package/lib/esm/ModeSwitch/index.tsx +82 -0
- package/lib/esm/MultiFuncSelect/index.scss +269 -0
- package/lib/esm/MultiFuncSelect/index.tsx +1597 -0
- package/lib/esm/MultiFuncSelect/utils/performance.js +52 -0
- package/lib/esm/MultiFuncSelect/utils/tree.js +103 -0
- package/lib/esm/MultiFuncSelect/utils/useThrottle.js +36 -0
- package/lib/esm/MultilevelDropdownMenu/MenuList.tsx +230 -0
- package/lib/esm/MultilevelDropdownMenu/index.scss +75 -0
- package/lib/esm/MultilevelDropdownMenu/index.tsx +71 -0
- package/lib/esm/MultilevelDropdownMenu/utils/dom.js +81 -0
- package/lib/esm/Pagination/index.tsx +230 -0
- package/lib/esm/Pagination/pagination-navigators.tsx +60 -0
- package/lib/esm/Radio/index.tsx +201 -0
- package/lib/esm/RangeSlider/index.scss +184 -0
- package/lib/esm/RangeSlider/index.tsx +223 -0
- package/lib/esm/ScrollReveal/index.scss +27 -0
- package/lib/esm/ScrollReveal/index.tsx +146 -0
- package/lib/esm/Scrollbar/index.scss +217 -0
- package/lib/esm/Scrollbar/index.tsx +497 -0
- package/lib/esm/Scrollbar/utils/performance.js +52 -0
- package/lib/esm/SearchBar/index.tsx +181 -0
- package/lib/esm/Select/index.tsx +276 -0
- package/lib/esm/ShowMoreLess/index.scss +27 -0
- package/lib/esm/ShowMoreLess/index.tsx +144 -0
- package/lib/esm/Switch/index.tsx +143 -0
- package/lib/esm/Table/TableColgroup.tsx +29 -0
- package/lib/esm/Table/TableField.tsx +40 -0
- package/lib/esm/Table/TableFieldRow.tsx +212 -0
- package/lib/esm/Table/TableHeaders.tsx +146 -0
- package/lib/esm/Table/TableRow.tsx +127 -0
- package/lib/esm/Table/TableSummaries.tsx +36 -0
- package/lib/esm/Table/index.scss +364 -0
- package/lib/esm/Table/index.tsx +576 -0
- package/lib/esm/Table/table-utils.ts +65 -0
- package/lib/esm/Table/utils/dom.js +81 -0
- package/lib/esm/Table/utils/performance.js +52 -0
- package/lib/esm/Tabs/TabList.tsx +42 -0
- package/lib/esm/Tabs/TabPanel.tsx +34 -0
- package/lib/esm/Tabs/Tabs.tsx +232 -0
- package/lib/esm/Tabs/index.tsx +3 -0
- package/lib/esm/TagInput/index.scss +125 -0
- package/lib/esm/TagInput/index.tsx +314 -0
- package/lib/esm/Textarea/index.tsx +178 -0
- package/lib/esm/Toast/Item.tsx +75 -0
- package/lib/esm/Toast/index.scss +120 -0
- package/lib/esm/Toast/index.tsx +249 -0
- package/lib/esm/Tooltip/index.scss +327 -0
- package/lib/esm/Tooltip/index.tsx +142 -0
- package/lib/esm/Tree/TreeList.tsx +503 -0
- package/lib/esm/Tree/index.scss +375 -0
- package/lib/esm/Tree/index.tsx +301 -0
- package/lib/esm/Tree/init-height.tsx +27 -0
- package/lib/esm/Tree/utils/convert-tree.js +29 -0
- package/lib/esm/Tree/utils/dom.js +81 -0
- package/lib/esm/index.js +31 -0
- package/package.json +40 -0
package/Toast/index.css
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* ======================================================
|
|
2
|
+
<!-- Toast -->
|
|
3
|
+
/* ====================================================== */
|
|
4
|
+
.toasts__wrapper {
|
|
5
|
+
--bs-toast-zindex: 1090;
|
|
6
|
+
width: 350px;
|
|
7
|
+
position: fixed;
|
|
8
|
+
left: 50%;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
z-index: var(--bs-toast-zindex);
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
transition: 0.1s ease-in-out;
|
|
13
|
+
}
|
|
14
|
+
.toasts__wrapper--bottom-left {
|
|
15
|
+
left: 15px;
|
|
16
|
+
}
|
|
17
|
+
.toasts__wrapper--bottom-right {
|
|
18
|
+
left: auto;
|
|
19
|
+
right: 15px;
|
|
20
|
+
}
|
|
21
|
+
.toasts__wrapper--bottom-center {
|
|
22
|
+
left: 50%;
|
|
23
|
+
transform: translateX(-50%);
|
|
24
|
+
}
|
|
25
|
+
.toasts__wrapper--top-left {
|
|
26
|
+
left: 15px;
|
|
27
|
+
bottom: auto;
|
|
28
|
+
top: 35px;
|
|
29
|
+
}
|
|
30
|
+
.toasts__wrapper--top-right {
|
|
31
|
+
left: auto;
|
|
32
|
+
right: 15px;
|
|
33
|
+
top: 35px;
|
|
34
|
+
}
|
|
35
|
+
.toasts__wrapper--top-center {
|
|
36
|
+
left: 50%;
|
|
37
|
+
transform: translateX(-50%);
|
|
38
|
+
top: 35px;
|
|
39
|
+
}
|
|
40
|
+
.toasts__wrapper--vertical-center {
|
|
41
|
+
left: 50%;
|
|
42
|
+
transform: translate(-50%, -50%);
|
|
43
|
+
top: 50%;
|
|
44
|
+
margin-top: 5%;
|
|
45
|
+
}
|
|
46
|
+
.toasts__wrapper .toasts {
|
|
47
|
+
position: relative;
|
|
48
|
+
width: 100%;
|
|
49
|
+
bottom: 15px;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-flow: column-reverse nowrap;
|
|
52
|
+
}
|
|
53
|
+
.toasts__wrapper .toasts::before {
|
|
54
|
+
content: "";
|
|
55
|
+
top: -80px;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
left: -8px;
|
|
58
|
+
right: -8px;
|
|
59
|
+
position: absolute;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
.toasts__wrapper .toasts:hover .toast-container {
|
|
64
|
+
transform: perspective(100px) translateZ(0) !important;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Bootstrap toast here */
|
|
68
|
+
.toast-container {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: auto;
|
|
71
|
+
position: relative;
|
|
72
|
+
transition: all 0.25s;
|
|
73
|
+
pointer-events: auto;
|
|
74
|
+
}
|
|
75
|
+
.toast-container [data-close] {
|
|
76
|
+
background: none;
|
|
77
|
+
}
|
|
78
|
+
.toast-container [data-close]:focus {
|
|
79
|
+
box-shadow: none;
|
|
80
|
+
}
|
|
81
|
+
.toast-container [data-close] svg {
|
|
82
|
+
vertical-align: top;
|
|
83
|
+
}
|
|
84
|
+
.toast-container [data-close] svg path {
|
|
85
|
+
transition: 0.3s ease-in-out;
|
|
86
|
+
}
|
|
87
|
+
.toast-container [data-close]:hover svg path {
|
|
88
|
+
fill: #f00;
|
|
89
|
+
}
|
|
90
|
+
.toast-container.hide-start {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
.toast-container.hide-end {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
package/Toast/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
setCloseToast?: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
declare type ToastProps = {
|
|
8
|
+
/** Specify data of toasts as a JSON string format. */
|
|
9
|
+
data: any[any];
|
|
10
|
+
/** Use asynchronous triggering */
|
|
11
|
+
async?: boolean;
|
|
12
|
+
/** The direction of the toast. */
|
|
13
|
+
direction?: string;
|
|
14
|
+
/** Set an automatic closing time, multiple items will be accumulated in order.
|
|
15
|
+
* Amount of time measured in milliseconds. If false or without this attribute, Auto-Close will be disabled.
|
|
16
|
+
*/
|
|
17
|
+
autoCloseTime?: boolean | number;
|
|
18
|
+
/** Starts from the top position of the Array when we use the automatic close. */
|
|
19
|
+
autoCloseReverse?: boolean;
|
|
20
|
+
/** You can not close pop-win when it is enabled */
|
|
21
|
+
lock?: boolean;
|
|
22
|
+
/** Self-defined class name for body*/
|
|
23
|
+
schemeBody?: string;
|
|
24
|
+
/** Self-defined class name for header */
|
|
25
|
+
schemeHeader?: string;
|
|
26
|
+
/** Set the color of the close button */
|
|
27
|
+
closeBtnColor?: string;
|
|
28
|
+
/** Disable the close button. */
|
|
29
|
+
closeDisabled?: boolean;
|
|
30
|
+
/** -- */
|
|
31
|
+
id?: string;
|
|
32
|
+
onClose?: (e: any, data: any[]) => void;
|
|
33
|
+
};
|
|
34
|
+
declare const Toast: (props: ToastProps) => JSX.Element;
|
|
35
|
+
export default Toast;
|
package/Toast/index.js
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("react"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["react"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["RPB"] = factory(require("react"));
|
|
8
|
+
else
|
|
9
|
+
root["RPB"] = factory(root["React"]);
|
|
10
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ 787:
|
|
16
|
+
/***/ ((module) => {
|
|
17
|
+
|
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
19
|
+
|
|
20
|
+
/***/ })
|
|
21
|
+
|
|
22
|
+
/******/ });
|
|
23
|
+
/************************************************************************/
|
|
24
|
+
/******/ // The module cache
|
|
25
|
+
/******/ var __webpack_module_cache__ = {};
|
|
26
|
+
/******/
|
|
27
|
+
/******/ // The require function
|
|
28
|
+
/******/ function __webpack_require__(moduleId) {
|
|
29
|
+
/******/ // Check if module is in cache
|
|
30
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
31
|
+
/******/ if (cachedModule !== undefined) {
|
|
32
|
+
/******/ return cachedModule.exports;
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ // Create a new module (and put it into the cache)
|
|
35
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
36
|
+
/******/ // no module.id needed
|
|
37
|
+
/******/ // no module.loaded needed
|
|
38
|
+
/******/ exports: {}
|
|
39
|
+
/******/ };
|
|
40
|
+
/******/
|
|
41
|
+
/******/ // Execute the module function
|
|
42
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // Return the exports of the module
|
|
45
|
+
/******/ return module.exports;
|
|
46
|
+
/******/ }
|
|
47
|
+
/******/
|
|
48
|
+
/************************************************************************/
|
|
49
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
50
|
+
/******/ (() => {
|
|
51
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
52
|
+
/******/ __webpack_require__.n = (module) => {
|
|
53
|
+
/******/ var getter = module && module.__esModule ?
|
|
54
|
+
/******/ () => (module['default']) :
|
|
55
|
+
/******/ () => (module);
|
|
56
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
57
|
+
/******/ return getter;
|
|
58
|
+
/******/ };
|
|
59
|
+
/******/ })();
|
|
60
|
+
/******/
|
|
61
|
+
/******/ /* webpack/runtime/define property getters */
|
|
62
|
+
/******/ (() => {
|
|
63
|
+
/******/ // define getter functions for harmony exports
|
|
64
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
65
|
+
/******/ for(var key in definition) {
|
|
66
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
67
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
68
|
+
/******/ }
|
|
69
|
+
/******/ }
|
|
70
|
+
/******/ };
|
|
71
|
+
/******/ })();
|
|
72
|
+
/******/
|
|
73
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
74
|
+
/******/ (() => {
|
|
75
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
76
|
+
/******/ })();
|
|
77
|
+
/******/
|
|
78
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
79
|
+
/******/ (() => {
|
|
80
|
+
/******/ // define __esModule on exports
|
|
81
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
82
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
83
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
84
|
+
/******/ }
|
|
85
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
86
|
+
/******/ };
|
|
87
|
+
/******/ })();
|
|
88
|
+
/******/
|
|
89
|
+
/************************************************************************/
|
|
90
|
+
var __webpack_exports__ = {};
|
|
91
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
92
|
+
(() => {
|
|
93
|
+
// ESM COMPAT FLAG
|
|
94
|
+
__webpack_require__.r(__webpack_exports__);
|
|
95
|
+
|
|
96
|
+
// EXPORTS
|
|
97
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
98
|
+
"default": () => (/* binding */ src)
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
|
|
102
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
|
|
103
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
|
|
104
|
+
;// CONCATENATED MODULE: ./src/Item.tsx
|
|
105
|
+
|
|
106
|
+
;
|
|
107
|
+
var Item = function Item(props) {
|
|
108
|
+
var index = props.index,
|
|
109
|
+
title = props.title,
|
|
110
|
+
note = props.note,
|
|
111
|
+
message = props.message,
|
|
112
|
+
depth = props.depth,
|
|
113
|
+
lock = props.lock,
|
|
114
|
+
schemeBody = props.schemeBody,
|
|
115
|
+
schemeHeader = props.schemeHeader,
|
|
116
|
+
closeBtnColor = props.closeBtnColor,
|
|
117
|
+
closeDisabled = props.closeDisabled,
|
|
118
|
+
closeEv = props.closeEv;
|
|
119
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
120
|
+
className: "toast-container",
|
|
121
|
+
"data-index": index,
|
|
122
|
+
style: {
|
|
123
|
+
transform: "perspective(100px) translateZ(-".concat(2 * index, "px) translateY(").concat(35 * index, "px)"),
|
|
124
|
+
zIndex: depth
|
|
125
|
+
}
|
|
126
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
127
|
+
className: "toast fade show ".concat(schemeBody ? schemeBody : ''),
|
|
128
|
+
role: "alert"
|
|
129
|
+
}, (title === '' || title === false) && (note === '' || note === false) ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
130
|
+
className: "toast-header ".concat(schemeHeader ? schemeHeader : '')
|
|
131
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("strong", {
|
|
132
|
+
className: "me-auto"
|
|
133
|
+
}, title === '' || title === false ? '' : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, title)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("small", {
|
|
134
|
+
className: "text-muted"
|
|
135
|
+
}, note === '' || note === false ? '' : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, note)), !lock ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !closeDisabled ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
136
|
+
"data-close": "1",
|
|
137
|
+
"data-index": index,
|
|
138
|
+
tabIndex: -1,
|
|
139
|
+
type: "button",
|
|
140
|
+
className: "btn-close"
|
|
141
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
142
|
+
width: "12px",
|
|
143
|
+
height: "12px",
|
|
144
|
+
viewBox: "0 0 16 16"
|
|
145
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
146
|
+
fill: "".concat(closeBtnColor ? closeBtnColor : '#000000'),
|
|
147
|
+
d: "M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z",
|
|
148
|
+
fillRule: "evenodd"
|
|
149
|
+
}))) : null) : null)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
150
|
+
className: "toast-body"
|
|
151
|
+
}, message, (title === '' || title === false) && (note === '' || note === false) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !closeDisabled ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
152
|
+
"data-close": "1",
|
|
153
|
+
"data-index": index,
|
|
154
|
+
tabIndex: -1,
|
|
155
|
+
type: "button",
|
|
156
|
+
className: "btn-close position-absolute top-0 end-0 me-2 mt-2"
|
|
157
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
158
|
+
width: "12px",
|
|
159
|
+
height: "12px",
|
|
160
|
+
viewBox: "0 0 16 16"
|
|
161
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
162
|
+
fill: "".concat(closeBtnColor ? closeBtnColor : '#000000'),
|
|
163
|
+
d: "M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z",
|
|
164
|
+
fillRule: "evenodd"
|
|
165
|
+
}))) : null) : null))));
|
|
166
|
+
};
|
|
167
|
+
/* harmony default export */ const src_Item = (Item);
|
|
168
|
+
;// CONCATENATED MODULE: ./src/index.tsx
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
var Toast = function Toast(props) {
|
|
172
|
+
var async = props.async,
|
|
173
|
+
direction = props.direction,
|
|
174
|
+
autoCloseTime = props.autoCloseTime,
|
|
175
|
+
autoCloseReverse = props.autoCloseReverse,
|
|
176
|
+
lock = props.lock,
|
|
177
|
+
data = props.data,
|
|
178
|
+
schemeBody = props.schemeBody,
|
|
179
|
+
schemeHeader = props.schemeHeader,
|
|
180
|
+
closeBtnColor = props.closeBtnColor,
|
|
181
|
+
closeDisabled = props.closeDisabled,
|
|
182
|
+
id = props.id,
|
|
183
|
+
onClose = props.onClose;
|
|
184
|
+
var uniqueID = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useId)().replace(/\:/g, "-");
|
|
185
|
+
var idRes = id || uniqueID;
|
|
186
|
+
var rootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
187
|
+
var depth = data.length + 1;
|
|
188
|
+
function init() {
|
|
189
|
+
// Move HTML templates to tag end body </body>
|
|
190
|
+
// render() don't use "Fragment", in order to avoid error "Failed to execute 'insertBefore' on 'Node'"
|
|
191
|
+
// prevent "transform", "filter", "perspective" attribute destruction fixed viewport orientation
|
|
192
|
+
//------------------------------------------
|
|
193
|
+
if (document.body !== null) {
|
|
194
|
+
document.body.appendChild(rootRef.current);
|
|
195
|
+
[].slice.call(rootRef.current.querySelectorAll('[data-close]')).forEach(function (node) {
|
|
196
|
+
node.addEventListener('pointerdown', function (e) {
|
|
197
|
+
var index = node.dataset.index;
|
|
198
|
+
handleClose(index);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Initialize data
|
|
204
|
+
//--------------
|
|
205
|
+
var $toast = document.querySelector("#".concat(rootRef.current.id));
|
|
206
|
+
if ($toast !== null) {
|
|
207
|
+
if ($toast.dataset.async == 'true') {
|
|
208
|
+
var _list = rootRef.current.querySelectorAll('.toast-container');
|
|
209
|
+
[].slice.call(_list).forEach(function (node, i) {
|
|
210
|
+
node.classList.remove('hide-end');
|
|
211
|
+
// rearrange
|
|
212
|
+
node.style.transform = "perspective(100px) translateZ(-".concat(2 * i, "px) translateY(").concat(35 * i, "px)");
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Auto hide
|
|
218
|
+
//--------------
|
|
219
|
+
var _autoCloseTime = typeof autoCloseTime === 'undefined' || autoCloseTime === false ? false : autoCloseTime;
|
|
220
|
+
if (_autoCloseTime !== false) {
|
|
221
|
+
var items = JSON.parse(JSON.stringify(data));
|
|
222
|
+
autoClose(0, items, _autoCloseTime);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function handleClose(index) {
|
|
226
|
+
var items = JSON.parse(JSON.stringify(data));
|
|
227
|
+
if (items[index] !== undefined) {
|
|
228
|
+
var _list = rootRef.current.querySelectorAll('.toast-container');
|
|
229
|
+
_list[index].classList.add('hide-start');
|
|
230
|
+
|
|
231
|
+
//Let the removed animation show
|
|
232
|
+
setTimeout(function () {
|
|
233
|
+
[].slice.call(_list).forEach(function (node, i) {
|
|
234
|
+
node.classList.remove('hide-start');
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// remove current
|
|
238
|
+
_list[index].classList.add('hide-end');
|
|
239
|
+
|
|
240
|
+
// rearrange
|
|
241
|
+
[].slice.call(_list).filter(function (node) {
|
|
242
|
+
return !node.classList.contains('hide-end');
|
|
243
|
+
}).forEach(function (node, index) {
|
|
244
|
+
node.style.transform = "perspective(100px) translateZ(-".concat(2 * index, "px) translateY(").concat(35 * index, "px)");
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
//
|
|
248
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(rootRef.current, items);
|
|
249
|
+
}, 300);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function autoClose(index, items) {
|
|
253
|
+
var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3000;
|
|
254
|
+
if (items.length === index) {
|
|
255
|
+
//
|
|
256
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(rootRef.current, items);
|
|
257
|
+
|
|
258
|
+
//
|
|
259
|
+
clearTimeout(window.setCloseToast);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
window.setCloseToast = setTimeout(function () {
|
|
263
|
+
var _list = rootRef.current.querySelectorAll('.toast-container');
|
|
264
|
+
if (autoCloseReverse) {
|
|
265
|
+
_list[items.length - index].classList.add('hide-start');
|
|
266
|
+
} else {
|
|
267
|
+
_list[index - 1].classList.add('hide-start');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
//Let the removed animation show
|
|
271
|
+
setTimeout(function () {
|
|
272
|
+
[].slice.call(_list).forEach(function (node) {
|
|
273
|
+
node.classList.remove('hide-start');
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// remove current
|
|
277
|
+
if (autoCloseReverse) {
|
|
278
|
+
_list[items.length - index].classList.add('hide-end');
|
|
279
|
+
} else {
|
|
280
|
+
_list[index - 1].classList.add('hide-end');
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// rearrange
|
|
284
|
+
[].slice.call(_list).filter(function (node) {
|
|
285
|
+
return !node.classList.contains('hide-end');
|
|
286
|
+
}).forEach(function (node, i) {
|
|
287
|
+
node.style.transform = "perspective(100px) translateZ(-".concat(2 * i, "px) translateY(").concat(35 * i, "px)");
|
|
288
|
+
});
|
|
289
|
+
autoClose(index, items, delay);
|
|
290
|
+
}, 300);
|
|
291
|
+
}, delay * (index + 1));
|
|
292
|
+
index++;
|
|
293
|
+
}
|
|
294
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
295
|
+
// Initialize
|
|
296
|
+
//------------------------------------------
|
|
297
|
+
init();
|
|
298
|
+
|
|
299
|
+
// Remove the global list of events, especially as scroll and interval.
|
|
300
|
+
//--------------
|
|
301
|
+
return function () {
|
|
302
|
+
// Cancels a timeout previously established by calling setTimeout().
|
|
303
|
+
clearTimeout(window.setCloseToast);
|
|
304
|
+
|
|
305
|
+
// Remove all toasts
|
|
306
|
+
var _el = document.querySelector("#toasts__wrapper-".concat(idRes));
|
|
307
|
+
if (_el !== null) _el.remove();
|
|
308
|
+
};
|
|
309
|
+
}, [data]);
|
|
310
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
311
|
+
id: "toasts__wrapper-".concat(idRes),
|
|
312
|
+
"data-async": async ? async : false,
|
|
313
|
+
className: "toasts__wrapper toasts__wrapper--".concat(direction ? direction : 'bottom-center'),
|
|
314
|
+
ref: rootRef
|
|
315
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
316
|
+
className: "toasts"
|
|
317
|
+
}, data.map(function (item, i) {
|
|
318
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_Item, {
|
|
319
|
+
depth: depth - i,
|
|
320
|
+
key: i,
|
|
321
|
+
index: i,
|
|
322
|
+
title: item.title,
|
|
323
|
+
note: item.note,
|
|
324
|
+
lock: lock,
|
|
325
|
+
schemeBody: schemeBody,
|
|
326
|
+
schemeHeader: schemeHeader,
|
|
327
|
+
closeBtnColor: closeBtnColor,
|
|
328
|
+
closeDisabled: closeDisabled,
|
|
329
|
+
message: item.message,
|
|
330
|
+
closeEv: handleClose
|
|
331
|
+
});
|
|
332
|
+
}))));
|
|
333
|
+
};
|
|
334
|
+
/* harmony default export */ const src = (Toast);
|
|
335
|
+
})();
|
|
336
|
+
|
|
337
|
+
/******/ return __webpack_exports__;
|
|
338
|
+
/******/ })()
|
|
339
|
+
;
|
|
340
|
+
});
|