@hanwenbo/x-web-pro-components 0.0.3 → 0.0.5
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/es/components/form/index.js +40 -31
- package/es/components/form/stepsForm.js +12 -10
- package/es/components/provider/intl.js +24 -1
- package/es/components/table/index.js +35 -34
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/components/form/index.js +40 -31
- package/lib/components/form/stepsForm.js +12 -10
- package/lib/components/provider/intl.js +24 -1
- package/lib/components/table/index.js +34 -33
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -10,6 +10,7 @@ var _button = require("@hanwenbo/x-web-ui/button");
|
|
|
10
10
|
var _card = require("@hanwenbo/x-web-ui/card");
|
|
11
11
|
var _form = require("@hanwenbo/x-web-ui/form");
|
|
12
12
|
var _cn = require("@hanwenbo/x-web-ui/utils/cn");
|
|
13
|
+
var _provider = require("../provider");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
var _excluded = ["current", "onCurrentChange", "submitter", "stepsRender", "form", "initialValues", "onFinish", "className", "children"];
|
|
15
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -53,6 +54,7 @@ var StepsForm = exports.StepsForm = function StepsForm(_ref2) {
|
|
|
53
54
|
className = _ref2.className,
|
|
54
55
|
children = _ref2.children,
|
|
55
56
|
restProps = _objectWithoutProperties(_ref2, _excluded);
|
|
57
|
+
var intl = (0, _provider.useIntl)();
|
|
56
58
|
var _useForm = (0, _form.useForm)(controlledForm),
|
|
57
59
|
_useForm2 = _slicedToArray(_useForm, 1),
|
|
58
60
|
form = _useForm2[0];
|
|
@@ -122,8 +124,8 @@ var StepsForm = exports.StepsForm = function StepsForm(_ref2) {
|
|
|
122
124
|
var handlePrev = function handlePrev() {
|
|
123
125
|
setStep(Math.max(0, mergedCurrent - 1));
|
|
124
126
|
};
|
|
125
|
-
var submitButtonText = (submitter === null || submitter === void 0 || (_submitter$searchConf = submitter.searchConfig) === null || _submitter$searchConf === void 0 ? void 0 : _submitter$searchConf.submitText) || (mergedCurrent >= steps.length - 1 ? '提交' : '下一步');
|
|
126
|
-
var resetButtonText = (submitter === null || submitter === void 0 || (_submitter$searchConf2 = submitter.searchConfig) === null || _submitter$searchConf2 === void 0 ? void 0 : _submitter$searchConf2.resetText) || '上一步';
|
|
127
|
+
var submitButtonText = (submitter === null || submitter === void 0 || (_submitter$searchConf = submitter.searchConfig) === null || _submitter$searchConf === void 0 ? void 0 : _submitter$searchConf.submitText) || (mergedCurrent >= steps.length - 1 ? intl.getMessage('modalForm.submit', '提交') : intl.getMessage('stepsForm.next', '下一步'));
|
|
128
|
+
var resetButtonText = (submitter === null || submitter === void 0 || (_submitter$searchConf2 = submitter.searchConfig) === null || _submitter$searchConf2 === void 0 ? void 0 : _submitter$searchConf2.resetText) || intl.getMessage('stepsForm.previous', '上一步');
|
|
127
129
|
var submitterDom = submitter === false ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
128
130
|
className: "mt-6 flex flex-wrap items-center justify-between gap-3",
|
|
129
131
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, _objectSpread(_objectSpread({
|
|
@@ -152,27 +154,27 @@ var StepsForm = exports.StepsForm = function StepsForm(_ref2) {
|
|
|
152
154
|
}
|
|
153
155
|
},
|
|
154
156
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
155
|
-
className: "text-xs font-medium
|
|
156
|
-
children: ["
|
|
157
|
+
className: "text-muted-foreground text-xs font-medium tracking-[0.2em] uppercase",
|
|
158
|
+
children: [intl.getMessage('stepsForm.step', '步骤'), " ", index + 1]
|
|
157
159
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
158
160
|
className: "mt-2 text-sm font-medium",
|
|
159
|
-
children: step.props.title || "
|
|
161
|
+
children: step.props.title || "".concat(intl.getMessage('stepsForm.step', '步骤'), " ").concat(index + 1)
|
|
160
162
|
}), step.props.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
161
|
-
className: "mt-1 text-xs
|
|
163
|
+
className: "text-muted-foreground mt-1 text-xs",
|
|
162
164
|
children: step.props.description
|
|
163
165
|
}) : null]
|
|
164
166
|
}, step.key || "step-".concat(index));
|
|
165
167
|
})
|
|
166
168
|
});
|
|
167
169
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_card.Card, {
|
|
168
|
-
className: "
|
|
170
|
+
className: "border-border bg-card rounded-3xl border shadow-sm",
|
|
169
171
|
children: [stepsRender ? stepsRender(stepsDom, submitterDom) : stepsDom, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
170
172
|
className: "mb-4 space-y-1",
|
|
171
173
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
172
|
-
className: "text-lg font-semibold
|
|
173
|
-
children: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.props.title) || '步骤表单'
|
|
174
|
+
className: "text-foreground text-lg font-semibold",
|
|
175
|
+
children: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.props.title) || intl.getMessage('stepsForm.title', '步骤表单')
|
|
174
176
|
}), activeStep !== null && activeStep !== void 0 && activeStep.props.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
175
|
-
className: "text-
|
|
177
|
+
className: "text-muted-foreground text-sm",
|
|
176
178
|
children: activeStep.props.description
|
|
177
179
|
}) : null]
|
|
178
180
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_form.Form, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
@@ -20,7 +20,30 @@ var createMessages = function createMessages(locale, overrides) {
|
|
|
20
20
|
'tableForm.collapsed': locale.toLowerCase().startsWith('zh') ? '展开' : 'Expand',
|
|
21
21
|
'modalForm.submit': locale.toLowerCase().startsWith('zh') ? '提交' : 'Submit',
|
|
22
22
|
'modalForm.cancel': locale.toLowerCase().startsWith('zh') ? '取消' : 'Cancel',
|
|
23
|
-
'tableForm.empty': locale.toLowerCase().startsWith('zh') ? '暂无数据' :
|
|
23
|
+
'tableForm.empty': locale.toLowerCase().startsWith('zh') ? '暂无数据' : 'No data',
|
|
24
|
+
'form.inputPrefix': locale.toLowerCase().startsWith('zh') ? '请输入' : 'Please enter ',
|
|
25
|
+
'form.selectPrefix': locale.toLowerCase().startsWith('zh') ? '请选择' : 'Please select ',
|
|
26
|
+
'form.close': locale.toLowerCase().startsWith('zh') ? '关闭' : 'Close',
|
|
27
|
+
'stepsForm.next': locale.toLowerCase().startsWith('zh') ? '下一步' : 'Next',
|
|
28
|
+
'stepsForm.previous': locale.toLowerCase().startsWith('zh') ? '上一步' : 'Previous',
|
|
29
|
+
'stepsForm.step': locale.toLowerCase().startsWith('zh') ? '步骤' : 'Step',
|
|
30
|
+
'stepsForm.title': locale.toLowerCase().startsWith('zh') ? '步骤表单' : 'Step form',
|
|
31
|
+
'tableToolbar.reload': locale.toLowerCase().startsWith('zh') ? '刷新' : 'Refresh',
|
|
32
|
+
'tableToolbar.tools': locale.toLowerCase().startsWith('zh') ? '打开表格工具' : 'Open table tools',
|
|
33
|
+
'tableToolbar.density': locale.toLowerCase().startsWith('zh') ? '密度' : 'Density',
|
|
34
|
+
'tableToolbar.large': locale.toLowerCase().startsWith('zh') ? '宽松' : 'Comfortable',
|
|
35
|
+
'tableToolbar.middle': locale.toLowerCase().startsWith('zh') ? '中等' : 'Medium',
|
|
36
|
+
'tableToolbar.small': locale.toLowerCase().startsWith('zh') ? '紧凑' : 'Compact',
|
|
37
|
+
'tableToolbar.columns': locale.toLowerCase().startsWith('zh') ? '列设置' : 'Columns',
|
|
38
|
+
'tableToolbar.fullscreen': locale.toLowerCase().startsWith('zh') ? '全屏' : 'Fullscreen',
|
|
39
|
+
'tableToolbar.exitFullscreen': locale.toLowerCase().startsWith('zh') ? '退出全屏' : 'Exit fullscreen',
|
|
40
|
+
'tableToolbar.pinLeft': locale.toLowerCase().startsWith('zh') ? '固定到左侧' : 'Pin left',
|
|
41
|
+
'tableToolbar.unpinLeft': locale.toLowerCase().startsWith('zh') ? '取消左侧固定' : 'Unpin left',
|
|
42
|
+
'tableToolbar.pinRight': locale.toLowerCase().startsWith('zh') ? '固定到右侧' : 'Pin right',
|
|
43
|
+
'tableToolbar.unpinRight': locale.toLowerCase().startsWith('zh') ? '取消右侧固定' : 'Unpin right',
|
|
44
|
+
'tableToolbar.keyword': locale.toLowerCase().startsWith('zh') ? '请输入关键词' : 'Please enter keywords',
|
|
45
|
+
'tableToolbar.selected': locale.toLowerCase().startsWith('zh') ? '已选' : 'Selected',
|
|
46
|
+
'tableToolbar.clear': locale.toLowerCase().startsWith('zh') ? '清空' : 'Clear'
|
|
24
47
|
}, overrides);
|
|
25
48
|
};
|
|
26
49
|
var zhCNMessages = createMessages('zh-CN');
|
|
@@ -456,6 +456,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
456
456
|
searchForm = _useForm2[0];
|
|
457
457
|
var _useLocale = (0, _i18n.useLocale)(),
|
|
458
458
|
t = _useLocale.t;
|
|
459
|
+
var intl = (0, _provider.useIntl)();
|
|
459
460
|
var itemsPerPageLabel = t('common.itemsPerPage') !== 'common.itemsPerPage' ? t('common.itemsPerPage') : String(_i18n.zhCN['common.itemsPerPage']);
|
|
460
461
|
var _useState = (0, _react.useState)(false),
|
|
461
462
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -849,7 +850,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
849
850
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
850
851
|
className: "flex items-center gap-1",
|
|
851
852
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
852
|
-
title: fixed === 'left' ? '
|
|
853
|
+
title: intl.getMessage(fixed === 'left' ? 'tableToolbar.unpinLeft' : 'tableToolbar.pinLeft'),
|
|
853
854
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
854
855
|
className: "inline-flex",
|
|
855
856
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.Button, {
|
|
@@ -862,18 +863,18 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
862
863
|
event.stopPropagation();
|
|
863
864
|
toggleColumnFixed(columnKey, 'left');
|
|
864
865
|
},
|
|
865
|
-
"aria-label": fixed === 'left' ? '
|
|
866
|
+
"aria-label": intl.getMessage(fixed === 'left' ? 'tableToolbar.unpinLeft' : 'tableToolbar.pinLeft'),
|
|
866
867
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReact.PanelLeft, {
|
|
867
868
|
size: 16,
|
|
868
869
|
className: "shrink-0"
|
|
869
870
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
870
871
|
className: "sr-only",
|
|
871
|
-
children: fixed === 'left' ? '
|
|
872
|
+
children: intl.getMessage(fixed === 'left' ? 'tableToolbar.unpinLeft' : 'tableToolbar.pinLeft')
|
|
872
873
|
})]
|
|
873
874
|
})
|
|
874
875
|
})
|
|
875
876
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
876
|
-
title: fixed === 'right' ? '
|
|
877
|
+
title: intl.getMessage(fixed === 'right' ? 'tableToolbar.unpinRight' : 'tableToolbar.pinRight'),
|
|
877
878
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
878
879
|
className: "inline-flex",
|
|
879
880
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.Button, {
|
|
@@ -886,13 +887,13 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
886
887
|
event.stopPropagation();
|
|
887
888
|
toggleColumnFixed(columnKey, 'right');
|
|
888
889
|
},
|
|
889
|
-
"aria-label": fixed === 'right' ? '
|
|
890
|
+
"aria-label": intl.getMessage(fixed === 'right' ? 'tableToolbar.unpinRight' : 'tableToolbar.pinRight'),
|
|
890
891
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReact.PanelRight, {
|
|
891
892
|
size: 16,
|
|
892
893
|
className: "shrink-0"
|
|
893
894
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
894
895
|
className: "sr-only",
|
|
895
|
-
children: fixed === 'right' ? '
|
|
896
|
+
children: intl.getMessage(fixed === 'right' ? 'tableToolbar.unpinRight' : 'tableToolbar.pinRight')
|
|
896
897
|
})]
|
|
897
898
|
})
|
|
898
899
|
})
|
|
@@ -931,17 +932,17 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
931
932
|
disabled: true,
|
|
932
933
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
933
934
|
className: "x-pro-table-options-dropdown-section-label",
|
|
934
|
-
children:
|
|
935
|
+
children: intl.getMessage('tableToolbar.density')
|
|
935
936
|
})
|
|
936
937
|
}, {
|
|
937
938
|
key: 'density-large',
|
|
938
|
-
label: '
|
|
939
|
+
label: intl.getMessage('tableToolbar.large')
|
|
939
940
|
}, {
|
|
940
941
|
key: 'density-middle',
|
|
941
|
-
label: '
|
|
942
|
+
label: intl.getMessage('tableToolbar.middle')
|
|
942
943
|
}, {
|
|
943
944
|
key: 'density-small',
|
|
944
|
-
label: '
|
|
945
|
+
label: intl.getMessage('tableToolbar.small')
|
|
945
946
|
});
|
|
946
947
|
}
|
|
947
948
|
if (optionConfig.setting && columnSettingItems.length > 0) {
|
|
@@ -956,7 +957,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
956
957
|
disabled: true,
|
|
957
958
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
958
959
|
className: "x-pro-table-options-dropdown-section-label",
|
|
959
|
-
children:
|
|
960
|
+
children: intl.getMessage('tableToolbar.columns')
|
|
960
961
|
})
|
|
961
962
|
});
|
|
962
963
|
dropdownItems.push.apply(dropdownItems, _toConsumableArray(columnSettingItems));
|
|
@@ -970,7 +971,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
970
971
|
}
|
|
971
972
|
dropdownItems.push({
|
|
972
973
|
key: 'fullscreen',
|
|
973
|
-
label: fullscreen ? '
|
|
974
|
+
label: intl.getMessage(fullscreen ? 'tableToolbar.exitFullscreen' : 'tableToolbar.fullscreen')
|
|
974
975
|
});
|
|
975
976
|
}
|
|
976
977
|
if (!optionConfig.reload && dropdownItems.length === 0) {
|
|
@@ -986,7 +987,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
986
987
|
onClick: function onClick() {
|
|
987
988
|
action.reload();
|
|
988
989
|
},
|
|
989
|
-
children: (_optionConfig$dropdow = optionConfig.dropdownText) !== null && _optionConfig$dropdow !== void 0 ? _optionConfig$dropdow : '
|
|
990
|
+
children: (_optionConfig$dropdow = optionConfig.dropdownText) !== null && _optionConfig$dropdow !== void 0 ? _optionConfig$dropdow : intl.getMessage('tableToolbar.reload')
|
|
990
991
|
}) : null, dropdownItems.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dropdown.Dropdown, {
|
|
991
992
|
placement: "bottomRight",
|
|
992
993
|
dropdownClassName: "x-pro-table-options-dropdown-menu",
|
|
@@ -1023,14 +1024,14 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1023
1024
|
className: "x-pro-table-options-dropdown-icon"
|
|
1024
1025
|
}),
|
|
1025
1026
|
className: "x-pro-table-options-dropdown-trigger",
|
|
1026
|
-
"aria-label":
|
|
1027
|
+
"aria-label": intl.getMessage('tableToolbar.tools')
|
|
1027
1028
|
})
|
|
1028
1029
|
}) : null]
|
|
1029
1030
|
}, "toolbar-options-split")];
|
|
1030
1031
|
}
|
|
1031
1032
|
if (optionConfig.reload) {
|
|
1032
1033
|
nextSettings.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
1033
|
-
title:
|
|
1034
|
+
title: intl.getMessage('tableToolbar.reload'),
|
|
1034
1035
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1035
1036
|
className: "inline-flex",
|
|
1036
1037
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.Button, {
|
|
@@ -1044,7 +1045,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1044
1045
|
className: "h-4 w-4"
|
|
1045
1046
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1046
1047
|
className: "sr-only",
|
|
1047
|
-
children:
|
|
1048
|
+
children: intl.getMessage('tableToolbar.reload')
|
|
1048
1049
|
})]
|
|
1049
1050
|
}, "toolbar-reload")
|
|
1050
1051
|
})
|
|
@@ -1055,13 +1056,13 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1055
1056
|
menu: {
|
|
1056
1057
|
items: [{
|
|
1057
1058
|
key: 'large',
|
|
1058
|
-
label: '
|
|
1059
|
+
label: intl.getMessage('tableToolbar.large')
|
|
1059
1060
|
}, {
|
|
1060
1061
|
key: 'middle',
|
|
1061
|
-
label: '
|
|
1062
|
+
label: intl.getMessage('tableToolbar.middle')
|
|
1062
1063
|
}, {
|
|
1063
1064
|
key: 'small',
|
|
1064
|
-
label: '
|
|
1065
|
+
label: intl.getMessage('tableToolbar.small')
|
|
1065
1066
|
}],
|
|
1066
1067
|
onClick: function onClick(item) {
|
|
1067
1068
|
var nextSize = mapTableSize(item.key);
|
|
@@ -1071,7 +1072,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1071
1072
|
selectedKeys: [tableSize]
|
|
1072
1073
|
},
|
|
1073
1074
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
1074
|
-
title:
|
|
1075
|
+
title: intl.getMessage('tableToolbar.density'),
|
|
1075
1076
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1076
1077
|
className: "inline-flex",
|
|
1077
1078
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.Button, {
|
|
@@ -1082,7 +1083,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1082
1083
|
className: "h-4 w-4"
|
|
1083
1084
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1084
1085
|
className: "sr-only",
|
|
1085
|
-
children:
|
|
1086
|
+
children: intl.getMessage('tableToolbar.density')
|
|
1086
1087
|
})]
|
|
1087
1088
|
})
|
|
1088
1089
|
})
|
|
@@ -1100,7 +1101,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1100
1101
|
onClick: function onClick() {}
|
|
1101
1102
|
},
|
|
1102
1103
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
1103
|
-
title:
|
|
1104
|
+
title: intl.getMessage('tableToolbar.columns'),
|
|
1104
1105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1105
1106
|
className: "inline-flex",
|
|
1106
1107
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.Button, {
|
|
@@ -1111,7 +1112,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1111
1112
|
className: "h-4 w-4"
|
|
1112
1113
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1113
1114
|
className: "sr-only",
|
|
1114
|
-
children:
|
|
1115
|
+
children: intl.getMessage('tableToolbar.columns')
|
|
1115
1116
|
})]
|
|
1116
1117
|
})
|
|
1117
1118
|
})
|
|
@@ -1120,7 +1121,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1120
1121
|
}
|
|
1121
1122
|
if (optionConfig.fullScreen) {
|
|
1122
1123
|
nextSettings.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
1123
|
-
title: fullscreen ? '
|
|
1124
|
+
title: intl.getMessage(fullscreen ? 'tableToolbar.exitFullscreen' : 'tableToolbar.fullscreen'),
|
|
1124
1125
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1125
1126
|
className: "inline-flex",
|
|
1126
1127
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.Button, {
|
|
@@ -1137,14 +1138,14 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1137
1138
|
className: "h-4 w-4"
|
|
1138
1139
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1139
1140
|
className: "sr-only",
|
|
1140
|
-
children: fullscreen ? '
|
|
1141
|
+
children: intl.getMessage(fullscreen ? 'tableToolbar.exitFullscreen' : 'tableToolbar.fullscreen')
|
|
1141
1142
|
})]
|
|
1142
1143
|
}, "toolbar-fullscreen")
|
|
1143
1144
|
})
|
|
1144
1145
|
}, "toolbar-fullscreen-tooltip"));
|
|
1145
1146
|
}
|
|
1146
1147
|
return nextSettings;
|
|
1147
|
-
}, [action, columns, fullscreen, mergedColumnsState, onSizeChange, optionConfig, setColumnVisibility, tableSize, toggleColumnFixed]);
|
|
1148
|
+
}, [action, intl, columns, fullscreen, mergedColumnsState, onSizeChange, optionConfig, setColumnVisibility, tableSize, toggleColumnFixed]);
|
|
1148
1149
|
var mergedRowSelection = (0, _react.useMemo)(function () {
|
|
1149
1150
|
if (!rowSelection) {
|
|
1150
1151
|
return undefined;
|
|
@@ -1169,7 +1170,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1169
1170
|
}
|
|
1170
1171
|
var searchConfig = toolSearchConfig === true ? {} : toolSearchConfig;
|
|
1171
1172
|
return {
|
|
1172
|
-
placeholder: searchConfig.placeholder || '
|
|
1173
|
+
placeholder: searchConfig.placeholder || intl.getMessage('tableToolbar.keyword'),
|
|
1173
1174
|
allowClear: true,
|
|
1174
1175
|
onSearch: function () {
|
|
1175
1176
|
var _onSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(keyword) {
|
|
@@ -1208,7 +1209,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1208
1209
|
return onSearch;
|
|
1209
1210
|
}()
|
|
1210
1211
|
};
|
|
1211
|
-
}, [optionConfig, toolbar === null || toolbar === void 0 ? void 0 : toolbar.search]);
|
|
1212
|
+
}, [intl, optionConfig, toolbar === null || toolbar === void 0 ? void 0 : toolbar.search]);
|
|
1212
1213
|
var toolbarOptionNodes = (0, _react.useMemo)(function () {
|
|
1213
1214
|
if (optionsRender === false) {
|
|
1214
1215
|
return [];
|
|
@@ -1304,7 +1305,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1304
1305
|
mode: "edit",
|
|
1305
1306
|
valueType: searchValueType,
|
|
1306
1307
|
valueEnum: columnItem.valueEnum,
|
|
1307
|
-
placeholder: typeof columnItem.title === 'string' ? ['select', 'tag', 'treeSelect', 'cascader', 'segmented', 'date', 'dateMonth', 'dateQuarter', 'dateTime', 'dateRange', 'dateMonthRange', 'dateQuarterRange', 'dateTimeRange', 'dateWeek', 'dateWeekRange', 'dateYear', 'dateYearRange', 'time', 'timeRange'].includes(valueTypeName) ? "
|
|
1308
|
+
placeholder: typeof columnItem.title === 'string' ? ['select', 'tag', 'treeSelect', 'cascader', 'segmented', 'date', 'dateMonth', 'dateQuarter', 'dateTime', 'dateRange', 'dateMonthRange', 'dateQuarterRange', 'dateTimeRange', 'dateWeek', 'dateWeekRange', 'dateYear', 'dateYearRange', 'time', 'timeRange'].includes(valueTypeName) ? "".concat(intl.getMessage('form.selectPrefix')).concat(columnItem.title) : "".concat(intl.getMessage('form.inputPrefix')).concat(columnItem.title) : undefined,
|
|
1308
1309
|
fieldProps: _objectSpread(_objectSpread({}, resolvedFieldProps || {}), {}, {
|
|
1309
1310
|
className: (0, _cn.cn)(stableChoiceWidth && 'min-w-0 w-full', resolvedFieldProps === null || resolvedFieldProps === void 0 ? void 0 : resolvedFieldProps.className),
|
|
1310
1311
|
style: _objectSpread(_objectSpread({}, stableChoiceWidth ? {
|
|
@@ -1354,7 +1355,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1354
1355
|
className: className
|
|
1355
1356
|
}, tableProps), defaultSearchNode)) : defaultSearchNode;
|
|
1356
1357
|
return rendered === null ? null : rendered;
|
|
1357
|
-
}, [action, className, columns, controlledDataSource, controlledLoading, columnsState, headerTitle, _onChange3, onDataSourceChange, onLoad, onLoadingChange, onRequestError, onSizeChange, options, optionsRender, params, pagination, request, resolveSearchValues, rowSelection, search, searchColumns, searchForm, searchFormRender, hasSearchForm, tableAlertOptionRender, tableAlertRender, tableClassName, tableExtraRender, tableProps, tableStyle, toolbar, toolBarRender]);
|
|
1358
|
+
}, [action, className, intl, columns, controlledDataSource, controlledLoading, columnsState, headerTitle, _onChange3, onDataSourceChange, onLoad, onLoadingChange, onRequestError, onSizeChange, options, optionsRender, params, pagination, request, resolveSearchValues, rowSelection, search, searchColumns, searchForm, searchFormRender, hasSearchForm, tableAlertOptionRender, tableAlertRender, tableClassName, tableExtraRender, tableProps, tableStyle, toolbar, toolBarRender]);
|
|
1358
1359
|
|
|
1359
1360
|
// ProTable 为了保持 hooks 顺序会始终创建 searchForm;没有搜索字段时仍需让
|
|
1360
1361
|
// rc-field-form 连接到一个 Form,否则它会在开发环境延迟输出未连接告警。
|
|
@@ -1380,7 +1381,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1380
1381
|
var messageNode = tableAlertRender ? tableAlertRender({
|
|
1381
1382
|
selectedRowKeys: selectedRowKeys,
|
|
1382
1383
|
selectedRows: selectedRows
|
|
1383
|
-
}) : selectedCount ? "
|
|
1384
|
+
}) : selectedCount ? "".concat(intl.getMessage('tableToolbar.selected'), " ").concat(selectedCount) : null;
|
|
1384
1385
|
if (!messageNode) {
|
|
1385
1386
|
return null;
|
|
1386
1387
|
}
|
|
@@ -1426,12 +1427,12 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1426
1427
|
size: "small",
|
|
1427
1428
|
variant: "ghost",
|
|
1428
1429
|
onClick: clearSelectionState,
|
|
1429
|
-
children:
|
|
1430
|
+
children: intl.getMessage('tableToolbar.clear')
|
|
1430
1431
|
}) : null)
|
|
1431
1432
|
})]
|
|
1432
1433
|
})
|
|
1433
1434
|
});
|
|
1434
|
-
}, [clearSelectionState, hasCustomToolbarActions, mergedRowSelection, selectedRows, mergedSelectedRowKeys, tableAlertOptionRender, tableAlertRender]);
|
|
1435
|
+
}, [clearSelectionState, intl, hasCustomToolbarActions, mergedRowSelection, selectedRows, mergedSelectedRowKeys, tableAlertOptionRender, tableAlertRender]);
|
|
1435
1436
|
var toolbarSectionNode = (0, _react.useMemo)(function () {
|
|
1436
1437
|
if (!toolbarNode) {
|
|
1437
1438
|
return null;
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.4";
|
|
2
2
|
export default version;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanwenbo/x-web-pro-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Enterprise-ready pro components built on x-web-ui",
|
|
5
5
|
"author": "9476400@qq.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"dayjs": "^1.11.3",
|
|
46
46
|
"lucide-react": "^0.460.0",
|
|
47
|
-
"@hanwenbo/x-web-ui": "0.0.
|
|
47
|
+
"@hanwenbo/x-web-ui": "0.0.6"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": ">=18.0.0",
|