cloud-b2b 1.0.4 → 1.0.5

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.
@@ -37,7 +37,7 @@ function Search(_ref) {
37
37
  };
38
38
 
39
39
  return /*#__PURE__*/React.createElement(Card, {
40
- className: s.search
40
+ className: variables('LayoutLink').search
41
41
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
42
42
  validateStatus: status
43
43
  }, /*#__PURE__*/React.createElement(_Input, {
@@ -52,7 +52,7 @@ function Search(_ref) {
52
52
  function Title(_ref2) {
53
53
  var title = _ref2.title;
54
54
  return /*#__PURE__*/React.createElement("div", {
55
- className: s.title
55
+ className: variables('LayoutLink').title
56
56
  }, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null));
57
57
  }
58
58
 
@@ -135,7 +135,7 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
135
135
  }, /*#__PURE__*/React.createElement(Link, _extends({}, _this.linkProps(item), {
136
136
  "data-role": "child-item"
137
137
  }), /*#__PURE__*/React.createElement("span", null, item.title), item.unreadTotal && item.unreadTotal > 0 && /*#__PURE__*/React.createElement("span", {
138
- className: s.unreadTotal
138
+ className: variables('Sidebar2').unreadTotal
139
139
  }, item.unreadTotal)));
140
140
  });
141
141
 
@@ -608,11 +608,11 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
608
608
  span: span * factor,
609
609
  key: control.key
610
610
  }, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
611
- className: s.checkbox,
611
+ className: variables('SuperForm').checkbox,
612
612
  onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _assertThisInitialized(_this2), control),
613
613
  checked: control.checked
