@ui5/webcomponents-base 2.11.0-rc.3 → 2.11.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 +20 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/custom-elements-internal.json +15 -0
- package/dist/custom-elements.json +15 -0
- package/dist/features/F6Navigation.js +3 -2
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/features/F6Navigation.js +1 -1
- package/dist/prod/features/F6Navigation.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/ssr-dom-shim.js +1 -1
- package/dist/prod/ssr-dom-shim.js.map +2 -2
- package/dist/prod/util/getParentElement.js +2 -0
- package/dist/prod/util/getParentElement.js.map +7 -0
- package/dist/ssr-dom-shim.js +2 -1
- package/dist/ssr-dom-shim.js.map +1 -1
- package/dist/util/getParentElement.d.ts +2 -0
- package/dist/util/getParentElement.js +5 -0
- package/dist/util/getParentElement.js.map +1 -0
- package/package.json +3 -3
|
@@ -1671,6 +1671,21 @@
|
|
|
1671
1671
|
}
|
|
1672
1672
|
]
|
|
1673
1673
|
},
|
|
1674
|
+
{
|
|
1675
|
+
"kind": "javascript-module",
|
|
1676
|
+
"path": "dist/util/getParentElement.js",
|
|
1677
|
+
"declarations": [],
|
|
1678
|
+
"exports": [
|
|
1679
|
+
{
|
|
1680
|
+
"kind": "js",
|
|
1681
|
+
"name": "default",
|
|
1682
|
+
"declaration": {
|
|
1683
|
+
"name": "getParentElement",
|
|
1684
|
+
"module": "dist/util/getParentElement.js"
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
]
|
|
1688
|
+
},
|
|
1674
1689
|
{
|
|
1675
1690
|
"kind": "javascript-module",
|
|
1676
1691
|
"path": "dist/util/getSingletonElementInstance.js",
|
|
@@ -1386,6 +1386,21 @@
|
|
|
1386
1386
|
}
|
|
1387
1387
|
]
|
|
1388
1388
|
},
|
|
1389
|
+
{
|
|
1390
|
+
"kind": "javascript-module",
|
|
1391
|
+
"path": "dist/util/getParentElement.js",
|
|
1392
|
+
"declarations": [],
|
|
1393
|
+
"exports": [
|
|
1394
|
+
{
|
|
1395
|
+
"kind": "js",
|
|
1396
|
+
"name": "default",
|
|
1397
|
+
"declaration": {
|
|
1398
|
+
"name": "getParentElement",
|
|
1399
|
+
"module": "dist/util/getParentElement.js"
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
]
|
|
1403
|
+
},
|
|
1389
1404
|
{
|
|
1390
1405
|
"kind": "javascript-module",
|
|
1391
1406
|
"path": "dist/util/getSingletonElementInstance.js",
|
|
@@ -6,6 +6,7 @@ import getFastNavigationGroups from "../util/getFastNavigationGroups.js";
|
|
|
6
6
|
import isElementClickable from "../util/isElementClickable.js";
|
|
7
7
|
import { getCurrentRuntimeIndex, compareRuntimes } from "../Runtimes.js";
|
|
8
8
|
import getSharedResource from "../getSharedResource.js";
|
|
9
|
+
import getParentElement from "../util/getParentElement.js";
|
|
9
10
|
const currentRuntimeINdex = getCurrentRuntimeIndex();
|
|
10
11
|
const shouldUpdate = (runtimeIndex) => {
|
|
11
12
|
if (runtimeIndex === undefined) {
|
|
@@ -149,7 +150,7 @@ class F6Navigation {
|
|
|
149
150
|
if (closestScopeEl) {
|
|
150
151
|
return closestScopeEl;
|
|
151
152
|
}
|
|
152
|
-
element = element
|
|
153
|
+
element = getParentElement(element);
|
|
153
154
|
}
|
|
154
155
|
return document.body;
|
|
155
156
|
}
|
|
@@ -157,7 +158,7 @@ class F6Navigation {
|
|
|
157
158
|
const htmlElement = window.document.querySelector("html");
|
|
158
159
|
let element = this.deepActive(root);
|
|
159
160
|
while (element && element.getAttribute("data-sap-ui-fastnavgroup") !== "true" && element !== htmlElement) {
|
|
160
|
-
element = element
|
|
161
|
+
element = getParentElement(element);
|
|
161
162
|
}
|
|
162
163
|
this.selectedGroup = element;
|
|
163
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAOxD,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;AAErD,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,eAAe,CAAC,mBAAmB,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,2FAA2F;AAC7J,CAAC,CAAC;AAEF,MAAM,YAAY;IAKjB;QAHA,kBAAa,GAAuB,IAAI,CAAC;QACzC,WAAM,GAAuB,EAAE,CAAC;QAG/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAmC,CAAC;QACxF,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,oBAAoB;QACnB,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3D,CAAC;IAED,oBAAoB;QACnB,QAAQ,CAAC,mBAAmB,C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../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tlet nextElementDomRef = nextElement;\n\n\t\tif (instanceOfUI5Element(nextElement)) {\n\t\t\tnextElementDomRef = nextElement.getDomRef() || nextElement.firstElementChild as HTMLElement;\n\t\t}\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = element.parentElement ? element.parentElement : (element.parentNode as ShadowRoot).host;\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null | ParentNode = this.deepActive(root);\n\n\t\twhile (element && (element as Element).getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = element.parentElement ? element.parentNode : (element.parentNode as ShadowRoot).host;\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
|
|
1
|
+
{"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAA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a,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,gBAAgB;QACnB,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,IAAI;QACV,MAAM,UAAU,GAAG,iBAAiB,CAAa,YAAY,EAAE,EAAE,CAAC,CAAC;QAEnE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC1B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;aAAM,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,CAAC;YAChE,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;YAC/B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tlet nextElementDomRef = nextElement;\n\n\t\tif (instanceOfUI5Element(nextElement)) {\n\t\t\tnextElementDomRef = nextElement.getDomRef() || nextElement.firstElementChild as HTMLElement;\n\t\t}\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "2.11.0
|
|
2
|
+
version: "2.11.0",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 11,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "
|
|
6
|
+
suffix: "",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1749117967,
|
|
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.11.0\",\n\tmajor: 2,\n\tminor: 11,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1749117967,\n};\nexport default VersionInfo;"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{getFeature as
|
|
1
|
+
"use strict";import{getFeature as m,registerFeature as c}from"../FeaturesRegistry.js";import{isF6Next as d,isF6Previous as h}from"../Keys.js";import{instanceOfUI5Element as f}from"../UI5Element.js";import{getFirstFocusableElement as g}from"../util/FocusableElements.js";import E from"../util/getFastNavigationGroups.js";import w from"../util/isElementClickable.js";import{getCurrentRuntimeIndex as v,compareRuntimes as y}from"../Runtimes.js";import F from"../getSharedResource.js";import a from"../util/getParentElement.js";const p=v(),b=l=>l===void 0?!0:y(p,l)===1;class n{constructor(){this.selectedGroup=null;this.groups=[];this.keydownHandler=this._keydownHandler.bind(this),this.attachEventListeners()}attachEventListeners(){document.addEventListener("keydown",this.keydownHandler)}removeEventListeners(){document.removeEventListener("keydown",this.keydownHandler)}async groupElementToFocus(e){let t=e;if(f(e)&&(t=e.getDomRef()||e.firstElementChild),t){if(w(t))return t;const o=await g(t);if(o)return o}}async findNextFocusableGroupElement(e){let t;for(let o=0;o<this.groups.length;o++){let s;if(e>-1?e+1>=this.groups.length?(e=0,s=this.groups[e]):(e+=1,s=this.groups[e]):(e=0,s=this.groups[e]),t=await this.groupElementToFocus(s),t)break}return t}async findPreviousFocusableGroupElement(e){let t;for(let o=0;o<this.groups.length;o++){let s;if(e>0?(e=await this.groupElementToFocus(this.groups[e-1])===await this.groupElementToFocus(this.groups[e])?e-2:e-1,e<0&&(e=this.groups.length-1),s=this.groups[e]):(e=this.groups.length-1,s=this.groups[e]),t=await this.groupElementToFocus(s),t)break}return t}async _keydownHandler(e){const t=m("OpenUI5Support");if(t&&t.isOpenUI5Detected()){this.destroy();return}const s=d(e),r=h(e);if(!(s||r)||(this.updateGroups(),this.groups.length<1))return;e.preventDefault();let i;if(this.groups.length===0)return i=await this.groupElementToFocus(this.groups[0]),i?.focus();let u=-1;this.selectedGroup&&(u=this.groups.indexOf(this.selectedGroup)),s&&(i=await this.findNextFocusableGroupElement(u)),r&&(i=await this.findPreviousFocusableGroupElement(u)),i?.focus()}updateGroups(){const e=this.findContainer();this.setSelectedGroup(),this.groups=E(e)}findContainer(){const e=window.document.querySelector("html");let t=this.deepActive(window.document);for(;t&&t!==e;){const o=t.closest("[data-sap-ui-fastnavgroup-container='true']");if(o)return o;t=a(t)}return document.body}setSelectedGroup(e=window.document){const t=window.document.querySelector("html");let o=this.deepActive(e);for(;o&&o.getAttribute("data-sap-ui-fastnavgroup")!=="true"&&o!==t;)o=a(o);this.selectedGroup=o}deepActive(e){return e?.activeElement?.shadowRoot?.activeElement?this.deepActive(e.activeElement.shadowRoot):e.activeElement}destroy(){this.removeEventListeners()}get _ui5RuntimeIndex(){return p}static init(){const e=F("F6Registry",{});e.instance?b(e.instance?._ui5RuntimeIndex)&&(e.instance?.destroy(),e.instance=new n):e.instance=new n}}c("F6Navigation",n);export default n;
|
|
2
2
|
//# sourceMappingURL=F6Navigation.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/features/F6Navigation.ts"],
|
|
4
|
-
"sourcesContent": ["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tlet nextElementDomRef = nextElement;\n\n\t\tif (instanceOfUI5Element(nextElement)) {\n\t\t\tnextElementDomRef = nextElement.getDomRef() || nextElement.firstElementChild as HTMLElement;\n\t\t}\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement =
|
|
5
|
-
"mappings": "aAAA,OAAS,cAAAA,EAAY,mBAAAC,MAAuB,yBAC5C,OAAS,YAAAC,EAAU,gBAAAC,MAAoB,aACvC,OAAS,wBAAAC,MAA4B,mBACrC,OAAS,4BAAAC,MAAgC,+BACzC,OAAOC,MAA6B,qCACpC,OAAOC,MAAwB,gCAC/B,OAAS,0BAAAC,EAAwB,mBAAAC,MAAuB,iBACxD,OAAOC,MAAuB,
|
|
6
|
-
"names": ["getFeature", "registerFeature", "isF6Next", "isF6Previous", "instanceOfUI5Element", "getFirstFocusableElement", "getFastNavigationGroups", "isElementClickable", "getCurrentRuntimeIndex", "compareRuntimes", "getSharedResource", "currentRuntimeINdex", "shouldUpdate", "runtimeIndex", "F6Navigation", "nextElement", "nextElementDomRef", "elementToFocus", "currentIndex", "index", "event", "openUI5Support", "forward", "backward", "container", "htmlElement", "element", "closestScopeEl", "root", "f6Registry"]
|
|
4
|
+
"sourcesContent": ["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tlet nextElementDomRef = nextElement;\n\n\t\tif (instanceOfUI5Element(nextElement)) {\n\t\t\tnextElementDomRef = nextElement.getDomRef() || nextElement.firstElementChild as HTMLElement;\n\t\t}\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,cAAAA,EAAY,mBAAAC,MAAuB,yBAC5C,OAAS,YAAAC,EAAU,gBAAAC,MAAoB,aACvC,OAAS,wBAAAC,MAA4B,mBACrC,OAAS,4BAAAC,MAAgC,+BACzC,OAAOC,MAA6B,qCACpC,OAAOC,MAAwB,gCAC/B,OAAS,0BAAAC,EAAwB,mBAAAC,MAAuB,iBACxD,OAAOC,MAAuB,0BAE9B,OAAOC,MAAsB,8BAM7B,MAAMC,EAAsBJ,EAAuB,EAE7CK,EAAgBC,GACjBA,IAAiB,OACb,GAEDL,EAAgBG,EAAqBE,CAAY,IAAM,EAG/D,MAAMC,CAAa,CAKlB,aAAc,CAHd,mBAAoC,KACpC,YAA6B,CAAC,EAG7B,KAAK,eAAiB,KAAK,gBAAgB,KAAK,IAAI,EACpD,KAAK,qBAAqB,CAC3B,CAEA,sBAAuB,CACtB,SAAS,iBAAiB,UAAW,KAAK,cAAc,CACzD,CAEA,sBAAuB,CACtB,SAAS,oBAAoB,UAAW,KAAK,cAAc,CAC5D,CAEA,MAAM,oBAAoBC,EAA0B,CACnD,IAAIC,EAAoBD,EAMxB,GAJIZ,EAAqBY,CAAW,IACnCC,EAAoBD,EAA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AI,kBAAmB,CACtB,OAAOjB,CACR,CAEA,OAAO,MAAO,CACb,MAAMkB,EAAapB,EAA8B,aAAc,CAAC,CAAC,EAE5DoB,EAAW,SAELjB,EAAaiB,EAAW,UAAU,gBAAgB,IAC5DA,EAAW,UAAU,QAAQ,EAC7BA,EAAW,SAAW,IAAIf,GAH1Be,EAAW,SAAW,IAAIf,CAK5B,CACD,CAEAd,EAAgB,eAAgBc,CAAY,EAE5C,eAAeA",
|
|
6
|
+
"names": ["getFeature", "registerFeature", "isF6Next", "isF6Previous", "instanceOfUI5Element", "getFirstFocusableElement", "getFastNavigationGroups", "isElementClickable", "getCurrentRuntimeIndex", "compareRuntimes", "getSharedResource", "getParentElement", "currentRuntimeINdex", "shouldUpdate", "runtimeIndex", "F6Navigation", "nextElement", "nextElementDomRef", "elementToFocus", "currentIndex", "index", "event", "openUI5Support", "forward", "backward", "container", "htmlElement", "element", "closestScopeEl", "root", "f6Registry"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e={version:"2.11.0
|
|
1
|
+
"use strict";const e={version:"2.11.0",major:2,minor:11,patch:0,suffix:"",isNext:!1,buildTime:1749117967};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.11.0
|
|
5
|
-
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,
|
|
4
|
+
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.11.0\",\n\tmajor: 2,\n\tminor: 11,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1749117967,\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";import{HTMLElement as o,Element as s,customElements as l,ElementInternals as i}from"@lit-labs/ssr-dom-shim";globalThis.HTMLElement??=o,globalThis.Element??=s,globalThis.customElements??=l;class n{}globalThis.Node??=n;class r{}globalThis.FileList??=r;const t=new WeakMap;globalThis.Document&&!("adoptedStyleSheets"in Document.prototype)&&Object.defineProperty(Document.prototype,"adoptedStyleSheets",{get(){return t.get(this)||[]},set(e){t.set(this,e)}}),globalThis.ShadowRoot&&!("adoptedStyleSheets"in ShadowRoot.prototype)&&Object.defineProperty(ShadowRoot.prototype,"adoptedStyleSheets",{get(){return t.get(this)||[]},set(e){t.set(this,e)}}),globalThis.CSSStyleSheet&&!("replaceSync"in CSSStyleSheet.prototype)&&Object.defineProperty(CSSStyleSheet.prototype,"replaceSync",{value(e){return this.cssText=e,e}}),globalThis.ResizeObserver=class{observe(){}unobserve(){}disconnect(){}},globalThis.HTMLElement.prototype.showPopover=function(){},globalThis.HTMLElement.prototype.attachInternals=function(){return new i};
|
|
1
|
+
"use strict";import{HTMLElement as o,Element as s,customElements as l,ElementInternals as i}from"@lit-labs/ssr-dom-shim";globalThis.HTMLElement??=o,globalThis.Element??=s,globalThis.customElements??=l;class n{}globalThis.Node??=n;class r{}globalThis.FileList??=r;const t=new WeakMap;globalThis.Document&&!("adoptedStyleSheets"in Document.prototype)&&Object.defineProperty(Document.prototype,"adoptedStyleSheets",{get(){return t.get(this)||[]},set(e){t.set(this,e)}}),globalThis.ShadowRoot&&!("adoptedStyleSheets"in ShadowRoot.prototype)&&Object.defineProperty(ShadowRoot.prototype,"adoptedStyleSheets",{get(){return t.get(this)||[]},set(e){t.set(this,e)}}),globalThis.CSSStyleSheet&&!("replaceSync"in CSSStyleSheet.prototype)&&Object.defineProperty(CSSStyleSheet.prototype,"replaceSync",{value(e){return this.cssText=e,e}}),globalThis.ResizeObserver=class{observe(){}unobserve(){}disconnect(){}},globalThis.HTMLElement.prototype.showPopover=function(){},globalThis.HTMLElement.prototype.hidePopover=function(){},globalThis.HTMLElement.prototype.attachInternals=function(){return new i};
|
|
2
2
|
//# sourceMappingURL=ssr-dom-shim.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ssr-dom-shim.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-classes-per-file */\nimport { HTMLElement, Element, customElements, ElementInternals } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement ??= HTMLElement;\nglobalThis.Element ??= Element;\nglobalThis.customElements ??= customElements;\n\nclass NodeShim {}\nglobalThis.Node ??= NodeShim as object as typeof Node;\n\nclass FileListShim {}\nglobalThis.FileList ??= FileListShim as object as typeof FileList;\n\n// ------- JS DOM shims -------\n\n// Polyfill `adoptedStyleSheets` globally for both `Document` and `ShadowRoot`\nconst adoptedSheetsStore = new WeakMap();\n\nif (globalThis.Document && !(\"adoptedStyleSheets\" in Document.prototype)) {\n Object.defineProperty(Document.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\nif (globalThis.ShadowRoot && !(\"adoptedStyleSheets\" in ShadowRoot.prototype)) {\n Object.defineProperty(ShadowRoot.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\n// Polyfill CSSStyleSheet to provide `replaceSync`\nif (globalThis.CSSStyleSheet && !(\"replaceSync\" in CSSStyleSheet.prototype)) {\n Object.defineProperty(CSSStyleSheet.prototype, \"replaceSync\", {\n value(cssText: string) {\n this.cssText = cssText;\n return cssText;\n },\n });\n }\n\n// Empty resize observer\nglobalThis.ResizeObserver = class ResizeObserver {\n observe() {\n // do nothing\n }\n unobserve() {\n // do nothing\n }\n disconnect() {\n // do nothing\n }\n};\n\n// empty showPopover method\nglobalThis.HTMLElement.prototype.showPopover = function () {};\n\n// ElementInternals\nglobalThis.HTMLElement.prototype.attachInternals = function() {\n return new ElementInternals();\n}"],
|
|
5
|
-
"mappings": "aACA,OAAS,eAAAA,EAAa,WAAAC,EAAS,kBAAAC,EAAgB,oBAAAC,MAAwB,yBAEvE,WAAW,cAAgBH,EAC3B,WAAW,UAAYC,EACvB,WAAW,iBAAmBC,EAE9B,MAAME,CAAS,CAAC,CAChB,WAAW,OAASA,EAEpB,MAAMC,CAAa,CAAC,CACpB,WAAW,WAAaA,EAKxB,MAAMC,EAAqB,IAAI,QAE3B,WAAW,UAAY,EAAE,uBAAwB,SAAS,YAC5D,OAAO,eAAe,SAAS,UAAW,qBAAsB,CAC9D,KAAM,CACJ,OAAOA,EAAmB,IAAI,IAAI,GAAK,CAAC,CAC1C,EACA,IAAIC,EAAyB,CAC3BD,EAAmB,IAAI,KAAMC,CAAM,CACrC,CACF,CAAC,EAGC,WAAW,YAAc,EAAE,uBAAwB,WAAW,YAChE,OAAO,eAAe,WAAW,UAAW,qBAAsB,CAChE,KAAM,CACJ,OAAOD,EAAmB,IAAI,IAAI,GAAK,CAAC,CAC1C,EACA,IAAIC,EAAyB,CAC3BD,EAAmB,IAAI,KAAMC,CAAM,CACrC,CACF,CAAC,EAIC,WAAW,eAAiB,EAAE,gBAAiB,cAAc,YAC7D,OAAO,eAAe,cAAc,UAAW,cAAe,CAC5D,MAAMC,EAAiB,CACrB,YAAK,QAAUA,EACRA,CACT,CACF,CAAC,EAIL,WAAW,eAAiB,KAAqB,CAC7C,SAAU,CAEV,CACA,WAAY,CAEZ,CACA,YAAa,CAEb,CACJ,EAGA,WAAW,YAAY,UAAU,YAAc,UAAY,CAAC,EAG5D,WAAW,YAAY,UAAU,gBAAkB,UAAW,CAC1D,OAAO,IAAIL,CACf",
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-classes-per-file */\nimport { HTMLElement, Element, customElements, ElementInternals } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement ??= HTMLElement;\nglobalThis.Element ??= Element;\nglobalThis.customElements ??= customElements;\n\nclass NodeShim {}\nglobalThis.Node ??= NodeShim as object as typeof Node;\n\nclass FileListShim {}\nglobalThis.FileList ??= FileListShim as object as typeof FileList;\n\n// ------- JS DOM shims -------\n\n// Polyfill `adoptedStyleSheets` globally for both `Document` and `ShadowRoot`\nconst adoptedSheetsStore = new WeakMap();\n\nif (globalThis.Document && !(\"adoptedStyleSheets\" in Document.prototype)) {\n Object.defineProperty(Document.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\nif (globalThis.ShadowRoot && !(\"adoptedStyleSheets\" in ShadowRoot.prototype)) {\n Object.defineProperty(ShadowRoot.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\n// Polyfill CSSStyleSheet to provide `replaceSync`\nif (globalThis.CSSStyleSheet && !(\"replaceSync\" in CSSStyleSheet.prototype)) {\n Object.defineProperty(CSSStyleSheet.prototype, \"replaceSync\", {\n value(cssText: string) {\n this.cssText = cssText;\n return cssText;\n },\n });\n }\n\n// Empty resize observer\nglobalThis.ResizeObserver = class ResizeObserver {\n observe() {\n // do nothing\n }\n unobserve() {\n // do nothing\n }\n disconnect() {\n // do nothing\n }\n};\n\n// empty showPopover & hidePopover method\nglobalThis.HTMLElement.prototype.showPopover = function () {};\nglobalThis.HTMLElement.prototype.hidePopover = function () {};\n\n// ElementInternals\nglobalThis.HTMLElement.prototype.attachInternals = function() {\n return new ElementInternals();\n}"],
|
|
5
|
+
"mappings": "aACA,OAAS,eAAAA,EAAa,WAAAC,EAAS,kBAAAC,EAAgB,oBAAAC,MAAwB,yBAEvE,WAAW,cAAgBH,EAC3B,WAAW,UAAYC,EACvB,WAAW,iBAAmBC,EAE9B,MAAME,CAAS,CAAC,CAChB,WAAW,OAASA,EAEpB,MAAMC,CAAa,CAAC,CACpB,WAAW,WAAaA,EAKxB,MAAMC,EAAqB,IAAI,QAE3B,WAAW,UAAY,EAAE,uBAAwB,SAAS,YAC5D,OAAO,eAAe,SAAS,UAAW,qBAAsB,CAC9D,KAAM,CACJ,OAAOA,EAAmB,IAAI,IAAI,GAAK,CAAC,CAC1C,EACA,IAAIC,EAAyB,CAC3BD,EAAmB,IAAI,KAAMC,CAAM,CACrC,CACF,CAAC,EAGC,WAAW,YAAc,EAAE,uBAAwB,WAAW,YAChE,OAAO,eAAe,WAAW,UAAW,qBAAsB,CAChE,KAAM,CACJ,OAAOD,EAAmB,IAAI,IAAI,GAAK,CAAC,CAC1C,EACA,IAAIC,EAAyB,CAC3BD,EAAmB,IAAI,KAAMC,CAAM,CACrC,CACF,CAAC,EAIC,WAAW,eAAiB,EAAE,gBAAiB,cAAc,YAC7D,OAAO,eAAe,cAAc,UAAW,cAAe,CAC5D,MAAMC,EAAiB,CACrB,YAAK,QAAUA,EACRA,CACT,CACF,CAAC,EAIL,WAAW,eAAiB,KAAqB,CAC7C,SAAU,CAEV,CACA,WAAY,CAEZ,CACA,YAAa,CAEb,CACJ,EAGA,WAAW,YAAY,UAAU,YAAc,UAAY,CAAC,EAC5D,WAAW,YAAY,UAAU,YAAc,UAAY,CAAC,EAG5D,WAAW,YAAY,UAAU,gBAAkB,UAAW,CAC1D,OAAO,IAAIL,CACf",
|
|
6
6
|
"names": ["HTMLElement", "Element", "customElements", "ElementInternals", "NodeShim", "FileListShim", "adoptedSheetsStore", "sheets", "cssText"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/getParentElement.ts"],
|
|
4
|
+
"sourcesContent": ["const getParentElement = (element: Element) : Element | null => {\n\treturn element.parentElement ? element.parentElement : (element.parentNode as ShadowRoot).host;\n};\n\nexport default getParentElement;\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAoBC,GAClBA,EAAQ,cAAgBA,EAAQ,cAAiBA,EAAQ,WAA0B,KAG3F,eAAeD",
|
|
6
|
+
"names": ["getParentElement", "element"]
|
|
7
|
+
}
|
package/dist/ssr-dom-shim.js
CHANGED
|
@@ -53,8 +53,9 @@ globalThis.ResizeObserver = class ResizeObserver {
|
|
|
53
53
|
// do nothing
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
// empty showPopover method
|
|
56
|
+
// empty showPopover & hidePopover method
|
|
57
57
|
globalThis.HTMLElement.prototype.showPopover = function () { };
|
|
58
|
+
globalThis.HTMLElement.prototype.hidePopover = function () { };
|
|
58
59
|
// ElementInternals
|
|
59
60
|
globalThis.HTMLElement.prototype.attachInternals = function () {
|
|
60
61
|
return new ElementInternals();
|
package/dist/ssr-dom-shim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-dom-shim.js","sourceRoot":"","sources":["../src/ssr-dom-shim.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC;AACvC,UAAU,CAAC,OAAO,KAAK,OAAO,CAAC;AAC/B,UAAU,CAAC,cAAc,KAAK,cAAc,CAAC;AAE7C,MAAM,QAAQ;CAAG;AACjB,UAAU,CAAC,IAAI,KAAK,QAAiC,CAAC;AAEtD,MAAM,YAAY;CAAG;AACrB,UAAU,CAAC,QAAQ,KAAK,YAAyC,CAAC;AAElE,+BAA+B;AAE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GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,kDAAkD;AAClD,IAAI,UAAU,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,aAAa,EAAE;QAC5D,KAAK,CAAC,OAAe;YACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAEH,wBAAwB;AACxB,UAAU,CAAC,cAAc,GAAG,MAAM,cAAc;IAC5C,OAAO;QACL,aAAa;IACf,CAAC;IACD,SAAS;QACP,aAAa;IACf,CAAC;IACD,UAAU;QACR,aAAa;IACf,CAAC;CACJ,CAAC;AAEF,yCAAyC;AACzC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,cAAa,CAAC,CAAC;AAC9D,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,cAAa,CAAC,CAAC;AAE9D,oBAAoB;AACpB,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,eAAe,GAAG;IAC/C,OAAO,IAAI,gBAAgB,EAAE,CAAC;AAClC,CAAC,CAAA","sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { HTMLElement, Element, customElements, ElementInternals } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement ??= HTMLElement;\nglobalThis.Element ??= Element;\nglobalThis.customElements ??= customElements;\n\nclass NodeShim {}\nglobalThis.Node ??= NodeShim as object as typeof Node;\n\nclass FileListShim {}\nglobalThis.FileList ??= FileListShim as object as typeof FileList;\n\n// ------- JS DOM shims -------\n\n// Polyfill `adoptedStyleSheets` globally for both `Document` and `ShadowRoot`\nconst adoptedSheetsStore = new WeakMap();\n\nif (globalThis.Document && !(\"adoptedStyleSheets\" in Document.prototype)) {\n Object.defineProperty(Document.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\nif (globalThis.ShadowRoot && !(\"adoptedStyleSheets\" in ShadowRoot.prototype)) {\n Object.defineProperty(ShadowRoot.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\n// Polyfill CSSStyleSheet to provide `replaceSync`\nif (globalThis.CSSStyleSheet && !(\"replaceSync\" in CSSStyleSheet.prototype)) {\n Object.defineProperty(CSSStyleSheet.prototype, \"replaceSync\", {\n value(cssText: string) {\n this.cssText = cssText;\n return cssText;\n },\n });\n }\n\n// Empty resize observer\nglobalThis.ResizeObserver = class ResizeObserver {\n observe() {\n // do nothing\n }\n unobserve() {\n // do nothing\n }\n disconnect() {\n // do nothing\n }\n};\n\n// empty showPopover & hidePopover method\nglobalThis.HTMLElement.prototype.showPopover = function () {};\nglobalThis.HTMLElement.prototype.hidePopover = function () {};\n\n// ElementInternals\nglobalThis.HTMLElement.prototype.attachInternals = function() {\n return new ElementInternals();\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getParentElement.js","sourceRoot":"","sources":["../../src/util/getParentElement.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,CAAC,OAAgB,EAAmB,EAAE;IAC9D,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAE,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;AAChG,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["const getParentElement = (element: Element) : Element | null => {\n\treturn element.parentElement ? element.parentElement : (element.parentNode as ShadowRoot).host;\n};\n\nexport default getParentElement;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "2.11.0
|
|
3
|
+
"version": "2.11.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.11.0
|
|
65
|
+
"@ui5/webcomponents-tools": "2.11.0",
|
|
66
66
|
"chromedriver": "^135.0.0",
|
|
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": "a768710e9fa722b88e495e9aea1964764af5b985"
|
|
77
77
|
}
|