@moneko/core 2.0.31 → 2.0.33
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/components/app-router.js +1 -1
- package/lib/components/fallback-comp.d.ts +2 -1
- package/lib/components/fallback-comp.js +1 -1
- package/lib/components/fallback.d.ts +2 -3
- package/lib/components/fallback.js +1 -1
- package/lib/index.d.ts +16 -5
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}import r,{Fragment as t,Suspense as a,cloneElement as n,createElement as o,useEffect as i,isValidElement as
|
|
1
|
+
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}import r,{Fragment as t,Suspense as a,cloneElement as n,createElement as o,useEffect as i,isValidElement as l}from"react";import{isObject as c}from"@moneko/common";import{AliveScope as p,KeepAlive as m,useAliveController as u}from"react-activation";import{createBrowserRouter as f,createHashRouter as s}from"react-router-dom";import{router as d}from"../router";var h=fallbackCompPath?require("./fallback").default:r.createElement(r.Fragment,null),g=function(t){var a=t.children,o=t.name,l=function(e,r){if(null==e)return{};var t,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r.indexOf(t=o[a])>=0||(n[t]=e[t]);return n}(t,["children","name"]),c=u(),p=c.drop,f=c.dropScope,s=c.clear,d=c.getCachingNodes,h=window.location.pathname+window.location.hash;return i(function(){window.__POWERED_BY_QIANKUN__&&window.primaryApp&&(window.primaryApp.currentTarget||(window.primaryApp.currentTarget={}),Object.assign(window.primaryApp.currentTarget,{aliveController:{drop:p,dropScope:f,clear:s,getCachingNodes:d}}))},[s,p,f,d]),r.createElement(m,e({id:h,name:h},l),n(a,{path:o,selfUrl:h}))},v=!1;export var createRouter="hash"===programInfo.routerMode?s:f;export var RouterFragment=t;export function prefixRouter(e,t){return e.map(function(e){var i=Object.assign({},e);if(i.alive&&!v&&(v=!0,RouterFragment=p),i.element){var m=Object.assign({path:i.key},i.props),u=l(i.element)?n(i.element,m):o(i.element,m);if(i.alive){var f={name:i.key,cacheKey:i.key};c(i.alive)&&Object.assign(f,i.alive),i.element=o(g,f,u)}else i.element=r.createElement(a,{fallback:e.fallback||t},u)}return Array.isArray(i.children)&&(i.children=prefixRouter(i.children,t)),i})}export var routerData=prefixRouter(d,r.createElement(h,null));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface FallbackCompProps {
|
|
3
3
|
/** 组件所在父级目录(默认:components) */
|
|
4
4
|
directory?: string;
|
|
@@ -6,5 +6,6 @@ export interface FallbackCompProps {
|
|
|
6
6
|
compName: string;
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
}
|
|
9
|
+
export declare const Fallback: React.FC;
|
|
9
10
|
declare const _default: React.NamedExoticComponent<FallbackCompProps>;
|
|
10
11
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return(e=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)}import
|
|
1
|
+
function e(){return(e=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)}import r,{useMemo as t,useState as n}from"react";import{useOutlet as o}from"react-router-dom";var a=function(t){var n=t.directory,o=void 0===n?"components":n,a=t.compName,c=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}(t,["directory","compName"]),l=r.Fragment;try{l=require("@/"+o+"/"+a).default}catch(e){console.info(a+" 组件不存在, 请在 @/"+o+"/"+a+" 目录下新建 index.tsx, 并导出默认组件")}return r.isValidElement(l)?null:r.createElement(l,e({},c))};export var Fallback=function(){var e,c=null==(e=o())?void 0:e.props.children,l=n(r.createElement(r.Fragment,null,"Loading...")),i=l[0],m=l[1];return t(function(){if("string"==typeof fallbackCompPath){var e=fallbackCompPath.replace(/@\//,"").split("/"),t=e[0],n=e.slice(1);m(r.createElement(a,{directory:t,compName:n.join("/")}))}},[]),c||i};export default r.memo(a);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export default _default;
|
|
1
|
+
declare const Fallback: any;
|
|
2
|
+
export default Fallback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"react";var e=fallbackCompPath?require("./fallback").Fallback:function(){return a.createElement(a.Fragment,null)};export default e;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,15 +2,26 @@
|
|
|
2
2
|
export * from './prefix/react-router-dom.js';
|
|
3
3
|
export { pathToRegexp } from 'path-to-regexp';
|
|
4
4
|
export { default as sso } from 'shared-store-object';
|
|
5
|
-
export
|
|
5
|
+
export declare const LayoutMenu: any;
|
|
6
|
+
export declare const DashboardLayout: any;
|
|
7
|
+
export declare const IconFont: any;
|
|
8
|
+
declare const localizable: any;
|
|
9
|
+
declare const setLanguage: any;
|
|
10
|
+
declare const interpolateString: any;
|
|
11
|
+
export { localizable, setLanguage, interpolateString };
|
|
12
|
+
export type { LocaleConfig, LocaleName } from './localizable';
|
|
13
|
+
declare const menu: any;
|
|
14
|
+
declare const addTab: any;
|
|
15
|
+
declare const closeTab: any;
|
|
16
|
+
declare const openTab: any;
|
|
17
|
+
declare const setMenu: any;
|
|
18
|
+
declare const expandMenu: any;
|
|
19
|
+
export { menu, addTab, closeTab, openTab, setMenu, expandMenu };
|
|
20
|
+
export type { TabItem, MenuItem, CloseTab } from './menu';
|
|
6
21
|
export { matchUtil, router, onlyLoginRouter, myPkgs, myDemoKv, mdxComponents, type ExampleModule, type RouterProps, type MyPkg, } from './router';
|
|
7
22
|
export { default as persistentKey } from './persistentKey';
|
|
8
|
-
export { default as menu, addTab, closeTab, openTab, setMenu, expandMenu, type TabItem, type MenuItem, type CloseTab, } from './menu';
|
|
9
23
|
export type { LayoutMenuProps } from './components/layout-menu';
|
|
10
24
|
export { createRouter, prefixRouter, routerData, RouterFragment } from './components/app-router';
|
|
11
|
-
export declare const LayoutMenu: any;
|
|
12
|
-
export declare const DashboardLayout: any;
|
|
13
|
-
export declare const IconFont: any;
|
|
14
25
|
export type { ConfigType, AppType, CommomType, ProgramInfoType, MemberTransformer, CoverageType, TerserOptions, MinifierType, SourceMapDevToolPluginOptions, ProjectCoverageType, SharedConfig, SwcOptions, OptimizationSplitChunksOptions, SwcImportOnDemandTransform, Theme, } from '../typings/global';
|
|
15
26
|
import type { ConfigType, CommomType, CoverageType, ProjectCoverageType } from '../typings/global';
|
|
16
27
|
export type PartialConfigType<T = 'swc'> = Partial<ConfigType<T>>;
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./prefix/react-router-dom.js";export{pathToRegexp}from"path-to-regexp";export{default as sso}from"shared-store-object";export
|
|
1
|
+
export*from"./prefix/react-router-dom.js";export{pathToRegexp}from"path-to-regexp";export{default as sso}from"shared-store-object";export var LayoutMenu=hasAntd?require("./components/layout-menu").default:null;export var DashboardLayout=hasAntd?require("./packages/back-stage/layout").default:null;export var IconFont=hasAntd?require("./components/iconfont").default:null;var e=hasLocales?require("./localizable"):null,o=e?e.default:null,r=e?e.setLanguage:null,t=e?e.interpolateString:null;var a=hasAntd?require("./menu"):null,n=a?a.default:null,l=a?a.addTab:null,u=a?a.closeTab:null,p=a?a.openTab:null,s=a?a.setMenu:null,m=a?a.expandMenu:null;export{matchUtil,router,onlyLoginRouter,myPkgs,myDemoKv,mdxComponents}from"./router";export{default as persistentKey}from"./persistentKey";export{createRouter,prefixRouter,routerData,RouterFragment}from"./components/app-router";export var projectBasicInfo={projectName:projectName,providerConfig:providerConfig,programInfo:programInfo,coverage:projectCoverage};export{o as localizable,r as setLanguage,t as interpolateString,n as menu,l as addTab,u as closeTab,p as openTab,s as setMenu,m as expandMenu};
|