cloud-b2b 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +21 -0
- package/README.md +1 -0
- package/es/Title/Title.js +36 -0
- package/es/Title/Title.less +35 -0
- package/es/Title/package.json +6 -0
- package/es/index.js +1 -0
- package/es/style.less +1 -0
- package/es/variables.js +4 -0
- package/es/variables.less +73 -0
- package/lib/Title/Title.js +54 -0
- package/lib/Title/Title.less +35 -0
- package/lib/Title/package.json +6 -0
- package/lib/index.js +18 -0
- package/lib/index.less +3 -0
- package/lib/style.less +1 -0
- package/lib/variables.js +16 -0
- package/lib/variables.less +73 -0
- package/package.json +21 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 zhangyanwei.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b2b_web-component
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _Icon from "antd/es/icon";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["title", "children", "className", "required", "fold", "isFold", "noBorder", "onFold"];
|
|
5
|
+
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import variables from '../variables';
|
|
8
|
+
|
|
9
|
+
function Title(_ref) {
|
|
10
|
+
var title = _ref.title,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
className = _ref.className,
|
|
13
|
+
_ref$required = _ref.required,
|
|
14
|
+
required = _ref$required === void 0 ? false : _ref$required,
|
|
15
|
+
_ref$fold = _ref.fold,
|
|
16
|
+
fold = _ref$fold === void 0 ? false : _ref$fold,
|
|
17
|
+
_ref$isFold = _ref.isFold,
|
|
18
|
+
isFold = _ref$isFold === void 0 ? false : _ref$isFold,
|
|
19
|
+
_ref$noBorder = _ref.noBorder,
|
|
20
|
+
noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
|
|
21
|
+
onFold = _ref.onFold,
|
|
22
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
25
|
+
className: variables('title')
|
|
26
|
+
}, props), /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
"data-border": !noBorder,
|
|
28
|
+
"data-fold": fold,
|
|
29
|
+
"data-required": required,
|
|
30
|
+
onClick: fold && onFold ? _bindInstanceProperty(onFold).call(onFold, null, !isFold) : undefined
|
|
31
|
+
}, title, fold ? /*#__PURE__*/React.createElement(_Icon, {
|
|
32
|
+
type: isFold ? 'down' : 'up'
|
|
33
|
+
}) : null), isFold ? null : children);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default Title;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import '../variables';
|
|
2
|
+
|
|
3
|
+
.@{cloudlink-prefix}-title {
|
|
4
|
+
> *:first-child {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
color: @brand-primary;
|
|
7
|
+
line-height: 1.2;
|
|
8
|
+
|
|
9
|
+
&[data-border='true'] {
|
|
10
|
+
padding: 0 5px;
|
|
11
|
+
border-left: @brand-primary solid 3px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&[data-fold='true'] {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
margin: 8px 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[data-required='true'] {
|
|
20
|
+
&::after {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
margin-left: 4px;
|
|
23
|
+
color: #f5222d;
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
font-family: SimSun, sans-serif;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
content: '*';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
> [role = 'toolbar'] {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
}
|
|
35
|
+
}
|
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Title } from './Title';
|
package/es/style.less
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./Title/Title.less";
|
package/es/variables.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@cloudlink-prefix: cloudlink;
|
|
2
|
+
@default-font-size: 14px;
|
|
3
|
+
@font-size-base: ceil((@default-font-size * 0.85));
|
|
4
|
+
@default-line-color:#d7d7d7;
|
|
5
|
+
@padding-horizontal: 10px;
|
|
6
|
+
@padding-vertical: 10px;
|
|
7
|
+
@padding-horizontal-sm: 5px;
|
|
8
|
+
@padding-vertical-sm: 5px;
|
|
9
|
+
@background-color: white;
|
|
10
|
+
@box-shadow-color: rgba(0, 0, 0, 0.15);
|
|
11
|
+
@brand-primary: #2196f3;
|
|
12
|
+
@font-family-base: '微软雅黑', '宋体', sans-serif;
|
|
13
|
+
@one-pixel: 0.0625vw;
|
|
14
|
+
@one-pixel-v: 0.1111vh;
|
|
15
|
+
|
|
16
|
+
// antd变量
|
|
17
|
+
@text-color: rgba(0, 0, 0, 0.80);
|
|
18
|
+
@primary-color: @brand-primary;
|
|
19
|
+
@primary-1: tint(@primary-color, 85%);
|
|
20
|
+
@primary-5: tint(@primary-color, 20%);
|
|
21
|
+
@border-radius-base: 4px;
|
|
22
|
+
@border-radius-sm: 2px;
|
|
23
|
+
@border-radius-lg: 8px;
|
|
24
|
+
@table-header-bg: #f0f0f0;
|
|
25
|
+
@table-row-hover-bg: @primary-1;
|
|
26
|
+
@input-height-base: 28px;
|
|
27
|
+
@input-height-lg: 32px;
|
|
28
|
+
@input-height-sm: 22px;
|
|
29
|
+
@btn-height-base: @input-height-base;
|
|
30
|
+
@btn-height-lg: @input-height-lg;
|
|
31
|
+
@btn-height-sm: @input-height-sm;
|
|
32
|
+
@pagination-item-size: @input-height-base;
|
|
33
|
+
|
|
34
|
+
// layout外观
|
|
35
|
+
@layout-font-size: @default-font-size;
|
|
36
|
+
@layout-font-family: @font-family-base;
|
|
37
|
+
|
|
38
|
+
// 页眉外观(header)
|
|
39
|
+
@header-height: 40px;
|
|
40
|
+
@header-font-size: @default-font-size + 2;
|
|
41
|
+
@header-color: #fff;
|
|
42
|
+
@header-color-bg: #0175DA;
|
|
43
|
+
@header-hover-bg: fade(darken(@header-color-bg, 15%), 50%);
|
|
44
|
+
@header-active-bg: @header-hover-bg;
|
|
45
|
+
|
|
46
|
+
// 侧边栏外观(sidebar)
|
|
47
|
+
@sidebar-width: 160px;
|
|
48
|
+
@sidebar-min-width: 43px;
|
|
49
|
+
@sidebar-color: black;
|
|
50
|
+
@sidebar-border-color: #d7d7d7;
|
|
51
|
+
@sidebar-color-bg: #f7f4f9;
|
|
52
|
+
@sidebar-hover-bg: #e4e4e4;
|
|
53
|
+
@sidebar-active-bg: @sidebar-hover-bg;
|
|
54
|
+
|
|
55
|
+
// Form
|
|
56
|
+
@form-group-margin-bottom: 0;
|
|
57
|
+
@legend-color: black;
|
|
58
|
+
|
|
59
|
+
//门户相关页面变量
|
|
60
|
+
@max-width: 1180px;
|
|
61
|
+
@padding: 15px;
|
|
62
|
+
|
|
63
|
+
//媒体查询定义
|
|
64
|
+
@screen-small: 768px;
|
|
65
|
+
@screen-low-middle: 1024px;
|
|
66
|
+
@screen-middle: 1180px;
|
|
67
|
+
|
|
68
|
+
@screen-sm-max: @screen-small;
|
|
69
|
+
@screen-lm-min: @screen-small + 1;
|
|
70
|
+
@screen-lm-max: @screen-low-middle;
|
|
71
|
+
@screen-md-min: @screen-low-middle + 1;
|
|
72
|
+
@screen-md-max: @screen-middle + 50;
|
|
73
|
+
@screen-lg-min: @screen-middle + 1 + 50;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
exports["default"] = void 0;
|
|
12
|
+
|
|
13
|
+
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
14
|
+
|
|
15
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
16
|
+
|
|
17
|
+
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
18
|
+
|
|
19
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
20
|
+
|
|
21
|
+
var _react = _interopRequireDefault(require("react"));
|
|
22
|
+
|
|
23
|
+
var _variables = _interopRequireDefault(require("../variables"));
|
|
24
|
+
|
|
25
|
+
var _excluded = ["title", "children", "className", "required", "fold", "isFold", "noBorder", "onFold"];
|
|
26
|
+
|
|
27
|
+
function Title(_ref) {
|
|
28
|
+
var title = _ref.title,
|
|
29
|
+
children = _ref.children,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
_ref$required = _ref.required,
|
|
32
|
+
required = _ref$required === void 0 ? false : _ref$required,
|
|
33
|
+
_ref$fold = _ref.fold,
|
|
34
|
+
fold = _ref$fold === void 0 ? false : _ref$fold,
|
|
35
|
+
_ref$isFold = _ref.isFold,
|
|
36
|
+
isFold = _ref$isFold === void 0 ? false : _ref$isFold,
|
|
37
|
+
_ref$noBorder = _ref.noBorder,
|
|
38
|
+
noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
|
|
39
|
+
onFold = _ref.onFold,
|
|
40
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
42
|
+
className: (0, _variables["default"])('title')
|
|
43
|
+
}, props), /*#__PURE__*/_react["default"].createElement("span", {
|
|
44
|
+
"data-border": !noBorder,
|
|
45
|
+
"data-fold": fold,
|
|
46
|
+
"data-required": required,
|
|
47
|
+
onClick: fold && onFold ? (0, _bind["default"])(onFold).call(onFold, null, !isFold) : undefined
|
|
48
|
+
}, title, fold ? /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
49
|
+
type: isFold ? 'down' : 'up'
|
|
50
|
+
}) : null), isFold ? null : children);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var _default = Title;
|
|
54
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import '../variables';
|
|
2
|
+
|
|
3
|
+
.@{cloudlink-prefix}-title {
|
|
4
|
+
> *:first-child {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
color: @brand-primary;
|
|
7
|
+
line-height: 1.2;
|
|
8
|
+
|
|
9
|
+
&[data-border='true'] {
|
|
10
|
+
padding: 0 5px;
|
|
11
|
+
border-left: @brand-primary solid 3px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&[data-fold='true'] {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
margin: 8px 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[data-required='true'] {
|
|
20
|
+
&::after {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
margin-left: 4px;
|
|
23
|
+
color: #f5222d;
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
font-family: SimSun, sans-serif;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
content: '*';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
> [role = 'toolbar'] {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
}
|
|
35
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
_Object$defineProperty(exports, "Title", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return _Title["default"];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
var _Title = _interopRequireDefault(require("./Title"));
|
package/lib/index.less
ADDED
package/lib/style.less
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./Title/Title.less";
|
package/lib/variables.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
exports["default"] = void 0;
|
|
10
|
+
var PREFIX = 'cloudlink';
|
|
11
|
+
|
|
12
|
+
var _default = function _default(name) {
|
|
13
|
+
return "".concat(PREFIX, "-").concat(name);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@cloudlink-prefix: cloudlink;
|
|
2
|
+
@default-font-size: 14px;
|
|
3
|
+
@font-size-base: ceil((@default-font-size * 0.85));
|
|
4
|
+
@default-line-color:#d7d7d7;
|
|
5
|
+
@padding-horizontal: 10px;
|
|
6
|
+
@padding-vertical: 10px;
|
|
7
|
+
@padding-horizontal-sm: 5px;
|
|
8
|
+
@padding-vertical-sm: 5px;
|
|
9
|
+
@background-color: white;
|
|
10
|
+
@box-shadow-color: rgba(0, 0, 0, 0.15);
|
|
11
|
+
@brand-primary: #2196f3;
|
|
12
|
+
@font-family-base: '微软雅黑', '宋体', sans-serif;
|
|
13
|
+
@one-pixel: 0.0625vw;
|
|
14
|
+
@one-pixel-v: 0.1111vh;
|
|
15
|
+
|
|
16
|
+
// antd变量
|
|
17
|
+
@text-color: rgba(0, 0, 0, 0.80);
|
|
18
|
+
@primary-color: @brand-primary;
|
|
19
|
+
@primary-1: tint(@primary-color, 85%);
|
|
20
|
+
@primary-5: tint(@primary-color, 20%);
|
|
21
|
+
@border-radius-base: 4px;
|
|
22
|
+
@border-radius-sm: 2px;
|
|
23
|
+
@border-radius-lg: 8px;
|
|
24
|
+
@table-header-bg: #f0f0f0;
|
|
25
|
+
@table-row-hover-bg: @primary-1;
|
|
26
|
+
@input-height-base: 28px;
|
|
27
|
+
@input-height-lg: 32px;
|
|
28
|
+
@input-height-sm: 22px;
|
|
29
|
+
@btn-height-base: @input-height-base;
|
|
30
|
+
@btn-height-lg: @input-height-lg;
|
|
31
|
+
@btn-height-sm: @input-height-sm;
|
|
32
|
+
@pagination-item-size: @input-height-base;
|
|
33
|
+
|
|
34
|
+
// layout外观
|
|
35
|
+
@layout-font-size: @default-font-size;
|
|
36
|
+
@layout-font-family: @font-family-base;
|
|
37
|
+
|
|
38
|
+
// 页眉外观(header)
|
|
39
|
+
@header-height: 40px;
|
|
40
|
+
@header-font-size: @default-font-size + 2;
|
|
41
|
+
@header-color: #fff;
|
|
42
|
+
@header-color-bg: #0175DA;
|
|
43
|
+
@header-hover-bg: fade(darken(@header-color-bg, 15%), 50%);
|
|
44
|
+
@header-active-bg: @header-hover-bg;
|
|
45
|
+
|
|
46
|
+
// 侧边栏外观(sidebar)
|
|
47
|
+
@sidebar-width: 160px;
|
|
48
|
+
@sidebar-min-width: 43px;
|
|
49
|
+
@sidebar-color: black;
|
|
50
|
+
@sidebar-border-color: #d7d7d7;
|
|
51
|
+
@sidebar-color-bg: #f7f4f9;
|
|
52
|
+
@sidebar-hover-bg: #e4e4e4;
|
|
53
|
+
@sidebar-active-bg: @sidebar-hover-bg;
|
|
54
|
+
|
|
55
|
+
// Form
|
|
56
|
+
@form-group-margin-bottom: 0;
|
|
57
|
+
@legend-color: black;
|
|
58
|
+
|
|
59
|
+
//门户相关页面变量
|
|
60
|
+
@max-width: 1180px;
|
|
61
|
+
@padding: 15px;
|
|
62
|
+
|
|
63
|
+
//媒体查询定义
|
|
64
|
+
@screen-small: 768px;
|
|
65
|
+
@screen-low-middle: 1024px;
|
|
66
|
+
@screen-middle: 1180px;
|
|
67
|
+
|
|
68
|
+
@screen-sm-max: @screen-small;
|
|
69
|
+
@screen-lm-min: @screen-small + 1;
|
|
70
|
+
@screen-lm-max: @screen-low-middle;
|
|
71
|
+
@screen-md-min: @screen-low-middle + 1;
|
|
72
|
+
@screen-md-max: @screen-middle + 50;
|
|
73
|
+
@screen-lg-min: @screen-middle + 1 + 50;
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cloud-b2b",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A react component library dependent antd",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"component",
|
|
8
|
+
"antd"
|
|
9
|
+
],
|
|
10
|
+
"author": "pxj",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@babel/runtime-corejs3": "^7.11.2",
|
|
14
|
+
"antd": "3.13.6",
|
|
15
|
+
"prop-types": "^15.7.2",
|
|
16
|
+
"react": "^16.8.2",
|
|
17
|
+
"react-dom": "^16.8.2"
|
|
18
|
+
},
|
|
19
|
+
"main": "lib/index.js",
|
|
20
|
+
"module": "es/index.js"
|
|
21
|
+
}
|