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

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 (212) hide show
  1. package/README.md +19 -19
  2. package/es/index.js +3 -0
  3. package/es/utils/components/LabelIconTip/index.js +7 -7
  4. package/es/utils/conversionMomentValue/index.js +25 -25
  5. package/es/utils/filterSpecialCharacters.js +53 -52
  6. package/es/utils/genCopyable/index.js +6 -6
  7. package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  8. package/es/utils/hooks/useDebounceFn/index.js +4 -4
  9. package/es/utils/hooks/useDebounceValue/index.js +6 -6
  10. package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
  11. package/es/utils/hooks/useLatest/index.js +2 -2
  12. package/es/utils/hooks/useRefCallback/index.js +5 -5
  13. package/es/utils/index.js +1 -2
  14. package/es/utils/isBrowser/index.js +7 -7
  15. package/es/utils/isUrl/index.js +4 -4
  16. package/es/utils/merge/index.js +4 -4
  17. package/es/utils/nanoid/index.js +4 -4
  18. package/es/utils/omitBoolean/index.js +4 -4
  19. package/es/utils/parseValueToMoment/index.js +4 -4
  20. package/es/utils/proFieldParsingText/index.js +10 -10
  21. package/es/utils/transformKeySubmitValue/index.js +57 -57
  22. package/es/utils/useEditableArray/index.js +46 -46
  23. package/es/utils/useEditableMap/index.js +22 -22
  24. package/es/utils/useMediaQuery/index.js +5 -5
  25. package/es/vtx-color-picker/index.js +138 -33
  26. package/es/vtx-color-picker/style/index.js +36 -12
  27. package/es/vtx-combogrid/Combogrid.js +16 -10
  28. package/es/vtx-combogrid/index.js +7 -4
  29. package/es/vtx-combogrid/style/index.js +4 -4
  30. package/es/vtx-datagrid/Store/Provide.js +109 -132
  31. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -9
  32. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  33. package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  34. package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  35. package/es/vtx-datagrid/ToolBar/index.js +2 -2
  36. package/es/vtx-datagrid/columnState.js +64 -0
  37. package/es/vtx-datagrid/index.js +114 -35
  38. package/es/vtx-datagrid/mergeComponents.js +15 -0
  39. package/es/vtx-datagrid/renderColumnButtons.js +30 -11
  40. package/es/vtx-datagrid/style/index.js +102 -20
  41. package/es/vtx-datagrid/style/index.less +242 -242
  42. package/es/vtx-date-picker/QdatePicker.js +1 -1
  43. package/es/vtx-date-picker/style/index.less +39 -39
  44. package/es/vtx-descriptions/Descriptions.js +29 -0
  45. package/es/vtx-descriptions/index.js +3 -0
  46. package/es/vtx-descriptions/style/index.js +19 -0
  47. package/es/vtx-ellipsis-text/index.js +7 -2
  48. package/es/vtx-ellipsis-text/style/index.js +3 -1
  49. package/es/vtx-export/index.js +33 -33
  50. package/es/vtx-export-async/History.js +11 -3
  51. package/es/vtx-export-async/index.js +45 -15
  52. package/es/vtx-form-layout/Card.js +10 -10
  53. package/es/vtx-form-layout/Divider.js +1 -1
  54. package/es/vtx-form-layout/FormItem.js +18 -17
  55. package/es/vtx-form-layout/Pane.js +23 -12
  56. package/es/vtx-icon/index.js +54 -45
  57. package/es/vtx-icon/index.js1 +90 -0
  58. package/es/vtx-image/Preview.js +11 -6
  59. package/es/vtx-image/style/index.js +0 -1
  60. package/es/vtx-import/index.js +155 -43
  61. package/es/vtx-import/result.js +6 -2
  62. package/es/vtx-import/style/index.js +16 -1
  63. package/es/vtx-import2/Content.js +2 -1
  64. package/es/vtx-import2/index.js +31 -20
  65. package/es/vtx-import2/style/index.js +60 -9
  66. package/es/vtx-input/TextArea/index.js +11 -6
  67. package/es/vtx-modal/index.js +11 -6
  68. package/es/vtx-modal/style/index.js +5 -3
  69. package/es/vtx-page-layout/Basic.js +2 -2
  70. package/es/vtx-page-layout/Content.js +1 -1
  71. package/es/vtx-page-layout/TabLayout.js +7 -13
  72. package/es/vtx-page-layout/TableLayout.js +24 -14
  73. package/es/vtx-page-layout/TableWrap.js +3 -2
  74. package/es/vtx-page-layout/TreeLayout.js +8 -14
  75. package/es/vtx-page-layout/container.js +8 -7
  76. package/es/vtx-page-layout/style/index.js +4 -2
  77. package/es/vtx-provider/index.js +50 -40
  78. package/es/vtx-provider/intl.js +9 -9
  79. package/es/vtx-provider/locale/en_US.js +65 -5
  80. package/es/vtx-provider/locale/zh_CN.js +75 -5
  81. package/es/vtx-provider/useStyle/index.js +25 -21
  82. package/es/vtx-scrollable-row/index.js +38 -28
  83. package/es/vtx-search/index.js +18 -13
  84. package/es/vtx-search/style/index.js +2 -1
  85. package/es/vtx-select/index.js +132 -46
  86. package/es/vtx-select/style/index.js +11 -56
  87. package/es/vtx-signature/index.js +5 -4
  88. package/es/vtx-signature/style/index.js +1 -1
  89. package/es/vtx-split-pane/Resizer.js +0 -1
  90. package/es/vtx-split-pane/SplitPane.js +34 -25
  91. package/es/vtx-split-pane/style/index.js +8 -112
  92. package/es/vtx-time-picker/index.js +27 -1
  93. package/es/vtx-transfer/Transfer.js +29 -0
  94. package/es/vtx-transfer/index.js +3 -0
  95. package/es/vtx-transfer/style/index.js +19 -0
  96. package/es/vtx-transfer-select/TransferSelect.js +143 -0
  97. package/es/vtx-transfer-select/index.js +3 -0
  98. package/es/vtx-transfer-select/style/index.js +19 -0
  99. package/es/vtx-tree/index.js +104 -40
  100. package/es/vtx-tree-select/index.js +75 -105
  101. package/es/vtx-tree-select/style/index.js +9 -3
  102. package/es/vtx-upload/FilePreview.js +2 -1
  103. package/es/vtx-wang-editor/index.js +291 -113
  104. package/es/vtx-wang-editor/style/index.less +12 -12
  105. package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
  106. package/lib/index.js +36 -0
  107. package/lib/utils/components/LabelIconTip/index.js +7 -7
  108. package/lib/utils/conversionMomentValue/index.js +25 -25
  109. package/lib/utils/filterSpecialCharacters.js +54 -52
  110. package/lib/utils/genCopyable/index.js +6 -6
  111. package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  112. package/lib/utils/hooks/useDebounceFn/index.js +4 -4
  113. package/lib/utils/hooks/useDebounceValue/index.js +6 -6
  114. package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
  115. package/lib/utils/hooks/useLatest/index.js +2 -2
  116. package/lib/utils/hooks/useRefCallback/index.js +5 -5
  117. package/lib/utils/index.js +0 -7
  118. package/lib/utils/isBrowser/index.js +7 -7
  119. package/lib/utils/isUrl/index.js +4 -4
  120. package/lib/utils/merge/index.js +4 -4
  121. package/lib/utils/nanoid/index.js +4 -4
  122. package/lib/utils/omitBoolean/index.js +4 -4
  123. package/lib/utils/parseValueToMoment/index.js +4 -4
  124. package/lib/utils/proFieldParsingText/index.js +10 -10
  125. package/lib/utils/transformKeySubmitValue/index.js +57 -57
  126. package/lib/utils/useEditableArray/index.js +46 -46
  127. package/lib/utils/useEditableMap/index.js +22 -22
  128. package/lib/utils/useMediaQuery/index.js +5 -5
  129. package/lib/vtx-color-picker/index.js +139 -34
  130. package/lib/vtx-color-picker/style/index.js +36 -12
  131. package/lib/vtx-combogrid/Combogrid.js +16 -10
  132. package/lib/vtx-combogrid/index.js +7 -4
  133. package/lib/vtx-combogrid/style/index.js +4 -4
  134. package/lib/vtx-datagrid/Store/Provide.js +116 -138
  135. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -10
  136. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  137. package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  138. package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  139. package/lib/vtx-datagrid/ToolBar/index.js +2 -2
  140. package/lib/vtx-datagrid/columnState.js +73 -0
  141. package/lib/vtx-datagrid/index.js +115 -35
  142. package/lib/vtx-datagrid/mergeComponents.js +21 -0
  143. package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
  144. package/lib/vtx-datagrid/style/index.js +102 -20
  145. package/lib/vtx-datagrid/style/index.less +242 -242
  146. package/lib/vtx-date-picker/QdatePicker.js +1 -1
  147. package/lib/vtx-date-picker/style/index.less +39 -39
  148. package/lib/vtx-descriptions/Descriptions.js +38 -0
  149. package/lib/vtx-descriptions/index.js +15 -0
  150. package/lib/vtx-descriptions/style/index.js +25 -0
  151. package/lib/vtx-ellipsis-text/index.js +7 -2
  152. package/lib/vtx-ellipsis-text/style/index.js +3 -1
  153. package/lib/vtx-export/index.js +34 -34
  154. package/lib/vtx-export-async/History.js +11 -3
  155. package/lib/vtx-export-async/index.js +43 -13
  156. package/lib/vtx-form-layout/Card.js +9 -9
  157. package/lib/vtx-form-layout/Divider.js +1 -1
  158. package/lib/vtx-form-layout/FormItem.js +18 -17
  159. package/lib/vtx-form-layout/Pane.js +22 -11
  160. package/lib/vtx-icon/index.js +54 -52
  161. package/lib/vtx-icon/index.js1 +90 -0
  162. package/lib/vtx-image/Preview.js +11 -6
  163. package/lib/vtx-image/style/index.js +0 -1
  164. package/lib/vtx-import/index.js +154 -42
  165. package/lib/vtx-import/result.js +6 -2
  166. package/lib/vtx-import/style/index.js +16 -1
  167. package/lib/vtx-import2/Content.js +2 -1
  168. package/lib/vtx-import2/index.js +30 -19
  169. package/lib/vtx-import2/style/index.js +60 -9
  170. package/lib/vtx-input/TextArea/index.js +11 -6
  171. package/lib/vtx-modal/index.js +11 -6
  172. package/lib/vtx-modal/style/index.js +5 -3
  173. package/lib/vtx-page-layout/Basic.js +2 -2
  174. package/lib/vtx-page-layout/Content.js +1 -1
  175. package/lib/vtx-page-layout/TabLayout.js +8 -14
  176. package/lib/vtx-page-layout/TableLayout.js +24 -14
  177. package/lib/vtx-page-layout/TableWrap.js +3 -2
  178. package/lib/vtx-page-layout/TreeLayout.js +9 -15
  179. package/lib/vtx-page-layout/container.js +8 -7
  180. package/lib/vtx-page-layout/style/index.js +4 -2
  181. package/lib/vtx-provider/index.js +49 -40
  182. package/lib/vtx-provider/intl.js +9 -9
  183. package/lib/vtx-provider/locale/en_US.js +65 -5
  184. package/lib/vtx-provider/locale/zh_CN.js +75 -5
  185. package/lib/vtx-provider/useStyle/index.js +25 -21
  186. package/lib/vtx-scrollable-row/index.js +38 -28
  187. package/lib/vtx-search/index.js +18 -13
  188. package/lib/vtx-search/style/index.js +2 -1
  189. package/lib/vtx-select/index.js +134 -48
  190. package/lib/vtx-select/style/index.js +11 -56
  191. package/lib/vtx-signature/index.js +4 -3
  192. package/lib/vtx-signature/style/index.js +1 -1
  193. package/lib/vtx-split-pane/Resizer.js +0 -1
  194. package/lib/vtx-split-pane/SplitPane.js +32 -23
  195. package/lib/vtx-split-pane/style/index.js +8 -112
  196. package/lib/vtx-time-picker/index.js +27 -1
  197. package/lib/vtx-transfer/Transfer.js +38 -0
  198. package/lib/vtx-transfer/index.js +15 -0
  199. package/lib/vtx-transfer/style/index.js +25 -0
  200. package/lib/vtx-transfer-select/TransferSelect.js +151 -0
  201. package/lib/vtx-transfer-select/index.js +15 -0
  202. package/lib/vtx-transfer-select/style/index.js +25 -0
  203. package/lib/vtx-tree/index.js +102 -38
  204. package/lib/vtx-tree-select/index.js +75 -105
  205. package/lib/vtx-tree-select/style/index.js +9 -3
  206. package/lib/vtx-upload/FilePreview.js +2 -1
  207. package/lib/vtx-wang-editor/index.js +289 -113
  208. package/lib/vtx-wang-editor/style/index.less +12 -12
  209. package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
  210. package/package.json +238 -222
  211. package/es/utils/hooks/useFetchData/index.js +0 -82
  212. package/lib/utils/hooks/useFetchData/index.js +0 -89
