@vtx/components 4.0.0-beta.7 → 4.0.0-beta.70

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 (161) hide show
  1. package/es/index.js +3 -0
  2. package/es/utils/filterSpecialCharacters.js +47 -46
  3. package/es/utils/index.js +1 -2
  4. package/es/vtx-color-picker/index.js +138 -33
  5. package/es/vtx-color-picker/style/index.js +36 -12
  6. package/es/vtx-combogrid/Combogrid.js +16 -10
  7. package/es/vtx-combogrid/index.js +7 -4
  8. package/es/vtx-combogrid/style/index.js +4 -4
  9. package/es/vtx-datagrid/Store/Provide.js +109 -132
  10. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -5
  11. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  12. package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  13. package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  14. package/es/vtx-datagrid/ToolBar/index.js +2 -2
  15. package/es/vtx-datagrid/columnState.js +64 -0
  16. package/es/vtx-datagrid/index.js +114 -35
  17. package/es/vtx-datagrid/mergeComponents.js +15 -0
  18. package/es/vtx-datagrid/renderColumnButtons.js +30 -11
  19. package/es/vtx-datagrid/style/index.js +102 -20
  20. package/es/vtx-date-picker/QdatePicker.js +1 -1
  21. package/es/vtx-descriptions/Descriptions.js +29 -0
  22. package/es/vtx-descriptions/index.js +3 -0
  23. package/es/vtx-descriptions/style/index.js +19 -0
  24. package/es/vtx-ellipsis-text/index.js +7 -2
  25. package/es/vtx-ellipsis-text/style/index.js +3 -1
  26. package/es/vtx-export/index.js +25 -25
  27. package/es/vtx-export-async/History.js +7 -3
  28. package/es/vtx-export-async/index.js +42 -14
  29. package/es/vtx-form-layout/Card.js +10 -10
  30. package/es/vtx-form-layout/Divider.js +1 -1
  31. package/es/vtx-form-layout/FormItem.js +18 -17
  32. package/es/vtx-form-layout/Pane.js +23 -12
  33. package/es/vtx-icon/index.js +54 -45
  34. package/es/vtx-icon/index.js1 +90 -0
  35. package/es/vtx-image/Preview.js +11 -6
  36. package/es/vtx-image/style/index.js +0 -1
  37. package/es/vtx-import/index.js +155 -43
  38. package/es/vtx-import/result.js +6 -2
  39. package/es/vtx-import/style/index.js +16 -1
  40. package/es/vtx-import2/Content.js +2 -1
  41. package/es/vtx-import2/index.js +31 -20
  42. package/es/vtx-import2/style/index.js +60 -9
  43. package/es/vtx-input/TextArea/index.js +11 -6
  44. package/es/vtx-modal/index.js +9 -4
  45. package/es/vtx-modal/style/index.js +5 -3
  46. package/es/vtx-page-layout/Content.js +1 -1
  47. package/es/vtx-page-layout/TabLayout.js +1 -7
  48. package/es/vtx-page-layout/TableLayout.js +14 -4
  49. package/es/vtx-page-layout/TableWrap.js +3 -2
  50. package/es/vtx-page-layout/TreeLayout.js +2 -8
  51. package/es/vtx-page-layout/container.js +6 -5
  52. package/es/vtx-page-layout/style/index.js +4 -2
  53. package/es/vtx-provider/index.js +20 -10
  54. package/es/vtx-provider/locale/en_US.js +65 -5
  55. package/es/vtx-provider/locale/zh_CN.js +75 -5
  56. package/es/vtx-provider/useStyle/index.js +8 -4
  57. package/es/vtx-scrollable-row/index.js +38 -28
  58. package/es/vtx-search/index.js +18 -13
  59. package/es/vtx-search/style/index.js +2 -1
  60. package/es/vtx-select/index.js +132 -46
  61. package/es/vtx-select/style/index.js +11 -56
  62. package/es/vtx-signature/index.js +5 -4
  63. package/es/vtx-signature/style/index.js +1 -1
  64. package/es/vtx-split-pane/Resizer.js +0 -1
  65. package/es/vtx-split-pane/SplitPane.js +34 -25
  66. package/es/vtx-split-pane/style/index.js +8 -112
  67. package/es/vtx-time-picker/index.js +27 -1
  68. package/es/vtx-transfer/Transfer.js +29 -0
  69. package/es/vtx-transfer/index.js +3 -0
  70. package/es/vtx-transfer/style/index.js +19 -0
  71. package/es/vtx-transfer-select/TransferSelect.js +143 -0
  72. package/es/vtx-transfer-select/index.js +3 -0
  73. package/es/vtx-transfer-select/style/index.js +19 -0
  74. package/es/vtx-tree/index.js +104 -40
  75. package/es/vtx-tree-select/index.js +75 -105
  76. package/es/vtx-tree-select/style/index.js +9 -3
  77. package/es/vtx-upload/FilePreview.js +2 -1
  78. package/es/vtx-wang-editor/index.js +291 -113
  79. package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
  80. package/lib/index.js +36 -0
  81. package/lib/utils/filterSpecialCharacters.js +48 -46
  82. package/lib/utils/index.js +0 -7
  83. package/lib/vtx-color-picker/index.js +139 -34
  84. package/lib/vtx-color-picker/style/index.js +36 -12
  85. package/lib/vtx-combogrid/Combogrid.js +16 -10
  86. package/lib/vtx-combogrid/index.js +7 -4
  87. package/lib/vtx-combogrid/style/index.js +4 -4
  88. package/lib/vtx-datagrid/Store/Provide.js +116 -138
  89. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -6
  90. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  91. package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  92. package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  93. package/lib/vtx-datagrid/ToolBar/index.js +2 -2
  94. package/lib/vtx-datagrid/columnState.js +73 -0
  95. package/lib/vtx-datagrid/index.js +115 -35
  96. package/lib/vtx-datagrid/mergeComponents.js +21 -0
  97. package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
  98. package/lib/vtx-datagrid/style/index.js +102 -20
  99. package/lib/vtx-date-picker/QdatePicker.js +1 -1
  100. package/lib/vtx-descriptions/Descriptions.js +38 -0
  101. package/lib/vtx-descriptions/index.js +15 -0
  102. package/lib/vtx-descriptions/style/index.js +25 -0
  103. package/lib/vtx-ellipsis-text/index.js +7 -2
  104. package/lib/vtx-ellipsis-text/style/index.js +3 -1
  105. package/lib/vtx-export/index.js +26 -26
  106. package/lib/vtx-export-async/History.js +7 -3
  107. package/lib/vtx-export-async/index.js +40 -12
  108. package/lib/vtx-form-layout/Card.js +9 -9
  109. package/lib/vtx-form-layout/Divider.js +1 -1
  110. package/lib/vtx-form-layout/FormItem.js +18 -17
  111. package/lib/vtx-form-layout/Pane.js +22 -11
  112. package/lib/vtx-icon/index.js +54 -52
  113. package/lib/vtx-icon/index.js1 +90 -0
  114. package/lib/vtx-image/Preview.js +11 -6
  115. package/lib/vtx-image/style/index.js +0 -1
  116. package/lib/vtx-import/index.js +154 -42
  117. package/lib/vtx-import/result.js +6 -2
  118. package/lib/vtx-import/style/index.js +16 -1
  119. package/lib/vtx-import2/Content.js +2 -1
  120. package/lib/vtx-import2/index.js +30 -19
  121. package/lib/vtx-import2/style/index.js +60 -9
  122. package/lib/vtx-input/TextArea/index.js +11 -6
  123. package/lib/vtx-modal/index.js +9 -4
  124. package/lib/vtx-modal/style/index.js +5 -3
  125. package/lib/vtx-page-layout/Content.js +1 -1
  126. package/lib/vtx-page-layout/TabLayout.js +3 -9
  127. package/lib/vtx-page-layout/TableLayout.js +14 -4
  128. package/lib/vtx-page-layout/TableWrap.js +3 -2
  129. package/lib/vtx-page-layout/TreeLayout.js +4 -10
  130. package/lib/vtx-page-layout/container.js +6 -5
  131. package/lib/vtx-page-layout/style/index.js +4 -2
  132. package/lib/vtx-provider/index.js +19 -10
  133. package/lib/vtx-provider/locale/en_US.js +65 -5
  134. package/lib/vtx-provider/locale/zh_CN.js +75 -5
  135. package/lib/vtx-provider/useStyle/index.js +8 -4
  136. package/lib/vtx-scrollable-row/index.js +38 -28
  137. package/lib/vtx-search/index.js +18 -13
  138. package/lib/vtx-search/style/index.js +2 -1
  139. package/lib/vtx-select/index.js +134 -48
  140. package/lib/vtx-select/style/index.js +11 -56
  141. package/lib/vtx-signature/index.js +4 -3
  142. package/lib/vtx-signature/style/index.js +1 -1
  143. package/lib/vtx-split-pane/Resizer.js +0 -1
  144. package/lib/vtx-split-pane/SplitPane.js +32 -23
  145. package/lib/vtx-split-pane/style/index.js +8 -112
  146. package/lib/vtx-time-picker/index.js +27 -1
  147. package/lib/vtx-transfer/Transfer.js +38 -0
  148. package/lib/vtx-transfer/index.js +15 -0
  149. package/lib/vtx-transfer/style/index.js +25 -0
  150. package/lib/vtx-transfer-select/TransferSelect.js +151 -0
  151. package/lib/vtx-transfer-select/index.js +15 -0
  152. package/lib/vtx-transfer-select/style/index.js +25 -0
  153. package/lib/vtx-tree/index.js +102 -38
  154. package/lib/vtx-tree-select/index.js +75 -105
  155. package/lib/vtx-tree-select/style/index.js +9 -3
  156. package/lib/vtx-upload/FilePreview.js +2 -1
  157. package/lib/vtx-wang-editor/index.js +289 -113
  158. package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
  159. package/package.json +44 -28
  160. package/es/utils/hooks/useFetchData/index.js +0 -82
  161. package/lib/utils/hooks/useFetchData/index.js +0 -89
