@pisell/materials 1.0.37 → 1.0.38

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 (89) 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 +11 -159
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -155
  11. package/dist/umd/materials.min.css +1 -1
  12. package/dist/umd/materials.min.js +1 -1
  13. package/dist/umd/static/DotsSix.57d66266.svg +1 -0
  14. package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
  15. package/dist/umd/static/help-circle.31c9be40.svg +1 -0
  16. package/es/components/Pagination/index.d.ts +1 -2
  17. package/es/components/Pagination/index.js +1 -44
  18. package/es/components/Pagination/index.less +1 -8
  19. package/es/components/date-picker/index.js +2 -12
  20. package/es/components/page/index.js +72 -156
  21. package/es/components/table/Actions/Filter/FilterItem/index.js +2 -3
  22. package/es/components/table/Actions/Sort/index.d.ts +3 -3
  23. package/es/components/table/Actions/Sort/index.js +17 -53
  24. package/es/components/table/Actions/index.js +5 -6
  25. package/es/components/table/Actions/index.less +0 -2
  26. package/es/components/table/BasicTable/index.js +48 -32
  27. package/es/components/table/Table/fields/index.d.ts +0 -29
  28. package/es/components/table/Table/fields/index.js +2 -5
  29. package/es/components/table/Table/fields/link/Show/index.js +2 -5
  30. package/es/components/table/Table/fields/rangePicker/Edit/index.js +3 -13
  31. package/es/components/table/Table/index.js +4 -4
  32. package/es/components/table/Table/tableConfig/body/CellContent/index.less +1 -0
  33. package/es/components/table/Table/tableConfig/body/CellProvider/index.less +3 -0
  34. package/es/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
  35. package/es/components/table/index.js +4 -21
  36. package/es/components/table/model.js +1 -1
  37. package/es/index.d.ts +63 -64
  38. package/es/index.js +43 -41
  39. package/lib/components/Pagination/index.d.ts +1 -2
  40. package/lib/components/Pagination/index.js +0 -34
  41. package/lib/components/Pagination/index.less +1 -8
  42. package/lib/components/date-picker/index.js +8 -2
  43. package/lib/components/page/index.js +72 -147
  44. package/lib/components/table/Actions/Filter/FilterItem/index.js +2 -2
  45. package/lib/components/table/Actions/Sort/index.d.ts +3 -3
  46. package/lib/components/table/Actions/Sort/index.js +2 -47
  47. package/lib/components/table/Actions/index.js +2 -2
  48. package/lib/components/table/Actions/index.less +0 -2
  49. package/lib/components/table/BasicTable/index.js +25 -31
  50. package/lib/components/table/Table/fields/index.d.ts +0 -29
  51. package/lib/components/table/Table/fields/index.js +2 -5
  52. package/lib/components/table/Table/fields/link/Show/index.js +2 -11
  53. package/lib/components/table/Table/fields/rangePicker/Edit/index.js +1 -6
  54. package/lib/components/table/Table/index.js +6 -4
  55. package/lib/components/table/Table/tableConfig/body/CellContent/index.less +1 -0
  56. package/lib/components/table/Table/tableConfig/body/CellProvider/index.less +3 -0
  57. package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
  58. package/lib/components/table/index.js +3 -21
  59. package/lib/components/table/model.js +1 -1
  60. package/lib/index.d.ts +63 -64
  61. package/lib/index.js +0 -3
  62. package/lowcode/filter/meta.ts +137 -0
  63. package/package.json +2 -2
  64. package/es/components/table/Table/fields/search/Config/index.d.ts +0 -3
  65. package/es/components/table/Table/fields/search/Config/index.js +0 -4
  66. package/es/components/table/Table/fields/search/Edit/index.d.ts +0 -4
  67. package/es/components/table/Table/fields/search/Edit/index.js +0 -28
  68. package/es/components/table/Table/fields/search/Edit/index.less +0 -0
  69. package/es/components/table/Table/fields/search/Show/index.d.ts +0 -4
  70. package/es/components/table/Table/fields/search/Show/index.js +0 -16
  71. package/es/components/table/Table/fields/search/Show/index.less +0 -0
  72. package/es/components/table/Table/fields/search/Sort/index.d.ts +0 -3
  73. package/es/components/table/Table/fields/search/Sort/index.js +0 -4
  74. package/es/components/table/Table/fields/search/index.d.ts +0 -14
  75. package/es/components/table/Table/fields/search/index.js +0 -17
  76. package/es/components/table/Table/fields/search/index.less +0 -0
  77. package/lib/components/table/Table/fields/search/Config/index.d.ts +0 -3
  78. package/lib/components/table/Table/fields/search/Config/index.js +0 -28
  79. package/lib/components/table/Table/fields/search/Edit/index.d.ts +0 -4
  80. package/lib/components/table/Table/fields/search/Edit/index.js +0 -51
  81. package/lib/components/table/Table/fields/search/Edit/index.less +0 -0
  82. package/lib/components/table/Table/fields/search/Show/index.d.ts +0 -4
  83. package/lib/components/table/Table/fields/search/Show/index.js +0 -37
  84. package/lib/components/table/Table/fields/search/Show/index.less +0 -0
  85. package/lib/components/table/Table/fields/search/Sort/index.d.ts +0 -3
  86. package/lib/components/table/Table/fields/search/Sort/index.js +0 -28
  87. package/lib/components/table/Table/fields/search/index.d.ts +0 -14
  88. package/lib/components/table/Table/fields/search/index.js +0 -51
  89. package/lib/components/table/Table/fields/search/index.less +0 -0
