date-table.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  2. require("../../../_virtual/_rolldown/runtime.js");
  3. const require_runtime$1 = require("../../../utils/vue/props/runtime.js");
  4. const require_utils = require("../../time-picker/src/utils.js");
  5. let _vue_shared = require("@vue/shared");
  6. //#region ../../packages/components/calendar/src/date-table.ts
  7. const getPrevMonthLastDays = (date, count) => {
  8. const lastDay = date.subtract(1, "month").endOf("month").date();
  9. return require_utils.rangeArr(count).map((_, index) => lastDay - (count - index - 1));
  10. };
  11. const getMonthDays = (date) => {
  12. return require_utils.rangeArr(date.daysInMonth()).map((_, index) => index + 1);
  13. };
  14. const toNestedArr = (days) => require_utils.rangeArr(days.length / 7).map((index) => {
  15. const start = index * 7;
  16. return days.slice(start, start + 7);
  17. });
  18. /**
  19. * @deprecated Removed after 3.0.0, Use `DateTableProps` instead.
  20. */
  21. const dateTableProps = require_runtime$1.buildProps({
  22. selectedDay: { type: require_runtime$1.definePropType(Object) },
  23. range: { type: require_runtime$1.definePropType(Array) },
  24. date: {
  25. type: require_runtime$1.definePropType(Object),
  26. required: true
  27. },
  28. hideHeader: { type: Boolean }
  29. });
  30. const dateTableEmits = { pick: (value) => (0, _vue_shared.isObject)(value) };
  31. //#endregion
  32. exports.dateTableEmits = dateTableEmits;
  33. exports.dateTableProps = dateTableProps;
  34. exports.getMonthDays = getMonthDays;
  35. exports.getPrevMonthLastDays = getPrevMonthLastDays;
  36. exports.toNestedArr = toNestedArr;
  37. //# sourceMappingURL=date-table.js.map