/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 swimly
 * @license MIT
 */

import { h as helper } from '../../_chunks/dep-9cf53923.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 props from './props.js';
import useInputNumber from './hooks/use-input-number.js';
import { useGlobalIcon } from '../../hooks/use-global-icon.js';
import '../button/button.js';
import '../loading/index.js';
import '../loading/loading.js';
import '../loading/icon/gradient.js';
import 'vue';
import '../../_chunks/dep-1dd6d50e.js';
import '../../_chunks/dep-1aed710a.js';
import '../../_chunks/dep-d640115b.js';
import '../../config.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../utils/easing.js';
import '../../utils/render-node.js';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../utils/transfer-dom.js';
import '../loading/props.js';
import '../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../_chunks/dep-b1584b65.js';
import '../../utils/mixins.js';
import '../../utils/with-install.js';
import '../loading/plugin.js';
import '../button/props.js';
import '../../utils/ripple.js';
import '../input/input.js';
import '../../utils/helper.js';
import '../../utils/event.js';
import '../input/props.js';
import '../input/group.js';
import '../../utils/map-props.js';
import '../../_chunks/dep-fd084baf.js';
import '../../_chunks/dep-b431a644.js';
import '../../_chunks/dep-db41eefc.js';
import '../../_chunks/dep-5bce19db.js';
import '../../hooks/use-common-classname.js';
import '../config-provider/useConfig.js';
import '../../hooks/use-vmodel.js';
import '../../hooks/use-form-disabled.js';

var _InputNumber = defineComponent({
  name: "LInputNumber",
  props,
  components: {
    LInput: Input,
    LButton: Button
  },

  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
