form.mjs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import '../../../constants/index.mjs';
  2. import '../../../utils/index.mjs';
  3. import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  4. import { componentSizes } from '../../../constants/size.mjs';
  5. import { isArray, isString } from '@vue/shared';
  6. import { isBoolean } from '@vueuse/core';
  7. const formProps = buildProps({
  8. model: Object,
  9. rules: {
  10. type: definePropType(Object)
  11. },
  12. labelPosition: {
  13. type: String,
  14. values: ["left", "right", "top"],
  15. default: "right"
  16. },
  17. requireAsteriskPosition: {
  18. type: String,
  19. values: ["left", "right"],
  20. default: "left"
  21. },
  22. labelWidth: {
  23. type: [String, Number],
  24. default: ""
  25. },
  26. labelSuffix: {
  27. type: String,
  28. default: ""
  29. },
  30. inline: Boolean,
  31. inlineMessage: Boolean,
  32. statusIcon: Boolean,
  33. showMessage: {
  34. type: Boolean,
  35. default: true
  36. },
  37. size: {
  38. type: String,
  39. values: componentSizes
  40. },
  41. disabled: Boolean,
  42. validateOnRuleChange: {
  43. type: Boolean,
  44. default: true
  45. },
  46. hideRequiredAsterisk: {
  47. type: Boolean,
  48. default: false
  49. },
  50. scrollToError: Boolean
  51. });
  52. const formEmits = {
  53. validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)
  54. };
  55. export { formEmits, formProps };
  56. //# sourceMappingURL=form.mjs.map