@pisell/materials 1.0.27 → 1.0.28

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.
Files changed (43) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +159 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +155 -7
  11. package/dist/umd/materials.min.js +1 -1
  12. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
  13. package/es/components/date-picker/index.d.ts.map +1 -1
  14. package/es/components/date-picker/index.js +1 -0
  15. package/es/components/page/index.d.ts.map +1 -1
  16. package/es/components/page/index.js +156 -72
  17. package/es/components/table/Actions/Sort/index.d.ts +3 -3
  18. package/es/components/table/Actions/Sort/index.d.ts.map +1 -1
  19. package/es/components/table/Actions/Sort/index.js +53 -17
  20. package/es/components/table/Actions/index.d.ts.map +1 -1
  21. package/es/components/table/Actions/index.js +7 -1
  22. package/es/components/table/BasicTable/index.d.ts.map +1 -1
  23. package/es/components/table/BasicTable/index.js +1 -2
  24. package/es/components/table/Table/index.d.ts.map +1 -1
  25. package/es/components/table/Table/index.js +0 -1
  26. package/es/components/table/Table/index.less +2 -0
  27. package/es/components/table/index.js +2 -2
  28. package/lib/components/date-picker/index.d.ts.map +1 -1
  29. package/lib/components/page/index.d.ts.map +1 -1
  30. package/lib/components/page/index.js +147 -72
  31. package/lib/components/table/Actions/Sort/index.d.ts +3 -3
  32. package/lib/components/table/Actions/Sort/index.d.ts.map +1 -1
  33. package/lib/components/table/Actions/Sort/index.js +47 -2
  34. package/lib/components/table/Actions/index.d.ts.map +1 -1
  35. package/lib/components/table/Actions/index.js +3 -1
  36. package/lib/components/table/BasicTable/index.d.ts.map +1 -1
  37. package/lib/components/table/BasicTable/index.js +1 -2
  38. package/lib/components/table/Table/index.d.ts.map +1 -1
  39. package/lib/components/table/Table/index.js +0 -1
  40. package/lib/components/table/Table/index.less +2 -0
  41. package/lib/components/table/index.js +2 -2
  42. package/lowcode/table/meta.ts +63 -0
  43. package/package.json +2 -1
