UNPKG

snowy-designer

Version:

基于Epic-Designer-Pro版本的设计器,可视化开发页面表单

646 lines (645 loc) 28.9 kB
import { ComponentSchema, FormDataModel } from '../../../types/src/index'; import { FormInst } from 'naive-ui'; import { PropType, Ref } from 'vue'; import { NForm } from 'naive-ui/lib/form'; interface FormInstance extends InstanceType<typeof NForm> { clearValidate?: () => void; getData?: () => FormDataModel; setData?: (data: FormDataModel) => void; } /** * 获取表单数据 */ declare function getData(): FormDataModel; /** * 设置表单数据 * @param data */ declare function setData(data: FormDataModel): void; /** * 校验表单数据 */ declare function validate(): ReturnType<FormInst['validate']> | undefined; /** * 清除的表单验证信息 */ declare function clearValidate(): void | undefined; declare function __VLS_template(): { attrs: Partial<{}>; slots: { default?(_: {}): any; 'edit-node'?(_: {}): any; node?(_: { componentSchema: ComponentSchema; }): any; }; refs: { form: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{ readonly inline: BooleanConstructor; readonly labelWidth: PropType<number | string>; readonly labelAlign: PropType<import('naive-ui/lib/form/src/interface').LabelAlign>; readonly labelPlacement: { readonly type: PropType<import('naive-ui/lib/form/src/interface').LabelPlacement>; readonly default: "top"; }; readonly model: { readonly type: PropType<Record<string, any>>; readonly default: () => void; }; readonly rules: PropType<import('naive-ui/lib/form').FormRules>; readonly disabled: BooleanConstructor; readonly size: PropType<import('naive-ui/lib/form/src/interface').Size>; readonly showRequireMark: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly requireMarkPlacement: PropType<"left" | "right" | "right-hanging">; readonly showFeedback: { readonly type: BooleanConstructor; readonly default: true; }; readonly onSubmit: { readonly type: PropType<(e: Event) => void>; readonly default: (e: Event) => void; }; readonly showLabel: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly validateMessages: PropType<Partial<import('naive-ui/lib/form/src/interface').FormValidateMessages>>; readonly theme: PropType<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>; readonly themeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; readonly builtinThemeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; }>> & Readonly<{}>, import('naive-ui/lib/form').FormInst & { mergedClsPrefix: import('vue').Ref<string, string>; }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, { readonly inline: boolean; readonly disabled: boolean; readonly onSubmit: (e: Event) => void; readonly labelPlacement: import('naive-ui/lib/form/src/interface').LabelPlacement; readonly model: Record<string, any>; readonly showRequireMark: boolean | undefined; readonly showFeedback: boolean; readonly showLabel: boolean | undefined; }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, { P: {}; B: {}; D: {}; C: {}; M: {}; Defaults: {}; }, Readonly<import('vue').ExtractPropTypes<{ readonly inline: BooleanConstructor; readonly labelWidth: PropType<number | string>; readonly labelAlign: PropType<import('naive-ui/lib/form/src/interface').LabelAlign>; readonly labelPlacement: { readonly type: PropType<import('naive-ui/lib/form/src/interface').LabelPlacement>; readonly default: "top"; }; readonly model: { readonly type: PropType<Record<string, any>>; readonly default: () => void; }; readonly rules: PropType<import('naive-ui/lib/form').FormRules>; readonly disabled: BooleanConstructor; readonly size: PropType<import('naive-ui/lib/form/src/interface').Size>; readonly showRequireMark: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly requireMarkPlacement: PropType<"left" | "right" | "right-hanging">; readonly showFeedback: { readonly type: BooleanConstructor; readonly default: true; }; readonly onSubmit: { readonly type: PropType<(e: Event) => void>; readonly default: (e: Event) => void; }; readonly showLabel: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly validateMessages: PropType<Partial<import('naive-ui/lib/form/src/interface').FormValidateMessages>>; readonly theme: PropType<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>; readonly themeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; readonly builtinThemeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; }>> & Readonly<{}>, import('naive-ui/lib/form').FormInst & { mergedClsPrefix: import('vue').Ref<string, string>; }, {}, {}, {}, { readonly inline: boolean; readonly disabled: boolean; readonly onSubmit: (e: Event) => void; readonly labelPlacement: import('naive-ui/lib/form/src/interface').LabelPlacement; readonly model: Record<string, any>; readonly showRequireMark: boolean | undefined; readonly showFeedback: boolean; readonly showLabel: boolean | undefined; }> | null; }; rootEl: any; }; type __VLS_TemplateResult = ReturnType<typeof __VLS_template>; declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{ componentSchema: { default: () => {}; require: boolean; type: PropType<ComponentSchema>; }; }>, { clearValidate: typeof clearValidate; form: Ref<FormInstance | null, FormInstance | null>; getData: typeof getData; setData: typeof setData; validate: typeof validate; }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{ componentSchema: { default: () => {}; require: boolean; type: PropType<ComponentSchema>; }; }>> & Readonly<{}>, { componentSchema: ComponentSchema; }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, { form: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{ readonly inline: BooleanConstructor; readonly labelWidth: PropType<number | string>; readonly labelAlign: PropType<import('naive-ui/lib/form/src/interface').LabelAlign>; readonly labelPlacement: { readonly type: PropType<import('naive-ui/lib/form/src/interface').LabelPlacement>; readonly default: "top"; }; readonly model: { readonly type: PropType<Record<string, any>>; readonly default: () => void; }; readonly rules: PropType<import('naive-ui/lib/form').FormRules>; readonly disabled: BooleanConstructor; readonly size: PropType<import('naive-ui/lib/form/src/interface').Size>; readonly showRequireMark: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly requireMarkPlacement: PropType<"left" | "right" | "right-hanging">; readonly showFeedback: { readonly type: BooleanConstructor; readonly default: true; }; readonly onSubmit: { readonly type: PropType<(e: Event) => void>; readonly default: (e: Event) => void; }; readonly showLabel: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly validateMessages: PropType<Partial<import('naive-ui/lib/form/src/interface').FormValidateMessages>>; readonly theme: PropType<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>; readonly themeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; readonly builtinThemeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; }>> & Readonly<{}>, import('naive-ui/lib/form').FormInst & { mergedClsPrefix: import('vue').Ref<string, string>; }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, { readonly inline: boolean; readonly disabled: boolean; readonly onSubmit: (e: Event) => void; readonly labelPlacement: import('naive-ui/lib/form/src/interface').LabelPlacement; readonly model: Record<string, any>; readonly showRequireMark: boolean | undefined; readonly showFeedback: boolean; readonly showLabel: boolean | undefined; }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, { P: {}; B: {}; D: {}; C: {}; M: {}; Defaults: {}; }, Readonly<import('vue').ExtractPropTypes<{ readonly inline: BooleanConstructor; readonly labelWidth: PropType<number | string>; readonly labelAlign: PropType<import('naive-ui/lib/form/src/interface').LabelAlign>; readonly labelPlacement: { readonly type: PropType<import('naive-ui/lib/form/src/interface').LabelPlacement>; readonly default: "top"; }; readonly model: { readonly type: PropType<Record<string, any>>; readonly default: () => void; }; readonly rules: PropType<import('naive-ui/lib/form').FormRules>; readonly disabled: BooleanConstructor; readonly size: PropType<import('naive-ui/lib/form/src/interface').Size>; readonly showRequireMark: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly requireMarkPlacement: PropType<"left" | "right" | "right-hanging">; readonly showFeedback: { readonly type: BooleanConstructor; readonly default: true; }; readonly onSubmit: { readonly type: PropType<(e: Event) => void>; readonly default: (e: Event) => void; }; readonly showLabel: { readonly type: PropType<boolean | undefined>; readonly default: undefined; }; readonly validateMessages: PropType<Partial<import('naive-ui/lib/form/src/interface').FormValidateMessages>>; readonly theme: PropType<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>; readonly themeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; readonly builtinThemeOverrides: PropType<import('naive-ui/lib/_mixins/use-theme').ExtractThemeOverrides<import('naive-ui/lib/_mixins').Theme<"Form", { blankHeightSmall: string; blankHeightMedium: string; blankHeightLarge: string; lineHeight: string; labelTextColor: string; asteriskColor: string; feedbackTextColorError: string; feedbackTextColorWarning: string; feedbackTextColor: string; feedbackPadding: string; feedbackHeightSmall: string; feedbackHeightMedium: string; feedbackHeightLarge: string; feedbackFontSizeSmall: string; feedbackFontSizeMedium: string; feedbackFontSizeLarge: string; labelFontSizeLeftSmall: string; labelFontSizeLeftMedium: string; labelFontSizeLeftLarge: string; labelFontSizeTopSmall: string; labelFontSizeTopMedium: string; labelFontSizeTopLarge: string; labelHeightSmall: string; labelHeightMedium: string; labelHeightLarge: string; labelPaddingVertical: string; labelPaddingHorizontal: string; labelTextAlignVertical: string; labelTextAlignHorizontal: string; labelFontWeight: string; }, any>>>; }>> & Readonly<{}>, import('naive-ui/lib/form').FormInst & { mergedClsPrefix: import('vue').Ref<string, string>; }, {}, {}, {}, { readonly inline: boolean; readonly disabled: boolean; readonly onSubmit: (e: Event) => void; readonly labelPlacement: import('naive-ui/lib/form/src/interface').LabelPlacement; readonly model: Record<string, any>; readonly showRequireMark: boolean | undefined; readonly showFeedback: boolean; readonly showLabel: boolean | undefined; }> | null; }, any>; declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>; export default _default; type __VLS_WithTemplateSlots<T, S> = T & { new (): { $slots: S; }; };