add package.json
This commit is contained in:
parent
2094f465fd
commit
1ed31ab39f
|
@ -0,0 +1 @@
|
||||||
|
export splitComponent from './splitComponent';
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**
|
||||||
|
* 分割要传入父元素和子元素的props
|
||||||
|
* @param {[object]} props 传入的属性
|
||||||
|
* @param {[reactElement]} Component 组件
|
||||||
|
* @return {[array]} 返回数组,第一个元素为父元素props对象,第二个子元素props对象
|
||||||
|
*/
|
||||||
|
export default function splitComponentProps(props, Component) {
|
||||||
|
const componentPropTypes = Component.propTypes;
|
||||||
|
|
||||||
|
const parentProps = {};
|
||||||
|
const childProps = {};
|
||||||
|
|
||||||
|
Object.entries(props).forEach(([propName, propValue]) => {
|
||||||
|
if (componentPropTypes[propName]) {
|
||||||
|
parentProps[propName] = propValue;
|
||||||
|
} else {
|
||||||
|
childProps[propName] = propValue;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return [parentProps, childProps];
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tinper-bee-core",
|
"name": "tinper-bee-core",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"description": "style core and js util for tinper-bee",
|
"description": "style core and js util for tinper-bee",
|
||||||
"main": "js/index.js",
|
"main": "js/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
@include typo-preferred-font($usePreferred);
|
@include typo-preferred-font($usePreferred);
|
||||||
font-size: 13/16 * $unit;
|
font-size: 13/16 * $unit;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
text-transform: uppercase;
|
// text-transform: uppercase;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@
|
||||||
@mixin badge-variant($color, $bg) {
|
@mixin badge-variant($color, $bg) {
|
||||||
color: $color;
|
color: $color;
|
||||||
background-color: $bg;
|
background-color: $bg;
|
||||||
|
|
||||||
&[href] {
|
&[href] {
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus {
|
&:focus {
|
||||||
|
@ -407,13 +407,13 @@
|
||||||
background-color: $color-opacity;
|
background-color: $color-opacity;
|
||||||
}
|
}
|
||||||
.bufferbar{
|
.bufferbar{
|
||||||
background:none;
|
background:none;
|
||||||
background-color: $color-opacity;
|
background-color: $color-opacity;
|
||||||
}
|
}
|
||||||
.progressbar{
|
.progressbar{
|
||||||
background-color: $color;
|
background-color: $color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,6 +483,10 @@
|
||||||
a{
|
a{
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.u-menu-item.active>a{
|
||||||
|
background-color:$color;
|
||||||
}
|
}
|
||||||
.u-menu-item:focus {
|
.u-menu-item:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
@ -496,17 +500,17 @@
|
||||||
|
|
||||||
// utilities
|
// utilities
|
||||||
// font-weight
|
// font-weight
|
||||||
@mixin font-weight-light(){
|
@mixin font-weight-light(){
|
||||||
font-weight: $font-weight-light;
|
font-weight: $font-weight-light;
|
||||||
}
|
}
|
||||||
@mixin font-weight-normal(){
|
@mixin font-weight-normal(){
|
||||||
font-weight: $font-weight-normal;
|
font-weight: $font-weight-normal;
|
||||||
}
|
}
|
||||||
@mixin font-weight-medium(){
|
@mixin font-weight-medium(){
|
||||||
font-weight: $font-weight-medium;
|
font-weight: $font-weight-medium;
|
||||||
}
|
}
|
||||||
@mixin font-weight-bold(){
|
@mixin font-weight-bold(){
|
||||||
font-weight: $font-weight-bold;
|
font-weight: $font-weight-bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
// text
|
// text
|
||||||
|
|
Loading…
Reference in New Issue