@pisell/materials 3.3.32 → 3.3.34

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.
Files changed (121) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +9 -9
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +24 -24
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +25 -25
  11. package/es/components/buttonGroupEdit/index.d.ts +8 -0
  12. package/es/components/dataSourceComponents/dataSourceMenu/Basic.js +6 -2
  13. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  14. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
  15. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +32 -0
  16. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +1 -1
  17. package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +5 -0
  18. package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +4 -12
  19. package/es/components/dataSourceComponents/fields/utils.js +0 -5
  20. package/es/components/div/index.js +45 -8
  21. package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.js +4 -3
  22. package/es/components/pisellDraggable/components/TreeItem/index.js +1 -1
  23. package/es/components/pisellDraggable/index.js +165 -127
  24. package/es/components/pisellDropSort/PisellDropSort.js +10 -3
  25. package/es/components/pisellDropSort/components/SortableItem/index.js +6 -1
  26. package/es/components/pisellDropSort/components/SortableItem/index.less +0 -1
  27. package/es/components/pisellMenu/PisellMenu.js +1 -0
  28. package/es/components/pisellNavigationMenu/PisellNavigationMenu.d.ts +5 -0
  29. package/es/components/pisellNavigationMenu/PisellNavigationMenu.js +79 -11
  30. package/es/components/pisellNavigationMenu/PisellNavigationMenu.less +14 -0
  31. package/es/components/productCard/components/MultiDay/index.d.ts +3 -0
  32. package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
  33. package/es/components/productCard/components/Packages/components/options/index.d.ts +3 -0
  34. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  35. package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  36. package/es/components/table/Table/SelectField/index.d.ts +1 -0
  37. package/es/components/table/Table/fields/index.d.ts +3 -2
  38. package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  39. package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  40. package/es/components/table/Table/utils.d.ts +1 -1
  41. package/es/locales/en-US.js +4 -0
  42. package/es/locales/zh-CN.js +4 -0
  43. package/es/locales/zh-TW.js +4 -0
  44. package/es/utils/index.d.ts +1 -1
  45. package/es/utils/platform.d.ts +1 -1
  46. package/lib/components/buttonGroupEdit/index.d.ts +8 -0
  47. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.js +6 -2
  48. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  49. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
  50. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +32 -0
  51. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +1 -1
  52. package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +5 -0
  53. package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +7 -15
  54. package/lib/components/dataSourceComponents/fields/utils.js +0 -5
  55. package/lib/components/div/index.js +33 -3
  56. package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.js +4 -7
  57. package/lib/components/pisellDraggable/components/TreeItem/index.js +12 -2
  58. package/lib/components/pisellDraggable/index.js +114 -80
  59. package/lib/components/pisellDropSort/PisellDropSort.js +9 -3
  60. package/lib/components/pisellDropSort/components/SortableItem/index.js +5 -0
  61. package/lib/components/pisellDropSort/components/SortableItem/index.less +0 -1
  62. package/lib/components/pisellMenu/PisellMenu.js +1 -0
  63. package/lib/components/pisellNavigationMenu/PisellNavigationMenu.d.ts +5 -0
  64. package/lib/components/pisellNavigationMenu/PisellNavigationMenu.js +64 -9
  65. package/lib/components/pisellNavigationMenu/PisellNavigationMenu.less +14 -0
  66. package/lib/components/productCard/components/MultiDay/index.d.ts +3 -0
  67. package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
  68. package/lib/components/productCard/components/Packages/components/options/index.d.ts +3 -0
  69. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  70. package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  71. package/lib/components/table/Table/SelectField/index.d.ts +1 -0
  72. package/lib/components/table/Table/fields/index.d.ts +3 -2
  73. package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  74. package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  75. package/lib/components/table/Table/utils.d.ts +1 -1
  76. package/lib/locales/en-US.js +4 -0
  77. package/lib/locales/zh-CN.js +4 -0
  78. package/lib/locales/zh-TW.js +4 -0
  79. package/lib/utils/index.d.ts +1 -1
  80. package/lib/utils/platform.d.ts +1 -1
  81. package/lowcode/div/meta.ts +39 -4
  82. package/lowcode/pisell-navigation-menu/meta.ts +12 -0
  83. package/package.json +3 -3
  84. package/es/components/appVersionControl/index.d.ts +0 -4
  85. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -38
  86. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +0 -78
  87. package/es/components/div/index.d.ts +0 -8
  88. package/es/components/drag-sort-tree/index.d.ts +0 -4
  89. package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +0 -9
  90. package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +0 -23
  91. package/es/components/pisellDraggable/components/TreeItem/index.d.ts +0 -2
  92. package/es/components/pisellDraggable/index.d.ts +0 -32
  93. package/es/components/pisellDropSort/PisellDropSort.d.ts +0 -5
  94. package/es/components/pisellDropSort/components/SortableItem/index.d.ts +0 -25
  95. package/es/components/pisellDropSort/types.d.ts +0 -52
  96. package/es/components/pisellMenu/PisellMenu.d.ts +0 -9
  97. package/es/components/pisellMenu/types.d.ts +0 -26
  98. package/es/components/pisellNavigationMenu/types.d.ts +0 -64
  99. package/es/components/table/Actions/component/ExportImport/index.d.ts +0 -7
  100. package/es/components/table/Table/index.d.ts +0 -4
  101. package/es/components/table/types.d.ts +0 -251
  102. package/es/components/versionModal/index.d.ts +0 -23
  103. package/lib/components/appVersionControl/index.d.ts +0 -4
  104. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -38
  105. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +0 -78
  106. package/lib/components/div/index.d.ts +0 -8
  107. package/lib/components/drag-sort-tree/index.d.ts +0 -4
  108. package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +0 -9
  109. package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +0 -23
  110. package/lib/components/pisellDraggable/components/TreeItem/index.d.ts +0 -2
  111. package/lib/components/pisellDraggable/index.d.ts +0 -32
  112. package/lib/components/pisellDropSort/PisellDropSort.d.ts +0 -5
  113. package/lib/components/pisellDropSort/components/SortableItem/index.d.ts +0 -25
  114. package/lib/components/pisellDropSort/types.d.ts +0 -52
  115. package/lib/components/pisellMenu/PisellMenu.d.ts +0 -9
  116. package/lib/components/pisellMenu/types.d.ts +0 -26
  117. package/lib/components/pisellNavigationMenu/types.d.ts +0 -64
  118. package/lib/components/table/Actions/component/ExportImport/index.d.ts +0 -7
  119. package/lib/components/table/Table/index.d.ts +0 -4
  120. package/lib/components/table/types.d.ts +0 -251
  121. package/lib/components/versionModal/index.d.ts +0 -23
