Skip to content

Commit

Permalink
CHANGED support js style export
Browse files Browse the repository at this point in the history
  • Loading branch information
lpgray committed Sep 18, 2018
1 parent 5ea1906 commit 165525d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 37 deletions.
8 changes: 5 additions & 3 deletions src/CascadeMultiSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import CascadeMultiModal from './CascadeMultiModal';
import i18n from './locale';
import { getDisabledValueLabel, getWidthStyle } from './utils';

const CASCADER_SELECT_PREFIXCLS = 'kuma-cascader';

const makeOptionsChecked = (value = [], options) => {
// 没有value则需要设置check为false
const valueStr = value.map(i => `${i}`);
Expand Down Expand Up @@ -238,7 +240,7 @@ class CascadeMultiSelect extends React.Component {
<div>
{
!displayValue.length ?
<div className="kuma-cascader-placeholder">
<div className={`${CASCADER_SELECT_PREFIXCLS}-placeholder`}>
{placeholder || i18n(locale).placeholder}
</div> :
<div className={classnames([`${prefixCls}-text-result`])}>
Expand All @@ -260,7 +262,7 @@ class CascadeMultiSelect extends React.Component {
const { disabled } = this.props;
if (disabled) { return null; }
return (
<div className={'kuma-cascader-close-wrap'}>
<div className={`${CASCADER_SELECT_PREFIXCLS}-close-wrap`}>
<i
className="kuma-icon kuma-icon-error"
onClick={(e) => {
Expand All @@ -276,7 +278,7 @@ class CascadeMultiSelect extends React.Component {
renderContent() {
const { className, prefixCls, size, allowClear, disabled } = this.props;
const { displayValue, showSubMenu } = this.state;
const prefixCls2 = 'kuma-cascader';

return (
<div
className={classnames({
Expand Down
61 changes: 27 additions & 34 deletions src/CascadeMultiSelect.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* Copyright 2015-2017, Uxcore Team, Alinw.
* All rights reserved.
*/
@notificationPrefixCls: kuma-cascade-multi;
@__cascadeMultiSelectPrefixCls: kuma-cascade-multi;
@backgroundColor: @bg-disabled-color;
@_border: rgba(31,56,88,0.20);
@_border-light: #e8e8e8;
@_text-0: #76889A;

.@{notificationPrefixCls} {
.@{__cascadeMultiSelectPrefixCls} {
float: left;
overflow: hidden;

Expand All @@ -23,7 +23,7 @@
border: 1px solid @_border;
background-color: #ffffff;

.@{notificationPrefixCls}-content {
.@{__cascadeMultiSelectPrefixCls}-content {
float: left;
overflow-y: auto;

Expand All @@ -37,7 +37,7 @@
border-left: 0;
}

.@{notificationPrefixCls}-list-item {
.@{__cascadeMultiSelectPrefixCls}-list-item {
overflow: hidden;

height: 28px;
Expand All @@ -57,33 +57,33 @@
margin-right: 5px;
}

.@{notificationPrefixCls}-item-label {
.@{__cascadeMultiSelectPrefixCls}-item-label {
span {
vertical-align: middle;
}
}

.@{notificationPrefixCls}-item-disabled {
.@{__cascadeMultiSelectPrefixCls}-item-disabled {
cursor: not-allowed;
* {
cursor: not-allowed;
}
}
}

.@{notificationPrefixCls}-list-item-active {
.@{__cascadeMultiSelectPrefixCls}-list-item-active {
background-color: @bg-disabled-color;
}

.@{notificationPrefixCls}-list-noData {
.@{__cascadeMultiSelectPrefixCls}-list-noData {
display: block;

margin-top: 7px;
margin-left: 21px;
}
}

.@{notificationPrefixCls}-result {
.@{__cascadeMultiSelectPrefixCls}-result {
float: left;

width: 220px;
Expand All @@ -93,13 +93,13 @@
border-left: 1px solid @_border-light;
background-color: #fff;

.@{notificationPrefixCls}-result-title {
.@{__cascadeMultiSelectPrefixCls}-result-title {
margin: 20px 15px 10px 15px;
padding: 0;

color: @_text-0;

.@{notificationPrefixCls}-result-clean {
.@{__cascadeMultiSelectPrefixCls}-result-clean {
float: right;

margin-right: 6px;
Expand All @@ -110,7 +110,7 @@
}
}

.@{notificationPrefixCls}-result-tree {
.@{__cascadeMultiSelectPrefixCls}-result-tree {
overflow-x: hidden;
overflow-y: auto;

Expand Down Expand Up @@ -196,54 +196,47 @@
}
}

/**
* CascadeMultiSelect Component Style for uxcore
* @author guyunxiang
*
* Copyright 2015-2017, Uxcore Team, Alinw.
* All rights reserved.
*/
.@{notificationPrefixCls}-select-panel-content {
.@{__cascadeMultiSelectPrefixCls}-select-panel-content {
position: relative;
box-shadow: @box-shadow-1;
border-radius: @popup-border-radius;
.@{notificationPrefixCls} {
.@{__cascadeMultiSelectPrefixCls} {
border-radius: @popup-border-radius @popup-border-radius 0 0;
overflow: hidden;
}
.@{notificationPrefixCls}-select-footer {
.@{__cascadeMultiSelectPrefixCls}-select-footer {
border-radius: 0 0 @popup-border-radius @popup-border-radius;
overflow: hidden;
clear: both;
}
.@{notificationPrefixCls}-select-panel-wrap {
.@{__cascadeMultiSelectPrefixCls}-select-panel-wrap {
border-radius: @popup-border-radius;
box-shadow: @box-shadow-1;
zoom: 1;
overflow: hidden;
}
}

.@{notificationPrefixCls}-input {
.@{__cascadeMultiSelectPrefixCls}-input {
background-color: #fff;
&::-ms-clear {
display: none;
}
}

.@{notificationPrefixCls}-large {
.@{__cascadeMultiSelectPrefixCls}-large {
height: 38px;
}
.@{notificationPrefixCls}-middle {
.@{__cascadeMultiSelectPrefixCls}-middle {
min-height: 32px;
line-height: 32px;
}
.@{notificationPrefixCls}-small {
.@{__cascadeMultiSelectPrefixCls}-small {
min-height: 28px;
line-height: 28px;
}

.@{notificationPrefixCls}-text-result {
.@{__cascadeMultiSelectPrefixCls}-text-result {
overflow-x: hidden;

margin-right: 30px;
Expand All @@ -262,7 +255,7 @@
}
}

.@{notificationPrefixCls}-select-footer {
.@{__cascadeMultiSelectPrefixCls}-select-footer {
float: left;

height: 52px;
Expand All @@ -278,7 +271,7 @@
line-height: 52px;
}

.@{notificationPrefixCls} {
.@{__cascadeMultiSelectPrefixCls} {
&.ucms-panel {
border-radius: @popup-border-radius;
}
Expand All @@ -292,8 +285,8 @@
* Copyright 2015-2017, Uxcore Team, Alinw.
* All rights reserved.
*/
.@{notificationPrefixCls}-model {
.@{notificationPrefixCls} {
.@{__cascadeMultiSelectPrefixCls}-model {
.@{__cascadeMultiSelectPrefixCls} {
border-left: none;
border-right: none;
}
Expand All @@ -313,11 +306,11 @@
border-radius: 2px;
background-color: #f0f0f0;
&:hover {
// .@{notificationPrefixCls}-model-result-ul-list-remove {
// .@{__cascadeMultiSelectPrefixCls}-model-result-ul-list-remove {
// -ms-transform: scale(1);
// transform: scale(1);
// }
// .@{notificationPrefixCls}-model-result-ul-list-content {
// .@{__cascadeMultiSelectPrefixCls}-model-result-ul-list-content {
// margin-right: 10px;
// margin-left: -10px;
// }
Expand Down
4 changes: 4 additions & 0 deletions style/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '../src/CascadeMultiSelect.less';
import 'uxcore-button/style';
import 'uxcore-dialog/style';
import 'uxcore-dropdown/style';
19 changes: 19 additions & 0 deletions webpack.custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const modifyVars = require('kuma-base/jsvars/orange');

/* eslint-disable no-param-reassign */
module.exports = (config) => {
config.module.rules.forEach((rule) => {
if (rule.test.toString() === /\.less$/.toString()) {
rule.use = [
'style-loader',
'css-loader',
{
loader: 'less-loader',
options: {
modifyVars,
},
},
];
}
});
};

0 comments on commit 165525d

Please sign in to comment.