@pisell/materials 1.0.606 → 1.0.607

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 (107) 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 +1 -1
  6. package/build/lowcode/preview.js +154 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +37 -23
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +38 -24
  11. package/es/components/Pagination/index.d.ts +1 -1
  12. package/es/components/appVersionControl/index.less +3 -0
  13. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
  14. package/es/components/dataSourceComponents/fields/index.d.ts +1 -1
  15. package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +3 -0
  16. package/es/components/pisellDraggable/components/Action/Action.d.ts +10 -0
  17. package/es/components/pisellDraggable/components/Action/Action.js +31 -0
  18. package/es/components/pisellDraggable/components/Action/Action.less +50 -0
  19. package/es/components/pisellDraggable/components/Action/index.d.ts +2 -0
  20. package/es/components/pisellDraggable/components/Action/index.js +1 -0
  21. package/es/components/pisellDraggable/components/Handle/Handle.d.ts +3 -0
  22. package/es/components/pisellDraggable/components/Handle/Handle.js +15 -0
  23. package/es/components/pisellDraggable/components/Handle/index.d.ts +1 -0
  24. package/es/components/pisellDraggable/components/Handle/index.js +1 -0
  25. package/es/components/pisellDraggable/components/Remove/Remove.d.ts +3 -0
  26. package/es/components/pisellDraggable/components/Remove/Remove.js +17 -0
  27. package/es/components/pisellDraggable/components/Remove/index.d.ts +1 -0
  28. package/es/components/pisellDraggable/components/Remove/index.js +1 -0
  29. package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +8 -0
  30. package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.js +51 -0
  31. package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +21 -0
  32. package/es/components/pisellDraggable/components/TreeItem/TreeItem.js +57 -0
  33. package/es/components/pisellDraggable/components/TreeItem/TreeItem.less +128 -0
  34. package/es/components/pisellDraggable/components/TreeItem/index.d.ts +2 -0
  35. package/es/components/pisellDraggable/components/TreeItem/index.js +2 -0
  36. package/es/components/pisellDraggable/components/index.d.ts +4 -0
  37. package/es/components/pisellDraggable/components/index.js +4 -0
  38. package/es/components/pisellDraggable/index.d.ts +27 -3
  39. package/es/components/pisellDraggable/index.js +380 -2
  40. package/es/components/pisellDraggable/types.d.ts +15 -99
  41. package/es/components/pisellDraggable/utilities.d.ts +17 -0
  42. package/es/components/pisellDraggable/utilities.js +230 -0
  43. package/es/components/pisellModal/components/Information/index.js +0 -1
  44. package/es/components/table/Table/utils.d.ts +1 -1
  45. package/es/components/versionModal/index.js +3 -1
  46. package/es/components/versionModal/index.less +9 -2
  47. package/es/locales/en-US.d.ts +6 -6
  48. package/es/locales/en-US.js +16 -22
  49. package/es/locales/zh-CN.d.ts +6 -6
  50. package/es/locales/zh-CN.js +15 -21
  51. package/es/locales/zh-TW.d.ts +6 -6
  52. package/es/locales/zh-TW.js +17 -23
  53. package/lib/components/Pagination/index.d.ts +1 -1
  54. package/lib/components/appVersionControl/index.less +3 -0
  55. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
  56. package/lib/components/dataSourceComponents/fields/index.d.ts +1 -1
  57. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +3 -0
  58. package/lib/components/pisellDraggable/components/Action/Action.d.ts +10 -0
  59. package/lib/components/pisellDraggable/components/Action/Action.js +60 -0
  60. package/lib/components/pisellDraggable/components/Action/Action.less +50 -0
  61. package/lib/components/pisellDraggable/components/Action/index.d.ts +2 -0
  62. package/lib/components/pisellDraggable/components/Action/index.js +29 -0
  63. package/lib/components/pisellDraggable/components/Handle/Handle.d.ts +3 -0
  64. package/lib/components/pisellDraggable/components/Handle/Handle.js +54 -0
  65. package/lib/components/pisellDraggable/components/Handle/index.d.ts +1 -0
  66. package/lib/components/pisellDraggable/components/Handle/index.js +29 -0
  67. package/lib/components/pisellDraggable/components/Remove/Remove.d.ts +3 -0
  68. package/lib/components/pisellDraggable/components/Remove/Remove.js +53 -0
  69. package/lib/components/pisellDraggable/components/Remove/index.d.ts +1 -0
  70. package/lib/components/pisellDraggable/components/Remove/index.js +29 -0
  71. package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +8 -0
  72. package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.js +83 -0
  73. package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +21 -0
  74. package/lib/components/pisellDraggable/components/TreeItem/TreeItem.js +93 -0
  75. package/lib/components/pisellDraggable/components/TreeItem/TreeItem.less +128 -0
  76. package/lib/components/pisellDraggable/components/TreeItem/index.d.ts +2 -0
  77. package/lib/components/pisellDraggable/components/TreeItem/index.js +32 -0
  78. package/lib/components/pisellDraggable/components/index.d.ts +4 -0
  79. package/lib/components/pisellDraggable/components/index.js +40 -0
  80. package/lib/components/pisellDraggable/index.d.ts +27 -3
  81. package/lib/components/pisellDraggable/index.js +237 -2
  82. package/lib/components/pisellDraggable/types.d.ts +15 -99
  83. package/lib/components/pisellDraggable/utilities.d.ts +17 -0
  84. package/lib/components/pisellDraggable/utilities.js +190 -0
  85. package/lib/components/pisellModal/components/Information/index.js +0 -1
  86. package/lib/components/table/Table/utils.d.ts +1 -1
  87. package/lib/components/versionModal/index.js +1 -1
  88. package/lib/components/versionModal/index.less +9 -2
  89. package/lib/locales/en-US.d.ts +6 -6
  90. package/lib/locales/en-US.js +8 -0
  91. package/lib/locales/zh-CN.d.ts +6 -6
  92. package/lib/locales/zh-CN.js +7 -0
  93. package/lib/locales/zh-TW.d.ts +6 -6
  94. package/lib/locales/zh-TW.js +7 -0
  95. package/lowcode/custom-select/meta.ts +11 -15
  96. package/lowcode/form-item-translation/meta.ts +59 -1
  97. package/package.json +2 -2
  98. package/es/components/pisellDraggable/PisellDraggable.d.ts +0 -18
  99. package/es/components/pisellDraggable/PisellDraggable.js +0 -190
  100. package/es/components/pisellDraggable/PisellDraggable.less +0 -154
  101. package/es/components/pisellDraggable/SortableItem.d.ts +0 -41
  102. package/es/components/pisellDraggable/SortableItem.js +0 -115
  103. package/lib/components/pisellDraggable/PisellDraggable.d.ts +0 -18
  104. package/lib/components/pisellDraggable/PisellDraggable.js +0 -175
  105. package/lib/components/pisellDraggable/PisellDraggable.less +0 -154
  106. package/lib/components/pisellDraggable/SortableItem.d.ts +0 -41
  107. package/lib/components/pisellDraggable/SortableItem.js +0 -127