@@ -14,37 +14,85 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
14
14
  var genVtxStyle = function genVtxStyle(token) {
15
15
  var componentCls = token.componentCls,
16
16
  antCls = token.antCls;
17
- return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
17
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({
18
18
  position: 'relative',
19
- overflow: 'hidden'
20
- }, "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty({}, '.ant-table', _defineProperty(_defineProperty(_defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
19
+ // overflow: 'hidden',
20
+ display: 'flex',
21
+ flexDirection: 'column'
22
+ }, "".concat(antCls, "-table-cell-ellipsis"), {
23
+ whiteSpace: "normal"
24
+ }), "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
25
+ // minWidth: "calc(100% - 2px) !important"
26
+ }), '.ant-spin', _defineProperty({
27
+ height: '100%'
28
+ }, '.ant-spin-container', _defineProperty({
29
+ height: '100%',
30
+ display: 'flex',
31
+ flexDirection: 'column'
32
+ }, '.ant-table', _defineProperty({
33
+ // height: '100%',
34
+ flex: 1
35
+ }, '.ant-table-container', _defineProperty(_defineProperty({
36
+ height: '100%',
37
+ borderInlineStart: "none"
38
+ }, '.ant-table-body', {
39
+ scrollbarWidth: "thin"
40
+ }), '.ant-table-content', _defineProperty({
41
+ height: '100%',
42
+ scrollbarWidth: "thin"
43
+ }, 'table', {
44
+ // height: '100%',
45
+ minWidth: "calc(100% - 1px) !important"
46
+ })))))), '.ant-table', _defineProperty(_defineProperty(_defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
21
47
  '>tr>th': {
22
- background: token.colorBgContainer
48
+ background: token.colorBgContainer,
49
+ '&:first-child': {
50
+ borderInlineStart: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
51
+ }
23
52
  }
24
53
  })), '.ant-table-cell', {
25
- minWidth: 20
26
- }), '.ant-table-body', _defineProperty({}, '.ant-table-tbody', {
54
+ // minWidth: 10,
55
+ }), '.ant-table-tbody', {
56
+ '>tr>td': {
57
+ '&:first-child': {
58
+ borderInlineStart: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
59
+ }
60
+ },
27
61
  '>tr.ant-table-placeholder': {
28
62
  position: 'absolute',
29
- top: '25%',
63
+ top: "auto",
64
+ bottom: "auto",
30
65
  right: 0,
31
66
  left: 0,
32
67
  backgroundColor: 'transparent',
33
68
  borderTop: 'none',
69
+ // borderInlineEnd: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
70
+ // borderBottom: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
34
71
  '>td.ant-table-cell': {
35
- display: 'flex',
36
- alignItems: 'center',
37
- justifyContent: 'center',
72
+ padding: 0,
38
73
  width: '100%',
39
74
  height: '100%',
40
- border: 'none'
75
+ border: 'none',
76
+ '>.ant-table-expanded-row-fixed': {
77
+ display: 'flex',
78
+ alignItems: 'center',
79
+ justifyContent: 'center',
80
+ height: '100%',
81
+ width: '100%',
82
+ '&::after': {
83
+ border: 'none'
84
+ }
85
+ }
41
86
  }
42
87
  }
43
- }))), '.ant-pagination', _defineProperty({}, '.ant-pagination-item', {
88
+ })), '.ant-pagination', _defineProperty({
89
+ margin: "var(--ant-margin) 0 0 0"
90
+ }, '.ant-pagination-item', {
44
91
  borderRadius: token.borderRadiusSM
45
- }))), "&-fit", {
46
- height: '100%'
47
- }), "&-noFit", {}), "&-no-border", _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({
92
+ })))), "".concat(componentCls, "-fit"), {
93
+ height: '100%',
94
+ minHeight: 200
95
+ }), "".concat(componentCls, "-noFit"), {}), "".concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({
48
96
  borderColor: 'transparent'
49
97
  }, '.ant-table-thead', {
50
98
  '>tr>th': {
@@ -53,10 +101,14 @@ var genVtxStyle = function genVtxStyle(token) {
53
101
  }), '.ant-table-body', {
54
102
  '>table >tbody>tr>td': {
55
103
  borderInlineColor: 'transparent !important'
104
+ },
105
+ '>table >tbody>tr.ant-table-placeholder': {
106
+ borderInlineColor: 'transparent !important',
107
+ borderBottomColor: 'transparent !important'
56
108
  }
57
- }))))), "&.vtx-datagrid-striped", _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty({}, '.ant-table-body', {
109
+ }))))), "".concat(componentCls, "-striped"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({}, '.ant-table-body', {
58
110
  '>table >tbody>tr:nth-child(odd)>td': {
59
- backgroundColor: token.colorBgLayout,
111
+ backgroundColor: token.colorBgLayoutTable,
60
112
  '&.ant-table-cell-row-hover': {
61
113
  backgroundColor: token.colorFillAlterSolid
62
114
  }
@@ -70,11 +122,41 @@ var genVtxStyle = function genVtxStyle(token) {
70
122
  backgroundColor: token.controlItemBgActiveHover
71
123
  }
72
124
  }
73
- }))))), "&.vtx-datagrid-header-background", _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
125
+ }), '.ant-table-tbody', {
126
+ '>tr:nth-child(odd)>td': {
127
+ backgroundColor: token.colorBgLayoutTable,
128
+ '&.ant-table-cell-row-hover': {
129
+ backgroundColor: token.colorFillAlterSolid
130
+ }
131
+ },
132
+ '>tr:nth-child(odd)>td.ant-table-column-sort': {
133
+ backgroundColor: token.colorFillAlterSolid
134
+ },
135
+ '>tr.ant-table-row-selected:nth-child(odd)>td': {
136
+ backgroundColor: token.controlItemBgActive,
137
+ '&.ant-table-cell-row-hover': {
138
+ backgroundColor: token.controlItemBgActiveHover
139
+ }
140
+ }
141
+ }))))), "".concat(componentCls, "-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
74
142
  '>tr>th': {
75
- background: token.colorBgLayout
143
+ background: token.colorBgLayoutTable
144
+ }
145
+ }))))), "".concat(componentCls, "-no-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper "), _defineProperty({}, '.ant-table-thead', {
146
+ '>tr>th': {
147
+ background: token.colorBgContainer
76
148
  }
77
- }))))));
149
+ }))), "".concat(componentCls, "-no-data"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
150
+ borderInlineStart: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
151
+ }, '.ant-table-content', _defineProperty({
152
+ borderRight: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
153
+ borderBottom: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
154
+ }, 'table', {})))))))), "".concat(componentCls, "-no-data").concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
155
+ borderInlineStart: "none"
156
+ }, '.ant-table-content', {
157
+ borderRight: "none",
158
+ borderBottom: "none"
159
+ })))))));
78
160
  };
