import { type PropType } from 'vue' import type { FieldTextAlign, FieldClearTrigger, FieldFormatTrigger } from './types' import { numericProp, unknownProp, makeStringProp, makeNumericProp, truthProp } from '../../libs/utils' export const fieldSharedProps = { id: String, name: String, leftIcon: String, rightIcon: String, autofocus: Boolean, clearable: Boolean, maxlength: { type: Number, default: 140 }, formatter: Function as PropType<(value: string) => string>, clearIcon: makeStringProp('close-circle-fill'), modelValue: makeNumericProp(''), inputAlign: String as PropType, placeholder: String, autocomplete: String, autocapitalize: String, autocorrect: String, errorMessage: String, enterkeyhint: String, clearTrigger: makeStringProp('focus'), formatTrigger: makeStringProp('onInput'), spellcheck: { type: Boolean, default: null }, error: { type: Boolean, default: null }, disabled: { type: Boolean, default: null }, readonly: { type: Boolean, default: null } } type CellSize = 'normal' | 'large' type CellArrowDirection = 'up' | 'down' | 'left' | 'right' export const cellSharedProps = { icon: String, size: String as PropType, title: numericProp, value: numericProp, label: numericProp, center: Boolean, isLink: Boolean, border: truthProp, iconPrefix: String, valueClass: unknownProp, labelClass: unknownProp, titleClass: unknownProp, titleStyle: null as unknown as PropType, arrowDirection: String as PropType, required: { type: [Boolean, String] as PropType, default: null }, clickable: { type: Boolean as PropType, default: null } }