calendar.mjs 744 B

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