79
161
  function useStyle(prefix) {
80
162
  return (0, _vtxProvider.useStyle)(prefix, function (token) {
@@ -31,7 +31,7 @@ function VtxQtimePicker(props) {
31
31
  var _format$split;
32
32
  var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
33
33
  getPrefixCls = _useContext.getPrefixCls;
34
- var prefixCls = getPrefixCls('', 'vtx-color-picker');
34
+ var prefixCls = getPrefixCls('', 'vtx-date-picker');
35
35
  var _useStyle = (0, _index.useStyle)(prefixCls),
36
36
  wrapSSR = _useStyle.wrapSSR,
37
37
  hashId = _useStyle.hashId;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _antd = require("antd");
11
+ var _style = require("./style");
12
+ var _vtxProvider = require("../vtx-provider");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ 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; }
18
+ 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; }
19
+ 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; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
21
+ 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); }
22
+ function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
23
+ function VtxDescriptions(props) {
24
+ var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
25
+ getPrefixCls = _useContext.getPrefixCls;
26
+ var prefixCls = getPrefixCls('descriptions', props.prefixCls);
27
+ var _useStyle = (0, _style.useStyle)(prefixCls),
28
+ wrapSSR = _useStyle.wrapSSR,
29
+ hashId = _useStyle.hashId;
30
+ var rest = Object.assign({}, (_objectDestructuringEmpty(props), props));
31
+ return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Descriptions, _objectSpread({
32
+ classNames: {
33
+ root: (0, _classnames.default)(hashId, prefixCls)
34
+ }
35
+ }, rest)));
36
+ }
37
+ VtxDescriptions.propTypes = {};
38
+ var _default = exports.default = VtxDescriptions;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "VtxDescriptions", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Descriptions.default;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+ var _Descriptions = _interopRequireDefault(require("./Descriptions"));
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ var _default = exports.default = _Descriptions.default;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useStyle = useStyle;
7
+ var _vtxProvider = require("../../vtx-provider");
8
+ 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); }
9
+ 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; }
10
+ 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; }
11
+ 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; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ 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); }
14
+ var genStyle = function genStyle(token) {
15
+ var componentCls = token.componentCls;
16
+ return _defineProperty({}, componentCls, {});
17
+ };
18
+ function useStyle(prefixCls) {
19
+ return (0, _vtxProvider.useStyle)('VtxDescriptions', function (token) {
20
+ var _token = _objectSpread(_objectSpread({}, token), {}, {
21
+ componentCls: ".".concat(prefixCls)
22
+ });
23
+ return [genStyle(_token)];
24
+ });
25
+ }
@@ -28,6 +28,11 @@ function VtxEllipsisText(props) {
28
28
  tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
29
29
  className = props.className,
30
30
  style = props.style;
31
+
32
+ // 边界检查
33
+ if (!text) {
34
+ return null;
35
+ }
31
36
  var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
32
37
  getPrefixCls = _useContext.getPrefixCls;
33
38
  var prefixCls = getPrefixCls('vtx-ellipsis-text');
@@ -35,7 +40,7 @@ function VtxEllipsisText(props) {
35
40
  wrapSSR = _useStyle.wrapSSR,
36
41
  hashId = _useStyle.hashId;
37
42
  var textStyle = {};
38
- if (lineClamp > 2) {
43
+ if (lineClamp >= 1) {
39
44
  textStyle['WebkitLineClamp'] = lineClamp;
40
45
  }
41
46
  return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, _objectSpread(_objectSpread({
@@ -44,7 +49,7 @@ function VtxEllipsisText(props) {
44
49
  mouseEnterDelay: 0.3
45
50
  }, tooltip), {}, {
46
51
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
47
- className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 2), "".concat(prefixCls, "--multi"), lineClamp >= 2), className),
52
+ className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 1), "".concat(prefixCls, "--multi"), lineClamp >= 1), className),
48
53
  style: _objectSpread(_objectSpread({}, style), textStyle),