@@ -34,164 +34,89 @@ __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");
39
37
  var theme = {
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"
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)"
109
44
  }
110
45
  },
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
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)"
177
110
  }
178
111
  };
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
- });
185
112
  var Page = (props) => {
186
- const { children, ...others } = props;
187
113
  return /* @__PURE__ */ import_react.default.createElement(
188
114
  import_config_provider.default,
189
115
  {
190
- ...others,
116
+ ...props,
191
117
  prefixCls: props.prefixCls || "pisell-lowcode",
192
118
  theme: props.theme || theme
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))
119
+ }
195
120
  );
196
121
  };
197
122
  var page_default = Page;
@@ -37,11 +37,11 @@ var import_antd = require("antd");
37
37
  var import_fields = require("../../../Table/fields");
38
38
  var import_index = require("./index.less");
39
39
  var FilterItem = (props) => {
40
- const { label, type, name, other } = props;
40
+ const { label, type, name } = props;
41
41
  const Com = (0, import_react.useMemo)(() => {
42
42
  var _a;
43
43
  return (_a = import_fields.fieldMaps[type]) == null ? void 0 : _a.edit;
44
44
  }, [type]);
45
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label, name }, /* @__PURE__ */ import_react.default.createElement(Com, { ...other }));
45
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label, name }, /* @__PURE__ */ import_react.default.createElement(Com, null));
46
46
  };
47
47
  var FilterItem_default = FilterItem;
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  export declare type SortItemProps = {
3
- type: "date" | "string" | "number";
4
- label: string;
3
+ type: "single" | "input";
5
4
  name: string;
5
+ props: object;
6
+ title: string;
6
7
  };
7
8
  declare type SortListProps = {
8
9
  list: SortItemProps[];
9
- onChange?: (val: string) => void;
10
10
  };
11
11
  declare const Sort: React.FC<SortListProps>;
12
12
  export default Sort;
@@ -35,52 +35,7 @@ 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 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"));
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");
85
40
  };
86
41
  var Sort_default = Sort;
@@ -33,7 +33,7 @@ __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
+ var import_Filter = __toESM(require("./Filter"));
37
37
  var import_QuickFilter = __toESM(require("./Filter/QuickFilter"));
38
38
  var import_Sort = __toESM(require("./Sort"));