@@ -34,89 +34,164 @@ __export(page_exports, {
34
34
  module.exports = __toCommonJS(page_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_config_provider = __toESM(require("../config-provider"));
37
+ var import_AdapterDayjs = require("@pisell/date-picker/es/AdapterDayjs");
38
+ var import_date_picker = require("@pisell/date-picker");
37
39
  var theme = {
38
- components: {
39
- Table: {
40
- colorFillContent: "rgba(0, 0, 0, 0.06)",
41
- colorFillSecondary: "rgba(0, 0, 0, 0.06)",
42
- colorBorderSecondary: "#EAECF0",
43
- colorFillAlter: "rgba(0, 0, 0, 0.02)"
40
+ "components": {
41
+ "Table": {
42
+ "colorFillContent": "#EAECF0",
43
+ "colorFillSecondary": "#F2F4F7",
44
+ "colorBorderSecondary": "#EAECF0",
45
+ "colorFillAlter": "#F9FAFB",
46
+ "controlItemBgHover": "#F9FAFB",
47
+ "colorTextHeading": "#475467",
48
+ "colorTextDescription": "#667085",
49
+ "colorText": "#101828",
50
+ "controlHeight": 32,
51
+ "padding": 24,
52
+ "margin": 16
53
+ },
54
+ "Button": {
55
+ "borderRadiusSM": 6,
56
+ "borderRadiusLG": 9,
57
+ "borderRadius": 8,
58
+ "controlHeight": 36,
59
+ "colorBgContainerDisabled": "#F2F4F7",
60
+ "colorBgTextHover": "#F9FAFB",
61
+ "colorBorder": "#D0D5DD",
62
+ "colorError": "#D92D20",
63
+ "colorErrorActive": "#D92D20",
64
+ "colorErrorHover": "#B42318",
65
+ "colorErrorBg": "#FEF3F2",
66
+ "colorErrorBorderHover": "#FDA29B",
67
+ "colorErrorOutline": "rgba(217, 45, 32, 0.06)",
68
+ "colorLink": "#175CD3",
69
+ "colorLinkActive": "#194185",
70
+ "colorLinkHover": "#1849A9",
71
+ "colorPrimaryActive": "#7f56d9",
72
+ "colorPrimaryBorder": "#E9D7FE",
73
+ "colorText": "#344054",
74
+ "colorTextDisabled": "#D0D5DD",
75
+ "colorTextLightSolid": "#fff",
76
+ "colorBgTextActive": "#D0D5DD",
77
+ "controlOutline": "rgba(127, 86, 217, 0.04)",
78
+ "controlTmpOutline": "#F9FAFB",
79
+ "paddingContentHorizontal": 14,
80
+ "marginXS": 8
81
+ },
82
+ "Divider": {
83
+ "colorSplit": "#EAECF0"
84
+ },
85
+ "Breadcrumb": {
86
+ "itemColor": "#475467",
87
+ "colorTextDescription": "#475467",
88
+ "lastItemColor": "#6941C6",
89
+ "separatorMargin": 12,
90
+ "separatorColor": "#D0D5DD",
91
+ "linkHoverColor": "#1D2939",
92
+ "linkColor": "#475467",
93
+ "colorBgTextHover": "#F9FAFB",
94
+ "paddingXXS": 8
95
+ },
96
+ "Dropdown": {
97
+ "borderRadiusLG": 8,
98
+ // "boxShadowPopoverArrow": "2px 2px 5px rgba(0, 0, 0, 0.05)",
99
+ "controlHeight": 42,
100
+ "fontSize": 14
101
+ },
102
+ "DatePicker": {
103
+ "borderRadius": 8,
104
+ "colorTextPlaceholder": "#667085",
105
+ "colorIcon": "#667085",
106
+ "colorTextQuaternary": "#D0D5DD",
107
+ "colorBgContainerDisabled": "#F9FAFB",
108
+ "colorTextDisabled": "#98A2B3"
44
109
  }
45
110
  },
46
- token: {
47
- colorPrimary: "#7F56D9",
48
- colorPrimaryBg: "#F9F5FF",
49
- colorPrimaryBgHover: "#F4EBFF",
50
- colorPrimaryBorder: "#E9D7FE",
51
- colorPrimaryBorderHover: "#D6BBFB",
52
- colorPrimaryHover: "#6941C6",
53
- colorPrimaryActive: "#53389E",
54
- colorPrimaryTextHover: "#53389E",
55
- colorPrimaryText: "#6941C6",
56
- colorPrimaryTextActive: "#42307D",
57
- colorSuccess: "#079455",
58
- colorSuccessBg: "#ECFDF3",
59
- colorSuccessBgHover: "#DCFAE6",
60
- colorSuccessBorder: "#ABEFC6",
61
- colorSuccessBorderHover: "#75E0A7",
62
- colorSuccessHover: "#067647",
63
- colorSuccessText: "#067647",
64
- colorSuccessActive: "#085D3A",
65
- colorSuccessTextHover: "#085D3A",
66
- colorSuccessTextActive: "#074D31",
67
- colorWarning: "#dc6803",
68
- colorWarningBg: "#FFFAEB",
69
- colorWarningBgHover: "#FEF0C7",
70
- colorWarningBorder: "#FEDF89",
71
- colorWarningBorderHover: "#FEC84B",
72
- colorWarningHover: "#B54708",
73
- colorWarningText: "#B54708",
74
- colorWarningActive: "#93370D",
75
- colorWarningTextHover: "#93370D",
76
- colorWarningTextActive: "#7A2E0E",
77
- colorError: "#d92d20",
78
- colorErrorBg: "#FEF3F2",
79
- colorErrorBgHover: "#FEE4E2",
80
- colorErrorBorder: "#FECDCA",
81
- colorErrorBorderHover: "#FDA29B",
82
- colorErrorHover: "#B42318",
83
- colorErrorText: "#B42318",
84
- colorErrorActive: "#912018",
85
- colorErrorTextHover: "#912018",
86
- colorErrorTextActive: "#7A271A",
87
- colorInfo: "#1570ef",
88
- colorInfoBg: "#EFF8FF",
89
- colorInfoBgHover: "#D1E9FF",
90
- colorInfoBorder: "#B2DDFF",
91
- colorInfoBorderHover: "#84CAFF",
92
- colorInfoHover: "#175CD3",
93
- colorInfoText: "#175CD3",
94
- colorInfoActive: "#1849A9",
95
- colorInfoTextHover: "#1849A9",
96
- colorInfoTextActive: "#194185",
97
- colorText: "#101828",
98
- colorTextSecondary: "#475467",
99
- colorTextTertiary: "#667085",
100
- colorTextQuaternary: "#D0D5DD",
101
- colorBorder: "#D0D5DD",
102
- colorBorderSecondary: "#EAECF0",
103
- colorFill: "#D0D5DD",
104
- colorFillSecondary: "#EAECF0",
105
- colorFillTertiary: "#F2F4F7",
106
- colorFillQuaternary: "#F9FAFB",
107
- colorBgLayout: "#F2F4F7",
108
- colorBgSpotlight: "#101828",
109
- colorBgMask: "rgba(0, 0, 0, 0.5)"
111
+ "token": {
112
+ "colorPrimary": "#7F56D9",
113
+ "colorPrimaryBg": "#F9F5FF",
114
+ "colorPrimaryBgHover": "#F4EBFF",
115
+ "colorPrimaryBorder": "#E9D7FE",
116
+ "colorPrimaryBorderHover": "#D6BBFB",
117
+ "colorPrimaryHover": "#6941C6",
118
+ "colorPrimaryActive": "#53389E",
119
+ "colorPrimaryTextHover": "#53389E",
120
+ "colorPrimaryText": "#6941C6",
121
+ "colorPrimaryTextActive": "#42307D",
122
+ "colorSuccess": "#079455",
123
+ "colorSuccessBg": "#ECFDF3",
124
+ "colorSuccessBgHover": "#DCFAE6",
125
+ "colorSuccessBorder": "#ABEFC6",
126
+ "colorSuccessBorderHover": "#75E0A7",
127
+ "colorSuccessHover": "#067647",
128
+ "colorSuccessText": "#067647",
129
+ "colorSuccessActive": "#085D3A",
130
+ "colorSuccessTextHover": "#085D3A",
131
+ "colorSuccessTextActive": "#074D31",
132
+ "colorWarning": "#dc6803",
133
+ "colorWarningBg": "#FFFAEB",
134
+ "colorWarningBgHover": "#FEF0C7",
135
+ "colorWarningBorder": "#FEDF89",
136
+ "colorWarningBorderHover": "#FEC84B",
137
+ "colorWarningHover": "#B54708",
138
+ "colorWarningText": "#B54708",
139
+ "colorWarningActive": "#93370D",
140
+ "colorWarningTextHover": "#93370D",
141
+ "colorWarningTextActive": "#7A2E0E",
142
+ "colorError": "#d92d20",
143
+ "colorErrorBg": "#FEF3F2",
144
+ "colorErrorBgHover": "#FEE4E2",
145
+ "colorErrorBorder": "#FECDCA",
146
+ "colorErrorBorderHover": "#FDA29B",
147
+ "colorErrorHover": "#B42318",
148
+ "colorErrorText": "#B42318",
149
+ "colorErrorActive": "#912018",
150
+ "colorErrorTextHover": "#912018",
151
+ "colorErrorTextActive": "#7A271A",
152
+ "colorInfo": "#1570ef",
153
+ "colorInfoBg": "#EFF8FF",
154
+ "colorInfoBgHover": "#D1E9FF",
155
+ "colorInfoBorder": "#B2DDFF",
156
+ "colorInfoBorderHover": "#84CAFF",
157
+ "colorInfoHover": "#175CD3",
158
+ "colorInfoText": "#175CD3",
159
+ "colorInfoActive": "#1849A9",
160
+ "colorInfoTextHover": "#1849A9",
161
+ "colorInfoTextActive": "#194185",
162
+ "colorText": "#101828",
163
+ "colorTextSecondary": "#475467",
164
+ "colorTextTertiary": "#667085",
165
+ "colorTextQuaternary": "#D0D5DD",
166
+ "colorBorder": "#D0D5DD",
167
+ "colorBorderSecondary": "#EAECF0",
168
+ "colorFill": "#D0D5DD",
169
+ "colorFillSecondary": "#EAECF0",
170
+ "colorFillTertiary": "#F2F4F7",
171
+ "colorFillQuaternary": "#F9FAFB",
172
+ "colorBgLayout": "#F2F4F7",
173
+ "colorBgSpotlight": "#101828",
174
+ "colorBgMask": "rgba(0, 0, 0, 0.5)",
175
+ "wireframe": false,
176
+ "borderRadius": 8
110
177
  }
111
178
  };
179
+ var _a;
180
+ var datePickerTheme = (0, import_date_picker.createTheme)({
181
+ palette: {
182
+ primary: { main: ((_a = theme.token) == null ? void 0 : _a.colorPrimary) || "#7F56D9" }
183
+ }
184
+ });
112
185
  var Page = (props) => {
186
+ const { children, ...others } = props;
113
187
  return /* @__PURE__ */ import_react.default.createElement(
114
188
  import_config_provider.default,
115
189
  {
116
- ...props,
190
+ ...others,
117
191
  prefixCls: props.prefixCls || "pisell-lowcode",
118
192
  theme: props.theme || theme
119
- }
193
+ },
194
+ /* @__PURE__ */ import_react.default.createElement(import_date_picker.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs }, /* @__PURE__ */ import_react.default.createElement(import_date_picker.ThemeProvider, { theme: datePickerTheme }, children))
120
195
  );
121
196
  };
122
197
  var page_default = Page;
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  export declare type SortItemProps = {
3
- type: "single" | "input";
3
+ type: "date" | "string" | "number";
4
+ label: string;
4
5
  name: string;
5
- props: object;
6
- title: string;
7
6
  };
8
7
  declare type SortListProps = {
9
8
  list: SortItemProps[];
9
+ onChange?: (val: string) => void;
10
10
  };
11
11
  declare const Sort: React.FC<SortListProps>;
12
12
  export default Sort;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,oBAAY,aAAa,GAAG;IAC3B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,aAAK,aAAa,GAAG;IACpB,IAAI,EAAE,aAAa,EAAE,CAAC;CACtB,CAAC;AAaF,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAEjC,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,aAAK,aAAa,GAAG;IACnB,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAmCF,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoBjC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -35,7 +35,52 @@ module.exports = __toCommonJS(Sort_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_icon = require("@pisell/icon");
38
- var Sort = ({ list = [] }) => {
39
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_icon.SwitchVertical01, null) }, "Sort");
38
+ var sortChildrenMap = {
39
+ date: (key) => [
40
+ {
41
+ key: `${key}:desc`,
42
+ label: "Oldest to newest"
43
+ },
44
+ {
45
+ key: `${key}:asc`,
46
+ label: "Newest to oldest"
47
+ }
48
+ ],
49
+ string: (key) => [
50
+ {
51
+ key: `${key}:asc`,
52
+ label: "A to Z"
53
+ },
54
+ {
55
+ key: `${key}:desc`,
56
+ label: "Z to A"
57
+ }
58
+ ],
59
+ number: (key) => [
60
+ {
61
+ key: `${key}:asc`,
62
+ label: "Lowest to highest"
63
+ },
64
+ {
65
+ key: `${key}:desc`,
66
+ label: "Highest to lowest"
67
+ }
68
+ ]
69
+ };
70
+ var Sort = ({ list = [], onChange }) => {
71
+ const sortItems = (0, import_react.useMemo)(() => {
72
+ return list.map((d) => {
73
+ return {
74
+ key: d.name,
75
+ label: d.label,
76
+ children: sortChildrenMap[d.type](d.name)
77
+ };
78
+ });
79
+ }, [list]);
80
+ const onClick = (detail) => {
81
+ var _a;
82
+ onChange == null ? void 0 : onChange((_a = detail == null ? void 0 : detail.keyPath) == null ? void 0 : _a[0]);
83
+ };
84
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Dropdown, { menu: { items: sortItems, onClick } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_icon.SwitchVertical01, null) }, "Sort"));
40
85
  };
