import type { ReturnPromise } from '@oinone/kunlun-shared'; import { OioComponentData, PopconfirmPlacement } from '@oinone/kunlun-vue-ui-common'; import type { PropType } from 'vue'; import { TableEditorCloseTrigger, TableEditorMode, TableEditorTrigger } from '../table'; import type { CellRenderFunction, RenderCellContext, RowContext } from '../typing'; import { ColumnAlignType, ColumnFixedType } from './typing'; export const OioColumnAppearanceProps = { width: { type: [String, Number] }, minWidth: { type: [String, Number] }, label: { type: String }, className: { type: [String, Function] as PropType string)> }, headerClassName: { type: [String, Function] as PropType string)> }, footerClassName: { type: [String, Function] as PropType string)> }, align: { type: String as PropType }, headerAlign: { type: String as PropType }, footerAlign: { type: String as PropType }, fixed: { type: [String, Boolean] as PropType, default: undefined }, invisible: { type: Boolean, default: false }, resizable: { type: Boolean, default: undefined }, treeNode: { type: Boolean, default: undefined } }; export const OioColumnEditorProps = { editable: { type: Boolean, default: false }, cellEditable: { type: [Boolean, Function] as PropType boolean)>, default: undefined }, editorTrigger: { type: String as PropType, default: TableEditorTrigger.manual }, editorMode: { type: String as PropType, default: TableEditorMode.cell }, editorCloseTrigger: { type: String as PropType, default: TableEditorCloseTrigger.manual }, editRender: { type: Object }, rowEditorClosedByEnter: { type: Function as PropType<(context: RowContext) => ReturnPromise> }, rowEditorClosedByCancel: { type: Function as PropType<(context: RowContext) => ReturnPromise> }, editorConfirm: { type: [String, Function] as PropType string)> }, editorConfirmPosition: { type: [String, Function] as PropType PopconfirmPlacement)> }, editorCondition: { type: Function as PropType<(context: RowContext) => ReturnPromise> }, editorEnterText: { type: [String, Function] as PropType string)> }, editorCancelText: { type: [String, Function] as PropType string)> } }; export const OioColumnControlProps = { type: { type: String }, field: { type: String }, invisibleContent: { type: [Boolean, Function] as PropType boolean)>, default: undefined }, sortable: { type: Boolean, default: undefined } }; export const OioColumnRenderFunctionProps = { renderGroupCellSlot: { type: Function as PropType }, renderDefaultSlot: { type: Function as PropType }, renderEditSlot: { type: Function as PropType }, renderContentSlot: { type: Function as PropType }, renderHeaderSlot: { type: Function as PropType }, dynamicRenderDefaultSlot: { type: Function as PropType<(context: RowContext) => CellRenderFunction> } }; export const OioColumnProps = { ...OioColumnAppearanceProps, ...OioColumnEditorProps, ...OioColumnControlProps, ...OioColumnRenderFunctionProps, ...OioComponentData };