@kordar/easyui 1.0.1 → 1.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/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var e,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),c=new L(r||[]);return i(a,"_invoke",{value:j(t,n,c)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var m="suspendedStart",v="suspendedYield",p="executing",y="completed",b={};function g(){}function w(){}function E(){}var k={};f(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(T([])));O&&O!==r&&o.call(O,c)&&(k=O);var C=E.prototype=g.prototype=Object.create(k);function x(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(r,i,a,c){var l=d(t[r],t,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==s(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function j(t,n,r){var o=m;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=P(c,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=d(t,n,r);if("normal"===u.type){if(o=r.done?y:v,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function T(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(s(t)+" is not iterable")}return w.prototype=E,i(C,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:w,configurable:!0}),w.displayName=f(E,u,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,f(t,u,"GeneratorFunction")),t.prototype=Object.create(C),t},n.awrap=function(t){return{__await:t}},x(N.prototype),f(N.prototype,l,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new N(h(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(C),f(C,u,"Generator"),f(C,c,(function(){return this})),f(C,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=T,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},n}function e(t,e,n,r,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void n(t)}c.done?e(l):Promise.resolve(l).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,l,"next",t)}function l(t){e(a,o,i,c,l,"throw",t)}c(void 0)}))}}function r(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}import f,{useRef as h,useState as d,forwardRef as m,useImperativeHandle as v,useEffect as p}from"react";import{setLanguage as y}from"@kordar-lib/i18n";import{useAppDispatch as b,useAppSelector as g,setLocale as w,setAppTheme as E}from"@kordar-lib/reducers";import{SwitchListImagesHooks as k,CheckAccessHooks as S,FormDataHooks as O,TableSelectionHooks as C,CheckboxAllHooks as x,DialogHooks as N,RefDialogHooks as j,FormDialogHooks as P,SwitchListImagesHookType as D,CheckAccessEleType as A,CheckboxAllHookState as L,FormDialogHookType as T,DefaultTableContext as R,executeCondition as _,Mutex as z}from"@kordar-lib/base";import{MenuTree as F}from"@kordar-lib/menus";import{Messager as I,SideMenu as H,Tabs as V,TabPanel as q,Panel as G}from"rc-easyui";import B from"react-dom";import U from"rc-drawer";var M=f.createRef(),W=f.createRef(),Y=f.createRef();function $(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Alert",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Here is a message!",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0;return null===(t=M.current)||void 0===t?void 0:t.alert({title:e,msg:n,icon:"k iconfont icon-msg-"+r,content:o})}function J(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Confirm",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Are you confirm this?",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(t=W.current)||void 0===t?void 0:t.prompt({title:e,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(t){t?i&&i():a&&a()}})}function K(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Prompt",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Please type something",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(t=Y.current)||void 0===t?void 0:t.confirm({title:e,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(t){t?i&&i(t):a&&a()}})}function Q(t,e){return t.forEach((function(t){-1!==e.findIndex((function(e){return e==t.id}))?(t.state="open",t.selected=!0):(t.state="closed",t.selected=!1)})),t}function X(t,e,n){for(var r=[],o=0;o<t.length;o++){var i=t[o];r.push({value:i[e],text:i[n]})}return r}function Z(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=b(),n=g((function(t){return t.app.localeOptions}));return{locale:g((function(t){return t.app.locale})),localeOptions:n,changeLocale:function(n){e(w({locale:n,callback:function(){y(n,(function(e){t&&setTimeout((function(){window.location.reload()}),500)}))}}))}}}function tt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"//unpkg.com/rc-easyui@1.2.9/dist/themes/",e=g((function(t){return t.app.theme})),n=b(),r=function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)};return{changeTheme:function(t){n(E(t)),window.location.reload()},themeOptions:[{name:"default",key:"default"},{name:"black",key:"black"},{name:"gray",key:"gray"},{name:"bootstrap",key:"bootstrap"},{name:"material",key:"material"},{name:"material-blue",key:"material-blue"},{name:"material-teal",key:"material-teal"},{name:"metro",key:"metro"}],loadHtmlTheme:function(){e?(r(t+e+"/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",e)}):(r(t+"/default/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",e)}),r(t+"/icon.css"),r(t+"/react.css")}}}function et(t){return(et="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":s(t)})(t)}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function rt(t,e,n){return e=ct(e),function(t,e){if(e&&("object"==et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ut()?Reflect.construct(e,n||[],ct(t).constructor):e.apply(t,n))}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mt(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function at(t,e,n){return(e=mt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ct(t)}function lt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ht(t,e)}function ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ut=function(){return!!t})()}function st(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ft(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?st(Object(n),!0).forEach((function(e){at(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ht(t,e){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(t,e)}function dt(t){return function(t){if(Array.isArray(t))return nt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return nt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mt(t){var e=function(t){if("object"!=et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==et(e)?e:e+""}it((function t(e,n){ot(this,t),this.options=e,this.navigate=n,this.autoRedirect.bind(this),this.toHistory.bind(this),this.toLogin.bind(this),this.saveHistoryLocation.bind(this)}),[{key:"autoRedirect",value:function(){this.options.isGuest()?"/login"!==this.options.location.pathname&&this.toLogin():"/login"===this.options.location.pathname&&this.toHistory()}},{key:"toHistory",value:function(){var t=this.options.history;null==t||""===t.pathname?this.navigate("/"):this.navigate(t)}},{key:"toLogin",value:function(){this.navigate("/login")}},{key:"saveHistoryLocation",value:function(){this.options.saveHistoryLocation(this.options.location)}}]),function(){function t(e,n,r){var o;return ot(this,t),(o=rt(this,t,[e])).setState=n,o.callback=r,o.callback&&o.callback.bind(o),o.setState.bind(o),o}lt(t,k.AbstractHook),it(t,[{key:"toggle",value:function(){var t;this.state===D.List?this.setState(D.Image):this.setState(D.List),null===(t=this.callback)||void 0===t||t.call(this,this.state)}}])}(),function(){function t(e,n){var r;return ot(this,t),(r=rt(this,t,[e])).options=n,r}lt(t,S.AbstractHook),it(t,[{key:"can",value:function(t){var e;if(!this.items.has(t))return!1;var n=this.options.AndCan,r=this.options.OrCan,o=this.options.Permissions,i=this.items.get(t);if(null!=i)switch(i.type){case A.AND:return n.apply(void 0,dt(i.value));case A.OR:return r.apply(void 0,dt(i.value));case A.FUNC:return null===(e=i.func)||void 0===e?void 0:e.call(i,{type:i.type,value:i.value,key:i.key},o())}return!1}}])}(),function(){function t(e,n){var r;return ot(this,t),(r=rt(this,t,[e])).setFormData=n,r.setFormData.bind(r),r}lt(t,O.AbstractHook),it(t,[{key:"load",value:function(t){var e={};for(var n in this.data)e[n]=t[n];this.setFormData(e)}}])}(),function(){function t(e,n,r){var o;return ot(this,t),(o=rt(this,t,[e])).valueFn=r||function(t){return t.id},o.setValues=n,o}lt(t,C.AbstractHook),it(t,[{key:"selectionChange",value:function(t){var e=this,n=[];t.forEach((function(t){return n.push(e.valueFn(t))})),this.setValues(n)}},{key:"confirmValues",value:function(t){t&&t(this.values)}}])}(),function(){function t(e,n,r,o){var i;return ot(this,t),(i=rt(this,t,[e,r])).setItems=n,i.setState=o,i.setItems.bind(i),i.setState.bind(i),i}lt(t,x.AbstractHook),it(t,[{key:"selectAll",value:function(){this.setState(L.ALL)}},{key:"unSelectAll",value:function(){this.setState(L.NONE),this.setItems({})}},{key:"setValue",value:function(t,e){}},{key:"toggle",value:function(){this.state===L.NONE?this.selectAll():this.unSelectAll()}},{key:"selectBetween",value:function(t,e){}}])}(),function(){function t(e,n,r,o,i){var a;return ot(this,t),(a=rt(this,t,[e,i,r])).setSize=o,a.setVisible=n,a.setSize.bind(a),a.setVisible.bind(a),a}lt(t,N.AbstractHook),it(t,[{key:"open",value:function(){this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(t){this.setSize(t)}}])}();var vt=function(){function t(e,n,r){var o;return ot(this,t),(o=rt(this,t,[e])).openCallback=n,o.closeCallback=r,o.openCallback&&o.openCallback.bind(o),o.closeCallback&&o.closeCallback.bind(o),o}return lt(t,j.AbstractHook),it(t,[{key:"open",value:function(){var t,e,n;null===(t=(e=this.ref.current).open)||void 0===t||t.call(e),null===(n=this.openCallback)||void 0===n||n.call(this)}},{key:"close",value:function(){var t,e,n;null===(t=(e=this.ref.current).close)||void 0===t||t.call(e),null===(n=this.closeCallback)||void 0===n||n.call(this)}}])}();!function(){function t(e,n,r,o,i,a,c){var l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};return ot(this,t),(l=rt(this,t,[e,r,i,a])).defaultData=u,l.setSize=c,l.setVisible=o,l.setSize.bind(l),l.setVisible.bind(l),l.setFormData=n,l.setFormData.bind(l),l}lt(t,P.AbstractHook),it(t,[{key:"open",value:function(){var t={};for(var e in this.defaultData)t[e]=this.defaultData[e];this.setFormData(t),this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(t){this.setSize(t)}},{key:"load",value:function(t,e,n){if(n&&this.refreshWidth(n),t==T.UPDATE){var r={};for(var o in e)r[o]=e[o];this.setFormData(r)}}}])}();var pt=function(){function t(){var e;ot(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return at(e=rt(this,t,[].concat(r)),"initSearch",!1),at(e,"isTreeData",!1),at(e,"largeSize",999999),e}return lt(t,R),it(t,[{key:"search",value:function(t){var e=this;this.initSearch?(this.publish("reload:start"),this.renderData(t)):(t&&(this.tableRequest=ft(ft({},this.tableRequest),t)),this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(ft(ft({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(n){e.publish("fetch",n),e.publish("reload:end",{loading:!1}),e.renderData(t)})),this.loading=!1),this.initSearch=!0)}},{key:"refresh",value:function(t){var e=this;this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(ft(ft({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(t){e.publish("fetch:reload",t),e.renderData()})),this.loading=!1)}},{key:"renderDataData",value:function(t){this.publish("search:local",{conditions:t.conditions,page:t.page||this.config.defaultPageNumber,pageSize:t.pageSize||this.config.defaultPageSize})}},{key:"renderTreeData",value:function(t){this.publish("search:local-tree",{conditions:t.conditions,page:t.page||this.config.defaultPageNumber,pageSize:t.pageSize||this.config.defaultPageSize})}},{key:"renderData",value:function(t){t?this.tableRequest=ft(ft({},this.tableRequest),t):t=this.tableRequest,this.isTreeData?this.renderTreeData(t):this.renderDataData(t)}}])}(),yt=it((function t(e,n,r){ot(this,t),at(this,"version",0),this.ctx=e,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);it((function t(e,n){var r=this;ot(this,t),at(this,"originData",[]),at(this,"dependency",""),this.tableContext=new pt(e,n),this.tableContext.isTreeData=!!e.isTreeData,this.tableContext.setMethod("getOriginalData",(function(){return r.originData})),e.largeSize&&(this.tableContext.largeSize=e.largeSize)}),[{key:"load",value:function(t,e,n,r){var o=this;return this.tableContext.registerEvent("fetch:reload",(function(t){var r=t.data;o.originData=r,n(ft(ft({},e),{},{data:r,loading:!1,selectionValues:[]}))})),this.tableContext.registerEvent("search:local",(function(t){var r=t.conditions,i=t.page,a=t.pageSize,c=_(o.originData,r,i,a);n(ft(ft({},e),{},{data:c.data,loading:!1,total:c.count,pageNumber:i,selectionValues:[]}))})),this.tableContext.registerEvent("search:local-tree",(function(r){var i=r.conditions,a=r.page,c=r.pageSize,l=t.treeItemCallback;void 0===l&&(l=function(t){return t});var u=new F(o.originData).tree(0,l),s=_(u,i,a,c);n(ft(ft({},e),{},{data:s.data,loading:!1,total:s.count,pageNumber:a}))})),this.tableContext.registerEvent("reload:start",(function(){e.loading=!0,n(ft({},e))})),this.tableContext.registerEvent("table-version:incr",(function(t){t.value})),this.tableContext.registerEvent("checkbox:values",(function(t){})),this.tableContext.registerEvent("checkbox:clean",(function(t){})),this.tableContext.registerEvent("page:change",(function(t){t.number,t.size})),new yt(this.tableContext,e,r)}}]);var bt=it((function t(e,n,r){ot(this,t),at(this,"version",0),this.ctx=e,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);function gt(){var t=c(d(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),2),e=t[0],n=t[1],r=function(t,e){var n=h(null);return new vt(n,t,e)}();return{value:r,props:e,open:function(t){n(i(i({},e),t)),console.log(r,r.ref),r.open()},close:function(t){n(i(i({},e),t)),r.close()}}}it((function t(e,n){ot(this,t),this.dependency="",this.tableContext=new R(e,n)}),[{key:"load",value:function(t,e,n,r){return this.tableContext.registerEvent("fetch:save",(function(r){var o,i=r.data,a=r.count;setTimeout((function(){e.selectionValues=[],e.data=i,e.total=a,e.loading=!1,n(ft({},e))}),null!==(o=t.loadingTime)&&void 0!==o?o:200)})),this.tableContext.registerEvent("reload:start",(function(){e.loading=!0,e.selectionValues=[],n(ft({},e))})),this.tableContext.registerEvent("checkbox:values",(function(t){})),this.tableContext.registerEvent("checkbox:clean",(function(t){})),this.tableContext.registerEvent("page:change",(function(t){t.number,t.size})),new bt(this.tableContext,e,r)}}]);var wt,Et={};var kt=function(){if(wt)return Et;wt=1;var t=B;if("production"===process.env.NODE_ENV)Et.createRoot=t.createRoot,Et.hydrateRoot=t.hydrateRoot;else{var e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Et.createRoot=function(n,r){e.usingClientEntryPoint=!0;try{return t.createRoot(n,r)}finally{e.usingClientEntryPoint=!1}},Et.hydrateRoot=function(n,r,o){e.usingClientEntryPoint=!0;try{return t.hydrateRoot(n,r,o)}finally{e.usingClientEntryPoint=!1}}}return Et}(),St=f.createRef();var Ot=function(t,e,n){var r;return null===(r=St.current)||void 0===r?void 0:r.alert({title:n,icon:t,msg:e})};!function(){if(null===St.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(I,{ref:St}))}}();var Ct={info:function(t,e){return Ot("info",e,t)},warning:function(t,e){return Ot("warning",e,t)},error:function(t,e){return Ot("error",e,t)},question:function(t,e){return Ot("question",e,t)}},xt=f.createRef();var Nt=function(t,e,n,r,o){var i,a;return"confirm"===t?null===(i=xt.current)||void 0===i?void 0:i.confirm({title:n,msg:e,result:function(t){t?null==r||r():null==o||o()}}):"prompt"===t?null===(a=xt.current)||void 0===a?void 0:a.prompt({title:n,msg:e,result:function(t){t?r(t):null==o||o()}}):void 0};!function(){if(null===xt.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(I,{ref:xt}))}}();var jt=function(t,e,n,r){return Nt("confirm",e,t,n,r)},Pt=function(t,e,n,r){return Nt("prompt",e,t,n,r)},Dt={confirm:function(t,e,n,r){return Nt("confirm",e,t,n,r)},prompt:function(t,e,n,r){return Nt("prompt",e,t,n,r)}},At=function(t){var e=t.title,n=t.message,r=t.type,o=t.duration,i=void 0===o?5e3:o,a=t.onClose;return p((function(){var t=setTimeout((function(){a&&a()}),i);return function(){return clearTimeout(t)}}),[i,a]),f.createElement("div",{className:"notification ".concat(r)},f.createElement("div",{className:"notification-title"},f.createElement("h2",{className:"notification-title-head"},e),f.createElement("span",{onClick:function(){return a()},className:"notification-title-close iconfont icon-cancel"})),f.createElement("div",{className:"notification-content"},n))},Lt=new z,Tt=m((function(e,o){var i=c(d([]),2),a=i[0],l=i[1],u=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3,i=Date.now();l((function(a){return[].concat(r(a),[{id:i,title:t,message:e,type:n,duration:o}])}))},s=function(t){l((function(e){return e.filter((function(e){return e.id!==t}))}))};v(o,(function(){return{show:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;n(t().mark((function n(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Lt.lock();case 2:a=t.sent;try{u(e,r,o,i)}finally{a()}case 4:case"end":return t.stop()}}),n)})))()},close:function(e){n(t().mark((function n(){var r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Lt.lock();case 2:r=t.sent;try{s(e)}finally{r()}case 4:case"end":return t.stop()}}),n)})))()}}}));return f.createElement("div",{className:"notification-container"},a.map((function(t){return f.createElement(At,{key:t.id,id:t.id,title:t.title,message:t.message,type:t.type,duration:(e=t.id,n=t.duration,n-(Date.now()-e)),onClose:function(){return s(t.id)}});var e,n})))})),Rt=f.createRef();var _t=function(t,e,n,r){var o;return null===(o=Rt.current)||void 0===o?void 0:o.show(n,e,t,r)};!function(){if(null===Rt.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(Tt,{ref:Rt}))}}();var zt={info:function(t,e,n){return _t("info",t,e,n)},warning:function(t,e,n){return _t("warning",t,e,n)},error:function(t,e,n){return _t("error",t,e,n)},success:function(t,e,n){return _t("success",t,e,n)},validate:function(t,e,n){return _t("error",(r=t,f.createElement("div",{className:"notification-validate"},r.map((function(t,e){return f.createElement("p",{key:e},t)})))),e,n);var r}},Ft=function(t){var e=t.message,n=t.type,r=t.duration,o=void 0===r?5e3:r,i=t.onClose;return p((function(){var t=setTimeout((function(){i&&i()}),o);return function(){return clearTimeout(t)}}),[o,i]),f.createElement("div",{className:"toast ".concat(n)},f.createElement("div",{className:"toast-content"},f.createElement("span",null,e),f.createElement("span",{onClick:function(){return i()},className:"toast-content-close iconfont icon-cancel"})))},It=new z,Ht=m((function(e,o){var i=c(d([]),2),a=i[0],l=i[1],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=Date.now();l((function(i){return[].concat(r(i),[{id:o,message:t,type:e,duration:n}])}))},s=function(t){l((function(e){return e.filter((function(e){return e.id!==t}))}))};v(o,(function(){return{show:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;n(t().mark((function n(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,It.lock();case 2:i=t.sent;try{u(e,r,o)}finally{i()}case 4:case"end":return t.stop()}}),n)})))()},close:function(e){n(t().mark((function n(){var r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,It.lock();case 2:r=t.sent;try{s(e)}finally{r()}case 4:case"end":return t.stop()}}),n)})))()}}}));return f.createElement("div",{className:"toast-container"},a.map((function(t){return f.createElement(Ft,{key:t.id,id:t.id,message:t.message,type:t.type,duration:(e=t.id,n=t.duration,n-(Date.now()-e)),onClose:function(){return s(t.id)}});var e,n})))})),Vt=f.createRef();var qt=function(t,e,n){var r;return null===(r=Vt.current)||void 0===r?void 0:r.show(e,t,n)};!function(){if(null===Vt.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(Ht,{ref:Vt}))}}();var Gt={info:function(t,e){return qt("info",t,e)},warning:function(t,e){return qt("warning",t,e)},error:function(t,e){return qt("error",t,e)},success:function(t,e){return qt("success",t,e)}},Bt=function(t){var e=t.children,n=t.collapsed,r=t.logo,o=t.title,a=t.slots,l=t.menus,u=t.sidebarCfg,s=t.toggle,m=t.onSideMenuSelection,v=t.selection,y=c(d(600),2),b=y[0],g=y[1],w=h(null),E=function(){return{width:n?50:200}};return p((function(){window.onload=function(t){var e=w.current.clientHeight;g(e)}}),[]),f.createElement("div",{className:"admin-layout f-column"},f.createElement("div",{className:"admin-layout-header f-row"},f.createElement("div",{className:"f-row f-full"},f.createElement("div",{className:"main-title f-animate f-row",style:E()},null!=a&&a.title?a.title:f.createElement(f.Fragment,null,f.createElement("img",{className:"app-logo",src:null!=r?r:"7f4f2d68782a7faf.png"}),n?"":null!=o?o:"App Layout")),f.createElement("div",{className:"main-bar f-full f-row"},f.createElement("div",{className:"f-inline-row f-content-center"},f.createElement("span",{className:"main-toggle label-icon icon-list ",onClick:function(){s&&s(!n)}})),f.createElement("div",{className:"f-row"},null==a?void 0:a.barLeft),f.createElement("div",{className:"f-row f-full main-bar-right"},null==a?void 0:a.barRight)))),f.createElement("div",{className:"admin-layout-body f-full"},f.createElement("div",{className:"sidebar-body f-animate",style:E()},!n&&(null==a?void 0:a.userPanel),f.createElement(H,i(i({style:E(),menuCls:"admin-sidemenu",data:l||[],collapsed:n,selection:v},u),{},{onSelectionChange:function(t){return function(t){m&&m(t)}(t)}}))),f.createElement("div",{className:"main-body",ref:w},f.createElement("div",{className:"f-column admin-layout-container",style:{height:b-46}},e),f.createElement("div",{className:"f-column admin-layout-footer",style:{height:45}},null==a?void 0:a.footer))))},Ut=m((function(t,e){var n=t.tabsCfg,r=void 0===n?{}:n,o=t.tabPanelCfg,a=void 0===o?{}:o,c=t.data,l=void 0===c?[]:c,u=t.onTabClosed,s=t.onTabSelect;return f.createElement(f.Fragment,null,f.createElement(V,i(i({className:"admin-tabs-panel tabs-inner",ref:e},r),{},{onTabSelect:function(t){var e=t.props,n=e.id,r=e.title,o=e.path,i=e.type;s&&s({id:n,text:r,path:o,type:i})},onTabClose:function(t){u&&u(t)}}),l.map((function(t,e){return f.createElement(q,i(i({key:e},a),t))}))))})),Mt=function(t){var e=t.items,n=t.hasBack,r=t.toBack,o=t.to,i=t.separator,a=void 0===i?"/":i,c=t.backLabel,l=void 0===c?"Back":c,u=function(t,e){t.path&&o&&o(t,e)},s=function(t){var e=[];return t.path&&e.push("link"),t.iconCls&&e.push(t.iconCls),e.join(" ")};return f.createElement("div",{className:"admin-breadcrumb-layout"},f.createElement("div",{className:"admin-breadcrumb-plane"},function(){if(n)return f.createElement("div",{className:"admin-breadcrumb-back",onClick:r},f.createElement("span",{className:"iconfont icon-back"}),f.createElement("span",{className:"admin-breadcrumb-back-title"},l),f.createElement("span",{className:"admin-breadcrumb-back-s"},"|"))}(),f.createElement("div",{className:"admin-breadcrumb"},null==e?void 0:e.map((function(t,n){return function(t,e,n){var r;return n?f.createElement("div",{key:e,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(t),onClick:function(e){return u(t,e)}},t.label),f.createElement("span",{className:"admin-breadcrumb-separator"},null!==(r=t.separator)&&void 0!==r?r:a)):f.createElement("div",{key:e,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(t),onClick:function(e){return u(t,e)}},t.label))}(t,n,!!e&&n<e.length-1)})))))},Wt={maskMotion:{motionAppear:!0,motionName:"rc-drawer-mask-motion",onAppearEnd:console.warn},motion:function(t){return{motionAppear:!0,motionName:"rc-drawer-panel-motion-".concat(t)}}},Yt=m((function(t,e){var n=c(f.useState(!1),2),r=n[0],o=n[1];return v(e,(function(){return{toggle:function(){o(!r)}}})),f.createElement(U,i({open:r,onClose:function(){o(!1)},afterOpenChange:t.afterOpenChange,placement:t.placement,width:t.width},Wt),t.children)})),$t=function(t){var e=t.mode,n=t.children,r=t.header,o=t.footer;return f.createElement(G,{className:"admin-default-panel "+(null!=e?e:"none"),showHeader:!!r,showFooter:!!o,collapsible:!1,bodyCls:["admin-panel-body"].join(" "),border:!1,header:r,footer:o,headerCls:"admin-panel-header",footerCls:"admin-panel-footer"},f.createElement("div",{className:"admin-panel-body-content"},n))},Jt=function(t){var e=t.children,n=t.ctx,r=t.point;return f.createElement(f.Fragment,null,null!=n&&n.can(r)?e:null)};export{Ct as $alert,jt as $confirm,Dt as $interactive,zt as $notice,Pt as $prompt,Gt as $toast,Jt as Access,Bt as AdminLayout,$ as Alert,Mt as Breadcrumb,J as Confirm,$t as DefaultPanel,Yt as DrawerPanel,K as Prompt,Ut as TabsPanel,St as alertMessagerRef,xt as interactiveMessagerRef,M as messagerAlertRef,W as messagerConfirmRef,Y as messagerPromptRef,Rt as notificationRef,Q as setSideMenuState,X as toComboBox,Vt as toastRef,Z as useLocale,gt as useRefDialog,tt as useTheme};
|
|
1
|
+
function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var e,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),c=new L(r||[]);return i(a,"_invoke",{value:j(t,n,c)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var m="suspendedStart",v="suspendedYield",p="executing",y="completed",b={};function g(){}function w(){}function E(){}var k={};f(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(T([])));O&&O!==r&&o.call(O,c)&&(k=O);var C=E.prototype=g.prototype=Object.create(k);function x(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(r,i,a,c){var l=d(t[r],t,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==s(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function j(t,n,r){var o=m;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=P(c,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=d(t,n,r);if("normal"===u.type){if(o=r.done?y:v,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function T(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(s(t)+" is not iterable")}return w.prototype=E,i(C,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:w,configurable:!0}),w.displayName=f(E,u,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,f(t,u,"GeneratorFunction")),t.prototype=Object.create(C),t},n.awrap=function(t){return{__await:t}},x(N.prototype),f(N.prototype,l,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new N(h(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(C),f(C,u,"Generator"),f(C,c,(function(){return this})),f(C,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=T,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},n}function e(t,e,n,r,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void n(t)}c.done?e(l):Promise.resolve(l).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,l,"next",t)}function l(t){e(a,o,i,c,l,"throw",t)}c(void 0)}))}}function r(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}import f,{useRef as h,useState as d,forwardRef as m,useImperativeHandle as v,useEffect as p}from"react";import{setLanguage as y}from"@kordar-lib/i18n";import{useAppDispatch as b,useAppSelector as g,setLocale as w,setAppTheme as E}from"@kordar-lib/reducers";import{SwitchListImagesHooks as k,CheckAccessHooks as S,FormDataHooks as O,TableSelectionHooks as C,CheckboxAllHooks as x,DialogHooks as N,RefDialogHooks as j,FormDialogHooks as P,SwitchListImagesHookType as D,CheckAccessEleType as A,CheckboxAllHookState as L,FormDialogHookType as T,DefaultTableContext as R,executeCondition as _,Mutex as z}from"@kordar-lib/base";import{MenuTree as F}from"@kordar-lib/menus";import{Messager as I,SideMenu as H,Tabs as V,TabPanel as q,Panel as G}from"rc-easyui";import B from"react-dom";import U from"rc-drawer";var M=f.createRef(),W=f.createRef(),Y=f.createRef();function $(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Alert",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Here is a message!",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0;return null===(t=M.current)||void 0===t?void 0:t.alert({title:e,msg:n,icon:"k iconfont icon-msg-"+r,content:o})}function J(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Confirm",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Are you confirm this?",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(t=W.current)||void 0===t?void 0:t.prompt({title:e,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(t){t?i&&i():a&&a()}})}function K(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Prompt",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Please type something",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(t=Y.current)||void 0===t?void 0:t.confirm({title:e,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(t){t?i&&i(t):a&&a()}})}function Q(t,e){return t.forEach((function(t){-1!==e.findIndex((function(e){return e==t.id}))?(t.state="open",t.selected=!0):(t.state="closed",t.selected=!1)})),t}function X(t,e,n){for(var r=[],o=0;o<t.length;o++){var i=t[o];r.push({value:i[e],text:i[n]})}return r}function Z(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=b(),n=g((function(t){return t.app.localeOptions}));return{locale:g((function(t){return t.app.locale})),localeOptions:n,changeLocale:function(n){e(w({locale:n,callback:function(){y(n,(function(e){t&&setTimeout((function(){window.location.reload()}),500)}))}}))}}}function tt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"//unpkg.com/rc-easyui@1.2.9/dist/themes/",e=g((function(t){return t.app.theme})),n=b(),r=function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)};return{changeTheme:function(t){n(E(t)),window.location.reload()},themeOptions:[{name:"default",key:"default"},{name:"black",key:"black"},{name:"gray",key:"gray"},{name:"bootstrap",key:"bootstrap"},{name:"material",key:"material"},{name:"material-blue",key:"material-blue"},{name:"material-teal",key:"material-teal"},{name:"metro",key:"metro"}],loadHtmlTheme:function(){e?(r(t+e+"/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",e)}):(r(t+"/default/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",e)}),r(t+"/icon.css"),r(t+"/react.css")}}}function et(t){return(et="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":s(t)})(t)}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function rt(t,e,n){return e=ct(e),function(t,e){if(e&&("object"==et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ut()?Reflect.construct(e,n||[],ct(t).constructor):e.apply(t,n))}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mt(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function at(t,e,n){return(e=mt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ct(t)}function lt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ht(t,e)}function ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ut=function(){return!!t})()}function st(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ft(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?st(Object(n),!0).forEach((function(e){at(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ht(t,e){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(t,e)}function dt(t){return function(t){if(Array.isArray(t))return nt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return nt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mt(t){var e=function(t){if("object"!=et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==et(e)?e:e+""}it((function t(e,n){ot(this,t),this.options=e,this.navigate=n,this.autoRedirect.bind(this),this.toHistory.bind(this),this.toLogin.bind(this),this.saveHistoryLocation.bind(this)}),[{key:"autoRedirect",value:function(){this.options.isGuest()?"/login"!==this.options.location.pathname&&this.toLogin():"/login"===this.options.location.pathname&&this.toHistory()}},{key:"toHistory",value:function(){var t=this.options.history;null==t||""===t.pathname?this.navigate("/"):this.navigate(t)}},{key:"toLogin",value:function(){this.navigate("/login")}},{key:"saveHistoryLocation",value:function(){this.options.saveHistoryLocation(this.options.location)}}]),function(){function t(e,n,r){var o;return ot(this,t),(o=rt(this,t,[e])).setState=n,o.callback=r,o.callback&&o.callback.bind(o),o.setState.bind(o),o}lt(t,k.AbstractHook),it(t,[{key:"toggle",value:function(){var t;this.state===D.List?this.setState(D.Image):this.setState(D.List),null===(t=this.callback)||void 0===t||t.call(this,this.state)}}])}(),function(){function t(e,n){var r;return ot(this,t),(r=rt(this,t,[e])).options=n,r}lt(t,S.AbstractHook),it(t,[{key:"can",value:function(t){var e;if(!this.items.has(t))return!1;var n=this.options.AndCan,r=this.options.OrCan,o=this.options.Permissions,i=this.items.get(t);if(null!=i)switch(i.type){case A.AND:return n.apply(void 0,dt(i.value));case A.OR:return r.apply(void 0,dt(i.value));case A.FUNC:return null===(e=i.func)||void 0===e?void 0:e.call(i,{type:i.type,value:i.value,key:i.key},o())}return!1}}])}(),function(){function t(e,n){var r;return ot(this,t),(r=rt(this,t,[e])).setFormData=n,r.setFormData.bind(r),r}lt(t,O.AbstractHook),it(t,[{key:"load",value:function(t){var e={};for(var n in this.data)e[n]=t[n];this.setFormData(e)}}])}(),function(){function t(e,n,r){var o;return ot(this,t),(o=rt(this,t,[e])).valueFn=r||function(t){return t.id},o.setValues=n,o}lt(t,C.AbstractHook),it(t,[{key:"selectionChange",value:function(t){var e=this,n=[];t.forEach((function(t){return n.push(e.valueFn(t))})),this.setValues(n)}},{key:"confirmValues",value:function(t){t&&t(this.values)}}])}(),function(){function t(e,n,r,o){var i;return ot(this,t),(i=rt(this,t,[e,r])).setItems=n,i.setState=o,i.setItems.bind(i),i.setState.bind(i),i}lt(t,x.AbstractHook),it(t,[{key:"selectAll",value:function(){this.setState(L.ALL)}},{key:"unSelectAll",value:function(){this.setState(L.NONE),this.setItems({})}},{key:"setValue",value:function(t,e){}},{key:"toggle",value:function(){this.state===L.NONE?this.selectAll():this.unSelectAll()}},{key:"selectBetween",value:function(t,e){}}])}(),function(){function t(e,n,r,o,i){var a;return ot(this,t),(a=rt(this,t,[e,i,r])).setSize=o,a.setVisible=n,a.setSize.bind(a),a.setVisible.bind(a),a}lt(t,N.AbstractHook),it(t,[{key:"open",value:function(){this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(t){this.setSize(t)}}])}();var vt=function(){function t(e,n,r){var o;return ot(this,t),(o=rt(this,t,[e])).openCallback=n,o.closeCallback=r,o.openCallback&&o.openCallback.bind(o),o.closeCallback&&o.closeCallback.bind(o),o}return lt(t,j.AbstractHook),it(t,[{key:"open",value:function(){var t,e,n;null===(t=(e=this.ref.current).open)||void 0===t||t.call(e),null===(n=this.openCallback)||void 0===n||n.call(this)}},{key:"close",value:function(){var t,e,n;null===(t=(e=this.ref.current).close)||void 0===t||t.call(e),null===(n=this.closeCallback)||void 0===n||n.call(this)}}])}();!function(){function t(e,n,r,o,i,a,c){var l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};return ot(this,t),(l=rt(this,t,[e,r,i,a])).defaultData=u,l.setSize=c,l.setVisible=o,l.setSize.bind(l),l.setVisible.bind(l),l.setFormData=n,l.setFormData.bind(l),l}lt(t,P.AbstractHook),it(t,[{key:"open",value:function(){var t={};for(var e in this.defaultData)t[e]=this.defaultData[e];this.setFormData(t),this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(t){this.setSize(t)}},{key:"load",value:function(t,e,n){if(n&&this.refreshWidth(n),t==T.UPDATE){var r={};for(var o in e)r[o]=e[o];this.setFormData(r)}}}])}();var pt=function(){function t(){var e;ot(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return at(e=rt(this,t,[].concat(r)),"initSearch",!1),at(e,"isTreeData",!1),at(e,"largeSize",999999),e}return lt(t,R),it(t,[{key:"search",value:function(t){var e=this;this.initSearch?(this.publish("reload:start"),this.renderData(t)):(t&&(this.tableRequest=ft(ft({},this.tableRequest),t)),this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(ft(ft({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(n){e.publish("fetch",n),e.publish("reload:end",{loading:!1}),e.renderData(t)})),this.loading=!1),this.initSearch=!0)}},{key:"refresh",value:function(t){var e=this;this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(ft(ft({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(t){e.publish("fetch:reload",t),e.renderData()})),this.loading=!1)}},{key:"renderDataData",value:function(t){this.publish("search:local",{conditions:t.conditions,page:t.page||this.config.defaultPageNumber,pageSize:t.pageSize||this.config.defaultPageSize})}},{key:"renderTreeData",value:function(t){this.publish("search:local-tree",{conditions:t.conditions,page:t.page||this.config.defaultPageNumber,pageSize:t.pageSize||this.config.defaultPageSize})}},{key:"renderData",value:function(t){t?this.tableRequest=ft(ft({},this.tableRequest),t):t=this.tableRequest,this.isTreeData?this.renderTreeData(t):this.renderDataData(t)}}])}(),yt=it((function t(e,n,r){ot(this,t),at(this,"version",0),this.ctx=e,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);it((function t(e,n){var r=this;ot(this,t),at(this,"originData",[]),at(this,"dependency",""),this.tableContext=new pt(e,n),this.tableContext.isTreeData=!!e.isTreeData,this.tableContext.setMethod("getOriginalData",(function(){return r.originData})),e.largeSize&&(this.tableContext.largeSize=e.largeSize)}),[{key:"load",value:function(t,e,n,r){var o=this;return this.tableContext.registerEvent("fetch:reload",(function(t){var r=t.data;o.originData=r,n(ft(ft({},e),{},{data:r,loading:!1,selectionValues:[]}))})),this.tableContext.registerEvent("search:local",(function(t){var r=t.conditions,i=t.page,a=t.pageSize,c=_(o.originData,r,i,a);n(ft(ft({},e),{},{data:c.data,loading:!1,total:c.count,pageNumber:i,selectionValues:[]}))})),this.tableContext.registerEvent("search:local-tree",(function(r){var i=r.conditions,a=r.page,c=r.pageSize,l=t.treeItemCallback;void 0===l&&(l=function(t){return t});var u=new F(o.originData).tree(0,l),s=_(u,i,a,c);n(ft(ft({},e),{},{data:s.data,loading:!1,total:s.count,pageNumber:a}))})),this.tableContext.registerEvent("reload:start",(function(){e.loading=!0,n(ft({},e))})),this.tableContext.registerEvent("table-version:incr",(function(t){t.value})),this.tableContext.registerEvent("checkbox:values",(function(t){})),this.tableContext.registerEvent("checkbox:clean",(function(t){})),this.tableContext.registerEvent("page:change",(function(t){t.number,t.size})),new yt(this.tableContext,e,r)}}]);var bt=it((function t(e,n,r){ot(this,t),at(this,"version",0),this.ctx=e,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);function gt(){var t=c(d(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),2),e=t[0],n=t[1],r=function(t,e){var n=h(null);return new vt(n,t,e)}();return{value:r,props:e,open:function(t){n(i(i({},e),t)),console.log(r,r.ref),r.open()},close:function(t){n(i(i({},e),t)),r.close()}}}it((function t(e,n){ot(this,t),this.dependency="",this.tableContext=new R(e,n)}),[{key:"load",value:function(t,e,n,r){return this.tableContext.registerEvent("fetch:save",(function(r){var o,i=r.data,a=r.count;setTimeout((function(){e.selectionValues=[],e.data=i,e.total=a,e.loading=!1,n(ft({},e))}),null!==(o=t.loadingTime)&&void 0!==o?o:200)})),this.tableContext.registerEvent("reload:start",(function(){e.loading=!0,e.selectionValues=[],n(ft({},e))})),this.tableContext.registerEvent("checkbox:values",(function(t){})),this.tableContext.registerEvent("checkbox:clean",(function(t){})),this.tableContext.registerEvent("page:change",(function(t){t.number,t.size})),new bt(this.tableContext,e,r)}}]);var wt,Et={};var kt=function(){if(wt)return Et;wt=1;var t=B;if("production"===process.env.NODE_ENV)Et.createRoot=t.createRoot,Et.hydrateRoot=t.hydrateRoot;else{var e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Et.createRoot=function(n,r){e.usingClientEntryPoint=!0;try{return t.createRoot(n,r)}finally{e.usingClientEntryPoint=!1}},Et.hydrateRoot=function(n,r,o){e.usingClientEntryPoint=!0;try{return t.hydrateRoot(n,r,o)}finally{e.usingClientEntryPoint=!1}}}return Et}(),St=f.createRef();var Ot=function(t,e,n){var r;return null===(r=St.current)||void 0===r?void 0:r.alert({title:n,icon:t,msg:e})};!function(){if(null===St.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(I,{ref:St}))}}();var Ct={info:function(t,e){return Ot("info",e,t)},warning:function(t,e){return Ot("warning",e,t)},error:function(t,e){return Ot("error",e,t)},question:function(t,e){return Ot("question",e,t)}},xt=f.createRef();var Nt=function(t,e,n,r,o){var i,a;return"confirm"===t?null===(i=xt.current)||void 0===i?void 0:i.confirm({title:n,msg:e,result:function(t){t?null==r||r():null==o||o()}}):"prompt"===t?null===(a=xt.current)||void 0===a?void 0:a.prompt({title:n,msg:e,result:function(t){t?r(t):null==o||o()}}):void 0};!function(){if(null===xt.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(I,{ref:xt}))}}();var jt=function(t,e,n,r){return Nt("confirm",e,t,n,r)},Pt=function(t,e,n,r){return Nt("prompt",e,t,n,r)},Dt={confirm:function(t,e,n,r){return Nt("confirm",e,t,n,r)},prompt:function(t,e,n,r){return Nt("prompt",e,t,n,r)}},At=function(t){var e=t.message,n=t.type,r=t.duration,o=void 0===r?5e3:r,i=t.onClose;return p((function(){var t=setTimeout((function(){i&&i()}),o);return function(){return clearTimeout(t)}}),[o,i]),f.createElement("div",{className:"toast ".concat(n)},f.createElement("div",{className:"toast-content"},f.createElement("span",null,e),f.createElement("span",{onClick:function(){return i()},className:"toast-content-close iconfont icon-cancel"})))},Lt=new z,Tt=m((function(e,o){var i=c(d([]),2),a=i[0],l=i[1],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=Date.now();l((function(i){return[].concat(r(i),[{id:o,message:t,type:e,duration:n}])}))},s=function(t){l((function(e){return e.filter((function(e){return e.id!==t}))}))};v(o,(function(){return{show:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;n(t().mark((function n(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Lt.lock();case 2:i=t.sent;try{u(e,r,o)}finally{i()}case 4:case"end":return t.stop()}}),n)})))()},close:function(e){n(t().mark((function n(){var r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Lt.lock();case 2:r=t.sent;try{s(e)}finally{r()}case 4:case"end":return t.stop()}}),n)})))()}}}));return f.createElement("div",{className:"toast-container"},a.map((function(t){return f.createElement(At,{key:t.id,id:t.id,message:t.message,type:t.type,duration:(e=t.id,n=t.duration,n-(Date.now()-e)),onClose:function(){return s(t.id)}});var e,n})))})),Rt=f.createRef();function _t(){if(null===Rt.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(Tt,{ref:Rt}))}}var zt=function(t,e,n){var r;return _t(),null===(r=Rt.current)||void 0===r?void 0:r.show(e,t,n)};_t();var Ft={info:function(t,e){return zt("info",t,e)},warning:function(t,e){return zt("warning",t,e)},error:function(t,e){return zt("error",t,e)},success:function(t,e){return zt("success",t,e)}},It=function(t){var e=t.title,n=t.message,r=t.type,o=t.duration,i=void 0===o?5e3:o,a=t.onClose;return p((function(){var t=setTimeout((function(){a&&a()}),i);return function(){return clearTimeout(t)}}),[i,a]),f.createElement("div",{className:"notification ".concat(r)},f.createElement("div",{className:"notification-title"},f.createElement("h2",{className:"notification-title-head"},e),f.createElement("span",{onClick:function(){return a()},className:"notification-title-close iconfont icon-cancel"})),f.createElement("div",{className:"notification-content"},n))},Ht=new z,Vt=m((function(e,o){var i=c(d([]),2),a=i[0],l=i[1],u=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3,i=Date.now();l((function(a){return[].concat(r(a),[{id:i,title:t,message:e,type:n,duration:o}])}))},s=function(t){l((function(e){return e.filter((function(e){return e.id!==t}))}))};v(o,(function(){return{show:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;n(t().mark((function n(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ht.lock();case 2:a=t.sent;try{u(e,r,o,i)}finally{a()}case 4:case"end":return t.stop()}}),n)})))()},close:function(e){n(t().mark((function n(){var r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ht.lock();case 2:r=t.sent;try{s(e)}finally{r()}case 4:case"end":return t.stop()}}),n)})))()}}}));return f.createElement("div",{className:"notification-container"},a.map((function(t){return f.createElement(It,{key:t.id,id:t.id,title:t.title,message:t.message,type:t.type,duration:(e=t.id,n=t.duration,n-(Date.now()-e)),onClose:function(){return s(t.id)}});var e,n})))})),qt=f.createRef();function Gt(){if(null===qt.current){var t=document.createElement("div");document.body.appendChild(t),kt.createRoot(t).render(f.createElement(Vt,{ref:qt}))}}var Bt=function(t,e,n,r){var o;return Gt(),null===(o=qt.current)||void 0===o?void 0:o.show(n,e,t,r)};Gt();var Ut={info:function(t,e,n){return Bt("info",t,e,n)},warning:function(t,e,n){return Bt("warning",t,e,n)},error:function(t,e,n){return Bt("error",t,e,n)},success:function(t,e,n){return Bt("success",t,e,n)},validate:function(t,e,n){return Bt("error",(r=t,f.createElement("div",{className:"notification-validate"},r.map((function(t,e){return f.createElement("p",{key:e},t)})))),e,n);var r}},Mt=function(t){var e=t.children,n=t.collapsed,r=t.logo,o=t.title,a=t.slots,l=t.menus,u=t.sidebarCfg,s=t.toggle,m=t.onSideMenuSelection,v=t.selection,y=c(d(600),2),b=y[0],g=y[1],w=h(null),E=function(){return{width:n?50:200}};return p((function(){window.onload=function(t){var e=w.current.clientHeight;g(e)}}),[]),f.createElement("div",{className:"admin-layout f-column"},f.createElement("div",{className:"admin-layout-header f-row"},f.createElement("div",{className:"f-row f-full"},f.createElement("div",{className:"main-title f-animate f-row",style:E()},null!=a&&a.title?a.title:f.createElement(f.Fragment,null,f.createElement("img",{className:"app-logo",src:null!=r?r:"7f4f2d68782a7faf.png"}),n?"":null!=o?o:"App Layout")),f.createElement("div",{className:"main-bar f-full f-row"},f.createElement("div",{className:"f-inline-row f-content-center"},f.createElement("span",{className:"main-toggle label-icon icon-list ",onClick:function(){s&&s(!n)}})),f.createElement("div",{className:"f-row"},null==a?void 0:a.barLeft),f.createElement("div",{className:"f-row f-full main-bar-right"},null==a?void 0:a.barRight)))),f.createElement("div",{className:"admin-layout-body f-full"},f.createElement("div",{className:"sidebar-body f-animate",style:E()},!n&&(null==a?void 0:a.userPanel),f.createElement(H,i(i({style:E(),menuCls:"admin-sidemenu",data:l||[],collapsed:n,selection:v},u),{},{onSelectionChange:function(t){return function(t){m&&m(t)}(t)}}))),f.createElement("div",{className:"main-body",ref:w},f.createElement("div",{className:"f-column admin-layout-container",style:{height:b-46}},e),f.createElement("div",{className:"f-column admin-layout-footer",style:{height:45}},null==a?void 0:a.footer))))},Wt=m((function(t,e){var n=t.tabsCfg,r=void 0===n?{}:n,o=t.tabPanelCfg,a=void 0===o?{}:o,c=t.data,l=void 0===c?[]:c,u=t.onTabClosed,s=t.onTabSelect;return f.createElement(f.Fragment,null,f.createElement(V,i(i({className:"admin-tabs-panel tabs-inner",ref:e},r),{},{onTabSelect:function(t){var e=t.props,n=e.id,r=e.title,o=e.path,i=e.type;s&&s({id:n,text:r,path:o,type:i})},onTabClose:function(t){u&&u(t)}}),l.map((function(t,e){return f.createElement(q,i(i({key:e},a),t))}))))})),Yt=function(t){var e=t.items,n=t.hasBack,r=t.toBack,o=t.to,i=t.separator,a=void 0===i?"/":i,c=t.backLabel,l=void 0===c?"Back":c,u=function(t,e){t.path&&o&&o(t,e)},s=function(t){var e=[];return t.path&&e.push("link"),t.iconCls&&e.push(t.iconCls),e.join(" ")};return f.createElement("div",{className:"admin-breadcrumb-layout"},f.createElement("div",{className:"admin-breadcrumb-plane"},function(){if(n)return f.createElement("div",{className:"admin-breadcrumb-back",onClick:r},f.createElement("span",{className:"iconfont icon-back"}),f.createElement("span",{className:"admin-breadcrumb-back-title"},l),f.createElement("span",{className:"admin-breadcrumb-back-s"},"|"))}(),f.createElement("div",{className:"admin-breadcrumb"},null==e?void 0:e.map((function(t,n){return function(t,e,n){var r;return n?f.createElement("div",{key:e,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(t),onClick:function(e){return u(t,e)}},t.label),f.createElement("span",{className:"admin-breadcrumb-separator"},null!==(r=t.separator)&&void 0!==r?r:a)):f.createElement("div",{key:e,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(t),onClick:function(e){return u(t,e)}},t.label))}(t,n,!!e&&n<e.length-1)})))))},$t={maskMotion:{motionAppear:!0,motionName:"rc-drawer-mask-motion",onAppearEnd:console.warn},motion:function(t){return{motionAppear:!0,motionName:"rc-drawer-panel-motion-".concat(t)}}},Jt=m((function(t,e){var n=c(f.useState(!1),2),r=n[0],o=n[1];return v(e,(function(){return{toggle:function(){o(!r)}}})),f.createElement(U,i({open:r,onClose:function(){o(!1)},afterOpenChange:t.afterOpenChange,placement:t.placement,width:t.width},$t),t.children)})),Kt=function(t){var e=t.mode,n=t.children,r=t.header,o=t.footer;return f.createElement(G,{className:"admin-default-panel "+(null!=e?e:"none"),showHeader:!!r,showFooter:!!o,collapsible:!1,bodyCls:["admin-panel-body"].join(" "),border:!1,header:r,footer:o,headerCls:"admin-panel-header",footerCls:"admin-panel-footer"},f.createElement("div",{className:"admin-panel-body-content"},n))},Qt=function(t){var e=t.children,n=t.ctx,r=t.point;return f.createElement(f.Fragment,null,null!=n&&n.can(r)?e:null)};export{Ct as $alert,jt as $confirm,Dt as $interactive,Ut as $notice,Pt as $prompt,Ft as $toast,Qt as Access,Mt as AdminLayout,$ as Alert,Yt as Breadcrumb,J as Confirm,Kt as DefaultPanel,Jt as DrawerPanel,K as Prompt,Wt as TabsPanel,St as alertMessagerRef,xt as interactiveMessagerRef,M as messagerAlertRef,W as messagerConfirmRef,Y as messagerPromptRef,qt as notificationRef,Q as setSideMenuState,X as toComboBox,Rt as toastRef,Z as useLocale,gt as useRefDialog,tt as useTheme};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),c=new T(r||[]);return i(a,"_invoke",{value:A(e,n,c)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var p="suspendedStart",m="suspendedYield",v="executing",y="completed",b={};function g(){}function w(){}function k(){}var E={};f(E,c,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&o.call(S,c)&&(E=S);var C=k.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function n(r,i,a,c){var l=d(e[r],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==s(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var r;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,r){n(e,o,t,r)}))}return r=r?r.then(i,i):i()}})}function A(e,n,r){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=j(c,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?y:m,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function j(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return w.prototype=k,i(C,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=f(k,u,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,f(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},n.awrap=function(e){return{__await:e}},O(N.prototype),f(N.prototype,l,(function(){return this})),n.AsyncIterator=N,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new N(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(C),f(C,u,"Generator"),f(C,c,(function(){return this})),f(C,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=L,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}function t(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function c(e){t(a,o,i,c,l,"next",e)}function l(e){t(a,o,i,c,l,"throw",e)}c(void 0)}))}}function r(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var f=require("react"),h=require("@kordar-lib/i18n"),d=require("@kordar-lib/reducers"),p=require("@kordar-lib/base"),m=require("@kordar-lib/menus"),v=require("rc-easyui"),y=require("react-dom"),b=require("rc-drawer"),g=f.createRef(),w=f.createRef(),k=f.createRef();function E(e){return(E="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":s(e)})(e)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n){return t=A(t),function(e,t){if(t&&("object"==E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,D()?Reflect.construct(t,n||[],A(e).constructor):t.apply(e,n))}function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e,t,n){return(t=H(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function R(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e){var t=function(e){if("object"!=E(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==E(t)?t:t+""}O((function e(t,n){C(this,e),this.options=t,this.navigate=n,this.autoRedirect.bind(this),this.toHistory.bind(this),this.toLogin.bind(this),this.saveHistoryLocation.bind(this)}),[{key:"autoRedirect",value:function(){this.options.isGuest()?"/login"!==this.options.location.pathname&&this.toLogin():"/login"===this.options.location.pathname&&this.toHistory()}},{key:"toHistory",value:function(){var e=this.options.history;null==e||""===e.pathname?this.navigate("/"):this.navigate(e)}},{key:"toLogin",value:function(){this.navigate("/login")}},{key:"saveHistoryLocation",value:function(){this.options.saveHistoryLocation(this.options.location)}}]),function(){function e(t,n,r){var o;return C(this,e),(o=S(this,e,[t])).setState=n,o.callback=r,o.callback&&o.callback.bind(o),o.setState.bind(o),o}j(e,p.SwitchListImagesHooks.AbstractHook),O(e,[{key:"toggle",value:function(){var e;this.state===p.SwitchListImagesHookType.List?this.setState(p.SwitchListImagesHookType.Image):this.setState(p.SwitchListImagesHookType.List),null===(e=this.callback)||void 0===e||e.call(this,this.state)}}])}(),function(){function e(t,n){var r;return C(this,e),(r=S(this,e,[t])).options=n,r}j(e,p.CheckAccessHooks.AbstractHook),O(e,[{key:"can",value:function(e){var t;if(!this.items.has(e))return!1;var n=this.options.AndCan,r=this.options.OrCan,o=this.options.Permissions,i=this.items.get(e);if(null!=i)switch(i.type){case p.CheckAccessEleType.AND:return n.apply(void 0,R(i.value));case p.CheckAccessEleType.OR:return r.apply(void 0,R(i.value));case p.CheckAccessEleType.FUNC:return null===(t=i.func)||void 0===t?void 0:t.call(i,{type:i.type,value:i.value,key:i.key},o())}return!1}}])}(),function(){function e(t,n){var r;return C(this,e),(r=S(this,e,[t])).setFormData=n,r.setFormData.bind(r),r}j(e,p.FormDataHooks.AbstractHook),O(e,[{key:"load",value:function(e){var t={};for(var n in this.data)t[n]=e[n];this.setFormData(t)}}])}(),function(){function e(t,n,r){var o;return C(this,e),(o=S(this,e,[t])).valueFn=r||function(e){return e.id},o.setValues=n,o}j(e,p.TableSelectionHooks.AbstractHook),O(e,[{key:"selectionChange",value:function(e){var t=this,n=[];e.forEach((function(e){return n.push(t.valueFn(e))})),this.setValues(n)}},{key:"confirmValues",value:function(e){e&&e(this.values)}}])}(),function(){function e(t,n,r,o){var i;return C(this,e),(i=S(this,e,[t,r])).setItems=n,i.setState=o,i.setItems.bind(i),i.setState.bind(i),i}j(e,p.CheckboxAllHooks.AbstractHook),O(e,[{key:"selectAll",value:function(){this.setState(p.CheckboxAllHookState.ALL)}},{key:"unSelectAll",value:function(){this.setState(p.CheckboxAllHookState.NONE),this.setItems({})}},{key:"setValue",value:function(e,t){}},{key:"toggle",value:function(){this.state===p.CheckboxAllHookState.NONE?this.selectAll():this.unSelectAll()}},{key:"selectBetween",value:function(e,t){}}])}(),function(){function e(t,n,r,o,i){var a;return C(this,e),(a=S(this,e,[t,i,r])).setSize=o,a.setVisible=n,a.setSize.bind(a),a.setVisible.bind(a),a}j(e,p.DialogHooks.AbstractHook),O(e,[{key:"open",value:function(){this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(e){this.setSize(e)}}])}();var _=function(){function e(t,n,r){var o;return C(this,e),(o=S(this,e,[t])).openCallback=n,o.closeCallback=r,o.openCallback&&o.openCallback.bind(o),o.closeCallback&&o.closeCallback.bind(o),o}return j(e,p.RefDialogHooks.AbstractHook),O(e,[{key:"open",value:function(){var e,t,n;null===(e=(t=this.ref.current).open)||void 0===e||e.call(t),null===(n=this.openCallback)||void 0===n||n.call(this)}},{key:"close",value:function(){var e,t,n;null===(e=(t=this.ref.current).close)||void 0===e||e.call(t),null===(n=this.closeCallback)||void 0===n||n.call(this)}}])}();!function(){function e(t,n,r,o,i,a,c){var l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};return C(this,e),(l=S(this,e,[t,r,i,a])).defaultData=u,l.setSize=c,l.setVisible=o,l.setSize.bind(l),l.setVisible.bind(l),l.setFormData=n,l.setFormData.bind(l),l}j(e,p.FormDialogHooks.AbstractHook),O(e,[{key:"open",value:function(){var e={};for(var t in this.defaultData)e[t]=this.defaultData[t];this.setFormData(e),this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(e){this.setSize(e)}},{key:"load",value:function(e,t,n){if(n&&this.refreshWidth(n),e==p.FormDialogHookType.UPDATE){var r={};for(var o in t)r[o]=t[o];this.setFormData(r)}}}])}();var I=function(){function e(){var t;C(this,e);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return N(t=S(this,e,[].concat(r)),"initSearch",!1),N(t,"isTreeData",!1),N(t,"largeSize",999999),t}return j(e,p.DefaultTableContext),O(e,[{key:"search",value:function(e){var t=this;this.initSearch?(this.publish("reload:start"),this.renderData(e)):(e&&(this.tableRequest=T(T({},this.tableRequest),e)),this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(T(T({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(n){t.publish("fetch",n),t.publish("reload:end",{loading:!1}),t.renderData(e)})),this.loading=!1),this.initSearch=!0)}},{key:"refresh",value:function(e){var t=this;this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(T(T({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(e){t.publish("fetch:reload",e),t.renderData()})),this.loading=!1)}},{key:"renderDataData",value:function(e){this.publish("search:local",{conditions:e.conditions,page:e.page||this.config.defaultPageNumber,pageSize:e.pageSize||this.config.defaultPageSize})}},{key:"renderTreeData",value:function(e){this.publish("search:local-tree",{conditions:e.conditions,page:e.page||this.config.defaultPageNumber,pageSize:e.pageSize||this.config.defaultPageSize})}},{key:"renderData",value:function(e){e?this.tableRequest=T(T({},this.tableRequest),e):e=this.tableRequest,this.isTreeData?this.renderTreeData(e):this.renderDataData(e)}}])}(),z=O((function e(t,n,r){C(this,e),N(this,"version",0),this.ctx=t,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);O((function e(t,n){var r=this;C(this,e),N(this,"originData",[]),N(this,"dependency",""),this.tableContext=new I(t,n),this.tableContext.isTreeData=!!t.isTreeData,this.tableContext.setMethod("getOriginalData",(function(){return r.originData})),t.largeSize&&(this.tableContext.largeSize=t.largeSize)}),[{key:"load",value:function(e,t,n,r){var o=this;return this.tableContext.registerEvent("fetch:reload",(function(e){var r=e.data;o.originData=r,n(T(T({},t),{},{data:r,loading:!1,selectionValues:[]}))})),this.tableContext.registerEvent("search:local",(function(e){var r=e.conditions,i=e.page,a=e.pageSize,c=p.executeCondition(o.originData,r,i,a);n(T(T({},t),{},{data:c.data,loading:!1,total:c.count,pageNumber:i,selectionValues:[]}))})),this.tableContext.registerEvent("search:local-tree",(function(r){var i=r.conditions,a=r.page,c=r.pageSize,l=e.treeItemCallback;void 0===l&&(l=function(e){return e});var u=new m.MenuTree(o.originData).tree(0,l),s=p.executeCondition(u,i,a,c);n(T(T({},t),{},{data:s.data,loading:!1,total:s.count,pageNumber:a}))})),this.tableContext.registerEvent("reload:start",(function(){t.loading=!0,n(T({},t))})),this.tableContext.registerEvent("table-version:incr",(function(e){e.value})),this.tableContext.registerEvent("checkbox:values",(function(e){})),this.tableContext.registerEvent("checkbox:clean",(function(e){})),this.tableContext.registerEvent("page:change",(function(e){e.number,e.size})),new z(this.tableContext,t,r)}}]);var q=O((function e(t,n,r){C(this,e),N(this,"version",0),this.ctx=t,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);O((function e(t,n){C(this,e),this.dependency="",this.tableContext=new p.DefaultTableContext(t,n)}),[{key:"load",value:function(e,t,n,r){return this.tableContext.registerEvent("fetch:save",(function(r){var o,i=r.data,a=r.count;setTimeout((function(){t.selectionValues=[],t.data=i,t.total=a,t.loading=!1,n(T({},t))}),null!==(o=e.loadingTime)&&void 0!==o?o:200)})),this.tableContext.registerEvent("reload:start",(function(){t.loading=!0,t.selectionValues=[],n(T({},t))})),this.tableContext.registerEvent("checkbox:values",(function(e){})),this.tableContext.registerEvent("checkbox:clean",(function(e){})),this.tableContext.registerEvent("page:change",(function(e){e.number,e.size})),new q(this.tableContext,t,r)}}]);var F,V={};var M=function(){if(F)return V;F=1;var e=y;if("production"===process.env.NODE_ENV)V.createRoot=e.createRoot,V.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;V.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},V.hydrateRoot=function(n,r,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,o)}finally{t.usingClientEntryPoint=!1}}}return V}(),B=f.createRef();var G=function(e,t,n){var r;return null===(r=B.current)||void 0===r?void 0:r.alert({title:n,icon:e,msg:t})};!function(){if(null===B.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(v.Messager,{ref:B}))}}();var $={info:function(e,t){return G("info",t,e)},warning:function(e,t){return G("warning",t,e)},error:function(e,t){return G("error",t,e)},question:function(e,t){return G("question",t,e)}},U=f.createRef();var W=function(e,t,n,r,o){var i,a;return"confirm"===e?null===(i=U.current)||void 0===i?void 0:i.confirm({title:n,msg:t,result:function(e){e?null==r||r():null==o||o()}}):"prompt"===e?null===(a=U.current)||void 0===a?void 0:a.prompt({title:n,msg:t,result:function(e){e?r(e):null==o||o()}}):void 0};!function(){if(null===U.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(v.Messager,{ref:U}))}}();var Y={confirm:function(e,t,n,r){return W("confirm",t,e,n,r)},prompt:function(e,t,n,r){return W("prompt",t,e,n,r)}},J=function(e){var t=e.title,n=e.message,r=e.type,o=e.duration,i=void 0===o?5e3:o,a=e.onClose;return f.useEffect((function(){var e=setTimeout((function(){a&&a()}),i);return function(){return clearTimeout(e)}}),[i,a]),f.createElement("div",{className:"notification ".concat(r)},f.createElement("div",{className:"notification-title"},f.createElement("h2",{className:"notification-title-head"},t),f.createElement("span",{onClick:function(){return a()},className:"notification-title-close iconfont icon-cancel"})),f.createElement("div",{className:"notification-content"},n))},K=new p.Mutex,Q=f.forwardRef((function(t,o){var i=c(f.useState([]),2),a=i[0],l=i[1],u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3,i=Date.now();l((function(a){return[].concat(r(a),[{id:i,title:e,message:t,type:n,duration:o}])}))},s=function(e){l((function(t){return t.filter((function(t){return t.id!==e}))}))};f.useImperativeHandle(o,(function(){return{show:function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;n(e().mark((function n(){var a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K.lock();case 2:a=e.sent;try{u(t,r,o,i)}finally{a()}case 4:case"end":return e.stop()}}),n)})))()},close:function(t){n(e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K.lock();case 2:r=e.sent;try{s(t)}finally{r()}case 4:case"end":return e.stop()}}),n)})))()}}}));return f.createElement("div",{className:"notification-container"},a.map((function(e){return f.createElement(J,{key:e.id,id:e.id,title:e.title,message:e.message,type:e.type,duration:(t=e.id,n=e.duration,n-(Date.now()-t)),onClose:function(){return s(e.id)}});var t,n})))})),X=f.createRef();var Z=function(e,t,n,r){var o;return null===(o=X.current)||void 0===o?void 0:o.show(n,t,e,r)};!function(){if(null===X.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(Q,{ref:X}))}}();var ee={info:function(e,t,n){return Z("info",e,t,n)},warning:function(e,t,n){return Z("warning",e,t,n)},error:function(e,t,n){return Z("error",e,t,n)},success:function(e,t,n){return Z("success",e,t,n)},validate:function(e,t,n){return Z("error",(r=e,f.createElement("div",{className:"notification-validate"},r.map((function(e,t){return f.createElement("p",{key:t},e)})))),t,n);var r}},te=function(e){var t=e.message,n=e.type,r=e.duration,o=void 0===r?5e3:r,i=e.onClose;return f.useEffect((function(){var e=setTimeout((function(){i&&i()}),o);return function(){return clearTimeout(e)}}),[o,i]),f.createElement("div",{className:"toast ".concat(n)},f.createElement("div",{className:"toast-content"},f.createElement("span",null,t),f.createElement("span",{onClick:function(){return i()},className:"toast-content-close iconfont icon-cancel"})))},ne=new p.Mutex,re=f.forwardRef((function(t,o){var i=c(f.useState([]),2),a=i[0],l=i[1],u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=Date.now();l((function(i){return[].concat(r(i),[{id:o,message:e,type:t,duration:n}])}))},s=function(e){l((function(t){return t.filter((function(t){return t.id!==e}))}))};f.useImperativeHandle(o,(function(){return{show:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;n(e().mark((function n(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ne.lock();case 2:i=e.sent;try{u(t,r,o)}finally{i()}case 4:case"end":return e.stop()}}),n)})))()},close:function(t){n(e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ne.lock();case 2:r=e.sent;try{s(t)}finally{r()}case 4:case"end":return e.stop()}}),n)})))()}}}));return f.createElement("div",{className:"toast-container"},a.map((function(e){return f.createElement(te,{key:e.id,id:e.id,message:e.message,type:e.type,duration:(t=e.id,n=e.duration,n-(Date.now()-t)),onClose:function(){return s(e.id)}});var t,n})))})),oe=f.createRef();var ie=function(e,t,n){var r;return null===(r=oe.current)||void 0===r?void 0:r.show(t,e,n)};!function(){if(null===oe.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(re,{ref:oe}))}}();var ae={info:function(e,t){return ie("info",e,t)},warning:function(e,t){return ie("warning",e,t)},error:function(e,t){return ie("error",e,t)},success:function(e,t){return ie("success",e,t)}},ce=f.forwardRef((function(e,t){var n=e.tabsCfg,r=void 0===n?{}:n,o=e.tabPanelCfg,a=void 0===o?{}:o,c=e.data,l=void 0===c?[]:c,u=e.onTabClosed,s=e.onTabSelect;return f.createElement(f.Fragment,null,f.createElement(v.Tabs,i(i({className:"admin-tabs-panel tabs-inner",ref:t},r),{},{onTabSelect:function(e){var t=e.props,n=t.id,r=t.title,o=t.path,i=t.type;s&&s({id:n,text:r,path:o,type:i})},onTabClose:function(e){u&&u(e)}}),l.map((function(e,t){return f.createElement(v.TabPanel,i(i({key:t},a),e))}))))})),le={maskMotion:{motionAppear:!0,motionName:"rc-drawer-mask-motion",onAppearEnd:console.warn},motion:function(e){return{motionAppear:!0,motionName:"rc-drawer-panel-motion-".concat(e)}}},ue=f.forwardRef((function(e,t){var n=c(f.useState(!1),2),r=n[0],o=n[1];return f.useImperativeHandle(t,(function(){return{toggle:function(){o(!r)}}})),f.createElement(b,i({open:r,onClose:function(){o(!1)},afterOpenChange:e.afterOpenChange,placement:e.placement,width:e.width},le),e.children)}));exports.$alert=$,exports.$confirm=function(e,t,n,r){return W("confirm",t,e,n,r)},exports.$interactive=Y,exports.$notice=ee,exports.$prompt=function(e,t,n,r){return W("prompt",t,e,n,r)},exports.$toast=ae,exports.Access=function(e){var t=e.children,n=e.ctx,r=e.point;return f.createElement(f.Fragment,null,null!=n&&n.can(r)?t:null)},exports.AdminLayout=function(e){var t=e.children,n=e.collapsed,r=e.logo,o=e.title,a=e.slots,l=e.menus,u=e.sidebarCfg,s=e.toggle,h=e.onSideMenuSelection,d=e.selection,p=c(f.useState(600),2),m=p[0],y=p[1],b=f.useRef(null),g=function(){return{width:n?50:200}};return f.useEffect((function(){window.onload=function(e){var t=b.current.clientHeight;y(t)}}),[]),f.createElement("div",{className:"admin-layout f-column"},f.createElement("div",{className:"admin-layout-header f-row"},f.createElement("div",{className:"f-row f-full"},f.createElement("div",{className:"main-title f-animate f-row",style:g()},null!=a&&a.title?a.title:f.createElement(f.Fragment,null,f.createElement("img",{className:"app-logo",src:null!=r?r:"7f4f2d68782a7faf.png"}),n?"":null!=o?o:"App Layout")),f.createElement("div",{className:"main-bar f-full f-row"},f.createElement("div",{className:"f-inline-row f-content-center"},f.createElement("span",{className:"main-toggle label-icon icon-list ",onClick:function(){s&&s(!n)}})),f.createElement("div",{className:"f-row"},null==a?void 0:a.barLeft),f.createElement("div",{className:"f-row f-full main-bar-right"},null==a?void 0:a.barRight)))),f.createElement("div",{className:"admin-layout-body f-full"},f.createElement("div",{className:"sidebar-body f-animate",style:g()},!n&&(null==a?void 0:a.userPanel),f.createElement(v.SideMenu,i(i({style:g(),menuCls:"admin-sidemenu",data:l||[],collapsed:n,selection:d},u),{},{onSelectionChange:function(e){return function(e){h&&h(e)}(e)}}))),f.createElement("div",{className:"main-body",ref:b},f.createElement("div",{className:"f-column admin-layout-container",style:{height:m-46}},t),f.createElement("div",{className:"f-column admin-layout-footer",style:{height:45}},null==a?void 0:a.footer))))},exports.Alert=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Alert",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Here is a message!",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0;return null===(e=g.current)||void 0===e?void 0:e.alert({title:t,msg:n,icon:"k iconfont icon-msg-"+r,content:o})},exports.Breadcrumb=function(e){var t=e.items,n=e.hasBack,r=e.toBack,o=e.to,i=e.separator,a=void 0===i?"/":i,c=e.backLabel,l=void 0===c?"Back":c,u=function(e,t){e.path&&o&&o(e,t)},s=function(e){var t=[];return e.path&&t.push("link"),e.iconCls&&t.push(e.iconCls),t.join(" ")};return f.createElement("div",{className:"admin-breadcrumb-layout"},f.createElement("div",{className:"admin-breadcrumb-plane"},function(){if(n)return f.createElement("div",{className:"admin-breadcrumb-back",onClick:r},f.createElement("span",{className:"iconfont icon-back"}),f.createElement("span",{className:"admin-breadcrumb-back-title"},l),f.createElement("span",{className:"admin-breadcrumb-back-s"},"|"))}(),f.createElement("div",{className:"admin-breadcrumb"},null==t?void 0:t.map((function(e,n){return function(e,t,n){var r;return n?f.createElement("div",{key:t,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(e),onClick:function(t){return u(e,t)}},e.label),f.createElement("span",{className:"admin-breadcrumb-separator"},null!==(r=e.separator)&&void 0!==r?r:a)):f.createElement("div",{key:t,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(e),onClick:function(t){return u(e,t)}},e.label))}(e,n,!!t&&n<t.length-1)})))))},exports.Confirm=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Confirm",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Are you confirm this?",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(e=w.current)||void 0===e?void 0:e.prompt({title:t,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(e){e?i&&i():a&&a()}})},exports.DefaultPanel=function(e){var t=e.mode,n=e.children,r=e.header,o=e.footer;return f.createElement(v.Panel,{className:"admin-default-panel "+(null!=t?t:"none"),showHeader:!!r,showFooter:!!o,collapsible:!1,bodyCls:["admin-panel-body"].join(" "),border:!1,header:r,footer:o,headerCls:"admin-panel-header",footerCls:"admin-panel-footer"},f.createElement("div",{className:"admin-panel-body-content"},n))},exports.DrawerPanel=ue,exports.Prompt=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Prompt",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Please type something",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(e=k.current)||void 0===e?void 0:e.confirm({title:t,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(e){e?i&&i(e):a&&a()}})},exports.TabsPanel=ce,exports.alertMessagerRef=B,exports.interactiveMessagerRef=U,exports.messagerAlertRef=g,exports.messagerConfirmRef=w,exports.messagerPromptRef=k,exports.notificationRef=X,exports.setSideMenuState=function(e,t){return e.forEach((function(e){-1!==t.findIndex((function(t){return t==e.id}))?(e.state="open",e.selected=!0):(e.state="closed",e.selected=!1)})),e},exports.toComboBox=function(e,t,n){for(var r=[],o=0;o<e.length;o++){var i=e[o];r.push({value:i[t],text:i[n]})}return r},exports.toastRef=oe,exports.useLocale=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=d.useAppDispatch(),n=d.useAppSelector((function(e){return e.app.localeOptions}));return{locale:d.useAppSelector((function(e){return e.app.locale})),localeOptions:n,changeLocale:function(n){t(d.setLocale({locale:n,callback:function(){h.setLanguage(n,(function(t){e&&setTimeout((function(){window.location.reload()}),500)}))}}))}}},exports.useRefDialog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=c(f.useState(e),2),n=t[0],r=t[1],o=function(e,t){var n=f.useRef(null);return new _(n,e,t)}();return{value:o,props:n,open:function(e){r(i(i({},n),e)),console.log(o,o.ref),o.open()},close:function(e){r(i(i({},n),e)),o.close()}}},exports.useTheme=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"//unpkg.com/rc-easyui@1.2.9/dist/themes/",t=d.useAppSelector((function(e){return e.app.theme})),n=d.useAppDispatch(),r=function(e){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e,document.getElementsByTagName("head")[0].appendChild(t)};return{changeTheme:function(e){n(d.setAppTheme(e)),window.location.reload()},themeOptions:[{name:"default",key:"default"},{name:"black",key:"black"},{name:"gray",key:"gray"},{name:"bootstrap",key:"bootstrap"},{name:"material",key:"material"},{name:"material-blue",key:"material-blue"},{name:"material-teal",key:"material-teal"},{name:"metro",key:"metro"}],loadHtmlTheme:function(){t?(r(e+t+"/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",t)}):(r(e+"/default/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",t)}),r(e+"/icon.css"),r(e+"/react.css")}}};
|
|
1
|
+
"use strict";function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),c=new T(r||[]);return i(a,"_invoke",{value:A(e,n,c)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var p="suspendedStart",m="suspendedYield",v="executing",y="completed",b={};function g(){}function w(){}function k(){}var E={};f(E,c,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&o.call(S,c)&&(E=S);var C=k.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function n(r,i,a,c){var l=d(e[r],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==s(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var r;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,r){n(e,o,t,r)}))}return r=r?r.then(i,i):i()}})}function A(e,n,r){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=j(c,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?y:m,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function j(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return w.prototype=k,i(C,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=f(k,u,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,f(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},n.awrap=function(e){return{__await:e}},O(N.prototype),f(N.prototype,l,(function(){return this})),n.AsyncIterator=N,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new N(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(C),f(C,u,"Generator"),f(C,c,(function(){return this})),f(C,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=L,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}function t(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function c(e){t(a,o,i,c,l,"next",e)}function l(e){t(a,o,i,c,l,"throw",e)}c(void 0)}))}}function r(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var f=require("react"),h=require("@kordar-lib/i18n"),d=require("@kordar-lib/reducers"),p=require("@kordar-lib/base"),m=require("@kordar-lib/menus"),v=require("rc-easyui"),y=require("react-dom"),b=require("rc-drawer"),g=f.createRef(),w=f.createRef(),k=f.createRef();function E(e){return(E="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":s(e)})(e)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n){return t=A(t),function(e,t){if(t&&("object"==E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,D()?Reflect.construct(t,n||[],A(e).constructor):t.apply(e,n))}function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e,t,n){return(t=H(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function R(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e){var t=function(e){if("object"!=E(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==E(t)?t:t+""}O((function e(t,n){C(this,e),this.options=t,this.navigate=n,this.autoRedirect.bind(this),this.toHistory.bind(this),this.toLogin.bind(this),this.saveHistoryLocation.bind(this)}),[{key:"autoRedirect",value:function(){this.options.isGuest()?"/login"!==this.options.location.pathname&&this.toLogin():"/login"===this.options.location.pathname&&this.toHistory()}},{key:"toHistory",value:function(){var e=this.options.history;null==e||""===e.pathname?this.navigate("/"):this.navigate(e)}},{key:"toLogin",value:function(){this.navigate("/login")}},{key:"saveHistoryLocation",value:function(){this.options.saveHistoryLocation(this.options.location)}}]),function(){function e(t,n,r){var o;return C(this,e),(o=S(this,e,[t])).setState=n,o.callback=r,o.callback&&o.callback.bind(o),o.setState.bind(o),o}j(e,p.SwitchListImagesHooks.AbstractHook),O(e,[{key:"toggle",value:function(){var e;this.state===p.SwitchListImagesHookType.List?this.setState(p.SwitchListImagesHookType.Image):this.setState(p.SwitchListImagesHookType.List),null===(e=this.callback)||void 0===e||e.call(this,this.state)}}])}(),function(){function e(t,n){var r;return C(this,e),(r=S(this,e,[t])).options=n,r}j(e,p.CheckAccessHooks.AbstractHook),O(e,[{key:"can",value:function(e){var t;if(!this.items.has(e))return!1;var n=this.options.AndCan,r=this.options.OrCan,o=this.options.Permissions,i=this.items.get(e);if(null!=i)switch(i.type){case p.CheckAccessEleType.AND:return n.apply(void 0,R(i.value));case p.CheckAccessEleType.OR:return r.apply(void 0,R(i.value));case p.CheckAccessEleType.FUNC:return null===(t=i.func)||void 0===t?void 0:t.call(i,{type:i.type,value:i.value,key:i.key},o())}return!1}}])}(),function(){function e(t,n){var r;return C(this,e),(r=S(this,e,[t])).setFormData=n,r.setFormData.bind(r),r}j(e,p.FormDataHooks.AbstractHook),O(e,[{key:"load",value:function(e){var t={};for(var n in this.data)t[n]=e[n];this.setFormData(t)}}])}(),function(){function e(t,n,r){var o;return C(this,e),(o=S(this,e,[t])).valueFn=r||function(e){return e.id},o.setValues=n,o}j(e,p.TableSelectionHooks.AbstractHook),O(e,[{key:"selectionChange",value:function(e){var t=this,n=[];e.forEach((function(e){return n.push(t.valueFn(e))})),this.setValues(n)}},{key:"confirmValues",value:function(e){e&&e(this.values)}}])}(),function(){function e(t,n,r,o){var i;return C(this,e),(i=S(this,e,[t,r])).setItems=n,i.setState=o,i.setItems.bind(i),i.setState.bind(i),i}j(e,p.CheckboxAllHooks.AbstractHook),O(e,[{key:"selectAll",value:function(){this.setState(p.CheckboxAllHookState.ALL)}},{key:"unSelectAll",value:function(){this.setState(p.CheckboxAllHookState.NONE),this.setItems({})}},{key:"setValue",value:function(e,t){}},{key:"toggle",value:function(){this.state===p.CheckboxAllHookState.NONE?this.selectAll():this.unSelectAll()}},{key:"selectBetween",value:function(e,t){}}])}(),function(){function e(t,n,r,o,i){var a;return C(this,e),(a=S(this,e,[t,i,r])).setSize=o,a.setVisible=n,a.setSize.bind(a),a.setVisible.bind(a),a}j(e,p.DialogHooks.AbstractHook),O(e,[{key:"open",value:function(){this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(e){this.setSize(e)}}])}();var _=function(){function e(t,n,r){var o;return C(this,e),(o=S(this,e,[t])).openCallback=n,o.closeCallback=r,o.openCallback&&o.openCallback.bind(o),o.closeCallback&&o.closeCallback.bind(o),o}return j(e,p.RefDialogHooks.AbstractHook),O(e,[{key:"open",value:function(){var e,t,n;null===(e=(t=this.ref.current).open)||void 0===e||e.call(t),null===(n=this.openCallback)||void 0===n||n.call(this)}},{key:"close",value:function(){var e,t,n;null===(e=(t=this.ref.current).close)||void 0===e||e.call(t),null===(n=this.closeCallback)||void 0===n||n.call(this)}}])}();!function(){function e(t,n,r,o,i,a,c){var l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};return C(this,e),(l=S(this,e,[t,r,i,a])).defaultData=u,l.setSize=c,l.setVisible=o,l.setSize.bind(l),l.setVisible.bind(l),l.setFormData=n,l.setFormData.bind(l),l}j(e,p.FormDialogHooks.AbstractHook),O(e,[{key:"open",value:function(){var e={};for(var t in this.defaultData)e[t]=this.defaultData[t];this.setFormData(e),this.setVisible(!0)}},{key:"close",value:function(){this.setVisible(!1)}},{key:"refreshWidth",value:function(e){this.setSize(e)}},{key:"load",value:function(e,t,n){if(n&&this.refreshWidth(n),e==p.FormDialogHookType.UPDATE){var r={};for(var o in t)r[o]=t[o];this.setFormData(r)}}}])}();var I=function(){function e(){var t;C(this,e);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return N(t=S(this,e,[].concat(r)),"initSearch",!1),N(t,"isTreeData",!1),N(t,"largeSize",999999),t}return j(e,p.DefaultTableContext),O(e,[{key:"search",value:function(e){var t=this;this.initSearch?(this.publish("reload:start"),this.renderData(e)):(e&&(this.tableRequest=T(T({},this.tableRequest),e)),this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(T(T({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(n){t.publish("fetch",n),t.publish("reload:end",{loading:!1}),t.renderData(e)})),this.loading=!1),this.initSearch=!0)}},{key:"refresh",value:function(e){var t=this;this.loading||(this.publish("reload:start",{loading:!0}),this.query.query(T(T({},this.tableRequest),{},{page:1,pageSize:this.largeSize}),this.config.fixedSorts,this.config.fixedConditions).then((function(e){t.publish("fetch:reload",e),t.renderData()})),this.loading=!1)}},{key:"renderDataData",value:function(e){this.publish("search:local",{conditions:e.conditions,page:e.page||this.config.defaultPageNumber,pageSize:e.pageSize||this.config.defaultPageSize})}},{key:"renderTreeData",value:function(e){this.publish("search:local-tree",{conditions:e.conditions,page:e.page||this.config.defaultPageNumber,pageSize:e.pageSize||this.config.defaultPageSize})}},{key:"renderData",value:function(e){e?this.tableRequest=T(T({},this.tableRequest),e):e=this.tableRequest,this.isTreeData?this.renderTreeData(e):this.renderDataData(e)}}])}(),z=O((function e(t,n,r){C(this,e),N(this,"version",0),this.ctx=t,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);O((function e(t,n){var r=this;C(this,e),N(this,"originData",[]),N(this,"dependency",""),this.tableContext=new I(t,n),this.tableContext.isTreeData=!!t.isTreeData,this.tableContext.setMethod("getOriginalData",(function(){return r.originData})),t.largeSize&&(this.tableContext.largeSize=t.largeSize)}),[{key:"load",value:function(e,t,n,r){var o=this;return this.tableContext.registerEvent("fetch:reload",(function(e){var r=e.data;o.originData=r,n(T(T({},t),{},{data:r,loading:!1,selectionValues:[]}))})),this.tableContext.registerEvent("search:local",(function(e){var r=e.conditions,i=e.page,a=e.pageSize,c=p.executeCondition(o.originData,r,i,a);n(T(T({},t),{},{data:c.data,loading:!1,total:c.count,pageNumber:i,selectionValues:[]}))})),this.tableContext.registerEvent("search:local-tree",(function(r){var i=r.conditions,a=r.page,c=r.pageSize,l=e.treeItemCallback;void 0===l&&(l=function(e){return e});var u=new m.MenuTree(o.originData).tree(0,l),s=p.executeCondition(u,i,a,c);n(T(T({},t),{},{data:s.data,loading:!1,total:s.count,pageNumber:a}))})),this.tableContext.registerEvent("reload:start",(function(){t.loading=!0,n(T({},t))})),this.tableContext.registerEvent("table-version:incr",(function(e){e.value})),this.tableContext.registerEvent("checkbox:values",(function(e){})),this.tableContext.registerEvent("checkbox:clean",(function(e){})),this.tableContext.registerEvent("page:change",(function(e){e.number,e.size})),new z(this.tableContext,t,r)}}]);var q=O((function e(t,n,r){C(this,e),N(this,"version",0),this.ctx=t,this.ctxState=n,this.version=r}),[{key:"toArray",value:function(){return[this]}}]);O((function e(t,n){C(this,e),this.dependency="",this.tableContext=new p.DefaultTableContext(t,n)}),[{key:"load",value:function(e,t,n,r){return this.tableContext.registerEvent("fetch:save",(function(r){var o,i=r.data,a=r.count;setTimeout((function(){t.selectionValues=[],t.data=i,t.total=a,t.loading=!1,n(T({},t))}),null!==(o=e.loadingTime)&&void 0!==o?o:200)})),this.tableContext.registerEvent("reload:start",(function(){t.loading=!0,t.selectionValues=[],n(T({},t))})),this.tableContext.registerEvent("checkbox:values",(function(e){})),this.tableContext.registerEvent("checkbox:clean",(function(e){})),this.tableContext.registerEvent("page:change",(function(e){e.number,e.size})),new q(this.tableContext,t,r)}}]);var F,V={};var M=function(){if(F)return V;F=1;var e=y;if("production"===process.env.NODE_ENV)V.createRoot=e.createRoot,V.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;V.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},V.hydrateRoot=function(n,r,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,o)}finally{t.usingClientEntryPoint=!1}}}return V}(),B=f.createRef();var G=function(e,t,n){var r;return null===(r=B.current)||void 0===r?void 0:r.alert({title:n,icon:e,msg:t})};!function(){if(null===B.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(v.Messager,{ref:B}))}}();var $={info:function(e,t){return G("info",t,e)},warning:function(e,t){return G("warning",t,e)},error:function(e,t){return G("error",t,e)},question:function(e,t){return G("question",t,e)}},U=f.createRef();var W=function(e,t,n,r,o){var i,a;return"confirm"===e?null===(i=U.current)||void 0===i?void 0:i.confirm({title:n,msg:t,result:function(e){e?null==r||r():null==o||o()}}):"prompt"===e?null===(a=U.current)||void 0===a?void 0:a.prompt({title:n,msg:t,result:function(e){e?r(e):null==o||o()}}):void 0};!function(){if(null===U.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(v.Messager,{ref:U}))}}();var Y={confirm:function(e,t,n,r){return W("confirm",t,e,n,r)},prompt:function(e,t,n,r){return W("prompt",t,e,n,r)}},J=function(e){var t=e.message,n=e.type,r=e.duration,o=void 0===r?5e3:r,i=e.onClose;return f.useEffect((function(){var e=setTimeout((function(){i&&i()}),o);return function(){return clearTimeout(e)}}),[o,i]),f.createElement("div",{className:"toast ".concat(n)},f.createElement("div",{className:"toast-content"},f.createElement("span",null,t),f.createElement("span",{onClick:function(){return i()},className:"toast-content-close iconfont icon-cancel"})))},K=new p.Mutex,Q=f.forwardRef((function(t,o){var i=c(f.useState([]),2),a=i[0],l=i[1],u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=Date.now();l((function(i){return[].concat(r(i),[{id:o,message:e,type:t,duration:n}])}))},s=function(e){l((function(t){return t.filter((function(t){return t.id!==e}))}))};f.useImperativeHandle(o,(function(){return{show:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;n(e().mark((function n(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K.lock();case 2:i=e.sent;try{u(t,r,o)}finally{i()}case 4:case"end":return e.stop()}}),n)})))()},close:function(t){n(e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K.lock();case 2:r=e.sent;try{s(t)}finally{r()}case 4:case"end":return e.stop()}}),n)})))()}}}));return f.createElement("div",{className:"toast-container"},a.map((function(e){return f.createElement(J,{key:e.id,id:e.id,message:e.message,type:e.type,duration:(t=e.id,n=e.duration,n-(Date.now()-t)),onClose:function(){return s(e.id)}});var t,n})))})),X=f.createRef();function Z(){if(null===X.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(Q,{ref:X}))}}var ee=function(e,t,n){var r;return Z(),null===(r=X.current)||void 0===r?void 0:r.show(t,e,n)};Z();var te={info:function(e,t){return ee("info",e,t)},warning:function(e,t){return ee("warning",e,t)},error:function(e,t){return ee("error",e,t)},success:function(e,t){return ee("success",e,t)}},ne=function(e){var t=e.title,n=e.message,r=e.type,o=e.duration,i=void 0===o?5e3:o,a=e.onClose;return f.useEffect((function(){var e=setTimeout((function(){a&&a()}),i);return function(){return clearTimeout(e)}}),[i,a]),f.createElement("div",{className:"notification ".concat(r)},f.createElement("div",{className:"notification-title"},f.createElement("h2",{className:"notification-title-head"},t),f.createElement("span",{onClick:function(){return a()},className:"notification-title-close iconfont icon-cancel"})),f.createElement("div",{className:"notification-content"},n))},re=new p.Mutex,oe=f.forwardRef((function(t,o){var i=c(f.useState([]),2),a=i[0],l=i[1],u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3,i=Date.now();l((function(a){return[].concat(r(a),[{id:i,title:e,message:t,type:n,duration:o}])}))},s=function(e){l((function(t){return t.filter((function(t){return t.id!==e}))}))};f.useImperativeHandle(o,(function(){return{show:function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;n(e().mark((function n(){var a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re.lock();case 2:a=e.sent;try{u(t,r,o,i)}finally{a()}case 4:case"end":return e.stop()}}),n)})))()},close:function(t){n(e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re.lock();case 2:r=e.sent;try{s(t)}finally{r()}case 4:case"end":return e.stop()}}),n)})))()}}}));return f.createElement("div",{className:"notification-container"},a.map((function(e){return f.createElement(ne,{key:e.id,id:e.id,title:e.title,message:e.message,type:e.type,duration:(t=e.id,n=e.duration,n-(Date.now()-t)),onClose:function(){return s(e.id)}});var t,n})))})),ie=f.createRef();function ae(){if(null===ie.current){var e=document.createElement("div");document.body.appendChild(e),M.createRoot(e).render(f.createElement(oe,{ref:ie}))}}var ce=function(e,t,n,r){var o;return ae(),null===(o=ie.current)||void 0===o?void 0:o.show(n,t,e,r)};ae();var le={info:function(e,t,n){return ce("info",e,t,n)},warning:function(e,t,n){return ce("warning",e,t,n)},error:function(e,t,n){return ce("error",e,t,n)},success:function(e,t,n){return ce("success",e,t,n)},validate:function(e,t,n){return ce("error",(r=e,f.createElement("div",{className:"notification-validate"},r.map((function(e,t){return f.createElement("p",{key:t},e)})))),t,n);var r}},ue=f.forwardRef((function(e,t){var n=e.tabsCfg,r=void 0===n?{}:n,o=e.tabPanelCfg,a=void 0===o?{}:o,c=e.data,l=void 0===c?[]:c,u=e.onTabClosed,s=e.onTabSelect;return f.createElement(f.Fragment,null,f.createElement(v.Tabs,i(i({className:"admin-tabs-panel tabs-inner",ref:t},r),{},{onTabSelect:function(e){var t=e.props,n=t.id,r=t.title,o=t.path,i=t.type;s&&s({id:n,text:r,path:o,type:i})},onTabClose:function(e){u&&u(e)}}),l.map((function(e,t){return f.createElement(v.TabPanel,i(i({key:t},a),e))}))))})),se={maskMotion:{motionAppear:!0,motionName:"rc-drawer-mask-motion",onAppearEnd:console.warn},motion:function(e){return{motionAppear:!0,motionName:"rc-drawer-panel-motion-".concat(e)}}},fe=f.forwardRef((function(e,t){var n=c(f.useState(!1),2),r=n[0],o=n[1];return f.useImperativeHandle(t,(function(){return{toggle:function(){o(!r)}}})),f.createElement(b,i({open:r,onClose:function(){o(!1)},afterOpenChange:e.afterOpenChange,placement:e.placement,width:e.width},se),e.children)}));exports.$alert=$,exports.$confirm=function(e,t,n,r){return W("confirm",t,e,n,r)},exports.$interactive=Y,exports.$notice=le,exports.$prompt=function(e,t,n,r){return W("prompt",t,e,n,r)},exports.$toast=te,exports.Access=function(e){var t=e.children,n=e.ctx,r=e.point;return f.createElement(f.Fragment,null,null!=n&&n.can(r)?t:null)},exports.AdminLayout=function(e){var t=e.children,n=e.collapsed,r=e.logo,o=e.title,a=e.slots,l=e.menus,u=e.sidebarCfg,s=e.toggle,h=e.onSideMenuSelection,d=e.selection,p=c(f.useState(600),2),m=p[0],y=p[1],b=f.useRef(null),g=function(){return{width:n?50:200}};return f.useEffect((function(){window.onload=function(e){var t=b.current.clientHeight;y(t)}}),[]),f.createElement("div",{className:"admin-layout f-column"},f.createElement("div",{className:"admin-layout-header f-row"},f.createElement("div",{className:"f-row f-full"},f.createElement("div",{className:"main-title f-animate f-row",style:g()},null!=a&&a.title?a.title:f.createElement(f.Fragment,null,f.createElement("img",{className:"app-logo",src:null!=r?r:"7f4f2d68782a7faf.png"}),n?"":null!=o?o:"App Layout")),f.createElement("div",{className:"main-bar f-full f-row"},f.createElement("div",{className:"f-inline-row f-content-center"},f.createElement("span",{className:"main-toggle label-icon icon-list ",onClick:function(){s&&s(!n)}})),f.createElement("div",{className:"f-row"},null==a?void 0:a.barLeft),f.createElement("div",{className:"f-row f-full main-bar-right"},null==a?void 0:a.barRight)))),f.createElement("div",{className:"admin-layout-body f-full"},f.createElement("div",{className:"sidebar-body f-animate",style:g()},!n&&(null==a?void 0:a.userPanel),f.createElement(v.SideMenu,i(i({style:g(),menuCls:"admin-sidemenu",data:l||[],collapsed:n,selection:d},u),{},{onSelectionChange:function(e){return function(e){h&&h(e)}(e)}}))),f.createElement("div",{className:"main-body",ref:b},f.createElement("div",{className:"f-column admin-layout-container",style:{height:m-46}},t),f.createElement("div",{className:"f-column admin-layout-footer",style:{height:45}},null==a?void 0:a.footer))))},exports.Alert=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Alert",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Here is a message!",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0;return null===(e=g.current)||void 0===e?void 0:e.alert({title:t,msg:n,icon:"k iconfont icon-msg-"+r,content:o})},exports.Breadcrumb=function(e){var t=e.items,n=e.hasBack,r=e.toBack,o=e.to,i=e.separator,a=void 0===i?"/":i,c=e.backLabel,l=void 0===c?"Back":c,u=function(e,t){e.path&&o&&o(e,t)},s=function(e){var t=[];return e.path&&t.push("link"),e.iconCls&&t.push(e.iconCls),t.join(" ")};return f.createElement("div",{className:"admin-breadcrumb-layout"},f.createElement("div",{className:"admin-breadcrumb-plane"},function(){if(n)return f.createElement("div",{className:"admin-breadcrumb-back",onClick:r},f.createElement("span",{className:"iconfont icon-back"}),f.createElement("span",{className:"admin-breadcrumb-back-title"},l),f.createElement("span",{className:"admin-breadcrumb-back-s"},"|"))}(),f.createElement("div",{className:"admin-breadcrumb"},null==t?void 0:t.map((function(e,n){return function(e,t,n){var r;return n?f.createElement("div",{key:t,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(e),onClick:function(t){return u(e,t)}},e.label),f.createElement("span",{className:"admin-breadcrumb-separator"},null!==(r=e.separator)&&void 0!==r?r:a)):f.createElement("div",{key:t,className:"admin-breadcrumb-item"},f.createElement("span",{className:s(e),onClick:function(t){return u(e,t)}},e.label))}(e,n,!!t&&n<t.length-1)})))))},exports.Confirm=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Confirm",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Are you confirm this?",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(e=w.current)||void 0===e?void 0:e.prompt({title:t,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(e){e?i&&i():a&&a()}})},exports.DefaultPanel=function(e){var t=e.mode,n=e.children,r=e.header,o=e.footer;return f.createElement(v.Panel,{className:"admin-default-panel "+(null!=t?t:"none"),showHeader:!!r,showFooter:!!o,collapsible:!1,bodyCls:["admin-panel-body"].join(" "),border:!1,header:r,footer:o,headerCls:"admin-panel-header",footerCls:"admin-panel-footer"},f.createElement("div",{className:"admin-panel-body-content"},n))},exports.DrawerPanel=fe,exports.Prompt=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Prompt",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Please type something",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return null===(e=k.current)||void 0===e?void 0:e.confirm({title:t,msg:n,icon:"k iconfont icon-msg-"+r,content:o,result:function(e){e?i&&i(e):a&&a()}})},exports.TabsPanel=ue,exports.alertMessagerRef=B,exports.interactiveMessagerRef=U,exports.messagerAlertRef=g,exports.messagerConfirmRef=w,exports.messagerPromptRef=k,exports.notificationRef=ie,exports.setSideMenuState=function(e,t){return e.forEach((function(e){-1!==t.findIndex((function(t){return t==e.id}))?(e.state="open",e.selected=!0):(e.state="closed",e.selected=!1)})),e},exports.toComboBox=function(e,t,n){for(var r=[],o=0;o<e.length;o++){var i=e[o];r.push({value:i[t],text:i[n]})}return r},exports.toastRef=X,exports.useLocale=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=d.useAppDispatch(),n=d.useAppSelector((function(e){return e.app.localeOptions}));return{locale:d.useAppSelector((function(e){return e.app.locale})),localeOptions:n,changeLocale:function(n){t(d.setLocale({locale:n,callback:function(){h.setLanguage(n,(function(t){e&&setTimeout((function(){window.location.reload()}),500)}))}}))}}},exports.useRefDialog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=c(f.useState(e),2),n=t[0],r=t[1],o=function(e,t){var n=f.useRef(null);return new _(n,e,t)}();return{value:o,props:n,open:function(e){r(i(i({},n),e)),console.log(o,o.ref),o.open()},close:function(e){r(i(i({},n),e)),o.close()}}},exports.useTheme=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"//unpkg.com/rc-easyui@1.2.9/dist/themes/",t=d.useAppSelector((function(e){return e.app.theme})),n=d.useAppDispatch(),r=function(e){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e,document.getElementsByTagName("head")[0].appendChild(t)};return{changeTheme:function(e){n(d.setAppTheme(e)),window.location.reload()},themeOptions:[{name:"default",key:"default"},{name:"black",key:"black"},{name:"gray",key:"gray"},{name:"bootstrap",key:"bootstrap"},{name:"material",key:"material"},{name:"material-blue",key:"material-blue"},{name:"material-teal",key:"material-teal"},{name:"metro",key:"metro"}],loadHtmlTheme:function(){t?(r(e+t+"/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",t)}):(r(e+"/default/easyui.css"),window.onload=function(){document.querySelector("html").setAttribute("theme",t)}),r(e+"/icon.css"),r(e+"/react.css")}}};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export { default as useTheme } from "./composable/useTheme";
|
|
|
7
7
|
export { default as useRefDialog } from "./composable/useRefDialog";
|
|
8
8
|
export * from './components/message/alert-messager';
|
|
9
9
|
export * from './components/message/interactive-messager';
|
|
10
|
-
export * from './components/message/notification';
|
|
11
10
|
export * from './components/message/toast';
|
|
11
|
+
export * from './components/message/notification';
|
|
12
12
|
export { default as AdminLayout } from "./components/layouts/admin-layout";
|
|
13
13
|
export { default as TabsPanel } from "./components/panel/tabs";
|
|
14
14
|
export { default as Breadcrumb } from "./components/panel/breadcrumb";
|