/**
 * tdesign v0.46.4
 * (c) 2022 tdesign
 * @license MIT
 */

import { h as helper } from '../_chunks/dep-a4bd011a.js';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { AddIcon, RemoveIcon, ChevronDownIcon, ChevronUpIcon } from 'tdesign-icons-vue';
import { defineComponent } from '@vue/composition-api';
import { Button } from '../button/index.js';
import { Input } from '../input/index.js';
import props from './props.js';
import useInputNumber from './useInputNumber.js';
import { useGlobalIcon } from '../hooks/useGlobalIcon.js';
import '../button/button.js';
import '../loading/index.js';
import '../loading/loading.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 '../config-provider/config-receiver.js';
import 'vue';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import 'lodash/merge';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '../config-provider/type.js';
import '../utils/mixins.js';
import '../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../utils/easing.js';
import '../utils/render-tnode.js';
import '@babel/runtime/helpers/typeof';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../utils/transfer-dom.js';
import '../loading/props.js';
import '../utils/withInstall.js';
import 'lodash/capitalize';
import './style/index.js';
import '../loading/type.js';
import '../loading/plugin.js';
import '../config.js';
import '../button/props.js';
import '../utils/ripple.js';
import '../button/type.js';
import '../input/input.js';
import '../utils/helper.js';
import '../utils/event.js';
import '../input/props.js';
import '../input/input-group.js';
import '../utils/map-props.js';
import '../input/type.js';
import '../hooks/useCommonClassName.js';
import '../config-provider/useConfig.js';
import '../hooks/useVModel.js';
import '../_common/js/input-number/number.js';
import 'lodash/isNumber';
import '../_common/js/input-number/large-number.js';
import '../_common/js/log/log.js';
import '../_common/js/log/index.js';
import '../hooks/useFormDisabled.js';
import '../hooks/useConfig.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 _InputNumber = defineComponent({
  name: "TInputNumber",
  props: props,
  setup: function setup(props2, context) {
    var p = useInputNumber(props2, context);

    var _useGlobalIcon = useGlobalIcon({
      AddIcon: AddIcon,
      RemoveIcon: RemoveIcon,
      ChevronDownIcon: ChevronDownIcon,
      ChevronUpIcon: ChevronUpIcon
    }),
        AddIcon$1 = _useGlobalIcon.AddIcon,
        RemoveIcon$1 = _useGlobalIcon.RemoveIcon,
        ChevronDownIcon$1 = _useGlobalIcon.ChevronDownIcon,
        ChevronUpIcon$1 = _useGlobalIcon.ChevronUpIcon;

    return _objectSpread(_objectSpread({}, p), {}, {
      AddIcon: AddIcon$1,
      RemoveIcon: RemoveIcon$1,
      ChevronDownIcon: ChevronDownIcon$1,
      ChevronUpIcon: ChevronUpIcon$1
    });
  },
  render: function render() {
    var h = arguments[0];
    var AddIcon = this.AddIcon,
        RemoveIcon = this.RemoveIcon,
        ChevronDownIcon = this.ChevronDownIcon,
        ChevronUpIcon = this.ChevronUpIcon;
    var reduceIcon = this.theme === "column" ? h(ChevronDownIcon, {
      "attrs": {
        "size": this.size
      }
    }) : h(RemoveIcon, {
      "attrs": {
        "size": this.size
      }
    });
    var addIcon = this.theme === "column" ? h(ChevronUpIcon, {
      "attrs": {
        "size": this.size
      }
    }) : h(AddIcon, {
      "attrs": {
        "size": this.size
      }
    });
    var status = this.isError ? "error" : this.status;
    return h("div", {
      "class": this.wrapClasses
    }, [this.theme !== "normal" && h(Button, {
      "class": this.reduceClasses,
      "attrs": {
        "disabled": this.tDisabled,
        "variant": "outline",
        "shape": "square",
        "icon": function icon() {
          return reduceIcon;
        }
      },
      "on": {
        "click": this.handleReduce
      }
    }), h(Input, helper([{
      "ref": "inputRef",
      "attrs": {
        "disabled": this.tDisabled,
        "readonly": this.readonly,
        "autocomplete": "off",
        "placeholder": this.placeholder,
        "unselectable": this.readonly ? "on" : "off",
        "autoWidth": this.autoWidth,
        "align": this.align || (this.theme === "row" ? "center" : void 0),
        "status": status,
        "label": this.label,
        "suffix": this.suffix
      }
    }, {
      "on": this.listeners
    }, {
      "scopedSlots": this.$scopedSlots
    }, {
      "props": this.inputProps
    }, {
      "attrs": {
        "value": this.userInput
      },
      "on": {
        "change": this.onInnerInputChange
      }
    }])), this.theme !== "normal" && h(Button, {
      "class": this.addClasses,
      "attrs": {
        "disabled": this.tDisabled,
        "variant": "outline",
        "shape": "square",
        "icon": function icon() {
          return addIcon;
        }
      },
      "on": {
        "click": this.handleAdd
      }
    }), this.tips && h("div", {
      "class": "".concat(this.classPrefix, "-input__tips ").concat(this.classPrefix, "-input__tips--").concat(status)
    }, [this.tips])]);
  }
});

export { _InputNumber as default };
//# sourceMappingURL=input-number.js.map
