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

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, computed } from '@vue/composition-api';
import isObject from 'lodash/isObject';
import { ChevronLeftIcon, RoundIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon } from '@ldesign/icons-vue';
import { usePrefixClass } from '../hooks/useConfig.js';
import { useGlobalIcon } from '../hooks/useGlobalIcon.js';
import { Button } from '../button/index.js';
import props from './pagination-mini-props.js';
import '../config-provider/useConfig.js';
import '../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-2cb61c79.js';
import 'dayjs';
import '../utils/withInstall.js';
import 'vue';
import 'lodash/capitalize';
import '../button/button.js';
import '../loading/index.js';
import '../loading/directive.js';
import 'lodash/mapKeys';
import 'lodash/isEqual';
import '../loading/plugin.js';
import '../config.js';
import '../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../utils/easing.js';
import '../loading/loading.js';
import '../utils/render-tnode.js';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../utils/transfer-dom.js';
import '../config-provider/config-receiver.js';
import '../utils/mixins.js';
import '../loading/props.js';
import '../loading/icon/gradient.js';
import '../_common/js/loading/circle-adapter.js';
import '../_common/js/utils/set-style.js';
import '../_common/js/utils/helper.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/isNull';
import 'lodash/isUndefined';
import 'lodash/isNumber';
import 'lodash/isArray';
import '../utils/ripple.js';
import '../button/props.js';

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(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 = 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 ? 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