49
54
  children: text
50
55
  })
@@ -16,7 +16,9 @@ var genVtxEllipsisTextStyle = function genVtxEllipsisTextStyle(token) {
16
16
  return _defineProperty({}, componentCls, _defineProperty(_defineProperty({
17
17
  margin: 0,
18
18
  overflow: 'hidden',
19
- textOverflow: 'ellipsis'
19
+ textOverflow: 'ellipsis',
20
+ wordBreak: "break-all",
21
+ wordWrap: "break-word"
20
22
  }, "&--single", {
21
23
  whiteSpace: 'nowrap'
22
24
  }), "&--multi", {
@@ -11,12 +11,14 @@ var _axios = _interopRequireDefault(require("axios"));
11
11
  var _querystring = _interopRequireDefault(require("querystring"));
12
12
  var _getToken = _interopRequireDefault(require("../utils/getToken"));
13
13
  var _icons = require("@ant-design/icons");
14
- var _utils = require("@vtx/utils");
15
- var _utils2 = require("../utils");
14
+ var _downloadFile = _interopRequireDefault(require("@vtx/utils/lib/downloadFile"));
15
+ var _getSignature = _interopRequireDefault(require("@vtx/utils/lib/getSignature"));
16
+ var _utils = require("../utils");
16
17
  var _index = require("./style/index");
17
18
  var _antd = require("antd");
18
19
  var _classnames = _interopRequireDefault(require("classnames"));
19
20
  var _vtxProvider = require("../vtx-provider");
21
+ var _vtxIcon = _interopRequireDefault(require("../vtx-icon"));
20
22
  var _jsxRuntime = require("react/jsx-runtime");
21
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -90,7 +92,7 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
90
92
  headers: _objectSpread(_objectSpread({
91
93
  'Content-Type': 'application/x-www-form-urlencoded',
92
94
  Authorization: token ? "Bearer ".concat(token) : ''
93
- }, headers), (0, _utils.getSignature)((0, _utils2.isObject)(postData) ? postData : {}, undefined, (0, _utils2.isObject)(postData) ? undefined : postData)),
95
+ }, headers), (0, _getSignature.default)((0, _utils.isObject)(postData) ? postData : {}, undefined, (0, _utils.isObject)(postData) ? undefined : postData)),
94
96
  data: (headers === null || headers === void 0 ? void 0 : headers['Content-Type']) === 'application/json' ? postData : _querystring.default.stringify(postData)
95
97
  };
