UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

72 lines (68 loc) 2.28 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import 'vue'; import { useConfig } from '../../config-provider/useConfig.js'; import { getWeeks, getQuarters, getMonths, getYears, flagActive } from '../../_common/js/date-picker/utils.js'; import 'lodash/isFunction'; import 'lodash/cloneDeep'; import 'lodash/isString'; import '../../config-provider/context.js'; import 'lodash/mergeWith'; import 'lodash/merge'; import '../../_common/js/global-config/default-config.js'; import '../../_common/js/global-config/locale/en_US.js'; import '../../_chunks/dep-3a1cce9f.js'; import 'lodash/isArray'; import '@babel/runtime/helpers/slicedToArray'; import '@babel/runtime/helpers/objectDestructuringEmpty'; import '@babel/runtime/helpers/extends'; import '@babel/runtime/helpers/defineProperty'; import 'dayjs'; import '../../_chunks/dep-78e63d0d.js'; import 'lodash/chunk'; function useTableData(props) { var _props$firstDayOfWeek; var _useConfig = useConfig("datePicker"), globalConfig = _useConfig.globalConfig; var options = { minDate: props.minDate, maxDate: props.maxDate, disableDate: props.disableDate, firstDayOfWeek: (_props$firstDayOfWeek = props.firstDayOfWeek) !== null && _props$firstDayOfWeek !== void 0 ? _props$firstDayOfWeek : globalConfig.value.firstDayOfWeek, monthLocal: globalConfig.value.months, quarterLocal: globalConfig.value.quarters, showWeekOfYear: props.mode === "week", dayjsLocale: globalConfig.value.dayjsLocale }; var data = []; if (props.mode === "date") { data = getWeeks({ year: props.year, month: props.month }, options); } else if (props.mode === "week") { data = getWeeks({ year: props.year, month: props.month }, options); } else if (props.mode === "quarter") { data = getQuarters(props.year, options); } else if (props.mode === "month") { data = getMonths(props.year, options); } else if (props.mode === "year") { data = getYears(props.year, options); } return flagActive(data, { start: props.start, end: props.end, hoverStart: props.hoverStart, hoverEnd: props.hoverEnd, type: props.mode, isRange: props.isRange }); } export { useTableData as default }; //# sourceMappingURL=useTableData.js.map