39
39
  var import_index = require("./index.less");
@@ -41,6 +41,6 @@ var Actions = ({ filter, sort }) => {
41
41
  const showActions = (0, import_react.useMemo)(() => {
42
42
  return (filter == null ? void 0 : filter.show) || (sort == null ? void 0 : sort.show);
43
43
  }, [filter == null ? void 0 : filter.show, sort == null ? void 0 : sort.show]);
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", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_Sort.default, { list: (sort == null ? void 0 : sort.list) || [] })) : null)) : 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" }, (filter == null ? void 0 : filter.show) ? /* @__PURE__ */ import_react.default.createElement(import_Filter.default, { list: (filter == null ? void 0 : filter.list) || [] }) : null, (sort == null ? void 0 : sort.show) ? /* @__PURE__ */ import_react.default.createElement(import_Sort.default, { list: (sort == null ? void 0 : sort.list) || [] }) : null)) : null;
45
45
  };
46
46
  var Actions_default = Actions;
@@ -3,13 +3,11 @@
3
3
  align-items: center;
4
4
  justify-content: space-between;
5
5
  margin-bottom: 16px;
6
- gap: 16px;
7
6
 
8
7
  .left-wrap {
9
8
  flex: 1;
10
9
  display: flex;
11
10
  align-items: center;
12
-
13
11
  .pisell-lowcode-form-item {
14
12
  margin-bottom: 0;
15
13
  }
@@ -34,50 +34,44 @@ __export(BasicTable_exports, {
34
34
  module.exports = __toCommonJS(BasicTable_exports);
35
35
  var import_antd = require("antd");
36
36
  var import_react = __toESM(require("react"));
37
- var import_Pagination = require("../../Pagination");
37
+ var import_Pagination = __toESM(require("../../Pagination"));
38
38
  var BasicTable = (props) => {
39
- var _a;
40
- const { dataSource, pagination, value, ...other } = props;
41
- const form = import_antd.Form.useFormInstance();
42
- const formPagination = import_antd.Form.useWatch("pagination", form) || {
43
- page: 1,
44
- size: 10
45
- };
46
- const { showTotal } = pagination;
47
- const _showTotal = (0, import_react.useCallback)(
48
- (total2, range) => {
49
- let _size = formPagination.size;
50
- return showTotal(total2, range, _size);
51
- },
52
- [showTotal, formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]
53
- );
39
+ const { dataSource, pagination, ...other } = props;
40
+ const [currentPage, setCurrentPage] = (0, import_react.useState)(1);
41
+ const [pageSize, setPageSize] = (0, import_react.useState)(10);
42
+ (0, import_react.useEffect)(() => {
43
+ setCurrentPage(1);
44
+ }, [dataSource]);
54
45
  const _dataSource = (0, import_react.useMemo)(() => {
55
- let _page = formPagination.page;
56
- let _size = formPagination.size;
57
- let list = [];
58
- let _total = total;
59
- if (dataSource.length > _size) {
60
- list = dataSource;
61
- _total = list.length;
62
- list = list.slice((_page - 1) * _size, _page * _size);
63
- } else {
46
+ let list = (dataSource == null ? void 0 : dataSource.list) || [];
47
+ let total2 = (dataSource == null ? void 0 : dataSource.total) || 0;
48
+ if (Array.isArray(dataSource)) {
64
49
  list = dataSource;
50
+ total2 = list.length;
65
51
  }
52
+ list = list.slice((currentPage - 1) * pageSize, currentPage * pageSize);
66
53
  return {
67
54
  list,
68
- total: _total
55
+ total: total2
69
56
  };
70
- }, [dataSource, formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]);
57
+ }, [dataSource, currentPage, pageSize]);
71
58
  const total = (0, import_react.useMemo)(() => {
72
59
  return (pagination == null ? void 0 : pagination.total) || (_dataSource == null ? void 0 : _dataSource.total) || 0;
73
60
  }, [dataSource, pagination]);
74
- 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(import_antd.Form.Item, { name: "pagination" }, /* @__PURE__ */ import_react.default.createElement(
75
- import_Pagination.FormPagination,
61
+ const onPaginationChange = (page, pageSize2) => {
62
+ setCurrentPage(page);
63
+ setPageSize(pageSize2);
64
+ };
65
+ 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 > pageSize ? /* @__PURE__ */ import_react.default.createElement(
66
+ import_Pagination.default,
76
67
  {
77
68
  ...pagination,
78
- showTotal: _showTotal,
69
+ current: currentPage,
70
+ pageSize,
71
+ onShowSizeChange: onPaginationChange,
72
+ onChange: onPaginationChange,
79
73
  total
80
74
  }
81
- )) : null);
75
+ ) : null);
82
76
  };
