tdesign-vue
Version:
185 lines (181 loc) • 6.34 kB
JavaScript
/**
* tdesign v1.12.1
* (c) 2025 tdesign
* @license MIT
*/
import { h as helper } from '../_chunks/dep-323b993c.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/directive.js';
import 'lodash-es';
import '../loading/plugin.js';
import 'vue';
import '../loading/loading.js';
import '../loading/icon/gradient.js';
import '../_common/js/loading/circle-adapter.js';
import '../_common/js/utils/setStyle.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 '../config-provider/context.js';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '../_chunks/dep-c44a474d.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-d639fbd7.js';
import 'dayjs';
import '../_chunks/dep-3c66615e.js';
import '../config-provider/type.js';
import '../_common/js/global-config/t.js';
import '../utils/mixins.js';
import '../utils/dom.js';
import 'raf';
import '../utils/easing.js';
import '../utils/render-tnode.js';
import '@babel/runtime/helpers/readOnlyError';
import '../utils/transfer-dom.js';
import '../loading/props.js';
import '../config.js';
import '../utils/withInstall.js';
import './style/css.js';
import '../loading/type.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 '../_common/js/log/index.js';
import '../_common/js/log/log.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 '../_common/js/input-number/large-number.js';
import '../hooks/useFormDisabled.js';
import '../hooks/useConfig.js';
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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