@pisell/materials 1.0.606 → 1.0.608
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 +3 -3
- package/build/lowcode/preview.js +154 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +37 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +38 -24
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/appVersionControl/index.less +3 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +6 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +15 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/es/components/dataSourceComponents/fields/Select/index.js +2 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +1 -1
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +3 -0
- 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 +28 -3
- package/es/components/pisellDraggable/index.js +380 -2
- package/es/components/pisellDraggable/types.d.ts +15 -99
- package/es/components/pisellDraggable/utilities.d.ts +17 -0
- package/es/components/pisellDraggable/utilities.js +230 -0
- package/es/components/pisellDropSort/PisellDropSort.d.ts +5 -0
- package/es/components/pisellDropSort/PisellDropSort.js +102 -0
- package/es/components/pisellDropSort/PisellDropSort.less +92 -0
- package/es/components/pisellDropSort/components/SortableItem/index.d.ts +19 -0
- package/es/components/pisellDropSort/components/SortableItem/index.js +93 -0
- package/es/components/pisellDropSort/components/SortableItem/index.less +155 -0
- package/es/components/pisellDropSort/index.d.ts +3 -0
- package/es/components/pisellDropSort/index.js +2 -0
- package/es/components/pisellDropSort/types.d.ts +42 -0
- package/es/components/pisellDropSort/types.js +1 -0
- package/es/components/pisellModal/components/Information/index.js +0 -1
- package/es/components/versionModal/index.js +3 -1
- package/es/components/versionModal/index.less +9 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/locales/en-US.d.ts +7 -6
- package/es/locales/en-US.js +16 -22
- package/es/locales/zh-CN.d.ts +7 -6
- package/es/locales/zh-CN.js +15 -21
- package/es/locales/zh-TW.d.ts +7 -6
- package/es/locales/zh-TW.js +17 -23
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/appVersionControl/index.less +3 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +6 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +16 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/lib/components/dataSourceComponents/fields/Select/index.js +2 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +3 -0
- 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 +28 -3
- package/lib/components/pisellDraggable/index.js +237 -2
- package/lib/components/pisellDraggable/types.d.ts +15 -99
- package/lib/components/pisellDraggable/utilities.d.ts +17 -0
- package/lib/components/pisellDraggable/utilities.js +190 -0
- package/lib/components/pisellDropSort/PisellDropSort.d.ts +5 -0
- package/lib/components/pisellDropSort/PisellDropSort.js +147 -0
- package/lib/components/pisellDropSort/PisellDropSort.less +92 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.d.ts +19 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.js +164 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.less +155 -0
- package/lib/components/pisellDropSort/index.d.ts +3 -0
- package/lib/components/pisellDropSort/index.js +36 -0
- package/lib/components/pisellDropSort/types.d.ts +42 -0
- package/lib/components/pisellDropSort/types.js +17 -0
- package/lib/components/pisellModal/components/Information/index.js +0 -1
- package/lib/components/versionModal/index.js +1 -1
- package/lib/components/versionModal/index.less +9 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +7 -6
- package/lib/locales/en-US.js +11 -1
- package/lib/locales/zh-CN.d.ts +7 -6
- package/lib/locales/zh-CN.js +10 -1
- package/lib/locales/zh-TW.d.ts +7 -6
- package/lib/locales/zh-TW.js +10 -1
- package/lowcode/custom-select/meta.ts +11 -15
- package/lowcode/form-item-translation/meta.ts +59 -1
- package/lowcode/pisell-drop-sort/meta.ts +343 -0
- package/package.json +2 -2
- package/es/components/pisellDraggable/PisellDraggable.d.ts +0 -18
- package/es/components/pisellDraggable/PisellDraggable.js +0 -190
- package/es/components/pisellDraggable/PisellDraggable.less +0 -154
- package/es/components/pisellDraggable/SortableItem.d.ts +0 -41
- package/es/components/pisellDraggable/SortableItem.js +0 -115
- package/lib/components/pisellDraggable/PisellDraggable.d.ts +0 -18
- package/lib/components/pisellDraggable/PisellDraggable.js +0 -175
- package/lib/components/pisellDraggable/PisellDraggable.less +0 -154
- package/lib/components/pisellDraggable/SortableItem.d.ts +0 -41
- package/lib/components/pisellDraggable/SortableItem.js +0 -127
|
@@ -0,0 +1,147 @@
|
|
|
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/pisellDropSort/PisellDropSort.tsx
|
|
30
|
+
var PisellDropSort_exports = {};
|
|
31
|
+
__export(PisellDropSort_exports, {
|
|
32
|
+
default: () => PisellDropSort_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PisellDropSort_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_icons = require("@ant-design/icons");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_button = __toESM(require("../button"));
|
|
39
|
+
var import_SortableItem = __toESM(require("./components/SortableItem"));
|
|
40
|
+
var import_pisellDraggable = require("../pisellDraggable");
|
|
41
|
+
var import_PisellDropSort = require("./PisellDropSort.less");
|
|
42
|
+
var import_locales = require("../../locales");
|
|
43
|
+
var PisellDropSort = ({
|
|
44
|
+
value = [],
|
|
45
|
+
allowDrag = true,
|
|
46
|
+
allowDelete = true,
|
|
47
|
+
allowAddChild = true,
|
|
48
|
+
allowAddRoot = true,
|
|
49
|
+
disabled = false,
|
|
50
|
+
spacing = 8,
|
|
51
|
+
maxLevel = 3,
|
|
52
|
+
showBorder = true,
|
|
53
|
+
style,
|
|
54
|
+
className,
|
|
55
|
+
onChange,
|
|
56
|
+
onDelete,
|
|
57
|
+
onAdd,
|
|
58
|
+
renderItem: propsRenderItem,
|
|
59
|
+
leftContent,
|
|
60
|
+
onAddRoot
|
|
61
|
+
}) => {
|
|
62
|
+
const treeItems = (0, import_react.useMemo)(() => {
|
|
63
|
+
return value.map((item) => {
|
|
64
|
+
var _a;
|
|
65
|
+
return {
|
|
66
|
+
id: item.id,
|
|
67
|
+
children: ((_a = item.children) == null ? void 0 : _a.map((child) => ({
|
|
68
|
+
id: child.id,
|
|
69
|
+
children: []
|
|
70
|
+
}))) || []
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
}, [value]);
|
|
74
|
+
const renderItem = (0, import_react.useCallback)(
|
|
75
|
+
(itemProps, ref) => {
|
|
76
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
77
|
+
import_SortableItem.default,
|
|
78
|
+
{
|
|
79
|
+
itemProps,
|
|
80
|
+
domRef: ref,
|
|
81
|
+
render: propsRenderItem,
|
|
82
|
+
allowAddChild,
|
|
83
|
+
allowDelete,
|
|
84
|
+
allowDrag,
|
|
85
|
+
disabled,
|
|
86
|
+
onAdd,
|
|
87
|
+
onDelete,
|
|
88
|
+
showBorder,
|
|
89
|
+
spacing,
|
|
90
|
+
maxLevel
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
[
|
|
95
|
+
allowAddChild,
|
|
96
|
+
allowDelete,
|
|
97
|
+
allowDrag,
|
|
98
|
+
value,
|
|
99
|
+
disabled,
|
|
100
|
+
maxLevel,
|
|
101
|
+
onAdd,
|
|
102
|
+
onDelete,
|
|
103
|
+
showBorder,
|
|
104
|
+
spacing,
|
|
105
|
+
treeItems
|
|
106
|
+
]
|
|
107
|
+
);
|
|
108
|
+
const handleChange = (0, import_react.useCallback)(
|
|
109
|
+
(items) => {
|
|
110
|
+
onChange == null ? void 0 : onChange(items);
|
|
111
|
+
},
|
|
112
|
+
[onChange]
|
|
113
|
+
);
|
|
114
|
+
const containerClassName = (0, import_classnames.default)(
|
|
115
|
+
"pisell-lowcode-drop-sort-container",
|
|
116
|
+
className
|
|
117
|
+
);
|
|
118
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: containerClassName, style }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-drop-sort-container-header" }, /* @__PURE__ */ import_react.default.createElement("span", null, leftContent), allowAddRoot && !disabled && /* @__PURE__ */ import_react.default.createElement(
|
|
119
|
+
import_button.default,
|
|
120
|
+
{
|
|
121
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.PlusOutlined, null),
|
|
122
|
+
type: "primary",
|
|
123
|
+
onClick: () => onAddRoot == null ? void 0 : onAddRoot(),
|
|
124
|
+
size: "large"
|
|
125
|
+
},
|
|
126
|
+
(0, import_locales.getText)("pisell-lowcode-drop-sort-add")
|
|
127
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: "pisell-lowcode-drop-sort-container-content",
|
|
131
|
+
style: { gap: spacing ?? 8 }
|
|
132
|
+
},
|
|
133
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
134
|
+
import_pisellDraggable.SortableTree,
|
|
135
|
+
{
|
|
136
|
+
value: treeItems,
|
|
137
|
+
collapsible: true,
|
|
138
|
+
indicator: false,
|
|
139
|
+
indentationWidth: 24,
|
|
140
|
+
removable: allowDelete,
|
|
141
|
+
renderItem,
|
|
142
|
+
onChange: handleChange
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
));
|
|
146
|
+
};
|
|
147
|
+
var PisellDropSort_default = PisellDropSort;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.pisell-lowcode-drop-sort-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
|
|
6
|
+
&-header {
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-content {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
flex: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-item {
|
|
20
|
+
display: flex;
|
|
21
|
+
padding: 12px;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 8px;
|
|
24
|
+
align-self: stretch;
|
|
25
|
+
|
|
26
|
+
border-radius: 12px;
|
|
27
|
+
border: 1px solid var(--Gray-200, #eaecf0);
|
|
28
|
+
background: var(--Base-White, #fff);
|
|
29
|
+
/* Shadow/xs */
|
|
30
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
31
|
+
|
|
32
|
+
transition: all 0.3s;
|
|
33
|
+
|
|
34
|
+
&.with-border {
|
|
35
|
+
border: 1px solid #f0f0f0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.dragging {
|
|
39
|
+
opacity: 0.5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&-content {
|
|
43
|
+
padding: 12px;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&-title {
|
|
50
|
+
flex: 1;
|
|
51
|
+
margin: 0 12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-actions {
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-children {
|
|
61
|
+
padding-left: 24px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-disabled {
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
opacity: 0.5;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.drag-handle {
|
|
70
|
+
cursor: move;
|
|
71
|
+
color: #999;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
color: #666;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.action-button {
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
color: #999;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
color: #666;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.delete {
|
|
87
|
+
&:hover {
|
|
88
|
+
color: #ff4d4f;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Props as TreeItem } from '../../../pisellDraggable/components/TreeItem/TreeItem';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface SortableItemProps {
|
|
5
|
+
itemProps: TreeItem;
|
|
6
|
+
render?: (itemProps: TreeItem) => React.ReactNode;
|
|
7
|
+
domRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
allowAddChild?: boolean;
|
|
9
|
+
allowDelete?: boolean;
|
|
10
|
+
allowDrag?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onAdd?: (itemProps: TreeItem) => void;
|
|
13
|
+
onDelete?: (itemProps: TreeItem) => void;
|
|
14
|
+
showBorder?: boolean;
|
|
15
|
+
spacing?: number;
|
|
16
|
+
maxLevel?: number;
|
|
17
|
+
}
|
|
18
|
+
declare const SortableItem: (props: SortableItemProps) => React.JSX.Element;
|
|
19
|
+
export default SortableItem;
|
|
@@ -0,0 +1,164 @@
|
|
|
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/pisellDropSort/components/SortableItem/index.tsx
|
|
30
|
+
var SortableItem_exports = {};
|
|
31
|
+
__export(SortableItem_exports, {
|
|
32
|
+
default: () => SortableItem_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SortableItem_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_DotsSix = __toESM(require("@pisell/icon/es/DotsSix"));
|
|
38
|
+
var import_button = __toESM(require("../../../button"));
|
|
39
|
+
var import_icon = __toESM(require("../../../icon"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var SortableItem = (props) => {
|
|
42
|
+
const {
|
|
43
|
+
itemProps,
|
|
44
|
+
render,
|
|
45
|
+
domRef,
|
|
46
|
+
allowAddChild,
|
|
47
|
+
allowDelete,
|
|
48
|
+
allowDrag,
|
|
49
|
+
disabled,
|
|
50
|
+
onAdd,
|
|
51
|
+
onDelete,
|
|
52
|
+
showBorder,
|
|
53
|
+
spacing,
|
|
54
|
+
maxLevel
|
|
55
|
+
} = props;
|
|
56
|
+
const {
|
|
57
|
+
item,
|
|
58
|
+
depth,
|
|
59
|
+
clone,
|
|
60
|
+
ghost,
|
|
61
|
+
indicator,
|
|
62
|
+
disableSelection,
|
|
63
|
+
disableInteraction,
|
|
64
|
+
wrapperRef,
|
|
65
|
+
style,
|
|
66
|
+
onCollapse,
|
|
67
|
+
onRemove,
|
|
68
|
+
childCount,
|
|
69
|
+
indentationWidth,
|
|
70
|
+
handleProps,
|
|
71
|
+
collapsed,
|
|
72
|
+
...otherProps
|
|
73
|
+
} = itemProps;
|
|
74
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: (0, import_classnames.default)(
|
|
78
|
+
"pisell-lowcode-drop-sort-item",
|
|
79
|
+
clone && "clone",
|
|
80
|
+
ghost && "ghost",
|
|
81
|
+
indicator && "indicator",
|
|
82
|
+
disableSelection && "disableSelection",
|
|
83
|
+
disableInteraction && "disableInteraction"
|
|
84
|
+
),
|
|
85
|
+
ref: wrapperRef,
|
|
86
|
+
style: {
|
|
87
|
+
"--spacing": `${indentationWidth * depth}px`
|
|
88
|
+
},
|
|
89
|
+
...otherProps
|
|
90
|
+
},
|
|
91
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: (0, import_classnames.default)("pisell-lowcode-drop-sort-item-tree-item", {
|
|
95
|
+
"pisell-lowcode-drop-sort-item-tree-item-border": showBorder,
|
|
96
|
+
disabled
|
|
97
|
+
}),
|
|
98
|
+
ref: domRef,
|
|
99
|
+
style
|
|
100
|
+
},
|
|
101
|
+
allowDrag && !disabled && /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
import_button.default,
|
|
103
|
+
{
|
|
104
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_DotsSix.default, { className: "pisell-lowcode-drop-sort-item-drag-handle-icon" }),
|
|
105
|
+
type: "text",
|
|
106
|
+
className: "pisell-lowcode-drop-sort-item-button",
|
|
107
|
+
...handleProps
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
onCollapse && /* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
import_button.default,
|
|
112
|
+
{
|
|
113
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
114
|
+
import_icon.default,
|
|
115
|
+
{
|
|
116
|
+
type: "pisell2-chevron-down",
|
|
117
|
+
className: "pisell-lowcode-drop-sort-item-icon"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
onClick: onCollapse,
|
|
121
|
+
type: "text",
|
|
122
|
+
className: (0, import_classnames.default)(
|
|
123
|
+
"Collapse",
|
|
124
|
+
collapsed && "collapsed",
|
|
125
|
+
"pisell-lowcode-drop-sort-item-button"
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-drop-sort-item-content" }, render && render(itemProps)),
|
|
130
|
+
!clone && allowAddChild && !disabled && /* @__PURE__ */ import_react.default.createElement(
|
|
131
|
+
import_button.default,
|
|
132
|
+
{
|
|
133
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
134
|
+
import_icon.default,
|
|
135
|
+
{
|
|
136
|
+
type: "pisell2-plus",
|
|
137
|
+
className: "pisell-lowcode-drop-sort-item-icon"
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
onClick: () => onAdd == null ? void 0 : onAdd(itemProps),
|
|
141
|
+
type: "text",
|
|
142
|
+
className: "pisell-lowcode-drop-sort-item-button"
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
!clone && allowDelete && !disabled && /* @__PURE__ */ import_react.default.createElement(
|
|
146
|
+
import_button.default,
|
|
147
|
+
{
|
|
148
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
149
|
+
import_icon.default,
|
|
150
|
+
{
|
|
151
|
+
type: "pisell2-trash-01",
|
|
152
|
+
className: "pisell-lowcode-drop-sort-item-icon"
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
onClick: () => onDelete == null ? void 0 : onDelete(itemProps),
|
|
156
|
+
type: "text",
|
|
157
|
+
className: "pisell-lowcode-drop-sort-item-button"
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
clone && childCount && childCount > 1 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode-drop-sort-item-count" }, childCount) : null
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
var SortableItem_default = SortableItem;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
.pisell-lowcode-drop-sort-item {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
padding-left: var(--spacing);
|
|
4
|
+
|
|
5
|
+
&.clone {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
padding: 0;
|
|
9
|
+
padding-left: 10px;
|
|
10
|
+
padding-top: 5px;
|
|
11
|
+
|
|
12
|
+
.pisell-lowcode-drop-sort-item-tree-item {
|
|
13
|
+
--vertical-padding: 5px;
|
|
14
|
+
|
|
15
|
+
padding-right: 24px;
|
|
16
|
+
box-shadow: 0px 15px 15px 0 rgba(34, 33, 81, 0.1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.ghost {
|
|
21
|
+
&.indicator {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
position: relative;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
margin-bottom: -1px;
|
|
26
|
+
|
|
27
|
+
.pisell-lowcode-drop-sort-item-tree-item {
|
|
28
|
+
position: relative;
|
|
29
|
+
padding: 0;
|
|
30
|
+
height: 8px;
|
|
31
|
+
border-color: #2389ff;
|
|
32
|
+
background-color: #56a1f8;
|
|
33
|
+
|
|
34
|
+
&:before {
|
|
35
|
+
position: absolute;
|
|
36
|
+
left: -8px;
|
|
37
|
+
top: -4px;
|
|
38
|
+
display: block;
|
|
39
|
+
content: '';
|
|
40
|
+
width: 12px;
|
|
41
|
+
height: 12px;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
border: 1px solid #2389ff;
|
|
44
|
+
background-color: #ffffff;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
> * {
|
|
48
|
+
/* Items are hidden using height and opacity to retain focus */
|
|
49
|
+
opacity: 0;
|
|
50
|
+
height: 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:not(.indicator) {
|
|
56
|
+
opacity: 0.5;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pisell-lowcode-drop-sort-item-tree-item > * {
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.pisell-lowcode-drop-sort-item-tree-item {
|
|
68
|
+
position: relative;
|
|
69
|
+
display: flex;
|
|
70
|
+
padding: 12px;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 16px;
|
|
73
|
+
align-self: stretch;
|
|
74
|
+
border-radius: 12px;
|
|
75
|
+
background: var(--Base-White, #fff);
|
|
76
|
+
|
|
77
|
+
--vertical-padding: 10px;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
// transition: all 0.25s;
|
|
80
|
+
|
|
81
|
+
.pisell-lowcode-drop-sort-item-content {
|
|
82
|
+
flex: 1;
|
|
83
|
+
height: 48px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.pisell-lowcode-drop-sort-item-button {
|
|
87
|
+
&:hover {
|
|
88
|
+
background: var(--Gray-100, #F2F4F7);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:hover {
|
|
93
|
+
background: var(--Gray-25, #FCFCFD);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.disabled {
|
|
97
|
+
border: 1px solid var(--Gray-200, #EAECF0);
|
|
98
|
+
background: var(--Gray-100, #F2F4F7);
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.pisell-lowcode-drop-sort-item-tree-item-border {
|
|
104
|
+
border: 1px solid var(--Gray-200, #eaecf0);
|
|
105
|
+
/* Shadow/xs */
|
|
106
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.pisell-lowcode-drop-sort-item-icon {
|
|
110
|
+
font-size: 20px;
|
|
111
|
+
color: #101828;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.pisell-lowcode-drop-sort-item-drag-handle-icon {
|
|
115
|
+
font-size: 20px;
|
|
116
|
+
color: #98a2b3;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.pisell-lowcode-drop-sort-item-count {
|
|
120
|
+
position: absolute;
|
|
121
|
+
top: -10px;
|
|
122
|
+
right: -10px;
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
width: 24px;
|
|
127
|
+
height: 24px;
|
|
128
|
+
border-radius: 50%;
|
|
129
|
+
background-color: #2389ff;
|
|
130
|
+
font-size: 0.8rem;
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
color: #fff;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.disableInteraction {
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.disableSelection,
|
|
140
|
+
.clone {
|
|
141
|
+
.pisell-lowcode-drop-sort-item-count {
|
|
142
|
+
user-select: none;
|
|
143
|
+
-webkit-user-select: none;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.Collapse {
|
|
148
|
+
svg {
|
|
149
|
+
transition: transform 250ms ease;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.collapsed svg {
|
|
153
|
+
transform: rotate(-90deg);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -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/pisellDropSort/index.tsx
|
|
30
|
+
var pisellDropSort_exports = {};
|
|
31
|
+
__export(pisellDropSort_exports, {
|
|
32
|
+
default: () => pisellDropSort_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellDropSort_exports);
|
|
35
|
+
var import_PisellDropSort = __toESM(require("./PisellDropSort"));
|
|
36
|
+
var pisellDropSort_default = import_PisellDropSort.default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import type { Props as TreeItem } from '../pisellDraggable/components/TreeItem/TreeItem';
|
|
3
|
+
import type { TreeItem as TreeItemType } from '../pisellDraggable/types';
|
|
4
|
+
export interface DropSortItem extends TreeItemType {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface PisellDropSortProps {
|
|
8
|
+
/** value */
|
|
9
|
+
value: DropSortItem[];
|
|
10
|
+
/** 允许拖拽 */
|
|
11
|
+
allowDrag?: boolean;
|
|
12
|
+
/** 允许删除 */
|
|
13
|
+
allowDelete?: boolean;
|
|
14
|
+
/** 允许添加子节点 */
|
|
15
|
+
allowAddChild?: boolean;
|
|
16
|
+
/** 允许添加根节点 */
|
|
17
|
+
allowAddRoot?: boolean;
|
|
18
|
+
/** 是否禁用 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 节点间距 */
|
|
21
|
+
spacing?: number;
|
|
22
|
+
/** 最大层级数 */
|
|
23
|
+
maxLevel?: number;
|
|
24
|
+
/** 是否显示边框 */
|
|
25
|
+
showBorder?: boolean;
|
|
26
|
+
/** 样式 */
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
/** 类名 */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** 数据源变化回调 */
|
|
31
|
+
onChange?: (items: DropSortItem[]) => void;
|
|
32
|
+
/** 删除节点回调 */
|
|
33
|
+
onDelete?: (itemProps: TreeItem) => void;
|
|
34
|
+
/** 添加节点回调 */
|
|
35
|
+
onAdd?: (itemProps: TreeItem) => void;
|
|
36
|
+
/** 自定义渲染节点 */
|
|
37
|
+
renderItem?: (itemProps: TreeItem) => React.ReactNode;
|
|
38
|
+
/** 添加根节点回调 */
|
|
39
|
+
onAddRoot?: () => void;
|
|
40
|
+
/** 左侧自定义内容 */
|
|
41
|
+
leftContent?: React.ReactNode;
|
|
42
|
+
}
|
|
@@ -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/pisellDropSort/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -44,7 +44,6 @@ var Information = (props) => {
|
|
|
44
44
|
mobileModalHeight: "auto",
|
|
45
45
|
headerDivider: false,
|
|
46
46
|
footerDivider,
|
|
47
|
-
size: "small",
|
|
48
47
|
transitionName: "pisell-move-down"
|
|
49
48
|
},
|
|
50
49
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-modal-information-title" }, title),
|
|
@@ -134,7 +134,7 @@ var PublishVersionModal = ({
|
|
|
134
134
|
preserve: false,
|
|
135
135
|
className: "pisell-lowcode-version-modal-form"
|
|
136
136
|
},
|
|
137
|
-
isShowCurrentVersion && /* @__PURE__ */ import_react.default.createElement("p",
|
|
137
|
+
isShowCurrentVersion && /* @__PURE__ */ import_react.default.createElement("p", { className: "pisell-lowcode-version-modal-current-version" }, (0, import_locales.getText)("pisell-version-modal-current-version"), ": ", currentVersion),
|
|
138
138
|
isShowBasedOn && /* @__PURE__ */ import_react.default.createElement(
|
|
139
139
|
import_antd.Form.Item,
|
|
140
140
|
{
|