83
77
  var BasicTable_default = BasicTable;
@@ -84,18 +84,6 @@ export declare const fieldMaps: {
84
84
  sort: () => JSX.Element;
85
85
  show: (props: import("./types").FieldPropsType) => JSX.Element;
86
86
  };
87
- search: {
88
- field: {
89
- field_icon: string;
90
- field_name: string;
91
- field_type: string;
92
- default_value: string;
93
- };
94
- config: () => JSX.Element;
95
- edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
96
- sort: () => JSX.Element;
97
- show: (props: import("./types").FieldPropsType) => JSX.Element;
98
- };
99
87
  };
100
88
  export declare const fieldList: ({
101
89
  field_icon: string;
@@ -132,11 +120,6 @@ export declare const fieldList: ({
132
120
  field_name: string;
133
121
  field_type: string;
134
122
  default_value: string;
135
- } | {
136
- field_icon: string;
137
- field_name: string;
138
- field_type: string;
139
- default_value: string;
140
123
  })[];
141
124
  export declare const getFieldByType: (type: string) => {
142
125
  field: {
@@ -235,17 +218,5 @@ declare const _default: {
235
218
  sort: () => JSX.Element;
236
219
  show: (props: import("./types").FieldPropsType) => JSX.Element;
237
220
  };
238
- search: {
239
- field: {
240
- field_icon: string;
241
- field_name: string;
242
- field_type: string;
243
- default_value: string;
244
- };
245
- config: () => JSX.Element;
246
- edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
247
- sort: () => JSX.Element;
248
- show: (props: import("./types").FieldPropsType) => JSX.Element;
249
- };
250
221
  };
251
222
  export default _default;
@@ -42,7 +42,6 @@ var import_select = __toESM(require("./select"));
42
42
  var import_text = __toESM(require("./text"));
43
43
  var import_image = __toESM(require("./image"));
44
44
  var import_rangePicker = __toESM(require("./rangePicker"));
45
- var import_search = __toESM(require("./search"));
46
45
  var fieldMaps = {
47
46
  text: import_text.default,
48
47
  link: import_link.default,
@@ -50,8 +49,7 @@ var fieldMaps = {
50
49
  date: import_date.default,
51
50
  select: import_select.default,
52
51
  image: import_image.default,
53
- rangePicker: import_rangePicker.default,
54
- search: import_search.default
52
+ rangePicker: import_rangePicker.default
55
53
  };
56
54
  var fieldList = Object.values(fieldMaps).map((d) => {
57
55
  return d.field;
@@ -66,8 +64,7 @@ var fields_default = {
66
64
  date: import_date.default,
67
65
  select: import_select.default,
68
66
  image: import_image.default,
69
- rangePicker: import_rangePicker.default,
70
- search: import_search.default
67
+ rangePicker: import_rangePicker.default
71
68
  };
72
69
  // Annotate the CommonJS export names for ESM import in node:
73
70
  0 && (module.exports = {
@@ -38,20 +38,11 @@ var Show = (props) => {
38
38
  if ((0, import_utils.isString)(record[dataIndex])) {
39
39
  return {
40
40
  content: record[dataIndex],
41
- url: record[dataIndex]
41
+ url: ""
42
42
  };
43
43
  }
44
44
  return record[dataIndex];
45
45
  }, [record, dataIndex]);
46
- return /* @__PURE__ */ React.createElement(
47
- "a",
48
- {
49
- className: "",
50
- href: field.url,
51
- target: "_blank",
52
- onClick: (e) => e.stopPropagation()
53
- },
54
- field.content
55
- );
46
+ return /* @__PURE__ */ React.createElement("a", { className: "", href: field.url, target: "_blank" }, field.content);
56
47
  };
57
48
  var Show_default = Show;
@@ -46,9 +46,7 @@ var Edit = (props, ref) => {
46
46
  style,
47
47
  bordered,
48
48
  presets,
49
- showTime,
50
- format,
51
- ...others
49
+ showTime
52
50
  } = props;
53
51
  const dayjsVal = (0, import_react.useMemo)(() => {
54
52
  if ((0, import_utils.isString)(value)) {
@@ -64,7 +62,6 @@ var Edit = (props, ref) => {
64
62
  }, [value]);
65
63
  const rangePresets = [
66
64
  { label: "Today", value: [(0, import_dayjs.default)().startOf("day"), (0, import_dayjs.default)().endOf("day")] },
67
- { label: "Yesterday", value: [(0, import_dayjs.default)().add(-1, "d").startOf("day"), (0, import_dayjs.default)().add(-1, "d").endOf("day")] },
68
65
  { label: "Last 3 Days", value: [(0, import_dayjs.default)().add(-3, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")] },
69
66
  { label: "Last 7 Days", value: [(0, import_dayjs.default)().add(-7, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")] },
70
67
  { label: "Last 14 Days", value: [(0, import_dayjs.default)().add(-14, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")] },
@@ -80,8 +77,6 @@ var Edit = (props, ref) => {
80
77
  return /* @__PURE__ */ React.createElement(
81
78
  RangePicker,
82
79
  {
83
- ...others,
84
- format,
85
80
  showTime: _showTime,
86
81
  presets: presets || rangePresets,
87
82
  ref,
@@ -99,12 +99,14 @@ var GridViewTable = ({ tableProps }) => {
99
99
  });
100
100
  }, [defaultColumns]);
101
101
  const showTotal = (0, import_react.useCallback)(
102
- (total, range, pageSize) => {
102
+ (total, range) => {
103
103
  let start = range[0] - 1;
104
- let _current = start / pageSize + 1;
105
- return `Page ${_current} of ${Math.ceil(total / pageSize)}`;
104
+ let _current = start / tableProps.pagination.pageSize + 1;
105
+ return `Page ${_current} of ${Math.ceil(
106
+ total / tableProps.pagination.pageSize
107
+ )}`;
106
108
  },
107
- []
109
+ [tableProps.pagination.pageSize]
108
110
  );
109
111
  const _paginationConfig = (0, import_react.useMemo)(() => {
110
112
  if (tableProps.pagination === false) {
@@ -1,5 +1,6 @@
1
1
  .cell-provider {
2
2
  position: relative;
3
+ cursor: pointer;
3
4
  width: 100%;
4
5
  height: 100%;
5
6
  display: flex;
@@ -1,4 +1,6 @@
1
1
  .cell-provider {
2
+ position: relative;
3
+ cursor: pointer;
2
4
  width: 100%;
3
5
  height: 100%;
4
6
  display: flex;
@@ -6,6 +8,7 @@
6
8
  justify-content: center;
7
9
  border-radius: 4px;
8
10
  padding: 12px;
11
+ // cursor: pointer;
9
12
 
10
13
  &.focus {
11
14
  box-shadow: var(--theme-color) 0px 0px 0px 1px !important;
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  .materials-grid-table-header-cell-content {
13
- // padding-right: 10px;
13
+ padding-right: 10px;
14
14
  flex: auto;
15
15
  font-weight: 600;
16
16
  font-size: 14px;