@sooloer/pages 0.0.1

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 (176) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/dist/button-group/demo/authcode.d.ts +3 -0
  4. package/dist/button-group/demo/authcode.js +78 -0
  5. package/dist/button-group/demo/basic.d.ts +3 -0
  6. package/dist/button-group/demo/basic.js +67 -0
  7. package/dist/button-group/demo/custom.d.ts +3 -0
  8. package/dist/button-group/demo/custom.js +50 -0
  9. package/dist/button-group/demo/link.d.ts +3 -0
  10. package/dist/button-group/demo/link.js +65 -0
  11. package/dist/button-group/index.d.ts +4 -0
  12. package/dist/button-group/index.js +59 -0
  13. package/dist/button-group/style.d.ts +5 -0
  14. package/dist/button-group/style.js +11 -0
  15. package/dist/button-group/typing.d.ts +35 -0
  16. package/dist/button-group/typing.js +1 -0
  17. package/dist/filter/components/checkbox/index.d.ts +3 -0
  18. package/dist/filter/components/checkbox/index.js +32 -0
  19. package/dist/filter/components/ellipsis-text/index.d.ts +6 -0
  20. package/dist/filter/components/ellipsis-text/index.js +78 -0
  21. package/dist/filter/components/field/index.d.ts +7 -0
  22. package/dist/filter/components/field/index.js +143 -0
  23. package/dist/filter/components/input-range/index.d.ts +4 -0
  24. package/dist/filter/components/input-range/index.js +44 -0
  25. package/dist/filter/components/input-range/type.d.ts +22 -0
  26. package/dist/filter/components/input-range/type.js +1 -0
  27. package/dist/filter/components/text-area/index.d.ts +3 -0
  28. package/dist/filter/components/text-area/index.js +72 -0
  29. package/dist/filter/components/text-area/index.less +0 -0
  30. package/dist/filter/demo/basic.d.ts +3 -0
  31. package/dist/filter/demo/basic.js +35 -0
  32. package/dist/filter/demo/change-label-width.d.ts +3 -0
  33. package/dist/filter/demo/change-label-width.js +59 -0
  34. package/dist/filter/demo/checkbox.d.ts +3 -0
  35. package/dist/filter/demo/checkbox.js +69 -0
  36. package/dist/filter/demo/col-span.d.ts +3 -0
  37. package/dist/filter/demo/col-span.js +52 -0
  38. package/dist/filter/demo/custom.d.ts +3 -0
  39. package/dist/filter/demo/custom.js +53 -0
  40. package/dist/filter/demo/datePicker.d.ts +3 -0
  41. package/dist/filter/demo/datePicker.js +72 -0
  42. package/dist/filter/demo/ellipsis.d.ts +3 -0
  43. package/dist/filter/demo/ellipsis.js +58 -0
  44. package/dist/filter/demo/expand.d.ts +3 -0
  45. package/dist/filter/demo/expand.js +79 -0
  46. package/dist/filter/demo/form-controlled.d.ts +3 -0
  47. package/dist/filter/demo/form-controlled.js +63 -0
  48. package/dist/filter/demo/grid-columns.d.ts +3 -0
  49. package/dist/filter/demo/grid-columns.js +59 -0
  50. package/dist/filter/demo/hide-action.d.ts +3 -0
  51. package/dist/filter/demo/hide-action.js +41 -0
  52. package/dist/filter/demo/initial-value.d.ts +3 -0
  53. package/dist/filter/demo/initial-value.js +56 -0
  54. package/dist/filter/demo/input-range.d.ts +3 -0
  55. package/dist/filter/demo/input-range.js +24 -0
  56. package/dist/filter/demo/mask.d.ts +3 -0
  57. package/dist/filter/demo/mask.js +77 -0
  58. package/dist/filter/demo/radio.d.ts +3 -0
  59. package/dist/filter/demo/radio.js +69 -0
  60. package/dist/filter/demo/rangePicker.d.ts +3 -0
  61. package/dist/filter/demo/rangePicker.js +80 -0
  62. package/dist/filter/demo/required.d.ts +3 -0
  63. package/dist/filter/demo/required.js +36 -0
  64. package/dist/filter/demo/search-advanced.d.ts +3 -0
  65. package/dist/filter/demo/search-advanced.js +45 -0
  66. package/dist/filter/demo/search.d.ts +3 -0
  67. package/dist/filter/demo/search.js +45 -0
  68. package/dist/filter/demo/set-field.d.ts +3 -0
  69. package/dist/filter/demo/set-field.js +64 -0
  70. package/dist/filter/demo/textarea.d.ts +3 -0
  71. package/dist/filter/demo/textarea.js +42 -0
  72. package/dist/filter/demo/tooltip.d.ts +3 -0
  73. package/dist/filter/demo/tooltip.js +36 -0
  74. package/dist/filter/index.d.ts +5 -0
  75. package/dist/filter/index.js +406 -0
  76. package/dist/filter/index.less +84 -0
  77. package/dist/filter/typing.d.ts +148 -0
  78. package/dist/filter/typing.js +1 -0
  79. package/dist/footer/demo/basic.d.ts +3 -0
  80. package/dist/footer/demo/basic.js +44 -0
  81. package/dist/footer/demo/right-render.d.ts +3 -0
  82. package/dist/footer/demo/right-render.js +8 -0
  83. package/dist/footer/index.d.ts +6 -0
  84. package/dist/footer/index.js +26 -0
  85. package/dist/footer/index.less +11 -0
  86. package/dist/footer/typing.d.ts +17 -0
  87. package/dist/footer/typing.js +1 -0
  88. package/dist/index.d.ts +17 -0
  89. package/dist/index.js +9 -0
  90. package/dist/page/demo/basic.d.ts +3 -0
  91. package/dist/page/demo/basic.js +215 -0
  92. package/dist/page/demo/data.d.ts +16 -0
  93. package/dist/page/demo/data.js +121 -0
  94. package/dist/page/demo/renderTable.d.ts +3 -0
  95. package/dist/page/demo/renderTable.js +209 -0
  96. package/dist/page/demo/selection.d.ts +3 -0
  97. package/dist/page/demo/selection.js +229 -0
  98. package/dist/page/index.d.ts +5 -0
  99. package/dist/page/index.js +120 -0
  100. package/dist/page/index.less +35 -0
  101. package/dist/page/typing.d.ts +68 -0
  102. package/dist/page/typing.js +1 -0
  103. package/dist/search-condition/demo/basic.d.ts +3 -0
  104. package/dist/search-condition/demo/basic.js +35 -0
  105. package/dist/search-condition/demo/custom.d.ts +3 -0
  106. package/dist/search-condition/demo/custom.js +35 -0
  107. package/dist/search-condition/demo/ellipsis.d.ts +3 -0
  108. package/dist/search-condition/demo/ellipsis.js +30 -0
  109. package/dist/search-condition/demo/expand.d.ts +3 -0
  110. package/dist/search-condition/demo/expand.js +46 -0
  111. package/dist/search-condition/demo/removeable.d.ts +3 -0
  112. package/dist/search-condition/demo/removeable.js +39 -0
  113. package/dist/search-condition/index.d.ts +5 -0
  114. package/dist/search-condition/index.js +226 -0
  115. package/dist/search-condition/index.less +65 -0
  116. package/dist/search-condition/typing.d.ts +39 -0
  117. package/dist/search-condition/typing.js +1 -0
  118. package/dist/tab/demo/basic.d.ts +3 -0
  119. package/dist/tab/demo/basic.js +36 -0
  120. package/dist/tab/demo/count.d.ts +3 -0
  121. package/dist/tab/demo/count.js +63 -0
  122. package/dist/tab/demo/extra.d.ts +3 -0
  123. package/dist/tab/demo/extra.js +70 -0
  124. package/dist/tab/demo/icon.d.ts +3 -0
  125. package/dist/tab/demo/icon.js +36 -0
  126. package/dist/tab/demo/overflowCount.d.ts +3 -0
  127. package/dist/tab/demo/overflowCount.js +50 -0
  128. package/dist/tab/demo/settingRef.d.ts +3 -0
  129. package/dist/tab/demo/settingRef.js +77 -0
  130. package/dist/tab/demo/slide.d.ts +3 -0
  131. package/dist/tab/demo/slide.js +98 -0
  132. package/dist/tab/index.d.ts +5 -0
  133. package/dist/tab/index.js +51 -0
  134. package/dist/tab/index.less +11 -0
  135. package/dist/tab/typing.d.ts +51 -0
  136. package/dist/tab/typing.js +1 -0
  137. package/dist/table/demo/basic.d.ts +3 -0
  138. package/dist/table/demo/basic.js +65 -0
  139. package/dist/table/demo/checkbox.d.ts +3 -0
  140. package/dist/table/demo/checkbox.js +75 -0
  141. package/dist/table/demo/data.d.ts +16 -0
  142. package/dist/table/demo/data.js +120 -0
  143. package/dist/table/demo/global-checkbox.d.ts +3 -0
  144. package/dist/table/demo/global-checkbox.js +83 -0
  145. package/dist/table/demo/setting.d.ts +3 -0
  146. package/dist/table/demo/setting.js +78 -0
  147. package/dist/table/index.d.ts +4 -0
  148. package/dist/table/index.js +173 -0
  149. package/dist/table/setting/components/height.d.ts +8 -0
  150. package/dist/table/setting/components/height.js +45 -0
  151. package/dist/table/setting/components/reload.d.ts +7 -0
  152. package/dist/table/setting/components/reload.js +19 -0
  153. package/dist/table/setting/components/sort-group.d.ts +10 -0
  154. package/dist/table/setting/components/sort-group.js +103 -0
  155. package/dist/table/setting/components/sort-item.d.ts +3 -0
  156. package/dist/table/setting/components/sort-item.js +20 -0
  157. package/dist/table/setting/components/sort.d.ts +9 -0
  158. package/dist/table/setting/components/sort.js +105 -0
  159. package/dist/table/setting/index.d.ts +18 -0
  160. package/dist/table/setting/index.js +41 -0
  161. package/dist/table/setting/index.less +33 -0
  162. package/dist/table/table/index.d.ts +5 -0
  163. package/dist/table/table/index.js +170 -0
  164. package/dist/table/table/index.less +35 -0
  165. package/dist/table/typing.d.ts +92 -0
  166. package/dist/table/typing.js +1 -0
  167. package/dist/title/demo/basic.d.ts +3 -0
  168. package/dist/title/demo/basic.js +35 -0
  169. package/dist/title/demo/custom.d.ts +3 -0
  170. package/dist/title/demo/custom.js +15 -0
  171. package/dist/title/index.d.ts +5 -0
  172. package/dist/title/index.js +32 -0
  173. package/dist/title/index.less +39 -0
  174. package/dist/title/typing.d.ts +22 -0
  175. package/dist/title/typing.js +10 -0
  176. package/package.json +86 -0
