br-dionysus 1.19.8 → 1.19.9
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/attributes.json +1 -1
- package/createWebTypes.mjs +64 -162
- package/cypress/aaa.umd.js +97 -0
- package/dist/br-dionysus.es.d.ts +3114 -0
- package/dist/br-dionysus.es.js +107662 -0
- package/dist/br-dionysus.umd.js +847 -0
- package/dist/index.css +1 -0
- package/package.json +1 -1
- package/packages/MVirtualTable/src/MVirtualTable.vue +49 -3
- package/packages/typings/global.d.ts +1 -0
- package/web-types.json +1 -1
package/attributes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"m-dialog/modelValue":{"type":"boolean | undefined","description":""},"m-dialog/width":{"type":"string | number | undefined","description":"对话框的宽度,默认值为 50%"},"m-dialog/insideHeight":{"type":"number | null | undefined","description":"对话框内部空间的高度,默认为null"},"m-dialog/minInsideHeight":{"type":"number | undefined","description":"对话框内部空间的最小高度,默认为0(当同时存在maxHeight和minInsideHeight时,以maxHeight为准)"},"m-dialog/maxInsideHeight":{"type":"number | undefined","description":"对话框内部空间的最大高度,默认为Infinity"},"m-dialog/resize":{"type":"boolean | undefined","description":"是否开启拖拽改变大小"},"m-dialog/draggable":{"type":"boolean | undefined","description":"是否可拖动"},"m-dialog/insideClassName":{"type":"string | undefined","description":"对话框内部空间的className"},"m-dialog/drawerMode":{"type":"boolean | undefined","description":"抽屉模式"},"m-dialog/resized":{"type":"[contentsSize: { width: number; height: number; }]","description":"窗口大小改变完成事件"},"m-dialog/update:insideHeight":{"type":"[number]","description":"更新内部容器高度"},"m-dialog/update:modelValue":{"type":"[boolean]","description":""},"m-inline/minWidth":{"type":"number | undefined","description":"列最小宽度"},"m-inline/maxWidth":{"type":"number | undefined","description":"列最大宽度"},"m-inline/size":{"type":"Size | undefined","description":"组件尺寸"},"m-inline/configKey":{"type":"string | undefined","description":"配置key"},"m-inline/model":{"type":"Record<string, any> | null | undefined","description":"筛选对象"},"m-inline/switch":{"type":"[status: boolean]","description":"切换折叠展开事件"},"m-input-number/modelValue":{"type":"string | number","description":""},"m-input-number/placeholder":{"type":"string | undefined","description":""},"m-input-number/disabled":{"type":"boolean | undefined","description":"是否禁用数值输入框"},"m-input-number/size":{"type":"string | undefined","description":"数值输入框尺寸"},"m-input-number/min":{"type":"number | undefined","description":"设置数值输入框允许的最小值"},"m-input-number/max":{"type":"number | undefined","description":"设置数值输入框允许的最大值"},"m-input-number/step":{"type":"number | undefined","description":"数值输入框步长"},"m-input-number/stepStrictly":{"type":"boolean | undefined","description":"是否只能输入 step 的倍数"},"m-input-number/thousandthPlace":{"type":"boolean | undefined","description":"输入框是否显示千分位"},"m-input-number/noBorder":{"type":"boolean | undefined","description":"是否不要边框"},"m-input-number/noSpacing":{"type":"boolean | undefined","description":"不要边距"},"m-input-number/update:modelValue":{"type":"[value: string | number | null]","description":""},"m-input-number/change":{"type":"[value?: number | undefined]","description":""},"m-input-number/focus":{"type":"[value: string | number | null]","description":""},"m-input-number/blur":{"type":"[value: string | number | null]","description":""},"m-input-number/input":{"type":"[value: string | number | null]","description":""},"m-select/checkboxMode":{"type":"boolean | undefined","description":"是否为checkbox模式"},"m-select/multiple":{"type":"boolean | undefined","description":"多选"},"m-select/modelValue":{"type":"any","description":"选中项绑定值"},"m-select/update:modelValue":{"type":"[value: string | number | boolean | (string | number | boolean)[]]","description":""},"m-select/change":{"type":"[value: any]","description":""},"m-select-table/modelValue":{"type":"string | number | (string | number)[] | undefined","description":""},"m-select-table/name":{"type":"string | number | (string | number)[] | undefined","description":"显示值"},"m-select-table/placeholder":{"type":"string | undefined","description":""},"m-select-table/disabled":{"type":"boolean | undefined","description":""},"m-select-table/size":{"type":"\"\" | \"small\" | \"large\" | undefined","description":""},"m-select-table/total":{"type":"number | null | undefined","description":"总数据量,当有值时,出现分页器"},"m-select-table/filterMethod":{"type":"Function | null | undefined","description":"自定义搜索"},"m-select-table/filterable":{"type":"boolean | undefined","description":"是否使用搜索"},"m-select-table/remote":{"type":"boolean | undefined","description":"是否使用 远程搜索"},"m-select-table/remoteMethod":{"type":"Function | undefined","description":"自定义远程搜索"},"m-select-table/options":{"type":"Option[]","description":""},"m-select-table/tableTitle":{"type":"TableTitle[]","description":""},"m-select-table/multiple":{"type":"boolean | undefined","description":"是否多选"},"m-select-table/keywords":{"type":"{ label: string; value: string; } | undefined","description":"定义默认的 label 和value"},"m-select-table/reserveSelection":{"type":"boolean | undefined","description":"是否开启翻页多选"},"m-select-table/tableHeight":{"type":"string | number | undefined","description":""},"m-select-table/isAffirmBtn":{"type":"boolean | undefined","description":"是否有确认按钮"},"m-select-table/scrollbarAlwaysOn":{"type":"boolean | undefined","description":"是否常态显示滚动条"},"m-select-table/allowCreate":{"type":"boolean | undefined","description":"是否能够创建条目"},"m-select-table/border":{"type":"boolean | undefined","description":"表格边框"},"m-select-table/popupWidth":{"type":"string | number | undefined","description":"弹窗的宽度"},"m-select-table/rowStyle":{"type":"Record<string, any> | ((data: { row: any; rowIndex: number; }) => Record<string, any>) | undefined","description":"行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style"},"m-select-table/cellStyle":{"type":"Record<string, any> | ((data: { row: any; column: any; rowIndex: number; columnIndex: number; }) => Record<string, any>) | undefined","description":"单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style"},"m-select-table/update:modelValue":{"type":"[value: string | number | boolean | (string | number | boolean)[]]","description":""},"m-select-table/selected":{"type":"[values: string | number | boolean | (string | number | boolean)[], rows: any]","description":"单选或多选之后的回调"},"m-select-table/selectMultiple":{"type":"[values: (string | number)[], rows: Option[]]","description":"多选确认按钮时的回调 配合isAffirmBtn使用"},"m-select-table/toPage":{"type":"[page: Page, query?: string | number | (string | number)[] | undefined]","description":"当没有使用filterMethod时候才会有回调否则没有"},"m-select-table/selectChange":{"type":"[values: string | number | (string | number)[], rows: Option[]]","description":"勾选数据change事件,选中值不发生变化"},"m-select-table/clear":{"type":"[]","description":"用户点击清空按钮时触发"},"m-select-table/removeTag":{"type":"[value: any, index: number]","description":"多选模式下移除tag时触发(标记,待处理)"},"m-select-table-v1/modelValue":{"type":"string | number | undefined","description":""},"m-select-table-v1/placeholder":{"type":"string | undefined","description":""},"m-select-table-v1/disabled":{"type":"boolean | undefined","description":""},"m-select-table-v1/options":{"type":"Option[]","description":""},"m-select-table-v1/tableTitle":{"type":"any[]","description":""},"m-select-table-v1/remoteMethod":{"type":"Function | undefined","description":""},"m-select-table-v1/allowCreate":{"type":"boolean | undefined","description":""},"m-select-table-v1/focusShow":{"type":"boolean | undefined","description":""},"m-select-table-v1/isSelect":{"type":"boolean | undefined","description":""},"m-select-table-v1/clearable":{"type":"boolean | undefined","description":""},"m-select-table-v1/size":{"type":"\"\" | \"small\" | \"large\" | undefined","description":""},"m-select-table-v1/labelKey":{"type":"string | undefined","description":""},"m-select-table-v1/scrollbarAlwaysOn":{"type":"boolean | undefined","description":""},"m-select-table-v1/total":{"type":"number | null | undefined","description":""},"m-select-table-v1/update:modelValue":{"type":"any","description":""},"m-select-table-v1/selectMultiple":{"type":"any","description":""},"m-select-table-v1/change":{"type":"any","description":""},"m-select-table-v1/selected":{"type":"any","description":""},"m-select-table-v1/clear":{"type":"any","description":""},"m-select-v2/modelValue":{"type":"ValueType","description":""},"m-select-v2/checkboxMode":{"type":"boolean | undefined","description":"是否为checkbox模式"},"m-select-v2/multiple":{"type":"boolean | undefined","description":"多选"},"m-select-v2/showAll":{"type":"boolean | undefined","description":"是否显示全选"},"m-select-v2/options":{"type":"Option[] | undefined","description":"选项"},"m-select-v2/update:modelValue":{"type":"[data: ValueType]","description":""},"m-batch-edit/selectionCell":{"type":"string | undefined","description":"选中列"},"m-batch-edit/size":{"type":"\"\" | \"small\" | \"large\" | undefined","description":"组件大小"},"m-batch-edit/tableData":{"type":"Record<string, any>[] | undefined","description":"表格数据"},"m-batch-edit/tableTitle":{"type":"TableTitle[] | null | undefined","description":"表格列配置"},"m-batch-edit/relevancyTable":{"type":"any","description":"关联表格(与tableTitle属性互斥,同时存在时只有tableTitle生效)"},"m-batch-edit/update:tableData":{"type":"[data: Record<string, any>[]]","description":""},"m-table/size":{"type":"\"\" | \"small\" | \"large\" | undefined","description":""},"m-table/sole":{"type":"string | undefined","description":""},"m-table/data":{"type":"Record<string, any>[] | undefined","description":""},"m-table/filtersValue":{"type":"Record<string, (string | number)[]> | null | undefined","description":"表格内容筛选(当为null时,不显示筛选图标)"},"m-table/tableConfig":{"type":"TableConfig | null | undefined","description":"表格配置"},"m-table/expandProp":{"type":"string | undefined","description":"展开图标列(如使用这个属性则必须存在rowKey属性) (标记,约束条件后面解决)"},"m-table/expandRowKeys":{"type":"any[] | undefined","description":"可以通过该属性设置 Table 目前的展开行,需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。"},"m-table/rowKey":{"type":"string | ((row: any) => string) | undefined","description":"行数据的 Key,用来优化 Table 的渲染; 在使用reserve-selection功能与显示树形数据时,该属性是必填的。 类型为 String 时,支持多层访问:user.info.id,但不支持 user.info[0].id,此种情况请使用 Function。"},"m-table/tableConfigKey":{"type":"string | undefined","description":"表格配置key"},"m-table/selectionCell":{"type":"string | number | symbol | undefined","description":"选中列"},"m-table/summaryMethod":{"type":"((data: { columns: any[]; data: any[]; }) => string[]) | null | undefined","description":"自定义的合计计算方法"},"m-table/circleTotal":{"type":"boolean | undefined","description":"是否圈选合计"},"m-table/isCircleCopy":{"type":"boolean | undefined","description":"是否启用圈选复制"},"m-table/isBuiltInSelection":{"type":"boolean | undefined","description":"启用内置多选(如同时启用了circleTotal,rowKey可实现勾选合计功能)"},"m-table/pasteData":{"type":"[data: { editRow: Record<string, any>; editColumn: string; arr: (string | number)[]; rowIndex: number; }, tableData: Record<string, any>[]]","description":"表格粘贴方法"},"m-table/update:tableConfig":{"type":"[tableConfig: TableConfig]","description":"表格配置更新"},"m-table/privateExpandChange":{"type":"[row: any, expandedRows: any[]]","description":"expandProp模式下 当用户对某一行展开或者关闭的时候会触发该事件"},"m-table/update:selectionCell":{"type":"[string | number | symbol]","description":"选中单元格更新"},"m-table/copyData":{"type":"[data: { text: string; selection: { startX: number; startY: number; endX: number; endY: number; }; }]","description":"复制事件"},"m-table/sortChange":{"type":"[data: { column: Record<string, any>; prop: string; order: any; }]","description":"当表格的排序条件发生变化的时候会触发该事件"},"m-table-column/filtersValue":{"type":"Record<string, (string | number)[]> | null | undefined","description":"列筛选过滤条件(当为null时,不显示筛选图标)"},"m-table-column/filters":{"type":"{ text: string | number; value: string | number; }[] | undefined","description":"过滤选项"},"m-table-column/filterMethod":{"type":"Function | null | undefined","description":"过滤方法"},"m-table-column/children":{"type":"PropChildren[] | undefined","description":""},"m-table-column/isBatchEdit":{"type":"boolean | undefined","description":"是否允许批改"},"m-table-column/update:filtersValue":{"type":"any","description":""},"m-table-column-set/modelValue":{"type":"TableConfig","description":"配置"},"m-table-column-set/foldMode":{"type":"boolean | undefined","description":"是否为折叠模式"},"m-table-column-set/link":{"type":"boolean | undefined","description":"是否为链接按钮"},"m-table-column-set/tableConfigKey":{"type":"string | undefined","description":"表格配置key"},"m-table-column-set/update:modelValue":{"type":"any","description":""},"m-table-column-set/change":{"type":"any","description":""},"m-table-v2/size":{"type":"\"small\" | \"large\" | \"default\" | undefined","description":""},"m-table-v2/data":{"type":"{ [key: string]: any; }[] | undefined","description":""},"m-table-v2/height":{"type":"number | undefined","description":"表格高度"},"m-table-v2/border":{"type":"boolean | undefined","description":"显示边框"},"m-table-v2/columns":{"type":"TableV2Title[] | undefined","description":"表格列配置"},"m-table-v2/filtersValue":{"type":"FilterValue | null | undefined","description":"表格内容筛选(当为null时,不显示筛选图标)"},"m-table-v2/tableConfig":{"type":"TableConfig | null | undefined","description":"表格配置"},"m-table-v2/tableConfigKey":{"type":"string | undefined","description":"表格配置key"},"m-table-v2/fixed":{"type":"boolean | undefined","description":"单元格宽度是自适应还是固定"},"m-table-v2/estimatedRowHeight":{"type":"number | null | undefined","description":"渲染动态的单元格的预估高度"},"m-table-v2/headerHeight":{"type":"number | number[] | null | undefined","description":"Header 的高度由height设置。 如果传入数组,它会使 header row 等于数组长度"},"m-table-v2/cellWidthAdaptive":{"type":"boolean | undefined","description":"单元格宽度自适应"},"m-table-v2/expandColumnKey":{"type":"string | undefined","description":"展开列的key"},"m-table-v2/pasteData":{"type":"[data: { editRow: { [key: string]: any; }; editColumn: string; arr: (string | number)[]; rowIndex: number; }, tableData: { [key: string]: any; }[]]","description":""},"m-table-v2/update:tableConfig":{"type":"[tableConfig: TableConfig]","description":"表格配置更新"},"m-tree-exhibit/data":{"type":"TreeItem[] | undefined","description":""},"m-tree-exhibit/nodeClick":{"type":"[Node]","description":"节点点击事件"},"m-tree-exhibit/descriptionClick":{"type":"[url: string]","description":"描述链接点击事件"},"m-virtual-table/columns":{"type":"TableColumn[]","description":"表格列配置"},"m-virtual-table/data":{"type":"Record<string, any>[]","description":"表格数据"},"m-virtual-table/theme":{"type":"\"light\" | \"dark\" | \"auto\" | undefined","description":"主题模式"},"m-virtual-table/loading":{"type":"boolean | undefined","description":"加载状态"},"m-virtual-table/rowHeight":{"type":"number | undefined","description":"行高"},"m-virtual-table/height":{"type":"string | number | undefined","description":"表格高度"},"m-virtual-table/showExport":{"type":"boolean | undefined","description":"是否显示导出按钮"},"m-virtual-table/exportFileName":{"type":"string | undefined","description":"导出文件名"},"m-virtual-table/showSelection":{"type":"boolean | undefined","description":"是否显示选择列"},"m-virtual-table/selectionWidth":{"type":"number | undefined","description":"选择列宽度"},"m-virtual-table/paginationMode":{"type":"\"virtual\" | \"pagination\" | undefined","description":"分页模式: 'virtual' 虚拟滚动 | 'pagination' 分页"},"m-virtual-table/currentPage":{"type":"number | undefined","description":"当前页码"},"m-virtual-table/pageSize":{"type":"number | undefined","description":"每页条数"},"m-virtual-table/total":{"type":"number | undefined","description":"数据总条数"},"m-virtual-table/size":{"type":"\"small\" | \"default\" | \"large\" | undefined","description":"组件尺寸"},"m-virtual-table/border":{"type":"boolean | undefined","description":"是否显示边框"},"m-virtual-table/showOverflowTooltip":{"type":"boolean | undefined","description":"是否在内容溢出时显示 Tooltip"},"m-virtual-table/rowClick":{"type":"(e: \"rowClick\", rowData: any, colData: any, event: any): void","description":""},"m-virtual-table/rowDblclick":{"type":"(e: \"rowDblclick\", rowData: any, colData: any, event: any): void","description":""},"m-virtual-table/headerDragend":{"type":"(e: \"headerDragend\", colWidth: number, oldWidth: number, colData: any, args: any): void","description":""},"m-virtual-table/scroll":{"type":"(e: \"scroll\", data: { scrollHeight: number; scrollDirection: string; scrollTop: number; viewHeight: number; }): void","description":""},"m-virtual-table/selectionChange":{"type":"(e: \"selectionChange\", selectedData: any[]): void","description":""},"m-virtual-table/currentChange":{"type":"(e: \"currentChange\", currentPage: number): void","description":""},"m-virtual-table/sizeChange":{"type":"(e: \"sizeChange\", pageSize: number): void","description":""},"m-virtual-table/export-complete":{"type":"(e: \"export-complete\"): void","description":""},"m-virtual-table/export-error":{"type":"(e: \"export-error\", error: Error): void","description":""},"skin-config/change":{"type":"any","description":""},"tab-page/modelValue":{"type":"MenuItem[] | undefined","description":""},"tab-page/activeKey":{"type":"string | undefined","description":""},"tab-page/showRightClickMenu":{"type":"boolean | undefined","description":""},"tab-page/primaryColor":{"type":"string | undefined","description":""},"tab-page/primaryBackgroundColor":{"type":"string | null | undefined","description":""},"tab-page/close":{"type":"any","description":""},"tab-page/click":{"type":"any","description":""}}
|
|
1
|
+
{"m-dialog/modelValue":{"type":"boolean","description":""},"m-dialog/width":{"type":"string | number","description":"对话框的宽度,默认值为 50%"},"m-dialog/insideHeight":{"type":"number | null","description":"对话框内部空间的高度,默认为null"},"m-dialog/minInsideHeight":{"type":"number","description":"对话框内部空间的最小高度,默认为0(当同时存在maxHeight和minInsideHeight时,以maxHeight为准)"},"m-dialog/maxInsideHeight":{"type":"number","description":"对话框内部空间的最大高度,默认为Infinity"},"m-dialog/resize":{"type":"boolean","description":"是否开启拖拽改变大小"},"m-dialog/draggable":{"type":"boolean","description":"是否可拖动"},"m-dialog/insideClassName":{"type":"string","description":"对话框内部空间的className"},"m-dialog/drawerMode":{"type":"boolean","description":"抽屉模式"},"m-dialog/resized":{"type":"[contentsSize: { width: number, height: number }]","description":"窗口大小改变完成事件"},"m-dialog/update:insideHeight":{"type":"[number]","description":"更新内部容器高度"},"m-dialog/update:modelValue":{"type":"[boolean]","description":""},"m-inline/minWidth":{"type":"number","description":"列最小宽度"},"m-inline/maxWidth":{"type":"number","description":"列最大宽度"},"m-inline/size":{"type":"Size","description":"组件尺寸"},"m-inline/configKey":{"type":"string","description":"配置key"},"m-inline/model":{"type":"Record<string, any> | null","description":"筛选对象"},"m-inline/switch":{"type":"[status: boolean]","description":"切换折叠展开事件"},"m-input-number/modelValue":{"type":"string | number","description":""},"m-input-number/placeholder":{"type":"string","description":""},"m-input-number/disabled":{"type":"boolean","description":"是否禁用数值输入框"},"m-input-number/size":{"type":"string","description":"数值输入框尺寸"},"m-input-number/min":{"type":"number","description":"设置数值输入框允许的最小值"},"m-input-number/max":{"type":"number","description":"设置数值输入框允许的最大值"},"m-input-number/step":{"type":"number","description":"数值输入框步长"},"m-input-number/stepStrictly":{"type":"boolean","description":"是否只能输入 step 的倍数"},"m-input-number/thousandthPlace":{"type":"boolean","description":"输入框是否显示千分位"},"m-input-number/noBorder":{"type":"boolean","description":"是否不要边框"},"m-input-number/noSpacing":{"type":"boolean","description":"不要边距"},"m-input-number/update:modelValue":{"type":"[value: string | number | null]","description":""},"m-input-number/change":{"type":"[value?: number]","description":""},"m-input-number/focus":{"type":"[value: string | number | null]","description":""},"m-input-number/blur":{"type":"[value: string | number | null]","description":""},"m-input-number/input":{"type":"[value: string | number | null]","description":""},"m-select/checkboxMode":{"type":"boolean","description":"是否为checkbox模式"},"m-select/multiple":{"type":"boolean","description":"多选"},"m-select/modelValue":{"type":"any","description":"选中项绑定值"},"m-select/update:modelValue":{"type":"[value: number | string | boolean | Array<number | string | boolean>]","description":""},"m-select/change":{"type":"[value: any]","description":""},"m-select-table/modelValue":{"type":"string | number | Array<number | string>","description":""},"m-select-table/name":{"type":"string | number | Array<number | string>","description":"显示值"},"m-select-table/placeholder":{"type":"string","description":""},"m-select-table/disabled":{"type":"boolean","description":""},"m-select-table/size":{"type":"'small' | 'large' | ''","description":""},"m-select-table/total":{"type":"number | null","description":"总数据量,当有值时,出现分页器"},"m-select-table/filterMethod":{"type":"Function | null","description":"自定义搜索"},"m-select-table/filterable":{"type":"boolean","description":"是否使用搜索"},"m-select-table/remote":{"type":"boolean","description":"是否使用 远程搜索"},"m-select-table/remoteMethod":{"type":"Function","description":"自定义远程搜索"},"m-select-table/options":{"type":"Option[]","description":""},"m-select-table/tableTitle":{"type":"TableTitle[]","description":""},"m-select-table/multiple":{"type":"boolean","description":"是否多选"},"m-select-table/keywords":{"type":"{ label: string, value: string }","description":"定义默认的 label 和value"},"m-select-table/reserveSelection":{"type":"boolean","description":"是否开启翻页多选"},"m-select-table/tableHeight":{"type":"string | number","description":""},"m-select-table/isAffirmBtn":{"type":"boolean","description":"是否有确认按钮"},"m-select-table/scrollbarAlwaysOn":{"type":"boolean","description":"是否常态显示滚动条"},"m-select-table/allowCreate":{"type":"boolean","description":"是否能够创建条目"},"m-select-table/border":{"type":"boolean","description":"表格边框"},"m-select-table/popupWidth":{"type":"number | string","description":"弹窗的宽度"},"m-select-table/rowStyle":{"type":"Record<string, any>|((data: { row: any, rowIndex: number }) => Record<string, any>)","description":"行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style"},"m-select-table/cellStyle":{"type":"Record<string, any>|((data: { row: any, column: any, rowIndex: number, columnIndex: number }) => Record<string, any>)","description":"单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style"},"m-select-table/update:modelValue":{"type":"[value: string | number | boolean | Array<string | number | boolean>]","description":""},"m-select-table/selected":{"type":"[values: string | number | boolean | Array<string | number | boolean>, rows: Option[] | Option]","description":"单选或多选之后的回调"},"m-select-table/selectMultiple":{"type":"[values: Array<string | number>, rows: Option[]]","description":"多选确认按钮时的回调 配合isAffirmBtn使用"},"m-select-table/toPage":{"type":"[page: Page, query?: string | number | Array<string | number>]","description":"当没有使用filterMethod时候才会有回调否则没有"},"m-select-table/selectChange":{"type":"[values: string | number | Array<string | number>, rows: Option[]]","description":"勾选数据change事件,选中值不发生变化"},"m-select-table/clear":{"type":"[]","description":"用户点击清空按钮时触发"},"m-select-table/removeTag":{"type":"[value: any, index: number]","description":"多选模式下移除tag时触发(标记,待处理)"},"m-select-table-v1/modelValue":{"type":"string | number","description":""},"m-select-table-v1/placeholder":{"type":"string","description":""},"m-select-table-v1/disabled":{"type":"boolean","description":""},"m-select-table-v1/options":{"type":"Option[]","description":""},"m-select-table-v1/tableTitle":{"type":"any[]","description":""},"m-select-table-v1/remoteMethod":{"type":"Function","description":""},"m-select-table-v1/allowCreate":{"type":"boolean","description":""},"m-select-table-v1/focusShow":{"type":"boolean","description":""},"m-select-table-v1/isSelect":{"type":"boolean","description":""},"m-select-table-v1/clearable":{"type":"boolean","description":""},"m-select-table-v1/size":{"type":"'small' | 'large' | ''","description":""},"m-select-table-v1/labelKey":{"type":"string","description":""},"m-select-table-v1/scrollbarAlwaysOn":{"type":"boolean","description":""},"m-select-table-v1/total":{"type":"number | null","description":""},"m-select-table-v1/update:modelValue":{"type":"any","description":""},"m-select-table-v1/selectMultiple":{"type":"any","description":""},"m-select-table-v1/change":{"type":"any","description":""},"m-select-table-v1/selected":{"type":"any","description":""},"m-select-table-v1/clear":{"type":"any","description":""},"m-select-v2/modelValue":{"type":"ValueType","description":""},"m-select-v2/checkboxMode":{"type":"boolean","description":"是否为checkbox模式"},"m-select-v2/multiple":{"type":"boolean","description":"多选"},"m-select-v2/showAll":{"type":"boolean","description":"是否显示全选"},"m-select-v2/options":{"type":"Option[]","description":"选项"},"m-select-v2/update:modelValue":{"type":"[data: ValueType]","description":""},"m-batch-edit/selectionCell":{"type":"string","description":"选中列"},"m-batch-edit/size":{"type":"'small' | 'large' | ''","description":"组件大小"},"m-batch-edit/tableData":{"type":"Record<string, any>[]","description":"表格数据"},"m-batch-edit/tableTitle":{"type":"TableTitle[] | null","description":"表格列配置"},"m-batch-edit/relevancyTable":{"type":"InstanceType<typeof import('./../../MTable').MTable> | null","description":"关联表格(与tableTitle属性互斥,同时存在时只有tableTitle生效)"},"m-batch-edit/update:tableData":{"type":"[data: Record<string, any>[]]","description":""},"m-table/size":{"type":"'small' | 'large' | ''","description":""},"m-table/sole":{"type":"string","description":""},"m-table/data":{"type":"Record<string, any>[]","description":""},"m-table/filtersValue":{"type":"Record<string, Array<string | number>> | null","description":"表格内容筛选(当为null时,不显示筛选图标)"},"m-table/tableConfig":{"type":"TableConfig | null","description":"表格配置"},"m-table/expandProp":{"type":"string","description":"展开图标列(如使用这个属性则必须存在rowKey属性) (标记,约束条件后面解决)"},"m-table/expandRowKeys":{"type":"any[]","description":"可以通过该属性设置 Table 目前的展开行,需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。"},"m-table/rowKey":{"type":"string |((row: any) => string)","description":"行数据的 Key,用来优化 Table 的渲染; 在使用reserve-selection功能与显示树形数据时,该属性是必填的。 类型为 String 时,支持多层访问:user.info.id,但不支持 user.info[0].id,此种情况请使用 Function。"},"m-table/tableConfigKey":{"type":"string","description":"表格配置key"},"m-table/selectionCell":{"type":"string | number | symbol","description":"选中列"},"m-table/summaryMethod":{"type":"((data: { columns: any[], data: any[] }) => string[]) | null","description":"自定义的合计计算方法"},"m-table/circleTotal":{"type":"boolean","description":"是否圈选合计"},"m-table/isCircleCopy":{"type":"boolean","description":"是否启用圈选复制"},"m-table/isBuiltInSelection":{"type":"boolean","description":"启用内置多选(如同时启用了circleTotal,rowKey可实现勾选合计功能)"},"m-table/pasteData":{"type":"[\n data: {\n /** 粘贴行的行数据 */\n editRow: Record<string, any>,\n /** 粘贴列的列名 */\n editColumn: string,\n /** 粘贴的数据 */\n arr: Array<string | number>,\n /** 起始行 */\n rowIndex: number,\n },\n /** 粘贴完成后的表格数据 */\n tableData: Array<Record<string, any>>\n ]","description":"表格粘贴方法"},"m-table/update:tableConfig":{"type":"[tableConfig: TableConfig]","description":"表格配置更新"},"m-table/privateExpandChange":{"type":"[row: any, expandedRows: any[]]","description":"expandProp模式下 当用户对某一行展开或者关闭的时候会触发该事件"},"m-table/update:selectionCell":{"type":"[ string | number | symbol ]","description":"选中单元格更新"},"m-table/copyData":{"type":"[ data: { text: string, selection: { startX: number, startY: number, endX: number, endY: number } } ]","description":"复制事件"},"m-table/sortChange":{"type":"[ data: { column: Record<string, any>, prop: string, order: any } ]","description":"当表格的排序条件发生变化的时候会触发该事件"},"m-table-column/filtersValue":{"type":"Record<string, Array<string | number>> | null","description":"列筛选过滤条件(当为null时,不显示筛选图标)"},"m-table-column/filters":{"type":"Array<{ text: string | number, value: string | number }>","description":"过滤选项"},"m-table-column/filterMethod":{"type":"Function | null","description":"过滤方法"},"m-table-column/children":{"type":"Array<PropChildren>","description":""},"m-table-column/isBatchEdit":{"type":"boolean","description":"是否允许批改"},"m-table-column/update:filtersValue":{"type":"any","description":""},"m-table-column-set/modelValue":{"type":"TableConfig","description":"配置"},"m-table-column-set/foldMode":{"type":"boolean","description":"是否为折叠模式"},"m-table-column-set/link":{"type":"boolean","description":"是否为链接按钮"},"m-table-column-set/tableConfigKey":{"type":"string","description":"表格配置key"},"m-table-column-set/update:modelValue":{"type":"any","description":""},"m-table-column-set/change":{"type":"any","description":""},"m-table-v2/size":{"type":"'small' | 'large' | 'default'","description":""},"m-table-v2/data":{"type":"Array<{\n [key: string]: any\n }>","description":""},"m-table-v2/height":{"type":"number","description":"表格高度"},"m-table-v2/border":{"type":"boolean","description":"显示边框"},"m-table-v2/columns":{"type":"TableV2Title[]","description":"表格列配置"},"m-table-v2/filtersValue":{"type":"FilterValue | null","description":"表格内容筛选(当为null时,不显示筛选图标)"},"m-table-v2/tableConfig":{"type":"TableConfig | null","description":"表格配置"},"m-table-v2/tableConfigKey":{"type":"string","description":"表格配置key"},"m-table-v2/fixed":{"type":"boolean","description":"单元格宽度是自适应还是固定"},"m-table-v2/estimatedRowHeight":{"type":"number | null","description":"渲染动态的单元格的预估高度"},"m-table-v2/headerHeight":{"type":"number | number[] | null","description":"Header 的高度由height设置。 如果传入数组,它会使 header row 等于数组长度"},"m-table-v2/cellWidthAdaptive":{"type":"boolean","description":"单元格宽度自适应"},"m-table-v2/expandColumnKey":{"type":"string","description":"展开列的key"},"m-table-v2/pasteData":{"type":"[\n data: {\n /** 粘贴行的行数据 */\n editRow: { [key: string]: any },\n /** 粘贴列的列名 */\n editColumn: string,\n /** 粘贴的数据 */\n arr: Array<string | number>,\n /** 起始行 */\n rowIndex: number,\n },\n /** 粘贴完成后的表格数据 */\n tableData: Array<{ [key: string]: any }>\n ]","description":""},"m-table-v2/update:tableConfig":{"type":"[tableConfig: TableConfig]","description":"表格配置更新"},"m-tree-exhibit/data":{"type":"TreeItem[]","description":""},"m-tree-exhibit/nodeClick":{"type":"[Node]","description":"节点点击事件"},"m-tree-exhibit/descriptionClick":{"type":"[url: string]","description":"描述链接点击事件"},"m-virtual-table/columns":{"type":"TableColumn[]","description":"表格列配置"},"m-virtual-table/data":{"type":"Record<string, any>[]","description":"表格数据"},"m-virtual-table/theme":{"type":"'light' | 'dark' | 'auto'","description":"主题模式"},"m-virtual-table/loading":{"type":"boolean","description":"加载状态"},"m-virtual-table/rowHeight":{"type":"number","description":"行高"},"m-virtual-table/height":{"type":"number | string","description":"表格高度"},"m-virtual-table/showExport":{"type":"boolean","description":"是否显示导出按钮"},"m-virtual-table/exportFileName":{"type":"string","description":"导出文件名"},"m-virtual-table/showSelection":{"type":"boolean","description":"是否显示选择列"},"m-virtual-table/selectionWidth":{"type":"number","description":"选择列宽度"},"m-virtual-table/paginationMode":{"type":"'virtual' | 'pagination'","description":"分页模式: 'virtual' 虚拟滚动 | 'pagination' 分页"},"m-virtual-table/currentPage":{"type":"number","description":"当前页码"},"m-virtual-table/pageSize":{"type":"number","description":"每页条数"},"m-virtual-table/total":{"type":"number","description":"数据总条数"},"m-virtual-table/size":{"type":"'small' | 'default' | 'large'","description":"组件尺寸"},"m-virtual-table/border":{"type":"boolean","description":"是否显示边框"},"m-virtual-table/showOverflowTooltip":{"type":"boolean","description":"是否在内容溢出时显示 Tooltip"},"m-virtual-table/rowClick":{"type":"[rowData: any, colData: any, event: any]","description":""},"m-virtual-table/rowDblclick":{"type":"[rowData: any, colData: any, event: any]","description":""},"m-virtual-table/headerDragend":{"type":"[colWidth: number, oldWidth: number, colData: any, args: any]","description":""},"m-virtual-table/scroll":{"type":"[data: { scrollHeight: number; scrollDirection: string; scrollTop: number; viewHeight: number }]","description":""},"m-virtual-table/selectionChange":{"type":"[selectedData: any[]]","description":""},"m-virtual-table/currentChange":{"type":"[currentPage: number]","description":""},"m-virtual-table/sizeChange":{"type":"[pageSize: number]","description":""},"m-virtual-table/export-complete":{"type":"[]","description":""},"m-virtual-table/export-error":{"type":"[error: Error]","description":""},"skin-config/change":{"type":"any","description":""},"tab-page/modelValue":{"type":"MenuItem[]","description":""},"tab-page/activeKey":{"type":"string","description":""},"tab-page/showRightClickMenu":{"type":"boolean","description":""},"tab-page/primaryColor":{"type":"string","description":""},"tab-page/primaryBackgroundColor":{"type":"string | null","description":""},"tab-page/close":{"type":"any","description":""},"tab-page/click":{"type":"any","description":""}}
|
package/createWebTypes.mjs
CHANGED
|
@@ -9,179 +9,83 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
9
9
|
const getPackage = () => JSON.parse(fs.readFileSync('./package.json', 'utf8'))
|
|
10
10
|
const packageJson = getPackage()
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
20
|
-
strict: false,
|
|
21
|
-
skipLibCheck: true
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const configFile = ts.readConfigFile(configPath, ts.sys.readFile)
|
|
26
|
-
if (configFile.error) {
|
|
27
|
-
throw new Error(ts.flattenDiagnosticMessageText(configFile.error.messageText, '\n'))
|
|
28
|
-
}
|
|
29
|
-
return ts.parseJsonConfigFileContent(configFile.config, ts.sys, path.dirname(configPath))
|
|
12
|
+
const createAST = (code, scriptSetup = false) => {
|
|
13
|
+
return ts.createSourceFile(
|
|
14
|
+
'temp.ts',
|
|
15
|
+
scriptSetup ? `<script setup>${code}</script>` : code,
|
|
16
|
+
ts.ScriptTarget.Latest,
|
|
17
|
+
false
|
|
18
|
+
)
|
|
30
19
|
}
|
|
31
20
|
|
|
32
|
-
const tsConfig = parseTsConfig()
|
|
33
|
-
|
|
34
21
|
// 根据ast中的jsDoc获取信息
|
|
35
|
-
const getJsDoc = (jsDoc) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (Array.isArray(jsDocObj.text)) {
|
|
42
|
-
return jsDocObj.text.map(item => item?.text || '').join('')
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const isDescriptionJsDoc = Boolean(jsDocObj?.parent?.jsDoc?.[0]?.tags)
|
|
46
|
-
const description = isDescriptionJsDoc ? jsDocObj.parent.jsDoc[0].tags[0]?.comment : jsDocObj.comment
|
|
47
|
-
return description || ''
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const buildVirtualProgram = (vueFilePath, scriptContent) => {
|
|
51
|
-
const virtualTsPath = `${vueFilePath}.web-types.ts`
|
|
52
|
-
const normalizedVirtualPath = path.resolve(virtualTsPath)
|
|
53
|
-
const host = ts.createCompilerHost(tsConfig.options, true)
|
|
54
|
-
|
|
55
|
-
const getSourceFile = host.getSourceFile.bind(host)
|
|
56
|
-
host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {
|
|
57
|
-
if (path.resolve(fileName) === normalizedVirtualPath) {
|
|
58
|
-
return ts.createSourceFile(fileName, scriptContent, languageVersion, true, ts.ScriptKind.TS)
|
|
59
|
-
}
|
|
60
|
-
return getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const readFile = host.readFile?.bind(host)
|
|
64
|
-
host.readFile = (fileName) => {
|
|
65
|
-
if (path.resolve(fileName) === normalizedVirtualPath) return scriptContent
|
|
66
|
-
return readFile ? readFile(fileName) : undefined
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const fileExists = host.fileExists?.bind(host)
|
|
70
|
-
host.fileExists = (fileName) => {
|
|
71
|
-
if (path.resolve(fileName) === normalizedVirtualPath) return true
|
|
72
|
-
return fileExists ? fileExists(fileName) : false
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const program = ts.createProgram({
|
|
76
|
-
rootNames: [virtualTsPath],
|
|
77
|
-
options: tsConfig.options,
|
|
78
|
-
host
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
program,
|
|
83
|
-
sourceFile: program.getSourceFile(virtualTsPath)
|
|
84
|
-
}
|
|
22
|
+
const getJsDoc = (jsDoc = {}) => {
|
|
23
|
+
const jsDocObj = jsDoc ? (Array.isArray(jsDoc) ? (jsDoc || [{}])[0] : jsDoc) : {}
|
|
24
|
+
// jsDoc是否带@description等标记
|
|
25
|
+
const isDescriptionJsDoc = Boolean(jsDocObj?.parent?.jsDoc[0].tags)
|
|
26
|
+
const _jsDoc = isDescriptionJsDoc ? jsDocObj.parent.jsDoc[0].tags[0].comment : jsDocObj.comment
|
|
27
|
+
return _jsDoc || ''
|
|
85
28
|
}
|
|
86
29
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const declaration = symbol.valueDeclaration || symbol.declarations?.[0] || fallbackNode
|
|
90
|
-
const valueType = checker.getTypeOfSymbolAtLocation(symbol, declaration)
|
|
91
|
-
return {
|
|
92
|
-
name: symbol.getName(),
|
|
93
|
-
type: checker.typeToString(valueType),
|
|
94
|
-
jsDoc: ts.displayPartsToString(symbol.getDocumentationComment(checker)) || getJsDoc(symbol.getJsDocTags())
|
|
95
|
-
}
|
|
96
|
-
})
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const getEventNamesFromSignature = (checker, signature, sourceFile) => {
|
|
100
|
-
const firstParam = signature.getParameters()[0]
|
|
101
|
-
if (!firstParam) return []
|
|
102
|
-
const declaration = firstParam.valueDeclaration || sourceFile
|
|
103
|
-
const firstParamType = checker.getTypeOfSymbolAtLocation(firstParam, declaration)
|
|
104
|
-
if (firstParamType.isUnion()) {
|
|
105
|
-
return firstParamType.types
|
|
106
|
-
.map(type => (type.isStringLiteral() ? type.value : null))
|
|
107
|
-
.filter(Boolean)
|
|
108
|
-
}
|
|
109
|
-
return firstParamType.isStringLiteral() ? [firstParamType.value] : []
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const getDefinePropsCall = (node) => {
|
|
113
|
-
const callExpression = node.expression
|
|
114
|
-
const functionName = callExpression.escapedText || (callExpression.name && callExpression.name.escapedText)
|
|
115
|
-
if (functionName === 'defineProps') return node
|
|
116
|
-
if (functionName === 'withDefaults' && ts.isCallExpression(node.arguments?.[0])) {
|
|
117
|
-
const firstArg = node.arguments[0]
|
|
118
|
-
const firstName = firstArg.expression.escapedText || (firstArg.expression.name && firstArg.expression.name.escapedText)
|
|
119
|
-
if (firstName === 'defineProps') return firstArg
|
|
120
|
-
}
|
|
121
|
-
return null
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// 使用 TypeChecker 遍历并提取 props / emits,支持类型引用
|
|
125
|
-
const extractPropsFromAST = (checker, sourceFile) => {
|
|
30
|
+
// 遍历AST并查找`props`定义
|
|
31
|
+
const extractPropsFromAST = (ast) => {
|
|
126
32
|
const props = []
|
|
127
33
|
const events = []
|
|
128
|
-
const eventSeen = new Set()
|
|
129
|
-
const propSeen = new Set()
|
|
130
34
|
|
|
131
35
|
const visit = (node) => {
|
|
132
36
|
if (ts.isCallExpression(node)) {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (ts.isCallExpression(node.parent) && node.parent.arguments?.[0] === node) {
|
|
137
|
-
const parentName = node.parent.expression.escapedText || (node.parent.expression.name && node.parent.expression.name.escapedText)
|
|
138
|
-
if (parentName === 'withDefaults') {
|
|
139
|
-
ts.forEachChild(node, visit)
|
|
140
|
-
return
|
|
141
|
-
}
|
|
142
|
-
}
|
|
37
|
+
const callExpression = node.expression
|
|
38
|
+
// 获取函数的名称
|
|
39
|
+
const functionName = callExpression.escapedText || (callExpression.name && callExpression.name.escapedText)
|
|
143
40
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
41
|
+
// 是属性
|
|
42
|
+
const isProps = functionName === 'defineProps' || functionName === 'withDefaults'
|
|
43
|
+
if (isProps) {
|
|
44
|
+
if (node.arguments.length) {
|
|
45
|
+
const propsArg = node.arguments[0]
|
|
46
|
+
const members = propsArg.typeArguments[0].members
|
|
47
|
+
|
|
48
|
+
members.forEach(member => {
|
|
49
|
+
const name = member.name.getText(ast)
|
|
50
|
+
const type = member.type.getText(ast)
|
|
51
|
+
const jsDoc = getJsDoc(member.jsDoc)
|
|
52
|
+
props.push({
|
|
53
|
+
name,
|
|
54
|
+
type,
|
|
55
|
+
jsDoc
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}
|
|
151
59
|
}
|
|
152
60
|
|
|
153
61
|
// 是事件
|
|
154
|
-
const callExpression = node.expression
|
|
155
|
-
const functionName = callExpression.escapedText || (callExpression.name && callExpression.name.escapedText)
|
|
156
62
|
const isEvents = functionName === 'defineEmits'
|
|
157
63
|
if (isEvents) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
getEventNamesFromSignature(checker, signature, sourceFile).forEach(name => {
|
|
171
|
-
if (eventSeen.has(name)) return
|
|
172
|
-
eventSeen.add(name)
|
|
173
|
-
events.push({ name, type, jsDoc })
|
|
64
|
+
// 是否为类型写法
|
|
65
|
+
const isTs = node.typeArguments
|
|
66
|
+
if (isTs) {
|
|
67
|
+
const members = node.typeArguments[0].members
|
|
68
|
+
members.forEach(member => {
|
|
69
|
+
const name = member.name.getText(ast)
|
|
70
|
+
const type = member.type.getText(ast)
|
|
71
|
+
const jsDoc = getJsDoc(member.jsDoc)
|
|
72
|
+
events.push({
|
|
73
|
+
name,
|
|
74
|
+
type,
|
|
75
|
+
jsDoc
|
|
174
76
|
})
|
|
175
77
|
})
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
78
|
+
}
|
|
79
|
+
if (!isTs) {
|
|
80
|
+
const elements = node.arguments[0].elements
|
|
81
|
+
elements.forEach(element => {
|
|
82
|
+
const name = element.getText(ast)
|
|
83
|
+
const type = 'any'
|
|
84
|
+
const jsDoc = ''
|
|
181
85
|
events.push({
|
|
182
86
|
name,
|
|
183
|
-
type
|
|
184
|
-
jsDoc
|
|
87
|
+
type,
|
|
88
|
+
jsDoc
|
|
185
89
|
})
|
|
186
90
|
})
|
|
187
91
|
}
|
|
@@ -191,7 +95,7 @@ const extractPropsFromAST = (checker, sourceFile) => {
|
|
|
191
95
|
ts.forEachChild(node, visit)
|
|
192
96
|
}
|
|
193
97
|
|
|
194
|
-
ts.forEachChild(
|
|
98
|
+
ts.forEachChild(ast, visit)
|
|
195
99
|
return {
|
|
196
100
|
props,
|
|
197
101
|
events
|
|
@@ -199,11 +103,9 @@ const extractPropsFromAST = (checker, sourceFile) => {
|
|
|
199
103
|
}
|
|
200
104
|
|
|
201
105
|
// 分析vue组件的script部分代码
|
|
202
|
-
const analyzeScriptPart = (
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
const checker = program.getTypeChecker()
|
|
206
|
-
return extractPropsFromAST(checker, sourceFile)
|
|
106
|
+
const analyzeScriptPart = (code) => {
|
|
107
|
+
const ast = createAST(code)
|
|
108
|
+
return extractPropsFromAST(ast)
|
|
207
109
|
}
|
|
208
110
|
|
|
209
111
|
// 读取文件列表
|
|
@@ -269,7 +171,7 @@ const main = () => {
|
|
|
269
171
|
const fileName = item.name.substring(0, item.name.lastIndexOf('.vue'))
|
|
270
172
|
if (!descriptor.scriptSetup) continue
|
|
271
173
|
// if (fileName !== 'MInline') continue
|
|
272
|
-
const { props, events } = analyzeScriptPart(
|
|
174
|
+
const { props, events } = analyzeScriptPart(descriptor.scriptSetup.content)
|
|
273
175
|
webTypesData.push({
|
|
274
176
|
name: camelToKebabCase(fileName),
|
|
275
177
|
source: {
|
|
@@ -314,7 +216,7 @@ const main = () => {
|
|
|
314
216
|
const { descriptor } = parse(fileContent)
|
|
315
217
|
const fileName = item.name.substring(0, item.name.lastIndexOf('.vue'))
|
|
316
218
|
if (!descriptor.scriptSetup) continue
|
|
317
|
-
const { props, events } = analyzeScriptPart(
|
|
219
|
+
const { props, events } = analyzeScriptPart(descriptor.scriptSetup.content)
|
|
318
220
|
const attributes = [...props.map(node => node.name), ...events.map(node => node.name)].map(node => node.replace(/'/g, ''))
|
|
319
221
|
tagsData[camelToKebabCase(fileName)] = {
|
|
320
222
|
attributes,
|
|
@@ -336,7 +238,7 @@ const main = () => {
|
|
|
336
238
|
const { descriptor } = parse(fileContent)
|
|
337
239
|
const fileName = item.name.substring(0, item.name.lastIndexOf('.vue'))
|
|
338
240
|
if (!descriptor.scriptSetup) continue
|
|
339
|
-
const { props, events } = analyzeScriptPart(
|
|
241
|
+
const { props, events } = analyzeScriptPart(descriptor.scriptSetup.content)
|
|
340
242
|
props.forEach(prop => {
|
|
341
243
|
const key = (camelToKebabCase(fileName) + '/' + prop.name).replace(/'/g, '')
|
|
342
244
|
attributesData[key] = {
|