41
86
  var Sort_default = Sort;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,QAAA,MAAM,OAAO,qBAAsB,GAAG,uBAerC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAKA,OAAO,cAAc,CAAC;AAEtB,QAAA,MAAM,OAAO,qBAAsB,GAAG,uBAmBrC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -33,12 +33,14 @@ __export(Actions_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Actions_exports);
35
35
  var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
36
37
  var import_QuickFilter = __toESM(require("./Filter/QuickFilter"));
38
+ var import_Sort = __toESM(require("./Sort"));
37
39
  var import_index = require("./index.less");
38
40
  var Actions = ({ filter, sort }) => {
39
41
  const showActions = (0, import_react.useMemo)(() => {
40
42
  return (filter == null ? void 0 : filter.show) || (sort == null ? void 0 : sort.show);
41
43
  }, [filter == null ? void 0 : filter.show, sort == null ? void 0 : sort.show]);
42
- return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_QuickFilter.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { className: "right-wrap" })) : null;
44
+ return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_QuickFilter.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { className: "right-wrap" }, (sort == null ? void 0 : sort.show) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "order_by" }, /* @__PURE__ */ import_react.default.createElement(import_Sort.default, { list: (sort == null ? void 0 : sort.list) || [] })) : null)) : null;
43
45
  };
