UNPKG

tntd

Version:

tntd是基于 TNT Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。

44 lines (42 loc) 1.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; exports.warningNullOptions = warningNullOptions; var _warning = _interopRequireDefault(require("rc-util/lib/warning")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } // @ts-nocheck function warningProps(props) { var onPopupVisibleChange = props.onPopupVisibleChange, popupVisible = props.popupVisible, popupClassName = props.popupClassName, popupPlacement = props.popupPlacement; (0, _warning["default"])(!onPopupVisibleChange, '`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead.'); (0, _warning["default"])(popupVisible === undefined, '`popupVisible` is deprecated. Please use `open` instead.'); (0, _warning["default"])(popupClassName === undefined, '`popupClassName` is deprecated. Please use `dropdownClassName` instead.'); (0, _warning["default"])(popupPlacement === undefined, '`popupPlacement` is deprecated. Please use `placement` instead.'); } // value in Cascader options should not be null function warningNullOptions(options, fieldNames) { if (options) { var _recursiveOptions = function recursiveOptions(optionsList) { for (var i = 0; i < optionsList.length; i++) { var option = optionsList[i]; if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) { (0, _warning["default"])(false, '`value` in Cascader options should not be `null`.'); return true; } if (Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]) && _recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children])) { return true; } } }; _recursiveOptions(options); } } var _default = exports["default"] = warningProps;