@@ -34,7 +34,37 @@ __export(div_exports, {
34
34
  module.exports = __toCommonJS(div_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var Div = (props) => {
37
- const { children, style = {}, others = {}, ...otherProps } = props;
38
- return /* @__PURE__ */ import_react.default.createElement("div", { style, ...others, ...otherProps }, children);
37
+ const {
38
+ baseClassName = "div",
39
+ className = "",
40
+ render,
41
+ children,
42
+ style = {},
43
+ others = {},
44
+ ...otherProps
45
+ } = props;
46
+ const combinedClassName = (0, import_react.useMemo)(() => {
47
+ const parts = [baseClassName, className].filter(Boolean);
48
+ return parts.length > 0 ? parts.join(" ") : void 0;
49
+ }, [baseClassName, className]);
50
+ const content = (0, import_react.useMemo)(() => {
51
+ if (render) {
52
+ try {
53
+ return render();
54
+ } catch (error) {
55
+ console.error("Div render function error:", error);
56
+ return children;
57
+ }
58
+ }
59
+ return children;
60
+ }, [render, children]);
61
+ const divProps = (0, import_react.useMemo)(() => ({
62
+ ...combinedClassName && { className: combinedClassName },
63
+ style,
64
+ ...others,
65
+ ...otherProps
66
+ }), [combinedClassName, style, others, otherProps]);
67
+ return /* @__PURE__ */ import_react.default.createElement("div", { ...divProps }, content);
39
68
  };
40
- var div_default = Div;
69
+ Div.displayName = "Div";
70
+ var div_default = import_react.default.memo(Div);
@@ -29,7 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/components/pisellDraggable/components/TreeItem/SortableTreeItem.tsx
30
30
  var SortableTreeItem_exports = {};
31
31
  __export(SortableTreeItem_exports, {
32
- SortableTreeItem: () => SortableTreeItem
32
+ default: () => SortableTreeItem_default
33
33
  });
34
34
  module.exports = __toCommonJS(SortableTreeItem_exports);
35
35
  var import_sortable = require("@dnd-kit/sortable");
@@ -41,7 +41,7 @@ var animateLayoutChanges = ({
41
41
  isSorting,
42
42
  wasDragging
43
43
  }) => isSorting || wasDragging ? false : true;
44
- function SortableTreeItem({ id, depth, ...props }) {
44
+ var SortableTreeItem = ({ id, depth, ...props }) => {
45
45
  const {
46
46
  attributes,
47
47
  isDragging,
@@ -76,8 +76,5 @@ function SortableTreeItem({ id, depth, ...props }) {
76
76
  ...props
77
77
  }
78
78
  );
79
- }
80
- // Annotate the CommonJS export names for ESM import in node:
81
- 0 && (module.exports = {
82
- SortableTreeItem
83
- });
79
+ };
80
+ var SortableTreeItem_default = (0, import_react.memo)(SortableTreeItem);
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,17 +16,25 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
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
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/pisellDraggable/components/TreeItem/index.ts
20
30
  var TreeItem_exports = {};
21
31
  __export(TreeItem_exports, {
22
- SortableTreeItem: () => import_SortableTreeItem.SortableTreeItem,
32
+ SortableTreeItem: () => import_SortableTreeItem.default,
23
33
  TreeItem: () => import_TreeItem.TreeItem
24
34
  });
25
35
  module.exports = __toCommonJS(TreeItem_exports);
26
36
  var import_TreeItem = require("./TreeItem");
27
- var import_SortableTreeItem = require("./SortableTreeItem");
37
+ var import_SortableTreeItem = __toESM(require("./SortableTreeItem"));
28
38
  // Annotate the CommonJS export names for ESM import in node:
29
39
  0 && (module.exports = {
30
40
  SortableTreeItem,
@@ -37,6 +37,7 @@ var import_core = require("@dnd-kit/core");
37
37
  var import_sortable = require("@dnd-kit/sortable");
38
38
  var import_react = __toESM(require("react"));
39
39
  var import_react_dom = require("react-dom");
40
+ var import_ahooks = require("ahooks");
40
41
  var import_utilities = require("@dnd-kit/utilities");
41
42
  var import_components = require("./components");
42
43
  var import_utilities2 = require("./utilities");
@@ -103,7 +104,8 @@ function SortableTree({
103
104
  onChange,
104
105
  onRemoveBefore,
105
106
  __designMode,
106
- maxLevel = 3
107
+ maxLevel = 3,
108
+ canDrop
107
109
  }) {
108
110
  const [items, setItems] = (0, import_react.useState)([]);
109
111
  const [activeId, setActiveId] = (0, import_react.useState)(null);
@@ -143,7 +145,9 @@ function SortableTree({
143
145
  () => flattenedItems.map(({ id }) => id),
144
146
  [flattenedItems]
145
147
  );
146
- const activeItem = activeId ? flattenedItems.find(({ id }) => id === activeId) : null;
148
+ const activeItem = (0, import_react.useMemo)(() => {
149
+ return activeId ? flattenedItems.find(({ id }) => id === activeId) : null;
150
+ }, [activeId, flattenedItems]);
147
151
  (0, import_react.useEffect)(() => {
148
152
  sensorContext.current = {
149
153
  items: flattenedItems,
@@ -164,68 +168,25 @@ function SortableTree({
164
168
  return childNewDepth >= maxLevel || checkSubtreeDepth(items2, child.id, childNewDepth);
165
169
  });
166
170
  }
167
- return /* @__PURE__ */ import_react.default.createElement(
168
- import_core.DndContext,
169
- {
170
- sensors,
171
- collisionDetection: import_core.closestCenter,
172
- measuring,
173
- onDragStart: handleDragStart,
174
- onDragMove: handleDragMove,
175
- onDragOver: handleDragOver,
176
- onDragEnd: handleDragEnd,
177
- onDragCancel: handleDragCancel
178
- },
179
- /* @__PURE__ */ import_react.default.createElement(import_sortable.SortableContext, { items: sortedIds, strategy: import_sortable.verticalListSortingStrategy }, flattenedItems.map((item) => {
180
- const { id, children, collapsed, depth } = item;
181
- return /* @__PURE__ */ import_react.default.createElement(
182
- import_components.SortableTreeItem,
183
- {
184
- key: id,
185
- id,
186
- item,
187
- depth: id === activeId && projected ? projected.depth : depth,
188
- indentationWidth,
189
- indicator,
190
- collapsed: Boolean(collapsed && (children == null ? void 0 : children.length)),
191
- onCollapse: collapsible && (children == null ? void 0 : children.length) ? () => handleCollapse(id) : void 0,
192
- onRemove: removable ? () => handleRemove(item) : void 0,
193
- renderItem,
194
- __designMode
195
- }
196
- );
197
- }), (0, import_react_dom.createPortal)(
198
- /* @__PURE__ */ import_react.default.createElement(
199
- import_core.DragOverlay,
200
- {
201
- dropAnimation: dropAnimationConfig,
202
- modifiers: indicator ? [adjustTranslate] : void 0
203
- },
204
- activeId && activeItem ? /* @__PURE__ */ import_react.default.createElement(
205
- import_components.SortableTreeItem,
206
- {
207
- id: activeId,
208
- depth: activeItem.depth,
209
- clone: true,
210
- childCount: (0, import_utilities2.getChildCount)(items, activeId) + 1,
211
- item: activeItem,
212
- indentationWidth,
213
- renderItem
214
- }
215
- ) : null
216
- ),
217
- document.body
218
- ))
219
- );
220
- function handleDragStart({ active: { id: activeId2 } }) {
171
+ const handleRemove = (0, import_ahooks.useMemoizedFn)(async (item) => {
172
+ if (onRemoveBefore) {
173
+ let res = await (onRemoveBefore == null ? void 0 : onRemoveBefore(item));
174
+ if (!res) {
175
+ return;
176
+ }
177
+ }
178
+ setItems((items2) => (0, import_utilities2.removeItem)(items2, item.id));
179
+ onChange == null ? void 0 : onChange(items);
180
+ });
181
+ const handleDragStart = (0, import_ahooks.useMemoizedFn)(({ active: { id: activeId2 } }) => {
221
182
  setActiveId(activeId2);
222
183
  setOverId(activeId2);
223
184
  document.body.style.setProperty("cursor", "grabbing");
224
- }
225
- function handleDragMove({ delta }) {
185
+ });
186
+ const handleDragMove = (0, import_ahooks.useMemoizedFn)(({ delta }) => {
226
187
  setOffsetLeft(delta.x);
227
- }
228
- function handleDragOver({ over }) {
188
+ });
189
+ const handleDragOver = (0, import_ahooks.useMemoizedFn)(({ over }) => {
229
190
  if (!projected || !over) {
230
191
  setOverId((over == null ? void 0 : over.id) ?? null);
231
192
  return;
@@ -246,8 +207,11 @@ function SortableTree({
246
207
  return;
247
208
  }
248
209
  setOverId(over.id);
249
- }
250
- function handleDragEnd({ active, over }) {
210
+ });
211
+ const parentNode = (0, import_react.useMemo)(() => {
212
+ return (projected == null ? void 0 : projected.parentId) ? flattenedItems.find((item) => item.id === projected.parentId) : null;
213
+ }, [flattenedItems, projected == null ? void 0 : projected.parentId]);
214
+ const handleDragEnd = (0, import_ahooks.useMemoizedFn)(({ active, over }) => {
251
215
  resetState();
252
216
  if (projected && over) {
253
217
  const { depth, parentId } = projected;
@@ -255,6 +219,14 @@ function SortableTree({
255
219
  if (targetParent == null ? void 0 : targetParent.disabledDrop) {
256
220
  return;
257
221
  }
222
+ const dragItem = flattenedItems.find((item) => item.id === active.id);
223
+ const dropTarget = flattenedItems.find((item) => item.id === over.id);
224
+ if (canDrop && dragItem && dropTarget) {
225
+ const canDropResult = canDrop(dragItem, dropTarget, parentId, targetParent);
226
+ if (!canDropResult) {
227
+ return;
228
+ }
229
+ }
258
230
  if (depth >= maxLevel) {
259
231
  return;
260
232
  }
@@ -278,7 +250,86 @@ function SortableTree({
278
250
  setItems(newItems);
279
251
  onChange == null ? void 0 : onChange(newItems);
280
252
  }
281
- }
253
+ });
254
+ const handleCollapse = (0, import_ahooks.useMemoizedFn)((id) => {
255
+ setItems((items2) => {
256
+ const newVal = (0, import_utilities2.setProperty)(items2, id, "collapsed", (value2) => {
257
+ return !value2;
258
+ });
259
+ onChange == null ? void 0 : onChange(items2);
260
+ return newVal;
261
+ });
262
+ });
263
+ const isError = (0, import_react.useMemo)(() => {
264
+ return !(canDrop == null ? void 0 : canDrop(activeItem || {}, {}, projected == null ? void 0 : projected.parentId, parentNode));
265
+ }, [projected, activeItem, canDrop, parentNode]);
266
+ const renderTreeItems = (0, import_react.useMemo)(() => {
267
+ return flattenedItems.map((item) => {
268
+ const { id, children, collapsed, depth } = item;
269
+ return /* @__PURE__ */ import_react.default.createElement(
270
+ import_components.SortableTreeItem,
271
+ {
272
+ key: id,
273
+ id,
274
+ item,
275
+ depth: id === activeId && projected ? projected.depth : depth,
276
+ indentationWidth,
277
+ indicator,
278
+ collapsed: Boolean(collapsed && (children == null ? void 0 : children.length)),
279
+ onCollapse: collapsible && (children == null ? void 0 : children.length) ? () => handleCollapse(id) : void 0,
280
+ onRemove: removable ? () => handleRemove(item) : void 0,
281
+ renderItem,
282
+ __designMode
283
+ }
284
+ );
285
+ });
286
+ }, [
287
+ flattenedItems,
288
+ activeId,
289
+ projected == null ? void 0 : projected.depth,
290
+ indentationWidth,
291
+ indicator,
292
+ collapsible,
293
+ handleCollapse,
294
+ handleRemove,
295
+ renderItem,
296
+ __designMode
297
+ ]);
298
+ return /* @__PURE__ */ import_react.default.createElement(
299
+ import_core.DndContext,
300
+ {
301
+ sensors,
302
+ collisionDetection: import_core.closestCenter,
303
+ measuring,
304
+ onDragStart: handleDragStart,
305
+ onDragMove: handleDragMove,
306
+ onDragOver: handleDragOver,
307
+ onDragEnd: handleDragEnd,
308
+ onDragCancel: handleDragCancel
309
+ },
310
+ /* @__PURE__ */ import_react.default.createElement(import_sortable.SortableContext, { items: sortedIds, strategy: import_sortable.verticalListSortingStrategy }, renderTreeItems, (0, import_react_dom.createPortal)(
311
+ /* @__PURE__ */ import_react.default.createElement(
312
+ import_core.DragOverlay,
313
+ {
314
+ dropAnimation: dropAnimationConfig,
315
+ modifiers: indicator ? [adjustTranslate] : void 0
316
+ },
317
+ activeId && activeItem ? /* @__PURE__ */ import_react.default.createElement(
318
+ import_components.SortableTreeItem,
319
+ {
320
+ id: activeId,
321
+ depth: activeItem.depth,
322
+ clone: true,
323
+ childCount: (0, import_utilities2.getChildCount)(items, activeId) + 1,
324
+ item: activeItem,
325
+ indentationWidth,
326
+ renderItem: (props, ref) => renderItem == null ? void 0 : renderItem({ ...props, isError }, ref)
327
+ }
328
+ ) : null
329
+ ),
330
+ document.body
331
+ ))
332
+ );
282
333
  function handleDragCancel() {
283
334
  resetState();
284
335
  }
@@ -288,23 +339,6 @@ function SortableTree({
288
339
  setOffsetLeft(0);
289
340
  document.body.style.setProperty("cursor", "");
290
341
  }
291
- async function handleRemove(item) {
292
- if (onRemoveBefore) {
293
- let res = await (onRemoveBefore == null ? void 0 : onRemoveBefore(item));
294
- if (!res) {
295
- return;
296
- }
297
- }
298
- setItems((items2) => (0, import_utilities2.removeItem)(items2, item.id));
299
- onChange == null ? void 0 : onChange(items);
300
- }
301
- function handleCollapse(id) {
302
- setItems(
303
- (items2) => (0, import_utilities2.setProperty)(items2, id, "collapsed", (value2) => {
304
- return !value2;
305
- })
306
- );
307
- }
308
342
  }
309
343
  var adjustTranslate = ({ transform }) => {
310
344
  return {
@@ -46,6 +46,7 @@ var PisellDropSort = ({
46
46
  allowDelete = true,
47
47
  allowAddChild = true,
48
48
  allowAddRoot = true,
49
+ allowIsShow = false,
49
50
  disabled = false,
50
51
  spacing = 8,
51
52
  maxLevel = 3,
@@ -62,7 +63,9 @@ var PisellDropSort = ({
62
63
  __designMode,
63
64
  isCustomAction,
64
65
  emptyContent,
65
- getItemStyle
66
+ getItemStyle,
67
+ canDrop,
68
+ indentationWidth
66
69
  }) => {
67
70
  const renderItem = (0, import_react.useCallback)(
68
71
  (itemProps, ref) => {
@@ -75,6 +78,7 @@ var PisellDropSort = ({
75
78
  allowAddChild,
76
79
  allowDelete,
77
80
  allowDrag,
81
+ allowIsShow,
78
82
  disabled,
79
83
  onAdd,
80
84
  onDelete,
@@ -132,10 +136,12 @@ var PisellDropSort = ({
132
136
  value,
133
137
  collapsible: true,
134
138
  indicator: false,
135
- indentationWidth: 24,
139
+ indentationWidth,
136
140
  removable: allowDelete,
137
141
  renderItem,
138
- onChange: handleChange
142
+ onChange: handleChange,
143
+ canDrop,
144
+ maxLevel
139
145
  }
140
146
  )
141
147
  ));
@@ -46,6 +46,7 @@ var SortableItem = (props) => {
46
46
  allowAddChild,
47
47
  allowDelete,
48
48
  allowDrag,
49
+ allowIsShow,
49
50
  disabled,
50
51
  onAdd,
51
52
  onDelete,
@@ -72,6 +73,7 @@ var SortableItem = (props) => {
72
73
  indentationWidth,
73
74
  handleProps,
74
75
  collapsed,
76
+ isError,
75
77
  ...otherProps
76
78
  } = itemProps;
77
79
  const itemStyle = (getItemStyle == null ? void 0 : getItemStyle(itemProps)) || {};
@@ -79,6 +81,9 @@ var SortableItem = (props) => {
79
81
  ...itemStyle,
80
82
  ...style
81
83
  };
84
+ if (isError) {
85
+ mergedStyle.backgroundColor = "#FECDCA";
86
+ }
82
87
  return /* @__PURE__ */ import_react.default.createElement(
83
88
  "li",
84
89
  {
@@ -81,7 +81,6 @@
81
81
 
82
82
  .pisell-lowcode-drop-sort-item-content {
83
83
  flex: 1;
84
- height: 48px;
85
84
  }
86
85
 
87
86
  .pisell-lowcode-drop-sort-item-button {
@@ -96,4 +96,5 @@ var PisellMenu = ({
96
96
  };
97
97
  PisellMenu.Item = import_antd.Menu.Item;
98
98
  PisellMenu.SubMenu = import_antd.Menu.SubMenu;
99
+ PisellMenu.ItemGroup = import_antd.Menu.ItemGroup;
99
100
  var PisellMenu_default = PisellMenu;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { PisellNavigationMenuProps } from './types';
3
+ import './PisellNavigationMenu.less';
4
+ declare const PisellNavigationMenu: React.FC<PisellNavigationMenuProps>;
5
+ export default PisellNavigationMenu;
@@ -33,6 +33,8 @@ __export(PisellNavigationMenu_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(PisellNavigationMenu_exports);
35
35
  var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var import_classnames = __toESM(require("classnames"));
36
38
  var import_pisellDropSort = __toESM(require("../pisellDropSort"));
37
39
  var import_pisellTags = __toESM(require("../pisellTags"));
38
40
  var import_icon = __toESM(require("../icon"));
@@ -40,7 +42,7 @@ var import_button = __toESM(require("../button"));
40
42
  var import_locales = require("../../locales");
41
43
  var import_antd = require("antd");
42
44
  var import_pisellEmpty = __toESM(require("../pisellEmpty"));
43
- var import_utils = require("./utils");
45
+ var import_utils2 = require("./utils");
44
46
  var import_PisellNavigationMenu = require("./PisellNavigationMenu.less");
45
47
  var PisellNavigationMenu = ({
46
48
  value = [],
@@ -48,6 +50,7 @@ var PisellNavigationMenu = ({
48
50
  allowDelete = true,
49
51
  allowAddChild = true,
50
52
  allowAddRoot = true,
53
+ allowIsShow = true,
51
54
  disabled = false,
52
55
  spacing = 8,
53
56
  maxLevel = 3,
@@ -58,14 +61,23 @@ var PisellNavigationMenu = ({
58
61
  onAddPage,
59
62
  onEdit,
60
63
  onDelete,
64
+ onIsShow,
61
65
  __designMode,
62
- title
66
+ title,
67
+ rightContent: propsRightContent,
68
+ getItemStyle: propsGetItemStyle,
69
+ canDrop,
70
+ indentationWidth = 24,
71
+ hideDescription,
72
+ showActionOnHover,
73
+ showTitleTags
63
74
  }) => {
64
75
  const convertToNavigationItems = (items2) => {
65
76
  return items2.map((item) => ({
66
77
  id: String(item.id),
67
78
  title: String(item.title || ""),
68
79
  path: String(item.path || "/"),
80
+ collapsed: item.collapsed,
69
81
  children: item.children ? convertToNavigationItems(item.children) : []
70
82
  }));
71
83
  };
@@ -94,25 +106,58 @@ var PisellNavigationMenu = ({
94
106
  text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-base"),
95
107
  color: "#7f56d9"
96
108
  },
109
+ proCode: {
110
+ text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-proCode"),
111
+ color: "#1677ff"
112
+ },
97
113
  pisellV1: {
98
114
  text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-pisell1"),
99
115
  color: "#ee837a"
116
+ },
117
+ group: {
118
+ text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-group"),
119
+ color: "#7f56d9"
120
+ },
121
+ subMenu: {
122
+ text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-sub-menu"),
123
+ color: "#067647"
124
+ },
125
+ custom: {
126
+ text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-custom"),
127
+ color: "#B54708"
100
128
  }
101
129
  };
102
130
  }, []);
103
131
  const renderMenuItem = (0, import_react.useCallback)(
104
132
  (itemProps) => {
105
- var _a, _b;
133
+ var _a, _b, _c, _d, _e, _f, _g, _h;
106
134
  const { item } = itemProps;
107
135
  const {
108
136
  allowEdit = true,
109
137
  allowDelete: allowDelete2 = true,
110
138
  allowAddChild: allowAddChild2 = true,
111
139
  allowAddSubmenu = true,
112
- allowAddPage = true
140
+ allowAddPage = true,
141
+ allowIsShow: allowIsShow2 = true
113
142
  } = item;
114
143
  const isShowAddButton = item.isGroup && allowAddChild2 && (allowAddSubmenu || allowAddPage);
115
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-icon" }, /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: item.icon })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-text" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-description" }, item.description, item.source && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: (_a = tagTextMap[item.source]) == null ? void 0 : _a.color }, ((_b = tagTextMap[item.source]) == null ? void 0 : _b.text) || ""), !item.isGroup && item.version && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: "success" }, "v", item.version)))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-action-wrap" }, allowEdit && /* @__PURE__ */ import_react.default.createElement(
144
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content" }, item.icon && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-icon" }, /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: item.icon })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-text" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-title" }, item.title, showTitleTags && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, item.isGroup && item.is_top && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: (_a = tagTextMap["group"]) == null ? void 0 : _a.color }, ((_b = tagTextMap["group"]) == null ? void 0 : _b.text) || ""), item.isGroup && !item.is_top && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: (_c = tagTextMap["subMenu"]) == null ? void 0 : _c.color }, ((_d = tagTextMap["subMenu"]) == null ? void 0 : _d.text) || ""), item.isCustom && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: (_e = tagTextMap["custom"]) == null ? void 0 : _e.color }, ((_f = tagTextMap["custom"]) == null ? void 0 : _f.text) || ""))), hideDescription ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-description", style: { display: hideDescription ? "none" : "flex" } }, item.description, item.source && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: (_g = tagTextMap[item.source]) == null ? void 0 : _g.color }, ((_h = tagTextMap[item.source]) == null ? void 0 : _h.text) || ""), !item.isGroup && item.version && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: "success" }, "v", item.version)))), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode-navigation-menu-item-action-wrap", {
145
+ "pisell-lowcode-navigation-menu-item-action-wrap-hover": showActionOnHover
146
+ }) }, allowIsShow2 && /* @__PURE__ */ import_react.default.createElement(
147
+ import_button.default,
148
+ {
149
+ type: "text",
150
+ onClick: () => onIsShow == null ? void 0 : onIsShow(item),
151
+ className: "pisell-lowcode-navigation-menu-item-action-button",
152
+ icon: /* @__PURE__ */ import_react.default.createElement(
153
+ import_icon.default,
154
+ {
155
+ type: item.is_show === false ? "pisell2-eye-off" : "pisell2-eye",
156
+ className: "pisell-lowcode-navigation-menu-item-action-button-icon"
157
+ }
158
+ )
159
+ }
160
+ ), allowEdit && /* @__PURE__ */ import_react.default.createElement(
116
161
  import_button.default,
117
162
  {
118
163
  type: "text",
@@ -129,6 +174,7 @@ var PisellNavigationMenu = ({
129
174
  ), isShowAddButton && /* @__PURE__ */ import_react.default.createElement(
130
175
  import_antd.Dropdown,
131
176
  {
177
+ getPopupContainer: (triggerNode) => triggerNode,
132
178
  menu: {
133
179
  items: [
134
180
  allowAddSubmenu && {
@@ -188,6 +234,9 @@ var PisellNavigationMenu = ({
188
234
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-left-content" }, title);
189
235
  }, [title]);
190
236
  const rightContent = (0, import_react.useMemo)(() => {
237
+ if (propsRightContent) {
238
+ return propsRightContent;
239
+ }
191
240
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-right-content" }, /* @__PURE__ */ import_react.default.createElement(
192
241
  import_button.default,
193
242
  {
@@ -206,27 +255,32 @@ var PisellNavigationMenu = ({
206
255
  },
207
256
  (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-page")
208
257
  ));
209
- }, [title]);
258
+ }, [propsRightContent]);
210
259
  const formatValue = (0, import_react.useMemo)(() => {
211
- return (0, import_utils.formatTree)(value, (item) => ({
260
+ return (0, import_utils2.formatTree)(value, (item) => ({
212
261
  ...item,
213
262
  disabledDrop: !item.isGroup
214
263
  }));
215
264
  }, [value]);
216
265
  const getItemStyle = (0, import_react.useCallback)((itemProps) => {
217
266
  const { item } = itemProps;
267
+ if ((0, import_utils.isFunction)(propsGetItemStyle)) {
268
+ return (propsGetItemStyle == null ? void 0 : propsGetItemStyle(item)) || {};
269
+ }
218
270
  return {
219
271
  backgroundColor: item.isGroup ? "#fff" : "var(--Gray-50, #F9FAFB)"
220
272
  };
221
- }, []);
273
+ }, [propsGetItemStyle]);
222
274
  return /* @__PURE__ */ import_react.default.createElement(
223
275
  import_pisellDropSort.default,
224
276
  {
277
+ indentationWidth,
225
278
  value: formatValue,
226
279
  allowDrag,
227
280
  allowDelete,
228
281
  allowAddChild,
229
282
  allowAddRoot,
283
+ allowIsShow,
230
284
  disabled,
231
285
  spacing,
232
286
  maxLevel,
@@ -245,7 +299,8 @@ var PisellNavigationMenu = ({
245
299
  maxWidth: 400,
246
300
  description: (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-page-tip")
247
301
  }
248
- )
302
+ ),
303
+ canDrop
249
304
  }
250
305
  );
251
306
  };
@@ -1,3 +1,10 @@
1
+ .pisell-lowcode-drop-sort-item-tree-item {
2
+ &:hover {
3
+ .pisell-lowcode-navigation-menu-item-action-wrap {
4
+ opacity: 1 !important;
5
+ }
6
+ }
7
+ }
1
8
  .pisell-lowcode-navigation-menu-item {
2
9
  display: flex;
3
10
  justify-content: space-between;
@@ -26,6 +33,9 @@
26
33
  font-size: 14px;
27
34
  font-weight: 600;
28
35
  line-height: 20px; /* 142.857% */
36
+ display: flex;
37
+ gap: 10px;
38
+ align-items: center;
29
39
  }
30
40
  .pisell-lowcode-navigation-menu-item-description {
31
41
  color: var(--Gray-500, #667085);
@@ -40,6 +50,10 @@
40
50
  .pisell-lowcode-navigation-menu-item-action-wrap {
41
51
  display: flex;
42
52
  gap: 8px;
53
+ transition: opacity 0.3s ease-in-out;
54
+ &.pisell-lowcode-navigation-menu-item-action-wrap-hover {
55
+ opacity: 0;
56
+ }
43
57
  .pisell-lowcode-navigation-menu-item-action-button {
44
58
  &:hover {
45
59
  background: var(--Gray-300, #D0D5DD);
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const MultiDay: ({ dataSource, hideDivider }: any) => JSX.Element;
3
+ export default MultiDay;
@@ -0,0 +1 @@
1
+ export declare const renderBundles: (item: any, hidePrice?: boolean, isShowPackageNote?: boolean) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Options: ({ options, amountSymbol }: any) => JSX.Element | null;
3
+ export default Options;