From e1faa8452c16dd69d04c70601a5b728cb0942a4a Mon Sep 17 00:00:00 2001 From: gengyang Date: Tue, 31 Mar 2020 20:20:20 +0800 Subject: [PATCH 1/7] feat: support localizing --- packages/material-parser/package.json | 1 + packages/material-parser/src/generate.ts | 2 +- packages/material-parser/src/index.ts | 12 +- packages/material-parser/src/localize.ts | 26 +- packages/material-parser/src/parse/index.ts | 5 +- .../material-parser/src/parse/transform.ts | 18 +- packages/material-parser/src/scan.ts | 79 +- .../src/types/IMaterialScanModel.ts | 11 +- .../src/types/IMaterializeOptions.ts | 9 +- .../fixtures/__snapshots__/test/index.ts.md | 8710 ++++++++++++++++- .../fixtures/__snapshots__/test/index.ts.snap | Bin 6148 -> 73232 bytes .../fixtures/__snapshots__/test/scan.ts.md | 204 +- .../fixtures/__snapshots__/test/scan.ts.snap | Bin 1656 -> 1555 bytes packages/material-parser/test/index.ts | 13 +- packages/material-parser/test/scan.ts | 2 - 15 files changed, 8864 insertions(+), 228 deletions(-) diff --git a/packages/material-parser/package.json b/packages/material-parser/package.json index 87caa2fc4..f061f4525 100644 --- a/packages/material-parser/package.json +++ b/packages/material-parser/package.json @@ -20,6 +20,7 @@ "jest-watch-typeahead": "^0.3.1", "js-yaml": "^3.13.1", "json-schema-to-typescript": "^8.2.0", + "tslib": "^1.11.1", "typescript": "^3.8.3" }, "scripts": { diff --git a/packages/material-parser/src/generate.ts b/packages/material-parser/src/generate.ts index 115e79b6f..65beef943 100644 --- a/packages/material-parser/src/generate.ts +++ b/packages/material-parser/src/generate.ts @@ -46,7 +46,7 @@ export async function genManifest( package: matScanModel.pkgName, version: matScanModel.pkgVersion, exportName: matParsedModel.componentName, - main: matScanModel.mainEntry, + main: matScanModel.entryFilePath, destructuring: false, subName: '', }, diff --git a/packages/material-parser/src/index.ts b/packages/material-parser/src/index.ts index 8d3b3118c..267a83629 100644 --- a/packages/material-parser/src/index.ts +++ b/packages/material-parser/src/index.ts @@ -10,17 +10,17 @@ import generate from './generate'; import parse from './parse'; import localize from './localize'; -export default async function( - options: IMaterializeOptions, -): Promise { +export default async function(options: IMaterializeOptions): Promise { const { accesser = 'local' } = options; if (accesser === 'online') { - const { entry, cwd } = await localize(options); + const entry = await localize(options); options.entry = entry; - options.cwd = cwd; } const scanedModel = await scan(options); - const parsedModel = await parse(scanedModel.modules[0]); + const parsedModel = await parse({ + filePath: scanedModel.entryFilePath, + fileContent: scanedModel.entryFileContent, + }); const result = await generate(scanedModel, parsedModel); return result; } diff --git a/packages/material-parser/src/localize.ts b/packages/material-parser/src/localize.ts index dfdbcbbad..fb59a795d 100644 --- a/packages/material-parser/src/localize.ts +++ b/packages/material-parser/src/localize.ts @@ -33,13 +33,13 @@ export async function createFakePackage(params: { pkgJsonFilePath, JSON.stringify({ name: params.pkgName, - version: params.pkgVersion, + version: params.pkgVersion || '0.0.0', dependencies: { - [params.pkgName]: params.pkgVersion, + [params.pkgName]: params.pkgVersion || 'latest', }, }), ); - debugger; + // 安装依赖 const npmClient = params.npmClient || 'tnpm'; await spawn(npmClient, ['i'], { stdio: 'inherit', cwd: tempDir } as any); @@ -68,12 +68,12 @@ export async function createTempDir(): Promise { * @returns {{ [key: string]: any }} * @memberof OnlineAccesser */ -export function getPkgNameAndVersion( - pkgNameWithVersion: string, -): { [key: string]: any } { +export function getPkgNameAndVersion(pkgNameWithVersion: string): { [key: string]: any } { const matches = pkgNameWithVersion.match(/(@\d+\.\d+\.\d+)$/); if (!matches) { - throw new OtterError(`Illegal semver version: ${pkgNameWithVersion}`); + return { + name: pkgNameWithVersion, + }; } const semverObj = semver.coerce(matches[0]); const name = pkgNameWithVersion.replace(matches[0], ''); @@ -84,12 +84,7 @@ export function getPkgNameAndVersion( } // 将问题转化为本地物料化场景 -export default async function localize( - options: IMaterializeOptions, -): Promise<{ - cwd: string; - entry: string; -}> { +export default async function localize(options: IMaterializeOptions): Promise { // 创建临时目录 const tempDir = await createTempDir(); // 创建组件包 @@ -101,8 +96,5 @@ export default async function localize( npmClient: options.npmClient, }); - return { - cwd: tempDir, - entry: join(tempDir, 'node_modules', name), - }; + return join(tempDir, 'node_modules', name); } diff --git a/packages/material-parser/src/parse/index.ts b/packages/material-parser/src/parse/index.ts index ccfe3212e..028200af2 100644 --- a/packages/material-parser/src/parse/index.ts +++ b/packages/material-parser/src/parse/index.ts @@ -5,10 +5,7 @@ import { IMaterialParsedModel, IMaterialScanModel } from '../types'; import resolver from './resolver'; import handlers from './handlers'; -export default function parse(params: { - fileContent: string; - filePath: string; -}): Promise { +export default function parse(params: { fileContent: string; filePath: string }): Promise { const { fileContent, filePath } = params; const result = reactDocs.parse( fileContent, diff --git a/packages/material-parser/src/parse/transform.ts b/packages/material-parser/src/parse/transform.ts index e2fe3f1cb..11de2aa22 100644 --- a/packages/material-parser/src/parse/transform.ts +++ b/packages/material-parser/src/parse/transform.ts @@ -49,10 +49,7 @@ export function transformType(type: any) { } = type; if (properties.length === 0) { result.type = 'object'; - } else if ( - properties.length === 1 && - typeof properties[0].key === 'object' - ) { + } else if (properties.length === 1 && typeof properties[0].key === 'object') { result.type = 'objectOf'; const v = transformType(properties[0].value); if (typeof v.type === 'string') result.value = v.type; @@ -81,7 +78,7 @@ export function transformType(type: any) { break; case 'exact': case 'shape': - result.value = Object.keys(value).map(n => { + result.value = Object.keys(value).map((n) => { // tslint:disable-next-line:variable-name const { name: _name, ...others } = value[n]; return transformItem(n, { @@ -110,13 +107,7 @@ export function transformType(type: any) { } export function transformItem(name: string, item: any) { - const { - description, - flowType, - type = flowType, - required, - defaultValue, - } = item; + const { description, flowType, type = flowType, required, defaultValue } = item; const result: any = { name, propType: transformType({ @@ -133,6 +124,9 @@ export function transformItem(name: string, item: any) { result.defaultValue = value; } catch (e) {} } + if (result.propType === undefined) { + delete result.propType; + } return result; } diff --git a/packages/material-parser/src/scan.ts b/packages/material-parser/src/scan.ts index 45fc361ca..9dd0f89a8 100644 --- a/packages/material-parser/src/scan.ts +++ b/packages/material-parser/src/scan.ts @@ -1,58 +1,53 @@ import { IMaterializeOptions, IMaterialScanModel, SourceType } from './types'; -import { pathExists, readFile } from 'fs-extra'; +import { pathExists, readFile, lstatSync } from 'fs-extra'; import { join } from 'path'; import { debug } from './otter-core'; const log = debug.extend('mat'); -export default async function scan( - options: IMaterializeOptions, -): Promise { +export default async function scan(options: IMaterializeOptions): Promise { const model: IMaterialScanModel = { pkgName: '', pkgVersion: '', - mainEntry: '', sourceType: SourceType.MODULE, - modules: [], + entryFilePath: '', + entryFileContent: '', }; log('options', options); // 入口文件路径 - let entryFilePath = null; - const cwd = options.cwd ? options.cwd : ''; - const entry = options.entry; - const isDepsMode = cwd !== entry; - const pkgJsonPath = join(cwd, 'package.json'); - // 判断是否存在 package.json - if (!(await pathExists(pkgJsonPath))) { - throw new Error(`Cannot find package.json. ${pkgJsonPath}`); + let entryFilePath = options.entry; + const stats = lstatSync(entryFilePath); + debugger; + if (!stats.isFile()) { + let mainFilePath = ''; + const pkgJsonPath = join(entryFilePath, 'package.json'); + // 判断是否存在 package.json + if (!(await pathExists(pkgJsonPath))) { + throw new Error(`Cannot find package.json. ${pkgJsonPath}`); + } + // 读取 package.json + let pkgJson = await resolvePkgJson(pkgJsonPath); + model.pkgName = pkgJson.name; + model.pkgVersion = pkgJson.version; + if (pkgJson.module) { + // 支持 es module + model.sourceType = SourceType.MODULE; + mainFilePath = pkgJson.module; + } else if (pkgJson.main) { + // 支持 commonjs + model.sourceType = SourceType.MAIN; + mainFilePath = pkgJson.main; + } else { + mainFilePath = './index.js'; + } + entryFilePath = join(entryFilePath, mainFilePath); } - // 读取 package.json - let pkgJson = await resolvePkgJson(pkgJsonPath); - model.pkgName = pkgJson.name; - model.pkgVersion = pkgJson.version; - if (isDepsMode) { - pkgJson = await resolvePkgJson(join(entry, 'package.json')); - } - if (pkgJson.module) { - // 支持 es module - model.sourceType = SourceType.MODULE; - entryFilePath = pkgJson.module; - } else if (pkgJson.main) { - // 支持 commonjs - model.sourceType = SourceType.MAIN; - entryFilePath = pkgJson.main; - } else { - entryFilePath = './index.js'; - } - entryFilePath = join(isDepsMode ? entry : cwd, entryFilePath); + log('entryFilePath', entryFilePath); - const entryFile = await loadFile(entryFilePath); - log('entryFile', entryFile); - model.mainEntry = entryFilePath; + const entryFileContent = await loadFile(entryFilePath); + log('entryFile', entryFileContent); + model.entryFilePath = entryFilePath; + model.entryFileContent = entryFileContent; // 记录入口文件 - model.modules.push({ - filePath: entryFilePath, - fileContent: entryFile, - }); log('model', model); return model; } @@ -65,9 +60,7 @@ export async function loadFile(filePath: string): Promise { return content.toString(); } -export async function resolvePkgJson( - pkgJsonPath: string, -): Promise<{ [k: string]: any }> { +export async function resolvePkgJson(pkgJsonPath: string): Promise<{ [k: string]: any }> { const content = await loadFile(pkgJsonPath); const json = JSON.parse(content); return json; diff --git a/packages/material-parser/src/types/IMaterialScanModel.ts b/packages/material-parser/src/types/IMaterialScanModel.ts index c87bdc6d7..3ed74a48c 100644 --- a/packages/material-parser/src/types/IMaterialScanModel.ts +++ b/packages/material-parser/src/types/IMaterialScanModel.ts @@ -2,15 +2,12 @@ * 对应扫描阶段的产物 */ interface IMaterialScanModel { - /** 入口文件地址 */ - mainEntry: string; /** 标记物料组件包所使用的模块规范 */ sourceType: 'module' | 'main'; - /** 每个文件对应的文件内容 */ - modules: { - filePath: string; - fileContent: string; - }[]; + /** 入口文件路径 */ + entryFilePath: string; + /** 入口文件内容 */ + entryFileContent: string; /** 当前包名 */ pkgName: string; /** 当前包版本 */ diff --git a/packages/material-parser/src/types/IMaterializeOptions.ts b/packages/material-parser/src/types/IMaterializeOptions.ts index f1fdb82a0..259656f08 100644 --- a/packages/material-parser/src/types/IMaterializeOptions.ts +++ b/packages/material-parser/src/types/IMaterializeOptions.ts @@ -7,7 +7,7 @@ import IExtensionConfigManifest from './IExtensionConfigManifest'; */ interface IMaterializeOptions { /** - * 入口文件路径或包名 + * 组件文件(夹)路径或包名 * 形如: * 本地路径:/usr/project/src/container/DemoMaterial * 包名:@ali/demo-material@0.0.1 @@ -22,13 +22,6 @@ interface IMaterializeOptions { */ accesser: 'local' | 'online'; - /** - * 当 accesser=local 时,需要通过此配置项指定当前工作目录,形如:/usr/.../demo-project - * @type {string} - * @memberof IMaterializeOptions - */ - cwd?: string; - /** * 扩展点 */ diff --git a/packages/material-parser/test/fixtures/__snapshots__/test/index.ts.md b/packages/material-parser/test/fixtures/__snapshots__/test/index.ts.md index 8d9ff0cf6..5425ba09e 100644 --- a/packages/material-parser/test/fixtures/__snapshots__/test/index.ts.md +++ b/packages/material-parser/test/fixtures/__snapshots__/test/index.ts.md @@ -4,6 +4,8678 @@ The actual snapshot is saved in `index.ts.snap`. Generated by [AVA](https://avajs.dev). +## fusion next component by local + +> Snapshot 1 + + [ + { + componentName: 'Affix', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Affix', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: Function {}, + description: `设置 Affix 需要监听滚动事件的容器元素␊ + @return {ReactElement} 目标容器元素的实例`, + name: 'container', + propType: 'func', + }, + { + description: '距离窗口顶部达到指定偏移量后触发', + name: 'offsetTop', + propType: 'number', + }, + { + description: '距离窗口底部达到制定偏移量后触发', + name: 'offsetBottom', + propType: 'number', + }, + { + description: `当元素的样式发生固钉样式变化时触发的回调函数␊ + @param {Boolean} affixed 元素是否被固钉`, + name: 'onAffix', + propType: 'func', + }, + { + description: `是否启用绝对布局实现 affix␊ + @param {Boolean} 是否启用绝对布局`, + name: 'useAbsolute', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'style', + propType: 'object', + }, + { + name: 'children', + propType: 'any', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Animate', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Animate', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + description: '动画 className', + name: 'animation', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'object', + ], + }, + }, + { + defaultValue: true, + description: '子元素第一次挂载时是否执行动画', + name: 'animationAppear', + propType: 'bool', + }, + { + defaultValue: 'div', + description: '包裹子元素的标签', + name: 'component', + propType: 'any', + }, + { + defaultValue: true, + description: '是否只有单个子元素,如果有多个子元素,请设置为 false', + name: 'singleMode', + propType: 'bool', + }, + { + description: '子元素', + name: 'children', + propType: { + type: 'oneOfType', + value: [ + 'element', + { + type: 'arrayOf', + value: 'element', + }, + ], + }, + }, + { + defaultValue: Function {}, + description: `执行第一次挂载动画前触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'beforeAppear', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行第一次挂载动画,添加 xxx-appear-active 类名后触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'onAppear', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行完第一次挂载动画后触发的函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'afterAppear', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行进场动画前触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'beforeEnter', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行进场动画,添加 xxx-enter-active 类名后触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'onEnter', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行完进场动画后触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'afterEnter', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行离场动画前触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'beforeLeave', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行离场动画,添加 xxx-leave-active 类名后触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'onLeave', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `执行完离场动画后触发的回调函数␊ + @param {HTMLElement} node 执行动画的 dom 元素`, + name: 'afterLeave', + propType: 'func', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Badge', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Badge', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'style', + propType: 'object', + }, + { + description: '徽章依托的内容', + name: 'children', + propType: 'node', + }, + { + defaultValue: 0, + description: '展示的数字,大于 overflowCount 时显示为 ${overflowCount}+,为 0 时默认隐藏', + name: 'count', + propType: { + type: 'oneOfType', + value: [ + 'number', + 'string', + ], + }, + }, + { + defaultValue: false, + description: '当count为0时,是否显示count', + name: 'showZero', + propType: 'bool', + }, + { + description: '自定义节点内容', + name: 'content', + propType: 'node', + }, + { + defaultValue: 99, + description: '展示的封顶的数字', + name: 'overflowCount', + propType: { + type: 'oneOfType', + value: [ + 'number', + 'string', + ], + }, + }, + { + defaultValue: false, + description: '不展示数字,只展示一个小红点', + name: 'dot', + propType: 'bool', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Balloon', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Balloon', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + description: '自定义类名', + name: 'className', + propType: 'string', + }, + { + description: '自定义内敛样式', + name: 'style', + propType: 'object', + }, + { + description: '浮层的内容', + name: 'children', + propType: 'any', + }, + { + defaultValue: 'medium', + name: 'size', + propType: 'string', + }, + { + defaultValue: 'normal', + description: '样式类型', + name: 'type', + propType: { + type: 'oneOf', + value: [ + 'normal', + 'primary', + ], + }, + }, + { + description: '弹层当前显示的状态', + name: 'visible', + propType: 'bool', + }, + { + defaultValue: false, + description: '弹层默认显示的状态', + name: 'defaultVisible', + propType: 'bool', + }, + { + description: `弹层在显示和隐藏触发的事件␊ + @param {Boolean} visible 弹层是否隐藏和显示␊ + @param {String} type 触发弹层显示或隐藏的来源, closeClick 表示由自带的关闭按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发`, + name: 'onVisibleChange', + propType: 'func', + }, + { + defaultValue: false, + description: '弹出层对齐方式, 是否为边缘对齐', + name: 'alignEdge', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否显示关闭按钮', + name: 'closable', + propType: 'bool', + }, + { + defaultValue: 'b', + description: `弹出层位置␊ + @enumdesc 上, 右, 下, 左, 上左, 上右, 下左, 下右, 左上, 左下, 右上, 右下 及其 两两组合`, + name: 'align', + propType: { + type: 'oneOf', + value: [ + 't', + 'r', + 'b', + 'l', + 'tl', + 'tr', + 'bl', + 'br', + 'lt', + 'lb', + 'rt', + 'rb', + ], + }, + }, + { + defaultValue: [ + 0, + 0, + ], + description: `弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量␊ + e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px`, + name: 'offset', + propType: 'array', + }, + { + description: '触发元素', + name: 'trigger', + propType: 'any', + }, + { + defaultValue: 'hover', + description: `触发行为␊ + 鼠标悬浮, 鼠标点击('hover','click')或者它们组成的数组,如 ['hover', 'click'], 强烈不建议使用'focus',若弹窗内容有复杂交互请使用click`, + name: 'triggerType', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + name: 'onClick', + propType: 'func', + }, + { + description: '任何visible为false时会触发的事件', + name: 'onClose', + propType: 'func', + }, + { + name: 'onHover', + propType: 'func', + }, + { + defaultValue: false, + description: '是否进行自动位置调整', + name: 'needAdjust', + propType: 'bool', + }, + { + description: '弹层在触发以后的延时显示, 单位毫秒 ms', + name: 'delay', + propType: 'number', + }, + { + description: '浮层关闭后触发的事件, 如果有动画,则在动画结束后触发', + name: 'afterClose', + propType: 'func', + }, + { + description: '强制更新定位信息', + name: 'shouldUpdatePosition', + propType: 'bool', + }, + { + defaultValue: true, + description: '弹层出现后是否自动focus到内部第一个元素', + name: 'autoFocus', + propType: 'bool', + }, + { + defaultValue: undefined, + description: '安全节点:对于triggetType为click的浮层,会在点击除了浮层外的其它区域时关闭浮层.safeNode用于添加不触发关闭的节点, 值可以是dom节点的id或者是节点的dom对象', + name: 'safeNode', + propType: 'string', + }, + { + defaultValue: null, + description: '用来指定safeNode节点的id,和safeNode配合使用', + name: 'safeId', + propType: 'string', + }, + { + description: `配置动画的播放方式␊ + @param {String} in 进场动画␊ + @param {String} out 出场动画`, + name: 'animation', + propType: { + type: 'oneOfType', + value: [ + 'object', + 'bool', + ], + }, + }, + { + defaultValue: false, + description: '弹层的dom节点关闭时是否删除', + name: 'cache', + propType: 'bool', + }, + { + description: '指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。', + name: 'popupContainer', + propType: 'any', + }, + { + name: 'container', + propType: 'any', + }, + { + defaultValue: undefined, + description: '弹层组件style,透传给Popup', + name: 'popupStyle', + propType: 'object', + }, + { + defaultValue: '', + description: '弹层组件className,透传给Popup', + name: 'popupClassName', + propType: 'string', + }, + { + defaultValue: undefined, + description: '弹层组件属性,透传给Popup', + name: 'popupProps', + propType: 'object', + }, + { + description: '是否跟随滚动', + name: 'followTrigger', + propType: 'bool', + }, + { + description: '弹层id, 传入值才会支持无障碍', + name: 'id', + propType: 'string', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Breadcrumb', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Breadcrumb', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + description: '样式类名的品牌前缀', + name: 'prefix', + propType: 'string', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + description: '面包屑子节点,需传入 Breadcrumb.Item', + name: 'children', + propType: 'custom', + }, + { + defaultValue: 100, + description: '面包屑最多显示个数,超出部分会被隐藏, 设置为 auto 会自动根据父元素的宽度适配。', + name: 'maxNode', + propType: { + type: 'oneOfType', + value: [ + 'number', + { + type: 'oneOf', + value: [ + 'auto', + ], + }, + ], + }, + }, + { + description: '分隔符,可以是文本或 Icon', + name: 'separator', + propType: 'node', + }, + { + defaultValue: 'nav', + description: '设置标签类型', + name: 'component', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'func', + ], + }, + }, + { + name: 'className', + propType: 'any', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Button', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Button', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + defaultValue: 'normal', + description: '按钮的类型', + name: 'type', + propType: { + type: 'oneOf', + value: [ + 'primary', + 'secondary', + 'normal', + ], + }, + }, + { + defaultValue: 'medium', + description: '按钮的尺寸', + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'small', + 'medium', + 'large', + ], + }, + }, + { + description: '按钮中 Icon 的尺寸,用于替代 Icon 的默认大小', + name: 'iconSize', + propType: { + type: 'oneOf', + value: [ + 'xxs', + 'xs', + 'small', + 'medium', + 'large', + 'xl', + 'xxl', + 'xxxl', + ], + }, + }, + { + defaultValue: 'button', + description: '当 component = \'button\' 时,设置 button 标签的 type 值', + name: 'htmlType', + propType: { + type: 'oneOf', + value: [ + 'submit', + 'reset', + 'button', + ], + }, + }, + { + defaultValue: 'button', + description: '设置标签类型', + name: 'component', + propType: { + type: 'oneOf', + value: [ + 'button', + 'a', + 'div', + 'span', + ], + }, + }, + { + defaultValue: false, + description: '设置按钮的载入状态', + name: 'loading', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否为幽灵按钮', + name: 'ghost', + propType: { + type: 'oneOf', + value: [ + true, + false, + 'light', + 'dark', + ], + }, + }, + { + defaultValue: false, + description: '是否为文本按钮', + name: 'text', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否为警告按钮', + name: 'warning', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否禁用', + name: 'disabled', + propType: 'bool', + }, + { + defaultValue: Function {}, + description: `点击按钮的回调␊ + @param {Object} e Event Object`, + name: 'onClick', + propType: 'func', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'onMouseUp', + propType: 'func', + }, + { + name: 'children', + propType: 'node', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Calendar', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Calendar', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'rtl', + propType: 'bool', + }, + { + description: '默认选中的日期(moment 对象)', + name: 'defaultValue', + propType: 'custom', + }, + { + description: '选中的日期值 (moment 对象)', + name: 'value', + propType: 'custom', + }, + { + name: 'modes', + propType: 'array', + }, + { + defaultValue: false, + name: 'disableChangeMode', + propType: 'bool', + }, + { + defaultValue: 'YYYY-MM-DD', + name: 'format', + propType: 'string', + }, + { + defaultValue: true, + description: '是否展示非本月的日期', + name: 'showOtherMonth', + propType: 'bool', + }, + { + description: '默认展示的月份', + name: 'defaultVisibleMonth', + propType: 'func', + }, + { + defaultValue: 'fullscreen', + description: '展现形态', + name: 'shape', + propType: { + type: 'oneOf', + value: [ + 'card', + 'fullscreen', + 'panel', + ], + }, + }, + { + description: `选择日期单元格时的回调␊ + @param {Object} value 对应的日期值 (moment 对象)`, + name: 'onSelect', + propType: 'func', + }, + { + description: `面板模式变化时的回调␊ + @param {String} mode 对应面板模式 date month year`, + name: 'onModeChange', + propType: 'func', + }, + { + description: `展现的月份变化时的回调␊ + @param {Object} value 显示的月份 (moment 对象)␊ + @param {String} reason 触发月份改变原因`, + name: 'onVisibleMonthChange', + propType: 'func', + }, + { + description: '自定义样式类', + name: 'className', + propType: 'string', + }, + { + defaultValue: Function {}, + description: `自定义日期渲染函数␊ + @param {Object} value 日期值(moment对象)␊ + @returns {ReactNode}`, + name: 'dateCellRender', + propType: 'func', + }, + { + description: `自定义月份渲染函数␊ + @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象␊ + @returns {ReactNode}`, + name: 'monthCellRender', + propType: 'func', + }, + { + name: 'yearCellRender', + propType: 'func', + }, + { + description: '年份范围,[START_YEAR, END_YEAR] (只在shape 为 ‘card’, \'fullscreen\' 下生效)', + name: 'yearRange', + propType: { + type: 'arrayOf', + value: 'number', + }, + }, + { + description: `不可选择的日期␊ + @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象␊ + @param {String} view 当前视图类型,year: 年, month: 月, date: 日␊ + @returns {Boolean}`, + name: 'disabledDate', + propType: 'func', + }, + { + description: '国际化配置', + name: 'locale', + propType: 'object', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Card', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Card', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + description: '卡片的上的图片 / 视频', + name: 'media', + propType: 'node', + }, + { + description: '卡片的标题', + name: 'title', + propType: 'node', + }, + { + description: '卡片的副标题', + name: 'subTitle', + propType: 'node', + }, + { + description: '卡片操作组,位置在卡片底部', + name: 'actions', + propType: 'node', + }, + { + defaultValue: true, + description: '是否显示标题的项目符号', + name: 'showTitleBullet', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否展示头部的分隔线', + name: 'showHeadDivider', + propType: 'bool', + }, + { + defaultValue: 120, + description: '内容区域的固定高度', + name: 'contentHeight', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'number', + ], + }, + }, + { + description: '标题区域的用户自定义内容', + name: 'extra', + propType: 'node', + }, + { + defaultValue: false, + description: '是否开启自由模式,开启后card 将使用子组件配合使用, 设置此项后 title, subtitle, 等等属性都将失效', + name: 'free', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'children', + propType: 'node', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Cascader', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Cascader', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'rtl', + propType: 'bool', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + defaultValue: [], + description: '数据源,结构可参考下方说明', + name: 'dataSource', + propType: { + type: 'arrayOf', + value: 'object', + }, + }, + { + defaultValue: null, + description: '(非受控)默认值', + name: 'defaultValue', + propType: { + type: 'oneOfType', + value: [ + 'string', + { + type: 'arrayOf', + value: 'string', + }, + ], + }, + }, + { + description: '(受控)当前值', + name: 'value', + propType: { + type: 'oneOfType', + value: [ + 'string', + { + type: 'arrayOf', + value: 'string', + }, + ], + }, + }, + { + description: `选中值改变时触发的回调函数␊ + @param {String|Array} value 选中的值,单选时返回单个值,多选时返回数组␊ + @param {Object|Array} data 选中的数据,包括 value 和 label,单选时返回单个值,多选时返回数组,父子节点选中关联时,同时选中,只返回父节点␊ + @param {Object} extra 额外参数␊ + @param {Array} extra.selectedPath 单选时选中的数据的路径␊ + @param {Boolean} extra.checked 多选时当前的操作是选中还是取消选中␊ + @param {Object} extra.currentData 多选时当前操作的数据␊ + @param {Array} extra.checkedData 多选时所有被选中的数据␊ + @param {Array} extra.indeterminateData 多选时半选的数据`, + name: 'onChange', + propType: 'func', + }, + { + name: 'onSelect', + propType: 'func', + }, + { + description: '(非受控)默认展开值,如果不设置,组件内部会根据 defaultValue/value 进行自动设置', + name: 'defaultExpandedValue', + propType: { + type: 'arrayOf', + value: 'string', + }, + }, + { + description: '(受控)当前展开值', + name: 'expandedValue', + propType: { + type: 'arrayOf', + value: 'string', + }, + }, + { + defaultValue: 'click', + description: '展开触发的方式', + name: 'expandTriggerType', + propType: { + type: 'oneOf', + value: [ + 'click', + 'hover', + ], + }, + }, + { + description: `展开时触发的回调函数␊ + @param {Array} expandedValue 各列展开值的数组`, + name: 'onExpand', + propType: 'func', + }, + { + defaultValue: false, + description: '是否开启虚拟滚动', + name: 'useVirtual', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否多选', + name: 'multiple', + propType: 'bool', + }, + { + defaultValue: false, + description: '单选时是否只能选中叶子节点', + name: 'canOnlySelectLeaf', + propType: 'bool', + }, + { + defaultValue: false, + description: '多选时是否只能选中叶子节点', + name: 'canOnlyCheckLeaf', + propType: 'bool', + }, + { + defaultValue: false, + description: '父子节点是否选中不关联', + name: 'checkStrictly', + propType: 'bool', + }, + { + description: '每列列表样式对象', + name: 'listStyle', + propType: 'object', + }, + { + description: '每列列表类名', + name: 'listClassName', + propType: 'string', + }, + { + defaultValue: Function {}, + description: `每列列表项渲染函数␊ + @param {Object} data 数据␊ + @return {ReactNode} 列表项内容`, + name: 'itemRender', + propType: 'func', + }, + { + description: `异步加载数据函数␊ + @param {Object} data 当前点击异步加载的数据␊ + @param {Object} source 当前点击数据,source是原始对象`, + name: 'loadData', + propType: 'func', + }, + { + name: 'searchValue', + propType: 'string', + }, + { + name: 'onBlur', + propType: 'func', + }, + { + name: 'filteredPaths', + propType: 'array', + }, + { + name: 'filteredListStyle', + propType: 'object', + }, + { + name: 'resultRender', + propType: 'func', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'CascaderSelect', + docUrl: '', + npm: { + destructuring: false, + exportName: 'CascaderSelect', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + defaultValue: 'medium', + description: '选择框大小', + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'small', + 'medium', + 'large', + ], + }, + }, + { + description: '选择框占位符', + name: 'placeholder', + propType: 'string', + }, + { + defaultValue: false, + description: '是否禁用', + name: 'disabled', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否有下拉箭头', + name: 'hasArrow', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否有边框', + name: 'hasBorder', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否有清除按钮', + name: 'hasClear', + propType: 'bool', + }, + { + description: '自定义内联 label', + name: 'label', + propType: 'node', + }, + { + description: '是否只读,只读模式下可以展开弹层但不能选', + name: 'readOnly', + propType: 'bool', + }, + { + defaultValue: [], + description: '数据源,结构可参考下方说明', + name: 'dataSource', + propType: { + type: 'arrayOf', + value: 'object', + }, + }, + { + defaultValue: null, + description: '(非受控)默认值', + name: 'defaultValue', + propType: { + type: 'oneOfType', + value: [ + 'string', + { + type: 'arrayOf', + value: 'string', + }, + ], + }, + }, + { + description: '(受控)当前值', + name: 'value', + propType: { + type: 'oneOfType', + value: [ + 'string', + { + type: 'arrayOf', + value: 'string', + }, + ], + }, + }, + { + description: `选中值改变时触发的回调函数␊ + @param {String|Array} value 选中的值,单选时返回单个值,多选时返回数组␊ + @param {Object|Array} data 选中的数据,包括 value 和 label,单选时返回单个值,多选时返回数组,父子节点选中关联时,同时选中,只返回父节点␊ + @param {Object} extra 额外参数␊ + @param {Array} extra.selectedPath 单选时选中的数据的路径␊ + @param {Boolean} extra.checked 多选时当前的操作是选中还是取消选中␊ + @param {Object} extra.currentData 多选时当前操作的数据␊ + @param {Array} extra.checkedData 多选时所有被选中的数据␊ + @param {Array} extra.indeterminateData 多选时半选的数据`, + name: 'onChange', + propType: 'func', + }, + { + description: '默认展开值,如果不设置,组件内部会根据 defaultValue/value 进行自动设置', + name: 'defaultExpandedValue', + propType: { + type: 'arrayOf', + value: 'string', + }, + }, + { + defaultValue: 'click', + description: '展开触发的方式', + name: 'expandTriggerType', + propType: { + type: 'oneOf', + value: [ + 'click', + 'hover', + ], + }, + }, + { + defaultValue: Function {}, + name: 'onExpand', + propType: 'func', + }, + { + defaultValue: false, + description: '是否开启虚拟滚动', + name: 'useVirtual', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否多选', + name: 'multiple', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否选中即发生改变, 该属性仅在单选模式下有效', + name: 'changeOnSelect', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否只能勾选叶子项的checkbox,该属性仅在多选模式下有效', + name: 'canOnlyCheckLeaf', + propType: 'bool', + }, + { + defaultValue: false, + description: '父子节点是否选中不关联', + name: 'checkStrictly', + propType: 'bool', + }, + { + description: '每列列表样式对象', + name: 'listStyle', + propType: 'object', + }, + { + description: '每列列表类名', + name: 'listClassName', + propType: 'string', + }, + { + description: `选择框单选时展示结果的自定义渲染函数␊ + @param {Array} label 选中路径的文本数组␊ + @return {ReactNode} 渲染在选择框中的内容␊ + @default 单选时:labelPath => labelPath.join(' / ');多选时:labelPath => labelPath[labelPath.length - 1]`, + name: 'displayRender', + propType: 'func', + }, + { + description: `渲染 item 内容的方法␊ + @param {Object} item 渲染节点的item␊ + @return {ReactNode} item node`, + name: 'itemRender', + propType: 'func', + }, + { + defaultValue: false, + description: '是否显示搜索框', + name: 'showSearch', + propType: 'bool', + }, + { + defaultValue: Function {}, + description: `自定义搜索函数␊ + @param {String} searchValue 搜索的关键字␊ + @param {Array} path 节点路径␊ + @return {Boolean} 是否匹配␊ + @default 根据路径所有节点的文本值模糊匹配`, + name: 'filter', + propType: 'func', + }, + { + description: `搜索结果自定义渲染函数␊ + @param {String} searchValue 搜索的关键字␊ + @param {Array} path 匹配到的节点路径␊ + @return {ReactNode} 渲染的内容␊ + @default 按照节点文本 a / b / c 的模式渲染`, + name: 'resultRender', + propType: 'func', + }, + { + defaultValue: true, + description: '搜索结果列表是否和选择框等宽', + name: 'resultAutoWidth', + propType: 'bool', + }, + { + defaultValue: 'Not Found', + description: '无数据时显示内容', + name: 'notFoundContent', + propType: 'node', + }, + { + description: `异步加载数据函数␊ + @param {Object} data 当前点击异步加载的数据`, + name: 'loadData', + propType: 'func', + }, + { + description: '自定义下拉框头部', + name: 'header', + propType: 'node', + }, + { + description: '自定义下拉框底部', + name: 'footer', + propType: 'node', + }, + { + defaultValue: false, + description: '初始下拉框是否显示', + name: 'defaultVisible', + propType: 'bool', + }, + { + description: '当前下拉框是否显示', + name: 'visible', + propType: 'bool', + }, + { + defaultValue: Function {}, + description: `下拉框显示或关闭时触发事件的回调函数␊ + @param {Boolean} visible 是否显示␊ + @param {String} type 触发显示关闭的操作类型, fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发`, + name: 'onVisibleChange', + propType: 'func', + }, + { + description: '下拉框自定义样式对象', + name: 'popupStyle', + propType: 'object', + }, + { + description: '下拉框样式自定义类名', + name: 'popupClassName', + propType: 'string', + }, + { + description: '下拉框挂载的容器节点', + name: 'popupContainer', + propType: 'any', + }, + { + defaultValue: undefined, + description: '透传到 Popup 的属性对象', + name: 'popupProps', + propType: 'object', + }, + { + description: '是否跟随滚动', + name: 'followTrigger', + propType: 'bool', + }, + { + description: '是否为预览态', + name: 'isPreview', + propType: 'bool', + }, + { + description: `预览态模式下渲染的内容␊ + @param {Array} value 选择值 { label: , value:}`, + name: 'renderPreview', + propType: 'func', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Checkbox', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Checkbox', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + description: '自定义类名', + name: 'className', + propType: 'string', + }, + { + description: 'checkbox id, 挂载在input上', + name: 'id', + propType: 'string', + }, + { + description: '自定义内敛样式', + name: 'style', + propType: 'object', + }, + { + description: '选中状态', + name: 'checked', + propType: 'bool', + }, + { + defaultValue: false, + description: '默认选中状态', + name: 'defaultChecked', + propType: 'bool', + }, + { + description: '禁用', + name: 'disabled', + propType: 'bool', + }, + { + description: '通过属性配置label,', + name: 'label', + propType: 'node', + }, + { + description: 'Checkbox 的中间状态,只会影响到 Checkbox 的样式,并不影响其 checked 属性', + name: 'indeterminate', + propType: 'bool', + }, + { + defaultValue: false, + description: 'Checkbox 的默认中间态,只会影响到 Checkbox 的样式,并不影响其 checked 属性', + name: 'defaultIndeterminate', + propType: 'bool', + }, + { + description: `状态变化时触发的事件␊ + @param {Boolean} checked 是否选中␊ + @param {Event} e Dom 事件对象`, + name: 'onChange', + propType: 'func', + }, + { + description: `鼠标进入enter事件␊ + @param {Event} e Dom 事件对象`, + name: 'onMouseEnter', + propType: 'func', + }, + { + description: `鼠标离开Leave事件␊ + @param {Event} e Dom 事件对象`, + name: 'onMouseLeave', + propType: 'func', + }, + { + description: 'checkbox 的value', + name: 'value', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'number', + ], + }, + }, + { + description: 'name', + name: 'name', + propType: 'string', + }, + { + defaultValue: false, + description: '是否为预览态', + name: 'isPreview', + propType: 'bool', + }, + { + description: `预览态模式下渲染的内容␊ + @param {number} value 评分值`, + name: 'renderPreview', + propType: 'func', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Collapse', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Collapse', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + description: '样式前缀', + name: 'prefix', + propType: 'string', + }, + { + description: '组件接受行内样式', + name: 'style', + propType: 'object', + }, + { + description: '使用数据模型构建', + name: 'dataSource', + propType: 'array', + }, + { + description: '默认展开keys', + name: 'defaultExpandedKeys', + propType: 'array', + }, + { + description: '受控展开keys', + name: 'expandedKeys', + propType: 'array', + }, + { + description: '展开状态发升变化时候的回调', + name: 'onExpand', + propType: 'func', + }, + { + description: '所有禁用', + name: 'disabled', + propType: 'bool', + }, + { + description: '扩展class', + name: 'className', + propType: 'string', + }, + { + defaultValue: false, + description: '手风琴模式,一次只能打开一个', + name: 'accordion', + propType: 'bool', + }, + { + name: 'children', + propType: 'node', + }, + { + name: 'id', + propType: 'string', + }, + { + name: 'rtl', + propType: 'bool', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'ConfigProvider', + docUrl: '', + npm: { + destructuring: false, + exportName: 'ConfigProvider', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + description: '样式类名的品牌前缀', + name: 'prefix', + propType: 'string', + }, + { + description: '国际化文案对象,属性为组件的 displayName', + name: 'locale', + propType: 'object', + }, + { + defaultValue: false, + description: `是否开启错误捕捉 errorBoundary␊ + 如需自定义参数,请传入对象 对象接受参数列表如下:␊ + ␊ + fallbackUI `Function(error?: {}, errorInfo?: {}) => Element` 捕获错误后的展示␊ + afterCatch `Function(error?: {}, errorInfo?: {})` 捕获错误后的行为, 比如埋点上传`, + name: 'errorBoundary', + propType: { + type: 'oneOfType', + value: [ + 'bool', + 'object', + ], + }, + }, + { + description: '是否开启 Pure Render 模式,会提高性能,但是也会带来副作用', + name: 'pure', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否在开发模式下显示组件属性被废弃的 warning 提示', + name: 'warning', + propType: 'bool', + }, + { + description: '是否开启 rtl 模式', + name: 'rtl', + propType: 'bool', + }, + { + description: '设备类型,针对不同的设备类型组件做出对应的响应式变化', + name: 'device', + propType: { + type: 'oneOf', + value: [ + 'tablet', + 'desktop', + 'phone', + ], + }, + }, + { + description: '组件树', + name: 'children', + propType: 'any', + }, + { + description: '指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数', + name: 'popupContainer', + propType: 'any', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'DatePicker', + docUrl: '', + npm: { + destructuring: false, + exportName: 'DatePicker', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'rtl', + propType: 'bool', + }, + { + description: '输入框内置标签', + name: 'label', + propType: 'node', + }, + { + description: '输入框状态', + name: 'state', + propType: { + type: 'oneOf', + value: [ + 'success', + 'loading', + 'error', + ], + }, + }, + { + description: '输入提示', + name: 'placeholder', + propType: 'string', + }, + { + description: `默认展现的月␊ + @return {MomentObject} 返回包含指定月份的 moment 对象实例`, + name: 'defaultVisibleMonth', + propType: 'func', + }, + { + name: 'onVisibleMonthChange', + propType: 'func', + }, + { + description: '日期值(受控)moment 对象', + name: 'value', + propType: 'custom', + }, + { + description: '初始日期值,moment 对象', + name: 'defaultValue', + propType: 'custom', + }, + { + defaultValue: 'YYYY-MM-DD', + description: '日期值的格式(用于限定用户输入和展示)', + name: 'format', + propType: 'string', + }, + { + defaultValue: false, + description: '是否使用时间控件,传入 TimePicker 的属性 { defaultValue, format, ... }', + name: 'showTime', + propType: { + type: 'oneOfType', + value: [ + 'object', + 'bool', + ], + }, + }, + { + defaultValue: false, + description: '每次选择日期时是否重置时间(仅在 showTime 开启时有效)', + name: 'resetTime', + propType: 'bool', + }, + { + defaultValue: Function {}, + description: `禁用日期函数␊ + @param {MomentObject} 日期值␊ + @param {String} view 当前视图类型,year: 年, month: 月, date: 日␊ + @return {Boolean} 是否禁用`, + name: 'disabledDate', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `自定义面板页脚␊ + @return {Node} 自定义的面板页脚组件`, + name: 'footerRender', + propType: 'func', + }, + { + description: `日期值改变时的回调␊ + @param {MomentObject|String} value 日期值`, + name: 'onChange', + propType: 'func', + }, + { + description: `点击确认按钮时的回调␊ + @return {MomentObject|String} 日期值`, + name: 'onOk', + propType: 'func', + }, + { + defaultValue: 'medium', + description: '输入框尺寸', + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'small', + 'medium', + 'large', + ], + }, + }, + { + description: '是否禁用', + name: 'disabled', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否显示清空按钮', + name: 'hasClear', + propType: 'bool', + }, + { + description: '弹层显示状态', + name: 'visible', + propType: 'bool', + }, + { + defaultValue: false, + description: '弹层默认是否显示', + name: 'defaultVisible', + propType: 'bool', + }, + { + description: `弹层展示状态变化时的回调␊ + @param {Boolean} visible 弹层是否显示␊ + @param {String} type 触发弹层显示和隐藏的来源 calendarSelect 表示由日期表盘的选择触发; okBtnClick 表示由确认按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发`, + name: 'onVisibleChange', + propType: 'func', + }, + { + defaultValue: 'click', + description: '弹层触发方式', + name: 'popupTriggerType', + propType: { + type: 'oneOf', + value: [ + 'click', + 'hover', + ], + }, + }, + { + defaultValue: 'tl tl', + description: '弹层对齐方式,具体含义见 OverLay文档', + name: 'popupAlign', + propType: 'string', + }, + { + description: `弹层容器␊ + @param {Element} target 目标元素␊ + @return {Element} 弹层的容器元素`, + name: 'popupContainer', + propType: 'any', + }, + { + description: '弹层自定义样式', + name: 'popupStyle', + propType: 'object', + }, + { + description: '弹层自定义样式类', + name: 'popupClassName', + propType: 'string', + }, + { + description: '弹层其他属性', + name: 'popupProps', + propType: 'object', + }, + { + description: '是否跟随滚动', + name: 'followTrigger', + propType: 'bool', + }, + { + description: '输入框其他属性', + name: 'inputProps', + propType: 'object', + }, + { + description: `自定义日期渲染函数␊ + @param {Object} value 日期值(moment对象)␊ + @returns {ReactNode}`, + name: 'dateCellRender', + propType: 'func', + }, + { + description: `自定义月份渲染函数␊ + @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象␊ + @returns {ReactNode}`, + name: 'monthCellRender', + propType: 'func', + }, + { + name: 'yearCellRender', + propType: 'func', + }, + { + description: '日期输入框的 aria-label 属性', + name: 'dateInputAriaLabel', + propType: 'string', + }, + { + description: '时间输入框的 aria-label 属性', + name: 'timeInputAriaLabel', + propType: 'string', + }, + { + description: '是否为预览态', + name: 'isPreview', + propType: 'bool', + }, + { + description: `预览态模式下渲染的内容␊ + @param {MomentObject} value 日期`, + name: 'renderPreview', + propType: 'func', + }, + { + name: 'locale', + propType: 'object', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'name', + propType: 'string', + }, + { + name: 'popupComponent', + propType: 'elementType', + }, + { + name: 'popupContent', + propType: 'node', + }, + { + name: 'disableChangeMode', + propType: 'bool', + }, + { + name: 'yearRange', + propType: { + type: 'arrayOf', + value: 'number', + }, + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Dialog', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Dialog', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + defaultValue: false, + description: '是否显示', + name: 'visible', + propType: 'bool', + }, + { + description: '标题', + name: 'title', + propType: 'node', + }, + { + description: '内容', + name: 'children', + propType: 'node', + }, + { + description: `底部内容,设置为 false,则不进行显示␊ + @default [, ]`, + name: 'footer', + propType: { + type: 'oneOfType', + value: [ + 'bool', + 'node', + ], + }, + }, + { + defaultValue: 'right', + description: '底部按钮的对齐方式', + name: 'footerAlign', + propType: { + type: 'oneOf', + value: [ + 'left', + 'center', + 'right', + ], + }, + }, + { + defaultValue: [ + 'ok', + 'cancel', + ], + description: `指定确定按钮和取消按钮是否存在以及如何排列,

**可选值**:␊ + ['ok', 'cancel'](确认取消按钮同时存在,确认按钮在左)␊ + ['cancel', 'ok'](确认取消按钮同时存在,确认按钮在右)␊ + ['ok'](只存在确认按钮)␊ + ['cancel'](只存在取消按钮)`, + name: 'footerActions', + propType: 'array', + }, + { + defaultValue: Function {}, + description: `在点击确定按钮时触发的回调函数␊ + @param {Object} event 点击事件对象`, + name: 'onOk', + propType: 'func', + }, + { + defaultValue: Function {}, + description: `在点击取消按钮时触发的回调函数␊ + @param {Object} event 点击事件对象`, + name: 'onCancel', + propType: 'func', + }, + { + defaultValue: undefined, + description: '应用于确定按钮的属性对象', + name: 'okProps', + propType: 'object', + }, + { + defaultValue: undefined, + description: '应用于取消按钮的属性对象', + name: 'cancelProps', + propType: 'object', + }, + { + defaultValue: 'esc,close', + description: `控制对话框关闭的方式,值可以为字符串或者布尔值,其中字符串是由以下值组成:␊ + **close** 表示点击关闭按钮可以关闭对话框␊ + **mask** 表示点击遮罩区域可以关闭对话框␊ + **esc** 表示按下 esc 键可以关闭对话框␊ + 如 'close' 或 'close,esc,mask'␊ + 如果设置为 true,则以上关闭方式全部生效␊ + 如果设置为 false,则以上关闭方式全部失效`, + name: 'closeable', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'bool', + ], + }, + }, + { + defaultValue: Function {}, + description: `对话框关闭时触发的回调函数␊ + @param {String} trigger 关闭触发行为的描述字符串␊ + @param {Object} event 关闭时事件对象`, + name: 'onClose', + propType: 'func', + }, + { + defaultValue: Function {}, + description: '对话框关闭后触发的回调函数, 如果有动画,则在动画结束后触发', + name: 'afterClose', + propType: 'func', + }, + { + defaultValue: true, + description: '是否显示遮罩', + name: 'hasMask', + propType: 'bool', + }, + { + description: `显示隐藏时动画的播放方式␊ + @property {String} in 进场动画␊ + @property {String} out 出场动画`, + name: 'animation', + propType: { + type: 'oneOfType', + value: [ + 'object', + 'bool', + ], + }, + }, + { + defaultValue: false, + description: '对话框弹出时是否自动获得焦点', + name: 'autoFocus', + propType: 'bool', + }, + { + defaultValue: 'cc cc', + description: '对话框对齐方式, 具体见Overlay文档', + name: 'align', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'bool', + ], + }, + }, + { + defaultValue: false, + description: '当对话框高度超过浏览器视口高度时,是否显示所有内容而不是出现滚动条以保证对话框完整显示在浏览器视口内,该属性仅在对话框垂直水平居中时生效,即 align 被设置为 \'cc cc\' 时', + name: 'isFullScreen', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否在对话框重新渲染时及时更新对话框位置,一般用于对话框高度变化后依然能保证原来的对齐方式', + name: 'shouldUpdatePosition', + propType: 'bool', + }, + { + defaultValue: 40, + description: '对话框距离浏览器顶部和底部的最小间距,align 被设置为 \'cc cc\' 并且 isFullScreen 被设置为 true 时不生效', + name: 'minMargin', + propType: 'number', + }, + { + defaultValue: undefined, + description: '透传到弹层组件的属性对象', + name: 'overlayProps', + propType: 'object', + }, + { + description: `自定义国际化文案对象␊ + @property {String} ok 确认按钮文案␊ + @property {String} cancel 取消按钮文案`, + name: 'locale', + propType: 'object', + }, + { + description: '对话框的高度样式属性', + name: 'height', + propType: 'string', + }, + { + name: 'popupContainer', + propType: 'any', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Dropdown', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Dropdown', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + description: '弹层内容', + name: 'children', + propType: 'node', + }, + { + description: '弹层当前是否显示', + name: 'visible', + propType: 'bool', + }, + { + defaultValue: false, + description: '弹层默认是否显示', + name: 'defaultVisible', + propType: 'bool', + }, + { + description: `弹层显示或隐藏时触发的回调函数␊ + @param {Boolean} visible 弹层是否显示␊ + @param {String} type 触发弹层显示或隐藏的来源 fromContent 表示由Dropdown内容触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发`, + name: 'onVisibleChange', + propType: 'func', + }, + { + description: '触发弹层显示或者隐藏的元素', + name: 'trigger', + propType: 'node', + }, + { + defaultValue: 'hover', + description: '触发弹层显示或隐藏的操作类型,可以是 \'click\',\'hover\',或者它们组成的数组,如 [\'hover\', \'click\']', + name: 'triggerType', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + defaultValue: false, + description: '设置此属性,弹层无法显示或隐藏', + name: 'disabled', + propType: 'bool', + }, + { + defaultValue: 'tl bl', + description: '弹层相对于触发元素的定位, 详见 Overlay 的定位部分', + name: 'align', + propType: 'string', + }, + { + defaultValue: [ + 0, + 0, + ], + description: `弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量␊ + e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px`, + name: 'offset', + propType: 'array', + }, + { + defaultValue: 200, + description: '弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效', + name: 'delay', + propType: 'number', + }, + { + description: '弹层打开时是否让其中的元素自动获取焦点', + name: 'autoFocus', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否显示遮罩', + name: 'hasMask', + propType: 'bool', + }, + { + defaultValue: false, + description: '隐藏时是否保留子节点', + name: 'cache', + propType: 'bool', + }, + { + description: `配置动画的播放方式,支持 { in: 'enter-class', out: 'leave-class' } 的对象参数,如果设置为 false,则不播放动画␊ + @default { in: 'expandInDown', out: 'expandOutUp' }`, + name: 'animation', + propType: { + type: 'oneOfType', + value: [ + 'object', + 'bool', + ], + }, + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Drawer', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Drawer', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + name: 'pure', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + defaultValue: null, + name: 'trigger', + propType: 'element', + }, + { + defaultValue: 'click', + name: 'triggerType', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + description: '宽度,仅在 placement是 left right 的时候生效', + name: 'width', + propType: { + type: 'oneOfType', + value: [ + 'number', + 'string', + ], + }, + }, + { + description: '高度,仅在 placement是 top bottom 的时候生效', + name: 'height', + propType: { + type: 'oneOfType', + value: [ + 'number', + 'string', + ], + }, + }, + { + defaultValue: true, + description: `控制对话框关闭的方式,值可以为字符串或者布尔值,其中字符串是由以下值组成:␊ + **close** 表示点击关闭按钮可以关闭对话框␊ + **mask** 表示点击遮罩区域可以关闭对话框␊ + **esc** 表示按下 esc 键可以关闭对话框␊ + 如 'close' 或 'close,esc,mask'␊ + 如果设置为 true,则以上关闭方式全部生效␊ + 如果设置为 false,则以上关闭方式全部失效`, + name: 'closeable', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'bool', + ], + }, + }, + { + defaultValue: Function {}, + description: `对话框关闭时触发的回调函数␊ + @param {String} trigger 关闭触发行为的描述字符串␊ + @param {Object} event 关闭时事件对象`, + name: 'onClose', + propType: 'func', + }, + { + defaultValue: 'right', + description: '位于页面的位置', + name: 'placement', + propType: { + type: 'oneOf', + value: [ + 'top', + 'right', + 'bottom', + 'left', + ], + }, + }, + { + description: '标题', + name: 'title', + propType: 'node', + }, + { + description: 'header上的样式', + name: 'headerStyle', + propType: 'object', + }, + { + description: 'body上的样式', + name: 'bodyStyle', + propType: 'object', + }, + { + description: '是否显示', + name: 'visible', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否显示遮罩', + name: 'hasMask', + propType: 'bool', + }, + { + name: 'onVisibleChange', + propType: 'func', + }, + { + description: `显示隐藏时动画的播放方式␊ + @property {String} in 进场动画␊ + @property {String} out 出场动画`, + name: 'animation', + propType: { + type: 'oneOfType', + value: [ + 'object', + 'bool', + ], + }, + }, + { + name: 'locale', + propType: 'object', + }, + { + name: 'popupContainer', + propType: 'any', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Form', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Form', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + description: '样式前缀', + name: 'prefix', + propType: 'string', + }, + { + description: '内联表单', + name: 'inline', + propType: 'bool', + }, + { + defaultValue: 'medium', + description: `单个 Item 的 size 自定义,优先级高于 Form 的 size, 并且当组件与 Item 一起使用时,组件自身设置 size 属性无效。␊ + @enumdesc 大, 中, 小`, + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'large', + 'medium', + 'small', + ], + }, + }, + { + description: '单个 Item 中表单类组件宽度是否是100%', + name: 'fullWidth', + propType: 'bool', + }, + { + defaultValue: 'left', + description: `标签的位置␊ + @enumdesc 上, 左, 内`, + name: 'labelAlign', + propType: { + type: 'oneOf', + value: [ + 'top', + 'left', + 'inset', + ], + }, + }, + { + description: `标签的左右对齐方式␊ + @enumdesc 左, 右`, + name: 'labelTextAlign', + propType: { + type: 'oneOf', + value: [ + 'left', + 'right', + ], + }, + }, + { + description: 'field 实例, 传 false 会禁用 field', + name: 'field', + propType: 'any', + }, + { + description: '保存 Form 自动生成的 field 对象', + name: 'saveField', + propType: 'func', + }, + { + description: '控制第一级 Item 的 labelCol', + name: 'labelCol', + propType: 'object', + }, + { + description: '控制第一级 Item 的 wrapperCol', + name: 'wrapperCol', + propType: 'object', + }, + { + defaultValue: undefined, + description: 'form内有 `htmlType="submit"` 的元素的时候会触发', + name: 'onSubmit', + propType: 'func', + }, + { + description: '子元素', + name: 'children', + propType: 'any', + }, + { + description: '扩展class', + name: 'className', + propType: 'string', + }, + { + description: '自定义内联样式', + name: 'style', + propType: 'object', + }, + { + description: '表单数值', + name: 'value', + propType: 'object', + }, + { + description: `表单变化回调␊ + @param {Object} values 表单数据␊ + @param {Object} item 详细␊ + @param {String} item.name 变化的组件名␊ + @param {String} item.value 变化的数据␊ + @param {Object} item.field field 实例`, + name: 'onChange', + propType: 'func', + }, + { + defaultValue: 'form', + description: '设置标签类型', + name: 'component', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'func', + ], + }, + }, + { + name: 'fieldOptions', + propType: 'object', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + defaultValue: 'desktop', + description: '预设屏幕宽度', + name: 'device', + propType: { + type: 'oneOf', + value: [ + 'phone', + 'tablet', + 'desktop', + ], + }, + }, + { + description: '是否开启内置的响应式布局 (使用ResponsiveGrid)', + name: 'responsive', + propType: 'bool', + }, + { + description: '是否开启预览态', + name: 'isPreview', + propType: 'bool', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Icon', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Icon', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + description: '指定显示哪种图标', + name: 'type', + propType: 'string', + }, + { + name: 'children', + propType: 'node', + }, + { + defaultValue: 'medium', + description: `指定图标大小␊ +
**可选值**
xxs, xs, small, medium, large, xl, xxl, xxxl, inherit`, + name: 'size', + propType: { + type: 'oneOfType', + value: [ + { + type: 'oneOf', + value: [ + 'xxs', + 'xs', + 'small', + 'medium', + 'large', + 'xl', + 'xxl', + 'xxxl', + 'inherit', + ], + }, + 'number', + ], + }, + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'style', + propType: 'object', + }, + { + defaultValue: 'next-', + name: 'prefix', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Input', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Input', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + description: 'label', + name: 'label', + propType: 'node', + }, + { + description: '是否出现clear按钮', + name: 'hasClear', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否有边框', + name: 'hasBorder', + propType: 'bool', + }, + { + description: `状态␊ + @enumdesc 错误, 校验中, 成功, 警告`, + name: 'state', + propType: { + type: 'oneOf', + value: [ + 'error', + 'loading', + 'success', + 'warning', + ], + }, + }, + { + defaultValue: 'medium', + description: `尺寸␊ + @enumdesc 小, 中, 大`, + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'small', + 'medium', + 'large', + ], + }, + }, + { + description: '按下回车的回调', + name: 'onPressEnter', + propType: 'func', + }, + { + name: 'onClear', + propType: 'func', + }, + { + description: '原生type', + name: 'htmlType', + propType: 'string', + }, + { + name: 'htmlSize', + propType: 'string', + }, + { + description: '水印 (Icon的type类型,和hasClear占用一个地方)', + name: 'hint', + propType: 'string', + }, + { + description: '文字前附加内容', + name: 'innerBefore', + propType: 'node', + }, + { + description: '文字后附加内容', + name: 'innerAfter', + propType: 'node', + }, + { + description: '输入框前附加内容', + name: 'addonBefore', + propType: 'node', + }, + { + description: '输入框后附加内容', + name: 'addonAfter', + propType: 'node', + }, + { + description: '输入框前附加文字', + name: 'addonTextBefore', + propType: 'node', + }, + { + description: '输入框后附加文字', + name: 'addonTextAfter', + propType: 'node', + }, + { + defaultValue: 'off', + description: '(原生input支持)', + name: 'autoComplete', + propType: 'string', + }, + { + description: '自动聚焦(原生input支持)', + name: 'autoFocus', + propType: 'bool', + }, + { + defaultValue: Function {}, + name: 'inputRender', + propType: 'func', + }, + { + name: 'extra', + propType: 'node', + }, + { + name: 'innerBeforeClassName', + propType: 'string', + }, + { + name: 'innerAfterClassName', + propType: 'string', + }, + { + defaultValue: false, + description: '是否为预览态', + name: 'isPreview', + propType: 'bool', + }, + { + description: `预览态模式下渲染的内容␊ + @param {number} value 评分值`, + name: 'renderPreview', + propType: 'func', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Loading', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Loading', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + description: '样式前缀', + name: 'prefix', + propType: 'string', + }, + { + description: '自定义内容', + name: 'tip', + propType: 'any', + }, + { + defaultValue: 'bottom', + description: `自定义内容位置␊ + @enumdesc 出现在动画右边, 出现在动画下面`, + name: 'tipAlign', + propType: { + type: 'oneOf', + value: [ + 'right', + 'bottom', + ], + }, + }, + { + defaultValue: true, + description: 'loading 状态, 默认 true', + name: 'visible', + propType: 'bool', + }, + { + name: 'onVisibleChange', + propType: 'func', + }, + { + description: '自定义class', + name: 'className', + propType: 'string', + }, + { + description: '自定义内联样式', + name: 'style', + propType: 'object', + }, + { + defaultValue: 'large', + description: `设置动画尺寸␊ + @description 仅仅对默认动画效果起作用␊ + @enumdesc 大号, 中号`, + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'large', + 'medium', + ], + }, + }, + { + description: '自定义动画', + name: 'indicator', + propType: 'any', + }, + { + description: '动画颜色', + name: 'color', + propType: 'string', + }, + { + description: '全屏展示', + name: 'fullScreen', + propType: 'bool', + }, + { + description: '子元素', + name: 'children', + propType: 'any', + }, + { + defaultValue: true, + description: 'should loader be displayed inline', + name: 'inline', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + defaultValue: null, + name: 'animate', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Menu', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Menu', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + description: '菜单项和子菜单', + name: 'children', + propType: 'node', + }, + { + defaultValue: Function {}, + description: `点击菜单项触发的回调函数␊ + @param {String} key 点击的菜单项的 key 值␊ + @param {Object} item 点击的菜单项对象␊ + @param {Object} event 点击的事件对象`, + name: 'onItemClick', + propType: 'func', + }, + { + description: '当前打开的子菜单的 key 值', + name: 'openKeys', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + defaultValue: [], + description: '初始打开的子菜单的 key 值', + name: 'defaultOpenKeys', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + defaultValue: false, + description: '初始展开所有的子菜单,只在 mode 设置为 \'inline\' 以及 openMode 设置为 \'multiple\' 下生效,优先级高于 defaultOpenKeys', + name: 'defaultOpenAll', + propType: 'bool', + }, + { + defaultValue: Function {}, + description: `打开或关闭子菜单触发的回调函数␊ + @param {String} key 打开的所有子菜单的 key 值␊ + @param {Object} extra 额外参数␊ + @param {String} extra.key 当前操作子菜单的 key 值␊ + @param {Boolean} extra.open 是否是打开`, + name: 'onOpen', + propType: 'func', + }, + { + defaultValue: 'inline', + description: '子菜单打开的模式', + name: 'mode', + propType: { + type: 'oneOf', + value: [ + 'inline', + 'popup', + ], + }, + }, + { + defaultValue: 'click', + description: '子菜单打开的触发行为', + name: 'triggerType', + propType: { + type: 'oneOf', + value: [ + 'click', + 'hover', + ], + }, + }, + { + defaultValue: 'multiple', + description: '展开内连子菜单的模式,同时可以展开一个子菜单还是多个子菜单,该属性仅在 mode 为 inline 时生效', + name: 'openMode', + propType: { + type: 'oneOf', + value: [ + 'single', + 'multiple', + ], + }, + }, + { + defaultValue: 20, + description: '内连子菜单缩进距离', + name: 'inlineIndent', + propType: 'number', + }, + { + defaultValue: 'down', + name: 'inlineArrowDirection', + propType: { + type: 'oneOf', + value: [ + 'down', + 'right', + ], + }, + }, + { + defaultValue: false, + description: '是否自动让弹层的宽度和菜单项保持一致,如果弹层的宽度比菜单项小则和菜单项保持一致,如果宽度大于菜单项则不做处理', + name: 'popupAutoWidth', + propType: 'bool', + }, + { + defaultValue: 'follow', + description: '弹层的对齐方式', + name: 'popupAlign', + propType: { + type: 'oneOf', + value: [ + 'follow', + 'outside', + ], + }, + }, + { + defaultValue: undefined, + description: '弹层自定义 props', + name: 'popupProps', + propType: { + type: 'oneOfType', + value: [ + 'object', + 'func', + ], + }, + }, + { + description: '弹出子菜单自定义 className', + name: 'popupClassName', + propType: 'string', + }, + { + description: '弹出子菜单自定义 style', + name: 'popupStyle', + propType: 'object', + }, + { + description: '当前选中菜单项的 key 值', + name: 'selectedKeys', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + defaultValue: [], + description: '初始选中菜单项的 key 值', + name: 'defaultSelectedKeys', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + defaultValue: Function {}, + description: `选中或取消选中菜单项触发的回调函数␊ + @param {Array} selectedKeys 选中的所有菜单项的值␊ + @param {Object} item 选中或取消选中的菜单项␊ + @param {Object} extra 额外参数␊ + @param {Boolean} extra.select 是否是选中␊ + @param {Array} extra.key 菜单项的 key␊ + @param {Object} extra.label 菜单项的文本␊ + @param {Array} extra.keyPath 菜单项 key 的路径`, + name: 'onSelect', + propType: 'func', + }, + { + description: '选中模式,单选还是多选,默认无值,不可选', + name: 'selectMode', + propType: { + type: 'oneOf', + value: [ + 'single', + 'multiple', + ], + }, + }, + { + defaultValue: false, + description: '是否只能选择第一层菜单项(不能选择子菜单中的菜单项)', + name: 'shallowSelect', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否显示选中图标,如果设置为 false 需配合配置平台设置选中时的背景色以示区分', + name: 'hasSelectedIcon', + propType: 'bool', + }, + { + defaultValue: true, + name: 'labelToggleChecked', + propType: 'bool', + }, + { + defaultValue: false, + description: `是否将选中图标居右,仅当 hasSelectedIcon 为true 时生效。␊ + 注意:SubMenu 上的选中图标一直居左,不受此API控制`, + name: 'isSelectIconRight', + propType: 'bool', + }, + { + defaultValue: 'ver', + description: '菜单第一层展示方向', + name: 'direction', + propType: { + type: 'oneOf', + value: [ + 'ver', + 'hoz', + ], + }, + }, + { + defaultValue: 'left', + description: '横向菜单条 item 和 footer 的对齐方向,在 direction 设置为 \'hoz\' 并且 header 存在时生效', + name: 'hozAlign', + propType: { + type: 'oneOf', + value: [ + 'left', + 'right', + ], + }, + }, + { + defaultValue: false, + description: '横向菜单模式下,是否维持在一行,即超出一行折叠成 SubMenu 显示, 仅在 direction=\'hoz\' mode=\'popup\' 时生效', + name: 'hozInLine', + propType: 'bool', + }, + { + name: 'renderMore', + propType: 'func', + }, + { + description: '自定义菜单头部', + name: 'header', + propType: 'node', + }, + { + description: '自定义菜单尾部', + name: 'footer', + propType: 'node', + }, + { + defaultValue: false, + description: '是否自动获得焦点', + name: 'autoFocus', + propType: 'bool', + }, + { + description: '当前获得焦点的子菜单或菜单项 key 值', + name: 'focusedKey', + propType: 'string', + }, + { + defaultValue: true, + name: 'focusable', + propType: 'bool', + }, + { + defaultValue: Function {}, + name: 'onItemFocus', + propType: 'func', + }, + { + name: 'onBlur', + propType: 'func', + }, + { + defaultValue: false, + description: '是否开启嵌入式模式,一般用于Layout的布局中,开启后没有默认背景、外层border、box-shadow,可以配合`` 自定义高度', + name: 'embeddable', + propType: 'bool', + }, + { + defaultValue: Function {}, + name: 'onItemKeyDown', + propType: 'func', + }, + { + defaultValue: true, + name: 'expandAnimation', + propType: 'bool', + }, + { + name: 'itemClassName', + propType: 'string', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'MenuButton', + docUrl: '', + npm: { + destructuring: false, + exportName: 'MenuButton', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + description: '按钮上的文本内容', + name: 'label', + propType: 'node', + }, + { + defaultValue: true, + description: '弹层是否与按钮宽度相同', + name: 'autoWidth', + propType: 'bool', + }, + { + defaultValue: 'click', + description: '弹层触发方式', + name: 'popupTriggerType', + propType: { + type: 'oneOf', + value: [ + 'click', + 'hover', + ], + }, + }, + { + description: '弹层容器', + name: 'popupContainer', + propType: 'any', + }, + { + description: '弹层展开状态', + name: 'visible', + propType: 'bool', + }, + { + description: '弹层默认是否展开', + name: 'defaultVisible', + propType: 'bool', + }, + { + description: '弹层在显示和隐藏触发的事件', + name: 'onVisibleChange', + propType: 'func', + }, + { + description: '弹层自定义样式', + name: 'popupStyle', + propType: 'object', + }, + { + description: '弹层自定义样式类', + name: 'popupClassName', + propType: 'string', + }, + { + description: '弹层属性透传', + name: 'popupProps', + propType: 'object', + }, + { + description: '是否跟随滚动', + name: 'followTrigger', + propType: 'bool', + }, + { + defaultValue: [], + description: '默认激活的菜单项(用法同 Menu 非受控)', + name: 'defaultSelectedKeys', + propType: 'array', + }, + { + description: '激活的菜单项(用法同 Menu 受控)', + name: 'selectedKeys', + propType: 'array', + }, + { + description: '菜单的选择模式,同 Menu', + name: 'selectMode', + propType: { + type: 'oneOf', + value: [ + 'single', + 'multiple', + ], + }, + }, + { + description: '点击菜单项后的回调,同 Menu', + name: 'onItemClick', + propType: 'func', + }, + { + description: '选择菜单后的回调,同 Menu', + name: 'onSelect', + propType: 'func', + }, + { + defaultValue: undefined, + description: '菜单属性透传', + name: 'menuProps', + propType: 'object', + }, + { + name: 'style', + propType: 'object', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'children', + propType: 'any', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Message', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Message', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'style', + propType: 'object', + }, + { + defaultValue: 'success', + description: '反馈类型', + name: 'type', + propType: { + type: 'oneOf', + value: [ + 'success', + 'warning', + 'error', + 'notice', + 'help', + 'loading', + ], + }, + }, + { + defaultValue: 'inline', + description: '反馈外观', + name: 'shape', + propType: { + type: 'oneOf', + value: [ + 'inline', + 'addon', + 'toast', + ], + }, + }, + { + defaultValue: 'medium', + description: '反馈大小', + name: 'size', + propType: { + type: 'oneOf', + value: [ + 'medium', + 'large', + ], + }, + }, + { + description: '标题', + name: 'title', + propType: 'node', + }, + { + description: '内容', + name: 'children', + propType: 'node', + }, + { + defaultValue: true, + description: '默认是否显示', + name: 'defaultVisible', + propType: 'bool', + }, + { + description: '当前是否显示', + name: 'visible', + propType: 'bool', + }, + { + description: '显示的图标类型,会覆盖内部设置的IconType', + name: 'iconType', + propType: 'string', + }, + { + defaultValue: false, + description: '显示关闭按钮', + name: 'closeable', + propType: 'bool', + }, + { + defaultValue: Function {}, + description: '关闭按钮的回调', + name: 'onClose', + propType: 'func', + }, + { + defaultValue: Function {}, + description: '关闭之后调用的函数', + name: 'afterClose', + propType: 'func', + }, + { + defaultValue: true, + description: '是否开启展开收起动画', + name: 'animation', + propType: 'bool', + }, + { + name: 'locale', + propType: 'object', + }, + { + name: 'rtl', + propType: 'bool', + }, + ], + screenshot: '', + title: '@alifd/next', + }, + { + componentName: 'Nav', + docUrl: '', + npm: { + destructuring: false, + exportName: 'Nav', + main: '/Users/gengyang/code/frontend/low-code/ali-lowcode-engine-v0.8/packages/material-parser/test/fixtures/fusion-next-component/src/index.js', + package: '@alifd/next', + subName: '', + version: '1.19.18', + }, + props: [ + { + defaultValue: 'next-', + name: 'prefix', + propType: 'string', + }, + { + defaultValue: false, + name: 'pure', + propType: 'bool', + }, + { + name: 'rtl', + propType: 'bool', + }, + { + name: 'className', + propType: 'string', + }, + { + name: 'style', + propType: 'object', + }, + { + description: '导航项和子导航', + name: 'children', + propType: 'node', + }, + { + defaultValue: 'normal', + description: `导航类型␊ + @enumdesc 普通, 主要, 次要, 线形`, + name: 'type', + propType: { + type: 'oneOf', + value: [ + 'normal', + 'primary', + 'secondary', + 'line', + ], + }, + }, + { + defaultValue: 'ver', + description: `导航布局␊ + @enumdesc 水平, 垂直`, + name: 'direction', + propType: { + type: 'oneOf', + value: [ + 'hoz', + 'ver', + ], + }, + }, + { + defaultValue: 'left', + description: '横向导航条 items 和 footer 的对齐方向,在 direction 设置为 \'hoz\' 并且 header 存在时生效', + name: 'hozAlign', + propType: { + type: 'oneOf', + value: [ + 'left', + 'right', + ], + }, + }, + { + description: `设置组件选中状态的 active 边方向␊ + @enumdesc 无, 上, 下, 左, 右␊ + @default 当 direction 为 'hoz' 时,默认值为 'bottom',当 direction 为 'ver' 时,默认值为 'left'`, + name: 'activeDirection', + propType: { + type: 'oneOf', + value: [ + null, + 'top', + 'bottom', + 'left', + 'right', + ], + }, + }, + { + defaultValue: 'inline', + description: `子导航打开的模式(水平导航只支持弹出)␊ + @eumdesc 行内, 弹出`, + name: 'mode', + propType: { + type: 'oneOf', + value: [ + 'inline', + 'popup', + ], + }, + }, + { + defaultValue: 'click', + description: '子导航打开的触发方式', + name: 'triggerType', + propType: { + type: 'oneOf', + value: [ + 'click', + 'hover', + ], + }, + }, + { + defaultValue: 20, + description: '内联子导航缩进距离', + name: 'inlineIndent', + propType: 'number', + }, + { + defaultValue: false, + description: '初始展开所有的子导航,只在 mode 设置为 \'inline\' 以及 openMode 设置为 \'multiple\' 下生效', + name: 'defaultOpenAll', + propType: 'bool', + }, + { + defaultValue: 'multiple', + description: `内联子导航的展开模式,同时可以展开一个同级子导航还是多个同级子导航,该属性仅在 mode 为 inline 时生效␊ + @eumdesc 一个, 多个`, + name: 'openMode', + propType: { + type: 'oneOf', + value: [ + 'single', + 'multiple', + ], + }, + }, + { + description: '当前选中导航项的 key 值', + name: 'selectedKeys', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + defaultValue: [], + description: '初始选中导航项的 key 值', + name: 'defaultSelectedKeys', + propType: { + type: 'oneOfType', + value: [ + 'string', + 'array', + ], + }, + }, + { + description: `选中或取消选中导航项触发的回调函数␊ + @param {Array} selectedKeys 选中的所有导航项的 key␊ + @param {Object} item 选中或取消选中的导航项␊ + @param {Object} extra 额外参数␊ + @param {Boolean} extra.select 是否是选中␊ + @param {Array} extra.key 导航项的 key␊ + @param {Object} extra.label 导航项的文本␊ + @param {Array} extra.keyPath 导航项 key 的路径`, + name: 'onSelect', + propType: 'func', + }, + { + defaultValue: 'follow', + description: `弹出子导航的对齐方式(水平导航只支持 follow )␊ + @eumdesc Item 顶端对齐, Nav 顶端对齐`, + name: 'popupAlign', + propType: { + type: 'oneOf', + value: [ + 'follow', + 'outside', + ], + }, + }, + { + description: '弹出子导航的自定义类名', + name: 'popupClassName', + propType: 'string', + }, + { + description: '是否只显示图标', + name: 'iconOnly', + propType: 'bool', + }, + { + defaultValue: true, + description: '是否显示右侧的箭头(仅在 iconOnly=true 时生效)', + name: 'hasArrow', + propType: 'bool', + }, + { + defaultValue: false, + description: '是否有 ToolTips (仅在 iconOnly=true 时生效)', + name: 'hasTooltip', + propType: 'bool', + }, + { + description: '自定义导航头部', + name: 'header', + propType: 'node', + }, + { + description: '自定义导航尾部', + name: 'footer', + propType: 'node', + }, + { + defaultValue: false, + description: '是否开启嵌入式模式,一般用于Layout的布局中,开启后没有默认背景、外层border、box-shadow,可以配合`