/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { h as helper } from '../../chunks/helper.js';
import { AddIcon, RemoveIcon, ChevronDownIcon, ChevronUpIcon } from '@ldesign/icons-vue';
import { defineComponent } from '@vue/composition-api';
import { Button } from '../button/index.js';
import { Input } from '../input/index.js';
import { useGlobalIcon } from '../../hooks/use-global-icon.js';
import props from './props.js';
import useInputNumber from './hooks/use-input-number.js';
import '../../chunks/_commonjsHelpers.js';
import '../../utils/with-install.js';
import 'vue';
import 'lodash';
import '../../config.js';
import '../button/button.js';
import '../loading/index.js';
import '../loading/loading.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../chunks/index.js';
import '../../chunks/log.js';
import '../../chunks/_commonjsHelpers-2e6815bd.js';
import '../../utils/easing.js';
import '../../utils/render-node.js';
import '../../utils/transfer-dom.js';
import '../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import '../../chunks/zh_CN.js';
import '../config-provider/type.js';
import '../../utils/mixins.js';
import '../loading/props.js';
import '../loading/icon/gradient.js';
import '../../chunks/defineProperty-838e4192.js';
import '../../chunks/set-style.js';
import '../../chunks/helper2.js';
import '../loading/style';
import '../loading/type.js';
import '../loading/plugin.js';
import '../../utils/ripple.js';
import '../button/props.js';
import '../button/style';
import '../button/type.js';
import '../../utils/map-props.js';
import '../input/input.js';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../utils/helper.js';
import '../../utils/event.js';
import '../input/props.js';
import '../input/group.js';
import '../input/style';
import '../input/type.js';
import '../../hooks/use-config.js';
import '../config-provider/useConfig.js';
import '../../chunks/isObjectLike-c22c7e3b.js';
import '../../chunks/isArray-cd7357b9.js';
import '../../chunks/isNumber-c4eb560e.js';
import '../../hooks/use-common-classname.js';
import '../../hooks/use-vmodel.js';
import '../../hooks/use-form-disabled.js';

var _InputNumber = defineComponent({
  name: "LInputNumber",
  components: {
    LInput: Input,
    LButton: Button
  },
  props,
  setup(props2, context) {
    const p = useInputNumber(props2, context);
    const {
      AddIcon: AddIcon$1,
      RemoveIcon: RemoveIcon$1,
      ChevronDownIcon: ChevronDownIcon$1,
      ChevronUpIcon: ChevronUpIcon$1
    } = useGlobalIcon({
      AddIcon: AddIcon,
      RemoveIcon: RemoveIcon,
      ChevronDownIcon: ChevronDownIcon,
      ChevronUpIcon: ChevronUpIcon
    });
    return {
      ...p,
      AddIcon: AddIcon$1,
      RemoveIcon: RemoveIcon$1,
      ChevronDownIcon: ChevronDownIcon$1,
      ChevronUpIcon: ChevronUpIcon$1
    };
  },
  render() {
    const h = arguments[0];
    const {
      AddIcon,
      RemoveIcon,
      ChevronDownIcon,
      ChevronUpIcon
    } = this;
    const reduceIcon = this.theme === "column" ? h(ChevronDownIcon, {
      "attrs": {
        "size": this.size
      }
    }) : h(RemoveIcon, {
      "attrs": {
        "size": this.size
      }
    });
    const addIcon = this.theme === "column" ? h(ChevronUpIcon, {
      "attrs": {
        "size": this.size
      }
    }) : h(AddIcon, {
      "attrs": {
        "size": this.size
      }
    });
    const status = this.isError ? "error" : this.status;
    return h("div", {
      "class": this.wrapClasses
    }, [this.theme !== "normal" && h("l-button", {
      "class": this.reduceClasses,
      "attrs": {
        "disabled": this.tDisabled,
        "variant": "outline",
        "shape": "square",
        "icon": () => reduceIcon
      },
      "on": {
        "click": this.handleReduce
      }
    }), h("l-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("l-button", {
      "class": this.addClasses,
      "attrs": {
        "disabled": this.tDisabled,
        "variant": "outline",
        "shape": "square",
        "icon": () => addIcon
      },
      "on": {
        "click": this.handleAdd
      }
    }), this.tips && h("div", {
      "class": `${this.classPrefix}-input__tips ${this.classPrefix}-input__tips--${status}`
    }, [this.tips])]);
  }
});

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