UNPKG

ideaz-element

Version:

<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>

1 lines 8.88 kB
{"version":3,"file":"props.cjs","sources":["../../../../../packages/element/table/src/props.ts"],"sourcesContent":["import type { CSSProperties, ExtractPropTypes, PropType, VNode } from 'vue'\nimport type { ComponentSize, watermarkProps } from 'element-plus'\nimport type {\n DefaultRow,\n TableProps,\n} from 'element-plus/es/components/table/src/table/defaults'\nimport type { EditableTableEventParams, Pagination, TableCol, ToolBar } from '../../types'\n\nexport interface TableEdit {\n type?: 'multiple' | 'single'\n position?: 'bottom' | 'top'\n maxLength?: number\n deleteConfirm?: boolean\n onEdit?: ({ row, $index, column, formRef }: EditableTableEventParams) => void\n onSave?: ({ row, $index, column, formRef }: EditableTableEventParams) => void\n onDelete?: ({ row, $index, column, formRef }: EditableTableEventParams) => void\n onCancel?: ({ row, $index, column, formRef }: EditableTableEventParams) => void\n}\n\nexport interface TableSticky {\n top?: string\n parent?: string\n zIndex?: number\n style?: CSSProperties\n}\n\nexport const tableProps = {\n data: {\n type: Array as PropType<DefaultRow[]>,\n default: () => [],\n },\n height: [String, Number],\n maxHeight: [String, Number],\n fit: {\n type: Boolean,\n default: true,\n },\n stripe: Boolean,\n border: Boolean,\n rowKey: [String, Function] as PropType<TableProps<DefaultRow>['rowKey']>,\n showHeader: {\n type: Boolean,\n default: true,\n },\n showSummary: Boolean,\n sumText: String,\n summaryMethod: Function as PropType<TableProps<DefaultRow>['summaryMethod']>,\n rowClassName: [String, Function] as PropType<\n TableProps<DefaultRow>['rowClassName']\n >,\n rowStyle: [Object, Function] as PropType<TableProps<DefaultRow>['rowStyle']>,\n cellClassName: [String, Function] as PropType<\n TableProps<DefaultRow>['cellClassName']\n >,\n cellStyle: [Object, Function] as PropType<\n TableProps<DefaultRow>['cellStyle']\n >,\n headerRowClassName: [String, Function] as PropType<\n TableProps<DefaultRow>['headerRowClassName']\n >,\n headerRowStyle: [Object, Function] as PropType<\n TableProps<DefaultRow>['headerRowStyle']\n >,\n headerCellClassName: [String, Function] as PropType<\n TableProps<DefaultRow>['headerCellClassName']\n >,\n headerCellStyle: [Object, Function] as PropType<\n TableProps<DefaultRow>['headerCellStyle']\n >,\n highlightCurrentRow: Boolean,\n currentRowKey: [String, Number],\n emptyText: String,\n expandRowKeys: Array as PropType<TableProps<DefaultRow>['expandRowKeys']>,\n defaultExpandAll: Boolean,\n defaultSort: Object as PropType<TableProps<DefaultRow>['defaultSort']>,\n tooltipEffect: String,\n spanMethod: Function as PropType<TableProps<DefaultRow>['spanMethod']>,\n selectOnIndeterminate: {\n type: Boolean,\n default: true,\n },\n indent: {\n type: Number,\n default: 16,\n },\n treeProps: {\n type: Object as PropType<TableProps<DefaultRow>['treeProps']>,\n default: () => {\n return {\n hasChildren: 'hasChildren',\n children: 'children',\n }\n },\n },\n lazy: Boolean,\n load: Function as PropType<TableProps<DefaultRow>['load']>,\n style: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n className: {\n type: String,\n default: '',\n },\n tableLayout: {\n type: String as PropType<'fixed' | 'auto'>,\n default: 'fixed',\n },\n scrollbarAlwaysOn: Boolean,\n flexible: Boolean,\n showOverflowTooltip: Boolean,\n align: String as PropType<'left' | 'center' | 'right'>,\n headerAlign: String as PropType<'left' | 'center' | 'right'>,\n size: String as PropType<ComponentSize>,\n loading: Boolean,\n columns: {\n type: Array as PropType<TableCol[]>,\n default: () => [],\n },\n pagination: {\n type: [Object, Boolean] as PropType<Pagination | boolean>,\n default: () => ({ page: 1, pageSize: 0, total: 0, align: 'right' }),\n },\n toolBar: {\n type: [Boolean, Object] as PropType<ToolBar | boolean>,\n default: true,\n },\n draggable: {\n type: Boolean,\n default: false,\n },\n editable: {\n type: [Object, Boolean] as PropType<TableEdit | boolean>,\n },\n options: {\n type: Object,\n default: () => {},\n },\n watermark: {\n type: [String, Object, Boolean] as PropType<boolean | string | ElWatermarkProps>,\n default: false,\n },\n fullScreenElement: {\n type: [Function, HTMLElement] as PropType<() => HTMLElement | HTMLElement>,\n },\n totalData: {\n type: Array,\n default: () => [],\n },\n title: {\n type: [String, Function] as PropType<string | (() => VNode)>,\n default: '',\n },\n sticky: {\n type: [Boolean, Object] as PropType<boolean | TableSticky>,\n default: false,\n },\n mergeCells: {\n type: Object as PropType<{\n direction: 'row' | 'column' | 'both' // 合并方向:行、列、或两者都合并\n props?: string[] // 需要合并的字段,不传则所有列都参与合并\n }>,\n },\n}\n\nexport const tableColumnProps = {\n column: {\n type: Object as PropType<TableCol>,\n default: () => ({}),\n },\n size: {\n type: String as PropType<ComponentSize>,\n default: 'default',\n },\n tableProps: {\n type: Object as PropType<ITableProps>,\n default: () => ({}),\n },\n columnIndex: {\n type: Number,\n },\n columnsLength: {\n type: Number,\n default: 0,\n },\n}\n\nexport const radioColumnProps = {\n column: {\n type: Object as PropType<TableCol>,\n default: () => ({}),\n },\n tableProps: {\n type: Object as PropType<ITableProps>,\n default: () => ({}),\n },\n}\n\nexport const toolBarProps = {\n formatTableCols: {\n type: Array as PropType<TableCol[]>,\n default: () => [],\n },\n sortTableCols: {\n type: Array as PropType<TableCol[]>,\n default: () => [],\n },\n middleTableCols: {\n type: Array as PropType<TableCol[]>,\n default: () => [],\n },\n originFormatTableCols: {\n type: Array as PropType<TableCol[]>,\n default: () => [],\n },\n size: {\n type: String,\n default: 'default',\n },\n toolBar: {\n type: [Boolean, Object],\n default: undefined,\n },\n tableProps: {\n type: Object as PropType<ITableProps>,\n },\n}\n\nexport type ElWatermarkProps = ExtractPropTypes<typeof watermarkProps>\nexport type ITableProps = ExtractPropTypes<typeof tableProps>\nexport type TableColumnProps = ExtractPropTypes<typeof tableColumnProps>\nexport type ToolBarProps = ExtractPropTypes<typeof toolBarProps>\nexport const tableProvideKey = Symbol('tableKey')\n"],"names":["tableProps","tableColumnProps","radioColumnProps","toolBarProps","tableProvideKey"],"mappings":"gFA0BO,MAAAA,EAAA,CAA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