@pisell/materials 1.0.598 → 1.0.600
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +30 -30
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +27 -27
- package/es/components/appVersionControl/index.js +1 -1
- package/es/components/appVersionControl/types.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +4 -12
- package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceMenu/index.js +19 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/WithMode.js +4 -4
- package/es/components/image/avatar.png +0 -0
- package/es/components/image/image.png +0 -0
- package/es/components/image/index.d.ts +10 -0
- package/es/components/image/index.js +25 -0
- package/es/components/image/product.png +0 -0
- package/es/components/pisellDraggable/PisellDraggable.d.ts +18 -0
- package/es/components/pisellDraggable/PisellDraggable.js +190 -0
- package/es/components/pisellDraggable/PisellDraggable.less +154 -0
- package/es/components/pisellDraggable/SortableItem.d.ts +41 -0
- package/es/components/pisellDraggable/SortableItem.js +115 -0
- package/es/components/pisellDraggable/index.d.ts +3 -0
- package/es/components/pisellDraggable/index.js +2 -0
- package/es/components/pisellDraggable/types.d.ts +101 -0
- package/es/components/pisellDraggable/types.js +1 -0
- package/es/components/pisellLayout/content.d.ts +1 -0
- package/es/components/pisellLayout/content.js +19 -2
- package/es/components/pisellMenu/PisellMenu.d.ts +5 -0
- package/es/components/pisellMenu/PisellMenu.js +55 -0
- package/es/components/pisellMenu/PisellMenu.less +53 -0
- package/es/components/pisellMenu/index.d.ts +3 -0
- package/es/components/pisellMenu/index.js +2 -0
- package/es/components/pisellMenu/types.d.ts +30 -0
- package/es/components/pisellMenu/types.js +1 -0
- package/es/index.d.ts +29 -24
- package/es/index.js +29 -25
- package/es/locales/zh-TW.js +1 -1
- package/es/typings.d.ts +4 -0
- package/lib/components/appVersionControl/index.js +1 -1
- package/lib/components/appVersionControl/types.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +1 -14
- package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceMenu/index.js +45 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/WithMode.js +4 -4
- package/lib/components/image/avatar.png +0 -0
- package/lib/components/image/image.png +0 -0
- package/lib/components/image/index.d.ts +10 -0
- package/lib/components/image/index.js +59 -0
- package/lib/components/image/product.png +0 -0
- package/lib/components/pisellDraggable/PisellDraggable.d.ts +18 -0
- package/lib/components/pisellDraggable/PisellDraggable.js +175 -0
- package/lib/components/pisellDraggable/PisellDraggable.less +154 -0
- package/lib/components/pisellDraggable/SortableItem.d.ts +41 -0
- package/lib/components/pisellDraggable/SortableItem.js +127 -0
- package/lib/components/pisellDraggable/index.d.ts +3 -0
- package/lib/components/pisellDraggable/index.js +36 -0
- package/lib/components/pisellDraggable/types.d.ts +101 -0
- package/lib/components/pisellDraggable/types.js +17 -0
- package/lib/components/pisellLayout/content.d.ts +1 -0
- package/lib/components/pisellLayout/content.js +9 -1
- package/lib/components/pisellMenu/PisellMenu.d.ts +5 -0
- package/lib/components/pisellMenu/PisellMenu.js +91 -0
- package/lib/components/pisellMenu/PisellMenu.less +53 -0
- package/lib/components/pisellMenu/index.d.ts +3 -0
- package/lib/components/pisellMenu/index.js +36 -0
- package/lib/components/pisellMenu/types.d.ts +30 -0
- package/lib/components/pisellMenu/types.js +17 -0
- package/lib/index.d.ts +29 -24
- package/lib/index.js +34 -24
- package/lib/locales/zh-TW.js +1 -1
- package/lib/typings.d.ts +4 -0
- package/lowcode/_utils/defaultSchema.ts +1 -1
- package/lowcode/app-version-control/meta.ts +16 -0
- package/lowcode/data-source-menu/meta.ts +115 -0
- package/lowcode/form-item-input.mobile/__screenshots__/mobile.png +0 -0
- package/lowcode/form-item-input.mobile/meta.ts +15 -1
- package/lowcode/form-item-input.mobile/snippets.ts +7 -1
- package/lowcode/form-item-input.phone/meta.ts +15 -1
- package/lowcode/form-item-input.phone/snippets.ts +6 -0
- package/lowcode/form-item-input.subdomain/__screenshots__/subdomain.png +0 -0
- package/lowcode/form-item-input.subdomain/meta.ts +17 -1
- package/lowcode/form-item-input.subdomain/snippets.ts +1 -1
- package/lowcode/image/meta.ts +19 -0
- package/lowcode/image/snippets.ts +1 -0
- package/lowcode/pisell-content/meta.ts +12 -9
- package/lowcode/pisell-draggable/meta.ts +190 -0
- package/lowcode/pisell-layout/meta.ts +9 -9
- package/lowcode/pisell-menu/meta.ts +112 -0
- package/package.json +3 -3
- package/lowcode/form-item-input.mobile/__screenshots__/phone.png +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
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
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
8
|
+
import { useSortable } from '@dnd-kit/sortable';
|
|
9
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import PisellDraggable from "./PisellDraggable";
|
|
12
|
+
/**
|
|
13
|
+
* 可排序项组件
|
|
14
|
+
* 用于渲染单个可拖拽项,支持嵌套结构和自定义渲染
|
|
15
|
+
*/
|
|
16
|
+
export var SortableItem = function SortableItem(_ref) {
|
|
17
|
+
var id = _ref.id,
|
|
18
|
+
item = _ref.item,
|
|
19
|
+
renderItem = _ref.renderItem,
|
|
20
|
+
handleClassName = _ref.handleClassName,
|
|
21
|
+
_ref$animationDuratio = _ref.animationDuration,
|
|
22
|
+
animationDuration = _ref$animationDuratio === void 0 ? 250 : _ref$animationDuratio,
|
|
23
|
+
_ref$dragMode = _ref.dragMode,
|
|
24
|
+
dragMode = _ref$dragMode === void 0 ? 'handle' : _ref$dragMode,
|
|
25
|
+
onNestedChange = _ref.onNestedChange,
|
|
26
|
+
_ref$indentDistance = _ref.indentDistance,
|
|
27
|
+
indentDistance = _ref$indentDistance === void 0 ? 24 : _ref$indentDistance,
|
|
28
|
+
_ref$maxDepth = _ref.maxDepth,
|
|
29
|
+
maxDepth = _ref$maxDepth === void 0 ? 0 : _ref$maxDepth,
|
|
30
|
+
_ref$levelStyles = _ref.levelStyles,
|
|
31
|
+
levelStyles = _ref$levelStyles === void 0 ? {} : _ref$levelStyles,
|
|
32
|
+
_ref$handleIcon = _ref.handleIcon,
|
|
33
|
+
handleIcon = _ref$handleIcon === void 0 ? '⋮' : _ref$handleIcon,
|
|
34
|
+
_ref$animationTiming = _ref.animationTiming,
|
|
35
|
+
animationTiming = _ref$animationTiming === void 0 ? 'ease' : _ref$animationTiming,
|
|
36
|
+
_ref$dragScale = _ref.dragScale,
|
|
37
|
+
dragScale = _ref$dragScale === void 0 ? 1.02 : _ref$dragScale,
|
|
38
|
+
_ref$currentLevel = _ref.currentLevel,
|
|
39
|
+
currentLevel = _ref$currentLevel === void 0 ? 0 : _ref$currentLevel;
|
|
40
|
+
// 使用 dnd-kit 的 useSortable hook 处理拖拽逻辑
|
|
41
|
+
var _useSortable = useSortable({
|
|
42
|
+
id: id
|
|
43
|
+
}),
|
|
44
|
+
attributes = _useSortable.attributes,
|
|
45
|
+
listeners = _useSortable.listeners,
|
|
46
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
47
|
+
transform = _useSortable.transform,
|
|
48
|
+
transition = _useSortable.transition,
|
|
49
|
+
isDragging = _useSortable.isDragging;
|
|
50
|
+
|
|
51
|
+
// 构建样式对象,包含拖拽和动画相关的样式
|
|
52
|
+
var style = _objectSpread({
|
|
53
|
+
transform: CSS.Transform.toString(transform),
|
|
54
|
+
transition: transition,
|
|
55
|
+
'--animation-duration': "".concat(animationDuration, "ms"),
|
|
56
|
+
'--animation-timing': animationTiming,
|
|
57
|
+
'--drag-scale': dragScale,
|
|
58
|
+
'--indent-distance': "".concat(indentDistance, "px")
|
|
59
|
+
}, levelStyles[currentLevel]);
|
|
60
|
+
var itemClassName = "pisellDraggable-item ".concat(isDragging ? 'dragging' : '');
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 处理嵌套数据的变化
|
|
64
|
+
* 如果超过最大深度限制,则不允许更改
|
|
65
|
+
*/
|
|
66
|
+
var handleNestedChange = function handleNestedChange(items) {
|
|
67
|
+
if (maxDepth > 0 && currentLevel >= maxDepth - 1) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
onNestedChange === null || onNestedChange === void 0 ? void 0 : onNestedChange(id, items);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 渲染项目内容
|
|
75
|
+
* 如果提供了自定义渲染函数,则使用自定义渲染
|
|
76
|
+
* 否则使用默认的渲染方式
|
|
77
|
+
*/
|
|
78
|
+
var renderContent = function renderContent() {
|
|
79
|
+
if (renderItem) {
|
|
80
|
+
return renderItem(item);
|
|
81
|
+
}
|
|
82
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, dragMode === 'handle' && /*#__PURE__*/React.createElement("div", _extends({
|
|
83
|
+
className: "pisellDraggable-handle ".concat(handleClassName || '')
|
|
84
|
+
}, listeners), /*#__PURE__*/React.createElement("span", {
|
|
85
|
+
className: "pisellDraggable-handle-icon"
|
|
86
|
+
}, handleIcon)), /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
className: "pisellDraggable-content"
|
|
88
|
+
}, item.content));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// 检查是否有子项且是否可以继续嵌套
|
|
92
|
+
var hasChildren = Array.isArray(item.children) && item.children.length > 0;
|
|
93
|
+
var canNest = maxDepth === 0 || currentLevel < maxDepth - 1;
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
95
|
+
ref: setNodeRef,
|
|
96
|
+
style: style,
|
|
97
|
+
className: itemClassName,
|
|
98
|
+
"data-level": currentLevel
|
|
99
|
+
}, attributes, dragMode === 'item' ? listeners : {}), renderContent(), hasChildren && canNest && /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: "pisellDraggable-nested"
|
|
101
|
+
}, /*#__PURE__*/React.createElement(PisellDraggable, {
|
|
102
|
+
items: item.children,
|
|
103
|
+
onChange: handleNestedChange,
|
|
104
|
+
dragMode: dragMode,
|
|
105
|
+
handleClassName: handleClassName,
|
|
106
|
+
animationDuration: animationDuration,
|
|
107
|
+
indentDistance: indentDistance,
|
|
108
|
+
maxDepth: maxDepth,
|
|
109
|
+
levelStyles: levelStyles,
|
|
110
|
+
handleIcon: handleIcon,
|
|
111
|
+
animationTiming: animationTiming,
|
|
112
|
+
dragScale: dragScale,
|
|
113
|
+
currentLevel: currentLevel + 1
|
|
114
|
+
})));
|
|
115
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 可拖拽项的数据结构
|
|
4
|
+
*/
|
|
5
|
+
export interface DraggableItem {
|
|
6
|
+
/** 唯一标识符 */
|
|
7
|
+
id: string | number;
|
|
8
|
+
/** 渲染的内容 */
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
/** 子项列表 */
|
|
11
|
+
children?: DraggableItem[];
|
|
12
|
+
/** 父项ID */
|
|
13
|
+
parentId?: string | number;
|
|
14
|
+
/** 排序顺序 */
|
|
15
|
+
order?: number;
|
|
16
|
+
/** 当前项的层级(从0开始) */
|
|
17
|
+
level?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* PisellDraggable 组件的属性定义
|
|
21
|
+
*/
|
|
22
|
+
export interface PisellDraggableProps {
|
|
23
|
+
/** 自定义类名 */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** 自定义样式 */
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
/** 拖拽项数据列表 */
|
|
28
|
+
items: DraggableItem[];
|
|
29
|
+
/**
|
|
30
|
+
* 布局方向
|
|
31
|
+
* - vertical: 垂直排列(默认)
|
|
32
|
+
* - horizontal: 水平排列
|
|
33
|
+
* - grid: 网格布局
|
|
34
|
+
*/
|
|
35
|
+
direction?: 'horizontal' | 'vertical' | 'grid';
|
|
36
|
+
/** 网格布局时的列数(仅在 direction='grid' 时生效) */
|
|
37
|
+
columns?: number;
|
|
38
|
+
/** 是否允许跨容器拖拽 */
|
|
39
|
+
allowCrossContainer?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 拖拽开始时的回调
|
|
42
|
+
* @param activeId 被拖拽项的ID
|
|
43
|
+
*/
|
|
44
|
+
onDragStart?: (activeId: string | number) => void;
|
|
45
|
+
/**
|
|
46
|
+
* 拖拽结束时的回调
|
|
47
|
+
* @param result 包含拖拽项和目标项的信息
|
|
48
|
+
*/
|
|
49
|
+
onDragEnd?: (result: {
|
|
50
|
+
active: DraggableItem;
|
|
51
|
+
over: DraggableItem | null;
|
|
52
|
+
}) => void;
|
|
53
|
+
/**
|
|
54
|
+
* 数据变化时的回调
|
|
55
|
+
* @param items 更新后的数据列表
|
|
56
|
+
*/
|
|
57
|
+
onChange?: (items: DraggableItem[]) => void;
|
|
58
|
+
/**
|
|
59
|
+
* 自定义渲染拖拽项
|
|
60
|
+
* @param item 当前项的数据
|
|
61
|
+
*/
|
|
62
|
+
renderItem?: (item: DraggableItem) => ReactNode;
|
|
63
|
+
/** 拖拽手柄的自定义类名 */
|
|
64
|
+
handleClassName?: string;
|
|
65
|
+
/** 容器的自定义样式 */
|
|
66
|
+
containerStyle?: CSSProperties;
|
|
67
|
+
/** 是否禁用拖拽功能 */
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
/** 动画持续时间(毫秒) */
|
|
70
|
+
animationDuration?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 拖动方式
|
|
73
|
+
* - handle: 仅通过手柄拖动(默认)
|
|
74
|
+
* - item: 整个项目可拖动
|
|
75
|
+
*/
|
|
76
|
+
dragMode?: 'handle' | 'item';
|
|
77
|
+
/** 嵌套层级的缩进距离(像素) */
|
|
78
|
+
indentDistance?: number;
|
|
79
|
+
/**
|
|
80
|
+
* 最大嵌套深度
|
|
81
|
+
* - 0: 不限制深度(默认)
|
|
82
|
+
* - n: 最多允许n层嵌套
|
|
83
|
+
*/
|
|
84
|
+
maxDepth?: number;
|
|
85
|
+
/**
|
|
86
|
+
* 自定义层级样式
|
|
87
|
+
* 可以为不同层级设置不同的样式,key为层级数(从0开始)
|
|
88
|
+
*/
|
|
89
|
+
levelStyles?: Record<number, CSSProperties>;
|
|
90
|
+
/** 拖拽手柄的自定义图标 */
|
|
91
|
+
handleIcon?: ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* 拖拽时的动画曲线
|
|
94
|
+
* 支持 CSS transition-timing-function 的所有值
|
|
95
|
+
*/
|
|
96
|
+
animationTiming?: 'ease' | 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out';
|
|
97
|
+
/** 拖拽时的缩放比例 */
|
|
98
|
+
dragScale?: number;
|
|
99
|
+
/** 当前嵌套层级(内部使用) */
|
|
100
|
+
currentLevel?: number;
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import type { LayoutProps } from 'antd';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface PisellContentProps extends Omit<LayoutProps, 'prefixCls'> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
+
__designMode?: string;
|
|
5
6
|
}
|
|
6
7
|
declare const PisellContent: React.FC<PisellContentProps>;
|
|
7
8
|
export default PisellContent;
|
|
@@ -2,11 +2,28 @@ var _excluded = ["children"];
|
|
|
2
2
|
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
3
|
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
4
|
import { Layout } from 'antd';
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
6
7
|
var Content = Layout.Content;
|
|
7
8
|
var PisellContent = function PisellContent(props) {
|
|
8
9
|
var children = props.children,
|
|
9
10
|
rest = _objectWithoutProperties(props, _excluded);
|
|
10
|
-
|
|
11
|
+
var lowCodeProps = useEngineContext();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title: 内容
|
|
15
|
+
* @description: 该组件的children默认注入页面内容
|
|
16
|
+
* @param {*} useMemo
|
|
17
|
+
* @return {*}
|
|
18
|
+
* @Author: zhiwei.Wang
|
|
19
|
+
*/
|
|
20
|
+
var pageContent = useMemo(function () {
|
|
21
|
+
// 引擎模式下没有页面内容, 只展示提示
|
|
22
|
+
if (props.__designMode === 'design') {
|
|
23
|
+
return 'Page content';
|
|
24
|
+
}
|
|
25
|
+
return lowCodeProps.children;
|
|
26
|
+
}, [props.__designMode]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(Content, rest, children, pageContent);
|
|
11
28
|
};
|
|
12
29
|
export default PisellContent;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var _excluded = ["className", "style", "mode", "theme", "defaultOpenKeys", "defaultSelectedKeys", "inlineCollapsed", "openKeys", "selectedKeys", "onOpenChange", "onSelect", "dataSource", "__designMode"];
|
|
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
|
+
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
|
+
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; }
|
|
5
|
+
import { Menu as AntdMenu } from 'antd';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import "./PisellMenu.less";
|
|
8
|
+
var PisellMenu = function PisellMenu(_ref) {
|
|
9
|
+
var className = _ref.className,
|
|
10
|
+
style = _ref.style,
|
|
11
|
+
_ref$mode = _ref.mode,
|
|
12
|
+
mode = _ref$mode === void 0 ? 'vertical' : _ref$mode,
|
|
13
|
+
_ref$theme = _ref.theme,
|
|
14
|
+
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
15
|
+
defaultOpenKeys = _ref.defaultOpenKeys,
|
|
16
|
+
defaultSelectedKeys = _ref.defaultSelectedKeys,
|
|
17
|
+
inlineCollapsed = _ref.inlineCollapsed,
|
|
18
|
+
openKeys = _ref.openKeys,
|
|
19
|
+
selectedKeys = _ref.selectedKeys,
|
|
20
|
+
onOpenChange = _ref.onOpenChange,
|
|
21
|
+
onSelect = _ref.onSelect,
|
|
22
|
+
dataSource = _ref.dataSource,
|
|
23
|
+
__designMode = _ref.__designMode,
|
|
24
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var _dataSource = useMemo(function () {
|
|
26
|
+
if (Array.isArray(dataSource)) {
|
|
27
|
+
return dataSource;
|
|
28
|
+
}
|
|
29
|
+
if (__designMode === 'design') {
|
|
30
|
+
return [{
|
|
31
|
+
label: '菜单项1',
|
|
32
|
+
key: 'item-1'
|
|
33
|
+
}, {
|
|
34
|
+
label: '菜单项2',
|
|
35
|
+
key: 'item-2'
|
|
36
|
+
}];
|
|
37
|
+
}
|
|
38
|
+
return [];
|
|
39
|
+
}, [dataSource]);
|
|
40
|
+
return /*#__PURE__*/React.createElement(AntdMenu, _extends({
|
|
41
|
+
className: "pisell-menu ".concat(className || ''),
|
|
42
|
+
style: style,
|
|
43
|
+
items: _dataSource,
|
|
44
|
+
mode: mode,
|
|
45
|
+
theme: theme,
|
|
46
|
+
defaultOpenKeys: defaultOpenKeys,
|
|
47
|
+
defaultSelectedKeys: defaultSelectedKeys,
|
|
48
|
+
inlineCollapsed: inlineCollapsed,
|
|
49
|
+
openKeys: openKeys,
|
|
50
|
+
selectedKeys: selectedKeys,
|
|
51
|
+
onOpenChange: onOpenChange,
|
|
52
|
+
onSelect: onSelect
|
|
53
|
+
}, restProps));
|
|
54
|
+
};
|
|
55
|
+
export default PisellMenu;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.pisell-menu {
|
|
2
|
+
&.ant-menu {
|
|
3
|
+
border-right: none;
|
|
4
|
+
|
|
5
|
+
&.ant-menu-dark {
|
|
6
|
+
background: #001529;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ant-menu-item {
|
|
11
|
+
&:hover {
|
|
12
|
+
color: #1890ff;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.ant-menu-item-selected {
|
|
16
|
+
background-color: #e6f7ff;
|
|
17
|
+
color: #1890ff;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ant-menu-submenu {
|
|
22
|
+
&-title:hover {
|
|
23
|
+
color: #1890ff;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-selected>.ant-menu-submenu-title {
|
|
27
|
+
color: #1890ff;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.ant-menu-dark {
|
|
32
|
+
.ant-menu-item {
|
|
33
|
+
&:hover {
|
|
34
|
+
color: #fff;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.ant-menu-item-selected {
|
|
38
|
+
background-color: #1890ff;
|
|
39
|
+
color: #fff;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ant-menu-submenu {
|
|
44
|
+
&-title:hover {
|
|
45
|
+
color: #fff;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-selected>.ant-menu-submenu-title {
|
|
49
|
+
color: #fff;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MenuProps } from 'antd';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface PisellMenuProps extends Omit<MenuProps, 'items'> {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
mode?: 'vertical' | 'horizontal' | 'inline';
|
|
7
|
+
theme?: 'light' | 'dark';
|
|
8
|
+
defaultOpenKeys?: string[];
|
|
9
|
+
defaultSelectedKeys?: string[];
|
|
10
|
+
inlineCollapsed?: boolean;
|
|
11
|
+
openKeys?: string[];
|
|
12
|
+
selectedKeys?: string[];
|
|
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
|
+
dataSource?: any;
|
|
22
|
+
__designMode?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MenuItemType {
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
key: string;
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
children?: MenuItemType[];
|
|
29
|
+
type?: 'group' | 'divider';
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/index.d.ts
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
export { Affix, Alert, Anchor, Avatar, Breadcrumb, Card, Carousel, Col, ColorPicker, Descriptions, Divider, Empty, Grid,
|
|
2
|
-
export { default as
|
|
1
|
+
export { Affix, Alert, Anchor, Avatar, Breadcrumb, Card, Carousel, Col, ColorPicker, Descriptions, Divider, Empty, Grid, InputNumber, Mentions, Menu, Pagination, Popconfirm, Popover, Progress, Rate, Result, Row, Space, Spin, Statistic, Steps, Switch, Tag, Timeline, Tooltip, Transfer, Tree, message, notification, version, } from 'antd';
|
|
2
|
+
export { default as AppVersionControl } from './components/appVersionControl';
|
|
3
3
|
export { default as AutoComplete } from './components/auto-complete';
|
|
4
4
|
export { default as AutoCompleteNumber } from './components/auto-complete-number';
|
|
5
|
+
export { default as Badge } from './components/badge';
|
|
5
6
|
export { default as BatchEditor } from './components/batch-editor';
|
|
6
7
|
export { default as Button } from './components/button';
|
|
8
|
+
export { default as ButtonGroupEdit } from './components/buttonGroupEdit';
|
|
9
|
+
export { default as ButtonGroupPreview } from './components/buttonGroupPreview';
|
|
7
10
|
export { default as Calendar } from './components/calendar';
|
|
11
|
+
export { default as CardMetricItem } from './components/cardMetricItem';
|
|
12
|
+
export { default as CardPro } from './components/cardPro';
|
|
8
13
|
export { default as Cascader } from './components/cascader';
|
|
9
14
|
export { default as Checkbox } from './components/checkbox';
|
|
10
15
|
export { default as ClassicLayout } from './components/classicLayout';
|
|
16
|
+
export { default as Collapse } from './components/collapse';
|
|
11
17
|
export { default as Component } from './components/component';
|
|
12
18
|
export { default as ConfigProvider } from './components/config-provider';
|
|
19
|
+
export { default as CropPhoto } from './components/cropPhoto';
|
|
20
|
+
export { default as CustomSelect } from './components/customSelect';
|
|
13
21
|
export { default as DataSourceForm } from './components/dataSourceComponents/dataSourceForm';
|
|
14
22
|
export { default as FormGroup } from './components/dataSourceComponents/dataSourceForm/group';
|
|
15
23
|
export { default as JsonWrapper } from './components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider';
|
|
16
24
|
export { default as SubmitButton } from './components/dataSourceComponents/dataSourceForm/submitButton';
|
|
25
|
+
export { default as DataSourceMenu } from './components/dataSourceComponents/dataSourceMenu';
|
|
17
26
|
export { default as DataSourceImage } from './components/dataSourceComponents/dataSourceShow/dataSourceImage';
|
|
18
27
|
export { default as DataSourceQRCode } from './components/dataSourceComponents/dataSourceShow/dataSourceQRCode';
|
|
19
28
|
export { default as DataSourceTypography } from './components/dataSourceComponents/dataSourceShow/dataSourceTypography';
|
|
@@ -22,6 +31,7 @@ export { default as DataSourceWrapper } from './components/dataSourceComponents/
|
|
|
22
31
|
export { default as FormItemCheckbox } from './components/dataSourceComponents/fields/Checkbox';
|
|
23
32
|
export { default as FormItemColorPicker } from './components/dataSourceComponents/fields/ColorPicker';
|
|
24
33
|
export { default as FormItemDatePicker } from './components/dataSourceComponents/fields/DatePicker';
|
|
34
|
+
export { default as FormItemIconSelect } from './components/dataSourceComponents/fields/IconSelect';
|
|
25
35
|
export { default as FormItemInput } from './components/dataSourceComponents/fields/Input';
|
|
26
36
|
export { default as FormItemInputNumber } from './components/dataSourceComponents/fields/InputNumber';
|
|
27
37
|
export { default as FormItemRadio } from './components/dataSourceComponents/fields/Radio';
|
|
@@ -29,7 +39,6 @@ export { default as FormItemSelect } from './components/dataSourceComponents/fie
|
|
|
29
39
|
export { default as FormItemTimePicker } from './components/dataSourceComponents/fields/TimePicker';
|
|
30
40
|
export { default as FormItemTranslation } from './components/dataSourceComponents/fields/Translation';
|
|
31
41
|
export { default as FormItemUpload } from './components/dataSourceComponents/fields/Upload';
|
|
32
|
-
export { default as FormItemIconSelect } from './components/dataSourceComponents/fields/IconSelect';
|
|
33
42
|
export { default as DatePicker } from './components/date-picker';
|
|
34
43
|
export { default as Div } from './components/div';
|
|
35
44
|
export { default as DragSortTree } from './components/drag-sort-tree';
|
|
@@ -38,7 +47,9 @@ export { default as Dropdown } from './components/dropdown';
|
|
|
38
47
|
export { default as Filter } from './components/filter';
|
|
39
48
|
export { default as Form } from './components/form';
|
|
40
49
|
export { default as Icon } from './components/icon';
|
|
50
|
+
export { default as IconSelect } from './components/iconSelect';
|
|
41
51
|
export { default as Iconfont } from './components/iconfont';
|
|
52
|
+
export { default as Image } from './components/image';
|
|
42
53
|
export { default as Input } from './components/input';
|
|
43
54
|
export { default as InputNumberRange } from './components/input-number-range';
|
|
44
55
|
export { default as List } from './components/list';
|
|
@@ -48,21 +59,28 @@ export { default as Modal } from './components/modal';
|
|
|
48
59
|
export { default as OrganizationTenantSwitcher } from './components/organizationTenantSwitcher';
|
|
49
60
|
export { default as Page } from './components/page';
|
|
50
61
|
export { default as PageHeader } from './components/page-header';
|
|
62
|
+
export { default as PickerView } from './components/picker-view';
|
|
51
63
|
export { default as PisellConfigProvider } from './components/pisell-config-provider';
|
|
52
64
|
export { default as PisellContext, globalConfig, } from './components/pisell-config-provider/context';
|
|
53
65
|
export { default as usePisellConfig } from './components/pisell-config-provider/hooks/usePisellConfig';
|
|
54
66
|
export { default as PisellAdjustPrice } from './components/pisellAdjustPrice';
|
|
55
67
|
export { default as PisellAdjustPriceInputNumber } from './components/pisellAdjustPrice/PisellAdjustPriceInputNumber';
|
|
56
68
|
export { default as PisellAlert } from './components/pisellAlert';
|
|
69
|
+
export { default as PisellAnchor } from './components/pisellAnchor';
|
|
57
70
|
export { default as PisellAvatar } from './components/pisellAvatar';
|
|
58
71
|
export { default as PisellCard } from './components/pisellCard';
|
|
59
72
|
export { default as PisellCardList } from './components/pisellCardList';
|
|
60
73
|
export { default as PisellCheckboxGroup } from './components/pisellCheckboxGroup';
|
|
61
74
|
export { default as PisellContainer } from './components/pisellContainer';
|
|
62
75
|
export { default as PisellCountdown } from './components/pisellCountdown';
|
|
76
|
+
export { default as PisellCustomCheckboxGroup } from './components/pisellCustomCheckboxGroup';
|
|
63
77
|
export { default as PisellDatePicker } from './components/pisellDatePicker';
|
|
78
|
+
export { default as PisellDraggable } from './components/pisellDraggable';
|
|
79
|
+
export { default as PisellDropdown } from './components/pisellDropdown';
|
|
64
80
|
export { default as PisellEmpty } from './components/pisellEmpty';
|
|
65
81
|
export { default as PisellFloatingPanel } from './components/pisellFloatingPanel';
|
|
82
|
+
export { default as PisellHeaderProgressBar } from './components/pisellHeaderProgressBar';
|
|
83
|
+
export { default as PisellImageCarousels } from './components/pisellImageCarousels';
|
|
66
84
|
export { default as PisellInformationEntry } from './components/pisellInformationEntry';
|
|
67
85
|
export { default as PisellInput } from './components/pisellInput';
|
|
68
86
|
export { getBankCardTypeImg } from './components/pisellInput/components/BankCard/utils';
|
|
@@ -71,11 +89,15 @@ export { default as PisellContent } from './components/pisellLayout/content';
|
|
|
71
89
|
export { default as PisellFooter } from './components/pisellLayout/footer';
|
|
72
90
|
export { default as PisellHeader } from './components/pisellLayout/header';
|
|
73
91
|
export { default as PisellSider } from './components/pisellLayout/sider';
|
|
74
|
-
export { default as PisellLoading } from './components/pisellLoading';
|
|
75
92
|
export { default as PisellList01 } from './components/pisellList01';
|
|
93
|
+
export { default as PisellLoading } from './components/pisellLoading';
|
|
94
|
+
export { default as PisellMenu } from './components/pisellMenu';
|
|
95
|
+
export type { PisellMenuProps } from './components/pisellMenu/types';
|
|
76
96
|
export { default as PisellModal } from './components/pisellModal';
|
|
97
|
+
export { default as PisellQrcode } from './components/pisellQrcode';
|
|
77
98
|
export { default as PisellRow } from './components/pisellRow';
|
|
78
99
|
export { default as PisellScan } from './components/pisellScan';
|
|
100
|
+
export { default as PisellSectionHeaders } from './components/pisellSectionHeaders';
|
|
79
101
|
export { default as PisellStatisticList } from './components/pisellStatisticList';
|
|
80
102
|
export { default as PisellTags } from './components/pisellTags';
|
|
81
103
|
export { default as PisellText } from './components/pisellText';
|
|
@@ -84,10 +106,12 @@ export { default as PisellTooltip } from './components/pisellTooltip';
|
|
|
84
106
|
export { default as PisellUpload } from './components/pisellUpload';
|
|
85
107
|
export { default as PisellViewGrid } from './components/pisellViewGrid';
|
|
86
108
|
export { default as PisellWalletPassCard } from './components/pisellWalletPassCard';
|
|
109
|
+
export { default as ProductCard } from './components/productCard';
|
|
87
110
|
export { default as ProfileMenu } from './components/profileMenu';
|
|
88
111
|
export { default as QRCode } from './components/qrcode';
|
|
89
112
|
export { default as Radio } from './components/radio';
|
|
90
113
|
export { default as RecordView } from './components/record-view';
|
|
114
|
+
export { default as SectionFooters } from './components/section-footers';
|
|
91
115
|
export { default as Segmented } from './components/segmented';
|
|
92
116
|
export { default as Select } from './components/select';
|
|
93
117
|
export { default as SelectTime } from './components/select-time';
|
|
@@ -102,28 +126,9 @@ export { default as Translation } from './components/translation';
|
|
|
102
126
|
export { default as TreeSelect } from './components/tree-select';
|
|
103
127
|
export { default as Typography } from './components/typography';
|
|
104
128
|
export { default as Upload } from './components/upload';
|
|
129
|
+
export { default as PublishVersionModal } from './components/versionModal';
|
|
105
130
|
export { default as VirtualKeyboard } from './components/virtual-keyboard';
|
|
106
131
|
export { default as PisellPriceKeyboard } from './components/virtual-keyboard/Amount';
|
|
107
132
|
export { default as PisellNumberKeyboard } from './components/virtual-keyboard/Number';
|
|
108
133
|
export { default as VirtualKeyboardTime } from './components/virtual-keyboard/Time';
|
|
109
|
-
export { default as PisellHeaderProgressBar } from './components/pisellHeaderProgressBar';
|
|
110
|
-
export { default as PisellImageCarousels } from './components/pisellImageCarousels';
|
|
111
|
-
export { default as PisellSectionHeaders } from './components/pisellSectionHeaders';
|
|
112
|
-
export { default as PisellDropdown } from './components/pisellDropdown';
|
|
113
|
-
export { default as PisellCustomCheckboxGroup } from './components/pisellCustomCheckboxGroup';
|
|
114
134
|
export { default as WalletCard } from './components/walletCard';
|
|
115
|
-
export { default as CardMetricItem } from './components/cardMetricItem';
|
|
116
|
-
export { default as Collapse } from './components/collapse';
|
|
117
|
-
export { default as ProductCard } from './components/productCard';
|
|
118
|
-
export { default as PisellQrcode } from './components/pisellQrcode';
|
|
119
|
-
export { default as CropPhoto } from './components/cropPhoto';
|
|
120
|
-
export { default as PisellAnchor } from './components/pisellAnchor';
|
|
121
|
-
export { default as SectionFooters } from './components/section-footers';
|
|
122
|
-
export { default as CardPro } from './components/cardPro';
|
|
123
|
-
export { default as PickerView } from './components/picker-view';
|
|
124
|
-
export { default as ButtonGroupPreview } from './components/buttonGroupPreview';
|
|
125
|
-
export { default as ButtonGroupEdit } from './components/buttonGroupEdit';
|
|
126
|
-
export { default as PublishVersionModal } from './components/versionModal';
|
|
127
|
-
export { default as IconSelect } from './components/iconSelect';
|
|
128
|
-
export { default as CustomSelect } from './components/customSelect';
|
|
129
|
-
export { default as AppVersionControl } from './components/appVersionControl';
|