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