@@ -68,6 +68,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
68
68
  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; }
69
69
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
70
70
  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); }
71
+ // 调接口前剔除无效字段,节省流量
71
72
  var omitUndefined = function omitUndefined(obj) {
72
73
  var newObj = {};
73
74
  Object.keys(obj || {}).forEach(function (key) {
@@ -81,11 +82,11 @@ var omitUndefined = function omitUndefined(obj) {
81
82
  return newObj;
82
83
  };
83
84
 
84
- /**
85
- * 用于判断当前是否需要开启哈希(Hash)模式。
86
- * 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
87
- * 如果是,则返回 false。否则,直接返回 true 表示需要打开。
88
- * @returns
85
+ /**
86
+ * 用于判断当前是否需要开启哈希(Hash)模式。
87
+ * 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
88
+ * 如果是,则返回 false。否则,直接返回 true 表示需要打开。
89
+ * @returns
89
90
  */
90
91
  var isNeedOpenHash = exports.isNeedOpenHash = function isNeedOpenHash() {
91
92
  var _process$env$NODE_ENV, _process$env$NODE_ENV2;
@@ -104,7 +105,7 @@ var VtxConfigContext = exports.VtxConfigContext = /*#__PURE__*/_react.default.cr
104
105
  hashed: true,
105
106
  dark: false,
106
107
  token: _objectSpread(_objectSpread({}, _antd.theme.getDesignToken()), {}, {
107
- proComponentsCls: '.ant-pro',
108
+ vtxComponentsCls: '.vtx',
108
109
  antCls: '.ant',
109
110
  themeId: 0
110
111
  }),
@@ -120,10 +121,10 @@ var VtxConfigContext = exports.VtxConfigContext = /*#__PURE__*/_react.default.cr
120
121
  });
121
122
  var ConfigConsumer = exports.ConfigConsumer = VtxConfigContext.Consumer;
122
123
 
123
- /**
124
- * 组件解除挂载后清空一下 cache
125
- * @date 2022-11-28
126
- * @returns null
124
+ /**
125
+ * 组件解除挂载后清空一下 cache
126
+ * @date 2022-11-28
127
+ * @returns null
127
128
  */
128
129
  var CacheClean = function CacheClean() {
129
130
  var _useSWRConfig = (0, _swr.useSWRConfig)(),
@@ -136,10 +137,10 @@ var CacheClean = function CacheClean() {
136
137
  return null;
137
138
  };
138
139
 
139
- /**
140
- * 用于配置 Pro 的组件,分装之后会简单一些
141
- * @param props
142
- * @returns
140
+ /**
141
+ * 用于配置 Pro 的组件,分装之后会简单一些
142
+ * @param props
143
+ * @returns
143
144
  */
144
145
  var ConfigProviderContainer = function ConfigProviderContainer(props) {
145
146
  var _antdTheme$useToken;
@@ -158,17 +159,17 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
158
159
  var tokenContext = (_antdTheme$useToken = _antd.theme.useToken) === null || _antdTheme$useToken === void 0 ? void 0 : _antdTheme$useToken.call(_antd.theme);
159
160
  var proProvide = (0, _react.useContext)(VtxConfigContext);
160
161
 
161
- /**
162
- * pro 的 类
163
- * @type {string}
164
- * @example .ant-pro
162
+ /**
163
+ * pro 的 类
164
+ * @type {string}
165
+ * @example .ant-pro
165
166
  */
166
167
 
167
- var proComponentsCls = prefixCls ? ".".concat(prefixCls) : ".".concat(getPrefixCls(), "-pro");
168
+ var vtxComponentsCls = prefixCls ? ".".concat(prefixCls) : ".vtx";
168
169
  var antCls = '.' + getPrefixCls();
169
- var salt = "".concat(proComponentsCls);
170
- /**
171
- * 合并一下token,不然导致嵌套 token 失效
170
+ var salt = "".concat(vtxComponentsCls);
171
+ /**
172
+ * 合并一下token,不然导致嵌套 token 失效
172
173
  */
173
174
  var proLayoutTokenMerge = (0, _react.useMemo)(function () {
174
175
  return (0, _layoutToken.getLayoutDesignToken)(propsToken || {}, tokenContext.token);
@@ -177,21 +178,22 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
177
178
  var _proProvide$intl;
178
179
  var localeName = locale === null || locale === void 0 ? void 0 : locale.locale;
179
180
  var key = (0, _intl.findIntlKeyByAntdLocaleKey)(localeName);
181
+
180
182
  // antd 的 key 存在的时候以 antd 的为主
181
183
  var resolvedIntl = intl !== null && intl !== void 0 ? intl : localeName && ((_proProvide$intl = proProvide.intl) === null || _proProvide$intl === void 0 ? void 0 : _proProvide$intl.locale) === 'default' ? _intl.intlMap[key] : proProvide.intl || _intl.intlMap[key];
182
184
  return _objectSpread(_objectSpread({}, proProvide), {}, {
183
185
  dark: dark !== null && dark !== void 0 ? dark : proProvide.dark,
184
186
  token: (0, _merge.merge)(proProvide.token, tokenContext.token, {
185
- proComponentsCls: proComponentsCls,
187
+ vtxComponentsCls: vtxComponentsCls,
186
188
  antCls: antCls,
187
189
  themeId: tokenContext.theme.id,
188
190
  layout: proLayoutTokenMerge
189
191
  }),
190
192
  intl: resolvedIntl || _intl.zhCNIntl
191
193
  });
192
- }, [locale === null || locale === void 0 ? void 0 : locale.locale, proProvide, dark, tokenContext.token, tokenContext.theme.id, proComponentsCls, antCls, proLayoutTokenMerge, intl]);
194
+ }, [locale === null || locale === void 0 ? void 0 : locale.locale, proProvide, dark, tokenContext.token, tokenContext.theme.id, antCls, proLayoutTokenMerge, intl]);
193
195
  var finalToken = _objectSpread(_objectSpread({}, proProvideValue.token || {}), {}, {
194
- proComponentsCls: proComponentsCls
196
+ vtxComponentsCls: vtxComponentsCls
195
197
  });
196
198
  var _useCacheToken = (0, _cssinjs.useCacheToken)(tokenContext.theme, [tokenContext.token, finalToken !== null && finalToken !== void 0 ? finalToken : {}], {
197
199
  salt: salt,
@@ -264,13 +266,13 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
264
266
  });
265
267
  };
266
268
 
267
- /**
268
- * 用于配置 一些全局性的东西
269
- * @param props
270
- * @returns
269
+ /**
270
+ * 用于配置 一些全局性的东西
271
+ * @param props
272
+ * @returns
271
273
  */
272
274
  var VtxConfigProvider = exports.VtxConfigProvider = function VtxConfigProvider(props) {
273
- var _theme$components;
275
+ var _theme$components, _theme$components2;
274
276
  var propsTheme = props.theme,
275
277
  propsLocale = props.locale,
276
278
  needDeps = props.needDeps,
@@ -297,18 +299,25 @@ var VtxConfigProvider = exports.VtxConfigProvider = function VtxConfigProvider(p
297
299
  borderRadius: 8,
298
300
  borderRadiusLG: 12,
299
301
  borderRadiusSM: 4
300
- }, dark ? {} : _defineProperty(_defineProperty(_defineProperty(_defineProperty({
302
+ }, dark ? {
303
+ colorBgLayoutTable: '#111'
304
+ } : _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
301
305
  colorPrimary: '#3A6DFF',
306
+ colorLink: '#3A6DFF',
302
307
  colorText: '#29343D',
303
308
  colorTextSecondary: '#78829D',
304
309
  colorBorder: '#DCDFE6',
305
310
  colorTextPlaceholder: '#BFC3CB',
306
311
  colorFillAlter: '#F5F7FA'
307
- }, "colorFillAlter", '#F5F7FA'), "colorTextPlaceholder", '#BFC3CB'), "colorFillAlterSolid", '#F5F7FA'), "colorBgLayout", '#FAFAFA')), theme.token);
312
+ }, "colorFillAlter", '#F5F7FA'), "colorTextPlaceholder", '#BFC3CB'), "colorFillAlterSolid", '#F5F7FA'), "colorBgLayout", '#F0F2F5'), "colorBgLayoutTable", '#FAFAFA')), theme.token);
308
313
  theme.components = _objectSpread(_objectSpread({}, theme.components), {}, {
309
314
  Table: _objectSpread({
310
315
  headerBorderRadius: 0
311
- }, (_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Table)
316
+ }, (_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Table),
317
+ Modal: _objectSpread({
318
+ contentPadding: 0,
319
+ bodyPadding: 0
320
+ }, (_theme$components2 = theme.components) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.Modal)
312
321
  });