96
98
  return new Promise(function (resolve, reject) {
@@ -109,31 +111,26 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
109
111
  spinning: true,
110
112
  className: (0, _classnames.default)(prefixCls, hashId, 'vtx-spin')
111
113
  }), div);
114
+ var status = false;
112
115
  document.body.appendChild(div);
113
- requestToResponse(postData).then(function (res) {
114
- var status = false;
115
- // 文件存在
116
- if (res.headers['content-disposition']) {
117
- var contentDisposition = res.headers['content-disposition'];
118
- var filename;
119
- if (contentDisposition.indexOf('filename*=') > -1) {
120
- filename = decodeURI(contentDisposition.split('filename*=')[1].replace("utf-8'zh_cn'", ''));
121
- } else {
122
- filename = decodeURI(contentDisposition.split('filename=')[1]);
116
+ (0, _downloadFile.default)(downloadURL, {
117
+ timeout: timeout,
118
+ data: postData,
119
+ extraHeader: headers,
120
+ success: function success() {
121
+ status = true;
122
+ },
123
+ fail: function fail() {
124
+ status = false;
125
+ _antd.message.error('导出失败');
126
+ },
127
+ finally: function _finally() {
128
+ document.body.removeChild(div);
129
+ if (afterExport && typeof afterExport === 'function') {
130
+ afterExport(status);
123
131
  }
124
- if ('download' in document.createElement('a')) {
125
- download(res.data, filename);
126
- status = true;
127
- } else {
128
- _antd.message.warning(intl.getMessage('fallback.browserNotSupported', '浏览器不支持'));
129
- }
130
- }
131
- // 关闭loading,执行回调
132
- document.body.removeChild(div);
133
- if (afterExport && typeof afterExport === 'function') {
134
- afterExport(status);
135
132
  }
136
- });
133
+ }, 'blob');
137
134
  }
138
135
  /* 下载并 兼容IE */
139
136
  function download(content, filename) {
@@ -184,7 +181,10 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
184
181
  trigger: ['click'],
185
182
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
186
183
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ExportOutlined, {}),
187
- children: [exportText, " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DownOutlined, {})]
184
+ children: [exportText, " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
185
+ type: "downOutlined",
186
+ fileType: "svg"
187
+ })]
188
188
  })
