tdesign-vue
Version:
127 lines (123 loc) • 4.83 kB
JavaScript
/**
* tdesign v1.14.1
* (c) 2025 tdesign
* @license MIT
*/
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, computed } from '@vue/composition-api';
import { usePrefixClass } from '../../hooks/useConfig.js';
import { Button } from '../../button/index.js';
import { useConfig } from '../../config-provider/useConfig.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-d2f11e9e.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-05dc6583.js';
import 'dayjs';
import '../../_chunks/dep-62386ed0.js';
import '../../config-provider/type.js';
import '../../_common/js/global-config/t.js';
import '@babel/runtime/helpers/slicedToArray';
import '../../button/button.js';
import '../../loading/index.js';
import '../../loading/directive.js';
import '../../loading/plugin.js';
import 'vue';
import '../../loading/loading.js';
import '../../loading/icon/gradient.js';
import '../../_common/js/loading/circle-adapter.js';
import '../../_common/js/utils/setStyle.js';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '../../config-provider/config-receiver.js';
import '../../utils/mixins.js';
import '../../utils/dom.js';
import 'raf';
import '../../utils/easing.js';
import '../../utils/render-tnode.js';
import '@babel/runtime/helpers/readOnlyError';
import '../../utils/transfer-dom.js';
import '../../loading/props.js';
import '../../config.js';
import '../../utils/withInstall.js';
import './style/css.js';
import '../../loading/type.js';
import '../../button/props.js';
import '../../utils/ripple.js';
import '../../button/type.js';
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var TDateFooter = defineComponent({
name: "TDatePickerTable",
props: {
enableTimePicker: Boolean,
presetsPlacement: String,
presets: Object,
selectedValue: [Date, String, Number],
onPresetClick: Function,
onConfirmClick: Function
},
setup: function setup(props) {
var COMPONENT_NAME = usePrefixClass("date-picker__footer");
var presetsClass = usePrefixClass("date-picker__presets");
var _useConfig = useConfig("datePicker"),
t = _useConfig.t,
global = _useConfig.global;
var footerClass = computed(function () {
return [COMPONENT_NAME.value, "".concat(COMPONENT_NAME.value, "--").concat(props.presetsPlacement)];
});
return {
footerClass: footerClass,
presetsClass: presetsClass,
global: global,
t: t
};
},
render: function render() {
var _this = this;
var h = arguments[0];
var footerClass = this.footerClass,
presetsClass = this.presetsClass,
global = this.global,
t = this.t;
return h("div", {
"class": footerClass
}, [h("div", {
"class": presetsClass
}, [this.presets && Object.keys(this.presets).map(function (key) {
return h(Button, {
"key": key,
"attrs": {
"size": "small",
"variant": "text"
},
"on": {
"click": function click(e) {
var _this$onPresetClick;
return (_this$onPresetClick = _this.onPresetClick) === null || _this$onPresetClick === void 0 ? void 0 : _this$onPresetClick.call(_this, _this.presets[key], {
e: e,
preset: _defineProperty({}, key, _this.presets[key])
});
}
}
}, [key]);
})]), this.enableTimePicker && h(Button, {
"props": _objectSpread({}, {
size: "small",
theme: "primary",
disabled: !this.selectedValue,
onClick: function onClick(e) {
var _this$onConfirmClick;
return (_this$onConfirmClick = _this.onConfirmClick) === null || _this$onConfirmClick === void 0 ? void 0 : _this$onConfirmClick.call(_this, {
e: e
});
}
})
}, [t(global.confirm)])]);
}
});
export { TDateFooter as default };
//# sourceMappingURL=Footer.js.map