@ui5/webcomponents-base 2.0.0-rc.5 → 2.0.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 +39 -0
- package/README.md +1 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/Boot.js.map +1 -1
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/InitialConfiguration.d.ts +1 -1
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/ManagedStyles.d.ts +1 -1
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/Render.js.map +1 -1
- package/dist/UI5Element.d.ts +11 -9
- package/dist/UI5Element.js +115 -109
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +6 -15
- package/dist/UI5ElementMetadata.js +3 -71
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.d.ts +1 -1
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/connectToComponent.js.map +1 -1
- package/dist/converters/DOMReference.d.ts +5 -0
- package/dist/converters/DOMReference.js +13 -0
- package/dist/converters/DOMReference.js.map +1 -0
- package/dist/custom-elements-internal.json +15 -275
- package/dist/custom-elements.json +15 -269
- package/dist/decorators/property.d.ts +1 -1
- package/dist/decorators/property.js +1 -1
- package/dist/decorators/property.js.map +1 -1
- package/dist/decorators/slot.d.ts +1 -1
- package/dist/decorators/slot.js.map +1 -1
- package/dist/delegate/ItemNavigation.d.ts +1 -1
- package/dist/delegate/ItemNavigation.js.map +1 -1
- package/dist/features/F6Navigation.js +1 -1
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +1 -1
- package/dist/features/InputElementsFormSupport.js.map +1 -1
- package/dist/features/OpenUI5Enablement.d.ts +1 -1
- package/dist/features/OpenUI5Enablement.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +1 -1
- package/dist/features/OpenUI5Support.js +3 -0
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPopup.d.ts +1 -0
- package/dist/features/patchPopup.js +11 -0
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +1 -1
- package/dist/prod/CustomElementsRegistry.js +2 -2
- package/dist/prod/CustomElementsRegistry.js.map +1 -1
- package/dist/prod/InitialConfiguration.js.map +1 -1
- package/dist/prod/ManagedStyles.js +1 -1
- package/dist/prod/ManagedStyles.js.map +1 -1
- package/dist/prod/Render.js +1 -1
- package/dist/prod/Render.js.map +1 -1
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +3 -3
- package/dist/prod/UI5ElementMetadata.js +1 -1
- package/dist/prod/UI5ElementMetadata.js.map +3 -3
- package/dist/prod/asset-registries/Icons.js +1 -1
- package/dist/prod/asset-registries/Icons.js.map +2 -2
- package/dist/prod/connectToComponent.js +1 -1
- package/dist/prod/connectToComponent.js.map +1 -1
- package/dist/prod/converters/DOMReference.js +2 -0
- package/dist/prod/converters/DOMReference.js.map +7 -0
- package/dist/prod/decorators/property.js +1 -1
- package/dist/prod/decorators/property.js.map +2 -2
- package/dist/prod/decorators/slot.js +1 -1
- package/dist/prod/decorators/slot.js.map +1 -1
- package/dist/prod/delegate/ItemNavigation.js.map +1 -1
- package/dist/prod/features/F6Navigation.js +1 -1
- package/dist/prod/features/F6Navigation.js.map +2 -2
- package/dist/prod/features/InputElementsFormSupport.js.map +1 -1
- package/dist/prod/features/OpenUI5Enablement.js.map +1 -1
- package/dist/prod/features/OpenUI5Support.js +1 -1
- package/dist/prod/features/OpenUI5Support.js.map +2 -2
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/renderer/LitRenderer.js +1 -1
- package/dist/prod/renderer/LitRenderer.js.map +2 -2
- package/dist/prod/theming/getConstructableStyle.js +1 -1
- package/dist/prod/theming/getConstructableStyle.js.map +1 -1
- package/dist/prod/theming/getEffectiveStyle.js +1 -1
- package/dist/prod/theming/getEffectiveStyle.js.map +1 -1
- package/dist/prod/util/AriaLabelHelper.js +1 -1
- package/dist/prod/util/AriaLabelHelper.js.map +2 -2
- package/dist/prod/util/TabbableElements.js +1 -1
- package/dist/prod/util/TabbableElements.js.map +3 -3
- package/dist/prod/util/debounce.js +1 -1
- package/dist/prod/util/debounce.js.map +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +2 -2
- package/dist/prod/util/isElementTabbable.js +1 -1
- package/dist/prod/util/isElementTabbable.js.map +3 -3
- package/dist/renderer/LitRenderer.d.ts +1 -1
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/theming/getConstructableStyle.d.ts +1 -1
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/util/AriaLabelHelper.d.ts +1 -1
- package/dist/util/AriaLabelHelper.js.map +1 -1
- package/dist/util/TabbableElements.js +3 -10
- package/dist/util/TabbableElements.js.map +1 -1
- package/dist/util/debounce.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.js +0 -2
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +5 -2
- package/dist/util/isElementTabbable.js +2 -2
- package/dist/util/isElementTabbable.js.map +1 -1
- package/package.json +3 -3
- package/dist/prod/types/CSSColor.js +0 -2
- package/dist/prod/types/CSSColor.js.map +0 -7
- package/dist/prod/types/CSSSize.js +0 -2
- package/dist/prod/types/CSSSize.js.map +0 -7
- package/dist/prod/types/DOMReference.js +0 -2
- package/dist/prod/types/DOMReference.js.map +0 -7
- package/dist/prod/types/DataType.js +0 -2
- package/dist/prod/types/DataType.js.map +0 -7
- package/dist/prod/types/Float.js +0 -2
- package/dist/prod/types/Float.js.map +0 -7
- package/dist/prod/types/Integer.js +0 -2
- package/dist/prod/types/Integer.js.map +0 -7
- package/dist/types/CSSColor.d.ts +0 -11
- package/dist/types/CSSColor.js +0 -14
- package/dist/types/CSSColor.js.map +0 -1
- package/dist/types/CSSSize.d.ts +0 -11
- package/dist/types/CSSSize.js +0 -14
- package/dist/types/CSSSize.js.map +0 -1
- package/dist/types/DOMReference.d.ts +0 -13
- package/dist/types/DOMReference.js +0 -21
- package/dist/types/DOMReference.js.map +0 -1
- package/dist/types/DataType.d.ts +0 -20
- package/dist/types/DataType.js +0 -39
- package/dist/types/DataType.js.map +0 -1
- package/dist/types/Float.d.ts +0 -14
- package/dist/types/Float.js +0 -18
- package/dist/types/Float.js.map +0 -1
- package/dist/types/Integer.d.ts +0 -14
- package/dist/types/Integer.js +0 -18
- package/dist/types/Integer.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";let t=null,n=!1;const r=new Set,
|
|
1
|
+
"use strict";let t=null,n=!1;const r=new Set,d=new Set,a=e=>{!e.dataTransfer||!(e.target instanceof HTMLElement)||d.has(e.target)||(t=e.target)},o=()=>{t=null},l=()=>{t=null},s=e=>{t=e},g=()=>t,c=()=>{n||(document.body.addEventListener("dragstart",a),document.body.addEventListener("dragend",o),document.body.addEventListener("drop",l))},m=()=>{document.body.removeEventListener("dragstart",a),document.body.removeEventListener("dragend",o),document.body.removeEventListener("drop",l),n=!1},E=e=>{r.add(e),n||c()},u=e=>{r.delete(e),r.size===0&&n&&m()},i=e=>(d.add(e),s),b=e=>{d.delete(e)},f={subscribe:E,unsubscribe:u,addSelfManagedArea:i,removeSelfManagedArea:b,getDraggedElement:g};export default f;
|
|
2
2
|
//# sourceMappingURL=DragRegistry.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/util/dragAndDrop/DragRegistry.ts"],
|
|
4
|
-
"sourcesContent": ["import type UI5Element from \"../../UI5Element.js\";\n\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\
|
|
5
|
-
"mappings": "aAEA,IAAIA,EAAqC,KACrCC,EAAyB,GAC7B,MAAMC,EAAc,IAAI,IAClBC,EAAuB,IAAI,IAE3BC,EAAe,GAAiB,CACjC,CAAC,EAAE,cAAgB,EAAE,EAAE,kBAAkB,
|
|
4
|
+
"sourcesContent": ["import type UI5Element from \"../../UI5Element.js\";\n\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\n};\n\nconst DragRegistry = {\n\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n};\n\nexport default DragRegistry;\nexport type {\n\tSetDraggedElementFunction,\n};\n"],
|
|
5
|
+
"mappings": "aAEA,IAAIA,EAAqC,KACrCC,EAAyB,GAC7B,MAAMC,EAAc,IAAI,IAClBC,EAAuB,IAAI,IAE3BC,EAAe,GAAiB,CACjC,CAAC,EAAE,cAAgB,EAAE,EAAE,kBAAkB,cAIxCD,EAAqB,IAAI,EAAE,MAAM,IACrCH,EAAiB,EAAE,OAErB,EAEMK,EAAY,IAAM,CACvBL,EAAiB,IAClB,EAEMM,EAAS,IAAM,CACpBN,EAAiB,IAClB,EAEMO,EAAqBC,GAAgC,CAC1DR,EAAiBQ,CAClB,EAGMC,EAAoB,IAClBT,EAGFU,EAAuB,IAAM,CAC9BT,IAIJ,SAAS,KAAK,iBAAiB,YAAaG,CAAW,EACvD,SAAS,KAAK,iBAAiB,UAAWC,CAAS,EACnD,SAAS,KAAK,iBAAiB,OAAQC,CAAM,EAC9C,EAEMK,EAAuB,IAAM,CAClC,SAAS,KAAK,oBAAoB,YAAaP,CAAW,EAC1D,SAAS,KAAK,oBAAoB,UAAWC,CAAS,EACtD,SAAS,KAAK,oBAAoB,OAAQC,CAAM,EAChDL,EAAyB,EAC1B,EAEMW,EAAaC,GAA2B,CAC7CX,EAAY,IAAIW,CAAU,EAErBZ,GACJS,EAAqB,CAEvB,EAEMI,EAAeD,GAA2B,CAC/CX,EAAY,OAAOW,CAAU,EAEzBX,EAAY,OAAS,GAAKD,GAC7BU,EAAqB,CAEvB,EAEMI,EAAsBC,IAC3Bb,EAAqB,IAAIa,CAAI,EAEtBT,GAGFU,EAAyBD,GAAmC,CACjEb,EAAqB,OAAOa,CAAI,CACjC,EAEME,EAAe,CACpB,UAAAN,EACA,YAAAE,EACA,mBAAAC,EACA,sBAAAE,EACA,kBAAAR,CACD,EAEA,eAAeS",
|
|
6
6
|
"names": ["draggedElement", "globalHandlersAttached", "subscribers", "selfManagedDragAreas", "ondragstart", "ondragend", "ondrop", "setDraggedElement", "element", "getDraggedElement", "attachGlobalHandlers", "detachGlobalHandlers", "subscribe", "subscriber", "unsubscribe", "addSelfManagedArea", "area", "removeSelfManagedArea", "DragRegistry"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import a from"./isElementHidden.js";const r=e=>{if(!e
|
|
1
|
+
"use strict";import a from"./isElementHidden.js";const r=e=>{if(!e||e.hasAttribute("data-sap-no-tab-ref")||a(e))return!1;const t=e.getAttribute("tabindex");if(t!=null)return parseInt(t)>=0;const n=e.nodeName.toLowerCase();return n==="a"||/^(input|select|textarea|button|object)$/.test(n)?!e.disabled:!1};export default r;
|
|
2
2
|
//# sourceMappingURL=isElementTabbable.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/isElementTabbable.ts"],
|
|
4
|
-
"sourcesContent": ["import isElementHidden from \"./isElementHidden.js\";\n\n/**\n * Returns if the HTMLElement is tabbable.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { boolean } true if the element is tabbable or false - if not\n */\nconst isElementTabbable = (el: HTMLElement): boolean => {\n\tif (!el) {\n\t\treturn false;\n\t}\n\n\
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAqB,uBAS5B,MAAMC,EAAqBC,GAA6B,
|
|
6
|
-
"names": ["isElementHidden", "isElementTabbable", "el", "
|
|
4
|
+
"sourcesContent": ["import isElementHidden from \"./isElementHidden.js\";\n\n/**\n * Returns if the HTMLElement is tabbable.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { boolean } true if the element is tabbable or false - if not\n */\nconst isElementTabbable = (el: HTMLElement): boolean => {\n\tif (!el) {\n\t\treturn false;\n\t}\n\n\tif (el.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\treturn false;\n\t}\n\n\tif (isElementHidden(el)) {\n\t\treturn false;\n\t}\n\n\tconst tabIndex = el.getAttribute(\"tabindex\");\n\tif (tabIndex !== null && tabIndex !== undefined) {\n\t\treturn parseInt(tabIndex) >= 0;\n\t}\n\n\tconst nodeName = el.nodeName.toLowerCase();\n\tif (nodeName === \"a\" || /^(input|select|textarea|button|object)$/.test(nodeName)) {\n\t\treturn !(el as HTMLLinkElement).disabled;\n\t}\n\n\treturn false;\n};\n\nexport default isElementTabbable;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAqB,uBAS5B,MAAMC,EAAqBC,GAA6B,CASvD,GARI,CAACA,GAIDA,EAAG,aAAa,qBAAqB,GAIrCF,EAAgBE,CAAE,EACrB,MAAO,GAGR,MAAMC,EAAWD,EAAG,aAAa,UAAU,EAC3C,GAAIC,GAAa,KAChB,OAAO,SAASA,CAAQ,GAAK,EAG9B,MAAMC,EAAWF,EAAG,SAAS,YAAY,EACzC,OAAIE,IAAa,KAAO,0CAA0C,KAAKA,CAAQ,EACvE,CAAEF,EAAuB,SAG1B,EACR,EAEA,eAAeD",
|
|
6
|
+
"names": ["isElementHidden", "isElementTabbable", "el", "tabIndex", "nodeName"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TemplateResult } from "lit-html";
|
|
1
|
+
import type { TemplateResult } from "lit-html";
|
|
2
2
|
import type { Renderer } from "../UI5Element.js";
|
|
3
3
|
declare const effectiveHtml: (strings: TemplateStringsArray, ...values: Array<unknown>) => TemplateResult;
|
|
4
4
|
declare const effectiveSvg: (strings: TemplateStringsArray, ...values: Array<unknown>) => TemplateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LitRenderer.js","sourceRoot":"","sources":["../../src/renderer/LitRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,IAAI,EACJ,GAAG,
|
|
1
|
+
{"version":3,"file":"LitRenderer.js","sourceRoot":"","sources":["../../src/renderer/LitRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,IAAI,EACJ,GAAG,GACH,MAAM,UAAU,CAAC;AAIlB,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,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAsB,EAAE,EAAE;IACjF,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3C,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/B,C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esRegistry.js\";\nimport type { 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 type { 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"]}
|
|
@@ -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,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"]}
|
|
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 type 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"]}
|
|
@@ -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,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"]}
|
|
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 type 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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B,CAAC,QAAQ,CAAC,CAAC;QAC5G,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,MAAM,EAAE;YACxC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;YACzC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACnC;KACD;IACD,iBAAiB,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC;AACxG,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,EAAc,EAAE,EAAE;IAC/C,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrD,IAAI,CAAC,iBAAiB,EAAE;QACvB,OAAO;KACP;IACD,MAAM,mBAAmB,GAAG,CAAC,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpE,mBAAmB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QAC7C,2CAA2C,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC5D,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import UI5Element, { ChangeInfo } from \"../UI5Element.js\";\n\ntype InvalidateCallback = (changeInfo: ChangeInfo) => void;\ntype MutationCallback = () => void;\ntype AssociatedElement = {\n\tobserver: MutationObserver | null;\n\tcallbacks: Array<MutationCallback>;\n};\ntype RegisteredElement = {\n\thost: UI5Element;\n\tobservedElements: Array<HTMLElement>;\n\tcallback: MutationCallback;\n\tinvalidationCallback: InvalidateCallback;\n};\n\nconst associatedElements = new WeakMap<HTMLElement, AssociatedElement>();\nconst registeredElements = new WeakMap<UI5Element, RegisteredElement>();\n\ntype AccessibleElement = HTMLElement & {\n\taccessibleNameRef: string;\n\taccessibleName: string;\n};\n\nconst observerOptions = {\n\tattributes: true,\n\tchildList: true,\n\tcharacterData: true,\n\tsubtree: true,\n};\n\nconst getEffectiveAriaLabelText = (el: HTMLElement) => {\n\tconst accessibleEl = el as AccessibleElement;\n\n\tif (!accessibleEl.accessibleNameRef) {\n\t\tif (accessibleEl.accessibleName) {\n\t\t\treturn accessibleEl.accessibleName;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\treturn getAllAccessibleNameRefTexts(el);\n};\n\n/**\n *\n * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts\n */\nconst getAllAccessibleNameRefTexts = (el: HTMLElement) => {\n\tconst ids = (el as AccessibleElement).accessibleNameRef?.split(\" \") ?? [];\n\tconst owner = el.getRootNode() as HTMLElement;\n\tlet result = \"\";\n\n\tids.forEach((elementId: string, index: number) => {\n\t\tconst element = owner.querySelector(`[id='${elementId}']`);\n\t\tconst text = `${element && element.textContent ? element.textContent : \"\"}`;\n\t\tif (text) {\n\t\t\tresult += text;\n\t\t\tif (index < ids.length - 1) {\n\t\t\t\tresult += \" \";\n\t\t\t}\n\t\t}\n\t});\n\n\treturn result;\n};\n\nconst _getAllAssociatedElementsFromDOM = (el: UI5Element): Array<HTMLElement> => {\n\tconst set = new Set<HTMLElement>();\n\t// adding labels with attribute for matching the el.id\n\tconst labelsForAssociated = _getAssociatedLabels(el);\n\tlabelsForAssociated.forEach(itm => {\n\t\tset.add(itm);\n\t});\n\t// adding other elements that id is the same as accessibleNameRef value\n\tconst value = el[\"accessibleNameRef\" as keyof typeof el] as string;\n\tconst ids = value?.split(\" \") ?? [];\n\tids.forEach(id => {\n\t\tconst refEl = _getReferencedElementById(el, id);\n\t\tif (refEl) {\n\t\t\tset.add(refEl);\n\t\t}\n\t});\n\treturn Array.from(set);\n};\n\nconst _getAssociatedLabels = (el: HTMLElement): Array<HTMLElement> => {\n\tconst labels = (el.getRootNode() as HTMLElement).querySelectorAll<HTMLElement>(`[for=\"${el.id}\"]`);\n\treturn Array.from(labels);\n};\n\nconst _getReferencedElementById = (el: HTMLElement, elementId: string): HTMLElement | null => {\n\treturn (el.getRootNode() as HTMLElement).querySelector<HTMLElement>(`[id='${elementId}']`);\n};\n\n/**\n * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related \"label for\" texts\n */\nconst getAssociatedLabelForTexts = (el: HTMLElement) => {\n\tconst results: Array<string> = [];\n\tconst labels = _getAssociatedLabels(el);\n\n\tlabels.forEach((label: HTMLElement) => {\n\t\tconst labelText = label.textContent;\n\t\tlabelText && results.push(labelText);\n\t});\n\n\tif (results.length) {\n\t\treturn results.join(\" \");\n\t}\n\n\treturn undefined;\n};\n\nconst _createInvalidationCallback = (el: UI5Element) => {\n\tconst invalidationCallback = (changeInfo: ChangeInfo) => {\n\t\tif (!(changeInfo && changeInfo.type === \"property\" && changeInfo.name === \"accessibleNameRef\")) {\n\t\t\treturn;\n\t\t}\n\t\tconst registeredElement = registeredElements.get(el);\n\t\tif (!registeredElement) {\n\t\t\treturn;\n\t\t}\n\t\tconst oldAssociatedElements = registeredElement.observedElements;\n\t\tconst newAssociatedElements = _getAllAssociatedElementsFromDOM(el);\n\t\toldAssociatedElements.forEach(oldElement => {\n\t\t\tif (!newAssociatedElements.includes(oldElement)) {\n\t\t\t\t_removeObservedElementFromRegisteredElement(registeredElement, oldElement);\n\t\t\t}\n\t\t});\n\t\tnewAssociatedElements.forEach(newElement => {\n\t\t\tif (!oldAssociatedElements.includes(newElement)) {\n\t\t\t\t_addObservedElementToRegisteredElement(registeredElement, newElement);\n\t\t\t\tregisteredElement.observedElements.push(newElement);\n\t\t\t}\n\t\t});\n\t\tregisteredElement?.callback();\n\t};\n\treturn invalidationCallback;\n};\n\nconst registerUI5Element = (el: UI5Element, callback: MutationCallback) => {\n\tif (registeredElements.has(el)) {\n\t\treturn;\n\t}\n\tconst allAssociatedElements = _getAllAssociatedElementsFromDOM(el);\n\tconst invalidationCallback = _createInvalidationCallback(el);\n\tconst registeredElement = {\n\t\thost: el,\n\t\tobservedElements: allAssociatedElements,\n\t\tcallback,\n\t\tinvalidationCallback,\n\t};\n\tregisteredElements.set(el, registeredElement);\n\tel.attachInvalidate(invalidationCallback);\n\n\tallAssociatedElements.forEach((element: HTMLElement) => {\n\t\t_addObservedElementToRegisteredElement(registeredElement, element);\n\t});\n\tcallback();\n};\n\nconst _addObservedElementToRegisteredElement = (registeredElement: RegisteredElement, element: HTMLElement) => {\n\tlet associatedElement = associatedElements.get(element);\n\tif (!associatedElement) {\n\t\tassociatedElement = { observer: null, callbacks: [] };\n\t\tconst observer = new MutationObserver(() => {\n\t\t\tconst callbacks = (associatedElement as AssociatedElement).callbacks;\n\t\t\tcallbacks.forEach(callback => {\n\t\t\t\tcallback();\n\t\t\t});\n\t\t\tconst domEl = document.getElementById(element.id);\n\t\t\t// if no longer should be observed from this registeredElement, remove it\n\t\t\tif (!(registeredElement.host.id === element.getAttribute(\"for\") || domEl)) {\n\t\t\t\t_removeObservedElementFromRegisteredElement(registeredElement, element);\n\t\t\t}\n\t\t});\n\t\tassociatedElement.observer = observer;\n\t\tobserver.observe(element, observerOptions);\n\t\tassociatedElements.set(element, associatedElement);\n\t}\n\tif (!associatedElement.callbacks.includes(registeredElement.callback)) {\n\t\tassociatedElement.callbacks.push(registeredElement.callback);\n\t}\n};\n\nconst _removeObservedElementFromRegisteredElement = (registeredElement: RegisteredElement, element: HTMLElement) => {\n\tconst associatedElement = associatedElements.get(element);\n\tif (associatedElement) {\n\t\tassociatedElement.callbacks = associatedElement.callbacks.filter(itm => itm !== registeredElement.callback);\n\t\tif (!associatedElement.callbacks.length) {\n\t\t\tassociatedElement.observer?.disconnect();\n\t\t\tassociatedElements.delete(element);\n\t\t}\n\t}\n\tregisteredElement.observedElements = registeredElement.observedElements.filter(itm => itm !== element);\n};\n\nconst deregisterUI5Element = (el: UI5Element) => {\n\tconst registeredElement = registeredElements.get(el);\n\tif (!registeredElement) {\n\t\treturn;\n\t}\n\tconst oldObservedElements = [...registeredElement.observedElements];\n\toldObservedElements.forEach(observedElement => {\n\t\t_removeObservedElementFromRegisteredElement(registeredElement, observedElement);\n\t});\n\tel.detachInvalidate(registeredElement.invalidationCallback);\n\tregisteredElements.delete(el);\n};\n\nexport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tregisterUI5Element,\n\tderegisterUI5Element,\n\tgetAllAccessibleNameRefTexts,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"AriaLabelHelper.js","sourceRoot":"","sources":["../../src/util/AriaLabelHelper.ts"],"names":[],"mappings":"AAgBA,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAkC,CAAC;AACzE,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAiC,CAAC;AAOxE,MAAM,eAAe,GAAG;IACvB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,EAAe,EAAE,EAAE;IACrD,MAAM,YAAY,GAAG,EAAuB,CAAC;IAE7C,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE;QACpC,IAAI,YAAY,CAAC,cAAc,EAAE;YAChC,OAAO,YAAY,CAAC,cAAc,CAAC;SACnC;QAED,OAAO,SAAS,CAAC;KACjB;IAED,OAAO,4BAA4B,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,4BAA4B,GAAG,CAAC,EAAe,EAAE,EAAE;IACxD,MAAM,GAAG,GAAI,EAAwB,CAAC,iBAAiB,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC1E,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,EAAiB,CAAC;IAC9C,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0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { ChangeInfo } from \"../UI5Element.js\";\n\ntype InvalidateCallback = (changeInfo: ChangeInfo) => void;\ntype MutationCallback = () => void;\ntype AssociatedElement = {\n\tobserver: MutationObserver | null;\n\tcallbacks: Array<MutationCallback>;\n};\ntype RegisteredElement = {\n\thost: UI5Element;\n\tobservedElements: Array<HTMLElement>;\n\tcallback: MutationCallback;\n\tinvalidationCallback: InvalidateCallback;\n};\n\nconst associatedElements = new WeakMap<HTMLElement, AssociatedElement>();\nconst registeredElements = new WeakMap<UI5Element, RegisteredElement>();\n\ntype AccessibleElement = HTMLElement & {\n\taccessibleNameRef?: string;\n\taccessibleName?: string;\n};\n\nconst observerOptions = {\n\tattributes: true,\n\tchildList: true,\n\tcharacterData: true,\n\tsubtree: true,\n};\n\nconst getEffectiveAriaLabelText = (el: HTMLElement) => {\n\tconst accessibleEl = el as AccessibleElement;\n\n\tif (!accessibleEl.accessibleNameRef) {\n\t\tif (accessibleEl.accessibleName) {\n\t\t\treturn accessibleEl.accessibleName;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\treturn getAllAccessibleNameRefTexts(el);\n};\n\n/**\n *\n * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts\n */\nconst getAllAccessibleNameRefTexts = (el: HTMLElement) => {\n\tconst ids = (el as AccessibleElement).accessibleNameRef?.split(\" \") ?? [];\n\tconst owner = el.getRootNode() as HTMLElement;\n\tlet result = \"\";\n\n\tids.forEach((elementId: string, index: number) => {\n\t\tconst element = owner.querySelector(`[id='${elementId}']`);\n\t\tconst text = `${element && element.textContent ? element.textContent : \"\"}`;\n\t\tif (text) {\n\t\t\tresult += text;\n\t\t\tif (index < ids.length - 1) {\n\t\t\t\tresult += \" \";\n\t\t\t}\n\t\t}\n\t});\n\n\treturn result;\n};\n\nconst _getAllAssociatedElementsFromDOM = (el: UI5Element): Array<HTMLElement> => {\n\tconst set = new Set<HTMLElement>();\n\t// adding labels with attribute for matching the el.id\n\tconst labelsForAssociated = _getAssociatedLabels(el);\n\tlabelsForAssociated.forEach(itm => {\n\t\tset.add(itm);\n\t});\n\t// adding other elements that id is the same as accessibleNameRef value\n\tconst value = el[\"accessibleNameRef\" as keyof typeof el] as string;\n\tconst ids = value?.split(\" \") ?? [];\n\tids.forEach(id => {\n\t\tconst refEl = _getReferencedElementById(el, id);\n\t\tif (refEl) {\n\t\t\tset.add(refEl);\n\t\t}\n\t});\n\treturn Array.from(set);\n};\n\nconst _getAssociatedLabels = (el: HTMLElement): Array<HTMLElement> => {\n\tconst labels = (el.getRootNode() as HTMLElement).querySelectorAll<HTMLElement>(`[for=\"${el.id}\"]`);\n\treturn Array.from(labels);\n};\n\nconst _getReferencedElementById = (el: HTMLElement, elementId: string): HTMLElement | null => {\n\treturn (el.getRootNode() as HTMLElement).querySelector<HTMLElement>(`[id='${elementId}']`);\n};\n\n/**\n * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related \"label for\" texts\n */\nconst getAssociatedLabelForTexts = (el: HTMLElement) => {\n\tconst results: Array<string> = [];\n\tconst labels = _getAssociatedLabels(el);\n\n\tlabels.forEach((label: HTMLElement) => {\n\t\tconst labelText = label.textContent;\n\t\tlabelText && results.push(labelText);\n\t});\n\n\tif (results.length) {\n\t\treturn results.join(\" \");\n\t}\n\n\treturn undefined;\n};\n\nconst _createInvalidationCallback = (el: UI5Element) => {\n\tconst invalidationCallback = (changeInfo: ChangeInfo) => {\n\t\tif (!(changeInfo && changeInfo.type === \"property\" && changeInfo.name === \"accessibleNameRef\")) {\n\t\t\treturn;\n\t\t}\n\t\tconst registeredElement = registeredElements.get(el);\n\t\tif (!registeredElement) {\n\t\t\treturn;\n\t\t}\n\t\tconst oldAssociatedElements = registeredElement.observedElements;\n\t\tconst newAssociatedElements = _getAllAssociatedElementsFromDOM(el);\n\t\toldAssociatedElements.forEach(oldElement => {\n\t\t\tif (!newAssociatedElements.includes(oldElement)) {\n\t\t\t\t_removeObservedElementFromRegisteredElement(registeredElement, oldElement);\n\t\t\t}\n\t\t});\n\t\tnewAssociatedElements.forEach(newElement => {\n\t\t\tif (!oldAssociatedElements.includes(newElement)) {\n\t\t\t\t_addObservedElementToRegisteredElement(registeredElement, newElement);\n\t\t\t\tregisteredElement.observedElements.push(newElement);\n\t\t\t}\n\t\t});\n\t\tregisteredElement?.callback();\n\t};\n\treturn invalidationCallback;\n};\n\nconst registerUI5Element = (el: UI5Element, callback: MutationCallback) => {\n\tif (registeredElements.has(el)) {\n\t\treturn;\n\t}\n\tconst allAssociatedElements = _getAllAssociatedElementsFromDOM(el);\n\tconst invalidationCallback = _createInvalidationCallback(el);\n\tconst registeredElement = {\n\t\thost: el,\n\t\tobservedElements: allAssociatedElements,\n\t\tcallback,\n\t\tinvalidationCallback,\n\t};\n\tregisteredElements.set(el, registeredElement);\n\tel.attachInvalidate(invalidationCallback);\n\n\tallAssociatedElements.forEach((element: HTMLElement) => {\n\t\t_addObservedElementToRegisteredElement(registeredElement, element);\n\t});\n\tcallback();\n};\n\nconst _addObservedElementToRegisteredElement = (registeredElement: RegisteredElement, element: HTMLElement) => {\n\tlet associatedElement = associatedElements.get(element);\n\tif (!associatedElement) {\n\t\tassociatedElement = { observer: null, callbacks: [] };\n\t\tconst observer = new MutationObserver(() => {\n\t\t\tconst callbacks = (associatedElement as AssociatedElement).callbacks;\n\t\t\tcallbacks.forEach(callback => {\n\t\t\t\tcallback();\n\t\t\t});\n\t\t\tconst domEl = document.getElementById(element.id);\n\t\t\t// if no longer should be observed from this registeredElement, remove it\n\t\t\tif (!(registeredElement.host.id === element.getAttribute(\"for\") || domEl)) {\n\t\t\t\t_removeObservedElementFromRegisteredElement(registeredElement, element);\n\t\t\t}\n\t\t});\n\t\tassociatedElement.observer = observer;\n\t\tobserver.observe(element, observerOptions);\n\t\tassociatedElements.set(element, associatedElement);\n\t}\n\tif (!associatedElement.callbacks.includes(registeredElement.callback)) {\n\t\tassociatedElement.callbacks.push(registeredElement.callback);\n\t}\n};\n\nconst _removeObservedElementFromRegisteredElement = (registeredElement: RegisteredElement, element: HTMLElement) => {\n\tconst associatedElement = associatedElements.get(element);\n\tif (associatedElement) {\n\t\tassociatedElement.callbacks = associatedElement.callbacks.filter(itm => itm !== registeredElement.callback);\n\t\tif (!associatedElement.callbacks.length) {\n\t\t\tassociatedElement.observer?.disconnect();\n\t\t\tassociatedElements.delete(element);\n\t\t}\n\t}\n\tregisteredElement.observedElements = registeredElement.observedElements.filter(itm => itm !== element);\n};\n\nconst deregisterUI5Element = (el: UI5Element) => {\n\tconst registeredElement = registeredElements.get(el);\n\tif (!registeredElement) {\n\t\treturn;\n\t}\n\tconst oldObservedElements = [...registeredElement.observedElements];\n\toldObservedElements.forEach(observedElement => {\n\t\t_removeObservedElementFromRegisteredElement(registeredElement, observedElement);\n\t});\n\tel.detachInvalidate(registeredElement.invalidationCallback);\n\tregisteredElements.delete(el);\n};\n\nexport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tregisterUI5Element,\n\tderegisterUI5Element,\n\tgetAllAccessibleNameRefTexts,\n};\n"]}
|
|
@@ -29,18 +29,10 @@ const getTabbables = (nodes, tabbables) => {
|
|
|
29
29
|
if (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
const currentElement = currentNode;
|
|
33
33
|
if (currentElement.hasAttribute("data-sap-no-tab-ref")) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
if (currentElement.shadowRoot) {
|
|
37
|
-
// get the root node of the ShadowDom (1st none style tag)
|
|
38
|
-
const children = currentElement.shadowRoot.children;
|
|
39
|
-
currentElement = Array.from(children).find(node => node.tagName !== "STYLE");
|
|
40
|
-
}
|
|
41
|
-
if (!currentElement) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
36
|
if (isElementTabbable(currentElement)) {
|
|
45
37
|
tabbableElements.push(currentElement);
|
|
46
38
|
}
|
|
@@ -48,7 +40,8 @@ const getTabbables = (nodes, tabbables) => {
|
|
|
48
40
|
getTabbables(currentElement.assignedNodes(), tabbableElements);
|
|
49
41
|
}
|
|
50
42
|
else {
|
|
51
|
-
|
|
43
|
+
const children = currentElement.shadowRoot ? currentElement.shadowRoot.children : currentElement.children;
|
|
44
|
+
getTabbables([...children], tabbableElements);
|
|
52
45
|
}
|
|
53
46
|
});
|
|
54
47
|
return tabbableElements;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabbableElements.js","sourceRoot":"","sources":["../../src/util/TabbableElements.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAAC,EAAe,EAAsB,EAAE;IACnE,OAAO,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,CAAC,EAAe,EAAsB,EAAE;IACtE,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAkB,EAAE,SAA8B,EAAsB,EAAE;IAC/F,MAAM,gBAAgB,GAAG,SAAS,IAAI,EAAE,CAAC;IAEzC,IAAI,CAAC,KAAK,EAAE;QACX,OAAO,gBAAgB,CAAC;KACxB;IAED,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAC3B,IAAI,WAAW,CAAC,QAAQ,KAAK,IA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CAAC;SACtC;QAED,IAAI,cAAc,CAAC,OAAO,KAAK,MAAM,EAAE;YACtC,YAAY,CAAE,cAAkC,CAAC,aAAa,EAAwB,EAAE,gBAAgB,CAAC,CAAC;SAC1G;aAAM;YACN,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC1G,YAAY,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;SAC9C;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,mBAAmB,EACnB,sBAAsB,GACtB,CAAC","sourcesContent":["import isElementTabbable from \"./isElementTabbable.js\";\n\n/**\n * Returns the tabbable elements within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { Array<HTMLElement> } the tabbable elements\n */\nconst getTabbableElements = (el: HTMLElement): Array<HTMLElement> => {\n\treturn getTabbables([...el.children]);\n};\n\n/**\n * Returns the last tabbable element within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { HTMLElement | null } the last tabbable element or \"null\" if not found\n */\nconst getLastTabbableElement = (el: HTMLElement): HTMLElement | null => {\n\tconst tabbables = getTabbables([...el.children]);\n\treturn tabbables.length ? tabbables[tabbables.length - 1] : null;\n};\n\nconst getTabbables = (nodes: Array<Node>, tabbables?: Array<HTMLElement>): Array<HTMLElement> => {\n\tconst tabbableElements = tabbables || [];\n\n\tif (!nodes) {\n\t\treturn tabbableElements;\n\t}\n\n\tnodes.forEach(currentNode => {\n\t\tif (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentElement = currentNode as HTMLElement;\n\t\tif (currentElement.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isElementTabbable(currentElement)) {\n\t\t\ttabbableElements.push(currentElement);\n\t\t}\n\n\t\tif (currentElement.tagName === \"SLOT\") {\n\t\t\tgetTabbables((currentElement as HTMLSlotElement).assignedNodes() as Array<HTMLElement>, tabbableElements);\n\t\t} else {\n\t\t\tconst children = currentElement.shadowRoot ? currentElement.shadowRoot.children : currentElement.children;\n\t\t\tgetTabbables([...children], tabbableElements);\n\t\t}\n\t});\n\n\treturn tabbableElements;\n};\n\nexport {\n\tgetTabbableElements,\n\tgetLastTabbableElement,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/util/debounce.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,IAAI,gBAAgB,GAAmB,IAAI,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAC,EAAc,EAAE,KAAa,EAAE,EAAE;IAClD,gBAAgB,IAAI,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,GAAG,UAAU,CAAC,GAAG,EAAE;QAClC,gBAAgB,GAAG,IAAI,CAAC;QACxB,EAAE,EAAE,CAAC;IACN,CAAC,EAAE,KAAK,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { Timeout } from \"../types.js\";\n\n/**\n * Delays function execution by given threshold.\n * @param fn {Function}\n * @param delay {Integer}\n */\nlet debounceInterval: Timeout | null = null;\n\nconst debounce = (fn: () => void, delay: number) => {\n\tdebounceInterval && clearTimeout(debounceInterval);\n\tdebounceInterval = setTimeout(() => {\n\t\tdebounceInterval = null;\n\t\tfn();\n\t}, delay);\n};\n\nexport default debounce;\n"]}
|
|
1
|
+
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/util/debounce.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,IAAI,gBAAgB,GAAmB,IAAI,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAC,EAAc,EAAE,KAAa,EAAE,EAAE;IAClD,gBAAgB,IAAI,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,GAAG,UAAU,CAAC,GAAG,EAAE;QAClC,gBAAgB,GAAG,IAAI,CAAC;QACxB,EAAE,EAAE,CAAC;IACN,CAAC,EAAE,KAAK,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import type { Timeout } from \"../types.js\";\n\n/**\n * Delays function execution by given threshold.\n * @param fn {Function}\n * @param delay {Integer}\n */\nlet debounceInterval: Timeout | null = null;\n\nconst debounce = (fn: () => void, delay: number) => {\n\tdebounceInterval && clearTimeout(debounceInterval);\n\tdebounceInterval = setTimeout(() => {\n\t\tdebounceInterval = null;\n\t\tfn();\n\t}, delay);\n};\n\nexport default debounce;\n"]}
|
|
@@ -6,8 +6,6 @@ const ondragstart = (e) => {
|
|
|
6
6
|
if (!e.dataTransfer || !(e.target instanceof HTMLElement)) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
e.dataTransfer.dropEffect = "move";
|
|
10
|
-
e.dataTransfer.effectAllowed = "move";
|
|
11
9
|
if (!selfManagedDragAreas.has(e.target)) {
|
|
12
10
|
draggedElement = e.target;
|
|
13
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"AAEA,IAAI,cAAc,GAAuB,IAAI,CAAC;AAC9C,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAc,CAAC;AAC1C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,CAAY,EAAE,EAAE;IACpC,IAAI,CAAC,CAAC,CAAC,YAAY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Element from \"../../UI5Element.js\";\n\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\n};\n\nconst DragRegistry = {\n\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n};\n\nexport default DragRegistry;\nexport type {\n\tSetDraggedElementFunction,\n};\n"]}
|
|
@@ -22,6 +22,10 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
22
22
|
_state: import("../UI5ElementMetadata.js").State;
|
|
23
23
|
_internals?: ElementInternals | undefined;
|
|
24
24
|
_getRealDomRef?: (() => HTMLElement) | undefined;
|
|
25
|
+
initializedProperties: Map<string, unknown>;
|
|
26
|
+
_rendered: boolean;
|
|
27
|
+
_initShadowRoot(): void;
|
|
28
|
+
_onShadowRootSlotChange(e: Event): void;
|
|
25
29
|
readonly _id: string;
|
|
26
30
|
render(): object;
|
|
27
31
|
connectedCallback(): Promise<void>;
|
|
@@ -45,8 +49,6 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
45
49
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
46
50
|
formAssociatedCallback(): void;
|
|
47
51
|
_updateAttribute(name: string, newValue: import("../UI5ElementMetadata.js").PropertyValue): void;
|
|
48
|
-
_upgradeProperty(this: Record<string, any>, propertyName: string): void;
|
|
49
|
-
_upgradeAllProperties(): void;
|
|
50
52
|
_getChildChangeListener(slotName: string): (param: import("../UI5Element.js").ChangeInfo & {
|
|
51
53
|
target: UI5Element;
|
|
52
54
|
}) => void;
|
|
@@ -55,6 +57,7 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
55
57
|
_detachSlotChange(child: HTMLSlotElement, slotName: string): void;
|
|
56
58
|
_onSlotChange(slotName: string): void;
|
|
57
59
|
onInvalidation(changeInfo: import("../UI5Element.js").ChangeInfo): void;
|
|
60
|
+
updateAttributes(): void;
|
|
58
61
|
_render(): void;
|
|
59
62
|
_assignIndividualSlotsToChildren(): void;
|
|
60
63
|
_waitForDomRef(): Promise<void> & {
|
|
@@ -10,7 +10,6 @@ const isElementTabbable = (el) => {
|
|
|
10
10
|
if (!el) {
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
|
-
const nodeName = el.nodeName.toLowerCase();
|
|
14
13
|
if (el.hasAttribute("data-sap-no-tab-ref")) {
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
@@ -21,7 +20,8 @@ const isElementTabbable = (el) => {
|
|
|
21
20
|
if (tabIndex !== null && tabIndex !== undefined) {
|
|
22
21
|
return parseInt(tabIndex) >= 0;
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
const nodeName = el.nodeName.toLowerCase();
|
|
24
|
+
if (nodeName === "a" || /^(input|select|textarea|button|object)$/.test(nodeName)) {
|
|
25
25
|
return !el.disabled;
|
|
26
26
|
}
|
|
27
27
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isElementTabbable.js","sourceRoot":"","sources":["../../src/util/isElementTabbable.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,CAAC,EAAe,EAAW,EAAE;IACtD,IAAI,CAAC,EAAE,EAAE;QACR,OAAO,KAAK,CAAC;KACb;IAED,
|
|
1
|
+
{"version":3,"file":"isElementTabbable.js","sourceRoot":"","sources":["../../src/util/isElementTabbable.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,CAAC,EAAe,EAAW,EAAE;IACtD,IAAI,CAAC,EAAE,EAAE;QACR,OAAO,KAAK,CAAC;KACb;IAED,IAAI,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;KACb;IAED,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACb;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE;QAChD,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KAC/B;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,QAAQ,KAAK,GAAG,IAAI,yCAAyC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACjF,OAAO,CAAE,EAAsB,CAAC,QAAQ,CAAC;KACzC;IAED,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import isElementHidden from \"./isElementHidden.js\";\n\n/**\n * Returns if the HTMLElement is tabbable.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { boolean } true if the element is tabbable or false - if not\n */\nconst isElementTabbable = (el: HTMLElement): boolean => {\n\tif (!el) {\n\t\treturn false;\n\t}\n\n\tif (el.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\treturn false;\n\t}\n\n\tif (isElementHidden(el)) {\n\t\treturn false;\n\t}\n\n\tconst tabIndex = el.getAttribute(\"tabindex\");\n\tif (tabIndex !== null && tabIndex !== undefined) {\n\t\treturn parseInt(tabIndex) >= 0;\n\t}\n\n\tconst nodeName = el.nodeName.toLowerCase();\n\tif (nodeName === \"a\" || /^(input|select|textarea|button|object)$/.test(nodeName)) {\n\t\treturn !(el as HTMLLinkElement).disabled;\n\t}\n\n\treturn false;\n};\n\nexport default isElementTabbable;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@openui5/sap.ui.core": "1.120.5",
|
|
54
|
-
"@ui5/webcomponents-tools": "2.0.0
|
|
54
|
+
"@ui5/webcomponents-tools": "2.0.0",
|
|
55
55
|
"chromedriver": "^125.0.0",
|
|
56
56
|
"clean-css": "^5.2.2",
|
|
57
57
|
"copy-and-watch": "^0.1.5",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"resolve": "^1.20.0",
|
|
63
63
|
"touch": "^3.1.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2960694d66c4b62d4240e3d45e1401dd94f61aec"
|
|
66
66
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";import r from"./DataType.js";class a extends r{static isValid(e){return/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})|rgb\(\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*(,\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*){2}\)|rgba\((\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*,){3}\s*(0(\.[0-9]+)?|1(\.0+)?)\s*\)|hsl\(\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\s*(,\s*(([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*){2}\)|hsla\(\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\s*,(\s*(([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*,){2}\s*(0(\.[0-9]+)?|1(\.0+)?)\s*\)|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgrey|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgrey|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silverskyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent|inherit|)$/.test(e)}}export default a;
|
|
2
|
-
//# sourceMappingURL=CSSColor.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/CSSColor.ts"],
|
|
4
|
-
"sourcesContent": ["import DataType from \"./DataType.js\";\n\n/**\n * @class\n * CSSColor data type.\n *\n * @public\n */\nclass CSSColor extends DataType {\n\tstatic override isValid(value: string) {\n\t\treturn /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})|rgb\\(\\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*(,\\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*){2}\\)|rgba\\((\\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*,){3}\\s*(0(\\.[0-9]+)?|1(\\.0+)?)\\s*\\)|hsl\\(\\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\\s*(,\\s*(([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*){2}\\)|hsla\\(\\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\\s*,(\\s*(([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*,){2}\\s*(0(\\.[0-9]+)?|1(\\.0+)?)\\s*\\)|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgrey|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgrey|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silverskyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent|inherit|)$/.test(value ); // eslint-disable-line\n\t}\n}\n\nexport default CSSColor;\n"],
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAc,gBAQrB,MAAMC,UAAiBD,CAAS,CAC/B,OAAgB,QAAQE,EAAe,CACtC,MAAO,+/DAA+/D,KAAKA,CAAM,CAClhE,CACD,CAEA,eAAeD",
|
|
6
|
-
"names": ["DataType", "CSSColor", "value"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";import m from"./DataType.js";class s extends m{static isValid(e){return/^(auto|inherit|[-+]?(0*|([0-9]+|[0-9]*\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%))|calc\(\s*(\(\s*)*[-+]?(([0-9]+|[0-9]*\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)(\s*(\)\s*)*(\s[-+]\s|[*\/])\s*(\(\s*)*([-+]?(([0-9]+|[0-9]*\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)))*\s*(\)\s*)*\))$/.test(e)}}export default s;
|
|
2
|
-
//# sourceMappingURL=CSSSize.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/CSSSize.ts"],
|
|
4
|
-
"sourcesContent": ["import DataType from \"./DataType.js\";\n\n/**\n * @class\n * CSSSize data type.\n *\n * @public\n */\nclass CSSSize extends DataType {\n\tstatic isValid(value: string) {\n\t\treturn /^(auto|inherit|[-+]?(0*|([0-9]+|[0-9]*\\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%))|calc\\(\\s*(\\(\\s*)*[-+]?(([0-9]+|[0-9]*\\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)(\\s*(\\)\\s*)*(\\s[-+]\\s|[*\\/])\\s*(\\(\\s*)*([-+]?(([0-9]+|[0-9]*\\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)))*\\s*(\\)\\s*)*\\))$/.test(value); // eslint-disable-line\n\t}\n}\n\nexport default CSSSize;\n"],
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAc,gBAQrB,MAAMC,UAAgBD,CAAS,CAC9B,OAAO,QAAQE,EAAe,CAC7B,MAAO,qcAAqc,KAAKA,CAAK,CACvd,CACD,CAEA,eAAeD",
|
|
6
|
-
"names": ["DataType", "CSSSize", "value"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/DOMReference.ts"],
|
|
4
|
-
"sourcesContent": ["import DataType from \"./DataType.js\";\n\n/**\n * @class\n * DOM Element reference or ID.\n * **Note:** If an ID is passed, it is expected to be part of the same `document` element as the consuming component.\n *\n * @public\n */\nclass DOMReference extends DataType {\n\tstatic override isValid(value: string | HTMLElement) {\n\t\treturn (typeof value === \"string\" || value instanceof HTMLElement);\n\t}\n\n\tstatic override propertyToAttribute(propertyValue: string | HTMLElement) {\n\t\tif (propertyValue instanceof HTMLElement) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn propertyValue;\n\t}\n}\n\nexport default DOMReference;\n"],
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAc,gBASrB,MAAMC,UAAqBD,CAAS,CACnC,OAAgB,QAAQE,EAA6B,CACpD,OAAQ,OAAOA,GAAU,UAAYA,aAAiB,WACvD,CAEA,OAAgB,oBAAoBC,EAAqC,CACxE,OAAIA,aAAyB,YACrB,KAGDA,CACR,CACD,CAEA,eAAeF",
|
|
6
|
-
"names": ["DataType", "DOMReference", "value", "propertyValue"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";class e{static isValid(t){return!1}static attributeToProperty(t){return t}static propertyToAttribute(t){return t===null?null:String(t)}static valuesAreEqual(t,r){return t===r}static generateTypeAccessors(t){Object.keys(t).forEach(r=>{Object.defineProperty(this,r,{get(){return t[r]}})})}static get isDataTypeClass(){return!0}}export default e;
|
|
2
|
-
//# sourceMappingURL=DataType.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/DataType.ts"],
|
|
4
|
-
"sourcesContent": ["import { PropertyValue } from \"../UI5ElementMetadata.js\";\n\n/**\n * @class\n * Base class for all data types.\n *\n * @public\n */\nclass DataType {\n\t/**\n\t * Checks if the value is valid for its data type.\n \t * @public\n\t */\n\t// eslint-disable-next-line\n\tstatic isValid(value: any): boolean {\n\t\treturn false;\n\t}\n\n\tstatic attributeToProperty(attributeValue: string | null): PropertyValue {\n\t\treturn attributeValue;\n\t}\n\n\tstatic propertyToAttribute(propertyValue: PropertyValue): string | null {\n\t\treturn propertyValue === null ? null : String(propertyValue);\n\t}\n\n\tstatic valuesAreEqual(value1: any, value2: any) {\n\t\treturn value1 === value2;\n\t}\n\n\tstatic generateTypeAccessors(types: Record<string, string>) {\n\t\tObject.keys(types).forEach(type => {\n\t\t\tObject.defineProperty(this, type, {\n\t\t\t\tget() {\n\t\t\t\t\treturn types[type];\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic get isDataTypeClass() {\n\t\treturn true;\n\t}\n}\n\nexport default DataType;\n"],
|
|
5
|
-
"mappings": "aAQA,MAAMA,CAAS,CAMd,OAAO,QAAQC,EAAqB,CACnC,MAAO,EACR,CAEA,OAAO,oBAAoBC,EAA8C,CACxE,OAAOA,CACR,CAEA,OAAO,oBAAoBC,EAA6C,CACvE,OAAOA,IAAkB,KAAO,KAAO,OAAOA,CAAa,CAC5D,CAEA,OAAO,eAAeC,EAAaC,EAAa,CAC/C,OAAOD,IAAWC,CACnB,CAEA,OAAO,sBAAsBC,EAA+B,CAC3D,OAAO,KAAKA,CAAK,EAAE,QAAQC,GAAQ,CAClC,OAAO,eAAe,KAAMA,EAAM,CACjC,KAAM,CACL,OAAOD,EAAMC,CAAI,CAClB,CACD,CAAC,CACF,CAAC,CACF,CAEA,WAAW,iBAAkB,CAC5B,MAAO,EACR,CACD,CAEA,eAAeP",
|
|
6
|
-
"names": ["DataType", "value", "attributeValue", "propertyValue", "value1", "value2", "types", "type"]
|
|
7
|
-
}
|
package/dist/prod/types/Float.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/Float.ts"],
|
|
4
|
-
"sourcesContent": ["import { PropertyValue } from \"../UI5ElementMetadata.js\";\nimport DataType from \"./DataType.js\";\n\n/**\n * @class\n * Float data type.\n *\n * @constructor\n * @public\n */\nclass Float extends DataType {\n\tstatic override isValid(value: any) {\n\t\treturn Number(value) === value;\n\t}\n\n\tstatic override attributeToProperty(attributeValue: string): PropertyValue {\n\t\treturn parseFloat(attributeValue);\n\t}\n}\n\nexport default Float;\n"],
|
|
5
|
-
"mappings": "aACA,OAAOA,MAAc,gBASrB,MAAMC,UAAcD,CAAS,CAC5B,OAAgB,QAAQE,EAAY,CACnC,OAAO,OAAOA,CAAK,IAAMA,CAC1B,CAEA,OAAgB,oBAAoBC,EAAuC,CAC1E,OAAO,WAAWA,CAAc,CACjC,CACD,CAEA,eAAeF",
|
|
6
|
-
"names": ["DataType", "Float", "value", "attributeValue"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/Integer.ts"],
|
|
4
|
-
"sourcesContent": ["import { PropertyValue } from \"../UI5ElementMetadata.js\";\nimport DataType from \"./DataType.js\";\n\n/**\n * @class\n * Integer data type.\n *\n * @constructor\n * @public\n */\nclass Integer extends DataType {\n\tstatic override isValid(value: any) {\n\t\treturn Number.isInteger(value);\n\t}\n\n\tstatic override attributeToProperty(attributeValue: string): PropertyValue {\n\t\treturn parseInt(attributeValue);\n\t}\n}\n\nexport default Integer;\n"],
|
|
5
|
-
"mappings": "aACA,OAAOA,MAAc,gBASrB,MAAMC,UAAgBD,CAAS,CAC9B,OAAgB,QAAQE,EAAY,CACnC,OAAO,OAAO,UAAUA,CAAK,CAC9B,CAEA,OAAgB,oBAAoBC,EAAuC,CAC1E,OAAO,SAASA,CAAc,CAC/B,CACD,CAEA,eAAeF",
|
|
6
|
-
"names": ["DataType", "Integer", "value", "attributeValue"]
|
|
7
|
-
}
|
package/dist/types/CSSColor.d.ts
DELETED
package/dist/types/CSSColor.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* CSSColor data type.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
class CSSColor extends DataType {
|
|
9
|
-
static isValid(value) {
|
|
10
|
-
return /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})|rgb\(\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*(,\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*){2}\)|rgba\((\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*,){3}\s*(0(\.[0-9]+)?|1(\.0+)?)\s*\)|hsl\(\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\s*(,\s*(([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*){2}\)|hsla\(\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\s*,(\s*(([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*,){2}\s*(0(\.[0-9]+)?|1(\.0+)?)\s*\)|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgrey|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgrey|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silverskyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent|inherit|)$/.test(value); // eslint-disable-line
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export default CSSColor;
|
|
14
|
-
//# sourceMappingURL=CSSColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSSColor.js","sourceRoot":"","sources":["../../src/types/CSSColor.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC;;;;;GAKG;AACH,MAAM,QAAS,SAAQ,QAAQ;IAC9B,MAAM,CAAU,OAAO,CAAC,KAAa;QACpC,OAAO,8/DAA8/D,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC,CAAC,sBAAsB;IAC3iE,CAAC;CACD;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import DataType from \"./DataType.js\";\n\n/**\n * @class\n * CSSColor data type.\n *\n * @public\n */\nclass CSSColor extends DataType {\n\tstatic override isValid(value: string) {\n\t\treturn /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})|rgb\\(\\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*(,\\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*){2}\\)|rgba\\((\\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*,){3}\\s*(0(\\.[0-9]+)?|1(\\.0+)?)\\s*\\)|hsl\\(\\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\\s*(,\\s*(([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*){2}\\)|hsla\\(\\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\\s*,(\\s*(([0-9]?[0-9](\\.[0-9]+)?|100(\\.0+)?)%)\\s*,){2}\\s*(0(\\.[0-9]+)?|1(\\.0+)?)\\s*\\)|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgrey|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgrey|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silverskyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent|inherit|)$/.test(value ); // eslint-disable-line\n\t}\n}\n\nexport default CSSColor;\n"]}
|
package/dist/types/CSSSize.d.ts
DELETED
package/dist/types/CSSSize.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* CSSSize data type.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
class CSSSize extends DataType {
|
|
9
|
-
static isValid(value) {
|
|
10
|
-
return /^(auto|inherit|[-+]?(0*|([0-9]+|[0-9]*\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%))|calc\(\s*(\(\s*)*[-+]?(([0-9]+|[0-9]*\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)(\s*(\)\s*)*(\s[-+]\s|[*\/])\s*(\(\s*)*([-+]?(([0-9]+|[0-9]*\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)))*\s*(\)\s*)*\))$/.test(value); // eslint-disable-line
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export default CSSSize;
|
|
14
|
-
//# sourceMappingURL=CSSSize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSSSize.js","sourceRoot":"","sources":["../../src/types/CSSSize.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAQ,SAAQ,QAAQ;IAC7B,MAAM,CAAC,OAAO,CAAC,KAAa;QAC3B,OAAO,ocAAoc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,sBAAsB;IAChf,CAAC;CACD;AAED,eAAe,OAAO,CAAC","sourcesContent":["import DataType from \"./DataType.js\";\n\n/**\n * @class\n * CSSSize data type.\n *\n * @public\n */\nclass CSSSize extends DataType {\n\tstatic isValid(value: string) {\n\t\treturn /^(auto|inherit|[-+]?(0*|([0-9]+|[0-9]*\\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%))|calc\\(\\s*(\\(\\s*)*[-+]?(([0-9]+|[0-9]*\\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)(\\s*(\\)\\s*)*(\\s[-+]\\s|[*\\/])\\s*(\\(\\s*)*([-+]?(([0-9]+|[0-9]*\\.[0-9]+)([rR][eE][mM]|[eE][mM]|[eE][xX]|[pP][xX]|[cC][mM]|[mM][mM]|[iI][nN]|[pP][tT]|[pP][cC]|%)?)))*\\s*(\\)\\s*)*\\))$/.test(value); // eslint-disable-line\n\t}\n}\n\nexport default CSSSize;\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* DOM Element reference or ID.
|
|
5
|
-
* **Note:** If an ID is passed, it is expected to be part of the same `document` element as the consuming component.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
declare class DOMReference extends DataType {
|
|
10
|
-
static isValid(value: string | HTMLElement): boolean;
|
|
11
|
-
static propertyToAttribute(propertyValue: string | HTMLElement): string | null;
|
|
12
|
-
}
|
|
13
|
-
export default DOMReference;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* DOM Element reference or ID.
|
|
5
|
-
* **Note:** If an ID is passed, it is expected to be part of the same `document` element as the consuming component.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
class DOMReference extends DataType {
|
|
10
|
-
static isValid(value) {
|
|
11
|
-
return (typeof value === "string" || value instanceof HTMLElement);
|
|
12
|
-
}
|
|
13
|
-
static propertyToAttribute(propertyValue) {
|
|
14
|
-
if (propertyValue instanceof HTMLElement) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
return propertyValue;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export default DOMReference;
|
|
21
|
-
//# sourceMappingURL=DOMReference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DOMReference.js","sourceRoot":"","sources":["../../src/types/DOMReference.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,YAAa,SAAQ,QAAQ;IAClC,MAAM,CAAU,OAAO,CAAC,KAA2B;QAClD,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,WAAW,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAU,mBAAmB,CAAC,aAAmC;QACtE,IAAI,aAAa,YAAY,WAAW,EAAE;YACzC,OAAO,IAAI,CAAC;SACZ;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;CACD;AAED,eAAe,YAAY,CAAC","sourcesContent":["import DataType from \"./DataType.js\";\n\n/**\n * @class\n * DOM Element reference or ID.\n * **Note:** If an ID is passed, it is expected to be part of the same `document` element as the consuming component.\n *\n * @public\n */\nclass DOMReference extends DataType {\n\tstatic override isValid(value: string | HTMLElement) {\n\t\treturn (typeof value === \"string\" || value instanceof HTMLElement);\n\t}\n\n\tstatic override propertyToAttribute(propertyValue: string | HTMLElement) {\n\t\tif (propertyValue instanceof HTMLElement) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn propertyValue;\n\t}\n}\n\nexport default DOMReference;\n"]}
|