@vtx/components 4.0.0-beta.9 → 4.0.0-beta.91
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.
- package/README.md +19 -19
- package/es/index.js +3 -0
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +6 -6
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -140
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -6
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/index.js +2 -1
- package/es/vtx-datagrid/ToolBar/style.js +6 -3
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +134 -37
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +108 -18
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +2 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -38
- package/es/vtx-export-async/History.js +15 -7
- package/es/vtx-export-async/index.js +18 -8
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/style/index.js +6 -4
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +143 -42
- package/es/vtx-import/result.js +28 -26
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +29 -19
- package/es/vtx-import2/style/index.js +59 -8
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-modal/style/index.js +5 -2
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +33 -31
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_GB.js +1 -1
- package/es/vtx-provider/locale/en_US.js +58 -4
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-search/index.js +30 -12
- package/es/vtx-search/style/index.js +6 -3
- package/es/vtx-select/index.js +123 -40
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +42 -34
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-statistics-column/style/index.js +1 -1
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +27 -9
- package/es/vtx-tree-select/index.js +81 -110
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +41 -32
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/lib/index.js +36 -0
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +6 -6
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/index.js +0 -7
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +112 -142
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -6
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/index.js +2 -1
- package/lib/vtx-datagrid/ToolBar/style.js +6 -3
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +134 -37
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +108 -18
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +2 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -39
- package/lib/vtx-export-async/History.js +14 -8
- package/lib/vtx-export-async/index.js +18 -8
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/style/index.js +6 -4
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +141 -43
- package/lib/vtx-import/result.js +29 -27
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +29 -19
- package/lib/vtx-import2/style/index.js +59 -8
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-modal/style/index.js +5 -2
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +33 -31
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_GB.js +1 -1
- package/lib/vtx-provider/locale/en_US.js +58 -4
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-search/index.js +32 -12
- package/lib/vtx-search/style/index.js +6 -3
- package/lib/vtx-select/index.js +125 -42
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +40 -31
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-statistics-column/style/index.js +1 -1
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +27 -9
- package/lib/vtx-tree-select/index.js +81 -112
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +39 -30
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/package.json +239 -238
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
package/es/vtx-provider/index.js
CHANGED
|
@@ -46,11 +46,11 @@ var omitUndefined = function omitUndefined(obj) {
|
|
|
46
46
|
return newObj;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* 用于判断当前是否需要开启哈希(Hash)模式。
|
|
51
|
-
* 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
|
|
52
|
-
* 如果是,则返回 false。否则,直接返回 true 表示需要打开。
|
|
53
|
-
* @returns
|
|
49
|
+
/**
|
|
50
|
+
* 用于判断当前是否需要开启哈希(Hash)模式。
|
|
51
|
+
* 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
|
|
52
|
+
* 如果是,则返回 false。否则,直接返回 true 表示需要打开。
|
|
53
|
+
* @returns
|
|
54
54
|
*/
|
|
55
55
|
export var isNeedOpenHash = function isNeedOpenHash() {
|
|
56
56
|
var _process$env$NODE_ENV, _process$env$NODE_ENV2;
|
|
@@ -85,10 +85,10 @@ export var VtxConfigContext = /*#__PURE__*/React.createContext({
|
|
|
85
85
|
});
|
|
86
86
|
var ConfigConsumer = VtxConfigContext.Consumer;
|
|
87
87
|
|
|
88
|
-
/**
|
|
89
|
-
* 组件解除挂载后清空一下 cache
|
|
90
|
-
* @date 2022-11-28
|
|
91
|
-
* @returns null
|
|
88
|
+
/**
|
|
89
|
+
* 组件解除挂载后清空一下 cache
|
|
90
|
+
* @date 2022-11-28
|
|
91
|
+
* @returns null
|
|
92
92
|
*/
|
|
93
93
|
export { ConfigConsumer };
|
|
94
94
|
var CacheClean = function CacheClean() {
|
|
@@ -102,10 +102,10 @@ var CacheClean = function CacheClean() {
|
|
|
102
102
|
return null;
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
/**
|
|
106
|
-
* 用于配置 Pro 的组件,分装之后会简单一些
|
|
107
|
-
* @param props
|
|
108
|
-
* @returns
|
|
105
|
+
/**
|
|
106
|
+
* 用于配置 Pro 的组件,分装之后会简单一些
|
|
107
|
+
* @param props
|
|
108
|
+
* @returns
|
|
109
109
|
*/
|
|
110
110
|
var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
111
111
|
var _antdTheme$useToken;
|
|
@@ -124,17 +124,17 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
124
124
|
var tokenContext = (_antdTheme$useToken = antdTheme.useToken) === null || _antdTheme$useToken === void 0 ? void 0 : _antdTheme$useToken.call(antdTheme);
|
|
125
125
|
var proProvide = useContext(VtxConfigContext);
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* pro 的 类
|
|
129
|
-
* @type {string}
|
|
130
|
-
* @example .ant-pro
|
|
127
|
+
/**
|
|
128
|
+
* pro 的 类
|
|
129
|
+
* @type {string}
|
|
130
|
+
* @example .ant-pro
|
|
131
131
|
*/
|
|
132
132
|
|
|
133
133
|
var vtxComponentsCls = prefixCls ? ".".concat(prefixCls) : ".vtx";
|
|
134
134
|
var antCls = '.' + getPrefixCls();
|
|
135
135
|
var salt = "".concat(vtxComponentsCls);
|
|
136
|
-
/**
|
|
137
|
-
* 合并一下token,不然导致嵌套 token 失效
|
|
136
|
+
/**
|
|
137
|
+
* 合并一下token,不然导致嵌套 token 失效
|
|
138
138
|
*/
|
|
139
139
|
var proLayoutTokenMerge = useMemo(function () {
|
|
140
140
|
return getLayoutDesignToken(propsToken || {}, tokenContext.token);
|
|
@@ -231,10 +231,10 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
/**
|
|
235
|
-
* 用于配置 一些全局性的东西
|
|
236
|
-
* @param props
|
|
237
|
-
* @returns
|
|
234
|
+
/**
|
|
235
|
+
* 用于配置 一些全局性的东西
|
|
236
|
+
* @param props
|
|
237
|
+
* @returns
|
|
238
238
|
*/
|
|
239
239
|
export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
240
240
|
var _theme$components, _theme$components2;
|
|
@@ -268,6 +268,7 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
268
268
|
colorBgLayoutTable: '#111'
|
|
269
269
|
} : _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
270
270
|
colorPrimary: '#3A6DFF',
|
|
271
|
+
colorLink: '#3A6DFF',
|
|
271
272
|
colorText: '#29343D',
|
|
272
273
|
colorTextSecondary: '#78829D',
|
|
273
274
|
colorBorder: '#DCDFE6',
|
|
@@ -279,7 +280,8 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
279
280
|
headerBorderRadius: 0
|
|
280
281
|
}, (_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Table),
|
|
281
282
|
Modal: _objectSpread({
|
|
282
|
-
contentPadding: 0
|
|
283
|
+
contentPadding: 0,
|
|
284
|
+
bodyPadding: 0
|
|
283
285
|
}, (_theme$components2 = theme.components) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.Modal)
|
|
284
286
|
});
|
|
285
287
|
|
|
@@ -297,13 +299,13 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
297
299
|
}));
|
|
298
300
|
};
|
|
299
301
|
|
|
300
|
-
/**
|
|
301
|
-
* It returns the intl object from the context if it exists, otherwise it returns the intl object for
|
|
302
|
-
* 获取国际化的方法
|
|
303
|
-
* @param locale
|
|
304
|
-
* @param localeMap
|
|
305
|
-
* the current locale
|
|
306
|
-
* @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.
|
|
307
309
|
*/
|
|
308
310
|
export function useIntl() {
|
|
309
311
|
var _useContext3 = useContext(AntdConfigProvider.ConfigContext),
|
package/es/vtx-provider/intl.js
CHANGED
|
@@ -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();
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
tableForm: {
|
|
16
|
-
search: '
|
|
16
|
+
search: 'Search',
|
|
17
17
|
reset: 'Reset',
|
|
18
18
|
submit: 'Submit',
|
|
19
19
|
collapsed: 'Expand',
|
|
@@ -125,6 +125,10 @@ export default {
|
|
|
125
125
|
operation: 'Import',
|
|
126
126
|
error: 'Upload failed',
|
|
127
127
|
success: 'Upload successful',
|
|
128
|
+
rowNumber: 'Line No.',
|
|
129
|
+
errorMessage: 'Error Description',
|
|
130
|
+
selectFile: 'Click to select file',
|
|
131
|
+
noFileSelected: "No file selected",
|
|
128
132
|
downloadTemplate: 'Download template',
|
|
129
133
|
pleaseSelectFile: 'Please select the file to upload',
|
|
130
134
|
upload: 'Upload',
|
|
@@ -182,8 +186,58 @@ export default {
|
|
|
182
186
|
download: 'Download'
|
|
183
187
|
},
|
|
184
188
|
wangEditor: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
messageOverSizeText: 'Exceeds file size limit, maximum file size is',
|
|
190
|
+
messageUploadFailText: 'Upload error',
|
|
191
|
+
messageInsertImgFailText: 'Image Insertion Failed',
|
|
192
|
+
messageInsertVideoFailText: 'Video Insertion Failed',
|
|
193
|
+
messageInsertAttachmentFailText: 'Attachment Insertion Failed'
|
|
194
|
+
},
|
|
195
|
+
envPuzzle: {
|
|
196
|
+
common: {
|
|
197
|
+
startTime: 'Start time',
|
|
198
|
+
endTime: 'End time',
|
|
199
|
+
confirm: 'OK',
|
|
200
|
+
prompt: 'Prompt'
|
|
201
|
+
},
|
|
202
|
+
createModal: {
|
|
203
|
+
clear: 'Clear',
|
|
204
|
+
required: '{label} is required',
|
|
205
|
+
whitespace: '{label} cannot contain only whitespace'
|
|
206
|
+
},
|
|
207
|
+
template: {
|
|
208
|
+
selectedPrefix: 'Selected',
|
|
209
|
+
selectedSuffix: 'items',
|
|
210
|
+
clearSelected: 'Clear',
|
|
211
|
+
deleteItemConfirm: 'Delete this item?',
|
|
212
|
+
deleteRowConfirm: 'Confirm delete?',
|
|
213
|
+
deleteSelectedConfirm: 'Delete the selected {count} records?',
|
|
214
|
+
exportSelectedRows: 'Export selected rows',
|
|
215
|
+
exportCurrentPage: 'Export current page',
|
|
216
|
+
exportAll: 'Export all',
|
|
217
|
+
exportAllFields: 'Export all fields',
|
|
218
|
+
exportingFile: 'Exporting file...',
|
|
219
|
+
paginationTotal: 'Total {total} records'
|
|
220
|
+
},
|
|
221
|
+
import: {
|
|
222
|
+
rowNumber: 'Row',
|
|
223
|
+
errorMessage: 'Error message',
|
|
224
|
+
pleaseUploadFile: 'Please upload a file',
|
|
225
|
+
uploadFile: 'Upload file'
|
|
226
|
+
},
|
|
227
|
+
map: {
|
|
228
|
+
goToMap: 'Open map',
|
|
229
|
+
locate: 'Locate',
|
|
230
|
+
calibrate: 'Calibrate',
|
|
231
|
+
redraw: 'Redraw',
|
|
232
|
+
keywordPlaceholder: 'Enter keywords',
|
|
233
|
+
invalidLayerOptions: 'data and options cannot be empty, and map is required'
|
|
234
|
+
},
|
|
235
|
+
upload: {
|
|
236
|
+
downloading: 'Downloading...',
|
|
237
|
+
pictureUnit: 'files'
|
|
238
|
+
},
|
|
239
|
+
request: {
|
|
240
|
+
operationFailed: 'Operation failed'
|
|
241
|
+
}
|
|
188
242
|
}
|
|
189
243
|
};
|
|
@@ -124,6 +124,10 @@ export default {
|
|
|
124
124
|
operation: '导入',
|
|
125
125
|
error: '上传失败',
|
|
126
126
|
success: '上传成功',
|
|
127
|
+
rowNumber: '行号',
|
|
128
|
+
errorMessage: '错误说明',
|
|
129
|
+
selectFile: '选择文件',
|
|
130
|
+
noFileSelected: "未选择任何文件",
|
|
127
131
|
downloadTemplate: '下载模板',
|
|
128
132
|
pleaseSelectFile: '请选择需要上传的文件',
|
|
129
133
|
upload: '上传',
|
|
@@ -181,9 +185,11 @@ export default {
|
|
|
181
185
|
download: '下载'
|
|
182
186
|
},
|
|
183
187
|
wangEditor: {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
188
|
+
messageOverSizeText: '超过文件大小限制,最大文件大小为',
|
|
189
|
+
messageUploadFailText: '上传出错',
|
|
190
|
+
messageInsertImgFailText: '插入图片失败',
|
|
191
|
+
messageInsertVideoFailText: '插入视频失败',
|
|
192
|
+
messageInsertAttachmentFailText: '插入附件失败'
|
|
187
193
|
},
|
|
188
194
|
colorPicker: {
|
|
189
195
|
primary: '主要',
|
|
@@ -197,5 +203,53 @@ export default {
|
|
|
197
203
|
basic: '基础颜色',
|
|
198
204
|
// 基础色板
|
|
199
205
|
chart: '图表颜色' // 图表专用色
|
|
206
|
+
},
|
|
207
|
+
envPuzzle: {
|
|
208
|
+
common: {
|
|
209
|
+
startTime: '开始时间',
|
|
210
|
+
endTime: '结束时间',
|
|
211
|
+
confirm: '确定',
|
|
212
|
+
prompt: '提示'
|
|
213
|
+
},
|
|
214
|
+
createModal: {
|
|
215
|
+
clear: '清空',
|
|
216
|
+
required: '{label}不能为空',
|
|
217
|
+
whitespace: '{label}不能只包含空白字符'
|
|
218
|
+
},
|
|
219
|
+
template: {
|
|
220
|
+
selectedPrefix: '已选择',
|
|
221
|
+
selectedSuffix: '项',
|
|
222
|
+
clearSelected: '清空',
|
|
223
|
+
deleteItemConfirm: '确定删除该项吗?',
|
|
224
|
+
deleteRowConfirm: '是否确认删除',
|
|
225
|
+
deleteSelectedConfirm: '确定删除选中的{count}条数据吗?',
|
|
226
|
+
exportSelectedRows: '导出选中行',
|
|
227
|
+
exportCurrentPage: '导出当前页',
|
|
228
|
+
exportAll: '导出全部',
|
|
229
|
+
exportAllFields: '导出全量字段',
|
|
230
|
+
exportingFile: '导出文件中...',
|
|
231
|
+
paginationTotal: '总共{total}条记录'
|
|
232
|
+
},
|
|
233
|
+
import: {
|
|
234
|
+
rowNumber: '行数',
|
|
235
|
+
errorMessage: '错误信息',
|
|
236
|
+
pleaseUploadFile: '请上传文件',
|
|
237
|
+
uploadFile: '上传文件'
|
|
238
|
+
},
|
|
239
|
+
map: {
|
|
240
|
+
goToMap: '去地图',
|
|
241
|
+
locate: '定位',
|
|
242
|
+
calibrate: '校正',
|
|
243
|
+
redraw: '重新绘制',
|
|
244
|
+
keywordPlaceholder: '请输入关键字',
|
|
245
|
+
invalidLayerOptions: 'data,options 不能为空或者是map对象没有'
|
|
246
|
+
},
|
|
247
|
+
upload: {
|
|
248
|
+
downloading: '下载中...',
|
|
249
|
+
pictureUnit: '张'
|
|
250
|
+
},
|
|
251
|
+
request: {
|
|
252
|
+
operationFailed: '操作失败'
|
|
253
|
+
}
|
|
200
254
|
}
|
|
201
255
|
};
|
|
@@ -10,23 +10,23 @@ import { ConfigProvider as AntdConfigProvider, theme as antdTheme } from 'antd';
|
|
|
10
10
|
import { useContext } from 'react';
|
|
11
11
|
import { VtxProvider } from "../index";
|
|
12
12
|
|
|
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}
|
|
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}
|
|
19
19
|
*/
|
|
20
20
|
export var setAlpha = function setAlpha(baseColor, alpha) {
|
|
21
21
|
return new TinyColor(baseColor).setAlpha(alpha).toRgbString();
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* 把一个颜色修改一些明度
|
|
26
|
-
* @example (#000, 50) => #808080
|
|
27
|
-
* @param baseColor {string}
|
|
28
|
-
* @param brightness {0-100}
|
|
29
|
-
* @returns hexColor {string}
|
|
24
|
+
/**
|
|
25
|
+
* 把一个颜色修改一些明度
|
|
26
|
+
* @example (#000, 50) => #808080
|
|
27
|
+
* @param baseColor {string}
|
|
28
|
+
* @param brightness {0-100}
|
|
29
|
+
* @returns hexColor {string}
|
|
30
30
|
*/
|
|
31
31
|
export var lighten = function lighten(baseColor, brightness) {
|
|
32
32
|
var instance = new TinyColor(baseColor);
|
|
@@ -61,11 +61,11 @@ export var operationUnit = function operationUnit(token) {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* 封装了一下 antd 的 useStyle
|
|
66
|
-
* @param componentName {string} 组件的名字
|
|
67
|
-
* @param styleFn {GenerateStyle} 生成样式的函数
|
|
68
|
-
* @returns UseStyleResult
|
|
64
|
+
/**
|
|
65
|
+
* 封装了一下 antd 的 useStyle
|
|
66
|
+
* @param componentName {string} 组件的名字
|
|
67
|
+
* @param styleFn {GenerateStyle} 生成样式的函数
|
|
68
|
+
* @returns UseStyleResult
|
|
69
69
|
*/
|
|
70
70
|
export function useStyle(componentName, styleFn) {
|
|
71
71
|
var _token$vtxComponentsC;
|
package/es/vtx-search/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { useSize, useUpdateLayoutEffect, useSetState } from 'ahooks';
|
|
|
19
19
|
import { Button, Tooltip, Row, Col, ConfigProvider } from 'antd';
|
|
20
20
|
import classnames from 'classnames';
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
|
-
import { useContext, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import React, { Children, Fragment, isValidElement, useContext, useMemo, useRef, useState } from 'react';
|
|
23
23
|
import useColSize from "../utils/useColSize";
|
|
24
24
|
import { StoreCtx } from "../vtx-page-layout/TableLayout";
|
|
25
25
|
import { prefix, useStyle } from "./style/index";
|
|
@@ -27,6 +27,18 @@ import { VtxProvider, useIntl } from "../vtx-provider";
|
|
|
27
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
29
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
30
|
+
var hasRenderableChildren = function hasRenderableChildren(children) {
|
|
31
|
+
var result = false;
|
|
32
|
+
Children.forEach(children, function (child) {
|
|
33
|
+
if (result) return;
|
|
34
|
+
if ( /*#__PURE__*/isValidElement(child) && child.type === Fragment) {
|
|
35
|
+
result = hasRenderableChildren(child.props.children);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
result = child !== null && child !== undefined && typeof child !== 'boolean';
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
30
42
|
function VtxSearch(props) {
|
|
31
43
|
var intl = useIntl();
|
|
32
44
|
var _useContext = useContext(VtxProvider),
|
|
@@ -55,10 +67,6 @@ function VtxSearch(props) {
|
|
|
55
67
|
isClearButton = _props$isClearButton === void 0 ? true : _props$isClearButton,
|
|
56
68
|
_props$isMoreButton = props.isMoreButton,
|
|
57
69
|
isMoreButton = _props$isMoreButton === void 0 ? true : _props$isMoreButton,
|
|
58
|
-
_props$confirmText = props.confirmText,
|
|
59
|
-
confirmText = _props$confirmText === void 0 ? intl.getMessage('tableForm.search', '查询') : _props$confirmText,
|
|
60
|
-
_props$clearText = props.clearText,
|
|
61
|
-
clearText = _props$clearText === void 0 ? intl.getMessage('tableForm.reset', '重置') : _props$clearText,
|
|
62
70
|
onConfirm = props.onConfirm,
|
|
63
71
|
onClear = props.onClear,
|
|
64
72
|
renderButtons = props.renderButtons,
|
|
@@ -66,7 +74,15 @@ function VtxSearch(props) {
|
|
|
66
74
|
showAll = _props$showAll === void 0 ? false : _props$showAll,
|
|
67
75
|
onToggleShow = props.onToggleShow,
|
|
68
76
|
_props$customEnumText = props.customEnumText,
|
|
69
|
-
customEnumText = _props$customEnumText === void 0 ? {
|
|
77
|
+
customEnumText = _props$customEnumText === void 0 ? {
|
|
78
|
+
confirmText: intl.getMessage('tableForm.search', '查询'),
|
|
79
|
+
//确认按钮文本
|
|
80
|
+
clearText: intl.getMessage('tableForm.reset', '重置'),
|
|
81
|
+
//情况按钮文本
|
|
82
|
+
collapseText: intl.getMessage('tableForm.expand', '收起'),
|
|
83
|
+
//情况按钮文本
|
|
84
|
+
expandText: intl.getMessage('tableForm.collapsed', '展开') //情况按钮文本
|
|
85
|
+
} : _props$customEnumText;
|
|
70
86
|
var vtxSearchRef = useRef();
|
|
71
87
|
var ref = useRef();
|
|
72
88
|
var size = useColSize(vtxSearchRef);
|
|
@@ -128,6 +144,8 @@ function VtxSearch(props) {
|
|
|
128
144
|
cumulativeWeight: cumulativeWeight
|
|
129
145
|
};
|
|
130
146
|
}, [JSON.stringify(props.gridWeight), size]);
|
|
147
|
+
var hasMoreButton = isMoreButton && grid.len > realColumn - 1;
|
|
148
|
+
var hasButtons = renderButtons ? hasRenderableChildren(renderButtons) : isConfirmButton || isClearButton || hasMoreButton;
|
|
131
149
|
|
|
132
150
|
// 需要显示的位置
|
|
133
151
|
var showPosition = useMemo(function () {
|
|
@@ -279,7 +297,7 @@ function VtxSearch(props) {
|
|
|
279
297
|
children: /*#__PURE__*/_jsxs(Row, {
|
|
280
298
|
gutter: 24,
|
|
281
299
|
attr: "row",
|
|
282
|
-
children: [analyzeChildren(newChildren), /*#__PURE__*/_jsx(Col, {
|
|
300
|
+
children: [analyzeChildren(newChildren), hasButtons && /*#__PURE__*/_jsx(Col, {
|
|
283
301
|
span: 24 / realColumn * 1,
|
|
284
302
|
offset: btnOffset,
|
|
285
303
|
className: "vtx-search-buttons-content",
|
|
@@ -296,7 +314,7 @@ function VtxSearch(props) {
|
|
|
296
314
|
},
|
|
297
315
|
type: "primary",
|
|
298
316
|
onClick: onConfirm,
|
|
299
|
-
children: confirmText
|
|
317
|
+
children: customEnumText.confirmText
|
|
300
318
|
})
|
|
301
319
|
}), isClearButton && /*#__PURE__*/_jsx("span", {
|
|
302
320
|
"data-type": 'bt',
|
|
@@ -306,18 +324,18 @@ function VtxSearch(props) {
|
|
|
306
324
|
width: '100%'
|
|
307
325
|
},
|
|
308
326
|
onClick: onClear,
|
|
309
|
-
children: clearText
|
|
327
|
+
children: customEnumText.clearText
|
|
310
328
|
})
|
|
311
|
-
}),
|
|
329
|
+
}), hasMoreButton && /*#__PURE__*/_jsx("div", {
|
|
312
330
|
"data-type": 'bt',
|
|
313
331
|
onClick: function onClick() {
|
|
314
332
|
return setShowMore(!showMore);
|
|
315
333
|
},
|
|
316
334
|
className: classnames("".concat(prefix, "-more"), hashId),
|
|
317
335
|
children: showMore ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
318
|
-
children: [
|
|
336
|
+
children: [customEnumText.collapseText, /*#__PURE__*/_jsx(UpOutlined, {})]
|
|
319
337
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
320
|
-
children: [
|
|
338
|
+
children: [customEnumText.expandText, /*#__PURE__*/_jsx(DownOutlined, {})]
|
|
321
339
|
})
|
|
322
340
|
})]
|
|
323
341
|
})
|
|
@@ -70,14 +70,17 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
70
70
|
alignItems: 'flex-end',
|
|
71
71
|
justifyContent: 'flex-end',
|
|
72
72
|
gap: 12
|
|
73
|
-
})), "".concat(componentCls, "-more"), {
|
|
73
|
+
})), "".concat(componentCls, "-more"), _defineProperty({
|
|
74
74
|
height: 32,
|
|
75
75
|
color: token.colorPrimary,
|
|
76
76
|
cursor: 'pointer',
|
|
77
77
|
whiteSpace: 'nowrap',
|
|
78
78
|
alignItems: 'center',
|
|
79
|
-
display: 'flex'
|
|
80
|
-
|
|
79
|
+
display: 'flex',
|
|
80
|
+
gap: '7px'
|
|
81
|
+
}, '.anticon', {
|
|
82
|
+
fontSize: '10px'
|
|
83
|
+
})));
|
|
81
84
|
};
|
|
82
85
|
export function useStyle() {
|
|
83
86
|
return useAntdStyle(prefix, function (token) {
|