/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var vue = require('vue');
var isObject = require('lodash/isObject');
var iconsVueNext = require('@ldesign/icons-vue-next');
var hooks_useConfig = require('../hooks/useConfig.js');
var hooks_useGlobalIcon = require('../hooks/useGlobalIcon.js');
var button_index = require('../button/index.js');
var pagination_paginationMiniProps = require('./pagination-mini-props.js');
require('../config-provider/useConfig.js');
require('lodash/cloneDeep');
require('lodash/isFunction');
require('lodash/isString');
require('../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('lodash/isArray');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('../_chunks/dep-f4db2590.js');
require('dayjs');
require('../utils/withInstall.js');
require('../button/button.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../loading/index.js');
require('../loading/directive.js');
require('../loading/plugin.js');
require('../utils/dom.js');
require('../utils/easing.js');
require('../loading/loading.js');
require('@babel/runtime/helpers/slicedToArray');
require('../utils/render-tnode.js');
require('lodash/isEmpty');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../hooks/useTeleport.js');
require('../loading/props.js');
require('../loading/icon/gradient.js');
require('../_common/js/loading/circle-adapter.js');
require('../_common/js/utils/set-style.js');
require('../_common/js/utils/helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('lodash/isNull');
require('lodash/isUndefined');
require('lodash/isNumber');
require('../hooks/useRipple.js');
require('../utils/set-style.js');
require('../hooks/useKeepAnimation.js');
require('../form/hooks.js');
require('../hooks/tnode.js');
require('../button/props.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var isObject__default = /*#__PURE__*/_interopDefaultLegacy(isObject);

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var _PaginationMini = vue.defineComponent({
  name: "TPaginationMini",
  props: _objectSpread({}, pagination_paginationMiniProps["default"]),
  setup: function setup(props2) {
    var COMPONENT_NAME = hooks_useConfig.usePrefixClass("pagination-mini");
    var _useGlobalIcon = hooks_useGlobalIcon.useGlobalIcon({
        ChevronLeftIcon: iconsVueNext.ChevronLeftIcon,
        RoundIcon: iconsVueNext.RoundIcon,
        ChevronRightIcon: iconsVueNext.ChevronRightIcon,
        ChevronUpIcon: iconsVueNext.ChevronUpIcon,
        ChevronDownIcon: iconsVueNext.ChevronDownIcon
      }),
      ChevronLeftIcon = _useGlobalIcon.ChevronLeftIcon,
      RoundIcon = _useGlobalIcon.RoundIcon,
      ChevronRightIcon = _useGlobalIcon.ChevronRightIcon,
      ChevronUpIcon = _useGlobalIcon.ChevronUpIcon,
      ChevronDownIcon = _useGlobalIcon.ChevronDownIcon;
    var titleConfig = vue.computed(function () {
      if (isObject__default["default"](props2.tips)) return props2.tips;
      if (props2.tips === true) return {
        prev: "\u4E0A\u4E00\u9875",
        current: "\u5F53\u524D",
        next: "\u4E0B\u4E00\u9875"
      };
      return {};
    });
    var disabledConfig = vue.computed(function () {
      if (isObject__default["default"](props2.disabled)) return props2.disabled;
      if (props2.disabled === true) return {
        prev: true,
        current: true,
        next: true
      };
      return {
        prev: false,
        current: false,
        next: false
      };
    });
    return function () {
      var jumperClass = [COMPONENT_NAME.value, _defineProperty__default["default"]({}, "".concat(COMPONENT_NAME.value, "--outline"), props2.variant === "outline")];
      return vue.createVNode("div", {
        "class": jumperClass
      }, [vue.createVNode(button_index.Button, {
        "title": titleConfig.value.prev,
        "variant": props2.variant,
        "size": props2.size,
        "shape": "square",
        "onClick": function onClick(e) {
          var _props2$onChange;
          return (_props2$onChange = props2.onChange) === null || _props2$onChange === void 0 ? void 0 : _props2$onChange.call(props2, {
            e: e,
            trigger: "prev"
          });
        },
        "icon": props2.layout === "horizontal" ? function () {
          return vue.createVNode(ChevronLeftIcon, null, null);
        } : function () {
          return vue.createVNode(ChevronUpIcon, null, null);
        },
        "class": "".concat(COMPONENT_NAME.value, "__prev"),
        "disabled": disabledConfig.value.prev
      }, null), props2.showCurrent && vue.createVNode(button_index.Button, {
        "title": titleConfig.value.current,
        "variant": props2.variant,
        "size": props2.size,
        "shape": "square",
        "onClick": function onClick(e) {
          var _props2$onChange2;
          return (_props2$onChange2 = props2.onChange) === null || _props2$onChange2 === void 0 ? void 0 : _props2$onChange2.call(props2, {
            e: e,
            trigger: "current"
          });
        },
        "icon": function icon() {
          return vue.createVNode(RoundIcon, null, null);
        },
        "class": "".concat(COMPONENT_NAME.value, "__current"),
        "disabled": disabledConfig.value.current
      }, null), vue.createVNode(button_index.Button, {
        "title": titleConfig.value.next,
        "variant": props2.variant,
        "size": props2.size,
        "shape": "square",
        "onClick": function onClick(e) {
          var _props2$onChange3;
          return (_props2$onChange3 = props2.onChange) === null || _props2$onChange3 === void 0 ? void 0 : _props2$onChange3.call(props2, {
            e: e,
            trigger: "next"
          });
        },
        "icon": props2.layout === "horizontal" ? function () {
          return vue.createVNode(ChevronRightIcon, null, null);
        } : function () {
          return vue.createVNode(ChevronDownIcon, null, null);
        },
        "class": "".concat(COMPONENT_NAME.value, "__next"),
        "disabled": disabledConfig.value.next
      }, null)]);
    };
  }
});

exports["default"] = _PaginationMini;
//# sourceMappingURL=pagination-mini.js.map
