interface.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import PropTypes from '../_util/vue-types';
  3. import { booleanType, functionType, stringType, arrayType } from '../_util/type';
  4. export const abstractCheckboxGroupProps = () => {
  5. return {
  6. name: String,
  7. prefixCls: String,
  8. options: arrayType([]),
  9. disabled: Boolean,
  10. id: String
  11. };
  12. };
  13. export const checkboxGroupProps = () => {
  14. return _extends(_extends({}, abstractCheckboxGroupProps()), {
  15. defaultValue: arrayType(),
  16. value: arrayType(),
  17. onChange: functionType(),
  18. 'onUpdate:value': functionType()
  19. });
  20. };
  21. export const abstractCheckboxProps = () => {
  22. return {
  23. prefixCls: String,
  24. defaultChecked: booleanType(),
  25. checked: booleanType(),
  26. disabled: booleanType(),
  27. isGroup: booleanType(),
  28. value: PropTypes.any,
  29. name: String,
  30. id: String,
  31. indeterminate: booleanType(),
  32. type: stringType('checkbox'),
  33. autofocus: booleanType(),
  34. onChange: functionType(),
  35. 'onUpdate:checked': functionType(),
  36. onClick: functionType(),
  37. skipGroup: booleanType(false)
  38. };
  39. };
  40. export const checkboxProps = () => {
  41. return _extends(_extends({}, abstractCheckboxProps()), {
  42. indeterminate: booleanType(false)
  43. });
  44. };
  45. export const CheckboxGroupContextKey = Symbol('CheckboxGroupContext');