UNPKG

@sishuguojixuefu/react-native-form

Version:
28 lines 1.54 kB
"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importStar(require("react")); const ErrorTip_1 = __importDefault(require("./helper/ErrorTip")); const SSMultiSelectView_1 = __importDefault(require("./SSMultiSelectView")); const getFieldDecorator_1 = __importDefault(require("../utils/getFieldDecorator")); class SsMultiSelect extends react_1.Component { componentWillMount() { const { form, id, initialValue, rules } = this.props; this.fieldDecorator = getFieldDecorator_1.default(form, id, initialValue && [initialValue], rules); } render() { const { label, required, form, id, onChange, options, placeholder, initialValue } = this.props; return (react_1.default.createElement(ErrorTip_1.default, { error: form.getFieldError(id) }, this.fieldDecorator(react_1.default.createElement(SSMultiSelectView_1.default, { label: label, required: required, onChange: onChange, options: options, placeholder: placeholder, initialValue: initialValue })))); } } exports.default = SsMultiSelect; //# sourceMappingURL=SsMultiSelect.js.map