cloud-b2b 1.0.0 → 1.0.3

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.
Files changed (208) hide show
  1. package/es/Area/Area.js +166 -0
  2. package/es/Area/package.json +6 -0
  3. package/es/Card/Card.js +20 -0
  4. package/es/Card/package.json +6 -0
  5. package/es/Control/Control.js +428 -0
  6. package/es/Control/event.js +57 -0
  7. package/es/Control/package.json +6 -0
  8. package/es/Enhance/Dialogs.js +67 -0
  9. package/es/Enhance/Loading.js +151 -0
  10. package/es/Enhance/index.js +8 -0
  11. package/es/Enhance/package.json +6 -0
  12. package/es/Header/Header.js +194 -0
  13. package/es/Header/Header.less +95 -0
  14. package/es/Header/Vertical.js +129 -0
  15. package/es/Header/Vertical.less +60 -0
  16. package/es/Header/package.json +6 -0
  17. package/es/HomeHeader/Header.js +75 -0
  18. package/es/HomeHeader/Header.less +73 -0
  19. package/es/HomeHeader/package.json +6 -0
  20. package/es/ImageView/ImageView.js +117 -0
  21. package/es/ImageView/ImageView.less +14 -0
  22. package/es/ImageView/package.json +6 -0
  23. package/es/InpurCascader/InputCascader.js +135 -0
  24. package/es/InpurCascader/package.json +6 -0
  25. package/es/InputEditor/InputEditor.js +118 -0
  26. package/es/InputEditor/inputEditor.less +8 -0
  27. package/es/InputEditor/package.json +6 -0
  28. package/es/InputSearch/InputSearch.js +306 -0
  29. package/es/InputSearch/package.json +6 -0
  30. package/es/InputSelect/InputSelect.js +185 -0
  31. package/es/InputSelect/package.json +6 -0
  32. package/es/InputWriting/InputWriting.js +107 -0
  33. package/es/InputWriting/package.json +6 -0
  34. package/es/Layout/Layout.js +232 -0
  35. package/es/Layout/Layout.less +28 -0
  36. package/es/Layout/package.json +6 -0
  37. package/es/LayoutLink/LayoutLink.js +82 -0
  38. package/es/LayoutLink/LayoutLink.less +53 -0
  39. package/es/LayoutLink/package.json +6 -0
  40. package/es/Link/Link.js +108 -0
  41. package/es/Link/package.json +6 -0
  42. package/es/Loading/Loading.js +15 -0
  43. package/es/Loading/Loading.less +13 -0
  44. package/es/Loading/package.json +6 -0
  45. package/es/Loading2/Loading2.js +11 -0
  46. package/es/Loading2/Loading2.less +19 -0
  47. package/es/Loading2/package.json +6 -0
  48. package/es/ModalWithDrag/ModalWithDrag.js +34 -0
  49. package/es/ModalWithDrag/ModalWithDrag.less +6 -0
  50. package/es/ModalWithDrag/drag.js +133 -0
  51. package/es/ModalWithDrag/package.json +6 -0
  52. package/es/NumberInput/NumberInput.js +237 -0
  53. package/es/NumberInput/package.json +6 -0
  54. package/es/Search/Search.js +581 -0
  55. package/es/Search/Search.less +63 -0
  56. package/es/Search/package.json +6 -0
  57. package/es/Sidebar/Sidebar.js +165 -0
  58. package/es/Sidebar/Sidebar.less +78 -0
  59. package/es/Sidebar/package.json +6 -0
  60. package/es/Sidebar2/Sidebar.js +192 -0
  61. package/es/Sidebar2/Sidebar.less +153 -0
  62. package/es/Sidebar2/package.json +6 -0
  63. package/es/SuperForm/SuperForm.js +688 -0
  64. package/es/SuperForm/SuperForm.less +52 -0
  65. package/es/SuperForm/package.json +6 -0
  66. package/es/SuperIcon/SuperIcon.js +30 -0
  67. package/es/SuperIcon/package.json +6 -0
  68. package/es/SuperPagination/SuperPagination.js +126 -0
  69. package/es/SuperPagination/package.json +6 -0
  70. package/es/SuperTable/DragSortRow.js +125 -0
  71. package/es/SuperTable/DragSortRow.less +17 -0
  72. package/es/SuperTable/FilterDropDown.js +188 -0
  73. package/es/SuperTable/FilterDropDown.less +30 -0
  74. package/es/SuperTable/SuperTable.js +933 -0
  75. package/es/SuperTable/SuperTable.less +135 -0
  76. package/es/SuperTable/fixed.js +42 -0
  77. package/es/SuperTable/package.json +6 -0
  78. package/es/SuperTable2/SuperTable2.js +700 -0
  79. package/es/SuperTable2/SuperTable2.less +100 -0
  80. package/es/SuperTable2/SuperTableCell.js +215 -0
  81. package/es/SuperTable2/package.json +6 -0
  82. package/es/SuperToolbar/SuperToolbar.js +223 -0
  83. package/es/SuperToolbar/SuperToolbar.less +17 -0
  84. package/es/SuperToolbar/package.json +6 -0
  85. package/es/SuperUpload/SuperUpload.js +282 -0
  86. package/es/SuperUpload/SuperUpload.less +27 -0
  87. package/es/SuperUpload/package.json +6 -0
  88. package/es/Title/Title.less +35 -35
  89. package/es/Title/package.json +6 -6
  90. package/es/Viewer/ImageViews.js +311 -0
  91. package/es/Viewer/Viewer.js +149 -0
  92. package/es/Viewer/Viewer.less +67 -0
  93. package/es/Viewer/imgView.less +59 -0
  94. package/es/Viewer/package.json +7 -0
  95. package/es/WingBlank/WingBlank.js +20 -0
  96. package/es/WingBlank/WingBlank.less +12 -0
  97. package/es/WingBlank/package.json +6 -0
  98. package/es/adjust.less +89 -0
  99. package/es/helper.js +118 -0
  100. package/es/history.js +5 -0
  101. package/es/index.js +27 -1
  102. package/es/style.less +20 -1
  103. package/es/variables.less +73 -73
  104. package/lib/Area/Area.js +194 -0
  105. package/lib/Area/package.json +6 -0
  106. package/lib/Card/Card.js +38 -0
  107. package/lib/Card/package.json +6 -0
  108. package/lib/Control/Control.js +477 -0
  109. package/lib/Control/event.js +68 -0
  110. package/lib/Control/package.json +6 -0
  111. package/lib/Enhance/Dialogs.js +87 -0
  112. package/lib/Enhance/Loading.js +175 -0
  113. package/lib/Enhance/index.js +35 -0
  114. package/lib/Enhance/package.json +6 -0
  115. package/lib/Header/Header.js +215 -0
  116. package/lib/Header/Header.less +95 -0
  117. package/lib/Header/Vertical.js +150 -0
  118. package/lib/Header/Vertical.less +60 -0
  119. package/lib/Header/package.json +6 -0
  120. package/lib/HomeHeader/Header.js +95 -0
  121. package/lib/HomeHeader/Header.less +73 -0
  122. package/lib/HomeHeader/package.json +6 -0
  123. package/lib/ImageView/ImageView.js +134 -0
  124. package/lib/ImageView/ImageView.less +14 -0
  125. package/lib/ImageView/package.json +6 -0
  126. package/lib/InpurCascader/InputCascader.js +156 -0
  127. package/lib/InpurCascader/package.json +6 -0
  128. package/lib/InputEditor/InputEditor.js +136 -0
  129. package/lib/InputEditor/inputEditor.less +8 -0
  130. package/lib/InputEditor/package.json +6 -0
  131. package/lib/InputSearch/InputSearch.js +322 -0
  132. package/lib/InputSearch/package.json +6 -0
  133. package/lib/InputSelect/InputSelect.js +208 -0
  134. package/lib/InputSelect/package.json +6 -0
  135. package/lib/InputWriting/InputWriting.js +123 -0
  136. package/lib/InputWriting/package.json +6 -0
  137. package/lib/Layout/Layout.js +258 -0
  138. package/lib/Layout/Layout.less +28 -0
  139. package/lib/Layout/package.json +6 -0
  140. package/lib/LayoutLink/LayoutLink.js +114 -0
  141. package/lib/LayoutLink/LayoutLink.less +53 -0
  142. package/lib/LayoutLink/package.json +6 -0
  143. package/lib/Link/Link.js +130 -0
  144. package/lib/Link/package.json +6 -0
  145. package/lib/Loading/Loading.js +30 -0
  146. package/lib/Loading/Loading.less +13 -0
  147. package/lib/Loading/package.json +6 -0
  148. package/lib/Loading2/Loading2.js +26 -0
  149. package/lib/Loading2/Loading2.less +19 -0
  150. package/lib/Loading2/package.json +6 -0
  151. package/lib/ModalWithDrag/ModalWithDrag.js +53 -0
  152. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  153. package/lib/ModalWithDrag/drag.js +147 -0
  154. package/lib/ModalWithDrag/package.json +6 -0
  155. package/lib/NumberInput/NumberInput.js +259 -0
  156. package/lib/NumberInput/package.json +6 -0
  157. package/lib/Search/Search.js +603 -0
  158. package/lib/Search/Search.less +63 -0
  159. package/lib/Search/package.json +6 -0
  160. package/lib/Sidebar/Sidebar.js +186 -0
  161. package/lib/Sidebar/Sidebar.less +78 -0
  162. package/lib/Sidebar/package.json +6 -0
  163. package/lib/Sidebar2/Sidebar.js +213 -0
  164. package/lib/Sidebar2/Sidebar.less +153 -0
  165. package/lib/Sidebar2/package.json +6 -0
  166. package/lib/SuperForm/SuperForm.js +702 -0
  167. package/lib/SuperForm/SuperForm.less +52 -0
  168. package/lib/SuperForm/package.json +6 -0
  169. package/lib/SuperIcon/SuperIcon.js +47 -0
  170. package/lib/SuperIcon/package.json +6 -0
  171. package/lib/SuperPagination/SuperPagination.js +145 -0
  172. package/lib/SuperPagination/package.json +6 -0
  173. package/lib/SuperTable/DragSortRow.js +142 -0
  174. package/lib/SuperTable/DragSortRow.less +17 -0
  175. package/lib/SuperTable/FilterDropDown.js +205 -0
  176. package/lib/SuperTable/FilterDropDown.less +30 -0
  177. package/lib/SuperTable/SuperTable.js +937 -0
  178. package/lib/SuperTable/SuperTable.less +135 -0
  179. package/lib/SuperTable/fixed.js +55 -0
  180. package/lib/SuperTable/package.json +6 -0
  181. package/lib/SuperTable2/SuperTable2.js +725 -0
  182. package/lib/SuperTable2/SuperTable2.less +100 -0
  183. package/lib/SuperTable2/SuperTableCell.js +231 -0
  184. package/lib/SuperTable2/package.json +6 -0
  185. package/lib/SuperToolbar/SuperToolbar.js +248 -0
  186. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  187. package/lib/SuperToolbar/package.json +6 -0
  188. package/lib/SuperUpload/SuperUpload.js +324 -0
  189. package/lib/SuperUpload/SuperUpload.less +27 -0
  190. package/lib/SuperUpload/package.json +6 -0
  191. package/lib/Title/Title.less +35 -35
  192. package/lib/Title/package.json +6 -6
  193. package/lib/Viewer/ImageViews.js +323 -0
  194. package/lib/Viewer/Viewer.js +167 -0
  195. package/lib/Viewer/Viewer.less +67 -0
  196. package/lib/Viewer/imgView.less +59 -0
  197. package/lib/Viewer/package.json +7 -0
  198. package/lib/WingBlank/WingBlank.js +37 -0
  199. package/lib/WingBlank/WingBlank.less +12 -0
  200. package/lib/WingBlank/package.json +6 -0
  201. package/lib/adjust.less +89 -0
  202. package/lib/helper.js +147 -0
  203. package/lib/history.js +18 -0
  204. package/lib/index.js +235 -1
  205. package/lib/index.less +25 -1
  206. package/lib/style.less +20 -1
  207. package/lib/variables.less +73 -73
  208. package/package.json +3 -2