@@ -0,0 +1,60 @@
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/pisellDraggable/components/Action/Action.tsx
30
+ var Action_exports = {};
31
+ __export(Action_exports, {
32
+ Action: () => Action
33
+ });
34
+ module.exports = __toCommonJS(Action_exports);
35
+ var import_classnames = __toESM(require("classnames"));
36
+ var import_react = __toESM(require("react"));
37
+ var import_Action = require("./Action.less");
38
+ var Action = (0, import_react.forwardRef)(
39
+ ({ active, className, cursor, style, ...props }, ref) => {
40
+ return /* @__PURE__ */ import_react.default.createElement(
41
+ "button",
42
+ {
43
+ ref,
44
+ ...props,
45
+ className: (0, import_classnames.default)("Action", className),
46
+ tabIndex: 0,
47
+ style: {
48
+ ...style,
49
+ cursor,
50
+ "--fill": active == null ? void 0 : active.fill,
51
+ "--background": active == null ? void 0 : active.background
52
+ }
53
+ }
54
+ );
55
+ }
56
+ );
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ Action
60
+ });
@@ -0,0 +1,50 @@
1
+ @focused-outline-color: #4c9ffe;
2
+
3
+ .Action {
4
+ display: flex;
5
+ width: 12px;
6
+ padding: 15px;
7
+ align-items: center;
8
+ justify-content: center;
9
+ flex: 0 0 auto;
10
+ touch-action: none;
11
+ cursor: var(--cursor, pointer);
12
+ border-radius: 5px;
13
+ border: none;
14
+ outline: none;
15
+ appearance: none;
16
+ background-color: transparent;
17
+ -webkit-tap-highlight-color: transparent;
18
+
19
+ @media (hover: hover) {
20
+ &:hover {
21
+ background-color: var(--action-background, rgba(0, 0, 0, 0.05));
22
+
23
+ svg {
24
+ fill: #6f7b88;
25
+ }
26
+ }
27
+ }
28
+
29
+ svg {
30
+ flex: 0 0 auto;
31
+ margin: auto;
32
+ height: 100%;
33
+ overflow: visible;
34
+ fill: #919eab;
35
+ }
36
+
37
+ &:active {
38
+ background-color: var(--background, rgba(0, 0, 0, 0.05));
39
+
40
+ svg {
41
+ fill: var(--fill, #788491);
42
+ }
43
+ }
44
+
45
+ &:focus-visible {
46
+ outline: none;
47
+ box-shadow: 0 0 0 2px rgba(255, 255, 255, 0),
48
+ 0 0px 0px 2px @focused-outline-color;
49
+ }
50
+ }
@@ -0,0 +1,2 @@
1
+ export { Action } from './Action';
2
+ export type { Props as ActionProps } from './Action';
@@ -0,0 +1,29 @@
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/components/Action/index.ts
20
+ var Action_exports = {};
21
+ __export(Action_exports, {
22
+ Action: () => import_Action.Action
23
+ });
24
+ module.exports = __toCommonJS(Action_exports);
25
+ var import_Action = require("./Action");
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ Action
29
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ActionProps } from '../Action';
3
+ export declare const Handle: React.ForwardRefExoticComponent<ActionProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,54 @@
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/pisellDraggable/components/Handle/Handle.tsx
30
+ var Handle_exports = {};
31
+ __export(Handle_exports, {
32
+ Handle: () => Handle
33
+ });
34
+ module.exports = __toCommonJS(Handle_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_Action = require("../Action");
37
+ var Handle = (0, import_react.forwardRef)(
38
+ (props, ref) => {
39
+ return /* @__PURE__ */ import_react.default.createElement(
40
+ import_Action.Action,
41
+ {
42
+ ref,
43
+ cursor: "grab",
44
+ "data-cypress": "draggable-handle",
45
+ ...props
46
+ },
47
+ /* @__PURE__ */ import_react.default.createElement("svg", { viewBox: "0 0 20 20", width: "12" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }))
48
+ );
49
+ }
50
+ );
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ Handle
54
+ });
@@ -0,0 +1 @@
1
+ export { Handle } from './Handle';
@@ -0,0 +1,29 @@
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/components/Handle/index.ts
20
+ var Handle_exports = {};
21
+ __export(Handle_exports, {
22
+ Handle: () => import_Handle.Handle
23
+ });
24
+ module.exports = __toCommonJS(Handle_exports);
25
+ var import_Handle = require("./Handle");
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ Handle
29
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ActionProps } from '../Action';
3
+ export declare function Remove(props: ActionProps): React.JSX.Element;
@@ -0,0 +1,53 @@
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/pisellDraggable/components/Remove/Remove.tsx
30
+ var Remove_exports = {};
31
+ __export(Remove_exports, {
32
+ Remove: () => Remove
33
+ });
34
+ module.exports = __toCommonJS(Remove_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_Action = require("../Action");
37
+ function Remove(props) {
38
+ return /* @__PURE__ */ import_react.default.createElement(
39
+ import_Action.Action,
40
+ {
41
+ ...props,
42
+ active: {
43
+ fill: "rgba(255, 70, 70, 0.95)",
44
+ background: "rgba(255, 70, 70, 0.1)"
45
+ }
46
+ },
47
+ /* @__PURE__ */ import_react.default.createElement("svg", { width: "8", viewBox: "0 0 22 22", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M2.99998 -0.000206962C2.7441 -0.000206962 2.48794 0.0972617 2.29294 0.292762L0.292945 2.29276C-0.0980552 2.68376 -0.0980552 3.31682 0.292945 3.70682L7.58591 10.9998L0.292945 18.2928C-0.0980552 18.6838 -0.0980552 19.3168 0.292945 19.7068L2.29294 21.7068C2.68394 22.0978 3.31701 22.0978 3.70701 21.7068L11 14.4139L18.2929 21.7068C18.6829 22.0978 19.317 22.0978 19.707 21.7068L21.707 19.7068C22.098 19.3158 22.098 18.6828 21.707 18.2928L14.414 10.9998L21.707 3.70682C22.098 3.31682 22.098 2.68276 21.707 2.29276L19.707 0.292762C19.316 -0.0982383 18.6829 -0.0982383 18.2929 0.292762L11 7.58573L3.70701 0.292762C3.51151 0.0972617 3.25585 -0.000206962 2.99998 -0.000206962Z" }))
48
+ );
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ Remove
53
+ });
@@ -0,0 +1 @@
1
+ export { Remove } from './Remove';
@@ -0,0 +1,29 @@
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/components/Remove/index.ts
20
+ var Remove_exports = {};
21
+ __export(Remove_exports, {
22
+ Remove: () => import_Remove.Remove
23
+ });
24
+ module.exports = __toCommonJS(Remove_exports);
25
+ var import_Remove = require("./Remove");
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ Remove
29
+ });
@@ -0,0 +1,8 @@
1
+ import type { UniqueIdentifier } from '@dnd-kit/core';
2
+ import React from 'react';
3
+ import { Props as TreeItemProps } from './TreeItem';
4
+ interface Props extends TreeItemProps {
5
+ id: UniqueIdentifier;
6
+ }
7
+ export declare function SortableTreeItem({ id, depth, ...props }: Props): React.JSX.Element;
8
+ export {};
@@ -0,0 +1,83 @@
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/pisellDraggable/components/TreeItem/SortableTreeItem.tsx
30
+ var SortableTreeItem_exports = {};
31
+ __export(SortableTreeItem_exports, {
32
+ SortableTreeItem: () => SortableTreeItem
33
+ });
34
+ module.exports = __toCommonJS(SortableTreeItem_exports);
35
+ var import_sortable = require("@dnd-kit/sortable");
36
+ var import_utilities = require("@dnd-kit/utilities");
37
+ var import_react = __toESM(require("react"));
38
+ var import_utilities2 = require("../../utilities");
39
+ var import_TreeItem = require("./TreeItem");
40
+ var animateLayoutChanges = ({
41
+ isSorting,
42
+ wasDragging
43
+ }) => isSorting || wasDragging ? false : true;
44
+ function SortableTreeItem({ id, depth, ...props }) {
45
+ const {
46
+ attributes,
47
+ isDragging,
48
+ isSorting,
49
+ listeners,
50
+ setDraggableNodeRef,
51
+ setDroppableNodeRef,
52
+ transform,
53
+ transition
54
+ } = (0, import_sortable.useSortable)({
55
+ id,
56
+ animateLayoutChanges
57
+ });
58
+ const style = {
59
+ transform: import_utilities.CSS.Translate.toString(transform),
60
+ transition
61
+ };
62
+ return /* @__PURE__ */ import_react.default.createElement(
63
+ import_TreeItem.TreeItem,
64
+ {
65
+ ref: setDraggableNodeRef,
66
+ wrapperRef: setDroppableNodeRef,
67
+ style,
68
+ depth,
69
+ ghost: isDragging,
70
+ disableSelection: import_utilities2.iOS,
71
+ disableInteraction: isSorting,
72
+ handleProps: {
73
+ ...attributes,
74
+ ...listeners
75
+ },
76
+ ...props
77
+ }
78
+ );
79
+ }
80
+ // Annotate the CommonJS export names for ESM import in node:
81
+ 0 && (module.exports = {
82
+ SortableTreeItem
83
+ });
@@ -0,0 +1,21 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import type { TreeItem as TreeItemType } from '../../types';
3
+ import './TreeItem.less';
4
+ export interface Props extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
5
+ childCount?: number;
6
+ clone?: boolean;
7
+ collapsed?: boolean;
8
+ depth: number;
9
+ disableInteraction?: boolean;
10
+ disableSelection?: boolean;
11
+ ghost?: boolean;
12
+ handleProps?: any;
13
+ indicator?: boolean;
14
+ indentationWidth: number;
15
+ onCollapse?(): void;
16
+ onRemove?(): void;
17
+ wrapperRef?(node: HTMLLIElement): void;
18
+ item: TreeItemType;
19
+ renderItem?(item: TreeItemType): React.ReactNode;
20
+ }
21
+ export declare const TreeItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,93 @@
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/pisellDraggable/components/TreeItem/TreeItem.tsx
30
+ var TreeItem_exports = {};
31
+ __export(TreeItem_exports, {
32
+ TreeItem: () => TreeItem
33
+ });
34
+ module.exports = __toCommonJS(TreeItem_exports);
35
+ var import_classnames = __toESM(require("classnames"));
36
+ var import_react = __toESM(require("react"));
37
+ var import_components = require("../../components");
38
+ var import_TreeItem = require("./TreeItem.less");
39
+ var TreeItem = (0, import_react.forwardRef)((props, ref) => {
40
+ const {
41
+ childCount,
42
+ clone,
43
+ depth,
44
+ disableSelection,
45
+ disableInteraction,
46
+ ghost,
47
+ handleProps,
48
+ indentationWidth,
49
+ indicator,
50
+ collapsed,
51
+ onCollapse,
52
+ onRemove,
53
+ style,
54
+ wrapperRef,
55
+ item,
56
+ renderItem,
57
+ ...otherProps
58
+ } = props;
59
+ if (renderItem) {
60
+ return renderItem(props);
61
+ }
62
+ return /* @__PURE__ */ import_react.default.createElement(
63
+ "li",
64
+ {
65
+ className: (0, import_classnames.default)(
66
+ "Wrapper",
67
+ clone && "clone",
68
+ ghost && "ghost",
69
+ indicator && "indicator",
70
+ disableSelection && "disableSelection",
71
+ disableInteraction && "disableInteraction"
72
+ ),
73
+ ref: wrapperRef,
74
+ style: {
75
+ "--spacing": `${indentationWidth * depth}px`
76
+ },
77
+ ...otherProps
78
+ },
79
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "TreeItem", ref, style }, /* @__PURE__ */ import_react.default.createElement(import_components.Handle, { ...handleProps }), onCollapse && /* @__PURE__ */ import_react.default.createElement(
80
+ import_components.Action,
81
+ {
82
+ onClick: onCollapse,
83
+ className: (0, import_classnames.default)("Collapse", collapsed && "collapsed")
84
+ },
85
+ collapseIcon
86
+ ), /* @__PURE__ */ import_react.default.createElement("span", { className: "Text" }, item.id), !clone && onRemove && /* @__PURE__ */ import_react.default.createElement(import_components.Remove, { onClick: onRemove }), clone && childCount && childCount > 1 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "Count" }, childCount) : null)
87
+ );
88
+ });
89
+ var collapseIcon = /* @__PURE__ */ import_react.default.createElement("svg", { width: "10", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 70 41" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z" }));
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ TreeItem
93
+ });
@@ -0,0 +1,128 @@
1
+ .Wrapper {
2
+ list-style: none;
3
+ box-sizing: border-box;
4
+ padding-left: var(--spacing);
5
+ margin-bottom: -1px;
6
+
7
+ &.clone {
8
+ display: inline-block;
9
+ pointer-events: none;
10
+ padding: 0;
11
+ padding-left: 10px;
12
+ padding-top: 5px;
13
+
14
+ .TreeItem {
15
+ --vertical-padding: 5px;
16
+
17
+ padding-right: 24px;
18
+ border-radius: 4px;
19
+ box-shadow: 0px 15px 15px 0 rgba(34, 33, 81, 0.1);
20
+ }
21
+ }
22
+
23
+ &.ghost {
24
+ &.indicator {
25
+ opacity: 1;
26
+ position: relative;
27
+ z-index: 1;
28
+ margin-bottom: -1px;
29
+
30
+ .TreeItem {
31
+ position: relative;
32
+ padding: 0;
33
+ height: 8px;
34
+ border-color: #2389ff;
35
+ background-color: #56a1f8;
36
+
37
+ &:before {
38
+ position: absolute;
39
+ left: -8px;
40
+ top: -4px;
41
+ display: block;
42
+ content: '';
43
+ width: 12px;
44
+ height: 12px;
45
+ border-radius: 50%;
46
+ border: 1px solid #2389ff;
47
+ background-color: #ffffff;
48
+ }
49
+
50
+ >* {
51
+ /* Items are hidden using height and opacity to retain focus */
52
+ opacity: 0;
53
+ height: 0;
54
+ }
55
+ }
56
+ }
57
+
58
+ &:not(.indicator) {
59
+ opacity: 0.5;
60
+ }
61
+
62
+ .TreeItem>* {
63
+ box-shadow: none;
64
+ background-color: transparent;
65
+ }
66
+ }
67
+ }
68
+
69
+ .TreeItem {
70
+ --vertical-padding: 10px;
71
+
72
+ position: relative;
73
+ display: flex;
74
+ align-items: center;
75
+ padding: var(--vertical-padding) 10px;
76
+ background-color: #fff;
77
+ border: 1px solid #dedede;
78
+ color: #222;
79
+ box-sizing: border-box;
80
+ }
81
+
82
+ .Text {
83
+ flex-grow: 1;
84
+ padding-left: 0.5rem;
85
+ white-space: nowrap;
86
+ text-overflow: ellipsis;
87
+ overflow: hidden;
88
+ }
89
+
90
+ .Count {
91
+ position: absolute;
92
+ top: -10px;
93
+ right: -10px;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ width: 24px;
98
+ height: 24px;
99
+ border-radius: 50%;
100
+ background-color: #2389ff;
101
+ font-size: 0.8rem;
102
+ font-weight: 600;
103
+ color: #fff;
104
+ }
105
+
106
+ .disableInteraction {
107
+ pointer-events: none;
108
+ }
109
+
110
+ .disableSelection,
111
+ .clone {
112
+
113
+ .Text,
114
+ .Count {
115
+ user-select: none;
116
+ -webkit-user-select: none;
117
+ }
118
+ }
119
+
120
+ .Collapse {
121
+ svg {
122
+ transition: transform 250ms ease;
123
+ }
124
+
125
+ &.collapsed svg {
126
+ transform: rotate(-90deg);
127
+ }
128
+ }
@@ -0,0 +1,2 @@
1
+ export { TreeItem } from './TreeItem';
2
+ export { SortableTreeItem } from './SortableTreeItem';