UNPKG

mobile-more

Version:

基于 antd-mobile v5 扩展移动端 UI 组件

42 lines 1.56 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["min", "max", "step", "digits", "allowEmpty", "stepperProps", "inputReadOnly", "className", "required"]; import { Stepper } from 'antd-mobile'; import classnames from 'classnames'; import React from 'react'; import { formItemPrefixClass } from "../../../config"; import BizFormItem from "../FormItem"; import { useConfig } from "../../BizConfigProvider"; var prefixCls = "".concat(formItemPrefixClass, "-stepper"); var BizFormItemStepper = function BizFormItemStepper(_ref) { var min = _ref.min, max = _ref.max, step = _ref.step, digits = _ref.digits, allowEmpty = _ref.allowEmpty, stepperProps = _ref.stepperProps, inputReadOnly = _ref.inputReadOnly, className = _ref.className, required = _ref.required, restProps = _objectWithoutProperties(_ref, _excluded); var _useConfig = useConfig(), locale = _useConfig.locale; return /*#__PURE__*/React.createElement(BizFormItem, _extends({ className: classnames(prefixCls, className), arrow: false, arrowIcon: false, required: required, rules: [{ required: required, message: locale.form.common.inputRequired }] }, restProps), /*#__PURE__*/React.createElement(Stepper, _extends({ min: min, max: max, step: step, digits: digits, allowEmpty: allowEmpty, inputReadOnly: inputReadOnly }, stepperProps))); }; export default BizFormItemStepper;