checkbox-group.mjs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  2. import { useSizeProp } from '../../../hooks/use-size/index.mjs';
  3. import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
  4. import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
  5. import { isArray } from '@vue/shared';
  6. const checkboxGroupProps = buildProps({
  7. modelValue: {
  8. type: definePropType(Array),
  9. default: () => []
  10. },
  11. disabled: {
  12. type: Boolean,
  13. default: void 0
  14. },
  15. min: Number,
  16. max: Number,
  17. size: useSizeProp,
  18. fill: String,
  19. textColor: String,
  20. tag: {
  21. type: String,
  22. default: "div"
  23. },
  24. validateEvent: {
  25. type: Boolean,
  26. default: true
  27. },
  28. options: {
  29. type: definePropType(Array)
  30. },
  31. props: {
  32. type: definePropType(Object),
  33. default: () => checkboxDefaultProps
  34. },
  35. type: {
  36. type: String,
  37. values: ["checkbox", "button"],
  38. default: "checkbox"
  39. },
  40. ...useAriaProps(["ariaLabel"])
  41. });
  42. const checkboxGroupEmits = {
  43. [UPDATE_MODEL_EVENT]: (val) => isArray(val),
  44. change: (val) => isArray(val)
  45. };
  46. const checkboxDefaultProps = {
  47. label: "label",
  48. value: "value",
  49. disabled: "disabled"
  50. };
  51. export { checkboxDefaultProps, checkboxGroupEmits, checkboxGroupProps };
  52. //# sourceMappingURL=checkbox-group.mjs.map