@pisell/materials 6.0.13 → 6.0.14
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 +7 -7
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +21 -21
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +1 -1
- package/es/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceMenu/Basic.js +61 -0
- package/es/components/dataSourceComponents/dataSourceMenu/index.js +39 -10
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +6 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +16 -1
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +42 -5
- package/es/components/dataSourceComponents/fields/DatePicker/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/DatePicker/type.d.ts +1 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +9 -3
- package/es/components/date-picker/datePickerCpt.js +4 -2
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +1 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.js +2 -1
- package/es/components/pisellDraggable/index.d.ts +3 -1
- package/es/components/pisellDraggable/index.js +89 -9
- package/es/components/pisellDraggable/types.d.ts +1 -0
- package/es/components/pisellLayout/content.d.ts +2 -0
- package/es/components/pisellLayout/content.js +26 -4
- package/es/components/pisellLayout/footer.d.ts +1 -0
- package/es/components/pisellLayout/footer.js +18 -3
- package/es/components/pisellLayout/header.d.ts +3 -0
- package/es/components/pisellLayout/header.js +26 -3
- package/es/components/pisellLayout/index.js +4 -1
- package/es/components/pisellLayout/index.less +23 -0
- package/es/components/pisellLayout/sider.d.ts +1 -0
- package/es/components/pisellLayout/sider.js +38 -3
- package/es/components/pisellMenu/PisellMenu.d.ts +5 -1
- package/es/components/pisellMenu/PisellMenu.js +10 -4
- package/es/components/pisellMenu/types.d.ts +6 -10
- package/es/hooks/useEngineContext.js +11 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceMenu/Basic.js +92 -0
- package/lib/components/dataSourceComponents/dataSourceMenu/index.js +36 -6
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +6 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +17 -1
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +37 -3
- package/lib/components/dataSourceComponents/fields/DatePicker/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/fields/DatePicker/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +3 -0
- package/lib/components/date-picker/datePickerCpt.js +4 -2
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +1 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.js +1 -0
- package/lib/components/pisellDraggable/index.d.ts +3 -1
- package/lib/components/pisellDraggable/index.js +59 -7
- package/lib/components/pisellDraggable/types.d.ts +1 -0
- package/lib/components/pisellLayout/content.d.ts +2 -0
- package/lib/components/pisellLayout/content.js +14 -3
- package/lib/components/pisellLayout/footer.d.ts +1 -0
- package/lib/components/pisellLayout/footer.js +8 -2
- package/lib/components/pisellLayout/header.d.ts +3 -0
- package/lib/components/pisellLayout/header.js +13 -2
- package/lib/components/pisellLayout/index.js +3 -0
- package/lib/components/pisellLayout/index.less +23 -0
- package/lib/components/pisellLayout/sider.d.ts +1 -0
- package/lib/components/pisellLayout/sider.js +30 -2
- package/lib/components/pisellMenu/PisellMenu.d.ts +5 -1
- package/lib/components/pisellMenu/PisellMenu.js +12 -4
- package/lib/components/pisellMenu/types.d.ts +6 -10
- package/lib/hooks/useEngineContext.js +6 -0
- package/lowcode/data-source-menu/meta.ts +66 -6
- package/lowcode/form-item-translation/meta.ts +1 -1
- package/lowcode/pisell-content/__screenshots__/content.png +0 -0
- package/lowcode/pisell-content/meta.ts +28 -5
- package/lowcode/pisell-footer/__screenshots__/footer.png +0 -0
- package/lowcode/pisell-footer/meta.ts +17 -4
- package/lowcode/pisell-header/__screenshots__/header.png +0 -0
- package/lowcode/pisell-header/meta.ts +29 -5
- package/lowcode/pisell-layout/__screenshots__/layout.png +0 -0
- package/lowcode/pisell-layout/meta.ts +10 -5
- package/lowcode/pisell-sider/__screenshots__/sider.png +0 -0
- package/lowcode/pisell-sider/meta.ts +41 -4
- package/package.json +30 -28
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.707 4.293a1 1 0 0 1 0 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L16.586 13H5a1 1 0 1 1 0-2h11.586l-5.293-5.293a1 1 0 0 1 0-1.414Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm11.258-3.976a2 2 0 0 0-2.225 1.308 1 1 0 1 1-1.886-.664 4 4 0 0 1 7.773 1.333c0 1.53-1.135 2.54-1.945 3.081a8.044 8.044 0 0 1-1.686.848l-.035.013-.011.003-.004.002h-.002L11.92 13l.316.949a1 1 0 0 1-.633-1.897l.016-.006.074-.027a6.051 6.051 0 0 0 1.172-.6c.69-.46 1.055-.95 1.055-1.419v-.001a2 2 0 0 0-1.662-1.975ZM11 17a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.293 3.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L8 6.414V20a1 1 0 1 1-2 0V6.414L3.707 8.707a1 1 0 0 1-1.414-1.414l4-4ZM16 17.586V4a1 1 0 1 1 2 0v13.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L16 17.586Z"/></svg>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ModeType } from '../../type';
|
|
3
3
|
export interface FormSettingContextType {
|
|
4
|
-
onDataSourceFinish?: (values: any, result: any) => void;
|
|
4
|
+
onDataSourceFinish?: (values: any, result: any, form: any) => void;
|
|
5
5
|
renderMode?: ModeType;
|
|
6
6
|
groupInfoPosition?: 'top' | 'side';
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -155,7 +155,7 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
155
155
|
result = _context2.sent;
|
|
156
156
|
// 数据源提交成功
|
|
157
157
|
if (onDataSourceFinish) {
|
|
158
|
-
onDataSourceFinish(formattedValues, result);
|
|
158
|
+
onDataSourceFinish(formattedValues, result, form);
|
|
159
159
|
}
|
|
160
160
|
if (refreshData) {
|
|
161
161
|
refreshTableData === null || refreshTableData === void 0 ? void 0 : refreshTableData();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
4
|
+
import BaseMenu from "../../pisellMenu";
|
|
5
|
+
/**
|
|
6
|
+
* @title: 数据源表单组件
|
|
7
|
+
* @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
|
|
8
|
+
*/
|
|
9
|
+
var DataSourceMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
10
|
+
var _appHelper$utils, _appHelper$utils$getA2, _appHelper$utils$getA3, _appHelper$utils$getA4;
|
|
11
|
+
var _useEngineContext = useEngineContext(),
|
|
12
|
+
appHelper = _useEngineContext.appHelper;
|
|
13
|
+
var _appHelper$utils$getA = appHelper === null || appHelper === void 0 ? void 0 : (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : (_appHelper$utils$getA2 = _appHelper$utils.getApp) === null || _appHelper$utils$getA2 === void 0 ? void 0 : (_appHelper$utils$getA3 = _appHelper$utils$getA2.call(_appHelper$utils)) === null || _appHelper$utils$getA3 === void 0 ? void 0 : (_appHelper$utils$getA4 = _appHelper$utils$getA3.menuManager) === null || _appHelper$utils$getA4 === void 0 ? void 0 : _appHelper$utils$getA4.useMenu(),
|
|
14
|
+
menuItems = _appHelper$utils$getA.menuItems,
|
|
15
|
+
selectedKeys = _appHelper$utils$getA.selectedKeys,
|
|
16
|
+
openKeys = _appHelper$utils$getA.openKeys,
|
|
17
|
+
setOpenKeys = _appHelper$utils$getA.setOpenKeys,
|
|
18
|
+
getShowChildren = _appHelper$utils$getA.getShowChildren,
|
|
19
|
+
handleClick = _appHelper$utils$getA.handleClick;
|
|
20
|
+
// 递归渲染菜单项
|
|
21
|
+
var renderMenuItems = function renderMenuItems(items) {
|
|
22
|
+
return items.map(function (item) {
|
|
23
|
+
if (item.hide) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var _children = getShowChildren(item.children || []);
|
|
27
|
+
if (_children !== null && _children !== void 0 && _children.length) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(BaseMenu.SubMenu, {
|
|
29
|
+
key: item.key,
|
|
30
|
+
title: item.label,
|
|
31
|
+
icon: item.icon,
|
|
32
|
+
router: item.path
|
|
33
|
+
}, renderMenuItems(_children));
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/React.createElement(BaseMenu.Item, {
|
|
36
|
+
key: item.key,
|
|
37
|
+
icon: item.icon,
|
|
38
|
+
router: item.path
|
|
39
|
+
}, item.label);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/React.createElement(BaseMenu, _extends({
|
|
43
|
+
ref: ref,
|
|
44
|
+
mode: "inline"
|
|
45
|
+
// theme="dark"
|
|
46
|
+
,
|
|
47
|
+
selectedKeys: selectedKeys,
|
|
48
|
+
openKeys: openKeys,
|
|
49
|
+
onOpenChange: setOpenKeys,
|
|
50
|
+
onClick: function onClick(_ref) {
|
|
51
|
+
var _item$props;
|
|
52
|
+
var item = _ref.item;
|
|
53
|
+
handleClick((_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.router);
|
|
54
|
+
}
|
|
55
|
+
}, props, {
|
|
56
|
+
other: {
|
|
57
|
+
items: undefined
|
|
58
|
+
}
|
|
59
|
+
}), renderMenuItems(menuItems));
|
|
60
|
+
});
|
|
61
|
+
export default DataSourceMenu;
|
|
@@ -1,19 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
3
|
+
import PisellMenu from "../../pisellMenu";
|
|
4
4
|
import useVariables from "../hooks/useVariables";
|
|
5
|
-
|
|
5
|
+
import BaseMenu from "./Basic";
|
|
6
6
|
/**
|
|
7
7
|
* @title: 数据源表单组件
|
|
8
8
|
* @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
|
|
9
9
|
*/
|
|
10
|
-
var DataSourceMenu =
|
|
10
|
+
var DataSourceMenu = function DataSourceMenu(props, ref) {
|
|
11
|
+
var _appHelper$utils, _appHelper$utils$getA, _appHelper$utils$getA2, _appHelper$utils$getA3;
|
|
11
12
|
var dataSource = props.dataSource;
|
|
12
13
|
var _useVariables = useVariables(),
|
|
13
14
|
parseVariable = _useVariables.parseVariable;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var _useEngineContext = useEngineContext(),
|
|
16
|
+
appHelper = _useEngineContext.appHelper;
|
|
17
|
+
var _dataSource = useMemo(function () {
|
|
18
|
+
if (Array.isArray(dataSource)) {
|
|
19
|
+
return dataSource;
|
|
20
|
+
}
|
|
21
|
+
if (props.__designMode === 'design') {
|
|
22
|
+
return [{
|
|
23
|
+
label: '菜单项1',
|
|
24
|
+
key: 'item-1',
|
|
25
|
+
path: '/item-1'
|
|
26
|
+
}, {
|
|
27
|
+
label: '菜单项2',
|
|
28
|
+
key: 'item-2',
|
|
29
|
+
path: '/item-2'
|
|
30
|
+
}];
|
|
31
|
+
}
|
|
32
|
+
if (typeof dataSource === 'string') {
|
|
33
|
+
return parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(dataSource);
|
|
34
|
+
}
|
|
35
|
+
return [];
|
|
36
|
+
}, [dataSource]);
|
|
37
|
+
|
|
38
|
+
// 设计模式下使用PisellMenu, 否则缺少app注入导致报错
|
|
39
|
+
if (props.__designMode === 'design') {
|
|
40
|
+
return /*#__PURE__*/React.createElement(PisellMenu, props);
|
|
41
|
+
}
|
|
42
|
+
var MenuProvider = appHelper === null || appHelper === void 0 ? void 0 : (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : (_appHelper$utils$getA = _appHelper$utils.getApp) === null || _appHelper$utils$getA === void 0 ? void 0 : (_appHelper$utils$getA2 = _appHelper$utils$getA.call(_appHelper$utils)) === null || _appHelper$utils$getA2 === void 0 ? void 0 : (_appHelper$utils$getA3 = _appHelper$utils$getA2.menuManager) === null || _appHelper$utils$getA3 === void 0 ? void 0 : _appHelper$utils$getA3.MenuProvider;
|
|
43
|
+
console.log('MenuProvider11', appHelper);
|
|
44
|
+
return /*#__PURE__*/React.createElement(MenuProvider, {
|
|
45
|
+
menus: _dataSource
|
|
46
|
+
}, /*#__PURE__*/React.createElement(BaseMenu, props));
|
|
47
|
+
};
|
|
19
48
|
export default DataSourceMenu;
|
|
@@ -9,12 +9,16 @@ export declare type UseFormatParams = {
|
|
|
9
9
|
dataSourceKey: string;
|
|
10
10
|
fields: Field[];
|
|
11
11
|
};
|
|
12
|
-
export declare type
|
|
12
|
+
export declare type ApiListResult = {
|
|
13
13
|
list: any[];
|
|
14
14
|
count: number;
|
|
15
|
-
page: number;
|
|
16
15
|
size: number;
|
|
16
|
+
} & ({
|
|
17
|
+
page: number;
|
|
17
18
|
} | {
|
|
19
|
+
skip: number;
|
|
20
|
+
});
|
|
21
|
+
export declare type FormatListResultParams = ApiListResult | {
|
|
18
22
|
data: any[];
|
|
19
23
|
meta: {
|
|
20
24
|
count: number;
|
|
@@ -122,7 +122,7 @@ var useFormat = function useFormat(_ref4) {
|
|
|
122
122
|
fields = _ref4.fields;
|
|
123
123
|
// list接口请求 结果格式化
|
|
124
124
|
var formatListResult = useMemoizedFn(function (res) {
|
|
125
|
-
if (dataSourceKey === 'pisell2-api' && 'list' in res) {
|
|
125
|
+
if (dataSourceKey === 'pisell2-api' && 'list' in res && 'page' in res) {
|
|
126
126
|
return {
|
|
127
127
|
data: res.list,
|
|
128
128
|
count: res.count,
|
|
@@ -130,6 +130,15 @@ var useFormat = function useFormat(_ref4) {
|
|
|
130
130
|
pageSize: res.size
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
+
if (dataSourceKey === 'mypisell-api' && 'list' in res && 'skip' in res) {
|
|
134
|
+
var skip = typeof res.skip === 'number' ? res.skip : 1;
|
|
135
|
+
return {
|
|
136
|
+
data: res.list,
|
|
137
|
+
count: res.count,
|
|
138
|
+
page: skip - 1 || 1,
|
|
139
|
+
pageSize: res.size
|
|
140
|
+
};
|
|
141
|
+
}
|
|
133
142
|
if ('meta' in res) {
|
|
134
143
|
return {
|
|
135
144
|
data: res.data,
|
|
@@ -156,6 +165,12 @@ var useFormat = function useFormat(_ref4) {
|
|
|
156
165
|
size: (params === null || params === void 0 ? void 0 : params.pageSize) || 10
|
|
157
166
|
}, customApiFormatFilter(params.filter || {}));
|
|
158
167
|
}
|
|
168
|
+
if (dataSourceKey === 'mypisell-api') {
|
|
169
|
+
return _objectSpread({
|
|
170
|
+
skip: (params === null || params === void 0 ? void 0 : params.page) || 1,
|
|
171
|
+
num: (params === null || params === void 0 ? void 0 : params.pageSize) || 10
|
|
172
|
+
}, customApiFormatFilter(params.filter || {}));
|
|
173
|
+
}
|
|
159
174
|
return params;
|
|
160
175
|
});
|
|
161
176
|
var formatCreateUpdateParams = useMemoizedFn(function (params) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import { DatePickerProps } from './type';
|
|
3
3
|
import './ReadPretty.less';
|
|
4
|
-
declare const DatePickerReadPretty:
|
|
4
|
+
declare const DatePickerReadPretty: FC<DatePickerProps>;
|
|
5
5
|
export default DatePickerReadPretty;
|
|
@@ -1,14 +1,51 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
+
import usePisellConfig from "../../../pisell-config-provider/hooks/usePisellConfig";
|
|
4
5
|
import "./ReadPretty.less";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var DEFAULT_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
7
|
+
var DATE_FORMATS = {
|
|
8
|
+
'zh-CN': {
|
|
9
|
+
withTime: 'YYYY-MM-DD HH:mm:ss',
|
|
10
|
+
withoutTime: 'YYYY-MM-DD'
|
|
11
|
+
},
|
|
12
|
+
'en-US': {
|
|
13
|
+
withTime: 'HH:mm:ss YYYY-MM-DD',
|
|
14
|
+
withoutTime: 'YYYY-MM-DD'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var DatePickerReadPretty = function DatePickerReadPretty(_ref) {
|
|
18
|
+
var value = _ref.value,
|
|
19
|
+
renderMode = _ref.renderMode,
|
|
20
|
+
showTime = _ref.showTime;
|
|
21
|
+
var _usePisellConfig = usePisellConfig(),
|
|
22
|
+
_usePisellConfig$loca = _usePisellConfig.locale,
|
|
23
|
+
locale = _usePisellConfig$loca === void 0 ? 'zh-CN' : _usePisellConfig$loca;
|
|
24
|
+
var dateFormat = useMemo(function () {
|
|
25
|
+
if (locale in DATE_FORMATS) {
|
|
26
|
+
var formats = DATE_FORMATS[locale];
|
|
27
|
+
return showTime ? formats.withTime : formats.withoutTime;
|
|
28
|
+
}
|
|
29
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
30
|
+
console.warn("Unsupported locale: ".concat(locale, ", falling back to default format"));
|
|
31
|
+
}
|
|
32
|
+
return DEFAULT_FORMAT;
|
|
33
|
+
}, [locale, showTime]);
|
|
34
|
+
var formattedDate = useMemo(function () {
|
|
35
|
+
if (!value) return '';
|
|
36
|
+
try {
|
|
37
|
+
return dayjs(value).format(dateFormat);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
+
console.error('Error formatting date:', error);
|
|
41
|
+
}
|
|
42
|
+
return '';
|
|
43
|
+
}
|
|
44
|
+
}, [value, dateFormat]);
|
|
8
45
|
return /*#__PURE__*/React.createElement("span", {
|
|
9
46
|
className: classNames('pisell-date-picker-read-pretty', {
|
|
10
47
|
'pisell-date-picker-read-pretty-table-view': renderMode === 'tableView'
|
|
11
48
|
})
|
|
12
|
-
},
|
|
49
|
+
}, formattedDate);
|
|
13
50
|
};
|
|
14
51
|
export default DatePickerReadPretty;
|
|
@@ -11,7 +11,7 @@ import ReadPretty from "./ReadPretty";
|
|
|
11
11
|
import { withMode } from "../../dataSourceForm/utils";
|
|
12
12
|
var DatePickerWithMode = withMode(DatePickerCpt, ReadPretty, function (props) {
|
|
13
13
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
14
|
-
value: isString(props.value) ? dayjs(props.value) : props.value
|
|
14
|
+
value: isString(props.value) && props.value ? dayjs(props.value) : props.value
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
export default DatePickerWithMode;
|
|
@@ -116,13 +116,19 @@ var useActions = function useActions() {
|
|
|
116
116
|
case 2:
|
|
117
117
|
result = _context.sent;
|
|
118
118
|
if (!['pisell2-api', 'mypisell-api'].includes(dataSourceKey)) {
|
|
119
|
-
_context.next =
|
|
119
|
+
_context.next = 7;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (!('mypisell-api' === dataSourceKey && designMode === 'design')) {
|
|
123
|
+
_context.next = 6;
|
|
120
124
|
break;
|
|
121
125
|
}
|
|
122
|
-
return _context.abrupt("return", result.data);
|
|
123
|
-
case 5:
|
|
124
126
|
return _context.abrupt("return", result);
|
|
125
127
|
case 6:
|
|
128
|
+
return _context.abrupt("return", result.data);
|
|
129
|
+
case 7:
|
|
130
|
+
return _context.abrupt("return", result);
|
|
131
|
+
case 8:
|
|
126
132
|
case "end":
|
|
127
133
|
return _context.stop();
|
|
128
134
|
}
|
|
@@ -84,7 +84,8 @@ var DatePickerCpt = function DatePickerCpt(props) {
|
|
|
84
84
|
setValue(value);
|
|
85
85
|
}, [value]);
|
|
86
86
|
useEffect(function () {
|
|
87
|
-
|
|
87
|
+
var _value$format;
|
|
88
|
+
setValueStr((_value === null || _value === void 0 ? void 0 : (_value$format = _value.format) === null || _value$format === void 0 ? void 0 : _value$format.call(_value, format || 'YYYY-MM-DD')) || '');
|
|
88
89
|
}, [_value]);
|
|
89
90
|
var customPresetItems = useMemo(function () {
|
|
90
91
|
var preset = [{
|
|
@@ -218,6 +219,7 @@ var DatePickerCpt = function DatePickerCpt(props) {
|
|
|
218
219
|
});
|
|
219
220
|
};
|
|
220
221
|
var timeInputProps = useMemo(function () {
|
|
222
|
+
var _value$format2;
|
|
221
223
|
var step = 1;
|
|
222
224
|
var _format = '';
|
|
223
225
|
if ((showTime === null || showTime === void 0 ? void 0 : showTime.format) === 'HH:mm') {
|
|
@@ -233,7 +235,7 @@ var DatePickerCpt = function DatePickerCpt(props) {
|
|
|
233
235
|
var val = e.target.value;
|
|
234
236
|
handleTimeChange(window.dayjs(val, _format));
|
|
235
237
|
},
|
|
236
|
-
value: _value === null || _value === void 0 ? void 0 : _value.format(_format)
|
|
238
|
+
value: _value === null || _value === void 0 ? void 0 : (_value$format2 = _value.format) === null || _value$format2 === void 0 ? void 0 : _value$format2.call(_value, _format)
|
|
237
239
|
};
|
|
238
240
|
}, [showTime, _value]);
|
|
239
241
|
if (!picker || picker === 'date') {
|
|
@@ -17,5 +17,6 @@ export interface Props extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
|
|
|
17
17
|
wrapperRef?(node: HTMLLIElement): void;
|
|
18
18
|
item: TreeItemType;
|
|
19
19
|
renderItem?(item: TreeItemType): React.ReactNode;
|
|
20
|
+
isBlocked?: boolean;
|
|
20
21
|
}
|
|
21
22
|
export declare const TreeItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["childCount", "clone", "depth", "disableSelection", "disableInteraction", "ghost", "handleProps", "indentationWidth", "indicator", "collapsed", "onCollapse", "onRemove", "style", "wrapperRef", "item", "renderItem"];
|
|
1
|
+
var _excluded = ["childCount", "clone", "depth", "disableSelection", "disableInteraction", "ghost", "handleProps", "indentationWidth", "indicator", "collapsed", "onCollapse", "onRemove", "style", "wrapperRef", "item", "renderItem", "isBlocked"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -23,6 +23,7 @@ export var TreeItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
23
|
wrapperRef = props.wrapperRef,
|
|
24
24
|
item = props.item,
|
|
25
25
|
renderItem = props.renderItem,
|
|
26
|
+
isBlocked = props.isBlocked,
|
|
26
27
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
27
28
|
if (renderItem) {
|
|
28
29
|
return renderItem(props);
|
|
@@ -21,7 +21,9 @@ interface Props {
|
|
|
21
21
|
onChange?: (items: TreeItems) => void;
|
|
22
22
|
/** 删除节点前 */
|
|
23
23
|
onRemoveBefore?: (item: TreeItem) => Promise<boolean>;
|
|
24
|
+
/** 最大层级 */
|
|
25
|
+
maxLevel?: number;
|
|
24
26
|
}
|
|
25
|
-
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, }: Props): React.JSX.Element;
|
|
27
|
+
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, maxLevel, }: Props): React.JSX.Element;
|
|
26
28
|
declare const Demo: () => React.JSX.Element;
|
|
27
29
|
export default Demo;
|
|
@@ -50,7 +50,8 @@ var initialItems = [{
|
|
|
50
50
|
children: []
|
|
51
51
|
}, {
|
|
52
52
|
id: 'Winter',
|
|
53
|
-
children: []
|
|
53
|
+
children: [],
|
|
54
|
+
disabledDrop: true
|
|
54
55
|
}]
|
|
55
56
|
}, {
|
|
56
57
|
id: 'About Us',
|
|
@@ -120,7 +121,9 @@ export function SortableTree(_ref3) {
|
|
|
120
121
|
removable = _ref3$removable === void 0 ? true : _ref3$removable,
|
|
121
122
|
renderItem = _ref3.renderItem,
|
|
122
123
|
onChange = _ref3.onChange,
|
|
123
|
-
onRemoveBefore = _ref3.onRemoveBefore
|
|
124
|
+
onRemoveBefore = _ref3.onRemoveBefore,
|
|
125
|
+
_ref3$maxLevel = _ref3.maxLevel,
|
|
126
|
+
maxLevel = _ref3$maxLevel === void 0 ? 3 : _ref3$maxLevel;
|
|
124
127
|
// 状态管理
|
|
125
128
|
/** 当前树形数据 */
|
|
126
129
|
var _useState = useState([]),
|
|
@@ -146,6 +149,9 @@ export function SortableTree(_ref3) {
|
|
|
146
149
|
console.log('初始化', value);
|
|
147
150
|
setItems(value);
|
|
148
151
|
}, [value]);
|
|
152
|
+
var flattenTreeData = useMemo(function () {
|
|
153
|
+
return flattenTree(items);
|
|
154
|
+
}, [items]);
|
|
149
155
|
|
|
150
156
|
/**
|
|
151
157
|
* 扁平化处理树形数据
|
|
@@ -154,16 +160,15 @@ export function SortableTree(_ref3) {
|
|
|
154
160
|
* 3. 移除被折叠节点的子节点
|
|
155
161
|
*/
|
|
156
162
|
var flattenedItems = useMemo(function () {
|
|
157
|
-
var
|
|
158
|
-
var collapsedItems = flattenedTree.reduce(function (acc, _ref4) {
|
|
163
|
+
var collapsedItems = flattenTreeData.reduce(function (acc, _ref4) {
|
|
159
164
|
var children = _ref4.children,
|
|
160
165
|
collapsed = _ref4.collapsed,
|
|
161
166
|
id = _ref4.id;
|
|
162
167
|
return collapsed && children.length ? [].concat(_toConsumableArray(acc), [id]) : acc;
|
|
163
168
|
}, []);
|
|
164
|
-
return removeChildrenOf(
|
|
165
|
-
}, [activeId,
|
|
166
|
-
|
|
169
|
+
return removeChildrenOf(flattenTreeData, activeId != null ? [activeId].concat(_toConsumableArray(collapsedItems)) : collapsedItems);
|
|
170
|
+
}, [activeId, flattenTreeData]);
|
|
171
|
+
console.log('flattenedItems', flattenedItems);
|
|
167
172
|
/**
|
|
168
173
|
* 计算拖拽投影
|
|
169
174
|
* 根据当前拖拽状态计算目标位置和深度
|
|
@@ -198,6 +203,39 @@ export function SortableTree(_ref3) {
|
|
|
198
203
|
useEffect(function () {
|
|
199
204
|
document.body.id = 'body';
|
|
200
205
|
}, []);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* 检查子树是否超过最大深度限制
|
|
209
|
+
* @param items 当前项目列表
|
|
210
|
+
* @param itemId 要检查的项目ID
|
|
211
|
+
* @param baseDepth 基础深度
|
|
212
|
+
* @returns 是否超过限制
|
|
213
|
+
*/
|
|
214
|
+
function checkSubtreeDepth(items, itemId, baseDepth) {
|
|
215
|
+
var item = items.find(function (i) {
|
|
216
|
+
return i.id === itemId;
|
|
217
|
+
});
|
|
218
|
+
if (!item) return false;
|
|
219
|
+
|
|
220
|
+
// 首先检查目标位置的深度
|
|
221
|
+
if (baseDepth >= maxLevel) return true;
|
|
222
|
+
|
|
223
|
+
// 获取所有子节点
|
|
224
|
+
var children = items.filter(function (i) {
|
|
225
|
+
return i.parentId === itemId;
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// 如果当前节点已经是最大深度,且尝试添加子节点,则返回 true
|
|
229
|
+
if (baseDepth >= maxLevel - 1 && children.length > 0) return true;
|
|
230
|
+
|
|
231
|
+
// 递归检查所有子节点
|
|
232
|
+
return children.some(function (child) {
|
|
233
|
+
// 计算子节点在新位置的深度
|
|
234
|
+
var childNewDepth = baseDepth + 1;
|
|
235
|
+
// 如果子节点深度超过限制,或者子节点的子树超过限制,则返回 true
|
|
236
|
+
return childNewDepth >= maxLevel || checkSubtreeDepth(items, child.id, childNewDepth);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
201
239
|
return /*#__PURE__*/React.createElement(DndContext, {
|
|
202
240
|
sensors: sensors,
|
|
203
241
|
collisionDetection: closestCenter,
|
|
@@ -264,9 +302,32 @@ export function SortableTree(_ref3) {
|
|
|
264
302
|
setOffsetLeft(delta.x);
|
|
265
303
|
}
|
|
266
304
|
function handleDragOver(_ref9) {
|
|
267
|
-
var _over$id;
|
|
268
305
|
var over = _ref9.over;
|
|
269
|
-
|
|
306
|
+
if (!projected || !over) {
|
|
307
|
+
var _over$id;
|
|
308
|
+
setOverId((_over$id = over === null || over === void 0 ? void 0 : over.id) !== null && _over$id !== void 0 ? _over$id : null);
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// 检查目标父节点是否禁止拖入
|
|
313
|
+
var targetParent = projected.parentId ? flattenedItems.find(function (item) {
|
|
314
|
+
return item.id === projected.parentId;
|
|
315
|
+
}) : null;
|
|
316
|
+
if (targetParent !== null && targetParent !== void 0 && targetParent.disabledDrop) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// 检查目标深度是否超过最大层级限制
|
|
321
|
+
if (projected.depth >= maxLevel) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// 检查整个子树的深度是否会超过限制
|
|
326
|
+
var willExceedLimit = checkSubtreeDepth(flattenTreeData, activeId, projected.depth);
|
|
327
|
+
if (willExceedLimit) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
setOverId(over.id);
|
|
270
331
|
}
|
|
271
332
|
|
|
272
333
|
/**
|
|
@@ -282,6 +343,25 @@ export function SortableTree(_ref3) {
|
|
|
282
343
|
if (projected && over) {
|
|
283
344
|
var depth = projected.depth,
|
|
284
345
|
parentId = projected.parentId;
|
|
346
|
+
|
|
347
|
+
// 检查目标父节点是否禁止拖入
|
|
348
|
+
var targetParent = parentId ? flattenedItems.find(function (item) {
|
|
349
|
+
return item.id === parentId;
|
|
350
|
+
}) : null;
|
|
351
|
+
if (targetParent !== null && targetParent !== void 0 && targetParent.disabledDrop) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// 检查是否超过最大层级限制
|
|
356
|
+
if (depth >= maxLevel) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// 检查整个子树的深度是否会超过限制
|
|
361
|
+
var willExceedLimit = checkSubtreeDepth(flattenTreeData, active.id, depth);
|
|
362
|
+
if (willExceedLimit) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
285
365
|
var clonedItems = JSON.parse(JSON.stringify(flattenTree(items)));
|
|
286
366
|
var overIndex = clonedItems.findIndex(function (_ref11) {
|
|
287
367
|
var id = _ref11.id;
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
export interface PisellContentProps extends Omit<LayoutProps, 'prefixCls'> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
__designMode?: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
scroll?: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare const PisellContent: React.FC<PisellContentProps>;
|
|
8
10
|
export default PisellContent;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className", "height", "scroll"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
11
|
import { Layout } from 'antd';
|
|
12
|
+
import classNames from 'classnames';
|
|
5
13
|
import React, { useMemo } from 'react';
|
|
6
14
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
7
15
|
var Content = Layout.Content;
|
|
8
16
|
var PisellContent = function PisellContent(props) {
|
|
9
17
|
var children = props.children,
|
|
18
|
+
className = props.className,
|
|
19
|
+
height = props.height,
|
|
20
|
+
scroll = props.scroll,
|
|
10
21
|
rest = _objectWithoutProperties(props, _excluded);
|
|
11
22
|
var lowCodeProps = useEngineContext();
|
|
12
|
-
|
|
13
23
|
/**
|
|
14
24
|
* @title: 内容
|
|
15
25
|
* @description: 该组件的children默认注入页面内容
|
|
@@ -18,12 +28,24 @@ var PisellContent = function PisellContent(props) {
|
|
|
18
28
|
* @Author: zhiwei.Wang
|
|
19
29
|
*/
|
|
20
30
|
var pageContent = useMemo(function () {
|
|
31
|
+
var _lowCodeProps$engine, _lowCodeProps$engine$;
|
|
21
32
|
// 引擎模式下没有页面内容, 只展示提示
|
|
22
33
|
if (props.__designMode === 'design') {
|
|
23
34
|
return 'Page content';
|
|
24
35
|
}
|
|
25
|
-
return lowCodeProps.children;
|
|
36
|
+
return lowCodeProps === null || lowCodeProps === void 0 ? void 0 : (_lowCodeProps$engine = lowCodeProps.engine) === null || _lowCodeProps$engine === void 0 ? void 0 : (_lowCodeProps$engine$ = _lowCodeProps$engine.props) === null || _lowCodeProps$engine$ === void 0 ? void 0 : _lowCodeProps$engine$.children;
|
|
26
37
|
}, [props.__designMode]);
|
|
27
|
-
|
|
38
|
+
var contentStyle = useMemo(function () {
|
|
39
|
+
return _objectSpread({
|
|
40
|
+
height: height
|
|
41
|
+
}, rest.style);
|
|
42
|
+
}, [height, rest.style]);
|
|
43
|
+
var contentClassName = classNames('pisell-layout-content', className, {
|
|
44
|
+
'pisell-layout-content-scroll': scroll
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/React.createElement(Content, _extends({}, rest, {
|
|
47
|
+
style: contentStyle,
|
|
48
|
+
className: contentClassName
|
|
49
|
+
}), children, pageContent);
|
|
28
50
|
};
|
|
29
51
|
export default PisellContent;
|
|
@@ -2,6 +2,7 @@ import type { LayoutProps } from 'antd';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface PisellFooterProps extends Omit<LayoutProps, 'prefixCls'> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
+
height?: number;
|
|
5
6
|
}
|
|
6
7
|
declare const PisellFooter: React.FC<PisellFooterProps>;
|
|
7
8
|
export default PisellFooter;
|