189
189
  }));
190
190
  };
@@ -46,7 +46,9 @@ function History(props) {
46
46
  _props$customTablePro = props.customTableProps,
47
47
  customTableProps = _props$customTablePro === void 0 ? {} : _props$customTablePro,
48
48
  refreshTime = props.refreshTime,
49
- downloadInNewTab = props.downloadInNewTab;
49
+ downloadInNewTab = props.downloadInNewTab,
50
+ _props$headers = props.headers,
51
+ headers = _props$headers === void 0 ? {} : _props$headers;
50
52
  var _Form$useForm = _antd.Form.useForm(),
51
53
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
52
54
  form = _Form$useForm2[0];
@@ -159,7 +161,8 @@ function History(props) {
159
161
  (0, _utils.downloadFile)(downFileUrl, {
160
162
  data: {
161
163
  id: record.id
162
- }
164
+ },
165
+ extraHeader: headers
163
166
  }, 'blob');
164
167
  }
165
168
  },
@@ -259,6 +262,7 @@ History.propTypes = {
259
262
  TextEnum: _propTypes.default.object,
260
263
  customTableProps: _propTypes.default.object,
261
264
  refreshTime: _propTypes.default.number,
262
- downloadInNewTab: _propTypes.default.bool
265
+ downloadInNewTab: _propTypes.default.bool,
266
+ headers: _propTypes.default.object
263
267
  };
