tdesign-vue
Version:
199 lines (195 loc) • 7.06 kB
JavaScript
/**
* tdesign v1.12.1
* (c) 2025 tdesign
* @license MIT
*/
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, computed } from '@vue/composition-api';
import { isObject } from 'lodash-es';
import { ChevronLeftIcon, RoundIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon } from 'tdesign-icons-vue';
import props from './pagination-mini-props.js';
import { usePrefixClass } from '../hooks/useConfig.js';
import { useGlobalIcon } from '../hooks/useGlobalIcon.js';
import { Button } from '../button/index.js';
import '../config-provider/useConfig.js';
import '../config-provider/context.js';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '../_chunks/dep-c44a474d.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-d639fbd7.js';
import 'dayjs';
import '../_chunks/dep-3c66615e.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/index.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 _PaginationMini = defineComponent({
name: "TPaginationMini",
props: _objectSpread({}, props),
setup: function setup(props2, _ref) {
var emit = _ref.emit;
var COMPONENT_NAME = usePrefixClass("pagination-mini");
var _useGlobalIcon = useGlobalIcon({
ChevronLeftIcon: ChevronLeftIcon,
RoundIcon: RoundIcon,
ChevronRightIcon: ChevronRightIcon,
ChevronUpIcon: ChevronUpIcon,
ChevronDownIcon: ChevronDownIcon
}),
ChevronLeftIcon$1 = _useGlobalIcon.ChevronLeftIcon,
RoundIcon$1 = _useGlobalIcon.RoundIcon,
ChevronRightIcon$1 = _useGlobalIcon.ChevronRightIcon,
ChevronUpIcon$1 = _useGlobalIcon.ChevronUpIcon,
ChevronDownIcon$1 = _useGlobalIcon.ChevronDownIcon;
var titleConfig = computed(function () {
if (isObject(props2.tips)) return props2.tips;
if (props2.tips === true) return {
prev: "\u4E0A\u4E00\u9875",
current: "\u5F53\u524D",
next: "\u4E0B\u4E00\u9875"
};
return {};
});
var disabledConfig = computed(function () {
if (isObject(props2.disabled)) return props2.disabled;
if (props2.disabled === true) return {
prev: true,
current: true,
next: true
};
return {
prev: false,
current: false,
next: false
};
});
function handleChange(context) {
var _props2$onChange;
emit("change", context);
(_props2$onChange = props2.onChange) === null || _props2$onChange === void 0 || _props2$onChange.call(props2, context);
}
return {
COMPONENT_NAME: COMPONENT_NAME,
ChevronLeftIcon: ChevronLeftIcon$1,
RoundIcon: RoundIcon$1,
ChevronRightIcon: ChevronRightIcon$1,
ChevronUpIcon: ChevronUpIcon$1,
ChevronDownIcon: ChevronDownIcon$1,
titleConfig: titleConfig,
disabledConfig: disabledConfig,
handleChange: handleChange
};
},
render: function render() {
var h = arguments[0];
var COMPONENT_NAME = this.COMPONENT_NAME,
ChevronLeftIcon = this.ChevronLeftIcon,
RoundIcon = this.RoundIcon,
ChevronRightIcon = this.ChevronRightIcon,
ChevronUpIcon = this.ChevronUpIcon,
ChevronDownIcon = this.ChevronDownIcon,
titleConfig = this.titleConfig,
disabledConfig = this.disabledConfig,
handleChange = this.handleChange;
var jumperClass = [COMPONENT_NAME, _defineProperty({}, "".concat(COMPONENT_NAME, "--outline"), this.variant === "outline")];
return h("div", {
"class": jumperClass
}, [h(Button, {
"attrs": {
"title": titleConfig.prev,
"variant": this.variant,
"size": this.size,
"shape": "square",
"icon": this.layout === "horizontal" ? function () {
return h(ChevronLeftIcon);
} : function () {
return h(ChevronUpIcon);
},
"disabled": disabledConfig.prev
},
"on": {
"click": function click(e) {
return handleChange({
e: e,
trigger: "prev"
});
}
},
"class": "".concat(COMPONENT_NAME, "__prev")
}), this.showCurrent && h(Button, {
"attrs": {
"title": titleConfig.current,
"variant": this.variant,
"size": this.size,
"shape": "square",
"icon": function icon() {
return h(RoundIcon);
},
"disabled": disabledConfig.current
},
"on": {
"click": function click(e) {
return handleChange({
e: e,
trigger: "current"
});
}
},
"class": "".concat(COMPONENT_NAME, "__current")
}), h(Button, {
"attrs": {
"title": titleConfig.next,
"variant": this.variant,
"size": this.size,
"shape": "square",
"icon": this.layout === "horizontal" ? function () {
return h(ChevronRightIcon);
} : function () {
return h(ChevronDownIcon);
},
"disabled": disabledConfig.next
},
"on": {
"click": function click(e) {
return handleChange({
e: e,
trigger: "next"
});
}
},
"class": "".concat(COMPONENT_NAME, "__next")
})]);
}
});
export { _PaginationMini as default };
//# sourceMappingURL=pagination-mini.js.map