@ui5/webcomponents-base 2.14.0-rc.3 → 2.14.0-rc.5
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/CHANGELOG.md +19 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +3 -3
- package/dist/util/dragAndDrop/DragRegistry.d.ts +5 -10
- package/dist/util/dragAndDrop/DragRegistry.js +15 -73
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "2.14.0-rc.
|
|
2
|
+
version: "2.14.0-rc.5",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 14,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "-rc.
|
|
6
|
+
suffix: "-rc.5",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1756368580,
|
|
9
9
|
};
|
|
10
10
|
export default VersionInfo;
|
|
11
11
|
//# sourceMappingURL=VersionInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.14.0-rc.
|
|
1
|
+
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.14.0-rc.5\",\n\tmajor: 2,\n\tminor: 14,\n\tpatch: 0,\n\tsuffix: \"-rc.5\",\n\tisNext: false,\n\tbuildTime: 1756368580,\n};\nexport default VersionInfo;"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e={version:"2.14.0-rc.
|
|
1
|
+
"use strict";const e={version:"2.14.0-rc.5",major:2,minor:14,patch:0,suffix:"-rc.5",isNext:!1,buildTime:1756368580};export default e;
|
|
2
2
|
//# sourceMappingURL=VersionInfo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/generated/VersionInfo.ts"],
|
|
4
|
-
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.14.0-rc.
|
|
4
|
+
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.14.0-rc.5\",\n\tmajor: 2,\n\tminor: 14,\n\tpatch: 0,\n\tsuffix: \"-rc.5\",\n\tisNext: false,\n\tbuildTime: 1756368580,\n};\nexport default VersionInfo;"],
|
|
5
5
|
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,cACT,MAAO,EACP,MAAO,GACP,MAAO,EACP,OAAQ,QACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
|
|
6
6
|
"names": ["VersionInfo"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import
|
|
1
|
+
"use strict";import s from"../../generated/css/MultipleDragGhost.css.js";import{getI18nBundle as i}from"../../i18nBundle.js";import{DRAG_DROP_MULTIPLE_TEXT as c}from"../../generated/i18n/i18n-defaults.js";const l=2;let a=null;const g=e=>{a=e},d=()=>{a=null},p=()=>a,u=async e=>{const t=document.createElement("div"),n=await i("@ui5/webcomponents-base"),r=t.attachShadow({mode:"open"}),o=new CSSStyleSheet;return o.replaceSync(s),r.adoptedStyleSheets=[o],r.textContent=n.getText(c,e),t},m=async(e,t)=>{if(e<l){console.warn(`Cannot start multiple drag with count ${e}. Minimum is ${l}.`);return}if(!t.dataTransfer)return;const n=await u(e);document.body.appendChild(n),t.dataTransfer.setDragImage(n,0,0),requestAnimationFrame(()=>{n.remove()})},D={setDraggedElement:g,clearDraggedElement:d,getDraggedElement:p,startMultipleDrag:m};export default D;export{m as startMultipleDrag};
|
|
2
2
|
//# sourceMappingURL=DragRegistry.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/util/dragAndDrop/DragRegistry.ts"],
|
|
4
|
-
"sourcesContent": ["import type
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["MultipleDragGhostCss", "getI18nBundle", "DRAG_DROP_MULTIPLE_TEXT", "MIN_MULTI_DRAG_COUNT", "
|
|
4
|
+
"sourcesContent": ["import type MovePlacement from \"../../types/MovePlacement.js\";\nimport MultipleDragGhostCss from \"../../generated/css/MultipleDragGhost.css.js\";\n\nimport { getI18nBundle } from \"../../i18nBundle.js\";\n\nimport {\n\tDRAG_DROP_MULTIPLE_TEXT,\n} from \"../../generated/i18n/i18n-defaults.js\";\n\nconst MIN_MULTI_DRAG_COUNT = 2;\n\nlet draggedElement: HTMLElement | null = null;\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\n\nconst clearDraggedElement = () => {\n\tdraggedElement = null;\n};\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst createDefaultMultiDragElement = async (count: number): Promise<HTMLElement> => {\n\tconst dragElement = document.createElement(\"div\");\n\tconst i18nBundle = await getI18nBundle(\"@ui5/webcomponents-base\");\n\n\tconst dragElementShadow = dragElement.attachShadow({ mode: \"open\" });\n\n\tconst styles = new CSSStyleSheet();\n\tstyles.replaceSync(MultipleDragGhostCss);\n\n\tdragElementShadow.adoptedStyleSheets = [styles];\n\tdragElementShadow.textContent = i18nBundle.getText(DRAG_DROP_MULTIPLE_TEXT, count);\n\n\treturn dragElement;\n};\n\n/**\n * Starts a multiple drag operation by creating a drag ghost element.\n * The drag ghost will be displayed when dragging multiple items.\n *\n * @param {number} count - The number of items being dragged.\n * @param {DragEvent} e - The drag event that triggered the operation.\n * @public\n */\nconst startMultipleDrag = async (count: number, e: DragEvent) => {\n\tif (count < MIN_MULTI_DRAG_COUNT) {\n\t\tconsole.warn(`Cannot start multiple drag with count ${count}. Minimum is ${MIN_MULTI_DRAG_COUNT}.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tif (!e.dataTransfer) {\n\t\treturn;\n\t}\n\n\tconst customDragElement = await createDefaultMultiDragElement(count);\n\n\t// Add to document body temporarily\n\tdocument.body.appendChild(customDragElement);\n\n\te.dataTransfer.setDragImage(customDragElement, 0, 0);\n\n\t// Clean up the temporary element after the drag operation starts\n\trequestAnimationFrame(() => {\n\t\tcustomDragElement.remove();\n\t});\n};\n\ntype DragAndDropSettings = {\n\t/**\n\t * Allow cross-browser and file drag and drop.\n\t */\n\tcrossDnD?: boolean;\n\t/**\n\t * Pass the original event in the event parameters.\n\t */\n\toriginalEvent?: boolean;\n};\n\ntype MoveEventDetail = {\n\toriginalEvent: Event,\n\tsource: {\n\t\telement: HTMLElement,\n\t},\n\tdestination: {\n\t\telement: HTMLElement,\n\t\tplacement: `${MovePlacement}`,\n\t}\n};\n\nconst DragRegistry = {\n\tsetDraggedElement,\n\tclearDraggedElement,\n\tgetDraggedElement,\n\tstartMultipleDrag,\n};\n\nexport default DragRegistry;\nexport {\n\tstartMultipleDrag,\n};\n\nexport type {\n\tDragAndDropSettings,\n\tMoveEventDetail,\n};\n"],
|
|
5
|
+
"mappings": "aACA,OAAOA,MAA0B,+CAEjC,OAAS,iBAAAC,MAAqB,sBAE9B,OACC,2BAAAC,MACM,wCAEP,MAAMC,EAAuB,EAE7B,IAAIC,EAAqC,KAEzC,MAAMC,EAAqBC,GAAgC,CAC1DF,EAAiBE,CAClB,EAEMC,EAAsB,IAAM,CACjCH,EAAiB,IAClB,EAEMI,EAAoB,IAClBJ,EAGFK,EAAgC,MAAOC,GAAwC,CACpF,MAAMC,EAAc,SAAS,cAAc,KAAK,EAC1CC,EAAa,MAAMX,EAAc,yBAAyB,EAE1DY,EAAoBF,EAAY,aAAa,CAAE,KAAM,MAAO,CAAC,EAE7DG,EAAS,IAAI,cACnB,OAAAA,EAAO,YAAYd,CAAoB,EAEvCa,EAAkB,mBAAqB,CAACC,CAAM,EAC9CD,EAAkB,YAAcD,EAAW,QAAQV,EAAyBQ,CAAK,EAE1EC,CACR,EAUMI,EAAoB,MAAOL,EAAeM,IAAiB,CAChE,GAAIN,EAAQP,EAAsB,CACjC,QAAQ,KAAK,yCAAyCO,CAAK,gBAAgBP,CAAoB,GAAG,EAClG,MACD,CAEA,GAAI,CAACa,EAAE,aACN,OAGD,MAAMC,EAAoB,MAAMR,EAA8BC,CAAK,EAGnE,SAAS,KAAK,YAAYO,CAAiB,EAE3CD,EAAE,aAAa,aAAaC,EAAmB,EAAG,CAAC,EAGnD,sBAAsB,IAAM,CAC3BA,EAAkB,OAAO,CAC1B,CAAC,CACF,EAwBMC,EAAe,CACpB,kBAAAb,EACA,oBAAAE,EACA,kBAAAC,EACA,kBAAAO,CACD,EAEA,eAAeG,EACf,OACCH,KAAA",
|
|
6
|
+
"names": ["MultipleDragGhostCss", "getI18nBundle", "DRAG_DROP_MULTIPLE_TEXT", "MIN_MULTI_DRAG_COUNT", "draggedElement", "setDraggedElement", "element", "clearDraggedElement", "getDraggedElement", "createDefaultMultiDragElement", "count", "dragElement", "i18nBundle", "dragElementShadow", "styles", "startMultipleDrag", "e", "customDragElement", "DragRegistry"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type UI5Element from "../../UI5Element.js";
|
|
2
1
|
import type MovePlacement from "../../types/MovePlacement.js";
|
|
3
|
-
declare const setDraggedElement: (element: HTMLElement | null) => void;
|
|
4
|
-
type SetDraggedElementFunction = typeof setDraggedElement;
|
|
5
2
|
/**
|
|
6
3
|
* Starts a multiple drag operation by creating a drag ghost element.
|
|
7
4
|
* The drag ghost will be displayed when dragging multiple items.
|
|
@@ -10,7 +7,7 @@ type SetDraggedElementFunction = typeof setDraggedElement;
|
|
|
10
7
|
* @param {DragEvent} e - The drag event that triggered the operation.
|
|
11
8
|
* @public
|
|
12
9
|
*/
|
|
13
|
-
declare const startMultipleDrag: (count: number, e: DragEvent) => void
|
|
10
|
+
declare const startMultipleDrag: (count: number, e: DragEvent) => Promise<void>;
|
|
14
11
|
type DragAndDropSettings = {
|
|
15
12
|
/**
|
|
16
13
|
* Allow cross-browser and file drag and drop.
|
|
@@ -32,13 +29,11 @@ type MoveEventDetail = {
|
|
|
32
29
|
};
|
|
33
30
|
};
|
|
34
31
|
declare const DragRegistry: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
addSelfManagedArea: (area: HTMLElement | ShadowRoot) => (element: HTMLElement | null) => void;
|
|
38
|
-
removeSelfManagedArea: (area: HTMLElement | ShadowRoot) => void;
|
|
32
|
+
setDraggedElement: (element: HTMLElement | null) => void;
|
|
33
|
+
clearDraggedElement: () => void;
|
|
39
34
|
getDraggedElement: () => HTMLElement | null;
|
|
40
|
-
startMultipleDrag: (count: number, e: DragEvent) => void
|
|
35
|
+
startMultipleDrag: (count: number, e: DragEvent) => Promise<void>;
|
|
41
36
|
};
|
|
42
37
|
export default DragRegistry;
|
|
43
38
|
export { startMultipleDrag, };
|
|
44
|
-
export type {
|
|
39
|
+
export type { DragAndDropSettings, MoveEventDetail, };
|
|
@@ -2,44 +2,13 @@ import MultipleDragGhostCss from "../../generated/css/MultipleDragGhost.css.js";
|
|
|
2
2
|
import { getI18nBundle } from "../../i18nBundle.js";
|
|
3
3
|
import { DRAG_DROP_MULTIPLE_TEXT, } from "../../generated/i18n/i18n-defaults.js";
|
|
4
4
|
const MIN_MULTI_DRAG_COUNT = 2;
|
|
5
|
-
let customDragElementPromise = null;
|
|
6
5
|
let draggedElement = null;
|
|
7
|
-
let globalHandlersAttached = false;
|
|
8
|
-
const subscribers = new Set();
|
|
9
|
-
const selfManagedDragAreas = new Set();
|
|
10
|
-
const ondragstart = (e) => {
|
|
11
|
-
if (!e.dataTransfer || !(e.target instanceof HTMLElement)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
if (!selfManagedDragAreas.has(e.target)) {
|
|
15
|
-
draggedElement = e.target;
|
|
16
|
-
}
|
|
17
|
-
handleMultipleDrag(e);
|
|
18
|
-
};
|
|
19
|
-
const handleMultipleDrag = async (e) => {
|
|
20
|
-
if (!customDragElementPromise || !e.dataTransfer) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const dragElement = await customDragElementPromise;
|
|
24
|
-
// Add to document body temporarily
|
|
25
|
-
document.body.appendChild(dragElement);
|
|
26
|
-
e.dataTransfer.setDragImage(dragElement, 0, 0);
|
|
27
|
-
// Clean up the temporary element after the drag operation starts
|
|
28
|
-
requestAnimationFrame(() => {
|
|
29
|
-
dragElement.remove();
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
const ondragend = () => {
|
|
33
|
-
draggedElement = null;
|
|
34
|
-
customDragElementPromise = null;
|
|
35
|
-
};
|
|
36
|
-
const ondrop = () => {
|
|
37
|
-
draggedElement = null;
|
|
38
|
-
customDragElementPromise = null;
|
|
39
|
-
};
|
|
40
6
|
const setDraggedElement = (element) => {
|
|
41
7
|
draggedElement = element;
|
|
42
8
|
};
|
|
9
|
+
const clearDraggedElement = () => {
|
|
10
|
+
draggedElement = null;
|
|
11
|
+
};
|
|
43
12
|
const getDraggedElement = () => {
|
|
44
13
|
return draggedElement;
|
|
45
14
|
};
|
|
@@ -61,53 +30,26 @@ const createDefaultMultiDragElement = async (count) => {
|
|
|
61
30
|
* @param {DragEvent} e - The drag event that triggered the operation.
|
|
62
31
|
* @public
|
|
63
32
|
*/
|
|
64
|
-
|
|
65
|
-
const startMultipleDrag = (count, e) => {
|
|
33
|
+
const startMultipleDrag = async (count, e) => {
|
|
66
34
|
if (count < MIN_MULTI_DRAG_COUNT) {
|
|
67
35
|
console.warn(`Cannot start multiple drag with count ${count}. Minimum is ${MIN_MULTI_DRAG_COUNT}.`); // eslint-disable-line
|
|
68
36
|
return;
|
|
69
37
|
}
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
const attachGlobalHandlers = () => {
|
|
73
|
-
if (globalHandlersAttached) {
|
|
38
|
+
if (!e.dataTransfer) {
|
|
74
39
|
return;
|
|
75
40
|
}
|
|
76
|
-
|
|
77
|
-
document
|
|
78
|
-
document.body.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
document.body.removeEventListener("drop", ondrop);
|
|
85
|
-
globalHandlersAttached = false;
|
|
86
|
-
};
|
|
87
|
-
const subscribe = (subscriber) => {
|
|
88
|
-
subscribers.add(subscriber);
|
|
89
|
-
if (!globalHandlersAttached) {
|
|
90
|
-
attachGlobalHandlers();
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const unsubscribe = (subscriber) => {
|
|
94
|
-
subscribers.delete(subscriber);
|
|
95
|
-
if (subscribers.size === 0 && globalHandlersAttached) {
|
|
96
|
-
detachGlobalHandlers();
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const addSelfManagedArea = (area) => {
|
|
100
|
-
selfManagedDragAreas.add(area);
|
|
101
|
-
return setDraggedElement;
|
|
102
|
-
};
|
|
103
|
-
const removeSelfManagedArea = (area) => {
|
|
104
|
-
selfManagedDragAreas.delete(area);
|
|
41
|
+
const customDragElement = await createDefaultMultiDragElement(count);
|
|
42
|
+
// Add to document body temporarily
|
|
43
|
+
document.body.appendChild(customDragElement);
|
|
44
|
+
e.dataTransfer.setDragImage(customDragElement, 0, 0);
|
|
45
|
+
// Clean up the temporary element after the drag operation starts
|
|
46
|
+
requestAnimationFrame(() => {
|
|
47
|
+
customDragElement.remove();
|
|
48
|
+
});
|
|
105
49
|
};
|
|
106
50
|
const DragRegistry = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
addSelfManagedArea,
|
|
110
|
-
removeSelfManagedArea,
|
|
51
|
+
setDraggedElement,
|
|
52
|
+
clearDraggedElement,
|
|
111
53
|
getDraggedElement,
|
|
112
54
|
startMultipleDrag,
|
|
113
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,MAAM,8CAA8C,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EACN,uBAAuB,GACvB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,IAAI,cAAc,GAAuB,IAAI,CAAC;AAE9C,MAAM,iBAAiB,GAAG,CAAC,OAA2B,EAAE,EAAE;IACzD,cAAc,GAAG,OAAO,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAChC,cAAc,GAAG,IAAI,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,KAAK,EAAE,KAAa,EAAwB,EAAE;IACnF,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAElE,MAAM,iBAAiB,GAAG,WAAW,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;IACnC,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAEzC,iBAAiB,CAAC,kBAAkB,GAAG,CAAC,MAAM,CAAC,CAAC;IAChD,iBAAiB,CAAC,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;IAEnF,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAAa,EAAE,CAAY,EAAE,EAAE;IAC/D,IAAI,KAAK,GAAG,oBAAoB,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,yCAAyC,KAAK,gBAAgB,oBAAoB,GAAG,CAAC,CAAC,CAAC,sBAAsB;QAC3H,OAAO;IACR,CAAC;IAED,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QACrB,OAAO;IACR,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAErE,mCAAmC;IACnC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAE7C,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAErD,iEAAiE;IACjE,qBAAqB,CAAC,GAAG,EAAE;QAC1B,iBAAiB,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAwBF,MAAM,YAAY,GAAG;IACpB,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;CACjB,CAAC;AAEF,eAAe,YAAY,CAAC;AAC5B,OAAO,EACN,iBAAiB,GACjB,CAAC","sourcesContent":["import type MovePlacement from \"../../types/MovePlacement.js\";\nimport MultipleDragGhostCss from \"../../generated/css/MultipleDragGhost.css.js\";\n\nimport { getI18nBundle } from \"../../i18nBundle.js\";\n\nimport {\n\tDRAG_DROP_MULTIPLE_TEXT,\n} from \"../../generated/i18n/i18n-defaults.js\";\n\nconst MIN_MULTI_DRAG_COUNT = 2;\n\nlet draggedElement: HTMLElement | null = null;\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\n\nconst clearDraggedElement = () => {\n\tdraggedElement = null;\n};\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst createDefaultMultiDragElement = async (count: number): Promise<HTMLElement> => {\n\tconst dragElement = document.createElement(\"div\");\n\tconst i18nBundle = await getI18nBundle(\"@ui5/webcomponents-base\");\n\n\tconst dragElementShadow = dragElement.attachShadow({ mode: \"open\" });\n\n\tconst styles = new CSSStyleSheet();\n\tstyles.replaceSync(MultipleDragGhostCss);\n\n\tdragElementShadow.adoptedStyleSheets = [styles];\n\tdragElementShadow.textContent = i18nBundle.getText(DRAG_DROP_MULTIPLE_TEXT, count);\n\n\treturn dragElement;\n};\n\n/**\n * Starts a multiple drag operation by creating a drag ghost element.\n * The drag ghost will be displayed when dragging multiple items.\n *\n * @param {number} count - The number of items being dragged.\n * @param {DragEvent} e - The drag event that triggered the operation.\n * @public\n */\nconst startMultipleDrag = async (count: number, e: DragEvent) => {\n\tif (count < MIN_MULTI_DRAG_COUNT) {\n\t\tconsole.warn(`Cannot start multiple drag with count ${count}. Minimum is ${MIN_MULTI_DRAG_COUNT}.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tif (!e.dataTransfer) {\n\t\treturn;\n\t}\n\n\tconst customDragElement = await createDefaultMultiDragElement(count);\n\n\t// Add to document body temporarily\n\tdocument.body.appendChild(customDragElement);\n\n\te.dataTransfer.setDragImage(customDragElement, 0, 0);\n\n\t// Clean up the temporary element after the drag operation starts\n\trequestAnimationFrame(() => {\n\t\tcustomDragElement.remove();\n\t});\n};\n\ntype DragAndDropSettings = {\n\t/**\n\t * Allow cross-browser and file drag and drop.\n\t */\n\tcrossDnD?: boolean;\n\t/**\n\t * Pass the original event in the event parameters.\n\t */\n\toriginalEvent?: boolean;\n};\n\ntype MoveEventDetail = {\n\toriginalEvent: Event,\n\tsource: {\n\t\telement: HTMLElement,\n\t},\n\tdestination: {\n\t\telement: HTMLElement,\n\t\tplacement: `${MovePlacement}`,\n\t}\n};\n\nconst DragRegistry = {\n\tsetDraggedElement,\n\tclearDraggedElement,\n\tgetDraggedElement,\n\tstartMultipleDrag,\n};\n\nexport default DragRegistry;\nexport {\n\tstartMultipleDrag,\n};\n\nexport type {\n\tDragAndDropSettings,\n\tMoveEventDetail,\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "2.14.0-rc.
|
|
3
|
+
"version": "2.14.0-rc.5",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@openui5/sap.ui.core": "1.120.17",
|
|
64
64
|
"@sap-theming/theming-base-content": "11.29.3",
|
|
65
65
|
"@ui5/cypress-internal": "0.0.0",
|
|
66
|
-
"@ui5/webcomponents-tools": "2.14.0-rc.
|
|
66
|
+
"@ui5/webcomponents-tools": "2.14.0-rc.5",
|
|
67
67
|
"chromedriver": "^138.0.5",
|
|
68
68
|
"clean-css": "^5.2.2",
|
|
69
69
|
"copy-and-watch": "^0.1.5",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"resolve": "^1.20.0",
|
|
75
75
|
"touch": "^3.1.0"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "e08117399dafdca92042b9b0f79dc231ce0d78ad"
|
|
78
78
|
}
|