264
268
  var _default = exports.default = History;
@@ -18,6 +18,8 @@ var _index = require("./style/index");
18
18
  var _classnames = _interopRequireDefault(require("classnames"));
19
19
  var _vtxProvider = require("../vtx-provider");
20
20
  var _vtxModal = _interopRequireDefault(require("../vtx-modal"));
21
+ var _vtxInput = _interopRequireDefault(require("../vtx-input"));
22
+ var _filterSpecialCharacters = require("../utils/filterSpecialCharacters");
21
23
  var _jsxRuntime = require("react/jsx-runtime");
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -33,15 +35,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
33
35
  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; }
34
36
  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; } }
35
37
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
- var timer = null;
38
+ var Includes = ['\\\\', '\\/', ':', '*', '?', '"', '<', '>', '|'];
37
39
  var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
38
40
  var intl = (0, _vtxProvider.useIntl)();
39
41
  var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
40
42
  getPrefixCls = _useContext.getPrefixCls;
41
- var prefixCls = getPrefixCls('vtx-export-async', props.prefixCls);
43
+ var prefixCls = getPrefixCls('', 'vtx-export-async');
42
44
  var _useStyle = (0, _index.useStyle)(prefixCls),
43
45
  wrapSSR = _useStyle.wrapSSR,
44
46
  hashId = _useStyle.hashId;
47
+ var timerRef = (0, _react.useRef)(null);
45
48
  var uniqueKey = props.uniqueKey,
46
49
  _props$title = props.title,
47
50
  title = _props$title === void 0 ? '' : _props$title,
@@ -84,9 +87,11 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
84
87
  downloadInNewTab = _props$downloadInNewT === void 0 ? false : _props$downloadInNewT,
85
88
  _props$enableCustomSe = props.enableCustomSelect,
86
89
  enableCustomSelect = _props$enableCustomSe === void 0 ? false : _props$enableCustomSe,
87
- beforeExport = props.beforeExport,
88
90
  _props$headers = props.headers,
89
- headers = _props$headers === void 0 ? {} : _props$headers;
91
+ headers = _props$headers === void 0 ? {} : _props$headers,
92
+ beforeExport = props.beforeExport,
93
+ _props$historyHeaders = props.historyHeaders,
94
+ historyHeaders = _props$historyHeaders === void 0 ? {} : _props$historyHeaders;
90
95
  var _Form$useForm = _antd.Form.useForm(),
91
96
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
92
97
  form = _Form$useForm2[0];
@@ -168,9 +173,9 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
168
173
  });
169
174
  }, [state.visible]);
170
175
  function close() {
171
- if (timer) {
172
- clearInterval(timer);
173
- timer = null;
176
+ if (timerRef.current) {
177
+ clearInterval(timerRef.current);
178
+ timerRef.current = null;
174
179
  }
175
180
  form.resetFields();
176
181
  setState({
@@ -180,6 +185,15 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
180
185
  timer: null
181
186
  });
182
187
  }
188
+
189
+ // 组件卸载时也要清理
190
+ (0, _react.useEffect)(function () {
191
+ return function () {
192
+ if (timerRef.current) {
193
+ clearInterval(timerRef.current);
194
+ }
195
+ };
196
+ }, []);
183
197
  function showHistory() {
184
198
  setState({
185
199
  showHistoryModal: true
@@ -261,6 +275,8 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
261
275
  } else {
262
276
  _antd.message.error((res === null || res === void 0 ? void 0 : res.msg) || "".concat(intl.getMessage('export.exportText', '导出')).concat(intl.getMessage('export.failure', '失败')));
263
277
  }
278
+ }).catch(function (err) {
279
+ _antd.message.error('导出失败:' + (err.message || '网络错误'));
264
280
  });
265
281
  }