@@ -0,0 +1,50 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { ProTabs } from "../..";
8
+ import React, { useState } from 'react';
9
+ export default (function () {
10
+ var _useState = useState('1'),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ activeKey = _useState2[0],
13
+ setActiveKey = _useState2[1];
14
+ var handleChange = function handleChange(activeKey) {
15
+ console.log(activeKey);
16
+ setActiveKey(activeKey);
17
+ };
18
+ var tabs = [{
19
+ key: '1',
20
+ tab: 'Tab 1',
21
+ count: 0
22
+ }, {
23
+ key: '2',
24
+ tab: 'Tab 2',
25
+ count: 99
26
+ }, {
27
+ key: '3',
28
+ tab: 'Tab 3',
29
+ count: 999
30
+ }, {
31
+ key: '4',
32
+ tab: 'Tab 4',
33
+ count: 1000
34
+ }];
35
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ProTabs, {
36
+ activeKey: activeKey,
37
+ onChange: handleChange,
38
+ overflowCount: 99,
39
+ tabs: tabs
40
+ }), /*#__PURE__*/React.createElement("div", {
41
+ style: {
42
+ marginTop: '24px'
43
+ }
44
+ }), /*#__PURE__*/React.createElement(ProTabs, {
45
+ activeKey: activeKey,
46
+ onChange: handleChange,
47
+ overflowCount: 0,
48
+ tabs: tabs
49
+ }));
50
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,77 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { SettingOutlined } from '@ant-design/icons';
8
+ import { ProTabs } from "../..";
9
+ import React, { useEffect, useRef, useState } from 'react';
10
+ import { render } from 'react-dom';
11
+ export default (function () {
12
+ var _useState = useState('1'),
13
+ _useState2 = _slicedToArray(_useState, 2),
14
+ activeKey = _useState2[0],
15
+ setActiveKey = _useState2[1];
16
+ var nodeRef = useRef(null);
17
+ var handleChange = function handleChange(activeKey) {
18
+ console.log(activeKey);
19
+ setActiveKey(activeKey);
20
+ };
21
+ useEffect(function () {
22
+ render( /*#__PURE__*/React.createElement(SettingOutlined, null), nodeRef === null || nodeRef === void 0 ? void 0 : nodeRef.current);
23
+ }, [nodeRef]);
24
+ var buttonSource = [{
25
+ buttonProps: {
26
+ onClick: function onClick() {
27
+ console.log('上传');
28
+ }
29
+ },
30
+ fixed: true,
31
+ text: '上传'
32
+ }, {
33
+ buttonProps: {
34
+ type: 'primary',
35
+ onClick: function onClick() {
36
+ console.log('修改');
37
+ }
38
+ },
39
+ fixed: true,
40
+ text: '修改'
41
+ }, {
42
+ buttonProps: {
43
+ type: 'primary',
44
+ danger: true,
45
+ onClick: function onClick() {
46
+ console.log('删除');
47
+ }
48
+ },
49
+ fixed: true,
50
+ text: '删除'
51
+ }];
52
+ return /*#__PURE__*/React.createElement(ProTabs, {
53
+ activeKey: activeKey,
54
+ onChange: handleChange,
55
+ settingTableRef: nodeRef,
56
+ toolbars: {
57
+ buttons: buttonSource
58
+ },
59
+ tabs: [{
60
+ key: '1',
61
+ tab: 'Tab 1',
62
+ count: 9
63
+ }, {
64
+ key: '2',
65
+ tab: 'Tab 2',
66
+ count: 99
67
+ }, {
68
+ key: '3',
69
+ tab: 'Tab 3',
70
+ count: 999
71
+ }, {
72
+ key: '4',
73
+ tab: 'Tab 4',
74
+ count: 1000
75
+ }]
76
+ });
77
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,98 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { ProTabs } from "../..";
8
+ import React, { useState } from 'react';
9
+ export default (function () {
10
+ var _useState = useState('1'),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ activeKey = _useState2[0],
13
+ setActiveKey = _useState2[1];
14
+ var handleChange = function handleChange(activeKey) {
15
+ console.log(activeKey);
16
+ setActiveKey(activeKey);
17
+ };
18
+ var buttonSource = [{
19
+ buttonProps: {
20
+ onClick: function onClick() {
21
+ console.log('上传');
22
+ }
23
+ },
24
+ fixed: true,
25
+ text: '上传'
26
+ }, {
27
+ buttonProps: {
28
+ type: 'primary',
29
+ onClick: function onClick() {
30
+ console.log('修改');
31
+ }
32
+ },
33
+ fixed: true,
34
+ text: '修改'
35
+ }, {
36
+ buttonProps: {
37
+ type: 'primary',
38
+ danger: true,
39
+ onClick: function onClick() {
40
+ console.log('删除');
41
+ }
42
+ },
43
+ fixed: true,
44
+ text: '删除'
45
+ }];
46
+ return /*#__PURE__*/React.createElement(ProTabs, {
47
+ activeKey: activeKey,
48
+ onChange: handleChange,
49
+ toolbars: {
50
+ buttons: [].concat(buttonSource)
51
+ },
52
+ tabs: [{
53
+ key: '1',
54
+ tab: 'Tab 1',
55
+ count: 9
56
+ }, {
57
+ key: '2',
58
+ tab: 'Tab 2',
59
+ count: 99
60
+ }, {
61
+ key: '3',
62
+ tab: 'Tab 3',
63
+ count: 999
64
+ }, {
65
+ key: '4',
66
+ tab: 'Tab 4',
67
+ count: 1000
68
+ }, {
69
+ key: '5',
70
+ tab: 'Tab 5',
71
+ count: 1000
72
+ }, {
73
+ key: '6',
74
+ tab: 'Tab 6',
75
+ count: 1000
76
+ }, {
77
+ key: '7',
78
+ tab: 'Tab 7',
79
+ count: 1000
80
+ }, {
81
+ key: '8',
82
+ tab: 'Tab 8',
83
+ count: 1000
84
+ }, {
85
+ key: '9',
86
+ tab: 'Tab 9',
87
+ count: 1000
88
+ }, {
89
+ key: '10',
90
+ tab: 'Tab 10',
91
+ count: 1000
92
+ }, {
93
+ key: '11',
94
+ tab: 'Tab 11',
95
+ count: 1000
96
+ }]
97
+ });
98
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ import type { ProTabsProps } from './typing';
4
+ declare const ProTabs: React.FC<ProTabsProps>;
5
+ export default ProTabs;
@@ -0,0 +1,51 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import { Badge, Space, Tabs } from 'antd';
3
+ import React from 'react';
4
+ import ProButton from "../button-group";
5
+ import "./index.less";
6
+ var ProTabs = function ProTabs(_ref) {
7
+ var activeKey = _ref.activeKey,
8
+ _ref$tabs = _ref.tabs,
9
+ tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
10
+ _ref$overflowCount = _ref.overflowCount,
11
+ overflowCount = _ref$overflowCount === void 0 ? 999 : _ref$overflowCount,
12
+ toolbars = _ref.toolbars,
13
+ onChange = _ref.onChange,
14
+ settingTableRef = _ref.settingTableRef;
15
+ var tabPanRender = function tabPanRender(item) {
16
+ if (item.hasOwnProperty('count')) {
17
+ return /*#__PURE__*/React.createElement(Space, _extends({
18
+ size: 2
19
+ }, item), item.tab, /*#__PURE__*/React.createElement(Badge, {
20
+ showZero: true,
21
+ count: item.count,
22
+ overflowCount: overflowCount || Number.MAX_SAFE_INTEGER,
23
+ style: {
24
+ color: 'rgba(0, 0, 0, .45)',
25
+ backgroundColor: '#f0f0f0'
26
+ }
27
+ }));
28
+ }
29
+ return /*#__PURE__*/React.createElement("span", item, item.tab);
30
+ };
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ className: "sooloer-tabs"
33
+ }, /*#__PURE__*/React.createElement(Tabs, {
34
+ size: "small",
35
+ onChange: onChange,
36
+ activeKey: activeKey,
37
+ tabBarExtraContent: /*#__PURE__*/React.createElement("div", {
38
+ className: "sooloer-tabs-bar"
39
+ }, toolbars && /*#__PURE__*/React.createElement(ProButton, toolbars), settingTableRef && /*#__PURE__*/React.createElement("div", {
40
+ className: "sooloer-tabs-bar__config",
41
+ ref: settingTableRef
42
+ }))
43
+ }, tabs.map(function (item) {
44
+ return /*#__PURE__*/React.createElement(Tabs.TabPane, {
45
+ className: "sooloer-tabs-tab",
46
+ key: item.key,
47
+ tab: tabPanRender(item)
48
+ });
49
+ })));
50
+ };
51
+ export default ProTabs;
@@ -0,0 +1,11 @@
1
+ .sooloer-tabs {
2
+ position: relative;
3
+ padding: 0 24px;
4
+ div[class$='-tabs-nav'] {
5
+ margin-bottom: 0;
6
+ }
7
+ &-bar__config {
8
+ display: inline-block;
9
+ margin-left: 12px;
10
+ }
11
+ }
@@ -0,0 +1,51 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ProButtonsProps } from '../button-group/typing';
3
+ /**
4
+ * tab props
5
+ */
6
+ export interface ProTabProps {
7
+ /**
8
+ * @description 对应 activeKey
9
+ */
10
+ key?: string;
11
+ /**
12
+ * @description 选项卡头显示文字
13
+ */
14
+ tab?: string | ReactElement;
15
+ /**
16
+ * @description 当前tab状态下的统计数量
17
+ */
18
+ count?: number;
19
+ [key: string]: any;
20
+ }
21
+ /**
22
+ * tabs props
23
+ */
24
+ export interface ProTabsProps {
25
+ /**
26
+ * @description 当前激活 tab 面板的 key
27
+ */
28
+ activeKey?: string;
29
+ /**
30
+ * @description 当前 tab 集合
31
+ */
32
+ tabs?: ProTabProps[];
33
+ /**
34
+ * @description 展示封顶的数字值, 为 0 时,不设封顶
35
+ * @default 999
36
+ */
37
+ overflowCount?: number;
38
+ /**
39
+ * @description 切换面板的回调
40
+ */
41
+ onChange?: (activeKey: string) => void;
42
+ /**
43
+ * @description tab bar 上右侧额外元素
44
+ * @default false
45
+ */
46
+ toolbars?: ProButtonsProps;
47
+ /**
48
+ * table 工具栏配置 ref
49
+ */
50
+ settingTableRef?: React.Ref<HTMLDivElement>;
51
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,65 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { ProTable } from "../..";
8
+ import { ConfigProvider } from 'antd';
9
+ import zhCN from 'antd/lib/locale/zh_CN';
10
+ import React, { useCallback, useEffect, useState } from 'react';
11
+ import { columns, fetchData, total } from "./data";
12
+ export default (function () {
13
+ var _useState = useState([]),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ dataSource = _useState2[0],
16
+ setDataSource = _useState2[1];
17
+ var _useState3 = useState(false),
18
+ _useState4 = _slicedToArray(_useState3, 2),
19
+ loading = _useState4[0],
20
+ setLoading = _useState4[1];
21
+ var _useState5 = useState({
22
+ pageNo: 1,
23
+ pageSize: 20
24
+ }),
25
+ _useState6 = _slicedToArray(_useState5, 2),
26
+ _useState6$ = _useState6[0],
27
+ pageNo = _useState6$.pageNo,
28
+ pageSize = _useState6$.pageSize,
29
+ setPage = _useState6[1];
30
+ var queryData = useCallback(function (pageNo, pageSize) {
31
+ setLoading(true);
32
+ var data = fetchData(pageNo, pageSize);
33
+ setTimeout(function () {
34
+ setDataSource(data);
35
+ setLoading(false);
36
+ }, 1000);
37
+ }, []);
38
+ var handlePageChange = function handlePageChange(pageNo, pageSize) {
39
+ setPage({
40
+ pageNo: pageNo,
41
+ pageSize: pageSize
42
+ });
43
+ };
44
+ useEffect(function () {
45
+ queryData(pageNo, pageSize);
46
+ }, [pageNo, pageSize, queryData]);
47
+ return /*#__PURE__*/React.createElement(ConfigProvider, {
48
+ locale: zhCN
49
+ }, /*#__PURE__*/React.createElement(ProTable, {
50
+ loading: {
51
+ spinning: loading,
52
+ tip: '加载中ing...'
53
+ },
54
+ height: 420,
55
+ columns: columns,
56
+ dataSource: dataSource,
57
+ pagination: {
58
+ size: 'small',
59
+ total: total,
60
+ current: pageNo,
61
+ pageSize: pageSize,
62
+ onChange: handlePageChange
63
+ }
64
+ }));
65
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,75 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { ProTable } from "../..";
8
+ import { ConfigProvider } from 'antd';
9
+ import zhCN from 'antd/lib/locale/zh_CN';
10
+ import React, { useCallback, useEffect, useState } from 'react';
11
+ import { columns, fetchData, total } from "./data";
12
+ export default (function () {
13
+ var _useState = useState([]),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ dataSource = _useState2[0],
16
+ setDataSource = _useState2[1];
17
+ var _useState3 = useState(false),
18
+ _useState4 = _slicedToArray(_useState3, 2),
19
+ loading = _useState4[0],
20
+ setLoading = _useState4[1];
21
+ var _useState5 = useState({
22
+ pageNo: 1,
23
+ pageSize: 20
24
+ }),
25
+ _useState6 = _slicedToArray(_useState5, 2),
26
+ _useState6$ = _useState6[0],
27
+ pageNo = _useState6$.pageNo,
28
+ pageSize = _useState6$.pageSize,
29
+ setPage = _useState6[1];
30
+ var _useState7 = useState([]),
31
+ _useState8 = _slicedToArray(_useState7, 2),
32
+ selectedRowKeys = _useState8[0],
33
+ setSelectedRowKeys = _useState8[1];
34
+ var queryData = useCallback(function (pageNo, pageSize) {
35
+ setLoading(true);
36
+ var data = fetchData(pageNo, pageSize);
37
+ setTimeout(function () {
38
+ setDataSource(data);
39
+ setLoading(false);
40
+ }, 1000);
41
+ }, []);
42
+ var handlePageChange = function handlePageChange(pageNo, pageSize) {
43
+ setPage({
44
+ pageNo: pageNo,
45
+ pageSize: pageSize
46
+ });
47
+ };
48
+ useEffect(function () {
49
+ queryData(pageNo, pageSize);
50
+ }, [pageNo, pageSize, queryData]);
51
+ var handleRowSelectionChange = function handleRowSelectionChange(selectedRowKeys, globalChecked) {
52
+ console.log(selectedRowKeys, globalChecked);
53
+ setSelectedRowKeys(selectedRowKeys);
54
+ };
55
+ return /*#__PURE__*/React.createElement(ConfigProvider, {
56
+ locale: zhCN
57
+ }, /*#__PURE__*/React.createElement(ProTable, {
58
+ loading: loading,
59
+ height: 420,
60
+ rowSelection: {
61
+ fixed: true,
62
+ selectedRowKeys: selectedRowKeys,
63
+ // @ts-ignore
64
+ onChange: handleRowSelectionChange
65
+ },
66
+ columns: columns,
67
+ dataSource: dataSource,
68
+ pagination: {
69
+ total: total,
70
+ current: pageNo,
71
+ pageSize: pageSize,
72
+ onChange: handlePageChange
73
+ }
74
+ }));
75
+ });
@@ -0,0 +1,16 @@
1
+ import type { ColumnsType } from 'antd/es/table';
2
+ export declare const total = 100;
3
+ export interface DataType {
4
+ id: string;
5
+ salesbill_no: string;
6
+ amount_with_tax: number;
7
+ amount_without_tax: number;
8
+ tax_amount: number;
9
+ purchaser_name: string;
10
+ seller_name: string;
11
+ create_time: string;
12
+ salesbill_type: string;
13
+ }
14
+ export declare const columns: ColumnsType<DataType>;
15
+ export declare const initData: (id?: number) => (import("antd/es/table").ColumnGroupType<DataType> | import("antd/es/table").ColumnType<DataType>)[];
16
+ export declare const fetchData: (pageNo?: number, pageSize?: number) => (import("antd/es/table").ColumnGroupType<DataType> | import("antd/es/table").ColumnType<DataType>)[];
@@ -0,0 +1,120 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { formatTime, toThousands } from '@tmaito/utils';
8
+ import Mock from 'mockjs';
9
+ var Random = Mock.Random;
10
+ export var total = 100;
11
+ export var columns = [{
12
+ title: '结算单号',
13
+ width: 180,
14
+ align: 'center',
15
+ // fixed: 'left',
16
+ dataIndex: 'salesbill_no'
17
+ }, {
18
+ title: '含税总金额',
19
+ width: 140,
20
+ align: 'right',
21
+ dataIndex: 'amount_with_tax',
22
+ render: function render(text) {
23
+ return toThousands(text);
24
+ }
25
+ }, {
26
+ title: '不含税总金额',
27
+ width: 140,
28
+ align: 'right',
29
+ dataIndex: 'amount_without_tax',
30
+ render: function render(text) {
31
+ return toThousands(text);
32
+ }
33
+ }, {
34
+ title: '总税额',
35
+ width: 120,
36
+ align: 'right',
37
+ dataIndex: 'tax_amount',
38
+ render: function render(text) {
39
+ return toThousands(text);
40
+ }
41
+ }, {
42
+ title: '购方名称',
43
+ width: 240,
44
+ dataIndex: 'purchaser_name'
45
+ }, {
46
+ title: '销方名称',
47
+ width: 240,
48
+ dataIndex: 'seller_name'
49
+ }, {
50
+ title: '创建日期',
51
+ width: 120,
52
+ align: 'center',
53
+ dataIndex: 'create_time',
54
+ render: function render(text) {
55
+ return formatTime(text, 'YYYY-MM-DD');
56
+ }
57
+ }, {
58
+ title: '结算单类型',
59
+ width: 120,
60
+ align: 'center',
61
+ dataIndex: 'salesbill_type',
62
+ render: function render(text) {
63
+ return "".concat(text, "\u7ED3\u7B97\u5355");
64
+ }
65
+ }];
66
+ export var initData = function initData() {
67
+ var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
68
+ var dataSource = [];
69
+ var _loop = function _loop(i) {
70
+ var row = columns.reduce(function (data, col) {
71
+ // @ts-ignore
72
+ switch (col.dataIndex) {
73
+ case 'salesbill_no':
74
+ // @ts-ignore
75
+ data[col.dataIndex] = Random.id();
76
+ break;
77
+ case 'tax_amount':
78
+ case 'amount_with_tax':
79
+ case 'amount_without_tax':
80
+ // @ts-ignore
81
+ data[col.dataIndex] = Random.integer(0, 10000);
82
+ break;
83
+ case 'purchaser_name':
84
+ case 'seller_name':
85
+ // @ts-ignore
86
+ data[col.dataIndex] = Random.title();
87
+ break;
88
+ case 'create_time':
89
+ // @ts-ignore
90
+ data[col.dataIndex] = Random.datetime('yyyyMMddHHmmss');
91
+ break;
92
+ case 'salesbill_type':
93
+ // @ts-ignore
94
+ data[col.dataIndex] = Random.pick(['AP', 'AR']);
95
+ break;
96
+ case 'action':
97
+ break;
98
+ default:
99
+ // @ts-ignore
100
+ data[col.dataIndex] = Random.title();
101
+ break;
102
+ }
103
+ return _objectSpread({
104
+ // id: Random.id(),
105
+ id: "".concat(id + i)
106
+ }, data);
107
+ }, {});
108
+ dataSource.push(row);
109
+ };
110
+ for (var i = 0; i < total; i++) {
111
+ _loop(i);
112
+ }
113
+ return dataSource;
114
+ };
115
+ var dataSource = initData();
116
+ export var fetchData = function fetchData() {
117
+ var pageNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
118
+ var pageSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
119
+ return dataSource.slice((pageNo - 1) * pageSize, pageNo * pageSize);
120
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;