| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- import { componentSizes } from "../../../constants/size.mjs";
- import { isArray, isBoolean, isString } from "../../../utils/types.mjs";
- import { buildProps, definePropType } from "../../../utils/vue/props/runtime.mjs";
- //#region ../../packages/components/form/src/form.ts
- /**
- * @deprecated Removed after 3.0.0, Use `FormMetaProps` instead.
- */
- const formMetaProps = buildProps({
- /**
- * @description Control the size of components in this form.
- */
- size: {
- type: String,
- values: componentSizes
- },
- /**
- * @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component.
- */
- disabled: Boolean
- });
- /**
- * @deprecated Removed after 3.0.0, Use `FormProps` instead.
- */
- const formProps = buildProps({
- ...formMetaProps,
- /**
- * @description Data of form component.
- */
- model: Object,
- /**
- * @description Validation rules of form.
- */
- rules: { type: definePropType(Object) },
- /**
- * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required.
- */
- labelPosition: {
- type: String,
- values: [
- "left",
- "right",
- "top"
- ],
- default: "right"
- },
- /**
- * @description Position of asterisk.
- */
- requireAsteriskPosition: {
- type: String,
- values: ["left", "right"],
- default: "left"
- },
- /**
- * @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported.
- */
- labelWidth: {
- type: [String, Number],
- default: ""
- },
- /**
- * @description Suffix of the label.
- */
- labelSuffix: {
- type: String,
- default: ""
- },
- /**
- * @description Whether the form is inline.
- */
- inline: Boolean,
- /**
- * @description Whether to display the error message inline with the form item.
- */
- inlineMessage: Boolean,
- /**
- * @description Whether to display an icon indicating the validation result.
- */
- statusIcon: Boolean,
- /**
- * @description Whether to show the error message.
- */
- showMessage: {
- type: Boolean,
- default: true
- },
- /**
- * @description Whether to trigger validation when the `rules` prop is changed.
- */
- validateOnRuleChange: {
- type: Boolean,
- default: true
- },
- /**
- * @description Whether to hide required fields should have a red asterisk (star) beside their labels.
- */
- hideRequiredAsterisk: Boolean,
- /**
- * @description When validation fails, scroll to the first error form entry.
- */
- scrollToError: Boolean,
- /**
- * @description When validation fails, it scrolls to the first error item based on the scrollIntoView option.
- */
- scrollIntoViewOptions: {
- type: definePropType([Object, Boolean]),
- default: true
- }
- });
- const formEmits = { validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message) };
- //#endregion
- export { formEmits, formMetaProps, formProps };
- //# sourceMappingURL=form.mjs.map
|