@pisell/materials 1.0.404 → 1.0.405

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 (141) hide show
  1. package/build/lowcode/assets-daily.json +13 -13
  2. package/build/lowcode/assets-dev.json +4 -4
  3. package/build/lowcode/assets-prod.json +13 -13
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  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 +59 -16
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +62 -19
  11. package/es/components/browserSelect/chevron-down.png +0 -0
  12. package/es/components/browserSelect/index.d.ts +15 -0
  13. package/es/components/browserSelect/index.js +36 -0
  14. package/es/components/browserSelect/index.less +18 -0
  15. package/es/components/date-picker/constants.d.ts +39 -0
  16. package/es/components/date-picker/constants.js +76 -0
  17. package/es/components/date-picker/datePickerCpt.d.ts +8 -0
  18. package/es/components/date-picker/datePickerCpt.js +370 -0
  19. package/es/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
  20. package/es/components/date-picker/hooks/useMediaQuery.js +28 -0
  21. package/es/components/date-picker/index.js +2 -2
  22. package/es/components/date-picker/index.less +1880 -0
  23. package/es/components/drag-sort-tree/index.d.ts +0 -1
  24. package/es/components/drag-sort-tree/index.js +2 -1
  25. package/es/components/picker-view/index.d.ts +2 -0
  26. package/es/components/picker-view/index.js +2 -0
  27. package/es/components/pisell-config-provider/index.js +2 -0
  28. package/es/components/pisellModal/components/functions/index.d.ts +23 -5
  29. package/es/components/pisellModal/components/functions/index.js +7 -2
  30. package/es/components/pisellModal/index.d.ts +20 -5
  31. package/es/components/pisellTags/index.d.ts +13 -0
  32. package/es/components/pisellTags/index.js +83 -0
  33. package/es/components/pisellTags/index.less +17 -0
  34. package/es/components/pisellTags/utils.d.ts +1 -0
  35. package/es/components/pisellTags/utils.js +89 -0
  36. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
  37. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +30 -26
  38. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +3 -1
  39. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
  40. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +25 -21
  41. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
  42. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +34 -31
  43. package/es/components/table/Actions/component/ExportImport/index.d.ts +3 -3
  44. package/es/components/table/Actions/component/ExportImport/index.js +32 -25
  45. package/es/components/table/BasicTable/index.js +5 -3
  46. package/es/components/table/Gallery/index.js +2 -1
  47. package/es/components/table/Table/fields/rangePicker/Edit/index.js +13 -11
  48. package/es/components/table/Table/index.d.ts +2 -2
  49. package/es/components/table/Table/index.js +68 -42
  50. package/es/components/table/Table/index.less +3 -0
  51. package/es/components/table/Table/utils.d.ts +14 -2
  52. package/es/components/table/Table/utils.js +6 -2
  53. package/es/components/table/View/index.d.ts +2 -2
  54. package/es/components/table/View/index.js +27 -16
  55. package/es/components/table/hooks/useGenScroll.js +1 -1
  56. package/es/components/table/hooks/useTableSetting.js +29 -7
  57. package/es/components/table/hooks/useTransDataSource.d.ts +1 -0
  58. package/es/components/table/hooks/useTransDataSource.js +8 -6
  59. package/es/components/table/index.js +7 -5
  60. package/es/components/table/index.less +9 -0
  61. package/es/components/table/serve.d.ts +1 -0
  62. package/es/components/table/serve.js +38 -7
  63. package/es/components/table/types.d.ts +2 -0
  64. package/es/index.d.ts +3 -1
  65. package/es/index.js +3 -1
  66. package/es/locales/en-US.d.ts +12 -0
  67. package/es/locales/en-US.js +13 -0
  68. package/es/locales/zh-CN.d.ts +12 -0
  69. package/es/locales/zh-CN.js +13 -0
  70. package/es/locales/zh-TW.d.ts +12 -0
  71. package/es/locales/zh-TW.js +13 -0
  72. package/lib/components/browserSelect/chevron-down.png +0 -0
  73. package/lib/components/browserSelect/index.d.ts +15 -0
  74. package/lib/components/browserSelect/index.js +59 -0
  75. package/lib/components/browserSelect/index.less +18 -0
  76. package/lib/components/date-picker/constants.d.ts +39 -0
  77. package/lib/components/date-picker/constants.js +78 -0
  78. package/lib/components/date-picker/datePickerCpt.d.ts +8 -0
  79. package/lib/components/date-picker/datePickerCpt.js +403 -0
  80. package/lib/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
  81. package/lib/components/date-picker/hooks/useMediaQuery.js +43 -0
  82. package/lib/components/date-picker/index.js +2 -2
  83. package/lib/components/date-picker/index.less +1880 -0
  84. package/lib/components/drag-sort-tree/index.d.ts +0 -1
  85. package/lib/components/drag-sort-tree/index.js +0 -1
  86. package/lib/components/picker-view/index.d.ts +2 -0
  87. package/lib/components/picker-view/index.js +36 -0
  88. package/lib/components/pisell-config-provider/index.js +2 -0
  89. package/lib/components/pisellModal/components/functions/index.d.ts +23 -5
  90. package/lib/components/pisellModal/components/functions/index.js +13 -7
  91. package/lib/components/pisellModal/index.d.ts +20 -5
  92. package/lib/components/pisellTags/index.d.ts +13 -0
  93. package/lib/components/pisellTags/index.js +113 -0
  94. package/lib/components/pisellTags/index.less +17 -0
  95. package/lib/components/pisellTags/utils.d.ts +1 -0
  96. package/lib/components/pisellTags/utils.js +86 -0
  97. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
  98. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +6 -2
  99. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +2 -1
  100. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
  101. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +6 -2
  102. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
  103. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +4 -2
  104. package/lib/components/table/Actions/component/ExportImport/index.d.ts +3 -3
  105. package/lib/components/table/Actions/component/ExportImport/index.js +13 -8
  106. package/lib/components/table/BasicTable/index.js +2 -3
  107. package/lib/components/table/Gallery/index.js +2 -1
  108. package/lib/components/table/Table/fields/rangePicker/Edit/index.js +1 -9
  109. package/lib/components/table/Table/index.d.ts +2 -2
  110. package/lib/components/table/Table/index.js +61 -34
  111. package/lib/components/table/Table/index.less +3 -0
  112. package/lib/components/table/Table/utils.d.ts +14 -2
  113. package/lib/components/table/Table/utils.js +7 -1
  114. package/lib/components/table/View/index.d.ts +2 -2
  115. package/lib/components/table/View/index.js +28 -19
  116. package/lib/components/table/hooks/useGenScroll.js +1 -1
  117. package/lib/components/table/hooks/useTableSetting.js +26 -11
  118. package/lib/components/table/hooks/useTransDataSource.d.ts +1 -0
  119. package/lib/components/table/hooks/useTransDataSource.js +6 -5
  120. package/lib/components/table/index.js +4 -4
  121. package/lib/components/table/index.less +9 -0
  122. package/lib/components/table/serve.d.ts +1 -0
  123. package/lib/components/table/serve.js +24 -4
  124. package/lib/components/table/types.d.ts +2 -0
  125. package/lib/index.d.ts +3 -1
  126. package/lib/index.js +6 -0
  127. package/lib/locales/en-US.d.ts +12 -0
  128. package/lib/locales/en-US.js +13 -0
  129. package/lib/locales/zh-CN.d.ts +12 -0
  130. package/lib/locales/zh-CN.js +13 -0
  131. package/lib/locales/zh-TW.d.ts +12 -0
  132. package/lib/locales/zh-TW.js +13 -0
  133. package/package.json +1 -1
  134. package/dist/umd/materials.min.css +0 -1
  135. package/dist/umd/materials.min.js +0 -1
  136. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  137. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  138. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  139. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  140. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  141. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
