@hanwenbo/x-web-pro-components 0.0.2 → 0.0.4
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/schemaForm.js +5 -2
- package/es/components/form/stepsForm.js +12 -10
- package/es/components/provider/intl.js +24 -1
- package/es/components/table/index.js +59 -58
- 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/schemaForm.js +5 -2
- package/lib/components/form/stepsForm.js +12 -10
- package/lib/components/provider/intl.js +24 -1
- package/lib/components/table/index.js +58 -57
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -28,13 +28,15 @@ import { Checkbox } from '@hanwenbo/x-web-ui/checkbox';
|
|
|
28
28
|
import { Dropdown } from '@hanwenbo/x-web-ui/dropdown';
|
|
29
29
|
import { Form, useForm } from '@hanwenbo/x-web-ui/form';
|
|
30
30
|
import { Pagination } from '@hanwenbo/x-web-ui/pagination';
|
|
31
|
+
import { Select } from '@hanwenbo/x-web-ui/select';
|
|
32
|
+
import { useLocale, zhCN } from '@hanwenbo/x-web-ui/i18n';
|
|
31
33
|
import { Table } from '@hanwenbo/x-web-ui/table';
|
|
32
34
|
import { Tooltip } from '@hanwenbo/x-web-ui/tooltip';
|
|
33
35
|
import { cn } from '@hanwenbo/x-web-ui/utils/cn';
|
|
34
36
|
import { ChevronDown, Columns3, Expand, Minimize2, PanelLeft, PanelRight, RefreshCw, Table2 } from 'lucide-react';
|
|
35
37
|
import { attachPropertiesToComponent, mergeTableLoading } from "../../utils";
|
|
36
38
|
import { FieldIndexColumn, FieldStatus, ProField, getEffectiveValueType } from "../field";
|
|
37
|
-
import { ConfigConsumer, IntlConsumer, arEGIntl, caESIntl, createIntl, enUSIntl, esESIntl, frFRIntl, itITIntl, jaJPIntl, msMYIntl, ptBRIntl, ruRUIntl, thTHIntl, viVNIntl, zhCNIntl, zhTWIntl } from "../provider";
|
|
39
|
+
import { ConfigConsumer, IntlConsumer, useIntl, arEGIntl, caESIntl, createIntl, enUSIntl, esESIntl, frFRIntl, itITIntl, jaJPIntl, msMYIntl, ptBRIntl, ruRUIntl, thTHIntl, viVNIntl, zhCNIntl, zhTWIntl } from "../provider";
|
|
38
40
|
import { DragSortTable } from "./dragSortTable";
|
|
39
41
|
import { EditableTable } from "./editableTable";
|
|
40
42
|
import { ListToolBar } from "./listToolBar";
|
|
@@ -307,6 +309,10 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
307
309
|
var _useForm = useForm(),
|
|
308
310
|
_useForm2 = _slicedToArray(_useForm, 1),
|
|
309
311
|
searchForm = _useForm2[0];
|
|
312
|
+
var _useLocale = useLocale(),
|
|
313
|
+
t = _useLocale.t;
|
|
314
|
+
var intl = useIntl();
|
|
315
|
+
var itemsPerPageLabel = t('common.itemsPerPage') !== 'common.itemsPerPage' ? t('common.itemsPerPage') : String(zhCN['common.itemsPerPage']);
|
|
310
316
|
var _useState = useState(false),
|
|
311
317
|
_useState2 = _slicedToArray(_useState, 2),
|
|
312
318
|
requestLoading = _useState2[0],
|
|
@@ -691,7 +697,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
691
697
|
setColumnVisibility(columnKey, checked);
|
|
692
698
|
},
|
|
693
699
|
children: /*#__PURE__*/_jsx("span", {
|
|
694
|
-
className: "truncate text-sm
|
|
700
|
+
className: "text-foreground truncate text-sm",
|
|
695
701
|
children: columnTitle
|
|
696
702
|
})
|
|
697
703
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -699,7 +705,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
699
705
|
children: /*#__PURE__*/_jsxs("div", {
|
|
700
706
|
className: "flex items-center gap-1",
|
|
701
707
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
702
|
-
title: fixed === 'left' ? '
|
|
708
|
+
title: intl.getMessage(fixed === 'left' ? 'tableToolbar.unpinLeft' : 'tableToolbar.pinLeft'),
|
|
703
709
|
children: /*#__PURE__*/_jsx("span", {
|
|
704
710
|
className: "inline-flex",
|
|
705
711
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
@@ -712,18 +718,18 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
712
718
|
event.stopPropagation();
|
|
713
719
|
toggleColumnFixed(columnKey, 'left');
|
|
714
720
|
},
|
|
715
|
-
"aria-label": fixed === 'left' ? '
|
|
721
|
+
"aria-label": intl.getMessage(fixed === 'left' ? 'tableToolbar.unpinLeft' : 'tableToolbar.pinLeft'),
|
|
716
722
|
children: [/*#__PURE__*/_jsx(PanelLeft, {
|
|
717
723
|
size: 16,
|
|
718
724
|
className: "shrink-0"
|
|
719
725
|
}), /*#__PURE__*/_jsx("span", {
|
|
720
726
|
className: "sr-only",
|
|
721
|
-
children: fixed === 'left' ? '
|
|
727
|
+
children: intl.getMessage(fixed === 'left' ? 'tableToolbar.unpinLeft' : 'tableToolbar.pinLeft')
|
|
722
728
|
})]
|
|
723
729
|
})
|
|
724
730
|
})
|
|
725
731
|
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
726
|
-
title: fixed === 'right' ? '
|
|
732
|
+
title: intl.getMessage(fixed === 'right' ? 'tableToolbar.unpinRight' : 'tableToolbar.pinRight'),
|
|
727
733
|
children: /*#__PURE__*/_jsx("span", {
|
|
728
734
|
className: "inline-flex",
|
|
729
735
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
@@ -736,13 +742,13 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
736
742
|
event.stopPropagation();
|
|
737
743
|
toggleColumnFixed(columnKey, 'right');
|
|
738
744
|
},
|
|
739
|
-
"aria-label": fixed === 'right' ? '
|
|
745
|
+
"aria-label": intl.getMessage(fixed === 'right' ? 'tableToolbar.unpinRight' : 'tableToolbar.pinRight'),
|
|
740
746
|
children: [/*#__PURE__*/_jsx(PanelRight, {
|
|
741
747
|
size: 16,
|
|
742
748
|
className: "shrink-0"
|
|
743
749
|
}), /*#__PURE__*/_jsx("span", {
|
|
744
750
|
className: "sr-only",
|
|
745
|
-
children: fixed === 'right' ? '
|
|
751
|
+
children: intl.getMessage(fixed === 'right' ? 'tableToolbar.unpinRight' : 'tableToolbar.pinRight')
|
|
746
752
|
})]
|
|
747
753
|
})
|
|
748
754
|
})
|
|
@@ -781,17 +787,17 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
781
787
|
disabled: true,
|
|
782
788
|
label: /*#__PURE__*/_jsx("span", {
|
|
783
789
|
className: "x-pro-table-options-dropdown-section-label",
|
|
784
|
-
children:
|
|
790
|
+
children: intl.getMessage('tableToolbar.density')
|
|
785
791
|
})
|
|
786
792
|
}, {
|
|
787
793
|
key: 'density-large',
|
|
788
|
-
label: '
|
|
794
|
+
label: intl.getMessage('tableToolbar.large')
|
|
789
795
|
}, {
|
|
790
796
|
key: 'density-middle',
|
|
791
|
-
label: '
|
|
797
|
+
label: intl.getMessage('tableToolbar.middle')
|
|
792
798
|
}, {
|
|
793
799
|
key: 'density-small',
|
|
794
|
-
label: '
|
|
800
|
+
label: intl.getMessage('tableToolbar.small')
|
|
795
801
|
});
|
|
796
802
|
}
|
|
797
803
|
if (optionConfig.setting && columnSettingItems.length > 0) {
|
|
@@ -806,7 +812,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
806
812
|
disabled: true,
|
|
807
813
|
label: /*#__PURE__*/_jsx("span", {
|
|
808
814
|
className: "x-pro-table-options-dropdown-section-label",
|
|
809
|
-
children:
|
|
815
|
+
children: intl.getMessage('tableToolbar.columns')
|
|
810
816
|
})
|
|
811
817
|
});
|
|
812
818
|
dropdownItems.push.apply(dropdownItems, _toConsumableArray(columnSettingItems));
|
|
@@ -820,7 +826,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
820
826
|
}
|
|
821
827
|
dropdownItems.push({
|
|
822
828
|
key: 'fullscreen',
|
|
823
|
-
label: fullscreen ? '
|
|
829
|
+
label: intl.getMessage(fullscreen ? 'tableToolbar.exitFullscreen' : 'tableToolbar.fullscreen')
|
|
824
830
|
});
|
|
825
831
|
}
|
|
826
832
|
if (!optionConfig.reload && dropdownItems.length === 0) {
|
|
@@ -836,7 +842,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
836
842
|
onClick: function onClick() {
|
|
837
843
|
action.reload();
|
|
838
844
|
},
|
|
839
|
-
children: (_optionConfig$dropdow = optionConfig.dropdownText) !== null && _optionConfig$dropdow !== void 0 ? _optionConfig$dropdow : '
|
|
845
|
+
children: (_optionConfig$dropdow = optionConfig.dropdownText) !== null && _optionConfig$dropdow !== void 0 ? _optionConfig$dropdow : intl.getMessage('tableToolbar.reload')
|
|
840
846
|
}) : null, dropdownItems.length > 0 ? /*#__PURE__*/_jsx(Dropdown, {
|
|
841
847
|
placement: "bottomRight",
|
|
842
848
|
dropdownClassName: "x-pro-table-options-dropdown-menu",
|
|
@@ -873,14 +879,14 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
873
879
|
className: "x-pro-table-options-dropdown-icon"
|
|
874
880
|
}),
|
|
875
881
|
className: "x-pro-table-options-dropdown-trigger",
|
|
876
|
-
"aria-label":
|
|
882
|
+
"aria-label": intl.getMessage('tableToolbar.tools')
|
|
877
883
|
})
|
|
878
884
|
}) : null]
|
|
879
885
|
}, "toolbar-options-split")];
|
|
880
886
|
}
|
|
881
887
|
if (optionConfig.reload) {
|
|
882
888
|
nextSettings.push( /*#__PURE__*/_jsx(Tooltip, {
|
|
883
|
-
title:
|
|
889
|
+
title: intl.getMessage('tableToolbar.reload'),
|
|
884
890
|
children: /*#__PURE__*/_jsx("span", {
|
|
885
891
|
className: "inline-flex",
|
|
886
892
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
@@ -894,7 +900,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
894
900
|
className: "h-4 w-4"
|
|
895
901
|
}), /*#__PURE__*/_jsx("span", {
|
|
896
902
|
className: "sr-only",
|
|
897
|
-
children:
|
|
903
|
+
children: intl.getMessage('tableToolbar.reload')
|
|
898
904
|
})]
|
|
899
905
|
}, "toolbar-reload")
|
|
900
906
|
})
|
|
@@ -905,13 +911,13 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
905
911
|
menu: {
|
|
906
912
|
items: [{
|
|
907
913
|
key: 'large',
|
|
908
|
-
label: '
|
|
914
|
+
label: intl.getMessage('tableToolbar.large')
|
|
909
915
|
}, {
|
|
910
916
|
key: 'middle',
|
|
911
|
-
label: '
|
|
917
|
+
label: intl.getMessage('tableToolbar.middle')
|
|
912
918
|
}, {
|
|
913
919
|
key: 'small',
|
|
914
|
-
label: '
|
|
920
|
+
label: intl.getMessage('tableToolbar.small')
|
|
915
921
|
}],
|
|
916
922
|
onClick: function onClick(item) {
|
|
917
923
|
var nextSize = mapTableSize(item.key);
|
|
@@ -921,7 +927,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
921
927
|
selectedKeys: [tableSize]
|
|
922
928
|
},
|
|
923
929
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
924
|
-
title:
|
|
930
|
+
title: intl.getMessage('tableToolbar.density'),
|
|
925
931
|
children: /*#__PURE__*/_jsx("span", {
|
|
926
932
|
className: "inline-flex",
|
|
927
933
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
@@ -932,7 +938,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
932
938
|
className: "h-4 w-4"
|
|
933
939
|
}), /*#__PURE__*/_jsx("span", {
|
|
934
940
|
className: "sr-only",
|
|
935
|
-
children:
|
|
941
|
+
children: intl.getMessage('tableToolbar.density')
|
|
936
942
|
})]
|
|
937
943
|
})
|
|
938
944
|
})
|
|
@@ -950,7 +956,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
950
956
|
onClick: function onClick() {}
|
|
951
957
|
},
|
|
952
958
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
953
|
-
title:
|
|
959
|
+
title: intl.getMessage('tableToolbar.columns'),
|
|
954
960
|
children: /*#__PURE__*/_jsx("span", {
|
|
955
961
|
className: "inline-flex",
|
|
956
962
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
@@ -961,7 +967,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
961
967
|
className: "h-4 w-4"
|
|
962
968
|
}), /*#__PURE__*/_jsx("span", {
|
|
963
969
|
className: "sr-only",
|
|
964
|
-
children:
|
|
970
|
+
children: intl.getMessage('tableToolbar.columns')
|
|
965
971
|
})]
|
|
966
972
|
})
|
|
967
973
|
})
|
|
@@ -970,7 +976,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
970
976
|
}
|
|
971
977
|
if (optionConfig.fullScreen) {
|
|
972
978
|
nextSettings.push( /*#__PURE__*/_jsx(Tooltip, {
|
|
973
|
-
title: fullscreen ? '
|
|
979
|
+
title: intl.getMessage(fullscreen ? 'tableToolbar.exitFullscreen' : 'tableToolbar.fullscreen'),
|
|
974
980
|
children: /*#__PURE__*/_jsx("span", {
|
|
975
981
|
className: "inline-flex",
|
|
976
982
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
@@ -987,14 +993,14 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
987
993
|
className: "h-4 w-4"
|
|
988
994
|
}), /*#__PURE__*/_jsx("span", {
|
|
989
995
|
className: "sr-only",
|
|
990
|
-
children: fullscreen ? '
|
|
996
|
+
children: intl.getMessage(fullscreen ? 'tableToolbar.exitFullscreen' : 'tableToolbar.fullscreen')
|
|
991
997
|
})]
|
|
992
998
|
}, "toolbar-fullscreen")
|
|
993
999
|
})
|
|
994
1000
|
}, "toolbar-fullscreen-tooltip"));
|
|
995
1001
|
}
|
|
996
1002
|
return nextSettings;
|
|
997
|
-
}, [action, columns, fullscreen, mergedColumnsState, onSizeChange, optionConfig, setColumnVisibility, tableSize, toggleColumnFixed]);
|
|
1003
|
+
}, [action, intl, columns, fullscreen, mergedColumnsState, onSizeChange, optionConfig, setColumnVisibility, tableSize, toggleColumnFixed]);
|
|
998
1004
|
var mergedRowSelection = useMemo(function () {
|
|
999
1005
|
if (!rowSelection) {
|
|
1000
1006
|
return undefined;
|
|
@@ -1019,7 +1025,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1019
1025
|
}
|
|
1020
1026
|
var searchConfig = toolSearchConfig === true ? {} : toolSearchConfig;
|
|
1021
1027
|
return {
|
|
1022
|
-
placeholder: searchConfig.placeholder || '
|
|
1028
|
+
placeholder: searchConfig.placeholder || intl.getMessage('tableToolbar.keyword'),
|
|
1023
1029
|
allowClear: true,
|
|
1024
1030
|
onSearch: function () {
|
|
1025
1031
|
var _onSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(keyword) {
|
|
@@ -1058,7 +1064,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1058
1064
|
return onSearch;
|
|
1059
1065
|
}()
|
|
1060
1066
|
};
|
|
1061
|
-
}, [optionConfig, toolbar === null || toolbar === void 0 ? void 0 : toolbar.search]);
|
|
1067
|
+
}, [intl, optionConfig, toolbar === null || toolbar === void 0 ? void 0 : toolbar.search]);
|
|
1062
1068
|
var toolbarOptionNodes = useMemo(function () {
|
|
1063
1069
|
if (optionsRender === false) {
|
|
1064
1070
|
return [];
|
|
@@ -1154,7 +1160,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1154
1160
|
mode: "edit",
|
|
1155
1161
|
valueType: searchValueType,
|
|
1156
1162
|
valueEnum: columnItem.valueEnum,
|
|
1157
|
-
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) ? "
|
|
1163
|
+
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,
|
|
1158
1164
|
fieldProps: _objectSpread(_objectSpread({}, resolvedFieldProps || {}), {}, {
|
|
1159
1165
|
className: cn(stableChoiceWidth && 'min-w-0 w-full', resolvedFieldProps === null || resolvedFieldProps === void 0 ? void 0 : resolvedFieldProps.className),
|
|
1160
1166
|
style: _objectSpread(_objectSpread({}, stableChoiceWidth ? {
|
|
@@ -1204,7 +1210,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1204
1210
|
className: className
|
|
1205
1211
|
}, tableProps), defaultSearchNode)) : defaultSearchNode;
|
|
1206
1212
|
return rendered === null ? null : rendered;
|
|
1207
|
-
}, [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]);
|
|
1213
|
+
}, [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]);
|
|
1208
1214
|
|
|
1209
1215
|
// ProTable 为了保持 hooks 顺序会始终创建 searchForm;没有搜索字段时仍需让
|
|
1210
1216
|
// rc-field-form 连接到一个 Form,否则它会在开发环境延迟输出未连接告警。
|
|
@@ -1230,7 +1236,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1230
1236
|
var messageNode = tableAlertRender ? tableAlertRender({
|
|
1231
1237
|
selectedRowKeys: selectedRowKeys,
|
|
1232
1238
|
selectedRows: selectedRows
|
|
1233
|
-
}) : selectedCount ? "
|
|
1239
|
+
}) : selectedCount ? "".concat(intl.getMessage('tableToolbar.selected'), " ").concat(selectedCount) : null;
|
|
1234
1240
|
if (!messageNode) {
|
|
1235
1241
|
return null;
|
|
1236
1242
|
}
|
|
@@ -1243,7 +1249,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1243
1249
|
children: /*#__PURE__*/_jsxs("div", {
|
|
1244
1250
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
1245
1251
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
1246
|
-
className: "flex items-center gap-2 text-sm
|
|
1252
|
+
className: "text-foreground flex items-center gap-2 text-sm",
|
|
1247
1253
|
children: [/*#__PURE__*/_jsx("span", {
|
|
1248
1254
|
className: "text-primary",
|
|
1249
1255
|
children: /*#__PURE__*/_jsxs("svg", {
|
|
@@ -1276,12 +1282,12 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1276
1282
|
size: "small",
|
|
1277
1283
|
variant: "ghost",
|
|
1278
1284
|
onClick: clearSelectionState,
|
|
1279
|
-
children:
|
|
1285
|
+
children: intl.getMessage('tableToolbar.clear')
|
|
1280
1286
|
}) : null)
|
|
1281
1287
|
})]
|
|
1282
1288
|
})
|
|
1283
1289
|
});
|
|
1284
|
-
}, [clearSelectionState, hasCustomToolbarActions, mergedRowSelection, selectedRows, mergedSelectedRowKeys, tableAlertOptionRender, tableAlertRender]);
|
|
1290
|
+
}, [clearSelectionState, intl, hasCustomToolbarActions, mergedRowSelection, selectedRows, mergedSelectedRowKeys, tableAlertOptionRender, tableAlertRender]);
|
|
1285
1291
|
var toolbarSectionNode = useMemo(function () {
|
|
1286
1292
|
if (!toolbarNode) {
|
|
1287
1293
|
return null;
|
|
@@ -1296,7 +1302,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1296
1302
|
}
|
|
1297
1303
|
return /*#__PURE__*/_jsx(Card, {
|
|
1298
1304
|
variant: "default",
|
|
1299
|
-
className: "overflow-visible rounded-xl border-0
|
|
1305
|
+
className: "bg-card overflow-visible rounded-xl border-0 shadow-none",
|
|
1300
1306
|
bodyClassName: "px-4 py-4",
|
|
1301
1307
|
children: searchNode
|
|
1302
1308
|
});
|
|
@@ -1369,25 +1375,20 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1369
1375
|
return /*#__PURE__*/_jsxs("div", {
|
|
1370
1376
|
className: cn(PRO_TABLE_STACK_CLASS, 'w-full sm:flex-row sm:items-center sm:justify-between'),
|
|
1371
1377
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
1372
|
-
className: "flex flex-wrap items-center
|
|
1373
|
-
children: [normalizedPaginationConfig.showTotal ? normalizedPaginationConfig.showTotal(total, range) : null, normalizedPaginationConfig.showSizeChanger ? /*#__PURE__*/
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
value: option,
|
|
1387
|
-
children: [option, " / page"]
|
|
1388
|
-
}, option);
|
|
1389
|
-
})
|
|
1390
|
-
})]
|
|
1378
|
+
className: "text-muted-foreground flex flex-wrap items-center [gap:var(--x-space-4)] text-sm",
|
|
1379
|
+
children: [normalizedPaginationConfig.showTotal ? normalizedPaginationConfig.showTotal(total, range) : null, normalizedPaginationConfig.showSizeChanger ? /*#__PURE__*/_jsx(Select, {
|
|
1380
|
+
"aria-label": itemsPerPageLabel,
|
|
1381
|
+
size: resolvedPaginationSize,
|
|
1382
|
+
value: pageInfo.pageSize,
|
|
1383
|
+
options: (normalizedPaginationConfig.pageSizeOptions || [10, 20, 50, 100]).map(function (option) {
|
|
1384
|
+
return {
|
|
1385
|
+
value: option,
|
|
1386
|
+
label: "".concat(option, " ").concat(itemsPerPageLabel)
|
|
1387
|
+
};
|
|
1388
|
+
}),
|
|
1389
|
+
onChange: function onChange(value) {
|
|
1390
|
+
void handleExternalPaginationChange(1, Number(value));
|
|
1391
|
+
}
|
|
1391
1392
|
}) : null]
|
|
1392
1393
|
}), shouldRenderPager ? /*#__PURE__*/_jsx(Pagination, {
|
|
1393
1394
|
current: pageInfo.current,
|
|
@@ -1400,7 +1401,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1400
1401
|
}
|
|
1401
1402
|
}) : null]
|
|
1402
1403
|
});
|
|
1403
|
-
}, [dataSource.length, handleExternalPaginationChange, normalizedPaginationConfig, pageInfo.current, pageInfo.pageSize, pageInfo.total, resolvedPaginationSize, showExternalBottomPagination, tableSize]);
|
|
1404
|
+
}, [itemsPerPageLabel, dataSource.length, handleExternalPaginationChange, normalizedPaginationConfig, pageInfo.current, pageInfo.pageSize, pageInfo.total, resolvedPaginationSize, showExternalBottomPagination, tableSize]);
|
|
1404
1405
|
var defaultTableNode = /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({}, tableProps), {}, {
|
|
1405
1406
|
className: cn(tableClassName),
|
|
1406
1407
|
style: tableStyle,
|
|
@@ -1526,7 +1527,7 @@ var BaseProTable = function BaseProTable(_ref3) {
|
|
|
1526
1527
|
cardStyle = _ref10.style,
|
|
1527
1528
|
restCardProps = _objectWithoutProperties(_ref10, _excluded2);
|
|
1528
1529
|
var tableCardNode = /*#__PURE__*/_jsxs(Card, _objectSpread(_objectSpread({}, restCardProps), {}, {
|
|
1529
|
-
className: cn('overflow-visible rounded-xl border-0
|
|
1530
|
+
className: cn('bg-card overflow-visible rounded-xl border-0 shadow-none', fullscreen && 'bg-background fixed inset-4 z-40 overflow-auto p-2 shadow-2xl', className, cardClassName),
|
|
1530
1531
|
style: cardStyle,
|
|
1531
1532
|
children: [searchFormConnectionNode, tableContent]
|
|
1532
1533
|
}));
|
package/es/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/es/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = '0.0.
|
|
1
|
+
export var version = '0.0.4';
|
|
2
2
|
export default version;
|