@moneko/core 2.0.51 → 2.0.53
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/lib/index.d.ts +1 -1
- package/lib/menu.js +1 -1
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export * from './prefix/react-router-dom.js';
|
|
3
3
|
export { pathToRegexp } from 'path-to-regexp';
|
|
4
|
-
export { default as sso } from 'shared-store-object';
|
|
4
|
+
export { default as sso, type SSOConfig, type PrivateSSOConfig } from 'shared-store-object';
|
|
5
5
|
export declare const IconFont: any;
|
|
6
6
|
export declare const LayoutMenu: any;
|
|
7
7
|
export declare const DashboardLayout: any;
|
package/lib/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}import{isEqual as n,isFunction as o,persistence as a}from"@moneko/common";import i from"shared-store-object";import u from"./persistentKey";var l=a.load,f=i({activeKey:l(u.menuActiveKey,"home"),expandKey:l(u.menuExpandKey,[]),menus:l(u.menuMenus,[]),kv:l(u.menuKv,{}),tabs:l(u.menuTabs,[])}),c=function(e,r){if(void 0===r&&(r=[]),0===e.length)return r;var n=e[0],o=n.children,a=void 0===o?[]:o,i=n.i18n,u=n.label,l=n.hideMenu,f=t(n,["children","i18n","label","hideMenu"]),s=Object.create(null);return Object.assign(s,f,{label:i||u,props:void 0,element:void 0}),a.length&&(s.children=c(a)),l||r.push(s),c(e.slice(1),r)},s=function(e,r){for(var n,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=unsupportedIterableToArray(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=o()).done;){var a=n.value,i=a.children,u=t(a,["children"]);r[a.key]=u,(null==i?void 0:i.length)&&s(i,r)}};export function setMenu(e){var r=c(e),t={};s(r,t),f.menus=r,f.kv=t}export function addTab(t){var o=f.kv[t.key];if(o&&!f.tabs.find(function(e){return e.key===t.key})){var a,i=((function(r){if(Array.isArray(r))return e(r)})(a=f.tabs)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([r({},o,{i18n:o.i18n||"route-"+o.key},t)]);n(i,f.tabs)||(f.tabs=i)}}export function openTab(e){f.activeKey=e.key,addTab(e)}export function closeTab(e,r,t){if(void 0===r&&(r="self"),e){for(var n=f.tabs,
|
|
1
|
+
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}import{isEqual as n,isFunction as o,persistence as a}from"@moneko/common";import i from"shared-store-object";import u from"./persistentKey";var l=a.load,f=i({activeKey:l(u.menuActiveKey,"home"),expandKey:l(u.menuExpandKey,[]),menus:l(u.menuMenus,[]),kv:l(u.menuKv,{}),tabs:l(u.menuTabs,[])}),c=function(e,r){if(void 0===r&&(r=[]),0===e.length)return r;var n=e[0],o=n.children,a=void 0===o?[]:o,i=n.i18n,u=n.label,l=n.hideMenu,f=t(n,["children","i18n","label","hideMenu"]),s=Object.create(null);return Object.assign(s,f,{label:i||u,props:void 0,element:void 0}),a.length&&(s.children=c(a)),l||r.push(s),c(e.slice(1),r)},s=function(e,r){for(var n,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=unsupportedIterableToArray(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=o()).done;){var a=n.value,i=a.children,u=t(a,["children"]);r[a.key]=u,(null==i?void 0:i.length)&&s(i,r)}};export function setMenu(e){var r=c(e),t={};s(r,t),f.menus=r,f.kv=t}export function addTab(t){var o=f.kv[t.key];if(o&&!f.tabs.find(function(e){return e.key===t.key})){var a,i=((function(r){if(Array.isArray(r))return e(r)})(a=f.tabs)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([r({},o,{i18n:o.i18n||"route-"+o.key},t)]);n(i,f.tabs)||(f.tabs=i)}}export function openTab(e){f.activeKey=e.key,addTab(e)}export function closeTab(e,r,t){if(void 0===r&&(r="self"),e){for(var n,a=f.tabs,i=f.activeKey,u=[],l=[],c="self"===r,s=a.findIndex(function(r){return r.key===e}),y=0,d=a.length;y<d;y++){var b,p=a[y],v=(b=y,!1===p.closable||({left:b>=s,right:b<=s,other:b===s,self:e!==p.key})[r]);if(c){if(!v&&e===i){var m=y?y-1:y+1;a[m]&&(i=a[m].key,n=a[m])}}else v&&p.key===e&&i!==e&&(i=e,n=p);v||u.push(p),v&&l.push(p)}if(f.tabs=l,f.activeKey=i,o(t)){t(u,n);return}}}export function expandMenu(e){n(e,f.expandKey)||(f.expandKey=e)}export default f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.53",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@emotion/css": "11.10.6",
|
|
19
19
|
"@mapbox/rehype-prism": "0.8.0",
|
|
20
20
|
"@mdx-js/loader": "2.3.0",
|
|
21
|
-
"@moneko/common": "1.0.
|
|
21
|
+
"@moneko/common": "1.0.32",
|
|
22
22
|
"@parcel/css": "1.14.0",
|
|
23
23
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
24
24
|
"@soda/friendly-errors-webpack-plugin": "1.8.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"swc-plugin-another-transform-imports": "0.2.1",
|
|
53
53
|
"ts-import-plugin": "2.0.0",
|
|
54
54
|
"ts-loader": "9.4.2",
|
|
55
|
-
"typescript": "
|
|
55
|
+
"typescript": "5.0.2",
|
|
56
56
|
"webpack": "5.76.1",
|
|
57
57
|
"webpack-bundle-analyzer": "4.8.0",
|
|
58
58
|
"webpack-cli": "5.0.1",
|