UNPKG

@nutui/nutui-react

Version:

京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序

54 lines (53 loc) 2.07 kB
import { _ as _object_spread } from "@swc/helpers/_/_object_spread"; import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props"; import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties"; import React from "react"; import { ComponentDefaults } from "../../utils/typings"; import Cascader from "../cascader"; var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), { visible: false, type: 'custom', options: [], optionKey: { textKey: 'text', valueKey: 'value', childrenKey: 'children' }, format: {}, height: '200px' }); export var CustomRender = function(props) { var _ref = _object_spread({}, defaultProps, props), children = _ref.children, visible = _ref.visible, type = _ref.type, height = _ref.height, options = _ref.options, title = _ref.title, left = _ref.left, value = _ref.value, defaultValue = _ref.defaultValue, optionKey = _ref.optionKey, format = _ref.format, onClose = _ref.onClose, onChange = _ref.onChange, onPathChange = _ref.onPathChange, rest = _object_without_properties(_ref, [ "children", "visible", "type", "height", "options", "title", "left", "value", "defaultValue", "optionKey", "format", "onClose", "onChange", "onPathChange" ]); return /*#__PURE__*/ React.createElement(React.Fragment, null, type === 'custom' && /*#__PURE__*/ React.createElement(Cascader, _object_spread({ visible: visible, value: value, defaultValue: defaultValue, title: title, left: left, options: options, format: format, optionKey: optionKey, onClose: function() { onClose === null || onClose === void 0 ? void 0 : onClose(); }, onChange: function(val, params) { onChange === null || onChange === void 0 ? void 0 : onChange(val, params); }, onPathChange: onPathChange }, rest))); };