614
614
  }), /*#__PURE__*/React.createElement(FormItem, _extends({}, itemProps, {
615
- className: checkable ? s.formItemWithCheckbox : ''
615
+ className: checkable ? variables('SuperForm').formItemWithCheckbox : ''
616
616
  }), _this2.toControl(controlProps, control))) : /*#__PURE__*/React.createElement(_Col, {
617
617
  span: span * factor,
618
618
  key: control.key,
@@ -1,17 +1,17 @@
1
- @import '../../components/variables';
2
-
3
- .@{cloudlink-prefix}-DragSortRow {
4
- cursor: move;
5
-
6
- &[data-drag-hover='up'] {
7
- td {
8
- border-top: 2px dashed @primary-color !important;
9
- }
10
- }
11
-
12
- &[data-drag-hover='down'] {
13
- td {
14
- border-bottom: 2px dashed @primary-color !important;
15
- }
16
- }
17
- }
1
+ @import '../../components/variables';
2
+
3
+ .@{cloudlink-prefix}-DragSortRow {
4
+ cursor: move;
5
+
6
+ &[data-drag-hover='up'] {
7
+ td {
8
+ border-top: 2px dashed @primary-color !important;
9
+ }
10
+ }
11
+
12
+ &[data-drag-hover='down'] {
13
+ td {
14
+ border-bottom: 2px dashed @primary-color !important;
15
+ }
16
+ }
17
+ }
@@ -1,30 +1,30 @@
1
- @import '../variables.less';
2
-
3
- .@{cloudlink-prefix}-FilterDropDown {
4
- background: white;
5
- padding: @padding-vertical @padding-horizontal;
6
- border-radius: @border-radius-base;
7
- border: 1px solid #d9d9d9;
8
-
9
- > :first-child {
10
- width: 135px;
11
- margin-right: 10px;
12
- }
13
- .date{
14
- background: white;
15
- padding: @padding-vertical @padding-horizontal;
16
- border-radius: @border-radius-base;
17
- border: 1px solid #d9d9d9;
18
-
19
- > :first-child > div {
20
- display: inline-block;
21
- }
22
-
23
- > :last-child {
24
- text-align: right;
25
- margin-top: 5px;
26
- }
27
- }
28
- }
29
-
30
-
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-FilterDropDown {
4
+ background: white;
5
+ padding: @padding-vertical @padding-horizontal;
6
+ border-radius: @border-radius-base;
7
+ border: 1px solid #d9d9d9;
8
+
9
+ > :first-child {
10
+ width: 135px;
11
+ margin-right: 10px;
12
+ }
13
+ .date{
14
+ background: white;
15
+ padding: @padding-vertical @padding-horizontal;
16
+ border-radius: @border-radius-base;
17
+ border: 1px solid #d9d9d9;
18
+
19
+ > :first-child > div {
20
+ display: inline-block;
21
+ }
22
+
23
+ > :last-child {
24
+ text-align: right;
25
+ margin-top: 5px;
26
+ }
27
+ }
28
+ }
29
+
30
+
@@ -50,13 +50,13 @@ import FilterDropDown from './FilterDropDown';
50
50
  import fixed from './fixed';
51
51
  import DragSortRow from './DragSortRow';
52
52
  import variables from '../variables';
53
- /**
54
- * sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
55
- * filter: [可选],是否支持过滤,默认为false
56
- * link: [可选],为true表示超链接,内容来至items;为字符串表示超链接,内容就是该字符串;为字符串‘list’表示超链接数组,内容就是该items对应key对象数组的linkTitleKey属性拼接
57
- * linkTitleKey: [可选],当link为'list'表示超链接组时,该值表示要拼接展示的属性key值
58
- * isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
59
- *
53
+ /**
54
+ * sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
55
+ * filter: [可选],是否支持过滤,默认为false
56
+ * link: [可选],为true表示超链接,内容来至items;为字符串表示超链接,内容就是该字符串;为字符串‘list’表示超链接数组,内容就是该items对应key对象数组的linkTitleKey属性拼接
57
+ * linkTitleKey: [可选],当link为'list'表示超链接组时,该值表示要拼接展示的属性key值
58
+ * isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
59
+ *
60
60
  */
61
61
 
62
62
  var ColType = {
@@ -75,13 +75,13 @@ var ColType = {
75
75
  var ItemType = {
76
76
  checked: PropTypes.bool
77
77
  };
78
- /**
79
- * onCheck:点击复选框时触发,原型func(isAll, checked, rowIndex);isolation为true时,原型为onCheck(checkedRows)
80
- * onRadio: 点击单选按钮时触发,原型为func(checkedRows)
81
- * onDoubleClick: 行双击时触发,原型func(rowIndex)
82
- * onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
83
- * onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
84
- * onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
78
+ /**
79
+ * onCheck:点击复选框时触发,原型func(isAll, checked, rowIndex);isolation为true时,原型为onCheck(checkedRows)
80
+ * onRadio: 点击单选按钮时触发,原型为func(checkedRows)
81
+ * onDoubleClick: 行双击时触发,原型func(rowIndex)
82
+ * onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
83
+ * onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
84
+ * onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
85
85
  */
86
86
 
87
87
  var CallbackType = {
@@ -92,22 +92,22 @@ var CallbackType = {
92
92
  onTableChange: PropTypes.func,
93
93
  onMoveRow: PropTypes.func
94
94
  };
95
- /**
96
- * checkbox: [可选],是否有复选框,默认为true
97
- * isPaging: [可选],是否分页,默认为false
98
- * radio: [可选],是否为单选按钮,当checkbox为true时生效,默认值为false
99
- * isolation: [可选],为true时,复选框的选中行采用checkedRows存储
100
- * checkedRows: [可选],选中的行数,radio为true时生效
101
- * index: [可选],是否有序号,默认值为true
102
- * indexTitle:[可选],序号标题,默认为'序号'
103
- * sortInfo: [可选],排序信息,默认为null
104
- * filterInfo: [可选],过滤信息,默认为null
105
- * maxHeight: [可选],设置表格的最大高度
106
- * dragSort: [可选], 为true表示支持行拖曳排序,且不支持行单击选中复选或单选按钮和双击事件,默认为false
107
- * isEmphasized: [可选],是否强调,行字体加粗显示;要实现字体加粗显示除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
108
- * isWeaken: [可选],是否弱化行字体置灰显示,除了isWeaken设置为true之外,置灰行数据里要设置__isWeaken为true
109
- * pageTotal: [可选], 为true表示开启表格末行自动汇总表格列数据,默认为false || searchTotal,当开启时,需要汇总的列需设置属性total为true,当dragSort为true时,该选项失效
110
- * searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
95
+ /**
96
+ * checkbox: [可选],是否有复选框,默认为true
97
+ * isPaging: [可选],是否分页,默认为false
98
+ * radio: [可选],是否为单选按钮,当checkbox为true时生效,默认值为false
99
+ * isolation: [可选],为true时,复选框的选中行采用checkedRows存储
100
+ * checkedRows: [可选],选中的行数,radio为true时生效
101
+ * index: [可选],是否有序号,默认值为true
102
+ * indexTitle:[可选],序号标题,默认为'序号'
103
+ * sortInfo: [可选],排序信息,默认为null
104
+ * filterInfo: [可选],过滤信息,默认为null
105
+ * maxHeight: [可选],设置表格的最大高度
106
+ * dragSort: [可选], 为true表示支持行拖曳排序,且不支持行单击选中复选或单选按钮和双击事件,默认为false
107
+ * isEmphasized: [可选],是否强调,行字体加粗显示;要实现字体加粗显示除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
108
+ * isWeaken: [可选],是否弱化行字体置灰显示,除了isWeaken设置为true之外,置灰行数据里要设置__isWeaken为true
109
+ * pageTotal: [可选], 为true表示开启表格末行自动汇总表格列数据,默认为false || searchTotal,当开启时,需要汇总的列需设置属性total为true,当dragSort为true时,该选项失效
110
+ * searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
111
111
  */
112
112
 
113
113
  var SuperTable = /*#__PURE__*/function (_React$Component) {
@@ -605,24 +605,24 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
605
605
  isWeaken = _this$props6$isWeaken === void 0 ? true : _this$props6$isWeaken;
606
606
 
607
607
  var rowClassName1 = function rowClassName1(record) {
608
- if (items[record.key].__total) return s.totalRow;
609
- if (items[record.key].__warningRow) return s.warningRow;
610
- return _includesInstanceProperty(checkedRows).call(checkedRows, record.key) ? s.select : '';
608
+ if (items[record.key].__total) return variables('SuperTable').totalRow;
609
+ if (items[record.key].__warningRow) return variables('SuperTable').warningRow;
610
+ return _includesInstanceProperty(checkedRows).call(checkedRows, record.key) ? variables('SuperTable').select : '';
611
611
  };
612
612
 
613
613
  var rowClassName2 = function rowClassName2(record) {
614
- if (items[record.key].__total) return s.totalRow;
615
- if (items[record.key].__warningRow) return s.warningRow;
614
+ if (items[record.key].__total) return variables('SuperTable').totalRow;
615
+ if (items[record.key].__warningRow) return variables('SuperTable').warningRow;
616
616
 
617
617
  if (isEmphasized && items[record.key].__isEmphasized) {
618
- return items[record.key].checked ? s.emphasizedSelectRow : s.emphasizedUnselectRow;
618
+ return items[record.key].checked ? variables('SuperTable').emphasizedSelectRow : variables('SuperTable').emphasizedUnselectRow;
619
619
  }
620
620
 
621
621
  if (isWeaken && items[record.key].__isWeaken) {
622
- return items[record.key].checked ? s.weakenedSelectRow : s.weakenedUnselectRow;
622
+ return items[record.key].checked ? variables('SuperTable').weakenedSelectRow : variables('SuperTable').weakenedUnselectRow;
623
623
  }
624
624
 
625
- return items[record.key].checked ? s.select : '';
625
+ return items[record.key].checked ? variables('SuperTable').select : '';
626
626
  };
627
627
 
628
628
  if (checkbox) {
@@ -1,135 +1,132 @@
1
- @import '../variables.less';
2
-
3
- .@{cloudlink-prefix}-SuperTable {
4
- border-spacing: 0;
5
- cursor: default;
6
-
7
- table {
8
- white-space: pre;
9
-
10
- :global(.ant-checkbox-input) {
11
- z-index: -1;
12
- }
13
- }
14
-
15
- :global(.ant-table-placeholder) {
16
- padding: 0;
17
-
18
- > div {
19
- margin: 0;
20
- }
21
- }
22
- .select {
23
- background-color: @primary-1;
24
- }
25
-
26
- .center {
27
- text-align: center !important;
28
- }
29
-
30
- .left {
31
- text-align: left !important;
32
- }
33
-
34
- .right {
35
- text-align: right !important;
36
- }
37
-
38
- .emphasizedSelectRow{
39
- background-color: @table-row-hover-bg;
40
- color :#000;
41
- font-weight: 700;
42
- }
43
- .emphasizedUnselectRow{
44
- color :#000;
45
- font-weight: 700;
46
- }
47
-
48
- .weakenedSelectRow{
49
- background-color: @table-row-hover-bg;
50
- color :#999;
51
- }
52
- .weakenedUnselectRow{
53
- color :#999;
54
- }
55
-
56
- .warningRow{
57
- color: red;
58
- }
59
-
60
- .noTransition{
61
- tr {
62
- transition: all 0s!important;
63
- >td{
64
- transition: all 0s!important;
65
- }
66
- }
67
- }
68
-
69
- .noWrap{
70
- white-space: nowrap;
71
- }
72
-
73
- .totalRow {
74
- color: #222!important;
75
- background-color: #f0f0f0!important;
76
- transition: all 0s!important;
77
- td {
78
- border-top: 1px solid #ddd!important;
79
- background-color: #f0f0f0!important;
80
- border-bottom: 0!important;
81
- transition: all 0s!important;
82
- }
83
- }
84
-
85
- }
86
-
87
-
88
-
89
-
90
-
91
- :global(.ant-table-footer) {
92
- padding: 0!important;
93
- }
94
-
95
- .footer {
96
- vertical-align: middle;
97
- overflow: auto;
98
- scrollbar-width: none;
99
- -ms-overflow-style: none;
100
- scrollbar-color: transparent transparent;
101
- scrollbar-track-color: transparent;
102
- -ms-scrollbar-track-color: transparent;
103
- .footerItem {
104
- white-space: pre;
105
- > span {
106
- display: inline-block;
107
- color: #222;
108
- position: relative;
109
- vertical-align: middle;
110
- border-top: 1px solid #dedede;
111
- display: inline-block;
112
- box-sizing: border-box;
113
- height: 35px;
114
- padding: 8px 8px 7px !important;
115
- border-right: 1px solid transparent;
116
- }
117
- .ghost {
118
- opacity: 0;
119
- filter: alpha(opacity=0);
120
- }
121
- .content {
122
- position: absolute;
123
- left: 0;
124
- }
125
- }
126
- }
127
-
128
- .footer::-webkit-scrollbar {
129
- display: none;
130
- width: 0!important;
131
- height: 0!important;
132
- opacity: 0;
133
- filter: alpha(opacity=0);
134
- }
135
-
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-SuperTable {
4
+ border-spacing: 0;
5
+ cursor: default;
6
+
7
+ table {
8
+ white-space: pre;
9
+
10
+ :global(.ant-checkbox-input) {
11
+ z-index: -1;
12
+ }
13
+ }
14
+
15
+ :global(.ant-table-placeholder) {
16
+ padding: 0;
17
+
18
+ > div {
19
+ margin: 0;
20
+ }
21
+ }
22
+
23
+ .select {
24
+ background-color: @primary-1;
25
+ }
26
+
27
+ .center {
28
+ text-align: center !important;
29
+ }
30
+
31
+ .left {
32
+ text-align: left !important;
33
+ }
34
+
35
+ .right {
36
+ text-align: right !important;
37
+ }
38
+
39
+ .emphasizedSelectRow{
40
+ background-color: @table-row-hover-bg;
41
+ color :#000;
42
+ font-weight: 700;
43
+ }
44
+ .emphasizedUnselectRow{
45
+ color :#000;
46
+ font-weight: 700;
47
+ }
48
+
49
+ .weakenedSelectRow{
50
+ background-color: @table-row-hover-bg;
51
+ color :#999;
52
+ }
53
+ .weakenedUnselectRow{
54
+ color :#999;
55
+ }
56
+
57
+ .warningRow{
58
+ color: red;
59
+ }
60
+
61
+ .noTransition{
62
+ tr {
63
+ transition: all 0s!important;
64
+ >td{
65
+ transition: all 0s!important;
66
+ }
67
+ }
68
+ }
69
+
70
+ .noWrap{
71
+ white-space: nowrap;
72
+ }
73
+
74
+ .totalRow {
75
+ color: #222!important;
76
+ background-color: #f0f0f0!important;
77
+ transition: all 0s!important;
78
+ td {
79
+ border-top: 1px solid #ddd!important;
80
+ background-color: #f0f0f0!important;
81
+ border-bottom: 0!important;
82
+ transition: all 0s!important;
83
+ }
84
+ }
85
+
86
+ :global(.ant-table-footer) {
87
+ padding: 0!important;
88
+ }
89
+
90
+ .footer {
91
+ vertical-align: middle;
92
+ overflow: auto;
93
+ scrollbar-width: none;
94
+ -ms-overflow-style: none;
95
+ scrollbar-color: transparent transparent;
96
+ scrollbar-track-color: transparent;
97
+ -ms-scrollbar-track-color: transparent;
98
+ .footerItem {
99
+ white-space: pre;
100
+ > span {
101
+ display: inline-block;
102
+ color: #222;
103
+ position: relative;
104
+ vertical-align: middle;
105
+ border-top: 1px solid #dedede;
106
+ display: inline-block;
107
+ box-sizing: border-box;
108
+ height: 35px;
109
+ padding: 8px 8px 7px !important;
110
+ border-right: 1px solid transparent;
111
+ }
112
+ .ghost {
113
+ opacity: 0;
114
+ filter: alpha(opacity=0);
115
+ }
116
+ .content {
117
+ position: absolute;
118
+ left: 0;
119
+ }
120
+ }
121
+ }
122
+
123
+ .footer::-webkit-scrollbar {
124
+ display: none;
125
+ width: 0!important;
126
+ height: 0!important;
127
+ opacity: 0;
128
+ filter: alpha(opacity=0);
129
+ }
130
+ }
131
+
132
+
@@ -1,6 +1,6 @@
1
- {
2
- "name": "SuperTable",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./SuperTable.js"
6
- }
1
+ {
2
+ "name": "SuperTable",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SuperTable.js"
6
+ }
@@ -61,17 +61,17 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select', //
61
61
  'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar', //按钮组
62
62
  'img' //图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
63
63
  ];
64
- /**
65
- * key:标识所在列,在一个表格中必须唯一
66
- * title:列的标题,type为checkbox时,title为空字符串时,表头才会显示为复选框
67
- * type:嵌入的表单元素类型
68
- * link: 是否为超链接,type未设置时,该属性才生效。为true表示内容来至items,为字符串表示超链接内容就是该字符串
69
- * options: 对象(包含value和title)数组
70
- * props:传递参数给被嵌入的组件
71
- * width: 嵌入的组件的宽度,默认值为100
72
- * align:对齐方式,index默认center,其他类型默认为left
73
- * showAdd: 表头是否显示+号,默认为false,加号会触发onAdd事件
74
- * hide: 为true时隐藏该列
64
+ /**
65
+ * key:标识所在列,在一个表格中必须唯一
66
+ * title:列的标题,type为checkbox时,title为空字符串时,表头才会显示为复选框
67
+ * type:嵌入的表单元素类型
68
+ * link: 是否为超链接,type未设置时,该属性才生效。为true表示内容来至items,为字符串表示超链接内容就是该字符串
69
+ * options: 对象(包含value和title)数组
70
+ * props:传递参数给被嵌入的组件
71
+ * width: 嵌入的组件的宽度,默认值为100
72
+ * align:对齐方式,index默认center,其他类型默认为left
73
+ * showAdd: 表头是否显示+号,默认为false,加号会触发onAdd事件
74
+ * hide: 为true时隐藏该列
75
75
  */
76
76
 
77
77
  var ColType = {
@@ -86,14 +86,14 @@ var ColType = {
86
86
  hide: PropTypes.bool,
87
87
  props: PropTypes.any
88
88
  };
89
- /**
90
- * onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
91
- * onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
92
- * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value)
93
- * onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
94
- * onAdd:点击+号时触发,原型为function(keyName)
95
- * onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
96
- * onToolbar:点击表格列按钮组时触发,原型为function(按钮组列的key,rowIndex,该行数据的值,按钮key)
89
+ /**
90
+ * onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
91
+ * onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
92
+ * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value)
93
+ * onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
94
+ * onAdd:点击+号时触发,原型为function(keyName)
95
+ * onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
96
+ * onToolbar:点击表格列按钮组时触发,原型为function(按钮组列的key,rowIndex,该行数据的值,按钮key)
97
97
  */
98
98
 
99
99
  var CallbackType = {
@@ -106,9 +106,9 @@ var CallbackType = {
106
106
  onRenderCustom: PropTypes.func,
107
107
  onToolbar: PropTypes.func
108
108
  };
109
- /**
110
- * base[可选]:序号的开始数字,所有回调函数中的序号值都会加上这个值,默认值为0
111
- * isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
109
+ /**
110
+ * base[可选]:序号的开始数字,所有回调函数中的序号值都会加上这个值,默认值为0
111
+ * isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
112
112
  */
113
113
 
114
114
  var SuperTable2 = /*#__PURE__*/function (_React$Component) {