/**
 * 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 iconsVueNext = require('@ldesign/icons-vue-next');
var button_index = require('../button/index.js');
var input_index = require('../input/index.js');
var hooks_useGlobalIcon = require('../hooks/useGlobalIcon.js');
var inputNumber_props = require('./props.js');
var inputNumber_useInputNumber = require('./useInputNumber.js');
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('../_chunks/dep-f4db2590.js');
require('lodash/isString');
require('lodash/isFunction');
require('lodash/isArray');
require('../utils/easing.js');
require('../hooks/useConfig.js');
require('../config-provider/useConfig.js');
require('lodash/cloneDeep');
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('dayjs');
require('../loading/loading.js');
require('@babel/runtime/helpers/slicedToArray');
require('../utils/render-tnode.js');
require('lodash/isEmpty');
require('lodash/isObject');
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');
require('../input/input.js');
require('../input/props.js');
require('../input/useInput.js');
require('../form/const.js');
require('../hooks/useVModel.js');
require('../input/useLengthLimit.js');
require('../_common/js/log/log.js');
require('../input/useInputEventHandler.js');
require('../input/useInputWidth.js');
require('../input/input-group.js');
require('../input/input-group-props.js');
require('../hooks/useCommonClassName.js');
require('../_common/js/input-number/number.js');
require('lodash/isNil');
require('../_common/js/input-number/large-number.js');

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

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

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 _InputNumber = vue.defineComponent({
  name: "TInputNumber",
  props: inputNumber_props["default"],
  setup: function setup(props2, context) {
    var _useGlobalIcon = hooks_useGlobalIcon.useGlobalIcon({
        AddIcon: iconsVueNext.AddIcon,
        RemoveIcon: iconsVueNext.RemoveIcon,
        ChevronDownIcon: iconsVueNext.ChevronDownIcon,
        ChevronUpIcon: iconsVueNext.ChevronUpIcon
      }),
      AddIcon = _useGlobalIcon.AddIcon,
      RemoveIcon = _useGlobalIcon.RemoveIcon,
      ChevronDownIcon = _useGlobalIcon.ChevronDownIcon,
      ChevronUpIcon = _useGlobalIcon.ChevronUpIcon;
    var p = inputNumber_useInputNumber["default"](props2);
    var inputRef = p.inputRef;
    context.expose(_objectSpread({}, p));
    return function () {
      var reduceIcon = props2.theme === "column" ? vue.createVNode(ChevronDownIcon, {
        "size": props2.size
      }, null) : vue.createVNode(RemoveIcon, {
        "size": props2.size
      }, null);
      var addIcon = props2.theme === "column" ? vue.createVNode(ChevronUpIcon, {
        "size": props2.size
      }, null) : vue.createVNode(AddIcon, {
        "size": props2.size
      }, null);
      var status = p.isError.value ? "error" : props2.status;
      return vue.createVNode("div", {
        "class": p.wrapClasses.value
      }, [props2.theme !== "normal" && vue.createVNode(button_index.Button, {
        "class": p.reduceClasses.value,
        "disabled": p.tDisabled.value,
        "onClick": p.handleReduce,
        "variant": "outline",
        "shape": "square",
        "icon": function icon() {
          return reduceIcon;
        }
      }, null), vue.createVNode(input_index.Input, vue.mergeProps({
        "ref": inputRef,
        "disabled": p.tDisabled.value,
        "readonly": props2.readonly,
        "autocomplete": "off",
        "placeholder": props2.placeholder,
        "unselectable": props2.readonly ? "on" : "off",
        "autoWidth": props2.autoWidth,
        "align": props2.align || (props2.theme === "row" ? "center" : void 0),
        "status": status,
        "label": props2.label,
        "suffix": props2.suffix
      }, p.listeners, props2.inputProps, {
        "value": p.userInput.value,
        "onChange": p.onInnerInputChange
      }), context.slots), props2.theme !== "normal" && vue.createVNode(button_index.Button, {
        "class": p.addClasses.value,
        "disabled": p.tDisabled.value,
        "onClick": p.handleAdd,
        "variant": "outline",
        "shape": "square",
        "icon": function icon() {
          return addIcon;
        }
      }, null), props2.tips && vue.createVNode("div", {
        "class": "".concat(p.classPrefix.value, "-input__tips ").concat(p.classPrefix.value, "-input__tips--").concat(status)
      }, [props2.tips])]);
    };
  }
});

exports["default"] = _InputNumber;
//# sourceMappingURL=input-number.js.map
