tdesign-vue
Version:
75 lines (71 loc) • 2.47 kB
JavaScript
/**
* tdesign v1.14.1
* (c) 2025 tdesign
* @license MIT
*/
import '@vue/composition-api';
import { useConfig } from '../../config-provider/useConfig.js';
import { getWeeks, getQuarters, getMonths, getYears, flagActive } from '../../_common/js/date-picker/utils.js';
import '../../config-provider/context.js';
import 'lodash-es';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../_chunks/dep-ba613a02.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-fdb1b253.js';
import 'dayjs';
import '../../_common/js/global-config/t.js';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/objectDestructuringEmpty';
import '@babel/runtime/helpers/extends';
import '@babel/runtime/helpers/defineProperty';
import '../../_chunks/dep-84c94da7.js';
import '../../_chunks/dep-655d809c.js';
import '../../_common/js/date-picker/format.js';
import '../../_common/js/log/log.js';
function useTableData(props) {
var _props$firstDayOfWeek;
var _useConfig = useConfig("datePicker"),
global = _useConfig.global;
var options = {
minDate: props.minDate,
maxDate: props.maxDate,
disableDate: props.disableDate,
firstDayOfWeek: (_props$firstDayOfWeek = props.firstDayOfWeek) !== null && _props$firstDayOfWeek !== void 0 ? _props$firstDayOfWeek : global.value.firstDayOfWeek,
monthLocal: global.value.months,
quarterLocal: global.value.quarters,
showWeekOfYear: props.mode === "week",
dayjsLocale: global.value.dayjsLocale,
cancelRangeSelectLimit: props.cancelRangeSelectLimit
};
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,
value: props.value,
multiple: props.multiple
});
}
export { useTableData as default };
//# sourceMappingURL=useTableData.js.map