@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
|
@@ -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>>;
|
|
@@ -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;
|
|
@@ -51,7 +51,7 @@ var initialItems = [
|
|
|
51
51
|
{ id: "Spring", children: [] },
|
|
52
52
|
{ id: "Summer", children: [] },
|
|
53
53
|
{ id: "Fall", children: [] },
|
|
54
|
-
{ id: "Winter", children: [] }
|
|
54
|
+
{ id: "Winter", children: [], disabledDrop: true }
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
57
|
{
|
|
@@ -101,7 +101,8 @@ function SortableTree({
|
|
|
101
101
|
removable = true,
|
|
102
102
|
renderItem,
|
|
103
103
|
onChange,
|
|
104
|
-
onRemoveBefore
|
|
104
|
+
onRemoveBefore,
|
|
105
|
+
maxLevel = 3
|
|
105
106
|
}) {
|
|
106
107
|
const [items, setItems] = (0, import_react.useState)([]);
|
|
107
108
|
const [activeId, setActiveId] = (0, import_react.useState)(null);
|
|
@@ -111,17 +112,20 @@ function SortableTree({
|
|
|
111
112
|
console.log("初始化", value);
|
|
112
113
|
setItems(value);
|
|
113
114
|
}, [value]);
|
|
115
|
+
const flattenTreeData = (0, import_react.useMemo)(() => {
|
|
116
|
+
return (0, import_utilities2.flattenTree)(items);
|
|
117
|
+
}, [items]);
|
|
114
118
|
const flattenedItems = (0, import_react.useMemo)(() => {
|
|
115
|
-
const
|
|
116
|
-
const collapsedItems = flattenedTree.reduce(
|
|
119
|
+
const collapsedItems = flattenTreeData.reduce(
|
|
117
120
|
(acc, { children, collapsed, id }) => collapsed && children.length ? [...acc, id] : acc,
|
|
118
121
|
[]
|
|
119
122
|
);
|
|
120
123
|
return (0, import_utilities2.removeChildrenOf)(
|
|
121
|
-
|
|
124
|
+
flattenTreeData,
|
|
122
125
|
activeId != null ? [activeId, ...collapsedItems] : collapsedItems
|
|
123
126
|
);
|
|
124
|
-
}, [activeId,
|
|
127
|
+
}, [activeId, flattenTreeData]);
|
|
128
|
+
console.log("flattenedItems", flattenedItems);
|
|
125
129
|
const projected = activeId && overId ? (0, import_utilities2.getProjection)(
|
|
126
130
|
flattenedItems,
|
|
127
131
|
activeId,
|
|
@@ -148,6 +152,20 @@ function SortableTree({
|
|
|
148
152
|
(0, import_react.useEffect)(() => {
|
|
149
153
|
document.body.id = "body";
|
|
150
154
|
}, []);
|
|
155
|
+
function checkSubtreeDepth(items2, itemId, baseDepth) {
|
|
156
|
+
const item = items2.find((i) => i.id === itemId);
|
|
157
|
+
if (!item)
|
|
158
|
+
return false;
|
|
159
|
+
if (baseDepth >= maxLevel)
|
|
160
|
+
return true;
|
|
161
|
+
const children = items2.filter((i) => i.parentId === itemId);
|
|
162
|
+
if (baseDepth >= maxLevel - 1 && children.length > 0)
|
|
163
|
+
return true;
|
|
164
|
+
return children.some((child) => {
|
|
165
|
+
const childNewDepth = baseDepth + 1;
|
|
166
|
+
return childNewDepth >= maxLevel || checkSubtreeDepth(items2, child.id, childNewDepth);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
151
169
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
152
170
|
import_core.DndContext,
|
|
153
171
|
{
|
|
@@ -209,12 +227,46 @@ function SortableTree({
|
|
|
209
227
|
setOffsetLeft(delta.x);
|
|
210
228
|
}
|
|
211
229
|
function handleDragOver({ over }) {
|
|
212
|
-
|
|
230
|
+
if (!projected || !over) {
|
|
231
|
+
setOverId((over == null ? void 0 : over.id) ?? null);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const targetParent = projected.parentId ? flattenedItems.find((item) => item.id === projected.parentId) : null;
|
|
235
|
+
if (targetParent == null ? void 0 : targetParent.disabledDrop) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (projected.depth >= maxLevel) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const willExceedLimit = checkSubtreeDepth(
|
|
242
|
+
flattenTreeData,
|
|
243
|
+
activeId,
|
|
244
|
+
projected.depth
|
|
245
|
+
);
|
|
246
|
+
if (willExceedLimit) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
setOverId(over.id);
|
|
213
250
|
}
|
|
214
251
|
function handleDragEnd({ active, over }) {
|
|
215
252
|
resetState();
|
|
216
253
|
if (projected && over) {
|
|
217
254
|
const { depth, parentId } = projected;
|
|
255
|
+
const targetParent = parentId ? flattenedItems.find((item) => item.id === parentId) : null;
|
|
256
|
+
if (targetParent == null ? void 0 : targetParent.disabledDrop) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (depth >= maxLevel) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const willExceedLimit = checkSubtreeDepth(
|
|
263
|
+
flattenTreeData,
|
|
264
|
+
active.id,
|
|
265
|
+
depth
|
|
266
|
+
);
|
|
267
|
+
if (willExceedLimit) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
218
270
|
const clonedItems = JSON.parse(
|
|
219
271
|
JSON.stringify((0, import_utilities2.flattenTree)(items))
|
|
220
272
|
);
|
|
@@ -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;
|
|
@@ -33,18 +33,29 @@ __export(content_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(content_exports);
|
|
35
35
|
var import_antd = require("antd");
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
37
|
var import_react = __toESM(require("react"));
|
|
37
38
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
38
39
|
var { Content } = import_antd.Layout;
|
|
39
40
|
var PisellContent = (props) => {
|
|
40
|
-
const { children, ...rest } = props;
|
|
41
|
+
const { children, className, height, scroll, ...rest } = props;
|
|
41
42
|
const lowCodeProps = (0, import_useEngineContext.default)();
|
|
42
43
|
const pageContent = (0, import_react.useMemo)(() => {
|
|
44
|
+
var _a, _b;
|
|
43
45
|
if (props.__designMode === "design") {
|
|
44
46
|
return "Page content";
|
|
45
47
|
}
|
|
46
|
-
return lowCodeProps.children;
|
|
48
|
+
return (_b = (_a = lowCodeProps == null ? void 0 : lowCodeProps.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.children;
|
|
47
49
|
}, [props.__designMode]);
|
|
48
|
-
|
|
50
|
+
const contentStyle = (0, import_react.useMemo)(() => {
|
|
51
|
+
return {
|
|
52
|
+
height,
|
|
53
|
+
...rest.style
|
|
54
|
+
};
|
|
55
|
+
}, [height, rest.style]);
|
|
56
|
+
const contentClassName = (0, import_classnames.default)("pisell-layout-content", className, {
|
|
57
|
+
"pisell-layout-content-scroll": scroll
|
|
58
|
+
});
|
|
59
|
+
return /* @__PURE__ */ import_react.default.createElement(Content, { ...rest, style: contentStyle, className: contentClassName }, children, pageContent);
|
|
49
60
|
};
|
|
50
61
|
var content_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;
|
|
@@ -36,7 +36,13 @@ var import_antd = require("antd");
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var { Footer } = import_antd.Layout;
|
|
38
38
|
var PisellFooter = (props) => {
|
|
39
|
-
const { children, ...rest } = props;
|
|
40
|
-
|
|
39
|
+
const { children, height, ...rest } = props;
|
|
40
|
+
const footerStyle = (0, import_react.useMemo)(() => {
|
|
41
|
+
return {
|
|
42
|
+
height,
|
|
43
|
+
...rest.style
|
|
44
|
+
};
|
|
45
|
+
}, [height, rest.style]);
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(Footer, { ...rest, style: footerStyle }, children);
|
|
41
47
|
};
|
|
42
48
|
var footer_default = PisellFooter;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { LayoutProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
3
4
|
export interface PisellHeaderProps extends Omit<LayoutProps, 'prefixCls'> {
|
|
4
5
|
children?: React.ReactNode;
|
|
6
|
+
height?: number;
|
|
7
|
+
fixed?: boolean;
|
|
5
8
|
}
|
|
6
9
|
declare const PisellHeader: React.FC<PisellHeaderProps>;
|
|
7
10
|
export default PisellHeader;
|
|
@@ -33,10 +33,21 @@ __export(header_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(header_exports);
|
|
35
35
|
var import_antd = require("antd");
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
37
|
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
37
39
|
var { Header } = import_antd.Layout;
|
|
38
40
|
var PisellHeader = (props) => {
|
|
39
|
-
const { children, ...rest } = props;
|
|
40
|
-
|
|
41
|
+
const { children, className, height, fixed, ...rest } = props;
|
|
42
|
+
const headerStyle = (0, import_react.useMemo)(() => {
|
|
43
|
+
return {
|
|
44
|
+
height,
|
|
45
|
+
...rest.style
|
|
46
|
+
};
|
|
47
|
+
}, [height, rest.style]);
|
|
48
|
+
const headerClassName = (0, import_classnames.default)("pisell-layout-header", className, {
|
|
49
|
+
// 'pisell-layout-header-fixed': fixed,
|
|
50
|
+
});
|
|
51
|
+
return /* @__PURE__ */ import_react.default.createElement(Header, { ...rest, style: headerStyle, className: headerClassName }, children);
|
|
41
52
|
};
|
|
42
53
|
var header_default = PisellHeader;
|
|
@@ -36,6 +36,9 @@ var import_antd = require("antd");
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var PisellLayout = (props) => {
|
|
38
38
|
const { children, ...rest } = props;
|
|
39
|
+
(0, import_react.useEffect)(() => {
|
|
40
|
+
document.body.id = "body";
|
|
41
|
+
}, []);
|
|
39
42
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Layout, { ...rest }, children);
|
|
40
43
|
};
|
|
41
44
|
PisellLayout.Header = import_antd.Layout.Header;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.pisell-layout {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.pisell-layout-header {}
|
|
6
|
+
|
|
7
|
+
.pisell-layout-header-fixed {
|
|
8
|
+
position: sticky;
|
|
9
|
+
top: 0;
|
|
10
|
+
z-index: 100;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.pisell-layout-content {}
|
|
14
|
+
|
|
15
|
+
.pisell-layout-content-scroll {
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.pisell-layout-sider {}
|
|
20
|
+
|
|
21
|
+
.pisell-lowcode-layout-sider-trigger {
|
|
22
|
+
position: unset;
|
|
23
|
+
}
|
|
@@ -33,10 +33,38 @@ __export(sider_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sider_exports);
|
|
35
35
|
var import_antd = require("antd");
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
37
|
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
37
39
|
var { Sider } = import_antd.Layout;
|
|
38
40
|
var PisellSider = (props) => {
|
|
39
|
-
const { children, ...rest } = props;
|
|
40
|
-
|
|
41
|
+
const { children, collapsible, collapsed, onCollapse, ...rest } = props;
|
|
42
|
+
const [collapsedState, setCollapsedState] = (0, import_react.useState)(collapsed);
|
|
43
|
+
const className = (0, import_classnames.default)("pisell-layout-sider", props.className);
|
|
44
|
+
const _onCollapse = (val, type) => {
|
|
45
|
+
onCollapse == null ? void 0 : onCollapse(val, type);
|
|
46
|
+
setCollapsedState(val);
|
|
47
|
+
};
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
setCollapsedState(collapsed);
|
|
50
|
+
}, [collapsed]);
|
|
51
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
52
|
+
Sider,
|
|
53
|
+
{
|
|
54
|
+
...rest,
|
|
55
|
+
collapsible,
|
|
56
|
+
collapsed: collapsedState,
|
|
57
|
+
onCollapse: _onCollapse,
|
|
58
|
+
className
|
|
59
|
+
},
|
|
60
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: "pisell-layout-sider-content",
|
|
64
|
+
style: { overflowY: "auto", height: "100%" }
|
|
65
|
+
},
|
|
66
|
+
children
|
|
67
|
+
)
|
|
68
|
+
);
|
|
41
69
|
};
|
|
42
70
|
var sider_default = PisellSider;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PisellMenu.less';
|
|
3
3
|
import type { PisellMenuProps } from './types';
|
|
4
|
-
declare const PisellMenu:
|
|
4
|
+
declare const PisellMenu: {
|
|
5
|
+
({ className, style, mode, theme, defaultOpenKeys, defaultSelectedKeys, inlineCollapsed, openKeys, selectedKeys, onOpenChange, onSelect, dataSource, __designMode, children, other, ...restProps }: PisellMenuProps): React.JSX.Element;
|
|
6
|
+
Item: Omit<React.FunctionComponent<import("antd").MenuItemProps>, ""> & (<T extends import("antd").MenuItemProps>(props: T extends infer U extends import("antd").MenuItemProps ? unknown extends U ? import("antd").MenuItemProps : U : import("antd").MenuItemProps, context?: any) => React.ReactElement<any, any> | null);
|
|
7
|
+
SubMenu: React.FC<import("antd").SubMenuProps>;
|
|
8
|
+
};
|
|
5
9
|
export default PisellMenu;
|
|
@@ -49,6 +49,8 @@ var PisellMenu = ({
|
|
|
49
49
|
onSelect,
|
|
50
50
|
dataSource,
|
|
51
51
|
__designMode,
|
|
52
|
+
children,
|
|
53
|
+
other,
|
|
52
54
|
...restProps
|
|
53
55
|
}) => {
|
|
54
56
|
const _dataSource = (0, import_react.useMemo)(() => {
|
|
@@ -59,11 +61,13 @@ var PisellMenu = ({
|
|
|
59
61
|
return [
|
|
60
62
|
{
|
|
61
63
|
label: "菜单项1",
|
|
62
|
-
key: "item-1"
|
|
64
|
+
key: "item-1",
|
|
65
|
+
path: "/item-1"
|
|
63
66
|
},
|
|
64
67
|
{
|
|
65
68
|
label: "菜单项2",
|
|
66
|
-
key: "item-2"
|
|
69
|
+
key: "item-2",
|
|
70
|
+
path: "/item-2"
|
|
67
71
|
}
|
|
68
72
|
];
|
|
69
73
|
}
|
|
@@ -84,8 +88,12 @@ var PisellMenu = ({
|
|
|
84
88
|
selectedKeys,
|
|
85
89
|
onOpenChange,
|
|
86
90
|
onSelect,
|
|
87
|
-
...restProps
|
|
88
|
-
|
|
91
|
+
...restProps,
|
|
92
|
+
...other
|
|
93
|
+
},
|
|
94
|
+
children
|
|
89
95
|
);
|
|
90
96
|
};
|
|
97
|
+
PisellMenu.Item = import_antd.Menu.Item;
|
|
98
|
+
PisellMenu.SubMenu = import_antd.Menu.SubMenu;
|
|
91
99
|
var PisellMenu_default = PisellMenu;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { MenuProps } from 'antd';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
3
|
export interface PisellMenuProps extends Omit<MenuProps, 'items'> {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
@@ -11,20 +11,16 @@ export interface PisellMenuProps extends Omit<MenuProps, 'items'> {
|
|
|
11
11
|
openKeys?: string[];
|
|
12
12
|
selectedKeys?: string[];
|
|
13
13
|
onOpenChange?: (openKeys: string[]) => void;
|
|
14
|
-
onSelect?: (info: {
|
|
15
|
-
key: string;
|
|
16
|
-
keyPath: string[];
|
|
17
|
-
item: ReactNode;
|
|
18
|
-
domEvent: Event;
|
|
19
|
-
selectedKeys: string[];
|
|
20
|
-
}) => void;
|
|
21
14
|
dataSource?: any;
|
|
22
15
|
__designMode?: string;
|
|
16
|
+
other?: PisellMenuProps;
|
|
23
17
|
}
|
|
24
18
|
export interface MenuItemType {
|
|
25
|
-
label: ReactNode;
|
|
26
19
|
key: string;
|
|
27
|
-
|
|
20
|
+
label: string;
|
|
21
|
+
path: string;
|
|
28
22
|
children?: MenuItemType[];
|
|
23
|
+
icon?: string | React.ReactNode;
|
|
24
|
+
hide?: boolean;
|
|
29
25
|
type?: 'group' | 'divider';
|
|
30
26
|
}
|
|
@@ -28,6 +28,12 @@ var useEngineContext = () => {
|
|
|
28
28
|
const context = (0, import_react.useContext)(
|
|
29
29
|
window.__appContext || defaultContext
|
|
30
30
|
);
|
|
31
|
+
if ((context == null ? void 0 : context.appHelper) === void 0) {
|
|
32
|
+
return {
|
|
33
|
+
...context,
|
|
34
|
+
appHelper: window.__appHelper
|
|
35
|
+
};
|
|
36
|
+
}
|
|
31
37
|
return context || {};
|
|
32
38
|
};
|
|
33
39
|
var useEngineContext_default = useEngineContext;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
defaultOpenKeys,
|
|
6
|
+
defaultSelectedKeys,
|
|
7
|
+
inlineCollapsed,
|
|
8
|
+
openKeys,
|
|
9
|
+
selectedKeys,
|
|
10
|
+
onOpenChange,
|
|
11
|
+
onSelect,
|
|
12
|
+
dataSource,
|
|
13
|
+
__designMode,
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
3
16
|
const DataSourceMenuMeta: IPublicTypeComponentMetadata = {
|
|
4
17
|
componentName: 'DataSourceMenu',
|
|
5
18
|
title: '菜单导航',
|
|
@@ -78,15 +91,52 @@ const DataSourceMenuMeta: IPublicTypeComponentMetadata = {
|
|
|
78
91
|
}
|
|
79
92
|
},
|
|
80
93
|
{
|
|
81
|
-
name: '
|
|
82
|
-
propType: '
|
|
83
|
-
description: '
|
|
84
|
-
|
|
94
|
+
name: 'defaultOpenKeys',
|
|
95
|
+
propType: 'array',
|
|
96
|
+
description: '默认展开的菜单项',
|
|
97
|
+
defaultValue: [],
|
|
98
|
+
setter: 'JsonSetter'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'defaultSelectedKeys',
|
|
102
|
+
propType: 'array',
|
|
103
|
+
description: '默认选中的菜单项',
|
|
104
|
+
defaultValue: [],
|
|
105
|
+
setter: 'JsonSetter'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'inlineCollapsed',
|
|
109
|
+
propType: "bool",
|
|
110
|
+
description: '是否内嵌折叠',
|
|
111
|
+
defaultValue: false,
|
|
112
|
+
setter: 'BoolSetter'
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'openKeys',
|
|
116
|
+
propType: 'array',
|
|
117
|
+
description: '展开的菜单项',
|
|
118
|
+
defaultValue: [],
|
|
119
|
+
setter: 'JsonSetter'
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'selectedKeys',
|
|
123
|
+
propType: 'array',
|
|
124
|
+
description: '选中的菜单项',
|
|
125
|
+
defaultValue: [],
|
|
126
|
+
setter: 'JsonSetter'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'other',
|
|
130
|
+
propType: 'object',
|
|
131
|
+
description: '其他属性',
|
|
132
|
+
defaultValue: {},
|
|
133
|
+
setter: 'JsonSetter'
|
|
85
134
|
},
|
|
86
135
|
{
|
|
87
136
|
name: 'style',
|
|
88
137
|
propType: 'object',
|
|
89
138
|
description: '样式',
|
|
139
|
+
defaultValue: {},
|
|
90
140
|
setter: 'StyleSetter'
|
|
91
141
|
}
|
|
92
142
|
],
|
|
@@ -96,8 +146,18 @@ const DataSourceMenuMeta: IPublicTypeComponentMetadata = {
|
|
|
96
146
|
},
|
|
97
147
|
supports: {
|
|
98
148
|
style: true,
|
|
99
|
-
className: true
|
|
100
|
-
|
|
149
|
+
className: true,
|
|
150
|
+
events: [
|
|
151
|
+
{
|
|
152
|
+
name: 'onOpenChange',
|
|
153
|
+
template: "onOpenChange(openKeys,${extParams}){\n// 展开菜单项变化时的回调\nconsole.log('onOpenChange', openKeys);}",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'onSelect',
|
|
157
|
+
template: "onSelect(selectedKeys,${extParams}){\n// 选中菜单项时的回调\nconsole.log('onSelect', selectedKeys);}",
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
101
161
|
}
|
|
102
162
|
};
|
|
103
163
|
|
|
@@ -69,7 +69,7 @@ export default {
|
|
|
69
69
|
target.parent.setPropValue('transform', {
|
|
70
70
|
type: 'JSExpression',
|
|
71
71
|
value:
|
|
72
|
-
'(value) =>
|
|
72
|
+
'(value) => Object.values(value || {}).join("")',
|
|
73
73
|
});
|
|
74
74
|
target.node.getProps().setPropValue('required', value);
|
|
75
75
|
},
|
|
Binary file
|
|
@@ -2,10 +2,11 @@ import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
|
|
|
2
2
|
|
|
3
3
|
const PisellContentMeta: ComponentMetadata = {
|
|
4
4
|
componentName: 'PisellContent',
|
|
5
|
-
title: '
|
|
5
|
+
title: '内容',
|
|
6
6
|
docUrl: '',
|
|
7
|
-
screenshot: '',
|
|
7
|
+
screenshot: require('./__screenshots__/content.png'),
|
|
8
8
|
devMode: 'proCode',
|
|
9
|
+
category: "布局",
|
|
9
10
|
npm: {
|
|
10
11
|
package: '@pisell/materials',
|
|
11
12
|
version: '1.0.3',
|
|
@@ -26,6 +27,17 @@ const PisellContentMeta: ComponentMetadata = {
|
|
|
26
27
|
name: 'className',
|
|
27
28
|
setter: 'StringSetter',
|
|
28
29
|
},
|
|
30
|
+
{
|
|
31
|
+
title: {
|
|
32
|
+
label: {
|
|
33
|
+
type: 'i18n',
|
|
34
|
+
'en-US': 'height',
|
|
35
|
+
'zh-CN': '高度',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
name: 'height',
|
|
39
|
+
setter: 'NumberSetter',
|
|
40
|
+
},
|
|
29
41
|
{
|
|
30
42
|
title: {
|
|
31
43
|
label: {
|
|
@@ -37,6 +49,17 @@ const PisellContentMeta: ComponentMetadata = {
|
|
|
37
49
|
name: 'children',
|
|
38
50
|
setter: ['SlotSetter'],
|
|
39
51
|
},
|
|
52
|
+
{
|
|
53
|
+
title: {
|
|
54
|
+
label: {
|
|
55
|
+
type: 'i18n',
|
|
56
|
+
'en-US': 'Content scrolling',
|
|
57
|
+
'zh-CN': '内容滚动',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
name: 'scroll',
|
|
61
|
+
setter: 'BoolSetter',
|
|
62
|
+
},
|
|
40
63
|
{
|
|
41
64
|
title: {
|
|
42
65
|
label: {
|
|
@@ -62,8 +85,8 @@ const PisellContentMeta: ComponentMetadata = {
|
|
|
62
85
|
|
|
63
86
|
const snippets: Snippet[] = [
|
|
64
87
|
{
|
|
65
|
-
title: '
|
|
66
|
-
screenshot: '',
|
|
88
|
+
title: '内容',
|
|
89
|
+
screenshot: require('./__screenshots__/content.png'),
|
|
67
90
|
schema: {
|
|
68
91
|
componentName: 'PisellContent',
|
|
69
92
|
props: {
|
|
@@ -74,7 +97,7 @@ const snippets: Snippet[] = [
|
|
|
74
97
|
lineHeight: '120px',
|
|
75
98
|
textAlign: 'center',
|
|
76
99
|
},
|
|
77
|
-
|
|
100
|
+
scroll: true,
|
|
78
101
|
},
|
|
79
102
|
},
|
|
80
103
|
},
|
|
Binary file
|
|
@@ -2,10 +2,11 @@ import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
|
|
|
2
2
|
|
|
3
3
|
const PisellFooterMeta: ComponentMetadata = {
|
|
4
4
|
componentName: 'PisellFooter',
|
|
5
|
-
title: '
|
|
5
|
+
title: '底部',
|
|
6
6
|
docUrl: '',
|
|
7
|
-
screenshot: '',
|
|
7
|
+
screenshot: require('./__screenshots__/footer.png'),
|
|
8
8
|
devMode: 'proCode',
|
|
9
|
+
category: "布局",
|
|
9
10
|
npm: {
|
|
10
11
|
package: '@pisell/materials',
|
|
11
12
|
version: '1.0.3',
|
|
@@ -26,6 +27,17 @@ const PisellFooterMeta: ComponentMetadata = {
|
|
|
26
27
|
name: 'className',
|
|
27
28
|
setter: 'StringSetter',
|
|
28
29
|
},
|
|
30
|
+
{
|
|
31
|
+
title: {
|
|
32
|
+
label: {
|
|
33
|
+
type: 'i18n',
|
|
34
|
+
'en-US': 'height',
|
|
35
|
+
'zh-CN': '高度',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
name: 'height',
|
|
39
|
+
setter: 'NumberSetter',
|
|
40
|
+
},
|
|
29
41
|
{
|
|
30
42
|
title: {
|
|
31
43
|
label: {
|
|
@@ -51,8 +63,8 @@ const PisellFooterMeta: ComponentMetadata = {
|
|
|
51
63
|
|
|
52
64
|
const snippets: Snippet[] = [
|
|
53
65
|
{
|
|
54
|
-
title: '
|
|
55
|
-
screenshot: '',
|
|
66
|
+
title: '底部',
|
|
67
|
+
screenshot: require('./__screenshots__/footer.png'),
|
|
56
68
|
schema: {
|
|
57
69
|
componentName: 'PisellFooter',
|
|
58
70
|
props: {
|
|
@@ -61,6 +73,7 @@ const snippets: Snippet[] = [
|
|
|
61
73
|
color: '#fff',
|
|
62
74
|
textAlign: 'center',
|
|
63
75
|
},
|
|
76
|
+
height: 80,
|
|
64
77
|
},
|
|
65
78
|
children: [{
|
|
66
79
|
componentName: 'PisellText',
|
|
Binary file
|