@ui5/webcomponents-base 2.13.0-rc.3 → 2.13.0
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 +8 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +21 -1
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -1
- package/dist/generated/json-imports/i18n-node.js +21 -1
- package/dist/generated/json-imports/i18n-node.js.map +1 -1
- package/dist/generated/json-imports/i18n.js +21 -1
- package/dist/generated/json-imports/i18n.js.map +1 -1
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/generated/json-imports/i18n-fetch.js +1 -1
- package/dist/prod/generated/json-imports/i18n-fetch.js.map +4 -4
- package/dist/prod/generated/json-imports/i18n-node.js +1 -1
- package/dist/prod/generated/json-imports/i18n-node.js.map +4 -4
- package/dist/prod/generated/json-imports/i18n.js +1 -1
- package/dist/prod/generated/json-imports/i18n.js.map +4 -4
- 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 +3 -2
- package/dist/util/dragAndDrop/DragRegistry.js +3 -1
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/package.json +3 -3
- package/src/i18n/messagebundle_en.properties +5 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "2.13.0
|
|
2
|
+
version: "2.13.0",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 13,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "
|
|
6
|
+
suffix: "",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1754315594,
|
|
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,
|
|
1
|
+
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.13.0\",\n\tmajor: 2,\n\tminor: 13,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1754315594,\n};\nexport default VersionInfo;"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"DRAG_DROP_MULTIPLE_TEXT":"{0} items"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"DRAG_DROP_MULTIPLE_TEXT":"{0} items"}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
|
|
3
|
+
const importMessageBundle = async (localeId) => {
|
|
4
|
+
switch (localeId) {
|
|
5
|
+
case "en": return (await fetch(new URL("../assets/i18n/messagebundle_en.json", import.meta.url))).json();
|
|
6
|
+
case "en_US_saprigi": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_saprigi.json", import.meta.url))).json();
|
|
7
|
+
default: throw "unknown locale";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const importAndCheck = async (localeId) => {
|
|
11
|
+
const data = await importMessageBundle(localeId);
|
|
12
|
+
if (typeof data === "string" && data.endsWith(".json")) {
|
|
13
|
+
throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
|
|
14
|
+
}
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
const localeIds = ["en",
|
|
18
|
+
"en_US_saprigi",];
|
|
19
|
+
localeIds.forEach(localeId => {
|
|
20
|
+
registerI18nLoader("@ui5/webcomponents-base", localeId, importAndCheck);
|
|
21
|
+
});
|
|
2
22
|
//# sourceMappingURL=i18n-fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-fetch.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-fetch.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
1
|
+
{"version":3,"file":"i18n-fetch.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-fetch.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC9C,QAAQ,QAAQ,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3G,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,iDAAiD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/H,OAAO,CAAC,CAAC,MAAM,gBAAgB,CAAA;IAChC,CAAC;AACF,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,+KAA+K,CAAC,CAAC;IAClM,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAI;IACtB,eAAe,EAAE,CAAC;AAEnB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IAC5B,kBAAkB,CAAC,yBAAyB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC","sourcesContent":["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en.json\", import.meta.url))).json();\n\t\tcase \"en_US_saprigi\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en_US_saprigi.json\", import.meta.url))).json();\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_saprigi\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@ui5/webcomponents-base\", localeId, importAndCheck);\n});\n"]}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
|
|
3
|
+
const importMessageBundle = async (localeId) => {
|
|
4
|
+
switch (localeId) {
|
|
5
|
+
case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en" */ "../assets/i18n/messagebundle_en.json", { with: { type: 'json' } })).default;
|
|
6
|
+
case "en_US_saprigi": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saprigi" */ "../assets/i18n/messagebundle_en_US_saprigi.json", { with: { type: 'json' } })).default;
|
|
7
|
+
default: throw "unknown locale";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const importAndCheck = async (localeId) => {
|
|
11
|
+
const data = await importMessageBundle(localeId);
|
|
12
|
+
if (typeof data === "string" && data.endsWith(".json")) {
|
|
13
|
+
throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
|
|
14
|
+
}
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
const localeIds = ["en",
|
|
18
|
+
"en_US_saprigi",];
|
|
19
|
+
localeIds.forEach(localeId => {
|
|
20
|
+
registerI18nLoader("@ui5/webcomponents-base", localeId, importAndCheck);
|
|
21
|
+
});
|
|
2
22
|
//# sourceMappingURL=i18n-node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-node.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-node.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
1
|
+
{"version":3,"file":"i18n-node.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-node.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC9C,QAAQ,QAAQ,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,iEAAiE,CAAC,sCAAsC,EAAE,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC9K,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,4EAA4E,CAAC,iDAAiD,EAAE,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7M,OAAO,CAAC,CAAC,MAAM,gBAAgB,CAAA;IAChC,CAAC;AACF,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,+KAA+K,CAAC,CAAC;IAClM,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAI;IACtB,eAAe,EAAE,CAAC;AAEnB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IAC5B,kBAAkB,CAAC,yBAAyB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC","sourcesContent":["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en\" */ \"../assets/i18n/messagebundle_en.json\", {with: { type: 'json'}})).default;\n\t\tcase \"en_US_saprigi\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saprigi\" */ \"../assets/i18n/messagebundle_en_US_saprigi.json\", {with: { type: 'json'}})).default;\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_saprigi\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@ui5/webcomponents-base\", localeId, importAndCheck);\n});\n"]}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
|
|
3
|
+
const importMessageBundle = async (localeId) => {
|
|
4
|
+
switch (localeId) {
|
|
5
|
+
case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en" */ "../assets/i18n/messagebundle_en.json")).default;
|
|
6
|
+
case "en_US_saprigi": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saprigi" */ "../assets/i18n/messagebundle_en_US_saprigi.json")).default;
|
|
7
|
+
default: throw "unknown locale";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const importAndCheck = async (localeId) => {
|
|
11
|
+
const data = await importMessageBundle(localeId);
|
|
12
|
+
if (typeof data === "string" && data.endsWith(".json")) {
|
|
13
|
+
throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
|
|
14
|
+
}
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
const localeIds = ["en",
|
|
18
|
+
"en_US_saprigi",];
|
|
19
|
+
localeIds.forEach(localeId => {
|
|
20
|
+
registerI18nLoader("@ui5/webcomponents-base", localeId, importAndCheck);
|
|
21
|
+
});
|
|
2
22
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC9C,QAAQ,QAAQ,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,iEAAiE,CAAC,sCAAsC,CAAC,CAAC,CAAC,OAAO,CAAC;QACrJ,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,4EAA4E,CAAC,iDAAiD,CAAC,CAAC,CAAC,OAAO,CAAC;QACpL,OAAO,CAAC,CAAC,MAAM,gBAAgB,CAAA;IAChC,CAAC;AACF,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,+KAA+K,CAAC,CAAC;IAClM,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAI;IACtB,eAAe,EAAE,CAAC;AAEnB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IAC5B,kBAAkB,CAAC,yBAAyB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC","sourcesContent":["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en\" */ \"../assets/i18n/messagebundle_en.json\")).default;\n\t\tcase \"en_US_saprigi\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saprigi\" */ \"../assets/i18n/messagebundle_en_US_saprigi.json\")).default;\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_saprigi\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@ui5/webcomponents-base\", localeId, importAndCheck);\n});\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e={version:"2.13.0
|
|
1
|
+
"use strict";const e={version:"2.13.0",major:2,minor:13,patch:0,suffix:"",isNext:!1,buildTime:1754315594};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.13.0
|
|
5
|
-
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,
|
|
4
|
+
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.13.0\",\n\tmajor: 2,\n\tminor: 13,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1754315594,\n};\nexport default VersionInfo;"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,SACT,MAAO,EACP,MAAO,GACP,MAAO,EACP,OAAQ,GACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
|
|
6
6
|
"names": ["VersionInfo"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{registerI18nLoader as s}from"@ui5/webcomponents-base/dist/asset-registries/i18n.js";const t=async e=>{switch(e){case"en":return(await fetch(new URL("../assets/i18n/messagebundle_en.json",import.meta.url))).json();case"en_US_saprigi":return(await fetch(new URL("../assets/i18n/messagebundle_en_US_saprigi.json",import.meta.url))).json();default:throw"unknown locale"}},i=async e=>{const n=await t(e);if(typeof n=="string"&&n.endsWith(".json"))throw new Error('[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.');return n},o=["en","en_US_saprigi"];o.forEach(e=>{s("@ui5/webcomponents-base",e,i)});
|
|
2
2
|
//# sourceMappingURL=i18n-fetch.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../../../../src/generated/json-imports/i18n-fetch.ts"],
|
|
4
|
+
"sourcesContent": ["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en.json\", import.meta.url))).json();\n\t\tcase \"en_US_saprigi\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en_US_saprigi.json\", import.meta.url))).json();\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_saprigi\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@ui5/webcomponents-base\", localeId, importAndCheck);\n});\n"],
|
|
5
|
+
"mappings": "aACA,OAAS,sBAAAA,MAA0B,wDAEnC,MAAMC,EAAsB,MAAOC,GAAa,CAC/C,OAAQA,EAAU,CACf,IAAK,KAAM,OAAQ,MAAM,MAAM,IAAI,IAAI,uCAAwC,YAAY,GAAG,CAAC,GAAG,KAAK,EACzG,IAAK,gBAAiB,OAAQ,MAAM,MAAM,IAAI,IAAI,kDAAmD,YAAY,GAAG,CAAC,GAAG,KAAK,EAC7H,QAAS,KAAM,gBAChB,CACD,EAEMC,EAAiB,MAAOD,GAAa,CAC1C,MAAME,EAAO,MAAMH,EAAoBC,CAAQ,EAC/C,GAAI,OAAOE,GAAS,UAAYA,EAAK,SAAS,OAAO,EACpD,MAAM,IAAI,MAAM,+KAA+K,EAEhM,OAAOA,CACR,EAEMC,EAAY,CAAC,KAClB,eAAgB,EAEjBA,EAAU,QAAQH,GAAY,CAC7BF,EAAmB,0BAA2BE,EAAUC,CAAc,CACvE,CAAC",
|
|
6
|
+
"names": ["registerI18nLoader", "importMessageBundle", "localeId", "importAndCheck", "data", "localeIds"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{registerI18nLoader as n}from"@ui5/webcomponents-base/dist/asset-registries/i18n.js";const i=async t=>{switch(t){case"en":return(await import("../assets/i18n/messagebundle_en.json",{with:{type:"json"}})).default;case"en_US_saprigi":return(await import("../assets/i18n/messagebundle_en_US_saprigi.json",{with:{type:"json"}})).default;default:throw"unknown locale"}},o=async t=>{const e=await i(t);if(typeof e=="string"&&e.endsWith(".json"))throw new Error('[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.');return e},r=["en","en_US_saprigi"];r.forEach(t=>{n("@ui5/webcomponents-base",t,o)});
|
|
2
2
|
//# sourceMappingURL=i18n-node.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../../../../src/generated/json-imports/i18n-node.ts"],
|
|
4
|
+
"sourcesContent": ["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en\" */ \"../assets/i18n/messagebundle_en.json\", {with: { type: 'json'}})).default;\n\t\tcase \"en_US_saprigi\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saprigi\" */ \"../assets/i18n/messagebundle_en_US_saprigi.json\", {with: { type: 'json'}})).default;\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_saprigi\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@ui5/webcomponents-base\", localeId, importAndCheck);\n});\n"],
|
|
5
|
+
"mappings": "aACA,OAAS,sBAAAA,MAA0B,wDAEnC,MAAMC,EAAsB,MAAOC,GAAa,CAC/C,OAAQA,EAAU,CACf,IAAK,KAAM,OAAQ,KAAM,QAAyE,uCAAwC,CAAC,KAAM,CAAE,KAAM,MAAM,CAAC,CAAC,GAAG,QACtK,IAAK,gBAAiB,OAAQ,KAAM,QAAoF,kDAAmD,CAAC,KAAM,CAAE,KAAM,MAAM,CAAC,CAAC,GAAG,QACrM,QAAS,KAAM,gBAChB,CACD,EAEMC,EAAiB,MAAOD,GAAa,CAC1C,MAAME,EAAO,MAAMH,EAAoBC,CAAQ,EAC/C,GAAI,OAAOE,GAAS,UAAYA,EAAK,SAAS,OAAO,EACpD,MAAM,IAAI,MAAM,+KAA+K,EAEhM,OAAOA,CACR,EAEMC,EAAY,CAAC,KAClB,eAAgB,EAEjBA,EAAU,QAAQH,GAAY,CAC7BF,EAAmB,0BAA2BE,EAAUC,CAAc,CACvE,CAAC",
|
|
6
|
+
"names": ["registerI18nLoader", "importMessageBundle", "localeId", "importAndCheck", "data", "localeIds"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{registerI18nLoader as t}from"@ui5/webcomponents-base/dist/asset-registries/i18n.js";const i=async e=>{switch(e){case"en":return(await import("../assets/i18n/messagebundle_en.json")).default;case"en_US_saprigi":return(await import("../assets/i18n/messagebundle_en_US_saprigi.json")).default;default:throw"unknown locale"}},o=async e=>{const n=await i(e);if(typeof n=="string"&&n.endsWith(".json"))throw new Error('[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.');return n},r=["en","en_US_saprigi"];r.forEach(e=>{t("@ui5/webcomponents-base",e,o)});
|
|
2
2
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../../../../src/generated/json-imports/i18n.ts"],
|
|
4
|
+
"sourcesContent": ["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en\" */ \"../assets/i18n/messagebundle_en.json\")).default;\n\t\tcase \"en_US_saprigi\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saprigi\" */ \"../assets/i18n/messagebundle_en_US_saprigi.json\")).default;\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_saprigi\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@ui5/webcomponents-base\", localeId, importAndCheck);\n});\n"],
|
|
5
|
+
"mappings": "aACA,OAAS,sBAAAA,MAA0B,wDAEnC,MAAMC,EAAsB,MAAOC,GAAa,CAC/C,OAAQA,EAAU,CACf,IAAK,KAAM,OAAQ,KAAM,QAAyE,sCAAsC,GAAG,QAC7I,IAAK,gBAAiB,OAAQ,KAAM,QAAoF,iDAAiD,GAAG,QAC5K,QAAS,KAAM,gBAChB,CACD,EAEMC,EAAiB,MAAOD,GAAa,CAC1C,MAAME,EAAO,MAAMH,EAAoBC,CAAQ,EAC/C,GAAI,OAAOE,GAAS,UAAYA,EAAK,SAAS,OAAO,EACpD,MAAM,IAAI,MAAM,+KAA+K,EAEhM,OAAOA,CACR,EAEMC,EAAY,CAAC,KAClB,eAAgB,EAEjBA,EAAU,QAAQH,GAAY,CAC7BF,EAAmB,0BAA2BE,EAAUC,CAAc,CACvE,CAAC",
|
|
6
|
+
"names": ["registerI18nLoader", "importMessageBundle", "localeId", "importAndCheck", "data", "localeIds"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import p from"../../generated/css/MultipleDragGhost.css.js";import{getI18nBundle as D}from"../../i18nBundle.js";import{DRAG_DROP_MULTIPLE_TEXT as
|
|
1
|
+
"use strict";import p from"../../generated/css/MultipleDragGhost.css.js";import{getI18nBundle as D}from"../../i18nBundle.js";import{DRAG_DROP_MULTIPLE_TEXT as v}from"../../generated/i18n/i18n-defaults.js";const m=2;let n=null,a=null,r=!1;const o=new Set,l=new Set,i=e=>{!e.dataTransfer||!(e.target instanceof HTMLElement)||(l.has(e.target)||(a=e.target),M(e))},M=async e=>{if(!n||!e.dataTransfer)return;const t=await n;document.body.appendChild(t),e.dataTransfer.setDragImage(t,0,0),requestAnimationFrame(()=>{t.remove()})},c=()=>{a=null,n=null},g=()=>{a=null,n=null},f=e=>{a=e},b=()=>a,y=async e=>{const t=document.createElement("div"),E=await D("@ui5/webcomponents-base"),s=t.attachShadow({mode:"open"}),d=new CSSStyleSheet;return d.replaceSync(p),s.adoptedStyleSheets=[d],s.textContent=E.getText(v,e),t},u=(e,t)=>{if(e<m){console.warn(`Cannot start multiple drag with count ${e}. Minimum is ${m}.`);return}n=y(e)},S=()=>{r||(document.body.addEventListener("dragstart",i),document.body.addEventListener("dragend",c),document.body.addEventListener("drop",g),r=!0)},L=()=>{document.body.removeEventListener("dragstart",i),document.body.removeEventListener("dragend",c),document.body.removeEventListener("drop",g),r=!1},T=e=>{o.add(e),r||S()},h=e=>{o.delete(e),o.size===0&&r&&L()},w=e=>(l.add(e),f),H=e=>{l.delete(e)},I={subscribe:T,unsubscribe:h,addSelfManagedArea:w,removeSelfManagedArea:H,getDraggedElement:b,startMultipleDrag:u};export default I;export{u 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 UI5Element from \"../../UI5Element.js\";\nimport 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 customDragElementPromise: Promise<HTMLElement> | null = null;\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n\n\thandleMultipleDrag(e);\n};\n\nconst handleMultipleDrag = async (e: DragEvent) => {\n\tif (!customDragElementPromise || !e.dataTransfer) {\n\t\treturn;\n\t}\n\tconst dragElement = await customDragElementPromise;\n\t// Add to document body temporarily\n\tdocument.body.appendChild(dragElement);\n\n\te.dataTransfer.setDragImage(dragElement, 0, 0);\n\n\t// Clean up the temporary element after the drag operation starts\n\trequestAnimationFrame(() => {\n\t\tdragElement.remove();\n\t});\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n\tcustomDragElementPromise = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n\tcustomDragElementPromise = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\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 * @public\n */\nconst startMultipleDrag = (count: number): void => {\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\tcustomDragElementPromise = createDefaultMultiDragElement(count);\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = true;\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\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\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n\tstartMultipleDrag,\n};\n\nexport default DragRegistry;\nexport {\n\tstartMultipleDrag,\n};\nexport type {\n\tSetDraggedElementFunction,\n\tDragAndDropSettings,\n\tMoveEventDetail,\n};\n"],
|
|
5
|
-
"mappings": "aAEA,OAAOA,MAA0B,+CAEjC,OAAS,iBAAAC,MAAqB,sBAE9B,OACC,2BAAAC,MACM,wCAEP,MAAMC,EAAuB,EAE7B,IAAIC,EAAwD,KACxDC,EAAqC,KACrCC,EAAyB,GAC7B,MAAMC,EAAc,IAAI,IAClBC,EAAuB,IAAI,IAE3BC,EAAe,GAAiB,CACjC,CAAC,EAAE,cAAgB,EAAE,EAAE,kBAAkB,eAIxCD,EAAqB,IAAI,EAAE,MAAM,IACrCH,EAAiB,EAAE,QAGpBK,EAAmB,CAAC,EACrB,EAEMA,EAAqB,MAAO,GAAiB,CAClD,GAAI,CAACN,GAA4B,CAAC,EAAE,aACnC,OAED,MAAMO,EAAc,MAAMP,EAE1B,SAAS,KAAK,YAAYO,CAAW,EAErC,EAAE,aAAa,aAAaA,EAAa,EAAG,CAAC,EAG7C,sBAAsB,IAAM,CAC3BA,EAAY,OAAO,CACpB,CAAC,CACF,EAEMC,EAAY,IAAM,CACvBP,EAAiB,KACjBD,EAA2B,IAC5B,EAEMS,EAAS,IAAM,CACpBR,EAAiB,KACjBD,EAA2B,IAC5B,EAEMU,EAAqBC,GAAgC,CAC1DV,EAAiBU,CAClB,EAGMC,EAAoB,IAClBX,EAGFY,EAAgC,MAAOC,GAAwC,CACpF,MAAMP,EAAc,SAAS,cAAc,KAAK,EAC1CQ,EAAa,MAAMlB,EAAc,yBAAyB,EAE1DmB,EAAoBT,EAAY,aAAa,CAAE,KAAM,MAAO,CAAC,EAE7DU,EAAS,IAAI,cACnB,OAAAA,EAAO,YAAYrB,CAAoB,EAEvCoB,EAAkB,mBAAqB,CAACC,CAAM,EAC9CD,EAAkB,YAAcD,EAAW,QAAQjB,EAAyBgB,CAAK,EAE1EP,CACR,
|
|
6
|
-
"names": ["MultipleDragGhostCss", "getI18nBundle", "DRAG_DROP_MULTIPLE_TEXT", "MIN_MULTI_DRAG_COUNT", "customDragElementPromise", "draggedElement", "globalHandlersAttached", "subscribers", "selfManagedDragAreas", "ondragstart", "handleMultipleDrag", "dragElement", "ondragend", "ondrop", "setDraggedElement", "element", "getDraggedElement", "createDefaultMultiDragElement", "count", "i18nBundle", "dragElementShadow", "styles", "startMultipleDrag", "attachGlobalHandlers", "detachGlobalHandlers", "subscribe", "subscriber", "unsubscribe", "addSelfManagedArea", "area", "removeSelfManagedArea", "DragRegistry"]
|
|
4
|
+
"sourcesContent": ["import type UI5Element from \"../../UI5Element.js\";\nimport 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 customDragElementPromise: Promise<HTMLElement> | null = null;\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n\n\thandleMultipleDrag(e);\n};\n\nconst handleMultipleDrag = async (e: DragEvent) => {\n\tif (!customDragElementPromise || !e.dataTransfer) {\n\t\treturn;\n\t}\n\tconst dragElement = await customDragElementPromise;\n\t// Add to document body temporarily\n\tdocument.body.appendChild(dragElement);\n\n\te.dataTransfer.setDragImage(dragElement, 0, 0);\n\n\t// Clean up the temporary element after the drag operation starts\n\trequestAnimationFrame(() => {\n\t\tdragElement.remove();\n\t});\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n\tcustomDragElementPromise = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n\tcustomDragElementPromise = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\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 */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst startMultipleDrag = (count: number, e: DragEvent): void => {\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\tcustomDragElementPromise = createDefaultMultiDragElement(count);\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = true;\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\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\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n\tstartMultipleDrag,\n};\n\nexport default DragRegistry;\nexport {\n\tstartMultipleDrag,\n};\nexport type {\n\tSetDraggedElementFunction,\n\tDragAndDropSettings,\n\tMoveEventDetail,\n};\n"],
|
|
5
|
+
"mappings": "aAEA,OAAOA,MAA0B,+CAEjC,OAAS,iBAAAC,MAAqB,sBAE9B,OACC,2BAAAC,MACM,wCAEP,MAAMC,EAAuB,EAE7B,IAAIC,EAAwD,KACxDC,EAAqC,KACrCC,EAAyB,GAC7B,MAAMC,EAAc,IAAI,IAClBC,EAAuB,IAAI,IAE3BC,EAAe,GAAiB,CACjC,CAAC,EAAE,cAAgB,EAAE,EAAE,kBAAkB,eAIxCD,EAAqB,IAAI,EAAE,MAAM,IACrCH,EAAiB,EAAE,QAGpBK,EAAmB,CAAC,EACrB,EAEMA,EAAqB,MAAO,GAAiB,CAClD,GAAI,CAACN,GAA4B,CAAC,EAAE,aACnC,OAED,MAAMO,EAAc,MAAMP,EAE1B,SAAS,KAAK,YAAYO,CAAW,EAErC,EAAE,aAAa,aAAaA,EAAa,EAAG,CAAC,EAG7C,sBAAsB,IAAM,CAC3BA,EAAY,OAAO,CACpB,CAAC,CACF,EAEMC,EAAY,IAAM,CACvBP,EAAiB,KACjBD,EAA2B,IAC5B,EAEMS,EAAS,IAAM,CACpBR,EAAiB,KACjBD,EAA2B,IAC5B,EAEMU,EAAqBC,GAAgC,CAC1DV,EAAiBU,CAClB,EAGMC,EAAoB,IAClBX,EAGFY,EAAgC,MAAOC,GAAwC,CACpF,MAAMP,EAAc,SAAS,cAAc,KAAK,EAC1CQ,EAAa,MAAMlB,EAAc,yBAAyB,EAE1DmB,EAAoBT,EAAY,aAAa,CAAE,KAAM,MAAO,CAAC,EAE7DU,EAAS,IAAI,cACnB,OAAAA,EAAO,YAAYrB,CAAoB,EAEvCoB,EAAkB,mBAAqB,CAACC,CAAM,EAC9CD,EAAkB,YAAcD,EAAW,QAAQjB,EAAyBgB,CAAK,EAE1EP,CACR,EAWMW,EAAoB,CAACJ,EAAeK,IAAuB,CAChE,GAAIL,EAAQf,EAAsB,CACjC,QAAQ,KAAK,yCAAyCe,CAAK,gBAAgBf,CAAoB,GAAG,EAClG,MACD,CAEAC,EAA2Ba,EAA8BC,CAAK,CAC/D,EAEMM,EAAuB,IAAM,CAC9BlB,IAIJ,SAAS,KAAK,iBAAiB,YAAaG,CAAW,EACvD,SAAS,KAAK,iBAAiB,UAAWG,CAAS,EACnD,SAAS,KAAK,iBAAiB,OAAQC,CAAM,EAC7CP,EAAyB,GAC1B,EAEMmB,EAAuB,IAAM,CAClC,SAAS,KAAK,oBAAoB,YAAahB,CAAW,EAC1D,SAAS,KAAK,oBAAoB,UAAWG,CAAS,EACtD,SAAS,KAAK,oBAAoB,OAAQC,CAAM,EAChDP,EAAyB,EAC1B,EAEMoB,EAAaC,GAA2B,CAC7CpB,EAAY,IAAIoB,CAAU,EAErBrB,GACJkB,EAAqB,CAEvB,EAEMI,EAAeD,GAA2B,CAC/CpB,EAAY,OAAOoB,CAAU,EAEzBpB,EAAY,OAAS,GAAKD,GAC7BmB,EAAqB,CAEvB,EAEMI,EAAsBC,IAC3BtB,EAAqB,IAAIsB,CAAI,EAEtBhB,GAGFiB,EAAyBD,GAAmC,CACjEtB,EAAqB,OAAOsB,CAAI,CACjC,EAwBME,EAAe,CACpB,UAAAN,EACA,YAAAE,EACA,mBAAAC,EACA,sBAAAE,EACA,kBAAAf,EACA,kBAAAM,CACD,EAEA,eAAeU,EACf,OACCV,KAAA",
|
|
6
|
+
"names": ["MultipleDragGhostCss", "getI18nBundle", "DRAG_DROP_MULTIPLE_TEXT", "MIN_MULTI_DRAG_COUNT", "customDragElementPromise", "draggedElement", "globalHandlersAttached", "subscribers", "selfManagedDragAreas", "ondragstart", "handleMultipleDrag", "dragElement", "ondragend", "ondrop", "setDraggedElement", "element", "getDraggedElement", "createDefaultMultiDragElement", "count", "i18nBundle", "dragElementShadow", "styles", "startMultipleDrag", "e", "attachGlobalHandlers", "detachGlobalHandlers", "subscribe", "subscriber", "unsubscribe", "addSelfManagedArea", "area", "removeSelfManagedArea", "DragRegistry"]
|
|
7
7
|
}
|
|
@@ -7,9 +7,10 @@ type SetDraggedElementFunction = typeof setDraggedElement;
|
|
|
7
7
|
* The drag ghost will be displayed when dragging multiple items.
|
|
8
8
|
*
|
|
9
9
|
* @param {number} count - The number of items being dragged.
|
|
10
|
+
* @param {DragEvent} e - The drag event that triggered the operation.
|
|
10
11
|
* @public
|
|
11
12
|
*/
|
|
12
|
-
declare const startMultipleDrag: (count: number) => void;
|
|
13
|
+
declare const startMultipleDrag: (count: number, e: DragEvent) => void;
|
|
13
14
|
type DragAndDropSettings = {
|
|
14
15
|
/**
|
|
15
16
|
* Allow cross-browser and file drag and drop.
|
|
@@ -36,7 +37,7 @@ declare const DragRegistry: {
|
|
|
36
37
|
addSelfManagedArea: (area: HTMLElement | ShadowRoot) => (element: HTMLElement | null) => void;
|
|
37
38
|
removeSelfManagedArea: (area: HTMLElement | ShadowRoot) => void;
|
|
38
39
|
getDraggedElement: () => HTMLElement | null;
|
|
39
|
-
startMultipleDrag: (count: number) => void;
|
|
40
|
+
startMultipleDrag: (count: number, e: DragEvent) => void;
|
|
40
41
|
};
|
|
41
42
|
export default DragRegistry;
|
|
42
43
|
export { startMultipleDrag, };
|
|
@@ -58,9 +58,11 @@ const createDefaultMultiDragElement = async (count) => {
|
|
|
58
58
|
* The drag ghost will be displayed when dragging multiple items.
|
|
59
59
|
*
|
|
60
60
|
* @param {number} count - The number of items being dragged.
|
|
61
|
+
* @param {DragEvent} e - The drag event that triggered the operation.
|
|
61
62
|
* @public
|
|
62
63
|
*/
|
|
63
|
-
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
65
|
+
const startMultipleDrag = (count, e) => {
|
|
64
66
|
if (count < MIN_MULTI_DRAG_COUNT) {
|
|
65
67
|
console.warn(`Cannot start multiple drag with count ${count}. Minimum is ${MIN_MULTI_DRAG_COUNT}.`); // eslint-disable-line
|
|
66
68
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"AAEA,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,wBAAwB,GAAgC,IAAI,CAAC;AACjE,IAAI,cAAc,GAAuB,IAAI,CAAC;AAC9C,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAc,CAAC;AAC1C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,CAAY,EAAE,EAAE;IACpC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE,CAAC;QAC3D,OAAO;IACR,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,KAAK,EAAE,CAAY,EAAE,EAAE;IACjD,IAAI,CAAC,wBAAwB,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QAClD,OAAO;IACR,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,wBAAw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CAAC,CAAC;IAE/B,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,sBAAsB,EAAE,CAAC;QACtD,oBAAoB,EAAE,CAAC;IACxB,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAA8B,EAAE,EAAE;IAC7D,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,OAAO,iBAAiB,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,IAA8B,EAAE,EAAE;IAChE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAwBF,MAAM,YAAY,GAAG;IACpB,SAAS;IACT,WAAW;IACX,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;CACjB,CAAC;AAEF,eAAe,YAAY,CAAC;AAC5B,OAAO,EACN,iBAAiB,GACjB,CAAC","sourcesContent":["import type UI5Element from \"../../UI5Element.js\";\nimport 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 customDragElementPromise: Promise<HTMLElement> | null = null;\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n\n\thandleMultipleDrag(e);\n};\n\nconst handleMultipleDrag = async (e: DragEvent) => {\n\tif (!customDragElementPromise || !e.dataTransfer) {\n\t\treturn;\n\t}\n\tconst dragElement = await customDragElementPromise;\n\t// Add to document body temporarily\n\tdocument.body.appendChild(dragElement);\n\n\te.dataTransfer.setDragImage(dragElement, 0, 0);\n\n\t// Clean up the temporary element after the drag operation starts\n\trequestAnimationFrame(() => {\n\t\tdragElement.remove();\n\t});\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n\tcustomDragElementPromise = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n\tcustomDragElementPromise = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\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 */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst startMultipleDrag = (count: number, e: DragEvent): void => {\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\tcustomDragElementPromise = createDefaultMultiDragElement(count);\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = true;\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\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\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n\tstartMultipleDrag,\n};\n\nexport default DragRegistry;\nexport {\n\tstartMultipleDrag,\n};\nexport type {\n\tSetDraggedElementFunction,\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.13.0
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@openui5/sap.ui.core": "1.120.17",
|
|
64
64
|
"@ui5/cypress-internal": "0.0.0",
|
|
65
|
-
"@ui5/webcomponents-tools": "2.13.0
|
|
65
|
+
"@ui5/webcomponents-tools": "2.13.0",
|
|
66
66
|
"chromedriver": "^137.0.4",
|
|
67
67
|
"clean-css": "^5.2.2",
|
|
68
68
|
"copy-and-watch": "^0.1.5",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"resolve": "^1.20.0",
|
|
74
74
|
"touch": "^3.1.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "005828de6708dade06748df6216ff9072f10aea5"
|
|
77
77
|
}
|