@vortex-ui/env-puzzle 2.0.0-beta.2 → 2.0.0-beta.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 (230) hide show
  1. package/lib/b-map/b-map.d.ts +63 -0
  2. package/lib/b-map/b-map.js +296 -0
  3. package/lib/b-map/b-map.js.map +1 -0
  4. package/lib/b-map/custom-overlay.d.ts +13 -0
  5. package/lib/b-map/custom-overlay.js +84 -0
  6. package/lib/b-map/custom-overlay.js.map +1 -0
  7. package/lib/b-map/drawing.d.ts +14 -0
  8. package/lib/b-map/drawing.js +73 -0
  9. package/lib/b-map/drawing.js.map +1 -0
  10. package/lib/b-map/index.d.ts +17 -0
  11. package/lib/b-map/index.js +35 -0
  12. package/lib/b-map/index.js.map +1 -0
  13. package/lib/b-map/js/marker-clusterer.js +158 -42
  14. package/lib/b-map/js/marker-clusterer.js.map +1 -1
  15. package/lib/b-map/lushu.d.ts +16 -0
  16. package/lib/b-map/lushu.js +78 -0
  17. package/lib/b-map/lushu.js.map +1 -0
  18. package/lib/b-map/marker-clusterer.d.ts +29 -0
  19. package/lib/b-map/marker-clusterer.js +52 -0
  20. package/lib/b-map/marker-clusterer.js.map +1 -0
  21. package/lib/b-map/marker.d.ts +45 -0
  22. package/lib/b-map/marker.js +184 -0
  23. package/lib/b-map/marker.js.map +1 -0
  24. package/lib/b-map/polygon.d.ts +54 -0
  25. package/lib/b-map/polygon.js +44 -0
  26. package/lib/b-map/polygon.js.map +1 -0
  27. package/lib/b-map/style/css.js +4 -0
  28. package/lib/b-map/style/css.js.map +1 -0
  29. package/lib/b-map/style/index.d.ts +1 -0
  30. package/lib/b-map/style/index.js +4 -0
  31. package/lib/b-map/style/index.js.map +1 -0
  32. package/lib/create-modal/create-modal.d.ts +31 -0
  33. package/lib/create-modal/create-modal.js +653 -0
  34. package/lib/create-modal/create-modal.js.map +1 -0
  35. package/lib/create-modal/index.d.ts +3 -0
  36. package/lib/create-modal/index.js +14 -0
  37. package/lib/create-modal/index.js.map +1 -0
  38. package/lib/create-modal/style/css.js +22 -0
  39. package/lib/create-modal/style/css.js.map +1 -0
  40. package/lib/create-modal/style/index.d.ts +10 -0
  41. package/lib/create-modal/style/index.js +22 -0
  42. package/lib/create-modal/style/index.js.map +1 -0
  43. package/lib/import-modal/import-modal.d.ts +23 -0
  44. package/lib/import-modal/import-modal.js +358 -0
  45. package/lib/import-modal/import-modal.js.map +1 -0
  46. package/lib/import-modal/index.d.ts +2 -0
  47. package/lib/import-modal/index.js +14 -0
  48. package/lib/import-modal/index.js.map +1 -0
  49. package/lib/import-modal/style/css.js +14 -0
  50. package/lib/import-modal/style/css.js.map +1 -0
  51. package/lib/import-modal/style/index.d.ts +6 -0
  52. package/lib/import-modal/style/index.js +14 -0
  53. package/lib/import-modal/style/index.js.map +1 -0
  54. package/lib/index.d.ts +13 -0
  55. package/lib/index.js +104 -0
  56. package/lib/index.js.map +1 -0
  57. package/lib/interface/index.d.ts +7 -0
  58. package/lib/interface/index.js +6 -0
  59. package/lib/interface/index.js.map +1 -0
  60. package/lib/mapv-Layer/Function.d.ts +1 -0
  61. package/lib/mapv-Layer/Function.js +2 -0
  62. package/lib/mapv-Layer/Function.js.map +1 -1
  63. package/lib/mapv-Layer/index.d.ts +2 -0
  64. package/lib/mapv-Layer/index.js +14 -0
  65. package/lib/mapv-Layer/index.js.map +1 -0
  66. package/lib/mapv-Layer/mapv-Layer.d.ts +7 -0
  67. package/lib/mapv-Layer/mapv-Layer.js +117 -0
  68. package/lib/mapv-Layer/mapv-Layer.js.map +1 -0
  69. package/lib/mapv-Layer/style/css.js +2 -0
  70. package/lib/mapv-Layer/style/css.js.map +1 -0
  71. package/lib/mapv-Layer/style/index.d.ts +1 -0
  72. package/lib/mapv-Layer/style/index.js +2 -0
  73. package/lib/mapv-Layer/style/index.js.map +1 -0
  74. package/lib/percent/images/icon-arrow.png +0 -0
  75. package/lib/percent/index.d.ts +8 -0
  76. package/lib/percent/index.js +18 -0
  77. package/lib/percent/index.js.map +1 -0
  78. package/lib/percent/interface.d.ts +6 -0
  79. package/lib/percent/interface.js +6 -0
  80. package/lib/percent/interface.js.map +1 -0
  81. package/lib/percent/line-percent.d.ts +11 -0
  82. package/lib/percent/line-percent.js +114 -0
  83. package/lib/percent/line-percent.js.map +1 -0
  84. package/lib/percent/percent.d.ts +10 -0
  85. package/lib/percent/percent.js +139 -0
  86. package/lib/percent/percent.js.map +1 -0
  87. package/lib/percent/style/css.js +4 -0
  88. package/lib/percent/style/css.js.map +1 -0
  89. package/lib/percent/style/index.d.ts +1 -0
  90. package/lib/percent/style/index.js +4 -0
  91. package/lib/percent/style/index.js.map +1 -0
  92. package/lib/scroll/index.d.ts +2 -0
  93. package/lib/scroll/index.js +14 -0
  94. package/lib/scroll/index.js.map +1 -0
  95. package/lib/scroll/scroll.d.ts +4 -0
  96. package/lib/scroll/scroll.js +105 -0
  97. package/lib/scroll/scroll.js.map +1 -0
  98. package/lib/scroll/style/css.js +4 -0
  99. package/lib/scroll/style/css.js.map +1 -0
  100. package/lib/scroll/style/index.d.ts +1 -0
  101. package/lib/scroll/style/index.js +4 -0
  102. package/lib/scroll/style/index.js.map +1 -0
  103. package/lib/scroll-select/index.d.ts +2 -0
  104. package/lib/scroll-select/index.js +14 -0
  105. package/lib/scroll-select/index.js.map +1 -0
  106. package/lib/scroll-select/scrollSelect.d.ts +2 -0
  107. package/lib/scroll-select/scrollSelect.js +323 -0
  108. package/lib/scroll-select/scrollSelect.js.map +1 -0
  109. package/lib/scroll-select/style/css.js +6 -0
  110. package/lib/scroll-select/style/css.js.map +1 -0
  111. package/lib/scroll-select/style/index.d.ts +2 -0
  112. package/lib/scroll-select/style/index.js +6 -0
  113. package/lib/scroll-select/style/index.js.map +1 -0
  114. package/lib/table/index.d.ts +2 -0
  115. package/lib/table/index.js +14 -0
  116. package/lib/table/index.js.map +1 -0
  117. package/lib/table/style/css.js +6 -0
  118. package/lib/table/style/css.js.map +1 -0
  119. package/lib/table/style/index.d.ts +2 -0
  120. package/lib/table/style/index.js +6 -0
  121. package/lib/table/style/index.js.map +1 -0
  122. package/lib/table/table.d.ts +17 -0
  123. package/lib/table/table.js +162 -0
  124. package/lib/table/table.js.map +1 -0
  125. package/lib/template/action.d.ts +57 -0
  126. package/lib/template/action.js +265 -0
  127. package/lib/template/action.js.map +1 -0
  128. package/lib/template/card-table.d.ts +35 -0
  129. package/lib/template/card-table.js +193 -0
  130. package/lib/template/card-table.js.map +1 -0
  131. package/lib/template/card.d.ts +15 -0
  132. package/lib/template/card.js +116 -0
  133. package/lib/template/card.js.map +1 -0
  134. package/lib/template/check-row.d.ts +6 -0
  135. package/lib/template/check-row.js +39 -0
  136. package/lib/template/check-row.js.map +1 -0
  137. package/lib/template/field.d.ts +6 -0
  138. package/lib/template/field.js +50 -0
  139. package/lib/template/field.js.map +1 -0
  140. package/lib/template/filter.d.ts +13 -0
  141. package/lib/template/filter.js +146 -0
  142. package/lib/template/filter.js.map +1 -0
  143. package/lib/template/icon.d.ts +6 -0
  144. package/lib/template/icon.js +33 -0
  145. package/lib/template/icon.js.map +1 -0
  146. package/lib/template/index.d.ts +13 -0
  147. package/lib/template/index.js +24 -0
  148. package/lib/template/index.js.map +1 -0
  149. package/lib/template/interface.d.ts +4 -0
  150. package/lib/template/interface.js +6 -0
  151. package/lib/template/interface.js.map +1 -0
  152. package/lib/template/renderColumnButtons.d.ts +2 -0
  153. package/lib/template/renderColumnButtons.js +173 -0
  154. package/lib/template/renderColumnButtons.js.map +1 -0
  155. package/lib/template/style/css.js +40 -0
  156. package/lib/template/style/css.js.map +1 -0
  157. package/lib/template/style/index.d.ts +19 -0
  158. package/lib/template/style/index.js +40 -0
  159. package/lib/template/style/index.js.map +1 -0
  160. package/lib/template/table.d.ts +44 -0
  161. package/lib/template/table.js +103 -0
  162. package/lib/template/table.js.map +1 -0
  163. package/lib/template/template.d.ts +84 -0
  164. package/lib/template/template.js +610 -0
  165. package/lib/template/template.js.map +1 -0
  166. package/lib/template/toolbar.d.ts +16 -0
  167. package/lib/template/toolbar.js +102 -0
  168. package/lib/template/toolbar.js.map +1 -0
  169. package/lib/to-map/container.d.ts +28 -0
  170. package/lib/to-map/container.js +295 -0
  171. package/lib/to-map/container.js.map +1 -0
  172. package/lib/to-map/draw-area.d.ts +6 -0
  173. package/lib/to-map/draw-area.js +66 -0
  174. package/lib/to-map/draw-area.js.map +1 -0
  175. package/lib/to-map/images/icon-area.png +0 -0
  176. package/lib/to-map/images/icon-picker.png +0 -0
  177. package/lib/to-map/index.d.ts +8 -0
  178. package/lib/to-map/index.js +18 -0
  179. package/lib/to-map/index.js.map +1 -0
  180. package/lib/to-map/style/css.js +6 -0
  181. package/lib/to-map/style/css.js.map +1 -0
  182. package/lib/to-map/style/index.d.ts +2 -0
  183. package/lib/to-map/style/index.js +6 -0
  184. package/lib/to-map/style/index.js.map +1 -0
  185. package/lib/to-map/to-map.d.ts +12 -0
  186. package/lib/to-map/to-map.js +120 -0
  187. package/lib/to-map/to-map.js.map +1 -0
  188. package/lib/upload/index.d.ts +2 -0
  189. package/lib/upload/index.js +14 -0
  190. package/lib/upload/index.js.map +1 -0
  191. package/lib/upload/style/css.js +10 -0
  192. package/lib/upload/style/css.js.map +1 -0
  193. package/lib/upload/style/index.d.ts +4 -0
  194. package/lib/upload/style/index.js +10 -0
  195. package/lib/upload/style/index.js.map +1 -0
  196. package/lib/upload/upload.d.ts +12 -0
  197. package/lib/upload/upload.js +445 -0
  198. package/lib/upload/upload.js.map +1 -0
  199. package/lib/use-simple-res/demos/index.d.ts +2 -0
  200. package/lib/use-simple-res/demos/index.js +116 -0
  201. package/lib/use-simple-res/demos/index.js.map +1 -0
  202. package/lib/use-simple-res/index.d.ts +28 -0
  203. package/lib/use-simple-res/index.js +99 -0
  204. package/lib/use-simple-res/index.js.map +1 -0
  205. package/lib/use-simple-res/style/css.js +4 -0
  206. package/lib/use-simple-res/style/css.js.map +1 -0
  207. package/lib/use-simple-res/style/index.d.ts +1 -0
  208. package/lib/use-simple-res/style/index.js +4 -0
  209. package/lib/use-simple-res/style/index.js.map +1 -0
  210. package/lib/utils/dom-util.d.ts +19 -0
  211. package/lib/utils/dom-util.js +98 -0
  212. package/lib/utils/dom-util.js.map +1 -0
  213. package/lib/utils/request-util.d.ts +42 -0
  214. package/lib/utils/request-util.js +191 -0
  215. package/lib/utils/request-util.js.map +1 -0
  216. package/lib/utils/string-util.d.ts +11 -0
  217. package/lib/utils/string-util.js +47 -0
  218. package/lib/utils/string-util.js.map +1 -0
  219. package/lib/view-modal/index.d.ts +2 -0
  220. package/lib/view-modal/index.js +14 -0
  221. package/lib/view-modal/index.js.map +1 -0
  222. package/lib/view-modal/style/css.js +16 -0
  223. package/lib/view-modal/style/css.js.map +1 -0
  224. package/lib/view-modal/style/index.d.ts +8 -0
  225. package/lib/view-modal/style/index.js +16 -0
  226. package/lib/view-modal/style/index.js.map +1 -0
  227. package/lib/view-modal/view-modal.d.ts +8 -0
  228. package/lib/view-modal/view-modal.js +208 -0
  229. package/lib/view-modal/view-modal.js.map +1 -0
  230. package/package.json +1 -1
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _popconfirm = _interopRequireDefault(require("antd/lib/popconfirm"));
11
+
12
+ var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
13
+
14
+ var _menu = _interopRequireDefault(require("antd/lib/menu"));
15
+
16
+ var _divider = _interopRequireDefault(require("antd/lib/divider"));
17
+
18
+ var _DownOutlined = _interopRequireDefault(require("@ant-design/icons/DownOutlined"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
+
24
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
+
26
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
+
28
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
29
+
30
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
31
+
32
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
33
+
34
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
35
+ var t = {};
36
+
37
+ for (var p in s) {
38
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
39
+ }
40
+
41
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
42
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
43
+ }
44
+ return t;
45
+ };
46
+
47
+ var renderColumnButtons = function renderColumnButtons(renderButtons) {
48
+ var visibleNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
49
+ var text = arguments.length > 2 ? arguments[2] : undefined;
50
+ var record = arguments.length > 3 ? arguments[3] : undefined;
51
+ var index = arguments.length > 4 ? arguments[4] : undefined;
52
+ var showAllButtons = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
53
+
54
+ var _a;
55
+
56
+ var actions = typeof renderButtons == 'function' ? (_a = renderButtons(record, index)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
57
+ var _a;
58
+
59
+ return item && ((_a = item.visibleNum) !== null && _a !== void 0 ? _a : true);
60
+ }) : renderButtons;
61
+
62
+ if (!Array.isArray(actions)) {
63
+ return;
64
+ }
65
+
66
+ var actionsLen = actions.length; // 更多
67
+
68
+ visibleNum = showAllButtons ? actionsLen : visibleNum;
69
+ var moreRender;
70
+
71
+ if (actionsLen > visibleNum + 1) {
72
+ var moreActions = actions.slice(visibleNum);
73
+ moreRender = /*#__PURE__*/_react["default"].createElement(_dropdown["default"], {
74
+ key: "more",
75
+ overlay: /*#__PURE__*/_react["default"].createElement(_menu["default"], {
76
+ onClick: function onClick(e) {
77
+ var _a, _b;
78
+
79
+ if (!((_a = moreActions[e.key]) === null || _a === void 0 ? void 0 : _a.popconfirm) && ((_b = moreActions[e.key]) === null || _b === void 0 ? void 0 : _b.name) !== '删除') {
80
+ moreActions[e.key].onClick(record, index); // setVisible(false);
81
+ }
82
+ }
83
+ }, moreActions.map(function (item, i) {
84
+ var name = item.name,
85
+ onClick = item.onClick,
86
+ popconfirm = item.popconfirm;
87
+
88
+ if (popconfirm) {
89
+ var confirm = popconfirm.confirm,
90
+ rest = __rest(popconfirm, ["confirm"]);
91
+
92
+ return /*#__PURE__*/_react["default"].createElement(_menu["default"].Item, {
93
+ key: i
94
+ }, /*#__PURE__*/_react["default"].createElement(_popconfirm["default"], Object.assign({}, rest, {
95
+ onConfirm: confirm ? function () {
96
+ confirm(record, index);
97
+ } : undefined,
98
+ key: name
99
+ }), item.name));
100
+ } else if (name == '删除') {
101
+ return /*#__PURE__*/_react["default"].createElement(_menu["default"].Item, {
102
+ key: i
103
+ }, /*#__PURE__*/_react["default"].createElement(_popconfirm["default"], {
104
+ title: "\u662F\u5426\u786E\u8BA4\u5220\u9664",
105
+ style: {
106
+ width: 140
107
+ },
108
+ onConfirm: onClick ? function (e) {
109
+ onClick(record, index);
110
+ } : undefined,
111
+ // @ts-ignore 勿删 这个方法用来点击的时候阻止冒泡,点击删除的时候不会关闭dropdown
112
+ onClick: function onClick(e) {
113
+ return e.stopPropagation();
114
+ },
115
+ key: name,
116
+ okText: (item === null || item === void 0 ? void 0 : item.okText) || '确定',
117
+ cancelText: (item === null || item === void 0 ? void 0 : item.cancelText) || '取消'
118
+ }, item.name));
119
+ } else {
120
+ return /*#__PURE__*/_react["default"].createElement(_menu["default"].Item, {
121
+ key: i
122
+ }, item.name);
123
+ }
124
+ }))
125
+ }, /*#__PURE__*/_react["default"].createElement("a", null, "\u66F4\u591A", /*#__PURE__*/_react["default"].createElement(_DownOutlined["default"], null)));
126
+ }
127
+
128
+ return [].concat(_toConsumableArray(actions.slice(0, actionsLen == visibleNum + 1 ? visibleNum + 1 : visibleNum).map(function (item, i) {
129
+ var name = item.name,
130
+ onClick = item.onClick,
131
+ popconfirm = item.popconfirm,
132
+ okText = item.okText,
133
+ cancelText = item.cancelText;
134
+
135
+ var btnNode = /*#__PURE__*/_react["default"].createElement("a", {
136
+ key: name,
137
+ onClick: onClick && !popconfirm && name !== '删除' ? function () {
138
+ return onClick(record, index);
139
+ } : undefined
140
+ }, name);
141
+
142
+ if (popconfirm) {
143
+ var confirm = popconfirm.confirm,
144
+ rest = __rest(popconfirm, ["confirm"]);
145
+
146
+ btnNode = /*#__PURE__*/_react["default"].createElement(_popconfirm["default"], Object.assign({}, rest, {
147
+ onConfirm: confirm ? function () {
148
+ return confirm(record, index);
149
+ } : undefined,
150
+ key: name
151
+ }), btnNode);
152
+ } else if (name == '删除') {
153
+ btnNode = /*#__PURE__*/_react["default"].createElement(_popconfirm["default"], {
154
+ title: "\u662F\u5426\u786E\u8BA4\u5220\u9664",
155
+ onConfirm: onClick ? function () {
156
+ return onClick(record, index);
157
+ } : undefined,
158
+ key: name,
159
+ okText: okText || '确定',
160
+ cancelText: cancelText || '取消'
161
+ }, btnNode);
162
+ }
163
+
164
+ return [btnNode, i != actionsLen - 1 && /*#__PURE__*/_react["default"].createElement(_divider["default"], {
165
+ key: i,
166
+ type: "vertical"
167
+ })];
168
+ })), [moreRender]);
169
+ };
170
+
171
+ var _default = renderColumnButtons;
172
+ exports["default"] = _default;
173
+ //# sourceMappingURL=renderColumnButtons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderColumnButtons.js","names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","renderColumnButtons","renderButtons","visibleNum","text","record","index","showAllButtons","_a","actions","filter","item","Array","isArray","actionsLen","moreRender","moreActions","slice","React","createElement","Dropdown","key","overlay","Menu","onClick","_b","popconfirm","name","map","confirm","rest","Item","Popconfirm","assign","onConfirm","undefined","title","style","width","stopPropagation","okText","cancelText","DownOutlined","btnNode","Divider","type"],"sources":["template/renderColumnButtons.js"],"sourcesContent":["var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport Popconfirm from 'antd/lib/popconfirm';\nimport Dropdown from 'antd/lib/dropdown';\nimport Menu from 'antd/lib/menu';\nimport Divider from 'antd/lib/divider';\nimport DownOutlined from '@ant-design/icons/DownOutlined';\nconst renderColumnButtons = (renderButtons, visibleNum = 4, text, record, index, showAllButtons = false) => {\n var _a;\n const actions = typeof renderButtons == 'function'\n ? (_a = renderButtons(record, index)) === null || _a === void 0 ? void 0 : _a.filter((item) => { var _a; return item && ((_a = item.visibleNum) !== null && _a !== void 0 ? _a : true); })\n : renderButtons;\n if (!Array.isArray(actions)) {\n return;\n }\n const actionsLen = actions.length;\n // 更多\n visibleNum = showAllButtons ? actionsLen : visibleNum;\n let moreRender;\n if (actionsLen > visibleNum + 1) {\n const moreActions = actions.slice(visibleNum);\n moreRender = (React.createElement(Dropdown, { key: \"more\", overlay: React.createElement(Menu, { onClick: (e) => {\n var _a, _b;\n if (!((_a = moreActions[e.key]) === null || _a === void 0 ? void 0 : _a.popconfirm)\n && ((_b = moreActions[e.key]) === null || _b === void 0 ? void 0 : _b.name) !== '删除') {\n moreActions[e.key].onClick(record, index);\n // setVisible(false);\n }\n } }, moreActions.map((item, i) => {\n const { name, onClick, popconfirm } = item;\n if (popconfirm) {\n const { confirm } = popconfirm, rest = __rest(popconfirm, [\"confirm\"]);\n return (React.createElement(Menu.Item, { key: i },\n React.createElement(Popconfirm, Object.assign({}, rest, { onConfirm: confirm\n ? () => {\n confirm(record, index);\n }\n : undefined, key: name }), item.name)));\n }\n else if (name == '删除') {\n return (React.createElement(Menu.Item, { key: i },\n React.createElement(Popconfirm, { title: \"\\u662F\\u5426\\u786E\\u8BA4\\u5220\\u9664\", style: { width: 140 }, onConfirm: onClick\n ? (e) => {\n onClick(record, index);\n }\n : undefined, \n // @ts-ignore 勿删 这个方法用来点击的时候阻止冒泡,点击删除的时候不会关闭dropdown\n onClick: (e) => e.stopPropagation(), key: name, okText: (item === null || item === void 0 ? void 0 : item.okText) || '确定', cancelText: (item === null || item === void 0 ? void 0 : item.cancelText) || '取消' }, item.name)));\n }\n else {\n return (React.createElement(Menu.Item, { key: i }, item.name));\n }\n })) },\n React.createElement(\"a\", null,\n \"\\u66F4\\u591A\",\n React.createElement(DownOutlined, null))));\n }\n return [\n ...actions\n .slice(0, actionsLen == visibleNum + 1 ? visibleNum + 1 : visibleNum)\n .map((item, i) => {\n const { name, onClick, popconfirm, okText, cancelText } = item;\n let btnNode = (React.createElement(\"a\", { key: name, onClick: onClick && !popconfirm && name !== '删除'\n ? () => onClick(record, index)\n : undefined }, name));\n if (popconfirm) {\n const { confirm } = popconfirm, rest = __rest(popconfirm, [\"confirm\"]);\n btnNode = (React.createElement(Popconfirm, Object.assign({}, rest, { onConfirm: confirm\n ? () => confirm(record, index)\n : undefined, key: name }), btnNode));\n }\n else if (name == '删除') {\n btnNode = (React.createElement(Popconfirm, { title: \"\\u662F\\u5426\\u786E\\u8BA4\\u5220\\u9664\", onConfirm: onClick\n ? () => onClick(record, index)\n : undefined, key: name, okText: okText || '确定', cancelText: cancelText || '取消' }, btnNode));\n }\n return [\n btnNode,\n i != actionsLen - 1 && React.createElement(Divider, { key: i, type: \"vertical\" }),\n ];\n }),\n moreRender,\n ];\n};\nexport default renderColumnButtons;\n"],"mappings":";;;;;;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;AAhBA,IAAIA,MAAM,GAAI,UAAQ,SAAKA,MAAd,IAAyB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;EAClD,IAAIC,CAAC,GAAG,EAAR;;EACA,KAAK,IAAIC,CAAT,IAAcH,CAAd;IAAiB,IAAII,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCP,CAArC,EAAwCG,CAAxC,KAA8CF,CAAC,CAACO,OAAF,CAAUL,CAAV,IAAe,CAAjE,EACbD,CAAC,CAACC,CAAD,CAAD,GAAOH,CAAC,CAACG,CAAD,CAAR;EADJ;;EAEA,IAAIH,CAAC,IAAI,IAAL,IAAa,OAAOI,MAAM,CAACK,qBAAd,KAAwC,UAAzD,EACI,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWP,CAAC,GAAGC,MAAM,CAACK,qBAAP,CAA6BT,CAA7B,CAApB,EAAqDU,CAAC,GAAGP,CAAC,CAACQ,MAA3D,EAAmED,CAAC,EAApE,EAAwE;IACpE,IAAIT,CAAC,CAACO,OAAF,CAAUL,CAAC,CAACO,CAAD,CAAX,IAAkB,CAAlB,IAAuBN,MAAM,CAACC,SAAP,CAAiBO,oBAAjB,CAAsCL,IAAtC,CAA2CP,CAA3C,EAA8CG,CAAC,CAACO,C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B,MAAD,EAASC,KAAT,CAAb;QAAA,CAD6E,GAE7E6B,SAFyD;QAE9Cd,GAAG,EAAEM;MAFyC,CAAxB,CAAhC,EAEwBgB,OAFxB,CAAX;IAGH,CALD,MAMK,IAAIhB,IAAI,IAAI,IAAZ,EAAkB;MACnBgB,OAAO,gBAAIzB,iBAAA,CAAMC,aAAN,CAAoBa,sBAApB,EAAgC;QAAEI,KAAK,EAAE,sCAAT;QAAiDF,SAAS,EAAEV,OAAO,GACpG;UAAA,OAAMA,OAAO,CAACnB,MAAD,EAASC,KAAT,CAAb;QAAA,CADoG,GAEpG6B,SAFiC;QAEtBd,GAAG,EAAEM,IAFiB;QAEXa,MAAM,EAAEA,MAAM,IAAI,IAFP;QAEaC,UAAU,EAAEA,UAAU,IAAI;MAFvC,CAAhC,EAE+EE,OAF/E,CAAX;IAGH;;IACD,OAAO,CACHA,OADG,EAEH7C,CAAC,IAAIgB,UAAU,GAAG,CAAlB,iBAAuBI,iBAAA,CAAMC,aAAN,CAAoByB,mBAApB,EAA6B;MAAEvB,GAAG,EAAEvB,CAAP;MAAU+C,IAAI,EAAE;IAAhB,CAA7B,CAFpB,CAAP;EAIH,CAtBE,CADP,IAwBI9B,UAxBJ;AA0BH,CA5ED;;eA6Eed,mB"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ require("antd/lib/checkbox/style/css");
4
+
5
+ require("antd/lib/menu/style/css");
6
+
7
+ require("antd/lib/popover/style/css");
8
+
9
+ require("antd/lib/col/style/css");
10
+
11
+ require("antd/lib/row/style/css");
12
+
13
+ require("antd/lib/tooltip/style/css");
14
+
15
+ require("antd/lib/table/style/css");
16
+
17
+ require("antd/lib/pagination/style/css");
18
+
19
+ require("antd/lib/button/style/css");
20
+
21
+ require("antd/lib/list/style/css");
22
+
23
+ require("antd/lib/form/style/css");
24
+
25
+ require("antd/lib/modal/style/css");
26
+
27
+ require("antd/lib/spin/style/css");
28
+
29
+ require("antd/lib/divider/style/css");
30
+
31
+ require("@vtx/components/lib/vtx-search/style/css");
32
+
33
+ require("@vtx/components/lib/vtx-page-layout/style/css");
34
+
35
+ require("@vtx/components/lib/vtx-import/style/css");
36
+
37
+ require("@vtx/components/lib/vtx-datagrid/style/css");
38
+
39
+ require("./index.css");
40
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.js","names":[],"sources":["template/style/index.js"],"sourcesContent":["import 'antd/lib/checkbox/style';\nimport 'antd/lib/menu/style';\nimport 'antd/lib/popover/style';\nimport 'antd/lib/col/style';\nimport 'antd/lib/row/style';\nimport 'antd/lib/tooltip/style';\nimport 'antd/lib/table/style';\nimport 'antd/lib/pagination/style';\nimport 'antd/lib/button/style';\nimport 'antd/lib/list/style';\nimport 'antd/lib/form/style';\nimport 'antd/lib/modal/style';\nimport 'antd/lib/spin/style';\nimport 'antd/lib/divider/style';\nimport '@vtx/components/lib/vtx-search/style';\nimport '@vtx/components/lib/vtx-page-layout/style';\nimport '@vtx/components/lib/vtx-import/style';\nimport '@vtx/components/lib/vtx-datagrid/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
@@ -0,0 +1,19 @@
1
+ import 'antd/lib/checkbox/style';
2
+ import 'antd/lib/menu/style';
3
+ import 'antd/lib/popover/style';
4
+ import 'antd/lib/col/style';
5
+ import 'antd/lib/row/style';
6
+ import 'antd/lib/tooltip/style';
7
+ import 'antd/lib/table/style';
8
+ import 'antd/lib/pagination/style';
9
+ import 'antd/lib/button/style';
10
+ import 'antd/lib/list/style';
11
+ import 'antd/lib/form/style';
12
+ import 'antd/lib/modal/style';
13
+ import 'antd/lib/spin/style';
14
+ import 'antd/lib/divider/style';
15
+ import '@vtx/components/lib/vtx-search/style';
16
+ import '@vtx/components/lib/vtx-page-layout/style';
17
+ import '@vtx/components/lib/vtx-import/style';
18
+ import '@vtx/components/lib/vtx-datagrid/style';
19
+ import './index.less';
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ require("antd/lib/checkbox/style");
4
+
5
+ require("antd/lib/menu/style");
6
+
7
+ require("antd/lib/popover/style");
8
+
9
+ require("antd/lib/col/style");
10
+
11
+ require("antd/lib/row/style");
12
+
13
+ require("antd/lib/tooltip/style");
14
+
15
+ require("antd/lib/table/style");
16
+
17
+ require("antd/lib/pagination/style");
18
+
19
+ require("antd/lib/button/style");
20
+
21
+ require("antd/lib/list/style");
22
+
23
+ require("antd/lib/form/style");
24
+
25
+ require("antd/lib/modal/style");
26
+
27
+ require("antd/lib/spin/style");
28
+
29
+ require("antd/lib/divider/style");
30
+
31
+ require("@vtx/components/lib/vtx-search/style");
32
+
33
+ require("@vtx/components/lib/vtx-page-layout/style");
34
+
35
+ require("@vtx/components/lib/vtx-import/style");
36
+
37
+ require("@vtx/components/lib/vtx-datagrid/style");
38
+
39
+ require("./index.less");
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["template/style/index.js"],"sourcesContent":["import 'antd/lib/checkbox/style';\nimport 'antd/lib/menu/style';\nimport 'antd/lib/popover/style';\nimport 'antd/lib/col/style';\nimport 'antd/lib/row/style';\nimport 'antd/lib/tooltip/style';\nimport 'antd/lib/table/style';\nimport 'antd/lib/pagination/style';\nimport 'antd/lib/button/style';\nimport 'antd/lib/list/style';\nimport 'antd/lib/form/style';\nimport 'antd/lib/modal/style';\nimport 'antd/lib/spin/style';\nimport 'antd/lib/divider/style';\nimport '@vtx/components/lib/vtx-search/style';\nimport '@vtx/components/lib/vtx-page-layout/style';\nimport '@vtx/components/lib/vtx-import/style';\nimport '@vtx/components/lib/vtx-datagrid/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import { TablePaginationConfig, TableProps as AntTableProps, ColumnGroupType, ColumnType } from 'antd/lib/table';
3
+ import { IsCardTheme } from './interface';
4
+ export interface ActionButton<T> {
5
+ name: string;
6
+ onClick?: (text: string, record: T, index: number) => any;
7
+ }
8
+ export interface CardActionButton<T> {
9
+ name: string;
10
+ onClick?: (record: T, index?: number) => any;
11
+ okText?: string;
12
+ cancelText?: string;
13
+ }
14
+ export declare type RenderCardButtons<T> = CardActionButton<T> | Array<CardActionButton<T>> | ((row: T) => CardActionButton<T> | Array<CardActionButton<T>>);
15
+ export declare type RenderButtons<T> = ActionButton<T> | Array<ActionButton<T>> | ((row: T) => ActionButton<T> | Array<ActionButton<T>>);
16
+ export declare type TableColumnType<T> = ((ColumnGroupType<T> | ColumnType<T>) & {
17
+ isShow?: boolean;
18
+ dataIndex?: string;
19
+ renderButtons?: RenderButtons<T>;
20
+ showAllButtons?: boolean;
21
+ renderButtonsVisibleNum?: number;
22
+ showTitle?: string;
23
+ })[];
24
+ export interface TableProps<T> extends Omit<AntTableProps<T>, 'columns'>, IsCardTheme {
25
+ hasIndex?: boolean;
26
+ selectable?: boolean;
27
+ columns?: TableColumnType<T>;
28
+ columnsVisibility?: boolean;
29
+ pagination?: false | TablePaginationConfig;
30
+ toolbarTilte?: string | React.ReactElement;
31
+ buttonGroup?: React.ReactElement;
32
+ hideColumnSetting?: boolean;
33
+ saveColumns?: (columns: TableColumnType<T>) => void;
34
+ theme?: string;
35
+ renderCard?: (data: T, index: number) => JSX.Element;
36
+ indexFixed?: boolean;
37
+ onRefresh?: () => void;
38
+ headFootHeight?: number;
39
+ }
40
+ declare function Table<T extends object = any>(props: TableProps<T>): JSX.Element;
41
+ declare namespace Table {
42
+ var defaultProps: {};
43
+ }
44
+ export default Table;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var React = _interopRequireWildcard(require("react"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _vtxDatagrid = _interopRequireDefault(require("@vtx/components/lib/vtx-datagrid"));
15
+
16
+ var _renderColumnButtons = _interopRequireDefault(require("./renderColumnButtons"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
25
+ var t = {};
26
+
27
+ for (var p in s) {
28
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
29
+ }
30
+
31
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
32
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
33
+ }
34
+ return t;
35
+ };
36
+
37
+ function Table(props) {
38
+ var className = props.className,
39
+ dataSource = props.dataSource,
40
+ columns = props.columns,
41
+ loading = props.loading,
42
+ hasIndex = props.hasIndex,
43
+ saveColumns = props.saveColumns,
44
+ rest = __rest(props, ["className", "dataSource", "columns", "loading", "hasIndex", "saveColumns"]); // 设置 renderButtons
45
+
46
+
47
+ columns === null || columns === void 0 ? void 0 : columns.forEach(function (item) {
48
+ var renderButtons = item.renderButtons,
49
+ renderButtonsVisibleNum = item.renderButtonsVisibleNum,
50
+ showTitle = item.showTitle;
51
+
52
+ if (showTitle) {
53
+ item.title = showTitle;
54
+ }
55
+
56
+ if (!renderButtons) {
57
+ return;
58
+ }
59
+
60
+ item.render = function (text, record, index) {
61
+ return (0, _renderColumnButtons["default"])(renderButtons, !item.showAllButtons && typeof item.renderButtonsVisibleNum !== 'number' ? 3 : renderButtonsVisibleNum, text, record, index, item.showAllButtons);
62
+ };
63
+
64
+ item.renderButtons = undefined;
65
+ });
66
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_vtxDatagrid["default"], Object.assign({
67
+ loading: loading,
68
+ indexColumn: hasIndex,
69
+ defaultVisibleColumnKeys: columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
70
+ return item.isShow || item.isShow === undefined;
71
+ }).map(function (item) {
72
+ return item.dataIndex;
73
+ }),
74
+ disabledColumnKeys: columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
75
+ return item.dataIndex === 'action';
76
+ }).map(function (item) {
77
+ return item.dataIndex;
78
+ }),
79
+ columns: columns,
80
+ dataSource: dataSource,
81
+ className: (0, _classnames["default"])(className, 'env-template-table'),
82
+ onColumnsSave: saveColumns ? function (keys) {
83
+ var newColumns = columns.map(function (item) {
84
+ var key = item.dataIndex || item.key;
85
+ return Object.assign(Object.assign({}, item), {
86
+ isShow: keys.includes(key)
87
+ });
88
+ });
89
+ saveColumns(newColumns);
90
+ } : undefined,
91
+ rowSelection: rest === null || rest === void 0 ? void 0 : rest.rowSelection,
92
+ onRowSelectionClear: function onRowSelectionClear() {
93
+ var _a;
94
+
95
+ (_a = rest === null || rest === void 0 ? void 0 : rest.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange([], []);
96
+ }
97
+ }, rest)));
98
+ }
99
+
100
+ var _default = Table;
101
+ exports["default"] = _default;
102
+ Table.defaultProps = {};
103
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","Table","props","className","dataSource","columns","loading","hasIndex","saveColumns","rest","forEach","item","renderButtons","renderButtonsVisibleNum","showTitle","title","render","text","record","index","renderColumnButtons","showAllButtons","undefined","React","createElement","Fragment","VtxDatagrid","assign","indexColumn","defaultVisibleColumnKeys","filter","isShow","map","dataIndex","disabledColumnKeys","classnames","onColumnsSave","keys","newColumns","key","includes","rowSelection","onRowSelectionClear","_a","onChange","defaultProps"],"sources":["template/table.js"],"sourcesContent":["var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classnames from 'classnames';\nimport VtxDatagrid from '@vtx/components/lib/vtx-datagrid';\n// import VtxDatagrid from '../vtx-datagrid';\nimport renderColumnButtons from './renderColumnButtons';\nfunction Table(props) {\n const { className, dataSource, columns, loading, hasIndex, saveColumns } = props, rest = __rest(props, [\"className\", \"dataSource\", \"columns\", \"loading\", \"hasIndex\", \"saveColumns\"]);\n // 设置 renderButtons\n columns === null || columns === void 0 ? void 0 : columns.forEach((item) => {\n const { renderButtons, renderButtonsVisibleNum, showTitle } = item;\n if (showTitle) {\n item.title = showTitle;\n }\n if (!renderButtons) {\n return;\n }\n item.render = (text, record, index) => {\n return renderColumnButtons(renderButtons, !item.showAllButtons\n && typeof item.renderButtonsVisibleNum !== 'number'\n ? 3\n : renderButtonsVisibleNum, text, record, index, item.showAllButtons);\n };\n item.renderButtons = undefined;\n });\n return (React.createElement(React.Fragment, null,\n React.createElement(VtxDatagrid, Object.assign({ loading: loading, indexColumn: hasIndex, defaultVisibleColumnKeys: columns === null || columns === void 0 ? void 0 : columns.filter((item) => item.isShow || item.isShow === undefined).map((item) => item.dataIndex), disabledColumnKeys: columns === null || columns === void 0 ? void 0 : columns.filter((item) => item.dataIndex === 'action').map((item) => item.dataIndex), columns: columns, dataSource: dataSource, className: classnames(className, 'env-template-table'), onColumnsSave: saveColumns\n ? (keys) => {\n const newColumns = columns.map((item) => {\n const key = item.dataIndex || item.key;\n return Object.assign(Object.assign({}, item), { isShow: keys.includes(key) });\n });\n saveColumns(newColumns);\n }\n : undefined, rowSelection: rest === null || rest === void 0 ? void 0 : rest.rowSelection, onRowSelectionClear: () => {\n var _a;\n (_a = rest === null || rest === void 0 ? void 0 : rest.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange([], []);\n } }, rest))));\n}\nexport default Table;\nTable.defaultProps = {};\n"],"mappings":";;;;;;;;;AAWA;;AACA;;AACA;;AAEA;;;;;;;;AAfA,IAAIA,MAAM,GAAI,UAAQ,SAAKA,MAAd,IAAyB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;EAClD,IAAIC,CAAC,GAAG,EAAR;;EACA,KAAK,IAAIC,CAAT,IAAc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GAAGlC,IAAI,KAAK,IAAT,IAAiBA,IAAI,KAAK,KAAK,CAA/B,GAAmC,KAAK,CAAxC,GAA4CA,IAAI,CAACgC,YAAvD,MAAyE,IAAzE,IAAiFE,EAAE,KAAK,KAAK,CAA7F,GAAiG,KAAK,CAAtG,GAA0GA,EAAE,CAACC,QAAH,CAAY,EAAZ,EAAgB,EAAhB,CAA1G;IACH;EAX0C,CAAd,EAWxBnC,IAXwB,CAAjC,CADI,CAAR;AAaH;;eACcR,K;;AACfA,KAAK,CAAC4C,YAAN,GAAqB,EAArB"}
@@ -0,0 +1,84 @@
1
+ import * as React from 'react';
2
+ import { Component } from 'react';
3
+ import { PageApiRes } from '../interface';
4
+ import { ActionProps } from './action';
5
+ import { FilterControl } from './filter';
6
+ import { TableColumnType, TableProps } from './table';
7
+ import { TablePaginationConfig } from 'antd/lib/table';
8
+ /**
9
+ * 列表展示的风格
10
+ */
11
+ export declare type TemplateTheme = 'card' | 'list';
12
+ export interface TemplatePagination extends TablePaginationConfig {
13
+ total?: number;
14
+ current?: number;
15
+ pageSize?: number;
16
+ }
17
+ export interface TemplateProps<F, T> {
18
+ actionProps?: Omit<ActionProps<F, T>, 'columns' | 'setColumns' | 'selectable' | 'selectRows' | 'filter' | 'dataSource' | 'onSelectedRows'>;
19
+ tableProps?: TableProps<T> | React.ReactElement;
20
+ statisticsProps?: React.ReactElement;
21
+ getDataSource: (pagination: TemplatePagination | false, filter: F) => Promise<PageApiRes<T>> | PageApiRes<T>;
22
+ onReset?: () => any;
23
+ autoRequest?: boolean;
24
+ showButtonRow?: boolean;
25
+ showButtonPage?: boolean;
26
+ showButtonAll?: boolean;
27
+ style?: object;
28
+ showAll?: boolean;
29
+ contentProps?: any;
30
+ importErrorColumns?: any[];
31
+ }
32
+ export interface TemplateState<F, T> {
33
+ /**
34
+ * 当前的搜索条件
35
+ */
36
+ filter: F;
37
+ /**
38
+ * table的加载状态
39
+ */
40
+ loading: boolean;
41
+ /**
42
+ * 数据列表
43
+ */
44
+ dataSource: T[];
45
+ /**
46
+ * 选中的行的keys
47
+ */
48
+ selectedRowKeys: React.ReactText[];
49
+ /**
50
+ * 选中的行
51
+ */
52
+ selectedRows: T[];
53
+ /**
54
+ * 内部用来展示的columns
55
+ */
56
+ selfColumns: TableColumnType<T>;
57
+ /**
58
+ * 分页信息
59
+ */
60
+ pagination?: TemplatePagination | false;
61
+ showImport: boolean;
62
+ showExportLoading: boolean;
63
+ }
64
+ declare class Template<F, T extends object = any> extends Component<TemplateProps<F, T>, TemplateState<F, T>> {
65
+ filterRef: FilterControl;
66
+ static defaultProps: {
67
+ autoRequest: boolean;
68
+ };
69
+ constructor(props: any);
70
+ state: TemplateState<F, T>;
71
+ componentDidMount(): void;
72
+ componentDidUpdate(prevProps: any, prevState: any): void;
73
+ /**
74
+ * 初始化columns, 给每个column加上是否显示的属性
75
+ */
76
+ setSelfColumns(): void;
77
+ getPagination(): boolean;
78
+ updateFilter(): void;
79
+ requestDataSource(newPagination?: {}, newFilter?: {}): Promise<void>;
80
+ setPagination(obj: Partial<TemplatePagination>): void;
81
+ clearSelectedRows(): void;
82
+ render(): JSX.Element;
83
+ }
84
+ export default Template;