Commit de072d17 authored by 吴志俊's avatar 吴志俊

add dist

parent 2e8b9650
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.React);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(e){return(()=>{"use strict";var t={261:(e,t,n)=>{n.r(t),n.d(t,{AllModals:()=>a,default:()=>g});var r=n(888),o=n.n(r);const a=o().createContext(),l=e=>(e.preventDefault&&e.preventDefault(),e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),!1),c=(e,t)=>function(){e(...arguments),t()},i=(e,t)=>o().Children.map(e,((e,n)=>o().isValidElement(e)&&"string"!=typeof e.type?o().cloneElement(e,{...t}):e)),s=()=>{const[,e]=(0,r.useReducer)((e=>[]),null);return e},u=(e=window,t,n,o={})=>{let{current:a}=(0,r.useRef)();a=n,(0,r.useEffect)((()=>{if(!e||!e.addEventListener)return;const n=e=>a(e);return e.addEventListener(t,n,{capture:!!o.capture,once:!!o.once,passive:!!o.passice}),()=>e.removeEventListener(t,n,{capture:!!o.capture})}),[e,t,o.capture,o.once,o.passice])},d=(e,t)=>{const{current:n}=(0,r.useRef)([]),{current:a}=(0,r.useRef)([]),l=(0,r.useCallback)(((t,r)=>{if(!e.hasOwnProperty(t))throw new ReferenceError("ModalRouter: In the map you provided, key didn't matched");a.push(t),n.push(r)}),[e]),c=(0,r.useCallback)(((e,t)=>l(e,t)),[e]),i=(0,r.useCallback)(t?e=>{let t=a.findIndex(((t,n)=>t===e));-1!==t?(a.splice(t,1),n.splice(t,1)):(a.pop(),n.pop())}:()=>u(),[t]),s=(0,r.useCallback)((e=>{i(e)}),[]),u=(0,r.useCallback)((()=>{a.length=0,n.length=0}),[]),d=(0,r.useCallback)(t?()=>a.map(((t,r)=>f(e[t],n[r],t+r))):()=>a.length?[f(e[a.slice(-1)[0]],n.slice(-1)[0],a.slice(-1)[0]+0)]:null,[t,e]);function f(e,t,n){let r={modalData:t,openModal:c,closeModal:s,closeAllModal:u};return"object"!=typeof t||t[Symbol.iterator]||(r={...r,...t}),o().isValidElement(e)?o().cloneElement(e,{...r,key:n}):o().createElement(e,{...r,key:n})}return[a,n,{getModal:d,openModal:c,closeModal:s,closeAllModal:u}]};var f=n(379),p=n.n(f),m=n(528),v={insert:"head",singleton:!1};p()(m.Z,v);m.Z.locals;const h=({container:e,hidden:t,children:n,...a})=>{const c=(0,r.useRef)();if(u(c.current,"mousewheel",l),u(c.current,"touchmove",l),!t){if("function"==typeof e)return e.prototype.isReactComponent?o().createElement(e,a,n):o().cloneElement(e({children:n,funcs:a}));if(o().isValidElement(e))return o().cloneElement(e,a,n)}return o().createElement("div",{className:"HOC_modal",ref:c,style:{display:t?"none":"flex"}},n)},b=({contextMode:e,Provider:t,children:n,...a})=>e?o().createElement(t,{value:a},n):o().createElement(r.Fragment,null,n);const y=function({children:e,map:t,contextMode:n,container:l,...u}){const f=s(),[p,m,{getModal:v,openModal:y,closeModal:g,closeAllModal:M}]=d(t,!1),x={openModal:(0,r.useCallback)(c(y,f),[]),closeModal:(0,r.useCallback)(c(g,f),[]),closeAllModal:(0,r.useCallback)(c(M,f),[])},E=i(e,x);return o().createElement(r.Fragment,null,o().createElement(b,{contextMode:n,Provider:a.Provider,...x},E),o().createElement(h,{container:l,hidden:!p.length,...x},v()))};y.Multi=function({children:e,map:t,contextMode:n,container:l,...u}){const f=s(),[p,m,{getModal:v,openModal:y,closeModal:g,closeAllModal:M}]=d(t,!0),x={openModal:(0,r.useCallback)(c(y,f),[]),closeModal:(0,r.useCallback)(c(g,f),[]),closeAllModal:(0,r.useCallback)(c(M,f),[])},E=i(e,x);return o().createElement(r.Fragment,null,o().createElement(b,{contextMode:n,Provider:a.Provider,...x},E),o().createElement(h,{container:l,hidden:!p.length,...x},v()))};const g=y},528:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".HOC_modal {\r\n position: fixed;\r\n width: 100%;\r\n height: 100%;\r\n top: 0;\r\n left: 0;\r\n background-color: rgba(0, 0, 0, 0.7);\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 2;\r\n}\r\n",""]);const a=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var i=[].concat(e[c]);r&&o[i[0]]||(n&&(i[2]?i[2]="".concat(n," and ").concat(i[2]):i[2]=n),t.push(i))}},t}},379:(e,t,n)=>{var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),l=[];function c(e){for(var t=-1,n=0;n<l.length;n++)if(l[n].identifier===e){t=n;break}return t}function i(e,t){for(var n={},r=[],o=0;o<e.length;o++){var a=e[o],i=t.base?a[0]+t.base:a[0],s=n[i]||0,u="".concat(i," ").concat(s);n[i]=s+1;var d=c(u),f={css:a[1],media:a[2],sourceMap:a[3]};-1!==d?(l[d].references++,l[d].updater(f)):l.push({identifier:u,updater:h(f,t),references:1}),r.push(u)}return r}function s(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var l=a(e.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function f(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var a=document.createTextNode(o),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(a,l[t]):e.appendChild(a)}}function p(e,t,n){var r=n.css,o=n.media,a=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var m=null,v=0;function h(e,t){var n,r,o;if(t.singleton){var a=v++;n=m||(m=s(t)),r=f.bind(null,n,a,!1),o=f.bind(null,n,a,!0)}else n=s(t),r=p.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=i(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=c(n[r]);l[o].references--}for(var a=i(e,t),s=0;s<n.length;s++){var u=c(n[s]);0===l[u].references&&(l[u].updater(),l.splice(u,1))}n=a}}}},888:t=>{t.exports=e}},n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={id:e,exports:{}};return t[e](o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(261)})()}));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment