@pisell/materials 6.0.15 → 6.0.16
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +6 -3
- package/es/components/dataSourceComponents/fields/Upload/index.js +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +31 -26
- package/lib/components/dataSourceComponents/fields/Upload/index.js +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/package.json +3 -3
|
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
|
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
19
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
title: number | boolean |
|
|
20
|
+
title: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
|
|
21
21
|
pagination: {
|
|
22
22
|
total: number;
|
|
23
23
|
current: number;
|
|
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
26
|
showSizeChanger: boolean;
|
|
27
27
|
};
|
|
28
28
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle: number | boolean |
|
|
29
|
+
subTitle: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
|
|
30
30
|
buttons: any[] | null;
|
|
31
31
|
filter: React.JSX.Element | null;
|
|
32
32
|
onRow: (record: any) => any;
|
|
@@ -52,7 +52,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
52
52
|
width: number;
|
|
53
53
|
align: "center" | "left" | "right";
|
|
54
54
|
fixed: false | "left" | "right";
|
|
55
|
-
type: "
|
|
55
|
+
type: "link" | "button";
|
|
56
56
|
items: OperationItem[];
|
|
57
57
|
} | undefined;
|
|
58
58
|
operationContent?: {
|
|
@@ -214,8 +214,11 @@ var useTableProps = function useTableProps(props) {
|
|
|
214
214
|
onClick: handleClick,
|
|
215
215
|
type: type === 'link' ? 'link' : 'default',
|
|
216
216
|
style: type === 'link' ? {
|
|
217
|
-
padding: '0'
|
|
218
|
-
|
|
217
|
+
padding: '0',
|
|
218
|
+
height: 'auto'
|
|
219
|
+
} : {
|
|
220
|
+
height: 'auto'
|
|
221
|
+
}
|
|
219
222
|
}, label);
|
|
220
223
|
}));
|
|
221
224
|
}
|
|
@@ -238,7 +241,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
238
241
|
beforeOpen = button.beforeOpen;
|
|
239
242
|
return _objectSpread(_objectSpread(_objectSpread({}, button), buttonProps), {}, {
|
|
240
243
|
title: button.label,
|
|
241
|
-
size:
|
|
244
|
+
size: 'large',
|
|
242
245
|
onClick: function onClick() {
|
|
243
246
|
if (actionType === 'add') {
|
|
244
247
|
var result = true;
|
|
@@ -17,7 +17,7 @@ var Upload = withFormItem(UploadWithMode, {
|
|
|
17
17
|
var _checkFileCount = checkFileCount({
|
|
18
18
|
minCount: props.minCount || 0,
|
|
19
19
|
maxCount: props.maxCount || DEFAULT_MAX_COUNT,
|
|
20
|
-
valueLength: value.length,
|
|
20
|
+
valueLength: (value === null || value === void 0 ? void 0 : value.length) || 0,
|
|
21
21
|
multiple: !!props.multiple
|
|
22
22
|
}),
|
|
23
23
|
success = _checkFileCount.success,
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
|
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
19
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
title: number | boolean |
|
|
20
|
+
title: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
|
|
21
21
|
pagination: {
|
|
22
22
|
total: number;
|
|
23
23
|
current: number;
|
|
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
26
|
showSizeChanger: boolean;
|
|
27
27
|
};
|
|
28
28
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle: number | boolean |
|
|
29
|
+
subTitle: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
|
|
30
30
|
buttons: any[] | null;
|
|
31
31
|
filter: React.JSX.Element | null;
|
|
32
32
|
onRow: (record: any) => any;
|
|
@@ -52,7 +52,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
52
52
|
width: number;
|
|
53
53
|
align: "center" | "left" | "right";
|
|
54
54
|
fixed: false | "left" | "right";
|
|
55
|
-
type: "
|
|
55
|
+
type: "link" | "button";
|
|
56
56
|
items: OperationItem[];
|
|
57
57
|
} | undefined;
|
|
58
58
|
operationContent?: {
|
|
@@ -113,33 +113,35 @@ var useTableProps = (props) => {
|
|
|
113
113
|
});
|
|
114
114
|
openDrawer(item);
|
|
115
115
|
});
|
|
116
|
-
const handleDelete = (0, import_ahooks.useMemoizedFn)(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
116
|
+
const handleDelete = (0, import_ahooks.useMemoizedFn)(
|
|
117
|
+
async (record, softDelete) => {
|
|
118
|
+
try {
|
|
119
|
+
registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
|
|
120
|
+
currentRecord: { ...record }
|
|
121
|
+
});
|
|
122
|
+
setTimeout(async () => {
|
|
123
|
+
if (softDelete) {
|
|
124
|
+
const deleteTime = (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss");
|
|
125
|
+
await (update == null ? void 0 : update.runAsync({
|
|
126
|
+
...record,
|
|
127
|
+
deleted_at: deleteTime
|
|
128
|
+
}));
|
|
129
|
+
} else {
|
|
130
|
+
await (destroy == null ? void 0 : destroy.runAsync(record.id));
|
|
131
|
+
}
|
|
132
|
+
refreshData();
|
|
133
|
+
(0, import_pisellToast.default)({
|
|
134
|
+
content: (0, import_locales.getText)("pisell-action-delete-success")
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.error(error);
|
|
132
139
|
(0, import_pisellToast.default)({
|
|
133
|
-
content: (0, import_locales.getText)("pisell-action-delete-
|
|
140
|
+
content: (0, import_locales.getText)("pisell-action-delete-failed")
|
|
134
141
|
});
|
|
135
|
-
}
|
|
136
|
-
} catch (error) {
|
|
137
|
-
console.error(error);
|
|
138
|
-
(0, import_pisellToast.default)({
|
|
139
|
-
content: (0, import_locales.getText)("pisell-action-delete-failed")
|
|
140
|
-
});
|
|
142
|
+
}
|
|
141
143
|
}
|
|
142
|
-
|
|
144
|
+
);
|
|
143
145
|
const actionsColumns = (0, import_react.useMemo)(() => {
|
|
144
146
|
if (!show) {
|
|
145
147
|
return [];
|
|
@@ -189,8 +191,11 @@ var useTableProps = (props) => {
|
|
|
189
191
|
onClick: handleClick,
|
|
190
192
|
type: type === "link" ? "link" : "default",
|
|
191
193
|
style: type === "link" ? {
|
|
192
|
-
padding: "0"
|
|
193
|
-
|
|
194
|
+
padding: "0",
|
|
195
|
+
height: "auto"
|
|
196
|
+
} : {
|
|
197
|
+
height: "auto"
|
|
198
|
+
}
|
|
194
199
|
},
|
|
195
200
|
label
|
|
196
201
|
);
|
|
@@ -45,7 +45,7 @@ var Upload = (0, import_utils.withFormItem)(import_WithMode.default, {
|
|
|
45
45
|
const { success, message } = (0, import_utils2.checkFileCount)({
|
|
46
46
|
minCount: props.minCount || 0,
|
|
47
47
|
maxCount: props.maxCount || import_constants.DEFAULT_MAX_COUNT,
|
|
48
|
-
valueLength: value.length,
|
|
48
|
+
valueLength: (value == null ? void 0 : value.length) || 0,
|
|
49
49
|
multiple: !!props.multiple
|
|
50
50
|
});
|
|
51
51
|
if (!success) {
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.16",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
68
68
|
"react-window": "^1.8.10",
|
|
69
69
|
"styled-components": "^6.0.0-rc.3",
|
|
70
|
+
"@pisell/icon": "0.0.11",
|
|
70
71
|
"@pisell/date-picker": "1.0.100",
|
|
71
|
-
"@pisell/utils": "1.0.42"
|
|
72
|
-
"@pisell/icon": "0.0.11"
|
|
72
|
+
"@pisell/utils": "1.0.42"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"react": "^18.0.0",
|