diff --git a/packages/design/src/Button.vue b/packages/design/src/Button.vue index 54b4d2aa..564ebbe0 100644 --- a/packages/design/src/Button.vue +++ b/packages/design/src/Button.vue @@ -30,3 +30,11 @@ const clickHandler = (...args: any[]) => { emit('click', ...args); }; + + diff --git a/packages/design/src/Icon.vue b/packages/design/src/Icon.vue index c588dd6d..d7cfc755 100644 --- a/packages/design/src/Icon.vue +++ b/packages/design/src/Icon.vue @@ -19,3 +19,16 @@ const uiComponent = ui?.component || 'el-icon'; const props = defineProps(); const uiProps = computed(() => ui?.props(props) || props); + + diff --git a/packages/design/src/Table.vue b/packages/design/src/Table.vue index 73d8190c..054f109b 100644 --- a/packages/design/src/Table.vue +++ b/packages/design/src/Table.vue @@ -16,7 +16,7 @@ diff --git a/packages/design/src/TableColumn.vue b/packages/design/src/TableColumn.vue deleted file mode 100644 index eb4be119..00000000 --- a/packages/design/src/TableColumn.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/packages/design/src/Tree.vue b/packages/design/src/Tree.vue deleted file mode 100644 index 6b9e75e5..00000000 --- a/packages/design/src/Tree.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - diff --git a/packages/design/src/index.ts b/packages/design/src/index.ts index 406f3815..088e2802 100644 --- a/packages/design/src/index.ts +++ b/packages/design/src/index.ts @@ -46,13 +46,11 @@ export { default as TMagicStep } from './Step.vue'; export { default as TMagicSteps } from './Steps.vue'; export { default as TMagicSwitch } from './Switch.vue'; export { default as TMagicTable } from './Table.vue'; -export { default as TMagicTableColumn } from './TableColumn.vue'; export { default as TMagicTabPane } from './TabPane.vue'; export { default as TMagicTabs } from './Tabs.vue'; export { default as TMagicTag } from './Tag.vue'; export { default as TMagicTimePicker } from './TimePicker.vue'; export { default as TMagicTooltip } from './Tooltip.vue'; -export { default as TMagicTree } from './Tree.vue'; export { default as TMagicUpload } from './Upload.vue'; export const tMagicMessage = { diff --git a/packages/design/src/types.ts b/packages/design/src/types.ts index 9c35dd5e..773d0e7c 100644 --- a/packages/design/src/types.ts +++ b/packages/design/src/types.ts @@ -182,6 +182,7 @@ export interface FormItemProps { prop?: string; labelWidth?: string | number; rules?: any; + extra?: string; } export interface InputProps { @@ -295,17 +296,36 @@ export interface SwitchProps { } export interface TableProps { + columns?: TableColumnOptions[]; data?: any[]; border?: boolean; maxHeight?: number | string; defaultExpandAll?: boolean; + showHeader?: boolean; + rowKey?: string; + treeProps?: Record; + emptyText?: string; + tooltipEffect?: string; + tooltipOptions?: any; + showOverflowTooltip?: boolean; + spanMethod?: (data: any) => any; } -export interface TableColumnProps { - label?: string; - align?: string; - fixed?: string | boolean; - width?: string | number; +export interface TableColumnOptions { + props: { + class?: string; + label?: string; + fixed?: 'left' | 'right' | boolean; + width?: number | string; + type?: 'default' | 'selection' | 'index' | 'expand'; + prop?: string; + align?: string; + headerAlign?: string; + sortable?: boolean; + sortOrders?: Array<'ascending' | 'descending'>; + selectable?: (row: T, index: number) => boolean; + }; + cell?: (scope: { row: T; $index: number }) => any; } export interface TabPaneProps { @@ -342,33 +362,6 @@ export interface TooltipProps { offset?: number; } -export interface TreeProps { - data?: any[]; - emptyText?: string; - nodeKey?: string; - props?: any; - renderAfterExpand?: boolean; - load?: any; - renderContent?: any; - highlightCurrent?: boolean; - defaultExpandAll?: boolean; - checkOnClickNode?: boolean; - autoExpandParent?: boolean; - defaultExpandedKeys?: any[]; - showCheckbox?: boolean; - checkStrictly?: boolean; - defaultCheckedKeys?: any[]; - currentNodeKey?: string | number; - filterNodeMethod?: (value: any, data: any, node: any) => boolean; - accordion?: boolean; - indent?: number; - icon?: any; - lazy?: boolean; - draggable?: boolean; - allowDrag?: (node: any) => boolean; - allowDrop?: any; -} - export interface UploadProps { action?: string; autoUpload?: boolean; @@ -635,8 +628,8 @@ export interface Components { | DefineComponent< TableProps, { - instance: any; - $el: HTMLDivElement | undefined; + getEl: () => HTMLElement | undefined; + getTableRef: () => any; clearSelection: (...args: any[]) => void; toggleRowSelection: (...args: any[]) => void; toggleRowExpansion: (...args: any[]) => void; @@ -647,11 +640,6 @@ export interface Components { props: (props: TableProps) => TableProps; }; - tableColumn: { - component: DefineComponent | string; - props: (props: TableColumnProps) => TableColumnProps; - }; - tabPane: { component: DefineComponent | string; props: (props: TabPaneProps) => TabPaneProps; @@ -677,24 +665,6 @@ export interface Components { props: (props: TooltipProps) => TooltipProps; }; - tree: { - component: - | DefineComponent< - TreeProps, - { - getData: () => TreeProps['data']; - getStore: () => any; - filter: (...args: any[]) => any; - getNode: (...args: any[]) => any; - setCheckedKeys: (...args: any[]) => any; - setCurrentKey: (...args: any[]) => any; - }, - any - > - | string; - props: (props: TreeProps) => TreeProps; - }; - upload: { component: | DefineComponent< diff --git a/packages/editor/src/fields/StyleSetter/Index.vue b/packages/editor/src/fields/StyleSetter/Index.vue index 85ddf057..90f5e093 100644 --- a/packages/editor/src/fields/StyleSetter/Index.vue +++ b/packages/editor/src/fields/StyleSetter/Index.vue @@ -1,5 +1,5 @@