@ui5/webcomponents-base 1.24.0 → 2.0.0-rc.1
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/.eslintignore +0 -1
- package/CHANGELOG.md +279 -0
- package/README.md +0 -8
- package/bundle.esm.js +0 -1
- package/config/wdio.conf.cjs +0 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/Device.d.ts +1 -2
- package/dist/Device.js +5 -12
- package/dist/Device.js.map +1 -1
- package/dist/ManagedStyles.js +21 -99
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/UI5Element.d.ts +5 -26
- package/dist/UI5Element.js +24 -54
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +2 -0
- package/dist/UI5ElementMetadata.js +3 -0
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/custom-elements-internal.json +0 -76
- package/dist/custom-elements.json +0 -76
- package/dist/decorators/customElement.d.ts +1 -2
- package/dist/decorators/customElement.js +6 -4
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +0 -2
- package/dist/features/OpenUI5Support.js +2 -23
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/generated/VersionInfo.js +5 -5
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/renderer/LitRenderer.js +2 -8
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/theming/getConstructableStyle.d.ts +1 -1
- package/dist/theming/getConstructableStyle.js +3 -3
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveStyle.d.ts +1 -1
- package/dist/theming/getEffectiveStyle.js +5 -12
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/updateShadowRoot.d.ts +1 -2
- package/dist/updateShadowRoot.js +5 -29
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/PopupUtils.d.ts +1 -3
- package/dist/util/PopupUtils.js +1 -15
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +1 -1
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +1 -8
- package/index.js +0 -14
- package/package-scripts.cjs +1 -1
- package/package.json +3 -3
- package/dist/CSP.d.ts +0 -33
- package/dist/CSP.js +0 -54
- package/dist/CSP.js.map +0 -1
- package/dist/StaticAreaItem.d.ts +0 -35
- package/dist/StaticAreaItem.js +0 -100
- package/dist/StaticAreaItem.js.map +0 -1
- package/dist/theming/getEffectiveLinksHrefs.d.ts +0 -3
- package/dist/theming/getEffectiveLinksHrefs.js +0 -17
- package/dist/theming/getEffectiveLinksHrefs.js.map +0 -1
- package/dist/theming/preloadLinks.d.ts +0 -3
- package/dist/theming/preloadLinks.js +0 -19
- package/dist/theming/preloadLinks.js.map +0 -1
- package/dist/util/createStyleInHead.d.ts +0 -8
- package/dist/util/createStyleInHead.js +0 -18
- package/dist/util/createStyleInHead.js.map +0 -1
|
@@ -657,21 +657,6 @@
|
|
|
657
657
|
}
|
|
658
658
|
]
|
|
659
659
|
},
|
|
660
|
-
{
|
|
661
|
-
"kind": "javascript-module",
|
|
662
|
-
"path": "dist/theming/getEffectiveLinksHrefs.js",
|
|
663
|
-
"declarations": [],
|
|
664
|
-
"exports": [
|
|
665
|
-
{
|
|
666
|
-
"kind": "js",
|
|
667
|
-
"name": "default",
|
|
668
|
-
"declaration": {
|
|
669
|
-
"name": "getEffectiveLinksHrefs",
|
|
670
|
-
"module": "dist/theming/getEffectiveLinksHrefs.js"
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
]
|
|
674
|
-
},
|
|
675
660
|
{
|
|
676
661
|
"kind": "javascript-module",
|
|
677
662
|
"path": "dist/theming/getEffectiveStyle.js",
|
|
@@ -717,21 +702,6 @@
|
|
|
717
702
|
}
|
|
718
703
|
]
|
|
719
704
|
},
|
|
720
|
-
{
|
|
721
|
-
"kind": "javascript-module",
|
|
722
|
-
"path": "dist/theming/preloadLinks.js",
|
|
723
|
-
"declarations": [],
|
|
724
|
-
"exports": [
|
|
725
|
-
{
|
|
726
|
-
"kind": "js",
|
|
727
|
-
"name": "default",
|
|
728
|
-
"declaration": {
|
|
729
|
-
"name": "preloadLinks",
|
|
730
|
-
"module": "dist/theming/preloadLinks.js"
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
]
|
|
734
|
-
},
|
|
735
705
|
{
|
|
736
706
|
"kind": "javascript-module",
|
|
737
707
|
"path": "dist/thirdparty/_merge.js",
|
|
@@ -1267,21 +1237,6 @@
|
|
|
1267
1237
|
}
|
|
1268
1238
|
]
|
|
1269
1239
|
},
|
|
1270
|
-
{
|
|
1271
|
-
"kind": "javascript-module",
|
|
1272
|
-
"path": "dist/util/createStyleInHead.js",
|
|
1273
|
-
"declarations": [],
|
|
1274
|
-
"exports": [
|
|
1275
|
-
{
|
|
1276
|
-
"kind": "js",
|
|
1277
|
-
"name": "default",
|
|
1278
|
-
"declaration": {
|
|
1279
|
-
"name": "createStyleInHead",
|
|
1280
|
-
"module": "dist/util/createStyleInHead.js"
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
]
|
|
1284
|
-
},
|
|
1285
1240
|
{
|
|
1286
1241
|
"kind": "javascript-module",
|
|
1287
1242
|
"path": "dist/util/debounce.js",
|
|
@@ -1639,12 +1594,6 @@
|
|
|
1639
1594
|
"declarations": [],
|
|
1640
1595
|
"exports": []
|
|
1641
1596
|
},
|
|
1642
|
-
{
|
|
1643
|
-
"kind": "javascript-module",
|
|
1644
|
-
"path": "dist/CSP.js",
|
|
1645
|
-
"declarations": [],
|
|
1646
|
-
"exports": []
|
|
1647
|
-
},
|
|
1648
1597
|
{
|
|
1649
1598
|
"kind": "javascript-module",
|
|
1650
1599
|
"path": "dist/CustomElementsRegistry.js",
|
|
@@ -1813,21 +1762,6 @@
|
|
|
1813
1762
|
}
|
|
1814
1763
|
]
|
|
1815
1764
|
},
|
|
1816
|
-
{
|
|
1817
|
-
"kind": "javascript-module",
|
|
1818
|
-
"path": "dist/StaticAreaItem.js",
|
|
1819
|
-
"declarations": [],
|
|
1820
|
-
"exports": [
|
|
1821
|
-
{
|
|
1822
|
-
"kind": "js",
|
|
1823
|
-
"name": "default",
|
|
1824
|
-
"declaration": {
|
|
1825
|
-
"name": "StaticAreaItem",
|
|
1826
|
-
"module": "dist/StaticAreaItem.js"
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
]
|
|
1830
|
-
},
|
|
1831
1765
|
{
|
|
1832
1766
|
"kind": "javascript-module",
|
|
1833
1767
|
"path": "dist/SystemCSSVars.js",
|
|
@@ -2130,16 +2064,6 @@
|
|
|
2130
2064
|
"default": "true",
|
|
2131
2065
|
"readonly": true
|
|
2132
2066
|
},
|
|
2133
|
-
{
|
|
2134
|
-
"kind": "method",
|
|
2135
|
-
"name": "getStaticAreaItemDomRef",
|
|
2136
|
-
"return": {
|
|
2137
|
-
"type": {
|
|
2138
|
-
"text": "Promise<ShadowRoot | null>"
|
|
2139
|
-
}
|
|
2140
|
-
},
|
|
2141
|
-
"privacy": "public"
|
|
2142
|
-
},
|
|
2143
2067
|
{
|
|
2144
2068
|
"kind": "method",
|
|
2145
2069
|
"name": "getUniqueDependencies",
|
|
@@ -14,10 +14,9 @@ declare const customElement: (tagNameOrComponentSettings?: string | {
|
|
|
14
14
|
styles?: Styles;
|
|
15
15
|
template?: Template;
|
|
16
16
|
dependencies?: Array<typeof UI5Element>;
|
|
17
|
-
staticAreaStyles?: Styles;
|
|
18
|
-
staticAreaTemplate?: Template;
|
|
19
17
|
languageAware?: boolean;
|
|
20
18
|
themeAware?: boolean;
|
|
21
19
|
fastNavigation?: boolean;
|
|
20
|
+
shadowRootOptions?: Partial<ShadowRootInit>;
|
|
22
21
|
}) => ClassDecorator;
|
|
23
22
|
export default customElement;
|
|
@@ -13,7 +13,7 @@ const customElement = (tagNameOrComponentSettings = {}) => {
|
|
|
13
13
|
target.metadata.tag = tagNameOrComponentSettings;
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
const { tag, languageAware, themeAware, fastNavigation, } = tagNameOrComponentSettings;
|
|
16
|
+
const { tag, languageAware, themeAware, fastNavigation, shadowRootOptions, } = tagNameOrComponentSettings;
|
|
17
17
|
target.metadata.tag = tag;
|
|
18
18
|
if (languageAware) {
|
|
19
19
|
target.metadata.languageAware = languageAware;
|
|
@@ -24,9 +24,11 @@ const customElement = (tagNameOrComponentSettings = {}) => {
|
|
|
24
24
|
if (fastNavigation) {
|
|
25
25
|
target.metadata.fastNavigation = fastNavigation;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if (shadowRootOptions) {
|
|
28
|
+
target.metadata.shadowRootOptions = shadowRootOptions;
|
|
29
|
+
}
|
|
30
|
+
["renderer", "template", "styles", "dependencies"].forEach((customElementEntity) => {
|
|
31
|
+
const customElementEntityValue = tagNameOrComponentSettings[customElementEntity];
|
|
30
32
|
customElementEntityValue && Object.defineProperty(target, customElementEntity, {
|
|
31
33
|
get: () => customElementEntityValue,
|
|
32
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,6BAUnB,EAAE,EAAkB,EAAE;IACzB,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;YAC9D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;SACrB;QAED,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE;YACnD,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,0BAA0B,CAAC;YACjD,OAAO;SACP;QAED,MAAM,EACL,GAAG,EACH,aAAa,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,GAChB,GAAG,0BAA0B,CAAC;QAEhC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,IAAI,aAAa,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;SAC9C;QACD,IAAI,UAAU,EAAE;YACf,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;SACxC;QACD,IAAI,cAAc,EAAE;YACnB,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;SAChD;QACD,IAAI,iBAAiB,EAAE;YACtB,MAAM,CAAC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;SACtD;QAED,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,mBAA2B,EAAE,EAAE;YAC1F,MAAM,wBAAwB,GAAG,0BAA0B,CAAC,mBAAuC,CAAC,CAAC;YAErG,wBAAwB,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE;gBAC9E,GAAG,EAAE,GAAG,EAAE,CAAC,wBAAwB;aACnC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Renderer } from \"../UI5Element.js\";\nimport type { TemplateFunction as Template } from \"../renderer/executeTemplate.js\";\nimport type { ComponentStylesData as Styles } from \"../types.js\";\n\n/**\n * Returns a custom element class decorator.\n *\n * @param { string | object } tagNameOrComponentSettings\n * @returns { ClassDecorator }\n */\nconst customElement = (tagNameOrComponentSettings: string | {\n\ttag?: string,\n\trenderer?: Renderer,\n\tstyles?: Styles,\n\ttemplate?: Template,\n\tdependencies?: Array<typeof UI5Element>,\n\tlanguageAware?: boolean,\n\tthemeAware?: boolean,\n\tfastNavigation?: boolean,\n\tshadowRootOptions?: Partial<ShadowRootInit>,\n} = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tif (typeof tagNameOrComponentSettings === \"string\") {\n\t\t\ttarget.metadata.tag = tagNameOrComponentSettings;\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttag,\n\t\t\tlanguageAware,\n\t\t\tthemeAware,\n\t\t\tfastNavigation,\n\t\t\tshadowRootOptions,\n\t\t } = tagNameOrComponentSettings;\n\n\t\ttarget.metadata.tag = tag;\n\t\tif (languageAware) {\n\t\t\ttarget.metadata.languageAware = languageAware;\n\t\t}\n\t\tif (themeAware) {\n\t\t\ttarget.metadata.themeAware = themeAware;\n\t\t}\n\t\tif (fastNavigation) {\n\t\t\ttarget.metadata.fastNavigation = fastNavigation;\n\t\t}\n\t\tif (shadowRootOptions) {\n\t\t\ttarget.metadata.shadowRootOptions = shadowRootOptions;\n\t\t}\n\n\t\t[\"renderer\", \"template\", \"styles\", \"dependencies\"].forEach((customElementEntity: string) => {\n\t\t\tconst customElementEntityValue = tagNameOrComponentSettings[customElementEntity as keyof typeof tag];\n\n\t\t\tcustomElementEntityValue && Object.defineProperty(target, customElementEntity, {\n\t\t\t\tget: () => customElementEntityValue,\n\t\t\t});\n\t\t});\n\t};\n};\n\nexport default customElement;\n"]}
|
|
@@ -30,7 +30,5 @@ declare class OpenUI5Support {
|
|
|
30
30
|
static _listenForThemeChange(): void;
|
|
31
31
|
static attachListeners(): void;
|
|
32
32
|
static cssVariablesLoaded(): boolean | undefined;
|
|
33
|
-
static getNextZIndex(): number | undefined;
|
|
34
|
-
static setInitialZIndex(): void;
|
|
35
33
|
}
|
|
36
34
|
export default OpenUI5Support;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { registerFeature } from "../FeaturesRegistry.js";
|
|
2
2
|
import { setTheme } from "../config/Theme.js";
|
|
3
|
-
import { getCurrentZIndex } from "../util/PopupUtils.js";
|
|
4
3
|
class OpenUI5Support {
|
|
5
4
|
static isAtLeastVersion116() {
|
|
6
5
|
const version = window.sap.ui.version;
|
|
@@ -20,7 +19,7 @@ class OpenUI5Support {
|
|
|
20
19
|
return new Promise(resolve => {
|
|
21
20
|
window.sap.ui.require(["sap/ui/core/Core"], async (Core) => {
|
|
22
21
|
const callback = () => {
|
|
23
|
-
let deps = ["sap/ui/core/
|
|
22
|
+
let deps = ["sap/ui/core/LocaleData"];
|
|
24
23
|
if (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core
|
|
25
24
|
deps = [
|
|
26
25
|
...deps,
|
|
@@ -31,10 +30,7 @@ class OpenUI5Support {
|
|
|
31
30
|
"sap/ui/core/date/CalendarUtils",
|
|
32
31
|
];
|
|
33
32
|
}
|
|
34
|
-
window.sap.ui.require(deps,
|
|
35
|
-
Popup.setInitialZIndex(getCurrentZIndex());
|
|
36
|
-
resolve();
|
|
37
|
-
});
|
|
33
|
+
window.sap.ui.require(deps, resolve);
|
|
38
34
|
};
|
|
39
35
|
if (OpenUI5Support.isAtLeastVersion116()) {
|
|
40
36
|
await Core.ready();
|
|
@@ -132,23 +128,6 @@ class OpenUI5Support {
|
|
|
132
128
|
}
|
|
133
129
|
return !!link.href.match(/\/css(-|_)variables\.css/);
|
|
134
130
|
}
|
|
135
|
-
static getNextZIndex() {
|
|
136
|
-
if (!OpenUI5Support.isOpenUI5Detected()) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
const Popup = window.sap.ui.require("sap/ui/core/Popup");
|
|
140
|
-
if (!Popup) {
|
|
141
|
-
console.warn(`The OpenUI5Support feature hasn't been initialized properly. Make sure you import the "@ui5/webcomponents-base/dist/features/OpenUI5Support.js" module before all components' modules.`); // eslint-disable-line
|
|
142
|
-
}
|
|
143
|
-
return Popup.getNextZIndex();
|
|
144
|
-
}
|
|
145
|
-
static setInitialZIndex() {
|
|
146
|
-
if (!OpenUI5Support.isOpenUI5Detected()) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const Popup = window.sap.ui.require("sap/ui/core/Popup");
|
|
150
|
-
Popup.setInitialZIndex(getCurrentZIndex());
|
|
151
|
-
}
|
|
152
131
|
}
|
|
153
132
|
registerFeature("OpenUI5Support", OpenUI5Support);
|
|
154
133
|
export default OpenUI5Support;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAoEzD,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAiB,CAAC;QACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,OAAO,KAAK,CAAC;SACb;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,iBAAiB;QACvB,OAAO,OAAO,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,KAAK,UAAU,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,cAAc,CAAC,iBAAiB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,CAAiB,CAAC;QAEzE,IAAI,CAAC,KAAK,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,wLAAwL,CAAC,CAAC,CAAC,sBAAsB;SAC9N;QAED,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,gBAAgB;QACtB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAiB,CAAC;QACzE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC5C,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport { getCurrentZIndex } from \"../util/PopupUtils.js\";\nimport { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Popup = {\n\tsetInitialZIndex: (zIndex: number) => void,\n\tgetNextZIndex: () => number,\n};\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise<void>(resolve => {\n\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\tconst callback = () => {\n\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup) => {\n\t\t\t\t\t\tPopup.setInitialZIndex(getCurrentZIndex());\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\tawait Core.ready();\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/);\n\t}\n\n\tstatic getNextZIndex() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst Popup = window.sap.ui.require(\"sap/ui/core/Popup\") as OpenUI5Popup;\n\n\t\tif (!Popup) {\n\t\t\tconsole.warn(`The OpenUI5Support feature hasn't been initialized properly. Make sure you import the \"@ui5/webcomponents-base/dist/features/OpenUI5Support.js\" module before all components' modules.`); // eslint-disable-line\n\t\t}\n\n\t\treturn Popup.getNextZIndex();\n\t}\n\n\tstatic setInitialZIndex() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst Popup = window.sap.ui.require(\"sap/ui/core/Popup\") as OpenUI5Popup;\n\t\tPopup.setInitialZIndex(getCurrentZIndex());\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
|
|
1
|
+
{"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,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AAO;SACP;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise<void>(resolve => {\n\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\tconst callback = () => {\n\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/LocaleData\"];\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\twindow.sap.ui.require(deps, resolve);\n\t\t\t\t};\n\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\tawait Core.ready();\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/);\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "
|
|
3
|
-
major:
|
|
4
|
-
minor:
|
|
2
|
+
version: "2.0.0-rc.1",
|
|
3
|
+
major: 2,
|
|
4
|
+
minor: 0,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "",
|
|
6
|
+
suffix: "-rc.1",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1712822792,
|
|
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,YAAY;IACrB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,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.0.0-rc.1\",\n\tmajor: 2,\n\tminor: 0,\n\tpatch: 0,\n\tsuffix: \"-rc.1\",\n\tisNext: false,\n\tbuildTime: 1712822792,\n};\nexport default VersionInfo;"]}
|
|
@@ -10,17 +10,11 @@ const effectiveSvg = (strings, ...values) => {
|
|
|
10
10
|
const fn = litStatic ? litStatic.svg : svg;
|
|
11
11
|
return fn(strings, ...values);
|
|
12
12
|
};
|
|
13
|
-
const litRender = (templateResult, container,
|
|
13
|
+
const litRender = (templateResult, container, options) => {
|
|
14
14
|
const openUI5Enablement = getFeature("OpenUI5Enablement");
|
|
15
|
-
if (openUI5Enablement
|
|
15
|
+
if (openUI5Enablement) {
|
|
16
16
|
templateResult = openUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, options.host, templateResult);
|
|
17
17
|
}
|
|
18
|
-
if (typeof styleStrOrHrefsArr === "string") {
|
|
19
|
-
templateResult = effectiveHtml `<style>${styleStrOrHrefsArr}</style>${templateResult}`;
|
|
20
|
-
}
|
|
21
|
-
else if (Array.isArray(styleStrOrHrefsArr) && styleStrOrHrefsArr.length) {
|
|
22
|
-
templateResult = effectiveHtml `${styleStrOrHrefsArr.map(href => effectiveHtml `<link type="text/css" rel="stylesheet" href="${href}">`)}${templateResult}`;
|
|
23
|
-
}
|
|
24
18
|
render(templateResult, container, options);
|
|
25
19
|
};
|
|
26
20
|
const scopeTag = (tag, tags, suffix) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LitRenderer.js","sourceRoot":"","sources":["../../src/renderer/LitRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,IAAI,EACJ,GAAG,GAEH,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,MAAM,aAAa,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAsB,EAAE,EAAE;IAClF,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,OAAO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LitStatic } from \"../CustomElementsScope.js\";\nimport type OpenUI5Enablement from \"../features/OpenUI5Enablement.js\";\nimport type UI5Element from \"../UI5Element.js\";\nimport type { Renderer, RendererOptions } from \"../UI5Element.js\";\nimport { TemplateFunctionResult } from \"./executeTemplate.js\";\n\nconst effectiveHtml = (strings: TemplateStringsArray, ...values: Array<unknown>) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tconst fn = litStatic ? litStatic.html : html;\n\treturn fn(strings, ...values);\n};\n\nconst effectiveSvg = (strings: TemplateStringsArray, ...values: Array<unknown>) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tconst fn = litStatic ? litStatic.svg : svg;\n\treturn fn(strings, ...values);\n};\n\nconst litRender: Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, options: RendererOptions) => {\n\tconst openUI5Enablement = getFeature<typeof OpenUI5Enablement>(\"OpenUI5Enablement\");\n\tif (openUI5Enablement) {\n\t\ttemplateResult = openUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, options.host as UI5Element, templateResult as TemplateResult);\n\t}\n\n\trender(templateResult as TemplateResult, container, options);\n};\n\nconst scopeTag = (tag: string, tags: Array<string>, suffix: string) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tif (litStatic) {\n\t\treturn litStatic.unsafeStatic((tags || []).includes(tag) ? `${tag}-${suffix}` : tag);\n\t}\n};\n\nexport {\n\teffectiveHtml as html,\n\teffectiveSvg as svg,\n};\nexport { scopeTag };\nexport { repeat } from \"lit-html/directives/repeat.js\";\nexport { classMap } from \"lit-html/directives/class-map.js\";\n// @ts-ignore style-map is a JS file\nexport { styleMap } from \"./directives/style-map.js\";\nexport { ifDefined } from \"lit-html/directives/if-defined.js\";\nexport { unsafeHTML } from \"lit-html/directives/unsafe-html.js\";\n\nexport default litRender;\n"]}
|
|
@@ -5,5 +5,5 @@ import UI5Element from "../UI5Element.js";
|
|
|
5
5
|
* @param ElementClass
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
|
-
declare const getConstructableStyle: (ElementClass: typeof UI5Element
|
|
8
|
+
declare const getConstructableStyle: (ElementClass: typeof UI5Element) => CSSStyleSheet[];
|
|
9
9
|
export default getConstructableStyle;
|
|
@@ -10,11 +10,11 @@ attachCustomCSSChange((tag) => {
|
|
|
10
10
|
* @param ElementClass
|
|
11
11
|
* @returns {*}
|
|
12
12
|
*/
|
|
13
|
-
const getConstructableStyle = (ElementClass
|
|
13
|
+
const getConstructableStyle = (ElementClass) => {
|
|
14
14
|
const tag = ElementClass.getMetadata().getTag();
|
|
15
|
-
const key = `${tag}
|
|
15
|
+
const key = `${tag}_normal`;
|
|
16
16
|
if (!constructableStyleMap.has(key)) {
|
|
17
|
-
const styleContent = getEffectiveStyle(ElementClass
|
|
17
|
+
const styleContent = getEffectiveStyle(ElementClass);
|
|
18
18
|
const style = new CSSStyleSheet();
|
|
19
19
|
style.replaceSync(styleContent);
|
|
20
20
|
constructableStyleMap.set(key, [style]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstructableStyle.js","sourceRoot":"","sources":["../../src/theming/getConstructableStyle.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAgC,CAAC;AAEtE,qBAAqB,CAAC,CAAC,GAAW,EAAE,EAAE;IACrC,qBAAqB,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,kFAAkF;AAClI,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,CAAC,YAA+B,EAAE,
|
|
1
|
+
{"version":3,"file":"getConstructableStyle.js","sourceRoot":"","sources":["../../src/theming/getConstructableStyle.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAgC,CAAC;AAEtE,qBAAqB,CAAC,CAAC,GAAW,EAAE,EAAE;IACrC,qBAAqB,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,kFAAkF;AAClI,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,CAAC,YAA+B,EAAE,EAAE;IACjE,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC;IAChD,MAAM,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;IAE5B,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACpC,MAAM,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,IAAI,aAAa,EAAE,CAAC;QAClC,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAChC,qBAAqB,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;AACxC,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import getEffectiveStyle from \"./getEffectiveStyle.js\";\nimport { attachCustomCSSChange } from \"./CustomStyle.js\";\nimport UI5Element from \"../UI5Element.js\";\n\nconst constructableStyleMap = new Map<string, Array<CSSStyleSheet>>();\n\nattachCustomCSSChange((tag: string) => {\n\tconstructableStyleMap.delete(`${tag}_normal`); // there is custom CSS only for the component itself, not for its static area part\n});\n\n/**\n * Returns (and caches) a constructable style sheet for a web component class\n * Note: Chrome\n * @param ElementClass\n * @returns {*}\n */\nconst getConstructableStyle = (ElementClass: typeof UI5Element) => {\n\tconst tag = ElementClass.getMetadata().getTag();\n\tconst key = `${tag}_normal`;\n\n\tif (!constructableStyleMap.has(key)) {\n\t\tconst styleContent = getEffectiveStyle(ElementClass);\n\t\tconst style = new CSSStyleSheet();\n\t\tstyle.replaceSync(styleContent);\n\t\tconstructableStyleMap.set(key, [style]);\n\t}\n\n\treturn constructableStyleMap.get(key)!;\n};\n\nexport default getConstructableStyle;\n"]}
|
|
@@ -5,25 +5,18 @@ const effectiveStyleMap = new Map();
|
|
|
5
5
|
attachCustomCSSChange((tag) => {
|
|
6
6
|
effectiveStyleMap.delete(`${tag}_normal`); // there is custom CSS only for the component itself, not for its static area part
|
|
7
7
|
});
|
|
8
|
-
const getEffectiveStyle = (ElementClass
|
|
8
|
+
const getEffectiveStyle = (ElementClass) => {
|
|
9
9
|
const tag = ElementClass.getMetadata().getTag();
|
|
10
|
-
const key = `${tag}
|
|
10
|
+
const key = `${tag}_normal`;
|
|
11
11
|
const openUI5Enablement = getFeature("OpenUI5Enablement");
|
|
12
12
|
if (!effectiveStyleMap.has(key)) {
|
|
13
|
-
let effectiveStyle;
|
|
14
13
|
let busyIndicatorStyles = "";
|
|
15
14
|
if (openUI5Enablement) {
|
|
16
15
|
busyIndicatorStyles = getStylesString(openUI5Enablement.getBusyIndicatorStyles());
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
const customStyle = getCustomCSS(tag) || "";
|
|
23
|
-
const builtInStyles = getStylesString(ElementClass.styles);
|
|
24
|
-
effectiveStyle = `${builtInStyles} ${customStyle}`;
|
|
25
|
-
}
|
|
26
|
-
effectiveStyle = `${effectiveStyle} ${busyIndicatorStyles}`;
|
|
17
|
+
const customStyle = getCustomCSS(tag) || "";
|
|
18
|
+
const builtInStyles = getStylesString(ElementClass.styles);
|
|
19
|
+
const effectiveStyle = `${builtInStyles} ${customStyle} ${busyIndicatorStyles}`;
|
|
27
20
|
effectiveStyleMap.set(key, effectiveStyle);
|
|
28
21
|
}
|
|
29
22
|
return effectiveStyleMap.get(key); // The key is guaranteed to exist
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEffectiveStyle.js","sourceRoot":"","sources":["../../src/theming/getEffectiveStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpD,qBAAqB,CAAC,CAAC,GAAW,EAAE,EAAE;IACrC,iBAAiB,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,kFAAkF;AAC9H,CAAC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,YAA+B,EAAE,
|
|
1
|
+
{"version":3,"file":"getEffectiveStyle.js","sourceRoot":"","sources":["../../src/theming/getEffectiveStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpD,qBAAqB,CAAC,CAAC,GAAW,EAAE,EAAE;IACrC,iBAAiB,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,kFAAkF;AAC9H,CAAC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,YAA+B,EAAE,EAAE;IAC7D,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC;IAChD,MAAM,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;IAC5B,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;IAEpF,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAChC,IAAI,mBAAmB,GAAG,EAAE,CAAC;QAE7B,IAAI,iBAAiB,EAAE;YACtB,mBAAmB,GAAG,eAAe,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,CAAC;SAClF;QAED,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,aAAa,GAAG,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAE3D,MAAM,cAAc,GAAG,GAAG,aAAa,IAAI,WAAW,IAAI,mBAAmB,EAAE,CAAC;QAChF,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;KAC3C;IAED,OAAO,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,CAAC,iCAAiC;AACtE,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { getCustomCSS, attachCustomCSSChange } from \"./CustomStyle.js\";\nimport getStylesString from \"./getStylesString.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type UI5Element from \"../UI5Element.js\";\nimport OpenUI5Enablement from \"../features/OpenUI5Enablement.js\";\n\nconst effectiveStyleMap = new Map<string, string>();\n\nattachCustomCSSChange((tag: string) => {\n\teffectiveStyleMap.delete(`${tag}_normal`); // there is custom CSS only for the component itself, not for its static area part\n});\n\nconst getEffectiveStyle = (ElementClass: typeof UI5Element) => {\n\tconst tag = ElementClass.getMetadata().getTag();\n\tconst key = `${tag}_normal`;\n\tconst openUI5Enablement = getFeature<typeof OpenUI5Enablement>(\"OpenUI5Enablement\");\n\n\tif (!effectiveStyleMap.has(key)) {\n\t\tlet busyIndicatorStyles = \"\";\n\n\t\tif (openUI5Enablement) {\n\t\t\tbusyIndicatorStyles = getStylesString(openUI5Enablement.getBusyIndicatorStyles());\n\t\t}\n\n\t\tconst customStyle = getCustomCSS(tag) || \"\";\n\t\tconst builtInStyles = getStylesString(ElementClass.styles);\n\n\t\tconst effectiveStyle = `${builtInStyles} ${customStyle} ${busyIndicatorStyles}`;\n\t\teffectiveStyleMap.set(key, effectiveStyle);\n\t}\n\n\treturn effectiveStyleMap.get(key)!; // The key is guaranteed to exist\n};\n\nexport default getEffectiveStyle;\n"]}
|
|
@@ -2,7 +2,6 @@ import type UI5Element from "./UI5Element.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Updates the shadow root of a UI5Element or its static area item
|
|
4
4
|
* @param element
|
|
5
|
-
* @param forStaticArea
|
|
6
5
|
*/
|
|
7
|
-
declare const updateShadowRoot: (element: UI5Element
|
|
6
|
+
declare const updateShadowRoot: (element: UI5Element) => void;
|
|
8
7
|
export default updateShadowRoot;
|
package/dist/updateShadowRoot.js
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
1
|
import getConstructableStyle from "./theming/getConstructableStyle.js";
|
|
2
|
-
import getEffectiveStyle from "./theming/getEffectiveStyle.js";
|
|
3
|
-
import getEffectiveLinksHrefs from "./theming/getEffectiveLinksHrefs.js";
|
|
4
|
-
import { shouldUseLinks } from "./CSP.js";
|
|
5
|
-
import { isSafari } from "./Device.js";
|
|
6
2
|
/**
|
|
7
3
|
* Updates the shadow root of a UI5Element or its static area item
|
|
8
4
|
* @param element
|
|
9
|
-
* @param forStaticArea
|
|
10
5
|
*/
|
|
11
|
-
const updateShadowRoot = (element
|
|
12
|
-
let styleStrOrHrefsArr;
|
|
6
|
+
const updateShadowRoot = (element) => {
|
|
13
7
|
const ctor = element.constructor;
|
|
14
|
-
const shadowRoot =
|
|
15
|
-
|
|
16
|
-
if (forStaticArea) {
|
|
17
|
-
renderResult = element.renderStatic(); // this is checked before calling updateShadowRoot
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
renderResult = element.render(); // this is checked before calling updateShadowRoot
|
|
21
|
-
}
|
|
8
|
+
const shadowRoot = element.shadowRoot;
|
|
9
|
+
const renderResult = element.render(); // this is checked before calling updateShadowRoot
|
|
22
10
|
if (!shadowRoot) {
|
|
23
11
|
console.warn(`There is no shadow root to update`); // eslint-disable-line
|
|
24
12
|
return;
|
|
25
13
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
else if (document.adoptedStyleSheets && !isSafari()) { // Chrome
|
|
30
|
-
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor, forStaticArea);
|
|
31
|
-
}
|
|
32
|
-
else { // FF, Safari
|
|
33
|
-
styleStrOrHrefsArr = getEffectiveStyle(ctor, forStaticArea);
|
|
34
|
-
}
|
|
35
|
-
if (ctor.renderer) {
|
|
36
|
-
ctor.renderer(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
ctor.render(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
14
|
+
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);
|
|
15
|
+
ctor.renderer(renderResult, shadowRoot, { host: element });
|
|
40
16
|
};
|
|
41
17
|
export default updateShadowRoot;
|
|
42
18
|
//# sourceMappingURL=updateShadowRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAGvE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,kDAAkD;IAEzF,IAAI,CAAC,UAAU,EAAE;QAChB,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,sBAAsB;QACzE,OAAO;KACP;IAED,UAAU,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAE5D,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\tconst renderResult = element.render(); // this is checked before calling updateShadowRoot\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);\n\n\tctor.renderer(renderResult, shadowRoot, { host: element });\n};\n\nexport default updateShadowRoot;\n"]}
|
|
@@ -2,6 +2,4 @@ declare const getFocusedElement: () => HTMLElement | null;
|
|
|
2
2
|
declare const isFocusedElementWithinNode: (node: HTMLElement) => boolean;
|
|
3
3
|
declare const isClickInRect: (e: MouseEvent | TouchEvent, rect: DOMRect) => boolean;
|
|
4
4
|
declare const getClosedPopupParent: (el: HTMLElement) => HTMLElement;
|
|
5
|
-
|
|
6
|
-
declare const getCurrentZIndex: () => number;
|
|
7
|
-
export { getFocusedElement, isClickInRect, getClosedPopupParent, getNextZIndex, getCurrentZIndex, isFocusedElementWithinNode, };
|
|
5
|
+
export { getFocusedElement, isClickInRect, getClosedPopupParent, isFocusedElementWithinNode, };
|
package/dist/util/PopupUtils.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import getSharedResource from "../getSharedResource.js";
|
|
2
|
-
import { getFeature } from "../FeaturesRegistry.js";
|
|
3
1
|
import getActiveElement from "./getActiveElement.js";
|
|
4
|
-
const popupUtilsData = getSharedResource("PopupUtilsData", { currentZIndex: 100 });
|
|
5
2
|
const getFocusedElement = () => {
|
|
6
3
|
const element = getActiveElement();
|
|
7
4
|
return (element && typeof element.focus === "function") ? element : null;
|
|
@@ -59,16 +56,5 @@ const getClosedPopupParent = (el) => {
|
|
|
59
56
|
}
|
|
60
57
|
return getClosedPopupParent(parent);
|
|
61
58
|
};
|
|
62
|
-
|
|
63
|
-
const openUI5Support = getFeature("OpenUI5Support");
|
|
64
|
-
if (openUI5Support && openUI5Support.isOpenUI5Detected()) { // use OpenUI5 for getting z-index values, if loaded
|
|
65
|
-
return openUI5Support.getNextZIndex();
|
|
66
|
-
}
|
|
67
|
-
popupUtilsData.currentZIndex += 2;
|
|
68
|
-
return popupUtilsData.currentZIndex;
|
|
69
|
-
};
|
|
70
|
-
const getCurrentZIndex = () => {
|
|
71
|
-
return popupUtilsData.currentZIndex;
|
|
72
|
-
};
|
|
73
|
-
export { getFocusedElement, isClickInRect, getClosedPopupParent, getNextZIndex, getCurrentZIndex, isFocusedElementWithinNode, };
|
|
59
|
+
export { getFocusedElement, isClickInRect, getClosedPopupParent, isFocusedElementWithinNode, };
|
|
74
60
|
//# sourceMappingURL=PopupUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupUtils.js","sourceRoot":"","sources":["../../src/util/PopupUtils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PopupUtils.js","sourceRoot":"","sources":["../../src/util/PopupUtils.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAErD,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,gBAAgB,EAAiB,CAAC;IAClD,OAAO,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,GAC1B,CAAC","sourcesContent":["import getActiveElement from \"./getActiveElement.js\";\n\nconst getFocusedElement = () => {\n\tconst element = getActiveElement() as HTMLElement;\n\treturn (element && typeof element.focus === \"function\") ? element : null;\n};\n\nconst isFocusedElementWithinNode = (node: HTMLElement) => {\n\tconst fe = getFocusedElement();\n\n\tif (fe) {\n\t\treturn isNodeContainedWithin(node, fe);\n\t}\n\n\treturn false;\n};\n\nconst isNodeContainedWithin = (parent: HTMLElement, child: HTMLElement): boolean => {\n\tlet currentNode: HTMLElement | undefined = parent;\n\n\tif (currentNode.shadowRoot) {\n\t\tconst children = Array.from(currentNode.shadowRoot.children) as Array<HTMLElement>;\n\t\tcurrentNode = children.find(n => n.localName !== \"style\");\n\n\t\tif (!currentNode) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (currentNode === child) {\n\t\treturn true;\n\t}\n\n\tconst childNodes = currentNode.localName === \"slot\" ? (currentNode as HTMLSlotElement).assignedNodes() : currentNode.children;\n\n\tif (childNodes) {\n\t\treturn Array.from(childNodes).some(n => isNodeContainedWithin(n as HTMLElement, child));\n\t}\n\n\treturn false;\n};\n\nconst isPointInRect = (x: number, y: number, rect: DOMRect) => {\n\treturn x >= rect.left && x <= rect.right\n\t\t&& y >= rect.top && y <= rect.bottom;\n};\n\nconst isClickInRect = (e: MouseEvent | TouchEvent, rect: DOMRect) => {\n\tlet x;\n\tlet y;\n\n\tif (e instanceof MouseEvent) {\n\t\tx = e.clientX;\n\t\ty = e.clientY;\n\t} else {\n\t\tconst touch = e.touches[0];\n\t\tx = touch.clientX;\n\t\ty = touch.clientY;\n\t}\n\n\treturn isPointInRect(x, y, rect);\n};\n\ninterface PopupInterface { // Refactor: replace with Popup.js\n\t_show: () => void,\n\topen: boolean,\n}\nfunction instanceOfPopup(object: any): object is PopupInterface {\n\treturn \"isUI5Element\" in object && \"_show\" in object;\n}\n\nconst getClosedPopupParent = (el: HTMLElement): HTMLElement => {\n\tconst parent = el.parentElement || (el.getRootNode && (el.getRootNode() as ShadowRoot).host);\n\n\tif (parent && ((instanceOfPopup(parent) || parent === document.documentElement))) {\n\t\treturn parent as HTMLElement;\n\t}\n\n\treturn getClosedPopupParent(parent as HTMLElement);\n};\n\nexport {\n\tgetFocusedElement,\n\tisClickInRect,\n\tgetClosedPopupParent,\n\tisFocusedElementWithinNode,\n};\n"]}
|