@uiw/react-select
Advanced tools
Comparing version 4.1.2 to 4.2.1
import React from 'react'; | ||
import { IProps } from '@uiw/utils'; | ||
import Option from './Option'; | ||
import Group from './Group'; | ||
import './style/index.less'; | ||
@@ -7,7 +9,7 @@ export interface SelectProps extends IProps, Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> { | ||
} | ||
export default class Select extends React.Component<SelectProps> { | ||
static defaultProps: SelectProps; | ||
static Option: (props: React.InputHTMLAttributes<HTMLOptionElement>) => JSX.Element; | ||
static Group: (props: React.InputHTMLAttributes<HTMLOptGroupElement>) => JSX.Element; | ||
render(): JSX.Element; | ||
interface CompoundedComponent extends React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLUListElement>> { | ||
Option: typeof Option; | ||
Group: typeof Group; | ||
} | ||
declare const Select: CompoundedComponent; | ||
export default Select; |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -16,14 +18,4 @@ | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames2 = _interopRequireDefault(require("classnames")); | ||
@@ -35,41 +27,30 @@ | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | ||
function InternalSelect() { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var ref = arguments.length > 1 ? arguments[1] : undefined; | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-select' : _props$prefixCls, | ||
className = props.className, | ||
_props$size = props.size, | ||
size = _props$size === void 0 ? 'default' : _props$size, | ||
other = (0, _objectWithoutProperties2.default)(props, ["prefixCls", "className", "size"]); | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
var selectRef = /*#__PURE__*/_react.default.createRef(); | ||
var Select = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2.default)(Select, _React$Component); | ||
(0, _react.useImperativeHandle)(ref, function () { | ||
return selectRef.current; | ||
}); | ||
return /*#__PURE__*/_react.default.createElement("select", (0, _extends2.default)({}, other, { | ||
ref: selectRef, | ||
className: (0, _classnames2.default)(prefixCls, className, (0, _defineProperty2.default)({}, "".concat(prefixCls, "-").concat(size), size)) | ||
})); | ||
} | ||
var _super = _createSuper(Select); | ||
var Select = /*#__PURE__*/_react.default.forwardRef(InternalSelect); | ||
function Select() { | ||
(0, _classCallCheck2.default)(this, Select); | ||
return _super.apply(this, arguments); | ||
} | ||
(0, _createClass2.default)(Select, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
prefixCls = _this$props.prefixCls, | ||
className = _this$props.className, | ||
size = _this$props.size, | ||
resetProps = (0, _objectWithoutProperties2.default)(_this$props, ["prefixCls", "className", "size"]); | ||
var cls = (0, _classnames2.default)(prefixCls, className, (0, _defineProperty2.default)({}, "".concat(prefixCls, "-").concat(size), size)); | ||
return /*#__PURE__*/_react.default.createElement("select", (0, _extends2.default)({}, resetProps, { | ||
className: cls | ||
})); | ||
} | ||
}]); | ||
return Select; | ||
}(_react.default.Component); | ||
exports.default = Select; | ||
Select.defaultProps = { | ||
prefixCls: 'w-select', | ||
size: 'default' | ||
}; | ||
Select.Option = _Option.default; | ||
Select.Group = _Group.default; | ||
var _default = Select; | ||
exports.default = _default; | ||
module.exports = exports.default; | ||
//# sourceMappingURL=index.js.map |
import React from 'react'; | ||
import { IProps } from '@uiw/utils'; | ||
import Option from './Option'; | ||
import Group from './Group'; | ||
import './style/index.less'; | ||
@@ -7,7 +9,7 @@ export interface SelectProps extends IProps, Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> { | ||
} | ||
export default class Select extends React.Component<SelectProps> { | ||
static defaultProps: SelectProps; | ||
static Option: (props: React.InputHTMLAttributes<HTMLOptionElement>) => JSX.Element; | ||
static Group: (props: React.InputHTMLAttributes<HTMLOptGroupElement>) => JSX.Element; | ||
render(): JSX.Element; | ||
interface CompoundedComponent extends React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLUListElement>> { | ||
Option: typeof Option; | ||
Group: typeof Group; | ||
} | ||
declare const Select: CompoundedComponent; | ||
export default Select; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
import React from 'react'; | ||
import React, { useImperativeHandle } from 'react'; | ||
import classnames from 'classnames'; | ||
@@ -20,39 +10,27 @@ import Option from './Option'; | ||
var Select = /*#__PURE__*/function (_React$Component) { | ||
_inherits(Select, _React$Component); | ||
function InternalSelect() { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var ref = arguments.length > 1 ? arguments[1] : undefined; | ||
var _super = _createSuper(Select); | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-select' : _props$prefixCls, | ||
className = props.className, | ||
_props$size = props.size, | ||
size = _props$size === void 0 ? 'default' : _props$size, | ||
other = _objectWithoutProperties(props, ["prefixCls", "className", "size"]); | ||
function Select() { | ||
_classCallCheck(this, Select); | ||
var selectRef = /*#__PURE__*/React.createRef(); | ||
useImperativeHandle(ref, function () { | ||
return selectRef.current; | ||
}); | ||
return /*#__PURE__*/React.createElement("select", _extends({}, other, { | ||
ref: selectRef, | ||
className: classnames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-").concat(size), size)) | ||
})); | ||
} | ||
return _super.apply(this, arguments); | ||
} | ||
_createClass(Select, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
prefixCls = _this$props.prefixCls, | ||
className = _this$props.className, | ||
size = _this$props.size, | ||
resetProps = _objectWithoutProperties(_this$props, ["prefixCls", "className", "size"]); | ||
var cls = classnames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-").concat(size), size)); | ||
return /*#__PURE__*/React.createElement("select", _extends({}, resetProps, { | ||
className: cls | ||
})); | ||
} | ||
}]); | ||
return Select; | ||
}(React.Component); | ||
Select.defaultProps = { | ||
prefixCls: 'w-select', | ||
size: 'default' | ||
}; | ||
var Select = /*#__PURE__*/React.forwardRef(InternalSelect); | ||
Select.Option = Option; | ||
Select.Group = Group; | ||
export { Select as default }; | ||
export default Select; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@uiw/react-select", | ||
"version": "4.1.2", | ||
"version": "4.2.1", | ||
"description": "Select component", | ||
@@ -47,3 +47,3 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"@uiw/utils": "^4.1.2", | ||
"classnames": "^2.2.6" | ||
"classnames": "2.2.6" | ||
}, | ||
@@ -59,3 +59,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "caafb4b0a1360c2a2bd46903932e4531860ce608" | ||
"gitHead": "f8a4dd106ada12727527eb2a0588be01980be86c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32467
234
+ Addedclassnames@2.2.6(transitive)
- Removedclassnames@2.5.1(transitive)
Updatedclassnames@2.2.6