| @@ -63,3 +63,5 @@ mvnw | |||||
| /react-ui/docs | /react-ui/docs | ||||
| /react-ui/types/tsconfig.tsbuildinfo | /react-ui/types/tsconfig.tsbuildinfo | ||||
| /react-ui/storybook-static | |||||
| /react-ui/.storybook/deploy.sh | |||||
| @@ -4,7 +4,6 @@ export default function(babel) { | |||||
| visitor: { | visitor: { | ||||
| ImportDeclaration(path) { | ImportDeclaration(path) { | ||||
| const source = path.node.source.value; | const source = path.node.source.value; | ||||
| // console.log("zzzz", source); | |||||
| if (source.endsWith('.less')) { | if (source.endsWith('.less')) { | ||||
| if (path.node.specifiers.length > 0) { | if (path.node.specifiers.length > 0) { | ||||
| path.node.source.value += "?modules"; | path.node.source.value += "?modules"; | ||||
| @@ -16,7 +16,11 @@ const config: StorybookConfig = { | |||||
| name: '@storybook/react-webpack5', | name: '@storybook/react-webpack5', | ||||
| options: {}, | options: {}, | ||||
| }, | }, | ||||
| staticDirs: ['../public', { from: '../docs', to: '/docs' }], | |||||
| staticDirs: [ | |||||
| '../public', | |||||
| { from: '../docs', to: '/docs' }, | |||||
| { from: '../docs/index.html', to: '/docs/index.html' }, | |||||
| ], | |||||
| docs: { | docs: { | ||||
| defaultName: 'Documentation', | defaultName: 'Documentation', | ||||
| }, | }, | ||||
| @@ -40,6 +40,7 @@ | |||||
| "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev", | "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev", | ||||
| "storybook": "storybook dev -p 6006", | "storybook": "storybook dev -p 6006", | ||||
| "storybook-build": "storybook build", | "storybook-build": "storybook build", | ||||
| "storybook-deploy": "./.storybook/deploy.sh", | |||||
| "storybook-docs": "storybook dev --docs", | "storybook-docs": "storybook dev --docs", | ||||
| "storybook-docs-build": "storybook build --docs", | "storybook-docs-build": "storybook build --docs", | ||||
| "test": "jest", | "test": "jest", | ||||
| @@ -44,7 +44,7 @@ type IframePageProps = { | |||||
| /** 子系统 */ | /** 子系统 */ | ||||
| type: IframePageType; | type: IframePageType; | ||||
| /** 是否可以在页签上打开 */ | /** 是否可以在页签上打开 */ | ||||
| openInTab: boolean; | |||||
| openInTab?: boolean; | |||||
| /** 自定义样式类名 */ | /** 自定义样式类名 */ | ||||
| className?: string; | className?: string; | ||||
| /** 自定义样式 */ | /** 自定义样式 */ | ||||
| @@ -4,7 +4,7 @@ import { fn } from '@storybook/test'; | |||||
| // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | ||||
| const meta = { | const meta = { | ||||
| title: 'Components/FullScreenFrame 全屏iframe', | |||||
| title: 'Components/FullScreenFrame 全屏 iframe', | |||||
| component: FullScreenFrame, | component: FullScreenFrame, | ||||
| parameters: { | parameters: { | ||||
| // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||||
| @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react'; | |||||
| // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | ||||
| const meta = { | const meta = { | ||||
| title: 'Components/IFramePage iframe页面', | |||||
| title: 'Components/IFramePage iframe 页面', | |||||
| component: IFramePage, | component: IFramePage, | ||||
| parameters: { | parameters: { | ||||
| // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||||
| @@ -5,14 +5,10 @@ | |||||
| */ | */ | ||||
| /** | /** | ||||
| * Safely invokes a function with a given value, returning the result of the | |||||
| * function or the provided value if it is `undefined` or `null`. | |||||
| * 安全调用函数,如果参数是 `undefined` 或 `null`,直接返回 `undefined` 或 `null`,而不会导致异常 | |||||
| * | * | ||||
| * @template T - The type of the input value. | |||||
| * @template M - The type of the output value. | |||||
| * @param {function} fn - The function to be invoked with the input value. | |||||
| * @returns {function} A function that takes a value, invokes `fn` with it if | |||||
| * it's not `undefined` or `null`, and returns the result or the original value. | |||||
| * @param fn - 要调用的函数 | |||||
| * @returns 封装后的函数,该函数的参数如果是 `undefined` 或 `null`,结果直接返回 `undefined` 或 `null`,而不会导致异常 | |||||
| */ | */ | ||||
| export function safeInvoke<T, M>( | export function safeInvoke<T, M>( | ||||
| fn: (value: T) => M | undefined | null, | fn: (value: T) => M | undefined | null, | ||||