@pisell/materials 6.0.11 → 6.0.12
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 -15
- package/build/lowcode/assets-dev.json +2 -6
- package/build/lowcode/assets-prod.json +11 -15
- 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 +22 -22
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +22 -22
- 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/BaseForm.js +94 -3
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +7 -6
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +120 -38
- package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceMenu/index.js +19 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +46 -8
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +90 -35
- package/es/components/dataSourceComponents/fields/Input.Mobile/index.js +11 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +73 -19
- package/es/components/dataSourceComponents/fields/Input.Subdomain/WithMode.d.ts +4 -2
- package/es/components/dataSourceComponents/fields/Input.Subdomain/WithMode.js +161 -52
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +4 -2
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.js +2 -2
- package/es/components/dataSourceComponents/fields/Input.Subdomain/serve.d.ts +3 -13
- package/es/components/dataSourceComponents/fields/Input.Subdomain/serve.js +15 -13
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.js +15 -4
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +17 -13
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +4 -2
- package/es/components/dataSourceComponents/fields/Upload/WithMode.js +5 -4
- package/es/components/dataSourceComponents/fields/Upload/index.less +1 -1
- package/es/components/dataSourceComponents/fields/Upload/serve.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/serve.js +5 -5
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +8 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +9 -5
- package/es/components/dataSourceComponents/fields/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/utils.js +1 -0
- package/es/components/dataSourceComponents/provider/actions/ActionsContext.d.ts +6 -1
- package/es/components/dataSourceComponents/provider/actions/ActionsProvider.d.ts +4 -1
- package/es/components/dataSourceComponents/provider/actions/ActionsProvider.js +0 -1
- package/es/components/form/index.js +12 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/pisellDraggable/components/Action/Action.d.ts +10 -0
- package/es/components/pisellDraggable/components/Action/Action.js +31 -0
- package/es/components/pisellDraggable/components/Action/Action.less +50 -0
- package/es/components/pisellDraggable/components/Action/index.d.ts +2 -0
- package/es/components/pisellDraggable/components/Action/index.js +1 -0
- package/es/components/pisellDraggable/components/Handle/Handle.d.ts +3 -0
- package/es/components/pisellDraggable/components/Handle/Handle.js +15 -0
- package/es/components/pisellDraggable/components/Handle/index.d.ts +1 -0
- package/es/components/pisellDraggable/components/Handle/index.js +1 -0
- package/es/components/pisellDraggable/components/Remove/Remove.d.ts +3 -0
- package/es/components/pisellDraggable/components/Remove/Remove.js +17 -0
- package/es/components/pisellDraggable/components/Remove/index.d.ts +1 -0
- package/es/components/pisellDraggable/components/Remove/index.js +1 -0
- package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +8 -0
- package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.js +51 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +21 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.js +57 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.less +128 -0
- package/es/components/pisellDraggable/components/TreeItem/index.d.ts +2 -0
- package/es/components/pisellDraggable/components/TreeItem/index.js +2 -0
- package/es/components/pisellDraggable/components/index.d.ts +4 -0
- package/es/components/pisellDraggable/components/index.js +4 -0
- package/es/components/pisellDraggable/index.d.ts +27 -0
- package/es/components/pisellDraggable/index.js +380 -0
- package/es/components/pisellDraggable/types.d.ts +17 -0
- package/es/components/pisellDraggable/types.js +1 -0
- package/es/components/pisellDraggable/utilities.d.ts +17 -0
- package/es/components/pisellDraggable/utilities.js +230 -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/components/pisellModal/components/functions/index.less +3 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/versionModal/index.d.ts +15 -0
- package/es/components/versionModal/index.js +192 -0
- package/es/components/versionModal/index.less +3 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +5 -1
- package/es/locales/en-US.d.ts +22 -0
- package/es/locales/en-US.js +24 -1
- package/es/locales/zh-CN.d.ts +21 -0
- package/es/locales/zh-CN.js +24 -2
- package/es/locales/zh-TW.d.ts +20 -0
- package/es/locales/zh-TW.js +23 -2
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +77 -4
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +138 -41
- package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceMenu/index.js +45 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +14 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +44 -29
- package/lib/components/dataSourceComponents/fields/Input.Mobile/index.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +34 -17
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/WithMode.d.ts +4 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/WithMode.js +96 -36
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +4 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/serve.d.ts +3 -13
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/serve.js +19 -14
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.js +15 -4
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +5 -3
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/Upload/WithMode.js +4 -4
- package/lib/components/dataSourceComponents/fields/Upload/index.less +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/serve.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/serve.js +5 -5
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +8 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +9 -5
- package/lib/components/dataSourceComponents/fields/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/utils.js +1 -0
- package/lib/components/dataSourceComponents/provider/actions/ActionsContext.d.ts +6 -1
- package/lib/components/dataSourceComponents/provider/actions/ActionsProvider.d.ts +4 -1
- package/lib/components/form/index.js +10 -1
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/pisellDraggable/components/Action/Action.d.ts +10 -0
- package/lib/components/pisellDraggable/components/Action/Action.js +60 -0
- package/lib/components/pisellDraggable/components/Action/Action.less +50 -0
- package/lib/components/pisellDraggable/components/Action/index.d.ts +2 -0
- package/lib/components/pisellDraggable/components/Action/index.js +29 -0
- package/lib/components/pisellDraggable/components/Handle/Handle.d.ts +3 -0
- package/lib/components/pisellDraggable/components/Handle/Handle.js +54 -0
- package/lib/components/pisellDraggable/components/Handle/index.d.ts +1 -0
- package/lib/components/pisellDraggable/components/Handle/index.js +29 -0
- package/lib/components/pisellDraggable/components/Remove/Remove.d.ts +3 -0
- package/lib/components/pisellDraggable/components/Remove/Remove.js +53 -0
- package/lib/components/pisellDraggable/components/Remove/index.d.ts +1 -0
- package/lib/components/pisellDraggable/components/Remove/index.js +29 -0
- package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +8 -0
- package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.js +83 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +21 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.js +93 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.less +128 -0
- package/lib/components/pisellDraggable/components/TreeItem/index.d.ts +2 -0
- package/lib/components/pisellDraggable/components/TreeItem/index.js +32 -0
- package/lib/components/pisellDraggable/components/index.d.ts +4 -0
- package/lib/components/pisellDraggable/components/index.js +40 -0
- package/lib/components/pisellDraggable/index.d.ts +27 -0
- package/lib/components/pisellDraggable/index.js +271 -0
- package/lib/components/pisellDraggable/types.d.ts +17 -0
- package/lib/components/pisellDraggable/types.js +17 -0
- package/lib/components/pisellDraggable/utilities.d.ts +17 -0
- package/lib/components/pisellDraggable/utilities.js +190 -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/components/pisellModal/components/functions/index.less +3 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/versionModal/index.d.ts +15 -0
- package/lib/components/versionModal/index.js +219 -0
- package/lib/components/versionModal/index.less +3 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +12 -0
- package/lib/locales/en-US.d.ts +22 -0
- package/lib/locales/en-US.js +24 -1
- package/lib/locales/zh-CN.d.ts +21 -0
- package/lib/locales/zh-CN.js +24 -2
- package/lib/locales/zh-TW.d.ts +20 -0
- package/lib/locales/zh-TW.js +23 -2
- package/lowcode/_utils/defaultSchema.ts +23 -2
- package/lowcode/button/meta.ts +4 -20
- package/lowcode/data-source-form/meta.ts +138 -1
- package/lowcode/data-source-form/snippets.ts +54 -0
- package/lowcode/data-source-menu/meta.ts +122 -0
- package/lowcode/data-source-table/meta.ts +32 -27
- package/lowcode/data-source-table/utils.tsx +33 -1
- package/lowcode/data-source-wrapper/meta.ts +6 -2
- package/lowcode/form-group/meta.ts +5 -1
- package/lowcode/form-item-input.mobile/__screenshots__/mobile.png +0 -0
- package/lowcode/form-item-input.mobile/meta.ts +36 -46
- package/lowcode/form-item-input.mobile/snippets.ts +8 -2
- package/lowcode/form-item-input.phone/meta.ts +8 -42
- 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 +20 -6
- package/lowcode/form-item-input.subdomain/snippets.ts +10 -11
- package/lowcode/form.item/meta.ts +48 -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 +1 -1
- package/lowcode/form-item-input.mobile/__screenshots__/phone.png +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellDraggable/utilities.ts
|
|
20
|
+
var utilities_exports = {};
|
|
21
|
+
__export(utilities_exports, {
|
|
22
|
+
buildTree: () => buildTree,
|
|
23
|
+
findItem: () => findItem,
|
|
24
|
+
findItemDeep: () => findItemDeep,
|
|
25
|
+
flattenTree: () => flattenTree,
|
|
26
|
+
getChildCount: () => getChildCount,
|
|
27
|
+
getProjection: () => getProjection,
|
|
28
|
+
iOS: () => iOS,
|
|
29
|
+
removeChildrenOf: () => removeChildrenOf,
|
|
30
|
+
removeItem: () => removeItem,
|
|
31
|
+
setProperty: () => setProperty
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(utilities_exports);
|
|
34
|
+
var import_sortable = require("@dnd-kit/sortable");
|
|
35
|
+
var iOS = /iPad|iPhone|iPod/.test(navigator.platform);
|
|
36
|
+
function getDragDepth(offset, indentationWidth) {
|
|
37
|
+
return Math.round(offset / indentationWidth);
|
|
38
|
+
}
|
|
39
|
+
function getProjection(items, activeId, overId, dragOffset, indentationWidth) {
|
|
40
|
+
const overItemIndex = items.findIndex(({ id }) => id === overId);
|
|
41
|
+
const activeItemIndex = items.findIndex(({ id }) => id === activeId);
|
|
42
|
+
const activeItem = items[activeItemIndex];
|
|
43
|
+
const newItems = (0, import_sortable.arrayMove)(items, activeItemIndex, overItemIndex);
|
|
44
|
+
const previousItem = newItems[overItemIndex - 1];
|
|
45
|
+
const nextItem = newItems[overItemIndex + 1];
|
|
46
|
+
const dragDepth = getDragDepth(dragOffset, indentationWidth);
|
|
47
|
+
const projectedDepth = activeItem.depth + dragDepth;
|
|
48
|
+
const maxDepth = getMaxDepth({
|
|
49
|
+
previousItem
|
|
50
|
+
});
|
|
51
|
+
const minDepth = getMinDepth({ nextItem });
|
|
52
|
+
let depth = projectedDepth;
|
|
53
|
+
if (projectedDepth >= maxDepth) {
|
|
54
|
+
depth = maxDepth;
|
|
55
|
+
} else if (projectedDepth < minDepth) {
|
|
56
|
+
depth = minDepth;
|
|
57
|
+
}
|
|
58
|
+
return { depth, maxDepth, minDepth, parentId: getParentId() };
|
|
59
|
+
function getParentId() {
|
|
60
|
+
var _a;
|
|
61
|
+
if (depth === 0 || !previousItem) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (depth === previousItem.depth) {
|
|
65
|
+
return previousItem.parentId;
|
|
66
|
+
}
|
|
67
|
+
if (depth > previousItem.depth) {
|
|
68
|
+
return previousItem.id;
|
|
69
|
+
}
|
|
70
|
+
const newParent = (_a = newItems.slice(0, overItemIndex).reverse().find((item) => item.depth === depth)) == null ? void 0 : _a.parentId;
|
|
71
|
+
return newParent ?? null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function getMaxDepth({ previousItem }) {
|
|
75
|
+
if (previousItem) {
|
|
76
|
+
return previousItem.depth + 1;
|
|
77
|
+
}
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
function getMinDepth({ nextItem }) {
|
|
81
|
+
if (nextItem) {
|
|
82
|
+
return nextItem.depth;
|
|
83
|
+
}
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
function flatten(items, parentId = null, depth = 0) {
|
|
87
|
+
return items.reduce((acc, item, index) => {
|
|
88
|
+
return [
|
|
89
|
+
...acc,
|
|
90
|
+
{ ...item, parentId, depth, index },
|
|
91
|
+
...flatten(item.children, item.id, depth + 1)
|
|
92
|
+
];
|
|
93
|
+
}, []);
|
|
94
|
+
}
|
|
95
|
+
function flattenTree(items) {
|
|
96
|
+
return flatten(items);
|
|
97
|
+
}
|
|
98
|
+
function buildTree(flattenedItems) {
|
|
99
|
+
const root = { id: "root", children: [] };
|
|
100
|
+
const nodes = { [root.id]: root };
|
|
101
|
+
const items = flattenedItems.map((item) => ({ ...item, children: [] }));
|
|
102
|
+
for (const item of items) {
|
|
103
|
+
const { id, children } = item;
|
|
104
|
+
const parentId = item.parentId ?? root.id;
|
|
105
|
+
const parent = nodes[parentId] ?? findItem(items, parentId);
|
|
106
|
+
nodes[id] = { id, children };
|
|
107
|
+
parent.children.push(item);
|
|
108
|
+
}
|
|
109
|
+
return root.children;
|
|
110
|
+
}
|
|
111
|
+
function findItem(items, itemId) {
|
|
112
|
+
return items.find(({ id }) => id === itemId);
|
|
113
|
+
}
|
|
114
|
+
function findItemDeep(items, itemId) {
|
|
115
|
+
for (const item of items) {
|
|
116
|
+
const { id, children } = item;
|
|
117
|
+
if (id === itemId) {
|
|
118
|
+
return item;
|
|
119
|
+
}
|
|
120
|
+
if (children.length) {
|
|
121
|
+
const child = findItemDeep(children, itemId);
|
|
122
|
+
if (child) {
|
|
123
|
+
return child;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return void 0;
|
|
128
|
+
}
|
|
129
|
+
function removeItem(items, id) {
|
|
130
|
+
const newItems = [];
|
|
131
|
+
for (const item of items) {
|
|
132
|
+
if (item.id === id) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (item.children.length) {
|
|
136
|
+
item.children = removeItem(item.children, id);
|
|
137
|
+
}
|
|
138
|
+
newItems.push(item);
|
|
139
|
+
}
|
|
140
|
+
return newItems;
|
|
141
|
+
}
|
|
142
|
+
function setProperty(items, id, property, setter) {
|
|
143
|
+
for (const item of items) {
|
|
144
|
+
if (item.id === id) {
|
|
145
|
+
item[property] = setter(item[property]);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (item.children.length) {
|
|
149
|
+
item.children = setProperty(item.children, id, property, setter);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return [...items];
|
|
153
|
+
}
|
|
154
|
+
function countChildren(items, count = 0) {
|
|
155
|
+
return items.reduce((acc, { children }) => {
|
|
156
|
+
if (children.length) {
|
|
157
|
+
return countChildren(children, acc + 1);
|
|
158
|
+
}
|
|
159
|
+
return acc + 1;
|
|
160
|
+
}, count);
|
|
161
|
+
}
|
|
162
|
+
function getChildCount(items, id) {
|
|
163
|
+
const item = findItemDeep(items, id);
|
|
164
|
+
return item ? countChildren(item.children) : 0;
|
|
165
|
+
}
|
|
166
|
+
function removeChildrenOf(items, ids) {
|
|
167
|
+
const excludeParentIds = [...ids];
|
|
168
|
+
return items.filter((item) => {
|
|
169
|
+
if (item.parentId && excludeParentIds.includes(item.parentId)) {
|
|
170
|
+
if (item.children.length) {
|
|
171
|
+
excludeParentIds.push(item.id);
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
179
|
+
0 && (module.exports = {
|
|
180
|
+
buildTree,
|
|
181
|
+
findItem,
|
|
182
|
+
findItemDeep,
|
|
183
|
+
flattenTree,
|
|
184
|
+
getChildCount,
|
|
185
|
+
getProjection,
|
|
186
|
+
iOS,
|
|
187
|
+
removeChildrenOf,
|
|
188
|
+
removeItem,
|
|
189
|
+
setProperty
|
|
190
|
+
});
|
|
@@ -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;
|
|
@@ -34,9 +34,17 @@ __export(content_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(content_exports);
|
|
35
35
|
var import_antd = require("antd");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
37
38
|
var { Content } = import_antd.Layout;
|
|
38
39
|
var PisellContent = (props) => {
|
|
39
40
|
const { children, ...rest } = props;
|
|
40
|
-
|
|
41
|
+
const lowCodeProps = (0, import_useEngineContext.default)();
|
|
42
|
+
const pageContent = (0, import_react.useMemo)(() => {
|
|
43
|
+
if (props.__designMode === "design") {
|
|
44
|
+
return "Page content";
|
|
45
|
+
}
|
|
46
|
+
return lowCodeProps.children;
|
|
47
|
+
}, [props.__designMode]);
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(Content, { ...rest }, children, pageContent);
|
|
41
49
|
};
|
|
42
50
|
var content_default = PisellContent;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellMenu/PisellMenu.tsx
|
|
30
|
+
var PisellMenu_exports = {};
|
|
31
|
+
__export(PisellMenu_exports, {
|
|
32
|
+
default: () => PisellMenu_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PisellMenu_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_PisellMenu = require("./PisellMenu.less");
|
|
38
|
+
var PisellMenu = ({
|
|
39
|
+
className,
|
|
40
|
+
style,
|
|
41
|
+
mode = "vertical",
|
|
42
|
+
theme = "light",
|
|
43
|
+
defaultOpenKeys,
|
|
44
|
+
defaultSelectedKeys,
|
|
45
|
+
inlineCollapsed,
|
|
46
|
+
openKeys,
|
|
47
|
+
selectedKeys,
|
|
48
|
+
onOpenChange,
|
|
49
|
+
onSelect,
|
|
50
|
+
dataSource,
|
|
51
|
+
__designMode,
|
|
52
|
+
...restProps
|
|
53
|
+
}) => {
|
|
54
|
+
const _dataSource = (0, import_react.useMemo)(() => {
|
|
55
|
+
if (Array.isArray(dataSource)) {
|
|
56
|
+
return dataSource;
|
|
57
|
+
}
|
|
58
|
+
if (__designMode === "design") {
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
label: "菜单项1",
|
|
62
|
+
key: "item-1"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "菜单项2",
|
|
66
|
+
key: "item-2"
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
}, [dataSource]);
|
|
72
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_antd.Menu,
|
|
74
|
+
{
|
|
75
|
+
className: `pisell-menu ${className || ""}`,
|
|
76
|
+
style,
|
|
77
|
+
items: _dataSource,
|
|
78
|
+
mode,
|
|
79
|
+
theme,
|
|
80
|
+
defaultOpenKeys,
|
|
81
|
+
defaultSelectedKeys,
|
|
82
|
+
inlineCollapsed,
|
|
83
|
+
openKeys,
|
|
84
|
+
selectedKeys,
|
|
85
|
+
onOpenChange,
|
|
86
|
+
onSelect,
|
|
87
|
+
...restProps
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
var PisellMenu_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,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellMenu/index.tsx
|
|
30
|
+
var pisellMenu_exports = {};
|
|
31
|
+
__export(pisellMenu_exports, {
|
|
32
|
+
default: () => pisellMenu_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellMenu_exports);
|
|
35
|
+
var import_PisellMenu = __toESM(require("./PisellMenu"));
|
|
36
|
+
var pisellMenu_default = import_PisellMenu.default;
|
|
@@ -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,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/pisellMenu/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface PublishVersionModalProps {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
currentVersion: string;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onConfirm: (data: VersionData) => void;
|
|
8
|
+
isShowNote?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface VersionData {
|
|
11
|
+
version: string;
|
|
12
|
+
note: string;
|
|
13
|
+
}
|
|
14
|
+
declare const PublishVersionModal: React.FC<PublishVersionModalProps>;
|
|
15
|
+
export default PublishVersionModal;
|