313
322
 
314
323
  // 自动注入 antd 的配置
@@ -325,13 +334,13 @@ var VtxConfigProvider = exports.VtxConfigProvider = function VtxConfigProvider(p
325
334
  }));
326
335
  };
327
336
 
328
- /**
329
- * It returns the intl object from the context if it exists, otherwise it returns the intl object for
330
- * 获取国际化的方法
331
- * @param locale
332
- * @param localeMap
333
- * the current locale
334
- * @returns The return value of the function is the intl object.
337
+ /**
338
+ * It returns the intl object from the context if it exists, otherwise it returns the intl object for
339
+ * 获取国际化的方法
340
+ * @param locale
341
+ * @param localeMap
342
+ * the current locale
343
+ * @returns The return value of the function is the intl object.
335
344
  */
336
345
  function useIntl() {
337
346
  var _useContext3 = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
@@ -39,11 +39,11 @@ var _zh_CN = _interopRequireDefault(require("./locale/zh_CN"));
39
39
  var _zh_HK = _interopRequireDefault(require("./locale/zh_HK"));
40
40
  var _zh_TW = _interopRequireDefault(require("./locale/zh_TW"));
41
41
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
- /**
43
- * 创建一个国际化的操作函数
44
- *
45
- * @param locale
46
- * @param localeMap
42
+ /**
43
+ * 创建一个国际化的操作函数
44
+ *
45
+ * @param locale
46
+ * @param localeMap
47
47
  */
48
48
  var createIntl = exports.createIntl = function createIntl(locale, localeMap) {
49
49
  return {
@@ -131,10 +131,10 @@ var intlMap = exports.intlMap = {
131
131
  };
132
132
  var intlMapKeys = exports.intlMapKeys = Object.keys(intlMap);
133
133
 
134
- /**
135
- * 根据 antd 的 key 来找到的 locale 插件的 key
136
- *
137
- * @param localeKey
134
+ /**
135
+ * 根据 antd 的 key 来找到的 locale 插件的 key
136
+ *
137
+ * @param localeKey
138
138
  */
139
139
  var findIntlKeyByAntdLocaleKey = exports.findIntlKeyByAntdLocaleKey = function findIntlKeyByAntdLocaleKey(localeKey) {
140
140
  var localeName = (localeKey || 'zh-CN').toLocaleLowerCase();
@@ -48,6 +48,7 @@ var _default = exports.default = {
48
48
  noFixedTitle: 'Not Fixed',
49
49
  reset: 'Reset',
50
50
  columnDisplay: 'Column Display',
51
+ columnAll: 'All',
51
52
  columnSetting: 'Table Settings',
52
53
  fullScreen: 'Full Screen',
53
54
  exitFullScreen: 'Exit Full Screen',
@@ -56,7 +57,12 @@ var _default = exports.default = {
56
57
  densityDefault: 'Default',
57
58
  densityLarger: 'Larger',
58
59
  densityMiddle: 'Middle',
59
- densitySmall: 'Compact'
60
+ densitySmall: 'Compact',
61
+ messageWarningOneText: 'Please select at least one column to save',
62
+ messageSuccessText: 'Operation successful',
63
+ striped: 'Striped',
64
+ border: 'Border',
65
+ headerBackground: 'Header Background'
60
66
  },
61
67
  stepsForm: {
62
68
  next: 'Next',
@@ -125,6 +131,8 @@ var _default = exports.default = {
125
131
  operation: 'Import',
126
132
  error: 'Upload failed',
127
133
  success: 'Upload successful',
134
+ selectFile: 'Click to select file',
135
+ noFileSelected: "No file selected",
128
136
  downloadTemplate: 'Download template',
129
137
  pleaseSelectFile: 'Please select the file to upload',
130
138
  upload: 'Upload',
@@ -148,7 +156,9 @@ var _default = exports.default = {
148
156
  delete: 'Delete',
149
157
  add: 'Add',
150
158
  import: 'Import',
151
- export: 'Export'
159
+ export: 'Export',
160
+ queryResults: 'Query results',
161
+ deleteConfirm: 'Are you sure you want to delete'
152
162
  },
153
163
  select: {
154
164
  selectAll: 'Select All',
@@ -180,8 +190,58 @@ var _default = exports.default = {
180
190
  download: 'Download'
181
191
  },
182
192
  wangEditor: {
183
- imageInsertionFailed: 'Image Insertion Failed',
184
- videoInsertionFailed: 'Video Insertion Failed',
185
- attachmentInsertionFailed: 'Attachment Insertion Failed'
193
+ messageOverSizeText: 'Exceeds file size limit, maximum file size is',
194
+ messageUploadFailText: 'Upload error',
195
+ messageInsertImgFailText: 'Image Insertion Failed',
196
+ messageInsertVideoFailText: 'Video Insertion Failed',
197
+ messageInsertAttachmentFailText: 'Attachment Insertion Failed'
198
+ },
199
+ envPuzzle: {
200
+ common: {
201
+ startTime: 'Start time',
202
+ endTime: 'End time',
203
+ confirm: 'OK',
204
+ prompt: 'Prompt'
205
+ },
206
+ createModal: {
207
+ clear: 'Clear',
208
+ required: '{label} is required',
209
+ whitespace: '{label} cannot contain only whitespace'
210
+ },
211
+ template: {
212
+ selectedPrefix: 'Selected',
213
+ selectedSuffix: 'items',
214
+ clearSelected: 'Clear',
215
+ deleteItemConfirm: 'Delete this item?',
216
+ deleteRowConfirm: 'Confirm delete?',
217
+ deleteSelectedConfirm: 'Delete the selected {count} records?',
218
+ exportSelectedRows: 'Export selected rows',
219
+ exportCurrentPage: 'Export current page',
220
+ exportAll: 'Export all',
221
+ exportAllFields: 'Export all fields',
222
+ exportingFile: 'Exporting file...',
223
+ paginationTotal: 'Total {total} records'
224
+ },
225
+ import: {
226
+ rowNumber: 'Row',
227
+ errorMessage: 'Error message',
228
+ pleaseUploadFile: 'Please upload a file',
229
+ uploadFile: 'Upload file'
230
+ },
231
+ map: {
232
+ goToMap: 'Open map',
233
+ locate: 'Locate',
234
+ calibrate: 'Calibrate',
235
+ redraw: 'Redraw',
236
+ keywordPlaceholder: 'Enter keywords',
237
+ invalidLayerOptions: 'data and options cannot be empty, and map is required'
238
+ },
239
+ upload: {
240
+ downloading: 'Downloading...',
241
+ pictureUnit: 'files'
242
+ },
243
+ request: {
244
+ operationFailed: 'Operation failed'
245
+ }
186
246
  }
187
247
  };
@@ -59,7 +59,10 @@ var _default = exports.default = {
59
59
  densityMiddle: '中等',
60
60
  densitySmall: '紧凑',
61
61
  messageWarningOneText: '至少勾选一列保存',
62
- messageSuccessText: '操作成功'
62
+ messageSuccessText: '操作成功',
63
+ striped: '斑马纹',
64
+ border: '边框',
65
+ headerBackground: '表头背景'
63
66
  },
64
67
  stepsForm: {
65
68
  next: '下一步',
@@ -127,6 +130,8 @@ var _default = exports.default = {
127
130
  operation: '导入',
128
131
  error: '上传失败',
129
132
  success: '上传成功',
133
+ selectFile: '选择文件',
134
+ noFileSelected: "未选择任何文件",
130
135
  downloadTemplate: '下载模板',
131
136
  pleaseSelectFile: '请选择需要上传的文件',
132
137
  upload: '上传',
@@ -150,7 +155,9 @@ var _default = exports.default = {
150
155
  delete: '删除',
151
156
  add: '新增',
152
157
  import: '导入',
153
- export: '导出'
158
+ export: '导出',
159
+ queryResults: '查询结果',
160
+ deleteConfirm: '是否确认删除'
154
161
  },
155
162
  select: {
156
163
  selectAll: '全选',
@@ -182,8 +189,71 @@ var _default = exports.default = {
182
189
  download: '下载'
183
190
  },
184
191
  wangEditor: {
185
- imageInsertionFailed: '插入图片失败',
186
- videoInsertionFailed: '插入视频失败',
187
- attachmentInsertionFailed: '插入附件失败'
192
+ messageOverSizeText: '超过文件大小限制,最大文件大小为',
193
+ messageUploadFailText: '上传出错',
194
+ messageInsertImgFailText: '插入图片失败',
195
+ messageInsertVideoFailText: '插入视频失败',
196
+ messageInsertAttachmentFailText: '插入附件失败'
197
+ },
198
+ colorPicker: {
199
+ primary: '主要',
200
+ // 主色调
201
+ danger: '红色',
202
+ // 危险/错误
203
+ success: '绿色',
204
+ // 成功
205
+ info: '青色',
206
+ // 信息/提示
207
+ basic: '基础颜色',
208
+ // 基础色板
209
+ chart: '图表颜色' // 图表专用色
210
+ },
211
+ envPuzzle: {
212
+ common: {
213
+ startTime: '开始时间',
214
+ endTime: '结束时间',
215
+ confirm: '确定',
216
+ prompt: '提示'
217
+ },
218
+ createModal: {
219
+ clear: '清空',
220
+ required: '{label}不能为空',
221
+ whitespace: '{label}不能只包含空白字符'
222
+ },
223
+ template: {
224
+ selectedPrefix: '已选择',
225
+ selectedSuffix: '项',
226
+ clearSelected: '清空',
227
+ deleteItemConfirm: '确定删除该项吗?',
228
+ deleteRowConfirm: '是否确认删除',
229
+ deleteSelectedConfirm: '确定删除选中的{count}条数据吗?',
230
+ exportSelectedRows: '导出选中行',
231
+ exportCurrentPage: '导出当前页',
232
+ exportAll: '导出全部',
233
+ exportAllFields: '导出全量字段',
234
+ exportingFile: '导出文件中...',
235
+ paginationTotal: '总共{total}条记录'
236
+ },
237
+ import: {
238
+ rowNumber: '行数',
239
+ errorMessage: '错误信息',
240
+ pleaseUploadFile: '请上传文件',
241
+ uploadFile: '上传文件'
242
+ },
243
+ map: {
244
+ goToMap: '去地图',
245
+ locate: '定位',
246
+ calibrate: '校正',
247
+ redraw: '重新绘制',
248
+ keywordPlaceholder: '请输入关键字',
249
+ invalidLayerOptions: 'data,options 不能为空或者是map对象没有'
250
+ },
251
+ upload: {
252
+ downloading: '下载中...',
253
+ pictureUnit: '张'
254
+ },
255
+ request: {
256
+ operationFailed: '操作失败'
257
+ }
188
258
  }
189
259
  };
@@ -10,30 +10,29 @@ var _tinycolor = require("@ctrl/tinycolor");
10
10
  var _antd = require("antd");
11
11
  var _react = require("react");
12
12
  var _index = require("../index");
13
- var _merge = require("../utils/merge");
14
13
  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); }
15
14
  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; }
16
15
  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; }
17
16
  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; }
18
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
19
18
  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); }
20
- /**
21
- * 把一个颜色设置一下透明度
22
- * @example (#fff, 0.5) => rgba(255, 255, 255, 0.5)
23
- * @param baseColor {string}
24
- * @param alpha {0-1}
25
- * @returns rgba {string}
19
+ /**
20
+ * 把一个颜色设置一下透明度
21
+ * @example (#fff, 0.5) => rgba(255, 255, 255, 0.5)
22
+ * @param baseColor {string}
23
+ * @param alpha {0-1}
24
+ * @returns rgba {string}
26
25
  */
27
26
  var setAlpha = exports.setAlpha = function setAlpha(baseColor, alpha) {
28
27
  return new _tinycolor.TinyColor(baseColor).setAlpha(alpha).toRgbString();
29
28
  };
30
29
 
31
- /**
32
- * 把一个颜色修改一些明度
33
- * @example (#000, 50) => #808080
34
- * @param baseColor {string}
35
- * @param brightness {0-100}
36
- * @returns hexColor {string}
30
+ /**
31
+ * 把一个颜色修改一些明度
32
+ * @example (#000, 50) => #808080
33
+ * @param baseColor {string}
34
+ * @param brightness {0-100}
35
+ * @returns hexColor {string}
37
36
  */
38
37
  var lighten = exports.lighten = function lighten(baseColor, brightness) {
39
38
  var instance = new _tinycolor.TinyColor(baseColor);
@@ -68,14 +67,14 @@ var operationUnit = exports.operationUnit = function operationUnit(token) {
68
67
  };
69
68
  };
70
69
 
71
- /**
72
- * 封装了一下 antd 的 useStyle
73
- * @param componentName {string} 组件的名字
74
- * @param styleFn {GenerateStyle} 生成样式的函数
75
- * @returns UseStyleResult
70
+ /**
71
+ * 封装了一下 antd 的 useStyle
72
+ * @param componentName {string} 组件的名字
73
+ * @param styleFn {GenerateStyle} 生成样式的函数
74
+ * @returns UseStyleResult
76
75
  */
77
76
  function useStyle(componentName, styleFn) {
78
- var _token$proComponentsC;
77
+ var _token$vtxComponentsC;
79
78
  // eslint-disable-next-line prefer-const
80
79
  var _useContext = (0, _react.useContext)(_index.VtxProvider),
81
80
  _useContext$token = _useContext.token,
@@ -93,8 +92,13 @@ function useStyle(componentName, styleFn) {
93
92
  if (!token.layout) {
94
93
  token = _objectSpread({}, antdToken);
95
94
  }
96
- token.proComponentsCls = (_token$proComponentsC = token.proComponentsCls) !== null && _token$proComponentsC !== void 0 ? _token$proComponentsC : ".".concat(getPrefixCls('pro'));
95
+ token.vtxComponentsCls = (_token$vtxComponentsC = token.vtxComponentsCls) !== null && _token$vtxComponentsC !== void 0 ? _token$vtxComponentsC : ".vtx";
97
96
  token.antCls = ".".concat(getPrefixCls());
97
+ // wrapSSR 样式注入器 支持 SSR
98
+ // useStyleRegister 生成注入器的工厂
99
+ // nonce CSP 通行证 把生成的 <style> 标签加上 nonce="xxx",防止内联样式被 CSP 拦截
100
+ // path 缓存键 相同 path 就复用已编译的 CSS,避免重复生成样式
101
+ // layer @layer 名称:把全部规则包进 @layer vtx- { ... },方便后续层叠控制与覆盖
98
102
  return {
99
103
  wrapSSR: (0, _cssinjs.useStyleRegister)({
100
104
  theme: theme,
@@ -102,7 +106,7 @@ function useStyle(componentName, styleFn) {
102
106
  path: [componentName],
103
107
  nonce: csp === null || csp === void 0 ? void 0 : csp.nonce,
104
108
  layer: {
105
- name: 'vtx-'
109
+ name: 'vtx'
106
110
  }
107
111
  }, function () {
108
112
  return styleFn(token);
@@ -63,44 +63,54 @@ function VtxScrollableRow(props) {
63
63
  setNextPrev();
64
64
  }, 200);
65
65
  window.addEventListener('resize', debouncedResize);
66
- setNextPrev();
66
+ // 使用 requestAnimationFrame 确保 DOM 已渲染
67
+ requestAnimationFrame(function () {
68
+ setNextPrev();
69
+ });
67
70
  return function () {
71
+ debouncedResize.cancel();
68
72
  window.removeEventListener('resize', debouncedResize);
69
73
  };
70
- }, [navRef === null || navRef === void 0 ? void 0 : navRef.current, containerRef.current, navWrapRef.current]);
74
+ }, []);
71
75
  function setNextPrev() {
72
76
  if (navRef !== null && navRef !== void 0 && navRef.current && containerRef.current && navWrapRef.current) {
73
77
  var navNodeW = navRef.current.scrollWidth;
74
78
  var containerW = containerRef.current.offsetWidth;
75
79
  var navWrapNodeW = navWrapRef.current.offsetWidth;
76
80
  var minOffset = containerW - navNodeW;
77
- var _next = state.next,
78
- _prev = state.prev;
79
- if (minOffset >= 0) {
80
- _next = false;
81
- setOffset(0, false);
82
- offset.current = 0;
83
- } else if (minOffset < offset.current) {
84
- _next = true;
85
- } else {
86
- _next = false;
87
- var realOffset = navWrapNodeW - navNodeW;
88
- setOffset(realOffset, false);
89
- offset.current = realOffset;
90
- }
91
- if (offset.current < 0) {
92
- _prev = true;
93
- } else {
94
- _prev = false;
95
- }
96
- setState({
97
- next: _next,
98
- prev: _prev
81
+
82
+ // ✅ 使用函数式更新确保状态一致性
83
+ setState(function (prevState) {
84
+ var next = prevState.next,
85
+ prev = prevState.prev;
86
+ var newOffset = offset.current;
87
+ if (minOffset >= 0) {
88
+ next = false;
89
+ setOffset(0, false);
90
+ newOffset = 0;
91
+ } else if (minOffset < newOffset) {
92
+ next = true;
93
+ } else {
94
+ next = false;
95
+ var realOffset = navWrapNodeW - navNodeW;
96
+ setOffset(realOffset, false);
97
+ newOffset = realOffset;
98
+ }
99
+ if (newOffset < 0) {
100
+ prev = true;
101
+ } else {
102
+ prev = false;
103
+ }
104
+
105
+ // 同步更新 ref 值
106
+ offset.current = newOffset;
107
+
108
+ // 返回新的状态对象
109
+ return {
110
+ next: next,
111
+ prev: prev
112
+ };
99
113
  });
100
- return {
101
- next: _next,
102
- prev: _prev
103
- };
104
114
  }
105
115
  }
106
116
  var setOffset = function setOffset(os) {