@pisell/materials 1.0.439 → 2.0.0

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(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 () {
@@ -1,4 +1,4 @@
1
- export declare const FIELD_VALUE_HEIGHT = 53;
1
+ export declare const FIELD_VALUE_HEIGHT = 55;
2
2
  export declare const FIELD_LABEL_HEIGHT = 26;
3
3
  export declare const TITLE_LENE_HEIGHT = 32;
4
4
  export declare const TITLE_VERTICAL_SPACING = 18;
@@ -1,4 +1,4 @@
1
- export var FIELD_VALUE_HEIGHT = 53;
1
+ export var FIELD_VALUE_HEIGHT = 55;
2
2
  export var FIELD_LABEL_HEIGHT = 26;
3
3
  export var TITLE_LENE_HEIGHT = 32;
4
4
  export var TITLE_VERTICAL_SPACING = 18;
@@ -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(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;
@@ -1,4 +1,4 @@
1
- export declare const FIELD_VALUE_HEIGHT = 53;
1
+ export declare const FIELD_VALUE_HEIGHT = 55;
2
2
  export declare const FIELD_LABEL_HEIGHT = 26;
3
3
  export declare const TITLE_LENE_HEIGHT = 32;
4
4
  export declare const TITLE_VERTICAL_SPACING = 18;
@@ -25,7 +25,7 @@ __export(constant_exports, {
25
25
  TITLE_VERTICAL_SPACING: () => TITLE_VERTICAL_SPACING
26
26
  });
27
27
  module.exports = __toCommonJS(constant_exports);
28
- var FIELD_VALUE_HEIGHT = 53;
28
+ var FIELD_VALUE_HEIGHT = 55;
29
29
  var FIELD_LABEL_HEIGHT = 26;
30
30
  var TITLE_LENE_HEIGHT = 32;
31
31
  var TITLE_VERTICAL_SPACING = 18;
@@ -992,6 +992,28 @@ export default {
992
992
  value: 'target => !!target.getProps().getPropValue("pagination")',
993
993
  },
994
994
  },
995
+ {
996
+ name: "pagination.showSizeChange",
997
+ title: {
998
+ label: "页数改变",
999
+ tip: "pagination.showSizeChange | pageSize 变化的回调",
1000
+ },
1001
+ propType: "func",
1002
+ setter: [
1003
+ {
1004
+ componentName: "FunctionSetter",
1005
+ props: {
1006
+ template:
1007
+ "showSizeChange(current,size,${extParams}){\n// pageSize 变化的回调\nconsole.log('showSizeChange', current, size);\n}",
1008
+ },
1009
+ },
1010
+ "VariableSetter",
1011
+ ],
1012
+ condition: {
1013
+ type: "JSFunction",
1014
+ value: 'target => !!target.getProps().getPropValue("pagination")',
1015
+ },
1016
+ },
995
1017
  {
996
1018
  name: "pagination.localPagination",
997
1019
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.439",
3
+ "version": "2.0.0",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -65,8 +65,8 @@
65
65
  "crypto-js": "^4.2.0",
66
66
  "@zxing/library": "0.21.2",
67
67
  "@pisell/utils": "1.0.42",
68
- "@pisell/date-picker": "1.0.111",
69
- "@pisell/icon": "0.0.10"
68
+ "@pisell/icon": "0.0.10",
69
+ "@pisell/date-picker": "1.0.111"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^18.0.0",