@@ -0,0 +1,100 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-SuperTable2 {
4
+ border-spacing: 0;
5
+ cursor: default;
6
+
7
+ :global(.ant-checkbox-input) {
8
+ z-index: -1;
9
+ }
10
+
11
+ :global(.ant-select-selection--multiple) {
12
+ max-width: 200px;
13
+ max-height: 22px;
14
+ overflow: auto;
15
+ }
16
+
17
+ :global(.ant-select-search__field) {
18
+ z-index: 0;
19
+ }
20
+
21
+ :global(.ant-switch-disabled) {
22
+ background: #e4e4e4;
23
+ }
24
+
25
+ :global(.ant-switch-checked) {
26
+ background: #2CBB45!important;
27
+ }
28
+
29
+ th [role='add'] {
30
+ color: @primary-color;
31
+ margin-left: 4px;
32
+ cursor: pointer;
33
+ }
34
+
35
+ td [role='imgBox']{
36
+ color: @primary-color;
37
+
38
+ span {
39
+ margin-left: 10px;
40
+ overflow: hidden;
41
+ text-overflow: ellipsis;
42
+ max-width: 100px;
43
+ }
44
+ }
45
+
46
+ :global(.ant-table-placeholder) {
47
+ padding: 0;
48
+
49
+ > div {
50
+ margin: 0;
51
+
52
+ :global(.ant-empty-image) {
53
+ display: none;
54
+ }
55
+ }
56
+ }
57
+
58
+ .emphasizedSelectRow{
59
+ background-color: @table-row-hover-bg;
60
+ color :#000;
61
+ font-weight: 700;
62
+ }
63
+ .emphasizedUnselectRow{
64
+ color :#000;
65
+ font-weight: 700;
66
+ }
67
+
68
+ .select {
69
+ background-color: @table-row-hover-bg;
70
+ }
71
+
72
+ .center {
73
+ text-align: center !important;
74
+ }
75
+
76
+ .left {
77
+ text-align: left !important;
78
+ }
79
+
80
+ .right {
81
+ text-align: right !important;
82
+ }
83
+
84
+ .noTransition{
85
+ tr {
86
+ transition: all 0s!important;
87
+ >td{
88
+ transition: all 0s!important;
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ .weakenedSelectRow{
95
+ background-color: @table-row-hover-bg;
96
+ color :#999;
97
+ }
98
+ .weakenedUnselectRow{
99
+ color :#999;
100
+ }
@@ -0,0 +1,215 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
3
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
4
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
5
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
6
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
7
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
8
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
9
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
10
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
11
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
12
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
13
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
14
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
15
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
16
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
17
+
18
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
21
+
22
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
+
26
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
+
28
+ import React from 'react';
29
+ import PropTypes from 'prop-types';
30
+ import ReactDOM from 'react-dom';
31
+ import Control from '../Control'; // 单元格的type只能取如下值:
32
+ // 'text', 'number', select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'
33
+
34
+ var isInRegion = function isInRegion(target, _ref) {
35
+ var x = _ref.x,
36
+ y = _ref.y;
37
+
38
+ var _target$getBoundingCl = target.getBoundingClientRect(),
39
+ left = _target$getBoundingCl.left,
40
+ right = _target$getBoundingCl.right,
41
+ top = _target$getBoundingCl.top,
42
+ bottom = _target$getBoundingCl.bottom;
43
+
44
+ return !(x < left || x > right || y < top || y > bottom);
45
+ };
46
+
47
+ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
48
+ _inherits(SuperTableCell, _React$Component);
49
+
50
+ var _super = _createSuper(SuperTableCell);
51
+
52
+ function SuperTableCell() {
53
+ var _context;
54
+
55
+ var _this;
56
+
57
+ _classCallCheck(this, SuperTableCell);
58
+
59
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
60
+ args[_key] = arguments[_key];
61
+ }
62
+
63
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
64
+
65
+ _defineProperty(_assertThisInitialized(_this), "onDateBlur", function (value, event) {
66
+ if (!isInRegion(event.target, global.mousePos)) {
67
+ _this.props.onBlur();
68
+ }
69
+ });
70
+
71
+ _defineProperty(_assertThisInitialized(_this), "onOpenChange", function (open) {
72
+ if (!open) {
73
+ var targets = document.getElementsByClassName('ant-calendar-picker-container');
74
+
75
+ if (!isInRegion(targets[0], global.mousePos)) {
76
+ _this.props.onBlur();
77
+ }
78
+ }
79
+ });
80
+
81
+ _defineProperty(_assertThisInitialized(_this), "options", function () {
82
+ return _this.props.options || _this.props.typeRelated || [];
83
+ });
84
+
85
+ _defineProperty(_assertThisInitialized(_this), "getPopupContainer", function () {
86
+ return ReactDOM.findDOMNode(_assertThisInitialized(_this));
87
+ });
88
+
89
+ _defineProperty(_assertThisInitialized(_this), "toTextComponent", function (props) {
90
+ return /*#__PURE__*/React.createElement(Control, props);
91
+ });
92
+
93
+ _defineProperty(_assertThisInitialized(_this), "toTextAreaComponent", function (props) {
94
+ return /*#__PURE__*/React.createElement(Control, props);
95
+ });
96
+
97
+ _defineProperty(_assertThisInitialized(_this), "toReadonlyComponent", function (props) {
98
+ return /*#__PURE__*/React.createElement(Control, props);
99
+ });
100
+
101
+ _defineProperty(_assertThisInitialized(_this), "toNumberComponent", function (props) {
102
+ props.defaultValue = props.value;
103
+ delete props.value;
104
+ return /*#__PURE__*/React.createElement(Control, props);
105
+ });
106
+
107
+ _defineProperty(_assertThisInitialized(_this), "toDateComponent", function (props) {
108
+ //props.getCalendarContainer = this.getPopupContainer;
109
+ props.onBlur = _this.onDateBlur;
110
+ props.onOpenChange = _this.onOpenChange;
111
+ return /*#__PURE__*/React.createElement(Control, props);
112
+ });
113
+
114
+ _defineProperty(_assertThisInitialized(_this), "toSelectComponent", function (props) {
115
+ props.options = _this.options();
116
+ props.dropdownMatchSelectWidth = false; //props.getPopupContainer = this.getPopupContainer;
117
+
118
+ return /*#__PURE__*/React.createElement(Control, props);
119
+ });
120
+
121
+ _defineProperty(_assertThisInitialized(_this), "toSearchComponent", function (props) {
122
+ props.options = _this.options(); //props.getPopupContainer = this.getPopupContainer;
123
+
124
+ props.onSearch = _this.props.onSearch;
125
+ props.dropdownMatchSelectWidth = false;
126
+ return /*#__PURE__*/React.createElement(Control, props);
127
+ });
128
+
129
+ _defineProperty(_assertThisInitialized(_this), "controlProps", function (_ref2) {
130
+ var type = _ref2.type,
131
+ value = _ref2.value,
132
+ _ref2$props = _ref2.props,
133
+ props = _ref2$props === void 0 ? {} : _ref2$props;
134
+ var _this$props$width = _this.props.width,
135
+ width = _this$props$width === void 0 ? 100 : _this$props$width;
136
+ type === 'readonly' && (props = {});
137
+ return _objectSpread(_objectSpread({}, props), {}, {
138
+ type: type,
139
+ value: value,
140
+ size: 'small',
141
+ autoFocus: _this.props.error,
142
+ style: {
143
+ width: '100%',
144
+ minWidth: width
145
+ },
146
+ onBlur: _this.props.onBlur,
147
+ onChange: _this.props.onChange
148
+ });
149
+ });
150
+
151
+ return _this;
152
+ }
153
+
154
+ _createClass(SuperTableCell, [{
155
+ key: "render",
156
+ value: function render() {
157
+ var props = this.controlProps(this.props);
158
+ var className = this.props.error ? 'has-error' : '';
159
+
160
+ switch (this.props.type) {
161
+ case "text":
162
+ return /*#__PURE__*/React.createElement("div", {
163
+ className: className
164
+ }, this.toTextComponent(props));
165
+
166
+ case "textArea":
167
+ return /*#__PURE__*/React.createElement("div", {
168
+ className: className
169
+ }, this.toTextAreaComponent(props));
170
+
171
+ case "number":
172
+ return /*#__PURE__*/React.createElement("div", {
173
+ className: className
174
+ }, this.toNumberComponent(props));
175
+
176
+ case "select":
177
+ return /*#__PURE__*/React.createElement("div", {
178
+ className: className
179
+ }, this.toSelectComponent(props));
180
+
181
+ case 'search':
182
+ case 'selectSearch':
183
+ return /*#__PURE__*/React.createElement("div", {
184
+ className: className
185
+ }, this.toSearchComponent(props));
186
+
187
+ case "date":
188
+ return /*#__PURE__*/React.createElement("div", {
189
+ className: className
190
+ }, this.toDateComponent(props));
191
+
192
+ case 'readonly':
193
+ return this.toReadonlyComponent(props);
194
+
195
+ default:
196
+ return /*#__PURE__*/React.createElement("div", null, "\"error type\"");
197
+ }
198
+ }
199
+ }]);
200
+
201
+ return SuperTableCell;
202
+ }(React.Component);
203
+
204
+ _defineProperty(SuperTableCell, "propTypes", {
205
+ type: PropTypes.string.isRequired,
206
+ value: PropTypes.any,
207
+ options: PropTypes.array,
208
+ props: PropTypes.object,
209
+ onChange: PropTypes.func,
210
+ onSearch: PropTypes.func,
211
+ onBlur: PropTypes.func
212
+ });
213
+
214
+ export default SuperTableCell;
215
+ export { isInRegion };
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "SuperTable2",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SuperTable2.js"
6
+ }
@@ -0,0 +1,223 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Popconfirm from "antd/es/popconfirm";
3
+ import _Dropdown from "antd/es/dropdown";
4
+ import _Icon from "antd/es/icon";
5
+ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
6
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
7
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
8
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
9
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
10
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
11
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
12
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
13
+ import _Button from "antd/es/button";
14
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
15
+ import _Menu from "antd/es/menu";
16
+ var _excluded = ["type", "children"];
17
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
18
+ import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
19
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
20
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
21
+
22
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+
24
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
+
26
+ import React from 'react';
27
+ import PropTypes from 'prop-types';
28
+ import variables from '../variables';
29
+ var MenuItem = _Menu.Item;
30
+ var SubMenu = _Menu.SubMenu;
31
+ var clicktag = 0; //被点击标识
32
+
33
+ /**
34
+ * key: 用于标识菜单项
35
+ * title: 菜单项上的文字
36
+ * subMenu: [可选],菜单项子列表,包含key和title的对象数组,此时点击菜单项不触发事件,只有点击子列表项才会触发onSubClick事件
37
+ */
38
+
39
+ var MenuType = {
40
+ key: PropTypes.string.isRequired,
41
+ title: PropTypes.string.isRequired,
42
+ subMenu: PropTypes.array
43
+ };
44
+ /**
45
+ * key: 用于标识按钮
46
+ * title: 按钮上的文字
47
+ * bsStyle: 按钮样式,与antd中Button的type取值一样
48
+ * confirm: 触发按钮事件前,是否需要用户确认,以及确认的提示文字;为空串则不会触发确认提示
49
+ * menu: [可选],下拉菜单项,有此属性时点击按钮不触发事件,菜单项如果仅是包含key和title的对象,点击菜单项会触发onClick事件
50
+ * 菜单项如果是包含key、title、subMenu的对象,则点击此菜单项不触发事件,必须点击子列表项时才会触发onSubClick事件
51
+ * loading: 是否正在加载,与antd中Button的loading取值一样
52
+ */
53
+
54
+ var ButtonType = {
55
+ key: PropTypes.string.isRequired,
56
+ title: PropTypes.string.isRequired,
57
+ bsStyle: PropTypes.string,
58
+ confirm: PropTypes.string,
59
+ menu: PropTypes.arrayOf(PropTypes.shape(MenuType)),
60
+ loading: PropTypes.bool
61
+ };
62
+
63
+ var ButtonEx = function ButtonEx(_ref) {
64
+ var type = _ref.type,
65
+ children = _ref.children,
66
+ props = _objectWithoutProperties(_ref, _excluded);
67
+
68
+ props[type === 'primary-o' ? 'data-btn-type' : 'type'] = type;
69
+ return /*#__PURE__*/React.createElement(_Button, props, children);
70
+ };
71
+ /**
72
+ * onClick: 纯按钮点击时或按钮下拉项中无子菜单列表项点击触发,原型为function(key)
73
+ * onSubClick: 按钮为下拉时下拉项子列表项点击时触发,原型为function(key, subKey)
74
+ */
75
+
76
+
77
+ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
78
+ _inherits(SuperToolbar, _React$Component);
79
+
80
+ var _super = _createSuper(SuperToolbar);
81
+
82
+ function SuperToolbar() {
83
+ var _context;
84
+
85
+ var _this;
86
+
87
+ _classCallCheck(this, SuperToolbar);
88
+
89
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
90
+ args[_key] = arguments[_key];
91
+ }
92
+
93
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
94
+
95
+ _defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
96
+ var _this$props = _this.props,
97
+ onClick = _this$props.onClick,
98
+ onSubClick = _this$props.onSubClick;
99
+ var key = _typeof(e) === 'object' ? e.key : e;
100
+
101
+ if (_typeof(e) === 'object' && e.keyPath.length === 2 && onSubClick) {
102
+ onSubClick(e.keyPath[1], e.keyPath[0]);
103
+ } else if (onClick) {
104
+ if (clicktag === 0) {
105
+ clicktag = 1;
106
+ onClick(key); //1秒过后可以再次点击
107
+
108
+ _setTimeout(function () {
109
+ clicktag = 0;
110
+ }, 1000);
111
+ } else {
112
+ console.log('请勿频繁操作!');
113
+ }
114
+ }
115
+ });
116
+
117
+ _defineProperty(_assertThisInitialized(_this), "toSubMenu", function (_ref2) {
118
+ var key = _ref2.key,
119
+ title = _ref2.title,
120
+ _ref2$subMenu = _ref2.subMenu,
121
+ subMenu = _ref2$subMenu === void 0 ? [] : _ref2$subMenu;
122
+ return /*#__PURE__*/React.createElement(SubMenu, {
123
+ key: key,
124
+ title: title
125
+ }, _mapInstanceProperty(subMenu).call(subMenu, function (_ref3) {
126
+ var key = _ref3.key,
127
+ title = _ref3.title;
128
+ return /*#__PURE__*/React.createElement(MenuItem, {
129
+ key: key
130
+ }, title);
131
+ }));
132
+ });
133
+
134
+ _defineProperty(_assertThisInitialized(_this), "toMenu", function (menu) {
135
+ return /*#__PURE__*/React.createElement(_Menu, {
136
+ onClick: _this.onClick
137
+ }, _mapInstanceProperty(menu).call(menu, function (item) {
138
+ var key = item.key,
139
+ title = item.title,
140
+ subMenu = item.subMenu;
141
+
142
+ if (subMenu) {
143
+ return _this.toSubMenu(item);
144
+ } else {
145
+ return /*#__PURE__*/React.createElement(MenuItem, {
146
+ key: key
147
+ }, title);
148
+ }
149
+ }));
150
+ });
151
+
152
+ _defineProperty(_assertThisInitialized(_this), "toButton", function (_ref4) {
153
+ var _context2;
154
+
155
+ var key = _ref4.key,
156
+ title = _ref4.title,
157
+ type = _ref4.bsStyle,
158
+ confirm = _ref4.confirm,
159
+ menu = _ref4.menu,
160
+ loading = _ref4.loading;
161
+
162
+ var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _assertThisInitialized(_this), key);
163
+
164
+ var _this$props$size = _this.props.size,
165
+ size = _this$props$size === void 0 ? 'small' : _this$props$size;
166
+
167
+ if (menu && menu.length) {
168
+ return /*#__PURE__*/React.createElement(_Dropdown, {
169
+ key: key,
170
+ trigger: ['hover'],
171
+ overlay: _this.toMenu(menu)
172
+ }, /*#__PURE__*/React.createElement(ButtonEx, {
173
+ size: size,
174
+ type: type
175
+ }, title, /*#__PURE__*/React.createElement(_Icon, {
176
+ type: "down"
177
+ })));
178
+ } else if (!confirm) {
179
+ return /*#__PURE__*/React.createElement(ButtonEx, {
180
+ key: key,
181
+ size: size,
182
+ type: type,
183
+ onClick: onClick,
184
+ loading: loading
185
+ }, title);
186
+ } else {
187
+ return /*#__PURE__*/React.createElement(_Popconfirm, {
188
+ key: key,
189
+ title: confirm,
190
+ onConfirm: onClick
191
+ }, /*#__PURE__*/React.createElement(ButtonEx, {
192
+ size: size,
193
+ type: type,
194
+ loading: loading
195
+ }, title));
196
+ }
197
+ });
198
+
199
+ return _this;
200
+ }
201
+
202
+ _createClass(SuperToolbar, [{
203
+ key: "render",
204
+ value: function render() {
205
+ var buttons = this.props.buttons;
206
+ return /*#__PURE__*/React.createElement("div", {
207
+ className: variables('SuperToolbar'),
208
+ role: "toolbar"
209
+ }, _mapInstanceProperty(buttons).call(buttons, this.toButton));
210
+ }
211
+ }]);
212
+
213
+ return SuperToolbar;
214
+ }(React.Component);
215
+
216
+ _defineProperty(SuperToolbar, "propTypes", {
217
+ buttons: PropTypes.arrayOf(PropTypes.shape(ButtonType)).isRequired,
218
+ size: PropTypes.oneOf(['small', 'default', 'large']),
219
+ onClick: PropTypes.func,
220
+ onSubClick: PropTypes.func
221
+ });
222
+
223
+ export default SuperToolbar;
@@ -0,0 +1,17 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-SuperToolbar {
4
+ > * {
5
+ margin-right: 5px;
6
+ }
7
+
8
+ [data-btn-type='primary-o'] {
9
+ color: @brand-primary;
10
+ border-color: @brand-primary;
11
+
12
+ &:hover {
13
+ color: @primary-5;
14
+ border-color: @primary-5;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "SuperToolbar",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SuperToolbar.js"
6
+ }