44
46
  var Actions_default = Actions;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,QAAA,MAAM,UAAU,UAAW,WAAW,GAAG,CAAC,gBA2EzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,QAAA,MAAM,UAAU,UAAW,WAAW,GAAG,CAAC,gBAyEzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -48,7 +48,7 @@ var BasicTable = (props) => {
48
48
  setCurrentPage(1);
49
49
  }, [dataSource]);
50
50
  (0, import_react.useEffect)(() => {
51
- setPageSize(pagination == null ? void 0 : pagination.pageSize);
51
+ (pagination == null ? void 0 : pagination.pageSize) && setPageSize(pagination == null ? void 0 : pagination.pageSize);
52
52
  }, [pagination.pageSize]);
53
53
  const _dataSource = (0, import_react.useMemo)(() => {
54
54
  let list = (dataSource == null ? void 0 : dataSource.list) || [];
@@ -70,7 +70,6 @@ var BasicTable = (props) => {
70
70
  setCurrentPage(page);
71
71
  setPageSize(pageSize2);
72
72
  };
73
- console.log(pagination, "pagination");
74
73
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Table, { ...other, pagination: false, dataSource: _dataSource == null ? void 0 : _dataSource.list }), total > (((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) ? /* @__PURE__ */ import_react.default.createElement(
75
74
  import_Pagination.default,
76
75
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,cAAc,CAAC;AAkBtB,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAwHhC,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,cAAc,CAAC;AAkBtB,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAuHhC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -100,7 +100,6 @@ var GridViewTable = ({ tableProps }) => {
100
100
  }, [defaultColumns]);
101
101
  const showTotal = (0, import_react.useCallback)(
102
102
  (total, range, pageSize) => {
103
- console.log(range, "range");
104
103
  let start = range[0] - 1;
105
104
  let _current = start / pageSize + 1;
106
105
  return `Page ${_current} of ${Math.ceil(
@@ -82,7 +82,7 @@ var GridView = (0, import_model.Provider)((props) => {
82
82
  });
83
83
  }, [filter]);
84
84
  const initialValues = (0, import_react.useMemo)(
85
- () => (filter.list || []).reduce(
85
+ () => ((filter == null ? void 0 : filter.list) || []).reduce(
86
86
  (p, c) => {
87
87
  var _a;
88
88
  return {
@@ -92,7 +92,7 @@ var GridView = (0, import_model.Provider)((props) => {
92
92
  },
93
93
  {}
94
94
  ),
95
- [filter.list]
95
+ [filter == null ? void 0 : filter.list]
96
96
  );
97
97
  return /* @__PURE__ */ import_react.default.createElement(
98
98
  import_antd.Form,
@@ -966,6 +966,69 @@ export default {
966
966
  setter: 'BoolSetter',
967
967
  defaultValue: true,
968
968
  },
969
+ {
970
+ name: "sort.list",
971
+ condition: {
972
+ type: 'JSFunction',
973
+ value: 'target => !!target.getProps().getPropValue("sort.show")',
974
+ },
975
+ setter: {
976
+ componentName: 'ArraySetter',
977
+ props: {
978
+ itemSetter: {
979
+ componentName: 'ObjectSetter',
980
+ props: {
981
+ config: {
982
+ items: [
983
+ {
984
+ name: 'label',
985
+ title: { label: '排序项', tip: '排序项展示文案' },
986
+ propType: 'string',
987
+ setter: 'StringSetter',
988
+ isRequired: true,
989
+ },
990
+ {
991
+ name: 'name',
992
+ title: { label: '字段', tip: '所排序的字段' },
993
+ propType: 'string',
994
+ setter: 'StringSetter',
995
+ isRequired: true,
996
+ },
997
+ {
998
+ name: 'type',
999
+ title: { label: '字段类型', tip: '所排序的字段类型' },
1000
+ propType: 'string',
1001
+ setter: {
1002
+ componentName: 'SelectSetter',
1003
+ mode: "single",
1004
+ defaultValue: "single",
1005
+ props: {
1006
+ options: [
1007
+ {
1008
+ title: '日期排序',
1009
+ value: 'date',
1010
+ },
1011
+ {
1012
+ title: '数字排序',
1013
+ value: 'number',
1014
+ },
1015
+ {
1016
+ title: 'a-z排序',
1017
+ value: 'string',
1018
+ },
1019
+ ],
1020
+ },
1021
+ },
1022
+ },
1023
+ ],
1024
+ },
1025
+ },
1026
+ initialValue: { label: '标题', name: "name", type: "date", },
1027
+ },
1028
+ },
1029
+ },
1030
+ }
1031
+
969
1032
  ]
970
1033
  },
971
1034
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -53,6 +53,7 @@
53
53
  "@dnd-kit/sortable": "^7.0.2",
54
54
  "@dnd-kit/utilities": "^3.2.1",
55
55
  "ahooks": "^3.7.6",
56
+ "@pisell/date-picker": "1.0.0",
56
57
  "@pisell/utils": "1.0.1",
57
58
  "@pisell/icon": "0.0.6"
58
59
  },