@pisell/materials 1.0.633 → 1.0.635
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 +1 -1
- package/build/lowcode/preview.js +5 -5
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.js +16 -16
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +17 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +17 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +9 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +29 -12
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +2 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.js +2 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +8 -1
- package/es/components/iconfont/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +15 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +58 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +9 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +17 -9
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +2 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.js +3 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +6 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lowcode/data-source-table/meta.ts +22 -0
- package/package.json +3 -3
|
@@ -30,7 +30,9 @@ var initialContext = {
|
|
|
30
30
|
destroy: {},
|
|
31
31
|
get: {},
|
|
32
32
|
update: {},
|
|
33
|
-
create: {}
|
|
33
|
+
create: {},
|
|
34
|
+
getCurrentRecord: () => {
|
|
35
|
+
}
|
|
34
36
|
};
|
|
35
37
|
var DataSourceContext = (0, import_react.createContext)(initialContext);
|
|
36
38
|
var DataSourceContext_default = DataSourceContext;
|
|
@@ -39,6 +39,7 @@ var import_DataSourceContext = __toESM(require("./DataSourceContext"));
|
|
|
39
39
|
var import_useActions = __toESM(require("../../hooks/useActions"));
|
|
40
40
|
var import_useVariables = __toESM(require("../../hooks/useVariables"));
|
|
41
41
|
var import_useSetRequest = __toESM(require("../../../../hooks/useSetRequest"));
|
|
42
|
+
var import_useDataSource = __toESM(require("../../hooks/useDataSource"));
|
|
42
43
|
var DataSourceProvider = (props) => {
|
|
43
44
|
const {
|
|
44
45
|
children,
|
|
@@ -51,8 +52,12 @@ var DataSourceProvider = (props) => {
|
|
|
51
52
|
requestOptions,
|
|
52
53
|
__designMode
|
|
53
54
|
} = props;
|
|
55
|
+
const { getCurrentRecord: ctxGetCurrentRecord } = (0, import_useDataSource.default)();
|
|
54
56
|
(0, import_useSetRequest.default)();
|
|
55
57
|
const { parseVariable } = (0, import_useVariables.default)();
|
|
58
|
+
const getCurrentRecord = (0, import_ahooks.useMemoizedFn)(() => {
|
|
59
|
+
return (parseVariable == null ? void 0 : parseVariable(currentValue, {})) || ctxGetCurrentRecord();
|
|
60
|
+
});
|
|
56
61
|
const dataSource = (0, import_utils.isString)(propsDataSource) ? parseVariable == null ? void 0 : parseVariable(propsDataSource) : propsDataSource;
|
|
57
62
|
const standardActions = (0, import_useActions.default)({
|
|
58
63
|
dataSource,
|
|
@@ -85,6 +90,7 @@ var DataSourceProvider = (props) => {
|
|
|
85
90
|
return {
|
|
86
91
|
__designMode,
|
|
87
92
|
dataSource,
|
|
93
|
+
getCurrentRecord,
|
|
88
94
|
list: {
|
|
89
95
|
...listResult,
|
|
90
96
|
data: (overrideData == null ? void 0 : overrideData.list) || listResult.data
|
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(iconfont_exports);
|
|
|
35
35
|
var import_icons = require("@ant-design/icons");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var MyIcon = (0, import_icons.createFromIconfontCN)({
|
|
38
|
-
scriptUrl: "https://static.pisellcdn.com/pisell2/iconfont_1.
|
|
38
|
+
scriptUrl: "https://static.pisellcdn.com/pisell2/iconfont_1.1.js"
|
|
39
39
|
// 在 iconfont.cn 上生成
|
|
40
40
|
});
|
|
41
41
|
var IconFont = (props) => {
|
|
@@ -2637,6 +2637,28 @@ const dataSourceTable = {
|
|
|
2637
2637
|
},
|
|
2638
2638
|
},
|
|
2639
2639
|
},
|
|
2640
|
+
{
|
|
2641
|
+
name: 'softDelete',
|
|
2642
|
+
title: {
|
|
2643
|
+
label: {
|
|
2644
|
+
type: 'i18n',
|
|
2645
|
+
'en-US': 'Soft Delete',
|
|
2646
|
+
'zh-CN': '软删除',
|
|
2647
|
+
},
|
|
2648
|
+
tip: {
|
|
2649
|
+
type: 'i18n',
|
|
2650
|
+
'en-US': 'Whether to use soft delete',
|
|
2651
|
+
'zh-CN': '是否使用软删除',
|
|
2652
|
+
},
|
|
2653
|
+
},
|
|
2654
|
+
propType: 'bool',
|
|
2655
|
+
setter: 'BoolSetter',
|
|
2656
|
+
defaultValue: false,
|
|
2657
|
+
condition: {
|
|
2658
|
+
type: 'JSFunction',
|
|
2659
|
+
value: "target => target.parent.getPropValue('actionType') === 'delete'",
|
|
2660
|
+
},
|
|
2661
|
+
},
|
|
2640
2662
|
{
|
|
2641
2663
|
name: 'show',
|
|
2642
2664
|
title: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.635",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"swiper": "^8.4.7",
|
|
71
71
|
"react-barcode": "^1.5.3",
|
|
72
72
|
"vod-js-sdk-v6": "^1.4.11",
|
|
73
|
-
"@pisell/
|
|
73
|
+
"@pisell/icon": "0.0.10",
|
|
74
74
|
"@pisell/date-picker": "1.0.115",
|
|
75
|
-
"@pisell/
|
|
75
|
+
"@pisell/utils": "1.0.43"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": "^18.0.0",
|