/**
 * ldesign v0.4.2
 * (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 _common_js_utils_helper = require('../_common/js/utils/helper.js');
var hooks_useConfig = require('../hooks/useConfig.js');
require('@babel/runtime/helpers/toConsumableArray');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/slicedToArray');
require('lodash/isString');
require('lodash/isNull');
require('lodash/isUndefined');
require('lodash/isNumber');
require('lodash/isArray');
require('../config-provider/useConfig.js');
require('lodash/cloneDeep');
require('lodash/isFunction');
require('../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
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-7f0559c3.js');
require('dayjs');

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

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

function usePaginationClasses(props, innerCurrent, innerPageSize, name) {
  var _useCommonClassName = hooks_useConfig.useCommonClassName(),
    SIZE = _useCommonClassName.SIZE,
    STATUS = _useCommonClassName.STATUS;
  var pageCount = vue.computed(function () {
    var c = Math.ceil(props.total / innerPageSize.value);
    return c > 0 ? c : 1;
  });
  var paginationClass = vue.computed(function () {
    var _ref;
    return ["".concat(name.value), SIZE.value[props.size], (_ref = {}, _defineProperty__default["default"](_ref, STATUS.value.disabled, props.disabled), _defineProperty__default["default"](_ref, "".concat(name.value, "-ie"), _common_js_utils_helper.getIEVersion() < 11), _ref)];
  });
  var totalClass = vue.computed(function () {
    return ["".concat(name.value, "__total")];
  });
  var sizerClass = vue.computed(function () {
    return ["".concat(name.value, "__select")];
  });
  var preBtnClass = vue.computed(function () {
    return ["".concat(name.value, "__btn"), "".concat(name.value, "__btn-prev"), _defineProperty__default["default"]({}, STATUS.value.disabled, props.disabled || innerCurrent.value === 1)];
  });
  var nextBtnClass = vue.computed(function () {
    return ["".concat(name.value, "__btn"), "".concat(name.value, "__btn-next"), _defineProperty__default["default"]({}, STATUS.value.disabled, props.disabled || innerCurrent.value === pageCount.value)];
  });
  var btnWrapClass = vue.computed(function () {
    return ["".concat(name.value, "__pager")];
  });
  var btnMoreClass = vue.computed(function () {
    return ["".concat(name.value, "__number"), "".concat(name.value, "__number--more"), _defineProperty__default["default"]({}, STATUS.value.disabled, props.disabled)];
  });
  var jumperClass = vue.computed(function () {
    return ["".concat(name.value, "__jump")];
  });
  var jumperInputClass = vue.computed(function () {
    return ["".concat(name.value, "__input")];
  });
  var simpleClass = vue.computed(function () {
    return ["".concat(name.value, "__select")];
  });
  var getButtonClass = function getButtonClass(index) {
    var _ref5;
    return ["".concat(name.value, "__number"), (_ref5 = {}, _defineProperty__default["default"](_ref5, STATUS.value.disabled, props.disabled), _defineProperty__default["default"](_ref5, STATUS.value.current, innerCurrent.value === index), _ref5)];
  };
  return {
    pageCount: pageCount,
    paginationClass: paginationClass,
    totalClass: totalClass,
    sizerClass: sizerClass,
    preBtnClass: preBtnClass,
    nextBtnClass: nextBtnClass,
    btnWrapClass: btnWrapClass,
    btnMoreClass: btnMoreClass,
    jumperClass: jumperClass,
    jumperInputClass: jumperInputClass,
    simpleClass: simpleClass,
    getButtonClass: getButtonClass
  };
}

exports["default"] = usePaginationClasses;
//# sourceMappingURL=usePaginationClasses.js.map
