@pisell/materials 1.0.528 → 1.0.530
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/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +5 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +2 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +5 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +2 -1
- package/lowcode/data-source-table/meta.ts +32 -3
- package/lowcode/page-header/meta.ts +1 -1
- package/lowcode/page-header/snippets.ts +1 -1
- package/package.json +4 -4
|
@@ -65,7 +65,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
65
65
|
useCustomAction: boolean;
|
|
66
66
|
actionType: string;
|
|
67
67
|
openMode: "modal" | "drawer";
|
|
68
|
-
openContentSize: "small" | "
|
|
68
|
+
openContentSize: "small" | "middle" | "large";
|
|
69
69
|
openTitle: string;
|
|
70
70
|
key: string;
|
|
71
71
|
} | undefined;
|
|
@@ -94,6 +94,11 @@ var useTableProps = function useTableProps(props) {
|
|
|
94
94
|
|
|
95
95
|
// 打开抽屉
|
|
96
96
|
var handleOpenDrawer = useMemoizedFn(function (record, item) {
|
|
97
|
+
if (item.openMode === 'custom') {
|
|
98
|
+
var _item$onClick;
|
|
99
|
+
item === null || item === void 0 ? void 0 : (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, record);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
97
102
|
registerValueVariable === null || registerValueVariable === void 0 ? void 0 : registerValueVariable(componentId, {
|
|
98
103
|
currentRecord: record
|
|
99
104
|
});
|
|
@@ -3,12 +3,13 @@ import { ColumnType } from 'antd/es/table';
|
|
|
3
3
|
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
4
4
|
export declare type OperationItem = {
|
|
5
5
|
label?: string;
|
|
6
|
-
openMode: 'modal' | 'drawer';
|
|
6
|
+
openMode: 'modal' | 'drawer' | 'custom';
|
|
7
7
|
openContentSize: 'small' | 'middle' | 'large';
|
|
8
8
|
openTitle: string;
|
|
9
9
|
actionType: 'detail' | 'edit' | 'delete' | 'custom';
|
|
10
10
|
key: string;
|
|
11
11
|
buttonProps?: any;
|
|
12
|
+
onClick?: (record: any) => void;
|
|
12
13
|
};
|
|
13
14
|
export interface DataSourceTableProps {
|
|
14
15
|
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
@@ -65,7 +65,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
65
65
|
useCustomAction: boolean;
|
|
66
66
|
actionType: string;
|
|
67
67
|
openMode: "modal" | "drawer";
|
|
68
|
-
openContentSize: "small" | "
|
|
68
|
+
openContentSize: "small" | "middle" | "large";
|
|
69
69
|
openTitle: string;
|
|
70
70
|
key: string;
|
|
71
71
|
} | undefined;
|
|
@@ -102,6 +102,11 @@ var useTableProps = (props) => {
|
|
|
102
102
|
return propsSubTitle;
|
|
103
103
|
}, [propsSubTitle]);
|
|
104
104
|
const handleOpenDrawer = (0, import_ahooks.useMemoizedFn)((record, item) => {
|
|
105
|
+
var _a2;
|
|
106
|
+
if (item.openMode === "custom") {
|
|
107
|
+
(_a2 = item == null ? void 0 : item.onClick) == null ? void 0 : _a2.call(item, record);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
105
110
|
registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
|
|
106
111
|
currentRecord: record
|
|
107
112
|
});
|
|
@@ -3,12 +3,13 @@ import { ColumnType } from 'antd/es/table';
|
|
|
3
3
|
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
4
4
|
export declare type OperationItem = {
|
|
5
5
|
label?: string;
|
|
6
|
-
openMode: 'modal' | 'drawer';
|
|
6
|
+
openMode: 'modal' | 'drawer' | 'custom';
|
|
7
7
|
openContentSize: 'small' | 'middle' | 'large';
|
|
8
8
|
openTitle: string;
|
|
9
9
|
actionType: 'detail' | 'edit' | 'delete' | 'custom';
|
|
10
10
|
key: string;
|
|
11
11
|
buttonProps?: any;
|
|
12
|
+
onClick?: (record: any) => void;
|
|
12
13
|
};
|
|
13
14
|
export interface DataSourceTableProps {
|
|
14
15
|
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
@@ -2375,13 +2375,13 @@ const dataSourceTable = {
|
|
|
2375
2375
|
},
|
|
2376
2376
|
tip: {
|
|
2377
2377
|
type: 'i18n',
|
|
2378
|
-
'en-US': 'Open mode | Dialog(modal)、Drawer(drawer)',
|
|
2379
|
-
'zh-CN': '打开方式 | 对话框(modal)、抽屉(drawer)',
|
|
2378
|
+
'en-US': 'Open mode | Dialog(modal)、Drawer(drawer) | Custom(custom)',
|
|
2379
|
+
'zh-CN': '打开方式 | 对话框(modal)、抽屉(drawer) | 自定义(custom)',
|
|
2380
2380
|
},
|
|
2381
2381
|
},
|
|
2382
2382
|
propType: {
|
|
2383
2383
|
type: 'oneOf',
|
|
2384
|
-
value: ['modal', 'drawer'],
|
|
2384
|
+
value: ['modal', 'drawer', 'custom'],
|
|
2385
2385
|
},
|
|
2386
2386
|
setter: {
|
|
2387
2387
|
componentName: 'RadioGroupSetter',
|
|
@@ -2395,11 +2395,40 @@ const dataSourceTable = {
|
|
|
2395
2395
|
title: '抽屉',
|
|
2396
2396
|
value: 'drawer',
|
|
2397
2397
|
},
|
|
2398
|
+
{
|
|
2399
|
+
title: '自定义',
|
|
2400
|
+
value: 'custom',
|
|
2401
|
+
},
|
|
2398
2402
|
],
|
|
2399
2403
|
},
|
|
2400
2404
|
},
|
|
2401
2405
|
defaultValue: 'drawer',
|
|
2402
2406
|
},
|
|
2407
|
+
{
|
|
2408
|
+
name: 'onClick',
|
|
2409
|
+
title: {
|
|
2410
|
+
label: {
|
|
2411
|
+
type: 'i18n',
|
|
2412
|
+
'en-US': 'Click Event',
|
|
2413
|
+
'zh-CN': '点击事件',
|
|
2414
|
+
},
|
|
2415
|
+
tip: {
|
|
2416
|
+
type: 'i18n',
|
|
2417
|
+
'en-US': 'Click event handler',
|
|
2418
|
+
'zh-CN': '点击事件处理函数',
|
|
2419
|
+
},
|
|
2420
|
+
},
|
|
2421
|
+
propType: 'func',
|
|
2422
|
+
setter: [
|
|
2423
|
+
{
|
|
2424
|
+
componentName: 'FunctionSetter',
|
|
2425
|
+
props: {
|
|
2426
|
+
template: 'onClick(record,${extParams}){\n// 点击按钮时的回调\nconsole.log("onClick", record);\n}',
|
|
2427
|
+
},
|
|
2428
|
+
},
|
|
2429
|
+
'VariableSetter',
|
|
2430
|
+
],
|
|
2431
|
+
},
|
|
2403
2432
|
{
|
|
2404
2433
|
name: 'openContentSize',
|
|
2405
2434
|
title: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.530",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"libphonenumber-js": "^1.11.17",
|
|
70
70
|
"swiper": "^8.4.7",
|
|
71
71
|
"react-barcode": "^1.5.3",
|
|
72
|
-
"@pisell/date-picker": "1.0.
|
|
73
|
-
"@pisell/
|
|
74
|
-
"@pisell/
|
|
72
|
+
"@pisell/date-picker": "1.0.115",
|
|
73
|
+
"@pisell/utils": "1.0.43",
|
|
74
|
+
"@pisell/icon": "0.0.10"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": "^18.0.0",
|