uplord-ui 0.0.22 → 0.0.24
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/{Modal-DcQNNOVd.cjs → Modal-BAMPI8p8.cjs} +1580 -1583
- package/dist/{Modal-CvyykTJL.js → Modal-C57uOuXY.js} +15474 -17182
- package/dist/components/index.d.ts +0 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +9 -10
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +9 -10
- package/dist/lib.cjs.js +1 -1
- package/dist/lib.es.js +323 -11
- package/dist/styles/mixins.scss +81 -0
- package/dist/uplord-ui.css +1 -1
- package/dist/useMounted-Do8RLpGz.js +11 -0
- package/dist/useMounted-Nl9boR7C.cjs +1 -0
- package/package.json +1 -1
- package/dist/index-DuZR_QSM.js +0 -325
- package/dist/index-VONKSw7f.cjs +0 -1
|
@@ -5,7 +5,6 @@ export { Stack } from './blocks/Stack';
|
|
|
5
5
|
export { Timeline } from './blocks/Timeline';
|
|
6
6
|
export { Footer } from './main/Footer';
|
|
7
7
|
export { Header } from './main/Header';
|
|
8
|
-
export { ContactForm } from './modals/ContactForm';
|
|
9
8
|
export { Pagination } from './navigation/Pagination';
|
|
10
9
|
export { Button } from './ui/Button';
|
|
11
10
|
export { Checkbox } from './ui/Checkbox';
|
package/dist/components.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Modal-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Modal-BAMPI8p8.cjs");exports.Banner=e.Banner;exports.Button=e.Button;exports.Checkbox=e.Checkbox;exports.Example=e.Example;exports.Footer=e.Footer;exports.FormikInput=e.FormikInput;exports.Header=e.Header;exports.Icon=e.Icon;exports.Input=e.Input;exports.Modal=e.Modal;exports.Pagination=e.Pagination;exports.Projects=e.Projects;exports.Radio=e.Radio;exports.Section=e.Section;exports.Select=e.Select;exports.Stack=e.Stack;exports.Textarea=e.Textarea;exports.Timeline=e.Timeline;
|
package/dist/components.es.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { B as e, c as o,
|
|
1
|
+
import { B as e, c as o, C as t, E as n, F as r, d as c, H as i, g as d, I as l, M as m, b as p, P as x, R as I, S, e as k, a as u, f as B, T as F } from "./Modal-C57uOuXY.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Banner,
|
|
4
4
|
o as Button,
|
|
5
5
|
t as Checkbox,
|
|
6
|
-
n as
|
|
7
|
-
r as
|
|
8
|
-
c as
|
|
9
|
-
i as
|
|
10
|
-
m as Header,
|
|
6
|
+
n as Example,
|
|
7
|
+
r as Footer,
|
|
8
|
+
c as FormikInput,
|
|
9
|
+
i as Header,
|
|
11
10
|
d as Icon,
|
|
12
11
|
l as Input,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
m as Modal,
|
|
13
|
+
p as Pagination,
|
|
14
|
+
x as Projects,
|
|
16
15
|
I as Radio,
|
|
17
16
|
S as Section,
|
|
18
17
|
k as Select,
|
|
19
18
|
u as Stack,
|
|
20
19
|
B as Textarea,
|
|
21
|
-
|
|
20
|
+
F as Timeline
|
|
22
21
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Modal-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Modal-BAMPI8p8.cjs");exports.Banner=e.Banner;exports.Button=e.Button;exports.Checkbox=e.Checkbox;exports.Example=e.Example;exports.Footer=e.Footer;exports.FormikInput=e.FormikInput;exports.Header=e.Header;exports.Icon=e.Icon;exports.Input=e.Input;exports.Modal=e.Modal;exports.Pagination=e.Pagination;exports.Projects=e.Projects;exports.Radio=e.Radio;exports.Section=e.Section;exports.Select=e.Select;exports.Stack=e.Stack;exports.Textarea=e.Textarea;exports.Timeline=e.Timeline;
|
package/dist/index.es.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { B as e, c as o,
|
|
1
|
+
import { B as e, c as o, C as t, E as n, F as r, d as c, H as i, g as d, I as l, M as m, b as p, P as x, R as I, S, e as k, a as u, f as B, T as F } from "./Modal-C57uOuXY.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Banner,
|
|
4
4
|
o as Button,
|
|
5
5
|
t as Checkbox,
|
|
6
|
-
n as
|
|
7
|
-
r as
|
|
8
|
-
c as
|
|
9
|
-
i as
|
|
10
|
-
m as Header,
|
|
6
|
+
n as Example,
|
|
7
|
+
r as Footer,
|
|
8
|
+
c as FormikInput,
|
|
9
|
+
i as Header,
|
|
11
10
|
d as Icon,
|
|
12
11
|
l as Input,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
m as Modal,
|
|
13
|
+
p as Pagination,
|
|
14
|
+
x as Projects,
|
|
16
15
|
I as Radio,
|
|
17
16
|
S as Section,
|
|
18
17
|
k as Select,
|
|
19
18
|
u as Stack,
|
|
20
19
|
B as Textarea,
|
|
21
|
-
|
|
20
|
+
F as Timeline
|
|
22
21
|
};
|
package/dist/lib.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),T=require("./useMounted-Nl9boR7C.cjs");var u=function(){return u=Object.assign||function(e){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},u.apply(this,arguments)},j=function(e,r){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o},I=Symbol("NiceModalId"),O={},h=i.createContext(O),H=i.createContext(null),v={},C={},F=0,g=function(){throw new Error("No dispatch method detected, did you embed your app with NiceModal.Provider?")},_=function(){return"_nice_modal_"+F++},S=function(e,r){var o,n,a;switch(e===void 0&&(e=O),r.type){case"nice-modal/show":{var d=r.payload,t=d.modalId,l=d.args;return u(u({},e),(o={},o[t]=u(u({},e[t]),{id:t,args:l,visible:!!C[t],delayVisible:!C[t]}),o))}case"nice-modal/hide":{var t=r.payload.modalId;return e[t]?u(u({},e),(n={},n[t]=u(u({},e[t]),{visible:!1}),n)):e}case"nice-modal/remove":{var t=r.payload.modalId,c=u({},e);return delete c[t],c}case"nice-modal/set-flags":{var f=r.payload,t=f.modalId,m=f.flags;return u(u({},e),(a={},a[t]=u(u({},e[t]),m),a))}default:return e}};function U(e){var r;return(r=v[e])===null||r===void 0?void 0:r.comp}function q(e,r){return{type:"nice-modal/show",payload:{modalId:e,args:r}}}function R(e,r){return{type:"nice-modal/set-flags",payload:{modalId:e,flags:r}}}function Y(e){return{type:"nice-modal/hide",payload:{modalId:e}}}function G(e){return{type:"nice-modal/remove",payload:{modalId:e}}}var p={},b={},k=function(e){return typeof e=="string"?e:(e[I]||(e[I]=_()),e[I])};function P(e,r){var o=k(e);if(typeof e!="string"&&!v[o]&&E(o,e),g(q(o,r)),!p[o]){var n,a,d=new Promise(function(t,l){n=t,a=l});p[o]={resolve:n,reject:a,promise:d}}return p[o].promise}function x(e){var r=k(e);if(g(Y(r)),delete p[r],!b[r]){var o,n,a=new Promise(function(d,t){o=d,n=t});b[r]={resolve:o,reject:n,promise:a}}return b[r].promise}var L=function(e){var r=k(e);g(G(r)),delete p[r],delete b[r]},J=function(e,r){g(R(e,r))};function V(e,r){var o=i.useContext(h),n=i.useContext(H),a=null,d=e&&typeof e!="string";if(e?a=k(e):a=n,!a)throw new Error("No modal id found in NiceModal.useModal.");var t=a;i.useEffect(function(){d&&!v[t]&&E(t,e,r)},[d,t,e,r]);var l=o[t],c=i.useCallback(function(M){return P(t,M)},[t]),f=i.useCallback(function(){return x(t)},[t]),m=i.useCallback(function(){return L(t)},[t]),w=i.useCallback(function(M){var s;(s=p[t])===null||s===void 0||s.resolve(M),delete p[t]},[t]),y=i.useCallback(function(M){var s;(s=p[t])===null||s===void 0||s.reject(M),delete p[t]},[t]),N=i.useCallback(function(M){var s;(s=b[t])===null||s===void 0||s.resolve(M),delete b[t]},[t]);return i.useMemo(function(){return{id:t,args:l==null?void 0:l.args,visible:!!(l!=null&&l.visible),keepMounted:!!(l!=null&&l.keepMounted),show:c,hide:f,remove:m,resolve:w,reject:y,resolveHide:N}},[t,l==null?void 0:l.args,l==null?void 0:l.visible,l==null?void 0:l.keepMounted,c,f,m,w,y,N])}var X=function(e){return function(r){var o,n=r.defaultVisible,a=r.keepMounted,d=r.id,t=j(r,["defaultVisible","keepMounted","id"]),l=V(d),c=l.args,f=l.show,m=i.useContext(h),w=!!m[d];i.useEffect(function(){return n&&f(),C[d]=!0,function(){delete C[d]}},[d,f,n]),i.useEffect(function(){a&&J(d,{keepMounted:!0})},[d,a]);var y=(o=m[d])===null||o===void 0?void 0:o.delayVisible;return i.useEffect(function(){y&&f(c)},[y,c,f]),w?i.createElement(H.Provider,{value:d},i.createElement(e,u({},t,c))):null}},E=function(e,r,o){v[e]?v[e].props=o:v[e]={comp:r,props:o}},z=function(e){delete v[e]},A=function(){var e=i.useContext(h),r=Object.keys(e).filter(function(n){return!!e[n]});r.forEach(function(n){if(!v[n]&&!C[n]){console.warn("No modal found for id: "+n+". Please check the id or if it is registered or declared via JSX.");return}});var o=r.filter(function(n){return v[n]}).map(function(n){return u({id:n},v[n])});return i.createElement(i.Fragment,null,o.map(function(n){return i.createElement(n.comp,u({key:n.id,id:n.id},n.props))}))},B=function(e){var r=e.children,o=i.useReducer(S,O),n=o[0];return g=o[1],i.createElement(h.Provider,{value:n},r,i.createElement(A,null))},K=function(e){var r=e.children,o=e.dispatch,n=e.modals;return!o||!n?i.createElement(B,null,r):(g=o,i.createElement(h.Provider,{value:n},r,i.createElement(A,null)))},Q=function(e){var r=e.id,o=e.component;return i.useEffect(function(){return E(r,o),function(){z(r)}},[r,o]),null},W=function(e){var r,o=e.modal,n=e.handler,a=n===void 0?{}:n,d=j(e,["modal","handler"]),t=i.useMemo(function(){return _()},[]),l=typeof o=="string"?(r=v[o])===null||r===void 0?void 0:r.comp:o;if(!a)throw new Error("No handler found in NiceModal.ModalHolder.");if(!l)throw new Error("No modal found for id: "+o+" in NiceModal.ModalHolder.");return a.show=i.useCallback(function(c){return P(t,c)},[t]),a.hide=i.useCallback(function(){return x(t)},[t]),i.createElement(l,u({id:t},d))},Z=function(e){return{visible:e.visible,onOk:function(){return e.hide()},onCancel:function(){return e.hide()},afterClose:function(){e.resolveHide(),e.keepMounted||e.remove()}}},$=function(e){return{visible:e.visible,onClose:function(){return e.hide()},afterVisibleChange:function(r){r||e.resolveHide(),!r&&!e.keepMounted&&e.remove()}}},ee=function(e){return{open:e.visible,onClose:function(){return e.hide()},onExited:function(){e.resolveHide(),!e.keepMounted&&e.remove()}}},re=function(e){return{show:e.visible,onHide:function(){return e.hide()},onExited:function(){e.resolveHide(),!e.keepMounted&&e.remove()}}},D={Provider:K,ModalDef:Q,ModalHolder:W,NiceModalContext:h,create:X,register:E,getModal:U,show:P,hide:x,remove:L,useModal:V,reducer:S,antdModal:Z,antdDrawer:$,muiDialog:ee,bootstrapDialog:re};const ne=()=>{const e=i.useContext(D.NiceModalContext),r=Object.keys(e).length>0;return i.useEffect(()=>{const o=()=>{Object.values(e).forEach(n=>D.remove(n.id))};return window.addEventListener("popstate",o),()=>{window.removeEventListener("popstate",o)}},[e]),i.useEffect(()=>(r?document.body.classList.add("stop-scroll"):document.body.classList.remove("stop-scroll"),()=>{document.body.classList.remove("stop-scroll")}),[r]),r};exports.useMounted=T.useMounted;exports.useModalData=ne;
|
package/dist/lib.es.js
CHANGED
|
@@ -1,20 +1,332 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import u, { useContext as k, useEffect as b, useCallback as m, useMemo as L, useReducer as Y } from "react";
|
|
2
|
+
import { u as ce } from "./useMounted-Do8RLpGz.js";
|
|
3
|
+
var d = function() {
|
|
4
|
+
return d = Object.assign || function(e) {
|
|
5
|
+
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
6
|
+
r = arguments[o];
|
|
7
|
+
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
8
|
+
}
|
|
9
|
+
return e;
|
|
10
|
+
}, d.apply(this, arguments);
|
|
11
|
+
}, S = function(e, r) {
|
|
12
|
+
var o = {};
|
|
13
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (o[n] = e[n]);
|
|
14
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
15
|
+
for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
|
|
16
|
+
r.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (o[n[i]] = e[n[i]]);
|
|
17
|
+
return o;
|
|
18
|
+
}, P = Symbol("NiceModalId"), x = {}, y = u.createContext(x), V = u.createContext(null), s = {}, C = {}, G = 0, w = function() {
|
|
19
|
+
throw new Error("No dispatch method detected, did you embed your app with NiceModal.Provider?");
|
|
20
|
+
}, A = function() {
|
|
21
|
+
return "_nice_modal_" + G++;
|
|
22
|
+
}, F = function(e, r) {
|
|
23
|
+
var o, n, i;
|
|
24
|
+
switch (e === void 0 && (e = x), r.type) {
|
|
25
|
+
case "nice-modal/show": {
|
|
26
|
+
var l = r.payload, t = l.modalId, a = l.args;
|
|
27
|
+
return d(d({}, e), (o = {}, o[t] = d(d({}, e[t]), {
|
|
28
|
+
id: t,
|
|
29
|
+
args: a,
|
|
30
|
+
// If modal is not mounted, mount it first then make it visible.
|
|
31
|
+
// There is logic inside HOC wrapper to make it visible after its first mount.
|
|
32
|
+
// This mechanism ensures the entering transition.
|
|
33
|
+
visible: !!C[t],
|
|
34
|
+
delayVisible: !C[t]
|
|
35
|
+
}), o));
|
|
36
|
+
}
|
|
37
|
+
case "nice-modal/hide": {
|
|
38
|
+
var t = r.payload.modalId;
|
|
39
|
+
return e[t] ? d(d({}, e), (n = {}, n[t] = d(d({}, e[t]), { visible: !1 }), n)) : e;
|
|
40
|
+
}
|
|
41
|
+
case "nice-modal/remove": {
|
|
42
|
+
var t = r.payload.modalId, c = d({}, e);
|
|
43
|
+
return delete c[t], c;
|
|
44
|
+
}
|
|
45
|
+
case "nice-modal/set-flags": {
|
|
46
|
+
var f = r.payload, t = f.modalId, h = f.flags;
|
|
47
|
+
return d(d({}, e), (i = {}, i[t] = d(d({}, e[t]), h), i));
|
|
48
|
+
}
|
|
49
|
+
default:
|
|
50
|
+
return e;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function J(e) {
|
|
54
|
+
var r;
|
|
55
|
+
return (r = s[e]) === null || r === void 0 ? void 0 : r.comp;
|
|
56
|
+
}
|
|
57
|
+
function X(e, r) {
|
|
58
|
+
return {
|
|
59
|
+
type: "nice-modal/show",
|
|
60
|
+
payload: {
|
|
61
|
+
modalId: e,
|
|
62
|
+
args: r
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function q(e, r) {
|
|
67
|
+
return {
|
|
68
|
+
type: "nice-modal/set-flags",
|
|
69
|
+
payload: {
|
|
70
|
+
modalId: e,
|
|
71
|
+
flags: r
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function z(e) {
|
|
76
|
+
return {
|
|
77
|
+
type: "nice-modal/hide",
|
|
78
|
+
payload: {
|
|
79
|
+
modalId: e
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function B(e) {
|
|
84
|
+
return {
|
|
85
|
+
type: "nice-modal/remove",
|
|
86
|
+
payload: {
|
|
87
|
+
modalId: e
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
var p = {}, g = {}, O = function(e) {
|
|
92
|
+
return typeof e == "string" ? e : (e[P] || (e[P] = A()), e[P]);
|
|
93
|
+
};
|
|
94
|
+
function D(e, r) {
|
|
95
|
+
var o = O(e);
|
|
96
|
+
if (typeof e != "string" && !s[o] && N(o, e), w(X(o, r)), !p[o]) {
|
|
97
|
+
var n, i, l = new Promise(function(t, a) {
|
|
98
|
+
n = t, i = a;
|
|
99
|
+
});
|
|
100
|
+
p[o] = {
|
|
101
|
+
resolve: n,
|
|
102
|
+
reject: i,
|
|
103
|
+
promise: l
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return p[o].promise;
|
|
107
|
+
}
|
|
108
|
+
function j(e) {
|
|
109
|
+
var r = O(e);
|
|
110
|
+
if (w(z(r)), delete p[r], !g[r]) {
|
|
111
|
+
var o, n, i = new Promise(function(l, t) {
|
|
112
|
+
o = l, n = t;
|
|
113
|
+
});
|
|
114
|
+
g[r] = {
|
|
115
|
+
resolve: o,
|
|
116
|
+
reject: n,
|
|
117
|
+
promise: i
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return g[r].promise;
|
|
121
|
+
}
|
|
122
|
+
var T = function(e) {
|
|
123
|
+
var r = O(e);
|
|
124
|
+
w(B(r)), delete p[r], delete g[r];
|
|
125
|
+
}, K = function(e, r) {
|
|
126
|
+
w(q(e, r));
|
|
127
|
+
};
|
|
128
|
+
function U(e, r) {
|
|
129
|
+
var o = k(y), n = k(V), i = null, l = e && typeof e != "string";
|
|
130
|
+
if (e ? i = O(e) : i = n, !i)
|
|
131
|
+
throw new Error("No modal id found in NiceModal.useModal.");
|
|
132
|
+
var t = i;
|
|
133
|
+
b(function() {
|
|
134
|
+
l && !s[t] && N(t, e, r);
|
|
135
|
+
}, [l, t, e, r]);
|
|
136
|
+
var a = o[t], c = m(function(M) {
|
|
137
|
+
return D(t, M);
|
|
138
|
+
}, [t]), f = m(function() {
|
|
139
|
+
return j(t);
|
|
140
|
+
}, [t]), h = m(function() {
|
|
141
|
+
return T(t);
|
|
142
|
+
}, [t]), I = m(function(M) {
|
|
143
|
+
var v;
|
|
144
|
+
(v = p[t]) === null || v === void 0 || v.resolve(M), delete p[t];
|
|
145
|
+
}, [t]), E = m(function(M) {
|
|
146
|
+
var v;
|
|
147
|
+
(v = p[t]) === null || v === void 0 || v.reject(M), delete p[t];
|
|
148
|
+
}, [t]), _ = m(function(M) {
|
|
149
|
+
var v;
|
|
150
|
+
(v = g[t]) === null || v === void 0 || v.resolve(M), delete g[t];
|
|
151
|
+
}, [t]);
|
|
152
|
+
return L(function() {
|
|
153
|
+
return {
|
|
154
|
+
id: t,
|
|
155
|
+
args: a == null ? void 0 : a.args,
|
|
156
|
+
visible: !!(a != null && a.visible),
|
|
157
|
+
keepMounted: !!(a != null && a.keepMounted),
|
|
158
|
+
show: c,
|
|
159
|
+
hide: f,
|
|
160
|
+
remove: h,
|
|
161
|
+
resolve: I,
|
|
162
|
+
reject: E,
|
|
163
|
+
resolveHide: _
|
|
164
|
+
};
|
|
165
|
+
}, [
|
|
166
|
+
t,
|
|
167
|
+
a == null ? void 0 : a.args,
|
|
168
|
+
a == null ? void 0 : a.visible,
|
|
169
|
+
a == null ? void 0 : a.keepMounted,
|
|
170
|
+
c,
|
|
171
|
+
f,
|
|
172
|
+
h,
|
|
173
|
+
I,
|
|
174
|
+
E,
|
|
175
|
+
_
|
|
176
|
+
]);
|
|
177
|
+
}
|
|
178
|
+
var Q = function(e) {
|
|
179
|
+
return function(r) {
|
|
180
|
+
var o, n = r.defaultVisible, i = r.keepMounted, l = r.id, t = S(r, ["defaultVisible", "keepMounted", "id"]), a = U(l), c = a.args, f = a.show, h = k(y), I = !!h[l];
|
|
181
|
+
b(function() {
|
|
182
|
+
return n && f(), C[l] = !0, function() {
|
|
183
|
+
delete C[l];
|
|
184
|
+
};
|
|
185
|
+
}, [l, f, n]), b(function() {
|
|
186
|
+
i && K(l, { keepMounted: !0 });
|
|
187
|
+
}, [l, i]);
|
|
188
|
+
var E = (o = h[l]) === null || o === void 0 ? void 0 : o.delayVisible;
|
|
189
|
+
return b(function() {
|
|
190
|
+
E && f(c);
|
|
191
|
+
}, [E, c, f]), I ? u.createElement(
|
|
192
|
+
V.Provider,
|
|
193
|
+
{ value: l },
|
|
194
|
+
u.createElement(e, d({}, t, c))
|
|
195
|
+
) : null;
|
|
196
|
+
};
|
|
197
|
+
}, N = function(e, r, o) {
|
|
198
|
+
s[e] ? s[e].props = o : s[e] = { comp: r, props: o };
|
|
199
|
+
}, W = function(e) {
|
|
200
|
+
delete s[e];
|
|
201
|
+
}, R = function() {
|
|
202
|
+
var e = k(y), r = Object.keys(e).filter(function(n) {
|
|
203
|
+
return !!e[n];
|
|
204
|
+
});
|
|
205
|
+
r.forEach(function(n) {
|
|
206
|
+
if (!s[n] && !C[n]) {
|
|
207
|
+
console.warn("No modal found for id: " + n + ". Please check the id or if it is registered or declared via JSX.");
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
var o = r.filter(function(n) {
|
|
212
|
+
return s[n];
|
|
213
|
+
}).map(function(n) {
|
|
214
|
+
return d({ id: n }, s[n]);
|
|
215
|
+
});
|
|
216
|
+
return u.createElement(u.Fragment, null, o.map(function(n) {
|
|
217
|
+
return u.createElement(n.comp, d({ key: n.id, id: n.id }, n.props));
|
|
218
|
+
}));
|
|
219
|
+
}, Z = function(e) {
|
|
220
|
+
var r = e.children, o = Y(F, x), n = o[0];
|
|
221
|
+
return w = o[1], u.createElement(
|
|
222
|
+
y.Provider,
|
|
223
|
+
{ value: n },
|
|
224
|
+
r,
|
|
225
|
+
u.createElement(R, null)
|
|
226
|
+
);
|
|
227
|
+
}, $ = function(e) {
|
|
228
|
+
var r = e.children, o = e.dispatch, n = e.modals;
|
|
229
|
+
return !o || !n ? u.createElement(Z, null, r) : (w = o, u.createElement(
|
|
230
|
+
y.Provider,
|
|
231
|
+
{ value: n },
|
|
232
|
+
r,
|
|
233
|
+
u.createElement(R, null)
|
|
234
|
+
));
|
|
235
|
+
}, ee = function(e) {
|
|
236
|
+
var r = e.id, o = e.component;
|
|
237
|
+
return b(function() {
|
|
238
|
+
return N(r, o), function() {
|
|
239
|
+
W(r);
|
|
240
|
+
};
|
|
241
|
+
}, [r, o]), null;
|
|
242
|
+
}, re = function(e) {
|
|
243
|
+
var r, o = e.modal, n = e.handler, i = n === void 0 ? {} : n, l = S(e, ["modal", "handler"]), t = L(function() {
|
|
244
|
+
return A();
|
|
245
|
+
}, []), a = typeof o == "string" ? (r = s[o]) === null || r === void 0 ? void 0 : r.comp : o;
|
|
246
|
+
if (!i)
|
|
247
|
+
throw new Error("No handler found in NiceModal.ModalHolder.");
|
|
248
|
+
if (!a)
|
|
249
|
+
throw new Error("No modal found for id: " + o + " in NiceModal.ModalHolder.");
|
|
250
|
+
return i.show = m(function(c) {
|
|
251
|
+
return D(t, c);
|
|
252
|
+
}, [t]), i.hide = m(function() {
|
|
253
|
+
return j(t);
|
|
254
|
+
}, [t]), u.createElement(a, d({ id: t }, l));
|
|
255
|
+
}, ne = function(e) {
|
|
256
|
+
return {
|
|
257
|
+
visible: e.visible,
|
|
258
|
+
onOk: function() {
|
|
259
|
+
return e.hide();
|
|
260
|
+
},
|
|
261
|
+
onCancel: function() {
|
|
262
|
+
return e.hide();
|
|
263
|
+
},
|
|
264
|
+
afterClose: function() {
|
|
265
|
+
e.resolveHide(), e.keepMounted || e.remove();
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
}, oe = function(e) {
|
|
269
|
+
return {
|
|
270
|
+
visible: e.visible,
|
|
271
|
+
onClose: function() {
|
|
272
|
+
return e.hide();
|
|
273
|
+
},
|
|
274
|
+
afterVisibleChange: function(r) {
|
|
275
|
+
r || e.resolveHide(), !r && !e.keepMounted && e.remove();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}, te = function(e) {
|
|
279
|
+
return {
|
|
280
|
+
open: e.visible,
|
|
281
|
+
onClose: function() {
|
|
282
|
+
return e.hide();
|
|
283
|
+
},
|
|
284
|
+
onExited: function() {
|
|
285
|
+
e.resolveHide(), !e.keepMounted && e.remove();
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}, ie = function(e) {
|
|
289
|
+
return {
|
|
290
|
+
show: e.visible,
|
|
291
|
+
onHide: function() {
|
|
292
|
+
return e.hide();
|
|
293
|
+
},
|
|
294
|
+
onExited: function() {
|
|
295
|
+
e.resolveHide(), !e.keepMounted && e.remove();
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}, H = {
|
|
299
|
+
Provider: $,
|
|
300
|
+
ModalDef: ee,
|
|
301
|
+
ModalHolder: re,
|
|
302
|
+
NiceModalContext: y,
|
|
303
|
+
create: Q,
|
|
304
|
+
register: N,
|
|
305
|
+
getModal: J,
|
|
306
|
+
show: D,
|
|
307
|
+
hide: j,
|
|
308
|
+
remove: T,
|
|
309
|
+
useModal: U,
|
|
310
|
+
reducer: F,
|
|
311
|
+
antdModal: ne,
|
|
312
|
+
antdDrawer: oe,
|
|
313
|
+
muiDialog: te,
|
|
314
|
+
bootstrapDialog: ie
|
|
315
|
+
};
|
|
316
|
+
const le = () => {
|
|
317
|
+
const e = k(H.NiceModalContext), r = Object.keys(e).length > 0;
|
|
318
|
+
return b(() => {
|
|
7
319
|
const o = () => {
|
|
8
|
-
Object.values(e).forEach((
|
|
320
|
+
Object.values(e).forEach((n) => H.remove(n.id));
|
|
9
321
|
};
|
|
10
322
|
return window.addEventListener("popstate", o), () => {
|
|
11
323
|
window.removeEventListener("popstate", o);
|
|
12
324
|
};
|
|
13
|
-
}, [e]),
|
|
325
|
+
}, [e]), b(() => (r ? document.body.classList.add("stop-scroll") : document.body.classList.remove("stop-scroll"), () => {
|
|
14
326
|
document.body.classList.remove("stop-scroll");
|
|
15
|
-
}), [
|
|
327
|
+
}), [r]), r;
|
|
16
328
|
};
|
|
17
329
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
330
|
+
le as useModalData,
|
|
331
|
+
ce as useMounted
|
|
20
332
|
};
|
package/dist/styles/mixins.scss
CHANGED
|
@@ -248,3 +248,84 @@ $color-tooltip-text-dark: #000;
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
+
|
|
252
|
+
$color-loading-01: color.change($color-dark, $alpha: 0.15);
|
|
253
|
+
$color-loading-02: color.change($color-dark, $alpha: 0.25);
|
|
254
|
+
$color-loading-03: color.change($color-dark, $alpha: 0.35);
|
|
255
|
+
$color-loading-01-dark: color.change($color-light, $alpha: 0.15);
|
|
256
|
+
$color-loading-02-dark: color.change($color-light, $alpha: 0.25);
|
|
257
|
+
$color-loading-03-dark: color.change($color-light, $alpha: 0.35);
|
|
258
|
+
|
|
259
|
+
@keyframes loading {
|
|
260
|
+
0% {
|
|
261
|
+
background: $color-loading-02;
|
|
262
|
+
box-shadow:
|
|
263
|
+
0.875rem 0 $color-loading-01,
|
|
264
|
+
-0.875rem 0 $color-loading-03;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
33% {
|
|
268
|
+
background: $color-loading-03;
|
|
269
|
+
box-shadow:
|
|
270
|
+
0.875rem 0 $color-loading-02,
|
|
271
|
+
-0.875rem 0 $color-loading-01;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
66% {
|
|
275
|
+
background: $color-loading-01;
|
|
276
|
+
box-shadow:
|
|
277
|
+
0.875rem 0 $color-loading-03,
|
|
278
|
+
-0.875rem 0 $color-loading-02;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
100% {
|
|
282
|
+
background: $color-loading-02;
|
|
283
|
+
box-shadow:
|
|
284
|
+
0.875rem 0 $color-loading-01,
|
|
285
|
+
-0.875rem 0 $color-loading-03;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@keyframes loading-dark {
|
|
290
|
+
0% {
|
|
291
|
+
background: $color-loading-02-dark;
|
|
292
|
+
box-shadow:
|
|
293
|
+
0.875rem 0 $color-loading-01-dark,
|
|
294
|
+
-0.875rem 0 $color-loading-03-dark;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
33% {
|
|
298
|
+
background: $color-loading-03-dark;
|
|
299
|
+
box-shadow:
|
|
300
|
+
0.875rem 0 $color-loading-02-dark,
|
|
301
|
+
-0.875rem 0 $color-loading-01-dark;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
66% {
|
|
305
|
+
background: $color-loading-01-dark;
|
|
306
|
+
box-shadow:
|
|
307
|
+
0.875rem 0 $color-loading-03-dark,
|
|
308
|
+
-0.875rem 0 $color-loading-02-dark;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
100% {
|
|
312
|
+
background: $color-loading-02-dark;
|
|
313
|
+
box-shadow:
|
|
314
|
+
0.875rem 0 $color-loading-01-dark,
|
|
315
|
+
-0.875rem 0 $color-loading-03-dark;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
@keyframes pulse {
|
|
320
|
+
0% {
|
|
321
|
+
opacity: 0.6;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
50% {
|
|
325
|
+
opacity: 1;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
100% {
|
|
329
|
+
opacity: 0.6;
|
|
330
|
+
}
|
|
331
|
+
}
|