calendar.mjs 670 B

123456789101112131415161718192021
  1. import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  2. import { isArray, isDate } from '@vue/shared';
  3. import { UPDATE_MODEL_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
  4. const isValidRange = (range) => isArray(range) && range.length === 2 && range.every((item) => isDate(item));
  5. const calendarProps = buildProps({
  6. modelValue: {
  7. type: Date
  8. },
  9. range: {
  10. type: definePropType(Array),
  11. validator: isValidRange
  12. }
  13. });
  14. const calendarEmits = {
  15. [UPDATE_MODEL_EVENT]: (value) => isDate(value),
  16. [INPUT_EVENT]: (value) => isDate(value)
  17. };
  18. export { calendarEmits, calendarProps };
  19. //# sourceMappingURL=calendar.mjs.map