checkbox.d.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import type { ExtractPropTypes } from 'vue';
  2. import type Checkbox from './checkbox.vue';
  3. export declare type CheckboxValueType = string | number | boolean;
  4. export declare const checkboxProps: {
  5. /**
  6. * @description binding value
  7. */
  8. modelValue: {
  9. type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
  10. default: undefined;
  11. };
  12. /**
  13. * @description value of the Checkbox when used inside a `checkbox-group`
  14. */
  15. label: {
  16. type: (BooleanConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
  17. };
  18. /**
  19. * @description Set indeterminate state, only responsible for style control
  20. */
  21. indeterminate: BooleanConstructor;
  22. /**
  23. * @description whether the Checkbox is disabled
  24. */
  25. disabled: BooleanConstructor;
  26. /**
  27. * @description if the Checkbox is checked
  28. */
  29. checked: BooleanConstructor;
  30. /**
  31. * @description native 'name' attribute
  32. */
  33. name: {
  34. type: StringConstructor;
  35. default: undefined;
  36. };
  37. /**
  38. * @description value of the Checkbox if it's checked
  39. */
  40. trueLabel: {
  41. type: (StringConstructor | NumberConstructor)[];
  42. default: undefined;
  43. };
  44. /**
  45. * @description value of the Checkbox if it's not checked
  46. */
  47. falseLabel: {
  48. type: (StringConstructor | NumberConstructor)[];
  49. default: undefined;
  50. };
  51. /**
  52. * @description input id
  53. */
  54. id: {
  55. type: StringConstructor;
  56. default: undefined;
  57. };
  58. /**
  59. * @description same as [aria-controls](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls), takes effect when `indeterminate` is `true`
  60. */
  61. controls: {
  62. type: StringConstructor;
  63. default: undefined;
  64. };
  65. /**
  66. * @description whether to add a border around Checkbox
  67. */
  68. border: BooleanConstructor;
  69. /**
  70. * @description size of the Checkbox
  71. */
  72. size: {
  73. readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
  74. readonly required: false;
  75. readonly validator: ((val: unknown) => boolean) | undefined;
  76. __epPropKey: true;
  77. };
  78. /**
  79. * @description input tabindex
  80. */
  81. tabindex: (StringConstructor | NumberConstructor)[];
  82. /**
  83. * @description whether to trigger form validation
  84. */
  85. validateEvent: {
  86. type: BooleanConstructor;
  87. default: boolean;
  88. };
  89. };
  90. export declare const checkboxEmits: {
  91. "update:modelValue": (val: CheckboxValueType) => boolean;
  92. change: (val: CheckboxValueType) => boolean;
  93. };
  94. export declare type CheckboxProps = ExtractPropTypes<typeof checkboxProps>;
  95. export declare type CheckboxEmits = typeof checkboxEmits;
  96. export declare type CheckboxInstance = InstanceType<typeof Checkbox>;