@vtx/components 4.0.0-beta.8 → 4.0.0-beta.81
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 +53 -52
- 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 +106 -137
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +124 -32
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- 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 +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -33
- package/es/vtx-export-async/History.js +15 -7
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +211 -70
- 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 +30 -19
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-modal/index.js +11 -6
- 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 +37 -33
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_US.js +57 -3
- 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 +13 -9
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +102 -36
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- 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-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 +98 -35
- package/es/vtx-tree-select/index.js +71 -105
- 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 +93 -39
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/es/vtx-wang-editor/wangEditorUtil.js +4 -0
- 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 +54 -52
- 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 +113 -143
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +124 -32
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- 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 +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -34
- package/lib/vtx-export-async/History.js +14 -8
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +209 -71
- 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 -18
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-modal/index.js +11 -6
- 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 +37 -33
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_US.js +57 -3
- 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 +13 -9
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +104 -38
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- 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-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 +96 -33
- package/lib/vtx-tree-select/index.js +71 -105
- 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 +91 -37
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/package.json +240 -225
- 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;
|
|
@@ -264,20 +264,24 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
264
264
|
borderRadius: 8,
|
|
265
265
|
borderRadiusLG: 12,
|
|
266
266
|
borderRadiusSM: 4
|
|
267
|
-
}, dark ? {
|
|
267
|
+
}, dark ? {
|
|
268
|
+
colorBgLayoutTable: '#111'
|
|
269
|
+
} : _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
268
270
|
colorPrimary: '#3A6DFF',
|
|
271
|
+
colorLink: '#3A6DFF',
|
|
269
272
|
colorText: '#29343D',
|
|
270
273
|
colorTextSecondary: '#78829D',
|
|
271
274
|
colorBorder: '#DCDFE6',
|
|
272
275
|
colorTextPlaceholder: '#BFC3CB',
|
|
273
276
|
colorFillAlter: '#F5F7FA'
|
|
274
|
-
}, "colorFillAlter", '#F5F7FA'), "colorTextPlaceholder", '#BFC3CB'), "colorFillAlterSolid", '#F5F7FA'), "colorBgLayout", '#FAFAFA')), theme.token);
|
|
277
|
+
}, "colorFillAlter", '#F5F7FA'), "colorTextPlaceholder", '#BFC3CB'), "colorFillAlterSolid", '#F5F7FA'), "colorBgLayout", '#F0F2F5'), "colorBgLayoutTable", '#FAFAFA')), theme.token);
|
|
275
278
|
theme.components = _objectSpread(_objectSpread({}, theme.components), {}, {
|
|
276
279
|
Table: _objectSpread({
|
|
277
280
|
headerBorderRadius: 0
|
|
278
281
|
}, (_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Table),
|
|
279
282
|
Modal: _objectSpread({
|
|
280
|
-
contentPadding: 0
|
|
283
|
+
contentPadding: 0,
|
|
284
|
+
bodyPadding: 0
|
|
281
285
|
}, (_theme$components2 = theme.components) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.Modal)
|
|
282
286
|
});
|
|
283
287
|
|
|
@@ -295,13 +299,13 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
295
299
|
}));
|
|
296
300
|
};
|
|
297
301
|
|
|
298
|
-
/**
|
|
299
|
-
* It returns the intl object from the context if it exists, otherwise it returns the intl object for
|
|
300
|
-
* 获取国际化的方法
|
|
301
|
-
* @param locale
|
|
302
|
-
* @param localeMap
|
|
303
|
-
* the current locale
|
|
304
|
-
* @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.
|
|
305
309
|
*/
|
|
306
310
|
export function useIntl() {
|
|
307
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();
|
|
@@ -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
|
@@ -55,10 +55,6 @@ function VtxSearch(props) {
|
|
|
55
55
|
isClearButton = _props$isClearButton === void 0 ? true : _props$isClearButton,
|
|
56
56
|
_props$isMoreButton = props.isMoreButton,
|
|
57
57
|
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
58
|
onConfirm = props.onConfirm,
|
|
63
59
|
onClear = props.onClear,
|
|
64
60
|
renderButtons = props.renderButtons,
|
|
@@ -66,7 +62,15 @@ function VtxSearch(props) {
|
|
|
66
62
|
showAll = _props$showAll === void 0 ? false : _props$showAll,
|
|
67
63
|
onToggleShow = props.onToggleShow,
|
|
68
64
|
_props$customEnumText = props.customEnumText,
|
|
69
|
-
customEnumText = _props$customEnumText === void 0 ? {
|
|
65
|
+
customEnumText = _props$customEnumText === void 0 ? {
|
|
66
|
+
confirmText: intl.getMessage('tableForm.search', '查询'),
|
|
67
|
+
//确认按钮文本
|
|
68
|
+
clearText: intl.getMessage('tableForm.reset', '重置'),
|
|
69
|
+
//情况按钮文本
|
|
70
|
+
collapseText: intl.getMessage('tableForm.expand', '收起'),
|
|
71
|
+
//情况按钮文本
|
|
72
|
+
expandText: intl.getMessage('tableForm.collapsed', '展开') //情况按钮文本
|
|
73
|
+
} : _props$customEnumText;
|
|
70
74
|
var vtxSearchRef = useRef();
|
|
71
75
|
var ref = useRef();
|
|
72
76
|
var size = useColSize(vtxSearchRef);
|
|
@@ -296,7 +300,7 @@ function VtxSearch(props) {
|
|
|
296
300
|
},
|
|
297
301
|
type: "primary",
|
|
298
302
|
onClick: onConfirm,
|
|
299
|
-
children: confirmText
|
|
303
|
+
children: customEnumText.confirmText
|
|
300
304
|
})
|
|
301
305
|
}), isClearButton && /*#__PURE__*/_jsx("span", {
|
|
302
306
|
"data-type": 'bt',
|
|
@@ -306,7 +310,7 @@ function VtxSearch(props) {
|
|
|
306
310
|
width: '100%'
|
|
307
311
|
},
|
|
308
312
|
onClick: onClear,
|
|
309
|
-
children: clearText
|
|
313
|
+
children: customEnumText.clearText
|
|
310
314
|
})
|
|
311
315
|
}), isMoreButton && grid.len > realColumn - 1 && /*#__PURE__*/_jsx("div", {
|
|
312
316
|
"data-type": 'bt',
|
|
@@ -315,9 +319,9 @@ function VtxSearch(props) {
|
|
|
315
319
|
},
|
|
316
320
|
className: classnames("".concat(prefix, "-more"), hashId),
|
|
317
321
|
children: showMore ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
318
|
-
children: [
|
|
322
|
+
children: [customEnumText.collapseText, /*#__PURE__*/_jsx(UpOutlined, {})]
|
|
319
323
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
320
|
-
children: [
|
|
324
|
+
children: [customEnumText.expandText, /*#__PURE__*/_jsx(DownOutlined, {})]
|
|
321
325
|
})
|
|
322
326
|
})]
|
|
323
327
|
})
|
|
@@ -16,7 +16,8 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
16
16
|
transitionDuration: token.toggleSpeed,
|
|
17
17
|
transitionProperty: 'height',
|
|
18
18
|
boxSizing: 'border-box',
|
|
19
|
-
overflow: 'hidden'
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
color: token.colorText
|
|
20
21
|
}, "".concat(componentCls, "-element"), {}), "".concat(componentCls, "-label_v"), {
|
|
21
22
|
overflow: 'hidden',
|
|
22
23
|
lineHeight: 1,
|
package/es/vtx-select/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["value", "mode", "size", "onChange", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "showAll", "selectStyle", "selectAll", "selectSearchAll", "defaultBindBodyToPopupContainer", "customEnumText", "showSearch", "optionFilterProp", "onSearch"],
|
|
2
|
+
_excluded2 = ["onSearch", "optionFilterProp"];
|
|
1
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -9,6 +11,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
17
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
18
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -26,6 +30,7 @@ import { VtxProvider, useIntl } from "../vtx-provider";
|
|
|
26
30
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
31
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
32
|
var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
33
|
+
var _props$options;
|
|
29
34
|
var intl = useIntl();
|
|
30
35
|
var _useState = useState(0),
|
|
31
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -58,16 +63,25 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
58
63
|
_props$defaultBindBod = props.defaultBindBodyToPopupContainer,
|
|
59
64
|
defaultBindBodyToPopupContainer = _props$defaultBindBod === void 0 ? true : _props$defaultBindBod,
|
|
60
65
|
_props$customEnumText = props.customEnumText,
|
|
61
|
-
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText
|
|
66
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
67
|
+
showSearch = props.showSearch,
|
|
68
|
+
optionFilterProp = props.optionFilterProp,
|
|
69
|
+
_onSearch = props.onSearch,
|
|
70
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
62
71
|
var TextEnum = _objectSpread({
|
|
63
72
|
selectAllText: intl.getMessage('select.selectAll', '全选'),
|
|
64
73
|
defaultPlaceholderText: intl.getMessage('tableForm.selectPlaceholder', '请选择'),
|
|
65
74
|
emptyDescriptionText: intl.getMessage('select.empty', '暂无数据')
|
|
66
75
|
}, customEnumText);
|
|
76
|
+
var _useContext = useContext(VtxProvider),
|
|
77
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
78
|
+
var prefixCls = getPrefixCls('select', props.prefixCls);
|
|
79
|
+
var _useStyle = useStyle(prefixCls),
|
|
80
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
81
|
+
hashId = _useStyle.hashId;
|
|
67
82
|
useEffect(function () {
|
|
68
83
|
if ((mode === 'multiple' || mode === 'tags') && elRef.current) {
|
|
69
84
|
var element = elRef.current;
|
|
70
|
-
|
|
71
85
|
// 立即设置一次
|
|
72
86
|
setPopWidth(element.clientWidth);
|
|
73
87
|
|
|
@@ -92,21 +106,51 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
92
106
|
};
|
|
93
107
|
}
|
|
94
108
|
}, [mode]);
|
|
95
|
-
var newChildren = props.children ?
|
|
109
|
+
var newChildren = props.children ? React.Children.toArray(props.children) : ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.map(function (v) {
|
|
110
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
111
|
+
key: v.value,
|
|
112
|
+
props: _objectSpread(_objectSpread({}, v), {}, {
|
|
113
|
+
children: v.label
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
})) || [];
|
|
117
|
+
var getOptionValue = function getOptionValue(item) {
|
|
118
|
+
var _ref, _itemProps$value;
|
|
119
|
+
var itemProps = (item === null || item === void 0 ? void 0 : item.props) || {};
|
|
120
|
+
return (_ref = (_itemProps$value = itemProps.value) !== null && _itemProps$value !== void 0 ? _itemProps$value : item.value) !== null && _ref !== void 0 ? _ref : item.key;
|
|
121
|
+
};
|
|
122
|
+
var getOptionLabel = function getOptionLabel(item) {
|
|
123
|
+
var _ref2, _itemProps$children;
|
|
124
|
+
var itemProps = (item === null || item === void 0 ? void 0 : item.props) || {};
|
|
125
|
+
return (_ref2 = (_itemProps$children = itemProps.children) !== null && _itemProps$children !== void 0 ? _itemProps$children : itemProps.label) !== null && _ref2 !== void 0 ? _ref2 : item.label;
|
|
126
|
+
};
|
|
127
|
+
var getSelectedValue = function getSelectedValue(item) {
|
|
128
|
+
if (isObject(item)) {
|
|
129
|
+
var _item$value;
|
|
130
|
+
return (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.key;
|
|
131
|
+
}
|
|
132
|
+
return item;
|
|
133
|
+
};
|
|
134
|
+
var normalizedOptions = newChildren.map(function (item) {
|
|
135
|
+
return {
|
|
136
|
+
value: getOptionValue(item),
|
|
137
|
+
label: getOptionLabel(item),
|
|
138
|
+
raw: item
|
|
139
|
+
};
|
|
140
|
+
});
|
|
96
141
|
var getContent = function getContent() {
|
|
97
142
|
var child = {};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
child[item.key] = item === null || item === void 0 || (_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.children;
|
|
143
|
+
normalizedOptions.forEach(function (item) {
|
|
144
|
+
child[item.value] = item.label;
|
|
101
145
|
});
|
|
102
146
|
var getChildren = function getChildren() {
|
|
103
147
|
var child = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
104
148
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
|
105
|
-
var key =
|
|
149
|
+
var key = getSelectedValue(value);
|
|
106
150
|
return child[key] || '';
|
|
107
151
|
};
|
|
108
152
|
return /*#__PURE__*/_jsx("div", {
|
|
109
|
-
className: "
|
|
153
|
+
className: classnames("".concat(prefixCls, "-all-list"), hashId),
|
|
110
154
|
children: Array.isArray(value) && value.length ? value.map(function (item, index) {
|
|
111
155
|
var name = getChildren(child, item);
|
|
112
156
|
return /*#__PURE__*/_jsx(Tag, {
|
|
@@ -118,10 +162,13 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
118
162
|
e.preventDefault();
|
|
119
163
|
var valueClone = _toConsumableArray(value);
|
|
120
164
|
valueClone.splice(index, 1);
|
|
121
|
-
var
|
|
122
|
-
|
|
165
|
+
var selectedValueSet = new Set(valueClone.map(getSelectedValue));
|
|
166
|
+
var options = normalizedOptions.filter(function (ite) {
|
|
167
|
+
return selectedValueSet.has(ite.value);
|
|
168
|
+
}).map(function (ite) {
|
|
169
|
+
return ite.raw;
|
|
123
170
|
});
|
|
124
|
-
_onChange(valueClone, options);
|
|
171
|
+
_onChange && _onChange(valueClone, options);
|
|
125
172
|
},
|
|
126
173
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
127
174
|
title: name,
|
|
@@ -134,16 +181,45 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
134
181
|
})
|
|
135
182
|
});
|
|
136
183
|
};
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
184
|
+
var defaultOptionFilterProp = ['label', 'children'];
|
|
185
|
+
var handleSearch = function handleSearch(value) {
|
|
186
|
+
setSearchValue(value ? String(value).toLowerCase() : '');
|
|
187
|
+
_onSearch && _onSearch(value);
|
|
188
|
+
};
|
|
189
|
+
var getSearchProps = function getSearchProps() {
|
|
190
|
+
if (showSearch && _typeof(showSearch) === 'object') {
|
|
191
|
+
var showSearchOnSearch = showSearch.onSearch,
|
|
192
|
+
showSearchOptionFilterProp = showSearch.optionFilterProp,
|
|
193
|
+
searchConfig = _objectWithoutProperties(showSearch, _excluded2);
|
|
194
|
+
return {
|
|
195
|
+
showSearch: _objectSpread(_objectSpread({}, searchConfig), {}, {
|
|
196
|
+
optionFilterProp: showSearchOptionFilterProp || optionFilterProp || defaultOptionFilterProp,
|
|
197
|
+
onSearch: function onSearch(value) {
|
|
198
|
+
setSearchValue(value ? String(value).toLowerCase() : '');
|
|
199
|
+
showSearchOnSearch && showSearchOnSearch(value);
|
|
200
|
+
_onSearch && _onSearch(value);
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
showSearch: showSearch === undefined ? true : showSearch,
|
|
207
|
+
optionFilterProp: optionFilterProp || defaultOptionFilterProp
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
var newProps = _objectSpread(_objectSpread(_objectSpread({}, getSearchProps()), {}, {
|
|
140
211
|
placeholder: TextEnum.defaultPlaceholderText,
|
|
141
|
-
allowClear: true
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
212
|
+
allowClear: true,
|
|
213
|
+
value: value,
|
|
214
|
+
mode: mode,
|
|
215
|
+
size: size,
|
|
216
|
+
//同步button大小
|
|
217
|
+
onChange: _onChange,
|
|
218
|
+
maxTagCount: maxTagCount,
|
|
219
|
+
maxTagTextLength: maxTagTextLength,
|
|
220
|
+
maxTagPlaceholder: maxTagPlaceholder
|
|
221
|
+
}, rest), {}, {
|
|
222
|
+
onSearch: handleSearch,
|
|
147
223
|
onBlur: function onBlur(e) {
|
|
148
224
|
setSearchValue('');
|
|
149
225
|
props.onBlur && props.onBlur(e);
|
|
@@ -172,7 +248,7 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
172
248
|
if (e.target.checked) {
|
|
173
249
|
var tempChildren = newChildren.filter(function (item) {
|
|
174
250
|
if (selectSearchAll && searchValue) {
|
|
175
|
-
return String(item
|
|
251
|
+
return String(getOptionLabel(item)).toLowerCase().indexOf(searchValue) > -1;
|
|
176
252
|
}
|
|
177
253
|
return true;
|
|
178
254
|
});
|
|
@@ -180,13 +256,13 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
180
256
|
if (props.labelInValue) {
|
|
181
257
|
keys = tempChildren.map(function (item) {
|
|
182
258
|
return {
|
|
183
|
-
label: item
|
|
184
|
-
value: item
|
|
259
|
+
label: getOptionLabel(item),
|
|
260
|
+
value: getOptionValue(item)
|
|
185
261
|
};
|
|
186
262
|
});
|
|
187
263
|
} else {
|
|
188
264
|
keys = tempChildren.map(function (item) {
|
|
189
|
-
return item
|
|
265
|
+
return getOptionValue(item);
|
|
190
266
|
});
|
|
191
267
|
}
|
|
192
268
|
_onChange && _onChange(keys, tempChildren);
|
|
@@ -206,21 +282,11 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
206
282
|
});
|
|
207
283
|
}
|
|
208
284
|
}
|
|
209
|
-
var _useContext = useContext(VtxProvider),
|
|
210
|
-
getPrefixCls = _useContext.getPrefixCls;
|
|
211
|
-
var prefixCls = getPrefixCls('select', props.prefixCls);
|
|
212
|
-
var _useStyle = useStyle(prefixCls),
|
|
213
|
-
wrapSSR = _useStyle.wrapSSR,
|
|
214
|
-
hashId = _useStyle.hashId;
|
|
215
285
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
216
|
-
className: classnames(prefixCls, hashId, {
|
|
217
|
-
'vtx-multi-select': mode == 'multiple' || mode == 'tags'
|
|
218
|
-
}),
|
|
286
|
+
className: classnames(prefixCls, hashId, _defineProperty({}, "".concat(prefixCls, "-multi"), mode == 'multiple' || mode == 'tags')),
|
|
219
287
|
id: elId.current,
|
|
220
288
|
ref: elRef,
|
|
221
|
-
style: _objectSpread(
|
|
222
|
-
paddingRight: (mode == 'multiple' || mode == 'tags') && showAll ? 32 : 0
|
|
223
|
-
}),
|
|
289
|
+
style: _objectSpread({}, props.style),
|
|
224
290
|
children: /*#__PURE__*/_jsxs(Space.Compact, {
|
|
225
291
|
style: {
|
|
226
292
|
width: '100%'
|