@pisell/materials 1.0.261 → 1.0.263
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/auto-complete-number/index.d.ts +10 -0
- package/es/components/auto-complete-number/index.js +28 -0
- package/es/components/picker-view/index.d.ts +2 -0
- package/es/components/picker-view/index.js +2 -0
- package/es/components/sort/index.js +1 -1
- package/es/components/sort/types.d.ts +1 -0
- package/es/components/table/Gallery/index.js +6 -2
- package/es/components/table/Gallery/types.d.ts +2 -1
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +8 -7
- package/es/components/table/Table/index.js +6 -2
- package/es/components/table/View/index.js +7 -4
- package/es/components/table/hooks/useTransSortSetting.js +4 -1
- package/es/components/table/hooks/useTriggerValuesChange.js +24 -2
- package/es/components/table/types.d.ts +5 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/en-US.js +8 -1
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +8 -1
- package/es/locales/zh-TW.d.ts +7 -0
- package/es/locales/zh-TW.js +8 -1
- package/lib/components/auto-complete-number/index.d.ts +10 -0
- package/lib/components/auto-complete-number/index.js +48 -0
- package/lib/components/picker-view/index.d.ts +2 -0
- package/lib/components/picker-view/index.js +36 -0
- package/lib/components/sort/index.js +1 -1
- package/lib/components/sort/types.d.ts +1 -0
- package/lib/components/table/Gallery/index.js +4 -1
- package/lib/components/table/Gallery/types.d.ts +2 -1
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +8 -7
- package/lib/components/table/Table/index.js +4 -1
- package/lib/components/table/View/index.js +12 -2
- package/lib/components/table/hooks/useTransSortSetting.js +3 -1
- package/lib/components/table/hooks/useTriggerValuesChange.js +18 -3
- package/lib/components/table/types.d.ts +5 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +7 -0
- package/lib/locales/en-US.js +8 -1
- package/lib/locales/zh-CN.d.ts +7 -0
- package/lib/locales/zh-CN.js +8 -1
- package/lib/locales/zh-TW.d.ts +7 -0
- package/lib/locales/zh-TW.js +8 -1
- package/lowcode/table/meta.ts +4 -0
- package/package.json +2 -2
|
@@ -54,6 +54,7 @@ var View = (props) => {
|
|
|
54
54
|
view,
|
|
55
55
|
gallery,
|
|
56
56
|
setTableSetting,
|
|
57
|
+
onDataSourceChange,
|
|
57
58
|
...other
|
|
58
59
|
} = props;
|
|
59
60
|
const form = import_antd.Form.useFormInstance();
|
|
@@ -61,14 +62,23 @@ var View = (props) => {
|
|
|
61
62
|
form,
|
|
62
63
|
preserve: true
|
|
63
64
|
});
|
|
64
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(
|
|
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(
|
|
65
74
|
import_Gallery.default,
|
|
66
75
|
{
|
|
67
76
|
loading: other == null ? void 0 : other.loading,
|
|
68
77
|
gallery,
|
|
69
78
|
pagination: other.pagination,
|
|
70
79
|
filter,
|
|
71
|
-
rowKey: other.rowKey
|
|
80
|
+
rowKey: other.rowKey,
|
|
81
|
+
onDataSourceChange
|
|
72
82
|
}
|
|
73
83
|
));
|
|
74
84
|
};
|
|
@@ -23,6 +23,7 @@ __export(useTransSortSetting_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(useTransSortSetting_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
|
+
var import_utils = require("@pisell/utils");
|
|
26
27
|
var useTransSortSetting = (params) => {
|
|
27
28
|
const { sort, originColumnsMap } = params;
|
|
28
29
|
return (0, import_react.useMemo)(() => {
|
|
@@ -30,7 +31,7 @@ var useTransSortSetting = (params) => {
|
|
|
30
31
|
return {
|
|
31
32
|
...sort,
|
|
32
33
|
list: sort.list.map((item) => {
|
|
33
|
-
let { name, label, columnKey, isCustom } = item;
|
|
34
|
+
let { name, label, columnKey, isCustom, localFilter } = item;
|
|
34
35
|
if (!isCustom && columnKey && originColumnsMap.has(columnKey)) {
|
|
35
36
|
const column = originColumnsMap.get(columnKey);
|
|
36
37
|
name = column.dataIndex || name;
|
|
@@ -38,6 +39,7 @@ var useTransSortSetting = (params) => {
|
|
|
38
39
|
}
|
|
39
40
|
return {
|
|
40
41
|
...item,
|
|
42
|
+
localFilter: (0, import_utils.isBoolean)(localFilter) ? localFilter : true,
|
|
41
43
|
name,
|
|
42
44
|
label
|
|
43
45
|
};
|
|
@@ -27,9 +27,10 @@ var import_utils = require("../Table/utils");
|
|
|
27
27
|
var useTriggerValuesChange = (params) => {
|
|
28
28
|
const { filter, columnSetting, dataSourceGroup, sort, currentViewMode } = params;
|
|
29
29
|
const { list, show } = filter || {};
|
|
30
|
+
const { list: sortList, show: sortShow } = sort || {};
|
|
30
31
|
const getIsTriggerValuesChange = (0, import_react.useCallback)(
|
|
31
32
|
(changedValues, values) => {
|
|
32
|
-
var _a;
|
|
33
|
+
var _a, _b, _c;
|
|
33
34
|
const keys = (0, import_utils.getSettingKeyArrByMode)({
|
|
34
35
|
filter,
|
|
35
36
|
columnSetting,
|
|
@@ -45,10 +46,24 @@ var useTriggerValuesChange = (params) => {
|
|
|
45
46
|
if (changedKey === "view_mode") {
|
|
46
47
|
return false;
|
|
47
48
|
}
|
|
49
|
+
if (changedKey === "order_by") {
|
|
50
|
+
if (sortShow && (sortList == null ? void 0 : sortList.length)) {
|
|
51
|
+
const value = changedValues[changedKey];
|
|
52
|
+
const sortField = ((_b = (_a = value == null ? void 0 : value.split) == null ? void 0 : _a.call(value, ":")) == null ? void 0 : _b[0]) || "";
|
|
53
|
+
const remoteSortKeys = sortList.filter((item) => !item.localFilter).map((item) => {
|
|
54
|
+
var _a2;
|
|
55
|
+
return (_a2 = item.name) == null ? void 0 : _a2.toString();
|
|
56
|
+
});
|
|
57
|
+
return remoteSortKeys.includes(sortField);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
48
60
|
if (changedKey === "filters") {
|
|
49
|
-
const filterKey = ((
|
|
61
|
+
const filterKey = ((_c = Object.keys(changedValues.filters)) == null ? void 0 : _c[0]) || "";
|
|
50
62
|
if (show && (list == null ? void 0 : list.length)) {
|
|
51
|
-
const remoteFilterKeys = list.filter((item) => !item.localFilter).map((item) =>
|
|
63
|
+
const remoteFilterKeys = list.filter((item) => !item.localFilter).map((item) => {
|
|
64
|
+
var _a2;
|
|
65
|
+
return (_a2 = item.name) == null ? void 0 : _a2.toString();
|
|
66
|
+
});
|
|
52
67
|
return remoteFilterKeys.includes(filterKey);
|
|
53
68
|
}
|
|
54
69
|
}
|
|
@@ -192,5 +192,10 @@ export declare type GridViewProps = {
|
|
|
192
192
|
* 当前本地配置的key 用此hash是否改变用来判断是否清空本地配置 不填默认使用columns数据生成hash
|
|
193
193
|
*/
|
|
194
194
|
currentSettingKey?: "";
|
|
195
|
+
/**
|
|
196
|
+
* 当前表格中数据发生变化事件 包含本地筛选和外部传入数据变化
|
|
197
|
+
* @param currentDataSource
|
|
198
|
+
*/
|
|
199
|
+
onDataSourceChange?: (currentDataSource: Record<string, any>[]) => void;
|
|
195
200
|
};
|
|
196
201
|
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -72,4 +72,6 @@ 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";
|
|
77
|
+
export { default as AutoCompleteNumber } from "./components/auto-complete-number";
|
package/lib/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
Alert: () => import_antd3.Alert,
|
|
34
34
|
Anchor: () => import_antd2.Anchor,
|
|
35
35
|
AutoComplete: () => import_auto_complete.default,
|
|
36
|
+
AutoCompleteNumber: () => import_auto_complete_number.default,
|
|
36
37
|
Avatar: () => import_antd4.Avatar,
|
|
37
38
|
Badge: () => import_antd5.Badge,
|
|
38
39
|
Breadcrumb: () => import_antd6.Breadcrumb,
|
|
@@ -69,6 +70,7 @@ __export(src_exports, {
|
|
|
69
70
|
Modal: () => import_modal.default,
|
|
70
71
|
Page: () => import_page.default,
|
|
71
72
|
Pagination: () => import_antd22.Pagination,
|
|
73
|
+
PickerView: () => import_picker_view.default,
|
|
72
74
|
Popconfirm: () => import_antd23.Popconfirm,
|
|
73
75
|
Popover: () => import_antd24.Popover,
|
|
74
76
|
Progress: () => import_antd25.Progress,
|
|
@@ -180,13 +182,16 @@ var import_list = __toESM(require("./components/list"));
|
|
|
180
182
|
var import_sort = __toESM(require("./components/sort"));
|
|
181
183
|
var import_input_number_range = __toESM(require("./components/input-number-range"));
|
|
182
184
|
var import_lowCodePage = __toESM(require("./components/lowCodePage"));
|
|
185
|
+
var import_picker_view = __toESM(require("./components/picker-view"));
|
|
183
186
|
var import_segmented = __toESM(require("./components/segmented"));
|
|
187
|
+
var import_auto_complete_number = __toESM(require("./components/auto-complete-number"));
|
|
184
188
|
// Annotate the CommonJS export names for ESM import in node:
|
|
185
189
|
0 && (module.exports = {
|
|
186
190
|
Affix,
|
|
187
191
|
Alert,
|
|
188
192
|
Anchor,
|
|
189
193
|
AutoComplete,
|
|
194
|
+
AutoCompleteNumber,
|
|
190
195
|
Avatar,
|
|
191
196
|
Badge,
|
|
192
197
|
Breadcrumb,
|
|
@@ -223,6 +228,7 @@ var import_segmented = __toESM(require("./components/segmented"));
|
|
|
223
228
|
Modal,
|
|
224
229
|
Page,
|
|
225
230
|
Pagination,
|
|
231
|
+
PickerView,
|
|
226
232
|
Popconfirm,
|
|
227
233
|
Popover,
|
|
228
234
|
Progress,
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -28,5 +28,12 @@ declare const _default: {
|
|
|
28
28
|
"table-column-group-records": string;
|
|
29
29
|
"table-column-drag-sort-disabled-tip": string;
|
|
30
30
|
"table-action-filter-no-filter": string;
|
|
31
|
+
"table-action-range-picker-presets-today": string;
|
|
32
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
33
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
34
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
35
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
package/lib/locales/en-US.js
CHANGED
|
@@ -51,5 +51,12 @@ var en_US_default = {
|
|
|
51
51
|
"table-action-column-title": "Header settings",
|
|
52
52
|
"table-column-group-records": "records",
|
|
53
53
|
"table-column-drag-sort-disabled-tip": "Automatic sorting is enabled, manual dragging is disabled.",
|
|
54
|
-
"table-action-filter-no-filter": "No filter options available."
|
|
54
|
+
"table-action-filter-no-filter": "No filter options available.",
|
|
55
|
+
"table-action-range-picker-presets-today": "Today",
|
|
56
|
+
"table-action-range-picker-presets-yesterday": "Yesterday",
|
|
57
|
+
"table-action-range-picker-presets-last-3-day": "Last 3 Days",
|
|
58
|
+
"table-action-range-picker-presets-last-7-day": "Last 7 Days",
|
|
59
|
+
"table-action-range-picker-presets-last-14-day": "Last 14 Days",
|
|
60
|
+
"table-action-range-picker-presets-last-30-day": "Last 30 Days",
|
|
61
|
+
"table-action-range-picker-presets-last-90-day": "Last 90 Days"
|
|
55
62
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
|
@@ -28,5 +28,12 @@ declare const _default: {
|
|
|
28
28
|
"table-column-group-records": string;
|
|
29
29
|
"table-column-drag-sort-disabled-tip": string;
|
|
30
30
|
"table-action-filter-no-filter": string;
|
|
31
|
+
"table-action-range-picker-presets-today": string;
|
|
32
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
33
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
34
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
35
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -51,5 +51,12 @@ var zh_CN_default = {
|
|
|
51
51
|
"table-action-column-title": "表头设置",
|
|
52
52
|
"table-column-group-records": "条记录",
|
|
53
53
|
"table-column-drag-sort-disabled-tip": "已开启自动排序,无法手动拖拽",
|
|
54
|
-
"table-action-filter-no-filter": "没有可用的筛选器。"
|
|
54
|
+
"table-action-filter-no-filter": "没有可用的筛选器。",
|
|
55
|
+
"table-action-range-picker-presets-today": "今天",
|
|
56
|
+
"table-action-range-picker-presets-yesterday": "昨天",
|
|
57
|
+
"table-action-range-picker-presets-last-3-day": "过去3天",
|
|
58
|
+
"table-action-range-picker-presets-last-7-day": "过去7天",
|
|
59
|
+
"table-action-range-picker-presets-last-14-day": "过去14天",
|
|
60
|
+
"table-action-range-picker-presets-last-30-day": "过去30天",
|
|
61
|
+
"table-action-range-picker-presets-last-90-day": "过去90天"
|
|
55
62
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
|
@@ -28,5 +28,12 @@ declare const _default: {
|
|
|
28
28
|
"table-column-group-records": string;
|
|
29
29
|
"table-column-drag-sort-disabled-tip": string;
|
|
30
30
|
"table-action-filter-no-filter": string;
|
|
31
|
+
"table-action-range-picker-presets-today": string;
|
|
32
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
33
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
34
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
35
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -51,5 +51,12 @@ var zh_TW_default = {
|
|
|
51
51
|
"table-action-column-title": "表頭設置",
|
|
52
52
|
"table-column-group-records": "條記錄",
|
|
53
53
|
"table-column-drag-sort-disabled-tip": "已開啟自動排序,無法手動拖曳",
|
|
54
|
-
"table-action-filter-no-filter": "沒有可用的篩選器。"
|
|
54
|
+
"table-action-filter-no-filter": "沒有可用的篩選器。",
|
|
55
|
+
"table-action-range-picker-presets-today": "今天",
|
|
56
|
+
"table-action-range-picker-presets-yesterday": "昨天",
|
|
57
|
+
"table-action-range-picker-presets-last-3-day": "過去3天",
|
|
58
|
+
"table-action-range-picker-presets-last-7-day": "過去7天",
|
|
59
|
+
"table-action-range-picker-presets-last-14-day": "過去14天",
|
|
60
|
+
"table-action-range-picker-presets-last-30-day": "過去30天",
|
|
61
|
+
"table-action-range-picker-presets-last-90-day": "過去90天"
|
|
55
62
|
};
|
package/lowcode/table/meta.ts
CHANGED
|
@@ -2165,6 +2165,10 @@ export default {
|
|
|
2165
2165
|
name: "onValuesChange",
|
|
2166
2166
|
template: "onValuesChange(changedValues, values){}",
|
|
2167
2167
|
},
|
|
2168
|
+
{
|
|
2169
|
+
name: "onDataSourceChange",
|
|
2170
|
+
template: "onDataSourceChange(currentDataSource) {}"
|
|
2171
|
+
},
|
|
2168
2172
|
{
|
|
2169
2173
|
name: "rowSelection.onChange",
|
|
2170
2174
|
template:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.263",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"react-window": "^1.8.10",
|
|
63
63
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
64
64
|
"crypto-js": "^4.2.0",
|
|
65
|
-
"@pisell/utils": "1.0.25",
|
|
66
65
|
"@pisell/icon": "0.0.8",
|
|
66
|
+
"@pisell/utils": "1.0.25",
|
|
67
67
|
"@pisell/date-picker": "1.0.71"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|