@@ -71,7 +71,8 @@ var Gallery = (props) => {
71
71
  form,
72
72
  localPagination: !!(pagination == null ? void 0 : pagination.localPagination),
73
73
  rowKey,
74
- filter
74
+ filter,
75
+ currentView: "gallery"
75
76
  });
76
77
  (0, import_react.useEffect)(() => {
77
78
  onDataSourceChange == null ? void 0 : onDataSourceChange(dataSource);
@@ -94,20 +94,12 @@ var Edit = (props, ref) => {
94
94
  value: [(0, import_dayjs.default)().add(-90, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
95
95
  }
96
96
  ];
97
- const _showTime = (0, import_react.useMemo)(() => {
98
- if ((0, import_utils.isBoolean)(showTime)) {
99
- return showTime;
100
- } else if (typeof showTime === "object") {
101
- return showTime;
102
- }
103
- return true;
104
- }, [showTime]);
105
97
  return /* @__PURE__ */ import_react.default.createElement(
106
98
  RangePicker,
107
99
  {
108
100
  ...others,
109
101
  format,
110
- showTime: _showTime,
102
+ showTime,
111
103
  presets: presets || rangePresets,
112
104
  ref,
113
105
  value: dayjsVal,
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  declare const _default: React.NamedExoticComponent<any>;
4
4
  export default _default;
@@ -52,13 +52,11 @@ var GridViewTable = ({
52
52
  setTableSetting,
53
53
  onDataSourceChange
54
54
  }) => {
55
- var _a, _b, _c, _d, _e, _f;
56
- const responsive = (0, import_hooks.useResponsive)();
55
+ var _a, _b;
57
56
  const { state, dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
58
57
  const form = import_antd.Form.useFormInstance();
59
58
  const column_setting = import_antd.Form.useWatch("column_setting", { form, preserve: true }) || [];
60
59
  const tableWrapRef = (0, import_react.useRef)(null);
61
- const { height } = (0, import_ahooks.useSize)(tableWrapRef) || {};
62
60
  const { dataSource: defaultDataSource, originDataSource } = state;
63
61
  const handleSave = (0, import_ahooks.useMemoizedFn)((row) => {
64
62
  const newData = [...defaultDataSource];
@@ -96,7 +94,8 @@ var GridViewTable = ({
96
94
  form,
97
95
  localPagination: !!((_b = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b.localPagination),
98
96
  rowKey: tableProps.rowKey,
99
- filter
97
+ filter,
98
+ currentView: "table"
100
99
  });
101
100
  (0, import_react.useEffect)(() => {
102
101
  dispatch({
@@ -110,25 +109,6 @@ var GridViewTable = ({
110
109
  const components = (0, import_useGenTableComponents.default)({
111
110
  form
112
111
  });
113
- const isShowPagination = (0, import_react.useMemo)(() => {
114
- var _a2, _b2, _c2, _d2;
115
- let total = ((_a2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a2.total) || (dataSource == null ? void 0 : dataSource.length) || 0;
116
- if ((_b2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b2.localPagination) {
117
- total = (dataSource == null ? void 0 : dataSource.length) || 0;
118
- }
119
- return total > (((_d2 = (_c2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c2.pageSizeOptions) == null ? void 0 : _d2[0]) || 10);
120
- }, [
121
- (_c = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c.localPagination,
122
- (_d = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _d.total,
123
- dataSource.length,
124
- (_f = (_e = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _e.pageSizeOptions) == null ? void 0 : _f[0]
125
- ]);
126
- const scroll = (0, import_useGenScroll.default)({
127
- wrapHeight: height || 500,
128
- scroll: tableProps.scroll,
129
- columns,
130
- isShowPagination
131
- });
132
112
  const showTotal = (0, import_react.useCallback)(
133
113
  (total, range, pageSize) => {
134
114
  let start = range[0] - 1;
@@ -149,26 +129,73 @@ var GridViewTable = ({
149
129
  ...tableProps.pagination,
150
130
  showTotal
151
131
  };
152
- }, [responsive, tableProps.pagination]);
132
+ }, [tableProps.pagination]);
153
133
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-table-wrap", ref: tableWrapRef }, /* @__PURE__ */ import_react.default.createElement(
154
- import_SortRow.default,
134
+ AutoSizerContent,
155
135
  {
156
- rowKey: tableProps.rowKey,
157
- onSortChange: tableProps.onSortChange
158
- },
159
- /* @__PURE__ */ import_react.default.createElement(
136
+ tableWrapRef,
137
+ dataSource,
138
+ tableProps,
139
+ columns,
140
+ paginationConfig: _paginationConfig,
141
+ components
142
+ }
143
+ ));
144
+ };
145
+ var AutoSizerContent = (props) => {
146
+ var _a, _b, _c, _d;
147
+ const {
148
+ tableProps,
149
+ dataSource,
150
+ paginationConfig: paginationConfig2,
151
+ columns,
152
+ components,
153
+ tableWrapRef
154
+ } = props;
155
+ const { height } = (0, import_ahooks.useSize)(tableWrapRef) || {};
156
+ const debouncedHeight = (0, import_ahooks.useDebounce)(height, { wait: 500 });
157
+ const isShowPagination = (0, import_react.useMemo)(() => {
158
+ var _a2, _b2, _c2, _d2, _e, _f;
159
+ let total = ((_a2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a2.total) || (dataSource == null ? void 0 : dataSource.length) || 0;
160
+ if ((_b2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b2.localPagination) {
161
+ total = (dataSource == null ? void 0 : dataSource.length) || 0;
162
+ }
163
+ return total > (((_c2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c2.pageSize) || ((_e = (_d2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _d2.pageSizeOptions) == null ? void 0 : _e[0]) || 10) || ((_f = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _f.showPagination) && total > 10;
164
+ }, [
165
+ (_a = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a.localPagination,
166
+ (_b = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b.total,
167
+ dataSource.length,
168
+ (_d = (_c = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c.pageSizeOptions) == null ? void 0 : _d[0]
169
+ ]);
170
+ const scroll = (0, import_useGenScroll.default)({
171
+ wrapHeight: debouncedHeight || 500,
172
+ scroll: tableProps.scroll,
173
+ columns,
174
+ isShowPagination
175
+ });
176
+ const debouncedScroll = (0, import_ahooks.useDebounce)(scroll, { wait: 200 });
177
+ const basicTable = (0, import_react.useMemo)(() => {
178
+ return /* @__PURE__ */ import_react.default.createElement(
160
179
  import_BasicTable.default,
161
180
  {
162
- key: scroll == null ? void 0 : scroll.y,
181
+ key: debouncedScroll,
163
182
  dataSource,
164
183
  columns,
165
184
  className: "grid-view-table",
166
185
  components,
167
186
  ...tableProps,
168
- scroll,
169
- pagination: _paginationConfig
187
+ scroll: debouncedScroll,
188
+ pagination: paginationConfig2
170
189
  }
171
- )
172
- ));
190
+ );
191
+ }, [
192
+ debouncedScroll,
193
+ dataSource,
194
+ columns,
195
+ components,
196
+ paginationConfig2,
197
+ tableProps
198
+ ]);
199
+ return /* @__PURE__ */ import_react.default.createElement(import_SortRow.default, { rowKey: tableProps.rowKey, onSortChange: tableProps.onSortChange }, basicTable);
173
200
  };
174
201
  var Table_default = (0, import_react.memo)(GridViewTable);
@@ -29,4 +29,7 @@
29
29
 
30
30
  .materials-grid-table-wrap {
31
31
  flex: 1;
32
+ // 使用overflow hidden 计算 materials-grid-table-wrap高度时不会动态变更
33
+ overflow: hidden;
34
+ padding-bottom: 24px;
32
35
  }
@@ -81,7 +81,10 @@ export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj,
81
81
  }>;
82
82
  currentViewMode: ModeType;
83
83
  currentSettingHash: string;
84
- }) => void;
84
+ }) => {
85
+ key: string;
86
+ value: Record<string, any>;
87
+ } | undefined;
85
88
  export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
86
89
  /**
87
90
  * 从本地存储中获取表格设置, 全部配置
@@ -112,7 +115,16 @@ export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, c
112
115
  keys?: string[] | undefined;
113
116
  currentViewMode: ModeType;
114
117
  currentSettingHash: string;
115
- }) => void;
118
+ }) => {
119
+ key: string;
120
+ value: Record<string, any>;
121
+ } | undefined;
122
+ /**
123
+ * 获取表格键值
124
+ * @param tableId 表格ID
125
+ * @returns 返回格式化后的表格键值
126
+ */
127
+ export declare const getTableKey: (tableId: string) => string;
116
128
  /**
117
129
  * 合并筛选设置
118
130
  * @param list 列表数据
@@ -36,6 +36,7 @@ __export(utils_exports, {
36
36
  getHash: () => getHash,
37
37
  getIdByRowKey: () => getIdByRowKey,
38
38
  getSettingKeyArrByMode: () => getSettingKeyArrByMode,
39
+ getTableKey: () => getTableKey,
39
40
  getTableSettingByCurrentViewMode: () => getTableSettingByCurrentViewMode,
40
41
  getTableSettingFromLocalStorage: () => getTableSettingFromLocalStorage,
41
42
  groupDataSource: () => groupDataSource,
@@ -270,6 +271,10 @@ var setTableSettingToLocalStorage = ({
270
271
  }
271
272
  };
272
273
  localStorage.setItem(getTableKey(tableId), JSON.stringify(newData));
274
+ return {
275
+ key: getTableKey(tableId),
276
+ value: newData
277
+ };
273
278
  };
274
279
  var clearTableSettingToLocalStorage = (tableId) => {
275
280
  if (!tableId)
@@ -306,7 +311,7 @@ var setFormValuesToLocalStorage = ({
306
311
  keys == null ? void 0 : keys.forEach((key) => {
307
312
  obj[key] = allValues == null ? void 0 : allValues[key];
308
313
  });
309
- setTableSettingToLocalStorage({
314
+ return setTableSettingToLocalStorage({
310
315
  tableId,
311
316
  tableSettingObj: obj,
312
317
  currentViewMode,
@@ -460,6 +465,7 @@ var stringify = (obj) => {
460
465
  getHash,
461
466
  getIdByRowKey,
462
467
  getSettingKeyArrByMode,
468
+ getTableKey,
463
469
  getTableSettingByCurrentViewMode,
464
470
  getTableSettingFromLocalStorage,
465
471
  groupDataSource,
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { GridViewProps } from "../types";
1
+ import React from 'react';
2
+ import { GridViewProps } from '../types';
3
3
  declare const View: (props: GridViewProps & {
4
4
  setTableSetting: (values: Record<string, any>) => void;
5
5
  }) => React.JSX.Element;
@@ -36,6 +36,8 @@ var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_Table = __toESM(require("../Table"));
38
38
  var import_Gallery = __toESM(require("../Gallery"));
39
+ var import_utils = require("../Table/utils");
40
+ var import_ahooks = require("ahooks");
39
41
  var View = (props) => {
40
42
  const {
41
43
  dataSource,
@@ -62,24 +64,31 @@ var View = (props) => {
62
64
  form,
63
65
  preserve: true
64
66
  });
65
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(
66
- import_Table.default,
67
- {
68
- tableProps: other,
69
- filter,
70
- setTableSetting,
71
- onDataSourceChange
72
- }
73
- ), viewMode === "gallery" && /* @__PURE__ */ import_react.default.createElement(
74
- import_Gallery.default,
75
- {
76
- loading: other == null ? void 0 : other.loading,
77
- gallery,
78
- pagination: other.pagination,
79
- filter,
80
- rowKey: other.rowKey,
81
- onDataSourceChange
82
- }
83
- ));
67
+ const debouncedFilter = (0, import_ahooks.useDebounce)(filter, { wait: 200 });
68
+ const memoOnDataSourceChange = (0, import_ahooks.useMemoizedFn)(
69
+ (v) => onDataSourceChange == null ? void 0 : onDataSourceChange(v)
70
+ );
71
+ const memoContent = (0, import_react.useMemo)(() => {
72
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(
73
+ import_Table.default,
74
+ {
75
+ tableProps: other,
76
+ filter,
77
+ setTableSetting,
78
+ onDataSourceChange: memoOnDataSourceChange
79
+ }
80
+ ), viewMode === "gallery" && /* @__PURE__ */ import_react.default.createElement(
81
+ import_Gallery.default,
82
+ {
83
+ loading: other == null ? void 0 : other.loading,
84
+ gallery,
85
+ pagination: other.pagination,
86
+ filter,
87
+ rowKey: other.rowKey,
88
+ onDataSourceChange: memoOnDataSourceChange
89
+ }
90
+ ));
91
+ }, [viewMode, (0, import_utils.stringify)(other), debouncedFilter, memoOnDataSourceChange, gallery]);
92
+ return memoContent;
84
93
  };
85
94
  var View_default = View;
@@ -31,7 +31,7 @@ var useGenScroll = (params) => {
31
31
  x: (propsScroll == null ? void 0 : propsScroll.x) || columns.reduce((p, c) => {
32
32
  return p + (c.width || 250);
33
33
  }, 0) || 2e3,
34
- y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 50 + 24 : 0), 100),
34
+ y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 50 + 24 : 24), 100),
35
35
  scrollToFirstRowOnChange: propsScroll == null ? void 0 : propsScroll.scrollToFirstRowOnChange
36
36
  };
37
37
  }
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/table/hooks/useTableSetting.ts
@@ -24,7 +34,10 @@ __export(useTableSetting_exports, {
24
34
  module.exports = __toCommonJS(useTableSetting_exports);
25
35
  var import_react = require("react");
26
36
  var import_utils = require("../Table/utils");
37
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
38
+ var import_ahooks = require("ahooks");
27
39
  var useTableSetting = (params) => {
40
+ var _a;
28
41
  const {
29
42
  tableId,
30
43
  filter,
@@ -38,27 +51,29 @@ var useTableSetting = (params) => {
38
51
  currentSettingHash,
39
52
  exportImport
40
53
  } = params;
54
+ const context = (0, import_useEngineContext.default)();
55
+ const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
41
56
  const columnsMap = (0, import_react.useMemo)(() => {
42
57
  return new Map(propsColumns.map((item) => [item.key, item]));
43
58
  }, [propsColumns]);
44
59
  const columns = (0, import_react.useMemo)(() => {
45
- var _a;
60
+ var _a2;
46
61
  if (currentViewMode === "grid") {
47
62
  return propsColumns;
48
63
  } else if (currentViewMode === "gallery") {
49
- return (((_a = gallery == null ? void 0 : gallery.content) == null ? void 0 : _a.fields) || []).filter((item) => item.show).map((item) => columnsMap.get(item.columnKey)).filter(Boolean);
64
+ return (((_a2 = gallery == null ? void 0 : gallery.content) == null ? void 0 : _a2.fields) || []).filter((item) => item.show).map((item) => columnsMap.get(item.columnKey)).filter(Boolean);
50
65
  }
51
66
  return propsColumns;
52
67
  }, [propsColumns, currentViewMode, gallery, columnsMap]);
53
68
  const { list, quickFilterMaxLength, sortButtonShow } = filter || {};
54
69
  const defaultGalleryCoverSetting = (0, import_react.useMemo)(() => {
55
- var _a, _b;
70
+ var _a2, _b;
56
71
  return {
57
- coverObjectFit: (_a = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a.objectFit,
72
+ coverObjectFit: (_a2 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a2.objectFit,
58
73
  coverField: (_b = columns.find(
59
74
  (column) => {
60
- var _a2, _b2;
61
- return column.key === ((_b2 = (_a2 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[0]);
75
+ var _a3, _b2;
76
+ return column.key === ((_b2 = (_a3 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a3.fields) == null ? void 0 : _b2[0]);
62
77
  }
63
78
  )) == null ? void 0 : _b.dataIndex,
64
79
  compactMode: "default",
@@ -102,7 +117,7 @@ var useTableSetting = (params) => {
102
117
  );
103
118
  const mergedSetting = { ...allSetting, ...currentViewModeSetting };
104
119
  localStorageSettingKeyArr.forEach((item) => {
105
- var _a, _b, _c, _d;
120
+ var _a2, _b, _c, _d;
106
121
  if (item === "view_mode") {
107
122
  setting[item] = view.multiple ? (mergedSetting == null ? void 0 : mergedSetting[item]) || view.defaultViewMode : view.defaultViewMode;
108
123
  } else if (item === "filter_setting") {
@@ -123,7 +138,7 @@ var useTableSetting = (params) => {
123
138
  setting[item] = {
124
139
  ...mergedSetting == null ? void 0 : mergedSetting[item],
125
140
  // 本地没有默认封面效果时取配置中的
126
- coverObjectFit: ((_a = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _a.coverObjectFit) || defaultGalleryCoverSetting.coverObjectFit,
141
+ coverObjectFit: ((_a2 = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _a2.coverObjectFit) || defaultGalleryCoverSetting.coverObjectFit,
127
142
  coverField: ((_b = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _b.coverField) || defaultGalleryCoverSetting.coverField,
128
143
  compactMode: ((_c = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _c.compactMode) || defaultGalleryCoverSetting.compactMode,
129
144
  isShowLabel: ((_d = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _d.isShowLabel) ?? defaultGalleryCoverSetting.isShowLabel
@@ -185,15 +200,15 @@ var useTableSetting = (params) => {
185
200
  quickFilterMaxLength,
186
201
  sortButtonShow
187
202
  ]);
188
- const setTableSetting = (values) => {
189
- (0, import_utils.setFormValuesToLocalStorage)({
203
+ const setTableSetting = (0, import_ahooks.useMemoizedFn)((values) => {
204
+ const result = (0, import_utils.setFormValuesToLocalStorage)({
190
205
  tableId,
191
206
  allValues: values,
192
207
  keys: localStorageSettingKeyArr,
193
208
  currentViewMode,
194
209
  currentSettingHash
195
210
  });
196
- };
211
+ });
197
212
  const tableSetting = (0, import_react.useMemo)(() => {
198
213
  return {
199
214
  ...tableLocalSetting,
@@ -6,6 +6,7 @@ declare type UseTransDataSourceParams = {
6
6
  dataSource: Record<string, any>[];
7
7
  rowKey: string | ((params: any) => string);
8
8
  filter: FilterType;
9
+ currentView: 'gallery' | 'table';
9
10
  };
10
11
  declare const useTransDataSource: (params: UseTransDataSourceParams) => Record<string, any>[];
11
12
  export default useTransDataSource;
@@ -33,7 +33,8 @@ var useTransDataSource = (params) => {
33
33
  localPagination,
34
34
  dataSource: pDataSource,
35
35
  rowKey,
36
- filter
36
+ filter,
37
+ currentView
37
38
  } = params;
38
39
  const sort = import_antd.Form.useWatch("order_by", { form, preserve: true });
39
40
  const group = import_antd.Form.useWatch("group_by", { form, preserve: true });
@@ -60,7 +61,7 @@ var useTransDataSource = (params) => {
60
61
  return [];
61
62
  }
62
63
  return filter == null ? void 0 : filter.list.filter((item) => item.localFilter);
63
- }, [filter]);
64
+ }, [(0, import_utils2.stringify)(filter)]);
64
65
  const dataSource = (0, import_react.useMemo)(() => {
65
66
  if (!localPagination) {
66
67
  return pDataSource;
@@ -72,7 +73,7 @@ var useTransDataSource = (params) => {
72
73
  if (sortObj) {
73
74
  newDataSource = (0, import_utils2.sortDataSource)(newDataSource, sortObj);
74
75
  }
75
- if (groupDetail) {
76
+ if (groupDetail && currentView === "table") {
76
77
  newDataSource = (0, import_utils2.groupDataSource)(newDataSource, groupDetail, rowKey);
77
78
  }
78
79
  return newDataSource;
@@ -82,9 +83,9 @@ var useTransDataSource = (params) => {
82
83
  sortObj,
83
84
  groupDetail,
84
85
  filterLocalArr,
85
- filters
86
+ filters,
87
+ currentView
86
88
  ]);
87
- console.log("dataSourcedataSource", dataSource);
88
89
  return dataSource;
89
90
  };
90
91
  var useTransDataSource_default = useTransDataSource;
@@ -89,9 +89,9 @@ var GridView = (0, import_model.Provider)(
89
89
  const filterDefaultRef = (0, import_react.useRef)({});
90
90
  const initialValuesRef = (0, import_react.useRef)({});
91
91
  const { width } = (0, import_ahooks.useSize)(wrapRef) || {};
92
+ const debouncedWidth = (0, import_ahooks.useDebounce)(width, { wait: 100 });
92
93
  const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
93
94
  const tableId = (0, import_react.useMemo)(() => {
94
- console.log(props, "wh");
95
95
  if (props.__designMode === "design") {
96
96
  return "designMode-mock-table-id";
97
97
  }
@@ -144,13 +144,13 @@ var GridView = (0, import_model.Provider)(
144
144
  }
145
145
  }, [currentSettingHash, tableId]);
146
146
  (0, import_react.useEffect)(() => {
147
- if (width) {
147
+ if (debouncedWidth) {
148
148
  modal.dispatch({
149
149
  type: "setTableWidth",
150
- payload: width || {}
150
+ payload: debouncedWidth || {}
151
151
  });
152
152
  }
153
- }, [width]);
153
+ }, [debouncedWidth]);
154
154
  const { setTableSetting, tableSetting } = (0, import_useTableSetting.default)({
155
155
  tableId,
156
156
  filter,
@@ -9,6 +9,15 @@
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
 
12
+ .pisell-lowcode-table-body {
13
+ overscroll-behavior: none;
14
+ }
15
+ .pisell-lowcode-table-placeholder {
16
+ .cell-provider {
17
+ display: block;
18
+ }
19
+ }
20
+
12
21
  .pisell-lowcode-table-thead {
13
22
  .pisell-lowcode-table-cell {
14
23
  padding: 0 14px;
@@ -3,6 +3,7 @@ declare type exportParams = {
3
3
  file_name?: string;
4
4
  form_id?: string | number;
5
5
  code?: string;
6
+ url?: string;
6
7
  };
7
8
  export declare const exportData: (params: exportParams) => Promise<any>;
8
9
  export declare const batchImport: (params: any) => Promise<any>;
@@ -26,12 +26,32 @@ __export(serve_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(serve_exports);
28
28
  var import_utils = require("./utils");
29
+ var defaultUrl = "/shop/form/data";
30
+ var formatApiParams = (params) => {
31
+ const _url = (params == null ? void 0 : params.url) || defaultUrl;
32
+ let _params = { ...params };
33
+ delete _params.url;
34
+ return {
35
+ url: _url,
36
+ params: { ..._params }
37
+ };
38
+ };
29
39
  var exportData = (params) => {
30
- return import_utils.request.getRequest().post(`/shop/form/data/export`, params);
40
+ const _params = formatApiParams(params);
41
+ return import_utils.request.getRequest().post(`${_params == null ? void 0 : _params.url}/export`, _params == null ? void 0 : _params.params);
42
+ };
43
+ var batchImport = (params) => {
44
+ const _params = formatApiParams(params);
45
+ return import_utils.request.getRequest().post(`${_params == null ? void 0 : _params.url}/import`, _params == null ? void 0 : _params.params);
46
+ };
47
+ var importTemplate = (params) => {
48
+ const _params = formatApiParams(params);
49
+ return import_utils.request.getRequest().post(`${_params == null ? void 0 : _params.url}/download-template`, _params == null ? void 0 : _params.params);
50
+ };
51
+ var historyData = async (params) => {
52
+ const _params = formatApiParams(params);
53
+ return await import_utils.request.getRequest().get(`${_params == null ? void 0 : _params.url}/task`, _params == null ? void 0 : _params.params);
31
54
  };
32
- var batchImport = (params) => import_utils.request.getRequest().post("/shop/form/data/import", params);
33
- var importTemplate = (params) => import_utils.request.getRequest().post("/shop/form/data/download-template", params);
34
- var historyData = async (params) => await import_utils.request.getRequest().get("/shop/form/data/task", params);
35
55
  // Annotate the CommonJS export names for ESM import in node:
36
56
  0 && (module.exports = {
37
57
  batchImport,
@@ -177,6 +177,8 @@ export declare type ExportImportType = {
177
177
  templateFileUrl: string;
178
178
  /** 标题 */
179
179
  title: string;
180
+ hiddenKeys?: string[];
181
+ apiUrl?: string;
180
182
  };
181
183
  export declare type GridViewProps = {
182
184
  columns: any;
package/lib/index.d.ts CHANGED
@@ -72,6 +72,7 @@ export { default as List } from './components/list';
72
72
  export { default as Sort } from './components/sort';
73
73
  export { default as InputNumberRange } from './components/input-number-range';
74
74
  export { default as LowCodePage } from './components/lowCodePage';
75
+ export { default as PickerView } from './components/picker-view';
75
76
  export { default as Segmented } from './components/segmented';
76
77
  export { default as VirtualKeyboard } from './components/virtual-keyboard';
77
78
  export { default as VirtualKeyboardTime } from './components/virtual-keyboard/Time';
@@ -101,4 +102,5 @@ export { default as PisellAlert } from './components/pisellAlert';
101
102
  export { default as PisellCard } from './components/pisellCard';
102
103
  export { default as PisellInformationEntry } from './components/pisellInformationEntry';
103
104
  export { default as usePisellConfig } from './components/pisell-config-provider/hooks/usePisellConfig';
104
- export { globalConfig, default as PisellContext } from './components/pisell-config-provider/context';
105
+ export { globalConfig, default as PisellContext, } from './components/pisell-config-provider/context';
106
+ export { default as PisellTags } from './components/pisellTags';
package/lib/index.js CHANGED
@@ -73,6 +73,7 @@ __export(src_exports, {
73
73
  Modal: () => import_modal.default,
74
74
  Page: () => import_page.default,
75
75
  Pagination: () => import_antd22.Pagination,
76
+ PickerView: () => import_picker_view.default,
76
77
  PisellAlert: () => import_pisellAlert.default,
77
78
  PisellCard: () => import_pisellCard.default,
78
79
  PisellCardList: () => import_pisellCardList.default,
@@ -89,6 +90,7 @@ __export(src_exports, {
89
90
  PisellModal: () => import_pisellModal.default,
90
91
  PisellRow: () => import_pisellRow.default,
91
92
  PisellScan: () => import_pisellScan.default,
93
+ PisellTags: () => import_pisellTags.default,
92
94
  PisellText: () => import_pisellText.default,
93
95
  PisellToast: () => import_pisellToast.default,
94
96
  PisellTooltip: () => import_pisellTooltip.default,
@@ -210,6 +212,7 @@ var import_list = __toESM(require("./components/list"));
210
212
  var import_sort = __toESM(require("./components/sort"));
211
213
  var import_input_number_range = __toESM(require("./components/input-number-range"));
212
214
  var import_lowCodePage = __toESM(require("./components/lowCodePage"));
215
+ var import_picker_view = __toESM(require("./components/picker-view"));
213
216
  var import_segmented = __toESM(require("./components/segmented"));
214
217
  var import_virtual_keyboard = __toESM(require("./components/virtual-keyboard"));
215
218
  var import_Time = __toESM(require("./components/virtual-keyboard/Time"));
@@ -240,6 +243,7 @@ var import_pisellCard = __toESM(require("./components/pisellCard"));
240
243
  var import_pisellInformationEntry = __toESM(require("./components/pisellInformationEntry"));
241
244
  var import_usePisellConfig = __toESM(require("./components/pisell-config-provider/hooks/usePisellConfig"));
242
245
  var import_context = __toESM(require("./components/pisell-config-provider/context"));
246
+ var import_pisellTags = __toESM(require("./components/pisellTags"));
243
247
  // Annotate the CommonJS export names for ESM import in node:
244
248
  0 && (module.exports = {
245
249
  Affix,
@@ -286,6 +290,7 @@ var import_context = __toESM(require("./components/pisell-config-provider/contex
286
290
  Modal,
287
291
  Page,
288
292
  Pagination,
293
+ PickerView,
289
294
  PisellAlert,
290
295
  PisellCard,
291
296
  PisellCardList,
@@ -302,6 +307,7 @@ var import_context = __toESM(require("./components/pisell-config-provider/contex
302
307
  PisellModal,
303
308
  PisellRow,
304
309
  PisellScan,
310
+ PisellTags,
305
311
  PisellText,
306
312
  PisellToast,
307
313
  PisellTooltip,