266
282
  });
@@ -290,7 +306,9 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
290
306
  subtitle: TextEnum.modalTitleText
291
307
  }) : TextEnum.modalTitleText,
292
308
  open: state.visible,
293
- maskClosable: false,
309
+ mask: {
310
+ closable: false
311
+ },
294
312
  onCancel: close,
295
313
  footer: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
296
314
  onClick: close,
@@ -321,8 +339,15 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
321
339
  required: true,
322
340
  message: TextEnum.requireFieldMsgText
323
341
  }],
324
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
325
- placeholder: TextEnum.placeholderFileName
342
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxInput.default, {
343
+ placeholder: TextEnum.placeholderFileName,
344
+ specialCharactersFilter: {
345
+ include: Includes,
346
+ exclude: _filterSpecialCharacters.SpecialCharacters.filter(function (v) {
347
+ return !Includes.includes(v);
348
+ })
349
+ },
350
+ maxLength: 255
326
351
  })
327
352
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
328
353
  label: TextEnum.fieldTypeText,
@@ -374,7 +399,8 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
374
399
  TextEnum: TextEnum,
375
400
  customTableProps: customTableProps,
376
401
  refreshTime: refreshTime,
377
- downloadInNewTab: downloadInNewTab
402
+ downloadInNewTab: downloadInNewTab,
403
+ headers: historyHeaders
378
404
  })]
379
405
  }));
380
406
  };
@@ -404,6 +430,8 @@ VtxExportAsync.propTypes = {
404
430
  refreshTime: _propTypes.default.number,
405
431
  downloadInNewTab: _propTypes.default.bool,
406
432
  enableCustomSelect: _propTypes.default.bool,
407
- headers: _propTypes.default.object
433
+ headers: _propTypes.default.object,
434
+ beforeExport: _propTypes.default.object,
435
+ historyHeaders: _propTypes.default.object
408
436
  };
409
437
  var _default = exports.default = VtxExportAsync;
@@ -31,17 +31,17 @@ function VtxCard(props) {
31
31
  _props$expand = props.expand,
32
32
  expand = _props$expand === void 0 ? true : _props$expand,
33
33
  extra = props.extra,
34
- onExpandChange = props.onExpandChange;
34
+ onExpandChange = props.onExpandChange,
35
+ children = props.children;
35
36
  var _useState = (0, _react.useState)(expand),
36
37
  _useState2 = _slicedToArray(_useState, 2),
37
38
  visible = _useState2[0],
38
39
  setVisible = _useState2[1];
39
- var style = {};
40
- if (visible) {
41
- style = {
40
+ var iconStyle = (0, _react.useMemo)(function () {
41
+ return visible ? {
42
42
  transform: 'rotate(90deg)'
43
- };
44
- }
43
+ } : {};
44
+ }, [visible]);
45
45
  (0, _react.useEffect)(function () {
46
46
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
47
47
  onExpandChange && onExpandChange(visible);
@@ -59,8 +59,8 @@ function VtxCard(props) {
59
59
  },
60
60
  children: extra
61
61
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.RightOutlined, {
62
- className: "".concat(prefixCls, "-expand-icon\""),
63
- style: style,
62
+ className: "".concat(prefixCls, "-expand-icon"),
63
+ style: iconStyle,
64
64
  onClick: function onClick() {
65
65
  return setVisible(function (pre) {
66
66
  return !pre;
@@ -69,7 +69,7 @@ function VtxCard(props) {
69
69
  }),
70
70
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
71
71
  className: (0, _classnames2.default)("".concat(prefixCls, "-content"), _defineProperty({}, "".concat(prefixCls, "-content-hide"), !visible)),
72
- children: props.children
72
+ children: children
73
73
  })
74
74
  });
75
75
  }
@@ -22,7 +22,7 @@ function VtxDivider(props) {
22
22
  var prefixCls = getPrefixCls('', 'vtx-form-layout-divider');
23
23
  var size = props.size;
24
24
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Divider, {
25
- className: (0, _classnames2.default)(prefixCls, _defineProperty({}, "".concat(prefixCls, "--small'"), size === 'small'))
25
+ className: (0, _classnames2.default)(prefixCls, _defineProperty({}, "".concat(prefixCls, "--small"), size === 'small'))
26
26
  });
27
27
  }
28
28
  VtxDivider.propTypes = {