@pisell/materials 2.2.34 → 2.2.35

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.
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
5
5
  className: string;
6
6
  defaultCurrent: number;
7
7
  showTotal: (total: number, range: [number, number]) => string;
8
- itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
8
+ itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
9
9
  responsive: boolean;
10
10
  size: string;
11
11
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export var formatApiUrl = function formatApiUrl(url) {
10
+ return url || '/shop/form/data';
11
+ };
@@ -54,11 +54,17 @@ var BasicTable = function BasicTable(props) {
54
54
  return isArr(group) && group.length > 0;
55
55
  }, [group]);
56
56
  var showTotal = pagination.showTotal,
57
- localPagination = pagination.localPagination;
57
+ localPagination = pagination.localPagination,
58
+ showSizeChange = pagination.showSizeChange;
58
59
  var _showTotal = useCallback(function (total, range) {
59
60
  var _size = formPagination.size || 10;
60
61
  return showTotal(total, range, _size);
61
62
  }, [showTotal, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
63
+ useEffect(function () {
64
+ // 默认100条每页
65
+ var _size = formPagination.size || 100;
66
+ showSizeChange && showSizeChange(formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, _size);
67
+ }, [formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
62
68
 
63
69
  // 分割数据源
64
70
  var _dataSource = useMemo(function () {
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
5
5
  className: string;
6
6
  defaultCurrent: number;
7
7
  showTotal: (total: number, range: [number, number]) => string;
8
- itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
8
+ itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
9
9
  responsive: boolean;
10
10
  size: string;
11
11
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,31 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/table/Actions/component/ExportImport/utils/index.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ formatApiUrl: () => formatApiUrl
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var formatApiUrl = (url) => {
26
+ return url || "/shop/form/data";
27
+ };
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ formatApiUrl
31
+ });
@@ -55,7 +55,7 @@ var BasicTable = (props) => {
55
55
  const group = import_antd.Form.useWatch("group_by", { form, preserve: true });
56
56
  const { dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
57
57
  const isGroup = (0, import_react.useMemo)(() => (0, import_utils2.isArr)(group) && group.length > 0, [group]);
58
- const { showTotal, localPagination } = pagination;
58
+ const { showTotal, localPagination, showSizeChange } = pagination;
59
59
  const _showTotal = (0, import_react.useCallback)(
60
60
  (total2, range) => {
61
61
  let _size = formPagination.size || 10;
@@ -63,6 +63,10 @@ var BasicTable = (props) => {
63
63
  },
64
64
  [showTotal, formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]
65
65
  );
66
+ (0, import_react.useEffect)(() => {
67
+ let _size = formPagination.size || 100;
68
+ showSizeChange && showSizeChange(formPagination == null ? void 0 : formPagination.page, _size);
69
+ }, [formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]);
66
70
  const _dataSource = (0, import_react.useMemo)(() => {
67
71
  let _page = formPagination.page;
68
72
  let _size = formPagination.size || 10;
@@ -982,6 +982,28 @@ export default {
982
982
  value: 'target => !!target.getProps().getPropValue("pagination")',
983
983
  },
984
984
  },
985
+ {
986
+ name: "pagination.showSizeChange",
987
+ title: {
988
+ label: "页数改变",
989
+ tip: "pagination.showSizeChange | pageSize 变化的回调",
990
+ },
991
+ propType: "func",
992
+ setter: [
993
+ {
994
+ componentName: "FunctionSetter",
995
+ props: {
996
+ template:
997
+ "showSizeChange(current,size,${extParams}){\n// pageSize 变化的回调\nconsole.log('showSizeChange', current, size);\n}",
998
+ },
999
+ },
1000
+ "VariableSetter",
1001
+ ],
1002
+ condition: {
1003
+ type: "JSFunction",
1004
+ value: 'target => !!target.getProps().getPropValue("pagination")',
1005
+ },
1006
+ },
985
1007
  {
986
1008
  name: "pagination.localPagination",
987
1009
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "2.2.34",
3
+ "version": "2.2.35",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -64,8 +64,8 @@
64
64
  "crypto-js": "^4.2.0",
65
65
  "@zxing/library": "0.21.2",
66
66
  "@pisell/utils": "2.0.1",
67
- "@pisell/date-picker": "1.0.100",
68
- "@pisell/icon": "0.0.11"
67
+ "@pisell/icon": "0.0.11",
68
+ "@pisell/date-picker": "1.0.100"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": "^18.0.0",