@uiw/react-icon
Advanced tools
Comparing version 5.0.0-bate-1 to 5.0.0-bate-10
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,13 +9,7 @@ value: true | ||
exports["default"] = Icon; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _wIcon = _interopRequireDefault(require("@uiw/icons/fonts/w-icon.json")); | ||
var _style = require("./style"); | ||
Object.keys(_style).forEach(function (key) { | ||
@@ -33,22 +26,18 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["className", "prefixCls", "verticalAlign", "tagName", "color", "type", "spin"]; | ||
function Icon(props) { | ||
var className = props.className, | ||
_props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-icon' : _props$prefixCls, | ||
_props$verticalAlign = props.verticalAlign, | ||
verticalAlign = _props$verticalAlign === void 0 ? 'middle' : _props$verticalAlign, | ||
_props$tagName = props.tagName, | ||
TagName = _props$tagName === void 0 ? 'span' : _props$tagName, | ||
color = props.color, | ||
type = props.type, | ||
_props$spin = props.spin, | ||
spin = _props$spin === void 0 ? false : _props$spin, | ||
others = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
_props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-icon' : _props$prefixCls, | ||
_props$verticalAlign = props.verticalAlign, | ||
verticalAlign = _props$verticalAlign === void 0 ? 'middle' : _props$verticalAlign, | ||
_props$tagName = props.tagName, | ||
TagName = _props$tagName === void 0 ? 'span' : _props$tagName, | ||
color = props.color, | ||
type = props.type, | ||
_props$spin = props.spin, | ||
spin = _props$spin === void 0 ? false : _props$spin, | ||
others = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
var svg = null; | ||
if (typeof type === 'string') { | ||
@@ -72,3 +61,2 @@ svg = /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", { | ||
} | ||
others.style = (0, _objectSpread2["default"])({ | ||
@@ -75,0 +63,0 @@ fill: 'currentColor' |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,22 +9,14 @@ value: true | ||
exports.IconStyleBase = void 0; | ||
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); | ||
var _styledComponents = _interopRequireWildcard(require("styled-components")); | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
var loadingCircle = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))); | ||
var IconStyleBase = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1em;\n width: 1em;\n & svg {\n height: 1em;\n width: 1em;\n }\n display: inline-flex;\n align-self: center;\n position: relative;\n transition: color 0.3s;\n box-sizing: inherit;\n ", "\n ", "\n"])), function (props) { | ||
var IconStyleBase = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1em;\n width: 1em;\n fill: currentColor;\n & svg {\n height: 1em;\n width: 1em;\n fill: currentColor;\n }\n display: inline-flex;\n align-self: center;\n position: relative;\n transition: color 0.3s;\n box-sizing: inherit;\n ", "\n ", "\n"])), function (props) { | ||
var _props$params; | ||
return (props.verticalAlign === 'baseline' || ((_props$params = props.params) === null || _props$params === void 0 ? void 0 : _props$params.verticalAlign) === 'baseline') && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n top: 0.125em;\n "]))); | ||
}, function (props) { | ||
var _props$params2; | ||
return (props.spin || ((_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.spin)) && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n & svg {\n animation: ", " 1s infinite linear;\n }\n "])), loadingCircle); | ||
}); | ||
exports.IconStyleBase = IconStyleBase; | ||
//# sourceMappingURL=index.js.map |
@@ -11,14 +11,12 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
var { | ||
className, | ||
prefixCls = 'w-icon', | ||
verticalAlign = 'middle', | ||
tagName: TagName = 'span', | ||
color, | ||
type, | ||
spin = false | ||
} = props, | ||
others = _objectWithoutPropertiesLoose(props, _excluded); | ||
className, | ||
prefixCls = 'w-icon', | ||
verticalAlign = 'middle', | ||
tagName: TagName = 'span', | ||
color, | ||
type, | ||
spin = false | ||
} = props, | ||
others = _objectWithoutPropertiesLoose(props, _excluded); | ||
var svg = null; | ||
if (typeof type === 'string') { | ||
@@ -40,11 +38,8 @@ svg = /*#__PURE__*/_jsx("svg", { | ||
} | ||
others.style = _extends({ | ||
fill: 'currentColor' | ||
}, others.style); | ||
var propps = _extends({}, others, { | ||
className: [prefixCls, className, prefixCls && verticalAlign ? prefixCls + "-" + verticalAlign : null, spin && prefixCls ? prefixCls + "-spin" : null].filter(Boolean).join(' ').trim() | ||
}); | ||
return /*#__PURE__*/React.createElement(IconStyleBase, _extends({}, propps, { | ||
@@ -51,0 +46,0 @@ verticalAlign, |
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
import styled, { keyframes, css } from 'styled-components'; | ||
var loadingCircle = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))); | ||
export var IconStyleBase = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n height: 1em;\n width: 1em;\n & svg {\n height: 1em;\n width: 1em;\n }\n display: inline-flex;\n align-self: center;\n position: relative;\n transition: color 0.3s;\n box-sizing: inherit;\n ", "\n ", "\n"])), props => { | ||
export var IconStyleBase = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n height: 1em;\n width: 1em;\n fill: currentColor;\n & svg {\n height: 1em;\n width: 1em;\n fill: currentColor;\n }\n display: inline-flex;\n align-self: center;\n position: relative;\n transition: color 0.3s;\n box-sizing: inherit;\n ", "\n ", "\n"])), props => { | ||
var _props$params; | ||
return (props.verticalAlign === 'baseline' || ((_props$params = props.params) == null ? void 0 : _props$params.verticalAlign) === 'baseline') && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n top: 0.125em;\n "]))); | ||
}, props => { | ||
var _props$params2; | ||
return (props.spin || ((_props$params2 = props.params) == null ? void 0 : _props$params2.spin)) && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n & svg {\n animation: ", " 1s infinite linear;\n }\n "])), loadingCircle); | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@uiw/react-icon", | ||
"version": "5.0.0-bate-1", | ||
"version": "5.0.0-bate-10", | ||
"description": "Icon component", | ||
@@ -5,0 +5,0 @@ "author": "Kenny Wong <wowohoo@qq.com>", |
@@ -46,3 +46,3 @@ Icon 图标 | ||
<div> | ||
<Input preIcon="search" placeholder="请输入图标名称" type="text" style={{ maxWidth: 200 }} onChange={this.onChange.bind(this)} /> | ||
<Input preIcon={<Icon type="search" />} placeholder="请输入图标名称" type="text" style={{ maxWidth: 200 }} onChange={this.onChange.bind(this)} /> | ||
<div style={{ padding: '10px 0' }}> | ||
@@ -49,0 +49,0 @@ 搜索到 {this.state.len} 个结果{len > 0 && <span>,下面展示 {len > 15 ? '15' : len} 个图标,可以点击复制图标代码: </span>} |
@@ -26,5 +26,7 @@ import React from 'react'; | ||
width: 1em; | ||
fill: currentColor; | ||
& svg { | ||
height: 1em; | ||
width: 1em; | ||
fill: currentColor; | ||
} | ||
@@ -31,0 +33,0 @@ display: inline-flex; |
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
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
48071
319