@ui5/webcomponents-base 0.0.0-0a35d6b3d → 0.0.0-0dd36ca4b
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 +653 -0
- package/README.md +0 -8
- package/config/wdio.conf.cjs +0 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/Boot.d.ts +3 -2
- package/dist/Boot.js +7 -5
- package/dist/Boot.js.map +1 -1
- package/dist/Device.d.ts +1 -2
- package/dist/Device.js +5 -12
- package/dist/Device.js.map +1 -1
- package/dist/IgnoreCustomElements.d.ts +3 -5
- package/dist/IgnoreCustomElements.js +3 -5
- package/dist/IgnoreCustomElements.js.map +1 -1
- package/dist/InitialConfiguration.d.ts +1 -2
- package/dist/InitialConfiguration.js +1 -5
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +3 -1
- package/dist/Keys.js +5 -1
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.js +24 -98
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/MediaRange.d.ts +6 -6
- package/dist/MediaRange.js +16 -16
- package/dist/MediaRange.js.map +1 -1
- package/dist/UI5Element.d.ts +20 -28
- package/dist/UI5Element.js +89 -67
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +9 -2
- package/dist/UI5ElementMetadata.js +23 -4
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.js +1 -1
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +1 -0
- package/dist/asset-registries/Illustrations.js +12 -19
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +1 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/i18n.d.ts +2 -2
- package/dist/asset-registries/i18n.js +2 -2
- package/dist/asset-registries/i18n.js.map +1 -1
- package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +1 -1
- package/dist/asset-registries/util/IconCollectionsByTheme.js +1 -1
- package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -1
- package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +3 -3
- package/dist/asset-registries/util/getIconCollectionByTheme.js +3 -3
- package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
- package/dist/config/Icons.d.ts +7 -7
- package/dist/config/Icons.js +7 -7
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/Language.d.ts +1 -1
- package/dist/config/Language.js +6 -3
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.d.ts +4 -3
- package/dist/config/Theme.js +13 -6
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +2 -4
- package/dist/config/ThemeRoot.js +2 -4
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/config/Timezone.d.ts +1 -1
- package/dist/config/Timezone.js +1 -1
- package/dist/config/Timezone.js.map +1 -1
- package/dist/css/SystemCSSVars.css +0 -8
- package/dist/custom-elements-internal.json +2952 -0
- package/dist/custom-elements.json +322 -2891
- package/dist/decorators/customElement.d.ts +2 -2
- package/dist/decorators/customElement.js +9 -4
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.d.ts +5 -2
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators.d.ts +5 -0
- package/dist/decorators.js +6 -0
- package/dist/decorators.js.map +1 -0
- package/dist/delegate/ItemNavigation.d.ts +8 -8
- package/dist/delegate/ItemNavigation.js +9 -9
- package/dist/delegate/ItemNavigation.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +18 -0
- package/dist/features/InputElementsFormSupport.js +40 -0
- package/dist/features/InputElementsFormSupport.js.map +1 -0
- package/dist/features/OpenUI5Support.d.ts +0 -2
- package/dist/features/OpenUI5Support.js +6 -21
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPatcher.d.ts +11 -0
- package/dist/features/patchPatcher.js +11 -0
- package/dist/features/patchPatcher.js.map +1 -0
- package/dist/features/patchPopup.d.ts +14 -0
- package/dist/features/patchPopup.js +50 -0
- package/dist/features/patchPopup.js.map +1 -0
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/AssetParameters.js.map +1 -1
- package/dist/generated/VersionInfo.js +5 -5
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/locale/applyDirection.d.ts +3 -2
- package/dist/locale/applyDirection.js +3 -2
- package/dist/locale/applyDirection.js.map +1 -1
- package/dist/locale/getEffectiveDir.d.ts +1 -1
- package/dist/locale/getEffectiveDir.js +3 -19
- package/dist/locale/getEffectiveDir.js.map +1 -1
- package/dist/renderer/LitRenderer.js +2 -8
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/renderer/directives/style-map.d.ts +13 -0
- package/dist/renderer/directives/style-map.js +59 -59
- package/dist/renderer/directives/style-map.js.map +1 -0
- package/dist/sap/base/Log.js +698 -188
- package/dist/sap/base/assert.js +28 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/security/URLListValidator.js +253 -6
- package/dist/sap/base/security/encodeCSS.js +34 -8
- package/dist/sap/base/security/encodeXML.js +47 -17
- package/dist/sap/base/security/sanitizeHTML.js +35 -13
- package/dist/sap/base/strings/toHex.js +27 -2
- package/dist/sap/base/util/now.js +24 -3
- package/dist/sap/base/util/uid.js +27 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
- package/dist/ssr-dom-shim.d.ts +1 -0
- package/dist/ssr-dom-shim.js +12 -0
- package/dist/ssr-dom-shim.js.map +1 -0
- package/dist/ssr-dom.d.ts +0 -0
- package/dist/ssr-dom.js +0 -0
- package/dist/theming/getConstructableStyle.d.ts +1 -1
- package/dist/theming/getConstructableStyle.js +3 -3
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveStyle.d.ts +1 -1
- package/dist/theming/getEffectiveStyle.js +5 -12
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/types/AriaHasPopup.d.ts +32 -0
- package/dist/types/AriaHasPopup.js +34 -0
- package/dist/types/AriaHasPopup.js.map +1 -0
- package/dist/types/AriaLandmarkRole.d.ts +79 -0
- package/dist/types/AriaLandmarkRole.js +81 -0
- package/dist/types/AriaLandmarkRole.js.map +1 -0
- package/dist/types/AriaRole.d.ts +27 -0
- package/dist/types/AriaRole.js +29 -0
- package/dist/types/AriaRole.js.map +1 -0
- package/dist/types/DOMReference.d.ts +1 -1
- package/dist/types/DOMReference.js +1 -1
- package/dist/types/DOMReference.js.map +1 -1
- package/dist/types/MovePlacement.d.ts +20 -0
- package/dist/types/MovePlacement.js +22 -0
- package/dist/types/MovePlacement.js.map +1 -0
- package/dist/types/Orientation.d.ts +16 -0
- package/dist/types/Orientation.js +18 -0
- package/dist/types/Orientation.js.map +1 -0
- package/dist/types/ValueState.d.ts +3 -3
- package/dist/types/ValueState.js +3 -3
- package/dist/types/ValueState.js.map +1 -1
- package/dist/types.d.ts +24 -1
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.d.ts +1 -2
- package/dist/updateShadowRoot.js +5 -29
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/PopupUtils.d.ts +1 -3
- package/dist/util/PopupUtils.js +1 -15
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/clamp.js +2 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/createLinkInHead.d.ts +1 -1
- package/dist/util/createLinkInHead.js +1 -1
- package/dist/util/createLinkInHead.js.map +1 -1
- package/dist/util/detectNavigatorLanguage.d.ts +2 -2
- package/dist/util/detectNavigatorLanguage.js +6 -1
- package/dist/util/detectNavigatorLanguage.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
- package/dist/util/dragAndDrop/DragRegistry.js +68 -0
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
- package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
- package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
- package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +13 -9
- package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
- package/dist/util/getDesigntimePropertyAsArray.js +2 -1
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
- package/dist/vscode.html-custom-data.json +22 -0
- package/index.js +1 -17
- package/package-scripts.cjs +12 -10
- package/package.json +13 -7
- package/src/css/SystemCSSVars.css +0 -8
- package/tsconfig.json +3 -0
- package/.eslintignore +0 -16
- package/.eslintrc.cjs +0 -3
- package/bundle.esm.js +0 -67
- package/dist/CSP.d.ts +0 -30
- package/dist/CSP.js +0 -51
- package/dist/CSP.js.map +0 -1
- package/dist/StaticAreaItem.d.ts +0 -35
- package/dist/StaticAreaItem.js +0 -100
- package/dist/StaticAreaItem.js.map +0 -1
- package/dist/config/RTL.d.ts +0 -7
- package/dist/config/RTL.js +0 -37
- package/dist/config/RTL.js.map +0 -1
- package/dist/theming/getEffectiveLinksHrefs.d.ts +0 -3
- package/dist/theming/getEffectiveLinksHrefs.js +0 -17
- package/dist/theming/getEffectiveLinksHrefs.js.map +0 -1
- package/dist/theming/preloadLinks.d.ts +0 -3
- package/dist/theming/preloadLinks.js +0 -19
- package/dist/theming/preloadLinks.js.map +0 -1
- package/dist/util/createStyleInHead.d.ts +0 -8
- package/dist/util/createStyleInHead.js +0 -18
- package/dist/util/createStyleInHead.js.map +0 -1
- package/lib/generate-asset-parameters/index.js +0 -27
- package/lib/generate-styles/index.js +0 -31
- package/lib/generate-version-info/index.js +0 -32
- package/src/renderer/directives/style-map.js +0 -72
- package/used-modules.txt +0 -10
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type AriaHasPopup from "./types/AriaHasPopup.js";
|
|
2
|
+
import type AriaRole from "./types/AriaRole.js";
|
|
1
3
|
type PromiseResolve = (value: void | PromiseLike<void>) => void;
|
|
2
4
|
type Timeout = ReturnType<typeof setTimeout>;
|
|
3
5
|
type Interval = ReturnType<typeof setInterval>;
|
|
@@ -15,4 +17,25 @@ type ClassMap = {
|
|
|
15
17
|
type PassiveEventListenerObject = EventListenerObject & {
|
|
16
18
|
passive: boolean;
|
|
17
19
|
};
|
|
18
|
-
|
|
20
|
+
type LowercaseString<T> = T extends string ? Lowercase<T> : never;
|
|
21
|
+
type ARIARoles = LowercaseString<AriaRole>;
|
|
22
|
+
type ARIAHasPopup = LowercaseString<AriaHasPopup>;
|
|
23
|
+
type AccessibilityInfo = {
|
|
24
|
+
role?: ARIARoles;
|
|
25
|
+
type?: LowercaseString<string>;
|
|
26
|
+
description?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
readonly?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
children?: Array<HTMLElement>;
|
|
31
|
+
};
|
|
32
|
+
type AccessibilityAttributes = {
|
|
33
|
+
ariaSetsize?: number;
|
|
34
|
+
ariaPosinset?: number;
|
|
35
|
+
controls?: LowercaseString<string>;
|
|
36
|
+
expanded?: "true" | "false" | boolean;
|
|
37
|
+
hasPopup?: ARIAHasPopup;
|
|
38
|
+
name?: string;
|
|
39
|
+
role?: ARIARoles;
|
|
40
|
+
};
|
|
41
|
+
export type { AccessibilityInfo, AccessibilityAttributes, PromiseResolve, Timeout, Interval, StyleData, StyleDataCSP, ComponentStylesData, ClassMap, ClassMapValue, PassiveEventListenerObject, };
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["type PromiseResolve = (value: void | PromiseLike<void>) => void;\ntype Timeout = ReturnType<typeof setTimeout>;\ntype Interval = ReturnType<typeof setInterval>;\n\ntype StyleDataCSP = {\n\tcontent: string,\n\tpackageName: string,\n\tfileName: string,\n};\n\ntype StyleData = StyleDataCSP | string;\n\ntype ComponentStylesData = Array<ComponentStylesData> | Array<StyleData> | StyleData;\n\ntype ClassMapValue = Record<string, boolean>\n\ntype ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\ntype PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\nexport type {\n\tPromiseResolve,\n\tTimeout,\n\tInterval,\n\tStyleData,\n\tStyleDataCSP,\n\tComponentStylesData,\n\tClassMap,\n\tClassMapValue,\n\tPassiveEventListenerObject,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type AriaHasPopup from \"./types/AriaHasPopup.js\";\nimport type AriaRole from \"./types/AriaRole.js\";\n\ntype PromiseResolve = (value: void | PromiseLike<void>) => void;\ntype Timeout = ReturnType<typeof setTimeout>;\ntype Interval = ReturnType<typeof setInterval>;\n\ntype StyleDataCSP = {\n\tcontent: string,\n\tpackageName: string,\n\tfileName: string,\n};\n\ntype StyleData = StyleDataCSP | string;\n\ntype ComponentStylesData = Array<ComponentStylesData> | Array<StyleData> | StyleData;\n\ntype ClassMapValue = Record<string, boolean>\n\ntype ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\ntype PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\ntype LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\ntype ARIARoles = LowercaseString<AriaRole>;\ntype ARIAHasPopup = LowercaseString<AriaHasPopup>;\n\ntype AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: ARIARoles,\n\n\t// A translated text that represents the component type. Used when several components share same role,\n\t// f.e. Select and ComboBox both have role=\"combobox\".\n\ttype?: LowercaseString<string>,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, label, etc.\n\tdescription?: string,\n\n\t // The component disabled state.\n\tdisabled?: boolean,\n\n\t// The component readonly state.\n\treadonly?: boolean,\n\n\t// The component required state.\n\trequired?: boolean,\n\n\t// An array of elements, aggregated by the component\n\t// <b>Note:</b> Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<HTMLElement>,\n}\n\ntype AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: ARIAHasPopup,\n\tname?: string\n\trole?: ARIARoles,\n}\n\nexport type {\n\tAccessibilityInfo,\n\tAccessibilityAttributes,\n\tPromiseResolve,\n\tTimeout,\n\tInterval,\n\tStyleData,\n\tStyleDataCSP,\n\tComponentStylesData,\n\tClassMap,\n\tClassMapValue,\n\tPassiveEventListenerObject,\n};\n"]}
|
|
@@ -2,7 +2,6 @@ import type UI5Element from "./UI5Element.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Updates the shadow root of a UI5Element or its static area item
|
|
4
4
|
* @param element
|
|
5
|
-
* @param forStaticArea
|
|
6
5
|
*/
|
|
7
|
-
declare const updateShadowRoot: (element: UI5Element
|
|
6
|
+
declare const updateShadowRoot: (element: UI5Element) => void;
|
|
8
7
|
export default updateShadowRoot;
|
package/dist/updateShadowRoot.js
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
1
|
import getConstructableStyle from "./theming/getConstructableStyle.js";
|
|
2
|
-
import getEffectiveStyle from "./theming/getEffectiveStyle.js";
|
|
3
|
-
import getEffectiveLinksHrefs from "./theming/getEffectiveLinksHrefs.js";
|
|
4
|
-
import { shouldUseLinks } from "./CSP.js";
|
|
5
|
-
import { isSafari } from "./Device.js";
|
|
6
2
|
/**
|
|
7
3
|
* Updates the shadow root of a UI5Element or its static area item
|
|
8
4
|
* @param element
|
|
9
|
-
* @param forStaticArea
|
|
10
5
|
*/
|
|
11
|
-
const updateShadowRoot = (element
|
|
12
|
-
let styleStrOrHrefsArr;
|
|
6
|
+
const updateShadowRoot = (element) => {
|
|
13
7
|
const ctor = element.constructor;
|
|
14
|
-
const shadowRoot =
|
|
15
|
-
|
|
16
|
-
if (forStaticArea) {
|
|
17
|
-
renderResult = element.renderStatic(); // this is checked before calling updateShadowRoot
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
renderResult = element.render(); // this is checked before calling updateShadowRoot
|
|
21
|
-
}
|
|
8
|
+
const shadowRoot = element.shadowRoot;
|
|
9
|
+
const renderResult = element.render(); // this is checked before calling updateShadowRoot
|
|
22
10
|
if (!shadowRoot) {
|
|
23
11
|
console.warn(`There is no shadow root to update`); // eslint-disable-line
|
|
24
12
|
return;
|
|
25
13
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
else if (document.adoptedStyleSheets && !isSafari()) { // Chrome
|
|
30
|
-
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor, forStaticArea);
|
|
31
|
-
}
|
|
32
|
-
else { // FF, Safari
|
|
33
|
-
styleStrOrHrefsArr = getEffectiveStyle(ctor, forStaticArea);
|
|
34
|
-
}
|
|
35
|
-
if (ctor.renderer) {
|
|
36
|
-
ctor.renderer(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
ctor.render(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
14
|
+
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);
|
|
15
|
+
ctor.renderer(renderResult, shadowRoot, { host: element });
|
|
40
16
|
};
|
|
41
17
|
export default updateShadowRoot;
|
|
42
18
|
//# sourceMappingURL=updateShadowRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAGvE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,kDAAkD;IAEzF,IAAI,CAAC,UAAU,EAAE;QAChB,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,sBAAsB;QACzE,OAAO;KACP;IAED,UAAU,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAE5D,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\tconst renderResult = element.render(); // this is checked before calling updateShadowRoot\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);\n\n\tctor.renderer(renderResult, shadowRoot, { host: element });\n};\n\nexport default updateShadowRoot;\n"]}
|
|
@@ -2,6 +2,4 @@ declare const getFocusedElement: () => HTMLElement | null;
|
|
|
2
2
|
declare const isFocusedElementWithinNode: (node: HTMLElement) => boolean;
|
|
3
3
|
declare const isClickInRect: (e: MouseEvent | TouchEvent, rect: DOMRect) => boolean;
|
|
4
4
|
declare const getClosedPopupParent: (el: HTMLElement) => HTMLElement;
|
|
5
|
-
|
|
6
|
-
declare const getCurrentZIndex: () => number;
|
|
7
|
-
export { getFocusedElement, isClickInRect, getClosedPopupParent, getNextZIndex, getCurrentZIndex, isFocusedElementWithinNode, };
|
|
5
|
+
export { getFocusedElement, isClickInRect, getClosedPopupParent, isFocusedElementWithinNode, };
|
package/dist/util/PopupUtils.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import getSharedResource from "../getSharedResource.js";
|
|
2
|
-
import { getFeature } from "../FeaturesRegistry.js";
|
|
3
1
|
import getActiveElement from "./getActiveElement.js";
|
|
4
|
-
const popupUtilsData = getSharedResource("PopupUtilsData", { currentZIndex: 100 });
|
|
5
2
|
const getFocusedElement = () => {
|
|
6
3
|
const element = getActiveElement();
|
|
7
4
|
return (element && typeof element.focus === "function") ? element : null;
|
|
@@ -59,16 +56,5 @@ const getClosedPopupParent = (el) => {
|
|
|
59
56
|
}
|
|
60
57
|
return getClosedPopupParent(parent);
|
|
61
58
|
};
|
|
62
|
-
|
|
63
|
-
const openUI5Support = getFeature("OpenUI5Support");
|
|
64
|
-
if (openUI5Support && openUI5Support.isOpenUI5Detected()) { // use OpenUI5 for getting z-index values, if loaded
|
|
65
|
-
return openUI5Support.getNextZIndex();
|
|
66
|
-
}
|
|
67
|
-
popupUtilsData.currentZIndex += 2;
|
|
68
|
-
return popupUtilsData.currentZIndex;
|
|
69
|
-
};
|
|
70
|
-
const getCurrentZIndex = () => {
|
|
71
|
-
return popupUtilsData.currentZIndex;
|
|
72
|
-
};
|
|
73
|
-
export { getFocusedElement, isClickInRect, getClosedPopupParent, getNextZIndex, getCurrentZIndex, isFocusedElementWithinNode, };
|
|
59
|
+
export { getFocusedElement, isClickInRect, getClosedPopupParent, isFocusedElementWithinNode, };
|
|
74
60
|
//# sourceMappingURL=PopupUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupUtils.js","sourceRoot":"","sources":["../../src/util/PopupUtils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PopupUtils.js","sourceRoot":"","sources":["../../src/util/PopupUtils.ts"],"names":[],"mappings":"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","sourcesContent":["import getActiveElement from \"./getActiveElement.js\";\n\nconst getFocusedElement = () => {\n\tconst element = getActiveElement() as HTMLElement;\n\treturn (element && typeof element.focus === \"function\") ? element : null;\n};\n\nconst isFocusedElementWithinNode = (node: HTMLElement) => {\n\tconst fe = getFocusedElement();\n\n\tif (fe) {\n\t\treturn isNodeContainedWithin(node, fe);\n\t}\n\n\treturn false;\n};\n\nconst isNodeContainedWithin = (parent: HTMLElement, child: HTMLElement): boolean => {\n\tlet currentNode: HTMLElement | undefined = parent;\n\n\tif (currentNode.shadowRoot) {\n\t\tconst children = Array.from(currentNode.shadowRoot.children) as Array<HTMLElement>;\n\t\tcurrentNode = children.find(n => n.localName !== \"style\");\n\n\t\tif (!currentNode) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (currentNode === child) {\n\t\treturn true;\n\t}\n\n\tconst childNodes = currentNode.localName === \"slot\" ? (currentNode as HTMLSlotElement).assignedNodes() : currentNode.children;\n\n\tif (childNodes) {\n\t\treturn Array.from(childNodes).some(n => isNodeContainedWithin(n as HTMLElement, child));\n\t}\n\n\treturn false;\n};\n\nconst isPointInRect = (x: number, y: number, rect: DOMRect) => {\n\treturn x >= rect.left && x <= rect.right\n\t\t&& y >= rect.top && y <= rect.bottom;\n};\n\nconst isClickInRect = (e: MouseEvent | TouchEvent, rect: DOMRect) => {\n\tlet x;\n\tlet y;\n\n\tif (e instanceof MouseEvent) {\n\t\tx = e.clientX;\n\t\ty = e.clientY;\n\t} else {\n\t\tconst touch = e.touches[0];\n\t\tx = touch.clientX;\n\t\ty = touch.clientY;\n\t}\n\n\treturn isPointInRect(x, y, rect);\n};\n\ninterface PopupInterface { // Refactor: replace with Popup.js\n\t_show: () => void,\n\topen: boolean,\n}\nfunction instanceOfPopup(object: any): object is PopupInterface {\n\treturn \"isUI5Element\" in object && \"_show\" in object;\n}\n\nconst getClosedPopupParent = (el: HTMLElement): HTMLElement => {\n\tconst parent = el.parentElement || (el.getRootNode && (el.getRootNode() as ShadowRoot).host);\n\n\tif (parent && ((instanceOfPopup(parent) || parent === document.documentElement))) {\n\t\treturn parent as HTMLElement;\n\t}\n\n\treturn getClosedPopupParent(parent as HTMLElement);\n};\n\nexport {\n\tgetFocusedElement,\n\tisClickInRect,\n\tgetClosedPopupParent,\n\tisFocusedElementWithinNode,\n};\n"]}
|
package/dist/util/clamp.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @returns {number}
|
|
7
7
|
*/
|
|
8
8
|
const clamp = (val, min, max) => {
|
|
9
|
-
|
|
9
|
+
// handles case when max < min
|
|
10
|
+
return Math.min(Math.max(val, min), Math.max(min, max));
|
|
10
11
|
};
|
|
11
12
|
export default clamp;
|
|
12
13
|
//# sourceMappingURL=clamp.js.map
|
package/dist/util/clamp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clamp.js","sourceRoot":"","sources":["../../src/util/clamp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE;IACvD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"clamp.js","sourceRoot":"","sources":["../../src/util/clamp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE;IACvD,8BAA8B;IAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["/**\n * Returns a value clamped between an upper bound 'max' and lower bound 'min'.\n * @param {number} val value\n * @param {number} min lower bound\n * @param {number} max upper bound\n * @returns {number}\n */\nconst clamp = (val: number, min: number, max: number) => {\n\t// handles case when max < min\n\treturn Math.min(Math.max(val, min), Math.max(min, max));\n};\n\nexport default clamp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLinkInHead.js","sourceRoot":"","sources":["../../src/util/createLinkInHead.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,UAAmC,EAAE,EAAE;IAC9E,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACvB,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;IAExB,IAAI,UAAU,EAAE;QACf,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAEjB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,IAAI,OAAO,CAAQ,OAAO,CAAC,EAAE;QACnC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW;IACrD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["/**\n * Creates a
|
|
1
|
+
{"version":3,"file":"createLinkInHead.js","sourceRoot":"","sources":["../../src/util/createLinkInHead.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,UAAmC,EAAE,EAAE;IAC9E,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACvB,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;IAExB,IAAI,UAAU,EAAE;QACf,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAEjB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,IAAI,OAAO,CAAQ,OAAO,CAAC,EAAE;QACnC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW;IACrD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["/**\n * Creates a `<link>` tag in the `<head>` tag\n * @param href - the CSS\n * @param attributes - optional attributes to add to the tag\n */\nconst createLinkInHead = (href: string, attributes?: Record<string, string>) => {\n\tconst link = document.createElement(\"link\");\n\tlink.type = \"text/css\";\n\tlink.rel = \"stylesheet\";\n\n\tif (attributes) {\n\t\tObject.entries(attributes).forEach(pair => link.setAttribute(...pair));\n\t}\n\n\tlink.href = href;\n\n\tdocument.head.appendChild(link);\n\n\treturn new Promise<Event>(resolve => {\n\t\tlink.addEventListener(\"load\", resolve);\n\t\tlink.addEventListener(\"error\", resolve); // intended\n\t});\n};\n\nexport default createLinkInHead;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const detectNavigatorLanguage: () => string;
|
|
2
|
+
export default detectNavigatorLanguage;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { DEFAULT_LANGUAGE } from "../generated/AssetParameters.js";
|
|
2
|
-
|
|
2
|
+
const isSSR = typeof document === "undefined";
|
|
3
|
+
const detectNavigatorLanguage = () => {
|
|
4
|
+
if (isSSR) {
|
|
5
|
+
return DEFAULT_LANGUAGE;
|
|
6
|
+
}
|
|
3
7
|
const browserLanguages = navigator.languages;
|
|
4
8
|
const navigatorLanguage = () => {
|
|
5
9
|
return navigator.language;
|
|
@@ -7,4 +11,5 @@ export default () => {
|
|
|
7
11
|
const rawLocale = (browserLanguages && browserLanguages[0]) || navigatorLanguage();
|
|
8
12
|
return rawLocale || DEFAULT_LANGUAGE;
|
|
9
13
|
};
|
|
14
|
+
export default detectNavigatorLanguage;
|
|
10
15
|
//# sourceMappingURL=detectNavigatorLanguage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectNavigatorLanguage.js","sourceRoot":"","sources":["../../src/util/detectNavigatorLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,
|
|
1
|
+
{"version":3,"file":"detectNavigatorLanguage.js","sourceRoot":"","sources":["../../src/util/detectNavigatorLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AAE9C,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACpC,IAAI,KAAK,EAAE;QACV,OAAO,gBAAgB,CAAC;KACxB;IACD,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAAC;IAE7C,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC9B,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC3B,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,iBAAiB,EAAE,CAAC;IAEnF,OAAO,SAAS,IAAI,gBAAgB,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["import { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst detectNavigatorLanguage = () => {\n\tif (isSSR) {\n\t\treturn DEFAULT_LANGUAGE;\n\t}\n\tconst browserLanguages = navigator.languages;\n\n\tconst navigatorLanguage = () => {\n\t\treturn navigator.language;\n\t};\n\n\tconst rawLocale = (browserLanguages && browserLanguages[0]) || navigatorLanguage();\n\n\treturn rawLocale || DEFAULT_LANGUAGE;\n};\n\nexport default detectNavigatorLanguage;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type UI5Element from "../../UI5Element.js";
|
|
2
|
+
declare const setDraggedElement: (element: HTMLElement | null) => void;
|
|
3
|
+
type SetDraggedElementFunction = typeof setDraggedElement;
|
|
4
|
+
declare const DragRegistry: {
|
|
5
|
+
subscribe: (subscriber: UI5Element) => void;
|
|
6
|
+
unsubscribe: (subscriber: UI5Element) => void;
|
|
7
|
+
addSelfManagedArea: (area: HTMLElement | ShadowRoot) => (element: HTMLElement | null) => void;
|
|
8
|
+
removeSelfManagedArea: (area: HTMLElement | ShadowRoot) => void;
|
|
9
|
+
getDraggedElement: () => HTMLElement | null;
|
|
10
|
+
};
|
|
11
|
+
export default DragRegistry;
|
|
12
|
+
export type { SetDraggedElementFunction, };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
let draggedElement = null;
|
|
2
|
+
let globalHandlersAttached = false;
|
|
3
|
+
const subscribers = new Set();
|
|
4
|
+
const selfManagedDragAreas = new Set();
|
|
5
|
+
const ondragstart = (e) => {
|
|
6
|
+
if (!e.dataTransfer || !(e.target instanceof HTMLElement)) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
e.dataTransfer.dropEffect = "move";
|
|
10
|
+
e.dataTransfer.effectAllowed = "move";
|
|
11
|
+
if (!selfManagedDragAreas.has(e.target)) {
|
|
12
|
+
draggedElement = e.target;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const ondragend = () => {
|
|
16
|
+
draggedElement = null;
|
|
17
|
+
};
|
|
18
|
+
const ondrop = () => {
|
|
19
|
+
draggedElement = null;
|
|
20
|
+
};
|
|
21
|
+
const setDraggedElement = (element) => {
|
|
22
|
+
draggedElement = element;
|
|
23
|
+
};
|
|
24
|
+
const getDraggedElement = () => {
|
|
25
|
+
return draggedElement;
|
|
26
|
+
};
|
|
27
|
+
const attachGlobalHandlers = () => {
|
|
28
|
+
if (globalHandlersAttached) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
document.body.addEventListener("dragstart", ondragstart);
|
|
32
|
+
document.body.addEventListener("dragend", ondragend);
|
|
33
|
+
document.body.addEventListener("drop", ondrop);
|
|
34
|
+
};
|
|
35
|
+
const detachGlobalHandlers = () => {
|
|
36
|
+
document.body.removeEventListener("dragstart", ondragstart);
|
|
37
|
+
document.body.removeEventListener("dragend", ondragend);
|
|
38
|
+
document.body.removeEventListener("drop", ondrop);
|
|
39
|
+
globalHandlersAttached = false;
|
|
40
|
+
};
|
|
41
|
+
const subscribe = (subscriber) => {
|
|
42
|
+
subscribers.add(subscriber);
|
|
43
|
+
if (!globalHandlersAttached) {
|
|
44
|
+
attachGlobalHandlers();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const unsubscribe = (subscriber) => {
|
|
48
|
+
subscribers.delete(subscriber);
|
|
49
|
+
if (subscribers.size === 0 && globalHandlersAttached) {
|
|
50
|
+
detachGlobalHandlers();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const addSelfManagedArea = (area) => {
|
|
54
|
+
selfManagedDragAreas.add(area);
|
|
55
|
+
return setDraggedElement;
|
|
56
|
+
};
|
|
57
|
+
const removeSelfManagedArea = (area) => {
|
|
58
|
+
selfManagedDragAreas.delete(area);
|
|
59
|
+
};
|
|
60
|
+
const DragRegistry = {
|
|
61
|
+
subscribe,
|
|
62
|
+
unsubscribe,
|
|
63
|
+
addSelfManagedArea,
|
|
64
|
+
removeSelfManagedArea,
|
|
65
|
+
getDraggedElement,
|
|
66
|
+
};
|
|
67
|
+
export default DragRegistry;
|
|
68
|
+
//# sourceMappingURL=DragRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"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","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\te.dataTransfer.dropEffect = \"move\";\n\te.dataTransfer.effectAllowed = \"move\";\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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import MovePlacement from "../../types/MovePlacement.js";
|
|
2
|
+
import Orientation from "../../types/Orientation.js";
|
|
3
|
+
declare const findClosestPosition: (elements: Array<HTMLElement>, point: number, layoutOrientation: Orientation) => {
|
|
4
|
+
element: HTMLElement;
|
|
5
|
+
placements: MovePlacement[];
|
|
6
|
+
} | null;
|
|
7
|
+
export default findClosestPosition;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import MovePlacement from "../../types/MovePlacement.js";
|
|
2
|
+
import Orientation from "../../types/Orientation.js";
|
|
3
|
+
const closestPlacement = (point, beforePoint, centerPoint, afterPoint) => {
|
|
4
|
+
const distToBeforePoint = Math.abs(point - beforePoint);
|
|
5
|
+
const distToCenterPoint = Math.abs(point - centerPoint);
|
|
6
|
+
const distToAfterPoint = Math.abs(point - afterPoint);
|
|
7
|
+
const closestPoint = Math.min(distToBeforePoint, distToCenterPoint, distToAfterPoint);
|
|
8
|
+
let placements = [];
|
|
9
|
+
switch (closestPoint) {
|
|
10
|
+
case distToBeforePoint:
|
|
11
|
+
placements = [MovePlacement.Before];
|
|
12
|
+
break;
|
|
13
|
+
case distToCenterPoint:
|
|
14
|
+
placements = [MovePlacement.On, distToBeforePoint < distToAfterPoint ? MovePlacement.Before : MovePlacement.After];
|
|
15
|
+
break;
|
|
16
|
+
case distToAfterPoint:
|
|
17
|
+
placements = [MovePlacement.After];
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
return placements;
|
|
21
|
+
};
|
|
22
|
+
const findClosestPosition = (elements, point, layoutOrientation) => {
|
|
23
|
+
let shortestDist = Number.POSITIVE_INFINITY;
|
|
24
|
+
let closestElement = null;
|
|
25
|
+
// determine which element is most closest to the point
|
|
26
|
+
for (let i = 0; i < elements.length; i++) {
|
|
27
|
+
const el = elements[i];
|
|
28
|
+
const { left, width, top, height, } = el.getBoundingClientRect();
|
|
29
|
+
let elemCenter;
|
|
30
|
+
if (layoutOrientation === Orientation.Vertical) {
|
|
31
|
+
elemCenter = top + height / 2;
|
|
32
|
+
}
|
|
33
|
+
else { // Horizontal
|
|
34
|
+
elemCenter = left + width / 2;
|
|
35
|
+
}
|
|
36
|
+
const distanceToCenter = Math.abs(point - elemCenter);
|
|
37
|
+
if (distanceToCenter < shortestDist) {
|
|
38
|
+
shortestDist = distanceToCenter;
|
|
39
|
+
closestElement = el;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (!closestElement) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const { width, height, left, right, top, bottom, } = closestElement.getBoundingClientRect();
|
|
46
|
+
let placements;
|
|
47
|
+
if (layoutOrientation === Orientation.Vertical) {
|
|
48
|
+
placements = closestPlacement(point, top, top + height / 2, bottom);
|
|
49
|
+
}
|
|
50
|
+
else { // Horizontal
|
|
51
|
+
placements = closestPlacement(point, left, left + width / 2, right);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
element: closestElement,
|
|
55
|
+
placements,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export default findClosestPosition;
|
|
59
|
+
//# sourceMappingURL=findClosestPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findClosestPosition.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/findClosestPosition.ts"],"names":[],"mappings":"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","sourcesContent":["import MovePlacement from \"../../types/MovePlacement.js\";\nimport Orientation from \"../../types/Orientation.js\";\n\nconst closestPlacement = (point: number, beforePoint: number, centerPoint: number, afterPoint: number) => {\n\tconst distToBeforePoint = Math.abs(point - beforePoint);\n\tconst distToCenterPoint = Math.abs(point - centerPoint);\n\tconst distToAfterPoint = Math.abs(point - afterPoint);\n\tconst closestPoint = Math.min(\n\t\tdistToBeforePoint,\n\t\tdistToCenterPoint,\n\t\tdistToAfterPoint,\n\t);\n\tlet placements: Array<MovePlacement> = [];\n\n\tswitch (closestPoint) {\n\tcase distToBeforePoint:\n\t\tplacements = [MovePlacement.Before];\n\t\tbreak;\n\tcase distToCenterPoint:\n\t\tplacements = [MovePlacement.On, distToBeforePoint < distToAfterPoint ? MovePlacement.Before : MovePlacement.After];\n\t\tbreak;\n\tcase distToAfterPoint:\n\t\tplacements = [MovePlacement.After];\n\t\tbreak;\n\t}\n\n\treturn placements;\n};\n\nconst findClosestPosition = (elements: Array<HTMLElement>, point: number, layoutOrientation: Orientation) => {\n\tlet shortestDist = Number.POSITIVE_INFINITY;\n\tlet closestElement: HTMLElement | null = null;\n\n\t// determine which element is most closest to the point\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst el = elements[i];\n\t\tconst {\n\t\t\tleft, width, top, height,\n\t\t} = el.getBoundingClientRect();\n\n\t\tlet elemCenter;\n\t\tif (layoutOrientation === Orientation.Vertical) {\n\t\t\telemCenter = top + height / 2;\n\t\t} else { // Horizontal\n\t\t\telemCenter = left + width / 2;\n\t\t}\n\n\t\tconst distanceToCenter = Math.abs(point - elemCenter);\n\n\t\tif (distanceToCenter < shortestDist) {\n\t\t\tshortestDist = distanceToCenter;\n\t\t\tclosestElement = el;\n\t\t}\n\t}\n\n\tif (!closestElement) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\twidth, height, left, right, top, bottom,\n\t} = closestElement.getBoundingClientRect();\n\tlet placements;\n\n\tif (layoutOrientation === Orientation.Vertical) {\n\t\tplacements = closestPlacement(point, top, top + height / 2, bottom);\n\t} else { // Horizontal\n\t\tplacements = closestPlacement(point, left, left + width / 2, right);\n\t}\n\n\treturn {\n\t\telement: closestElement,\n\t\tplacements,\n\t};\n};\n\nexport default findClosestPosition;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const longDragOverHandler: (targetsSelector: string) => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<(arg0: DragEvent, arg1: boolean) => any>) => TypedPropertyDescriptor<(arg0: DragEvent, arg1: boolean) => any>;
|
|
2
|
+
export default longDragOverHandler;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
let lastTarget = null;
|
|
2
|
+
let lastTargetDragOverStart = Date.now();
|
|
3
|
+
const LONG_DRAG_OVER_THRESHOLD = 300;
|
|
4
|
+
const longDragOverHandler = (targetsSelector) => {
|
|
5
|
+
return (target, propertyKey, descriptor) => {
|
|
6
|
+
const origHandler = descriptor.value;
|
|
7
|
+
descriptor.value = function handleDragOver(e) {
|
|
8
|
+
let isLongDragOver = false;
|
|
9
|
+
if (e.target instanceof HTMLElement) {
|
|
10
|
+
const currentTarget = e.target.closest(targetsSelector);
|
|
11
|
+
if (currentTarget === lastTarget && Date.now() - lastTargetDragOverStart >= LONG_DRAG_OVER_THRESHOLD) {
|
|
12
|
+
isLongDragOver = true;
|
|
13
|
+
}
|
|
14
|
+
else if (currentTarget !== lastTarget) {
|
|
15
|
+
lastTarget = currentTarget;
|
|
16
|
+
lastTargetDragOverStart = Date.now();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
origHandler.apply(this, [e, isLongDragOver]);
|
|
20
|
+
};
|
|
21
|
+
return descriptor;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default longDragOverHandler;
|
|
25
|
+
//# sourceMappingURL=longDragOverHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"longDragOverHandler.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/longDragOverHandler.ts"],"names":[],"mappings":"AAAA,IAAI,UAAU,GAAuB,IAAI,CAAC;AAC1C,IAAI,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACzC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,MAAM,mBAAmB,GAAG,CAAC,eAAuB,EAAE,EAAE;IACvD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,UAA4E,EAAE,EAAE;QACzH,MAAM,WAAW,GAAG,UAAU,CAAC,KAAM,CAAC;QAEtC,UAAU,CAAC,KAAK,GAAG,SAAS,cAAc,CAAC,CAAY;YACtD,IAAI,cAAc,GAAG,KAAK,CAAC;YAE3B,IAAI,CAAC,CAAC,MAAM,YAAY,WAAW,EAAE;gBACpC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAc,eAAe,CAAC,CAAC;gBAErE,IAAI,aAAa,KAAK,UAAU,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,uBAAuB,IAAI,wBAAwB,EAAE;oBACrG,cAAc,GAAG,IAAI,CAAC;iBACtB;qBAAM,IAAI,aAAa,KAAK,UAAU,EAAE;oBACxC,UAAU,GAAG,aAAa,CAAC;oBAC3B,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;iBACrC;aACD;YAED,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["let lastTarget: HTMLElement | null = null;\nlet lastTargetDragOverStart = Date.now();\nconst LONG_DRAG_OVER_THRESHOLD = 300;\n\nconst longDragOverHandler = (targetsSelector: string) => {\n\treturn (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<(arg0: DragEvent, arg1: boolean) => any>) => {\n\t\tconst origHandler = descriptor.value!;\n\n\t\tdescriptor.value = function handleDragOver(e: DragEvent) {\n\t\t\tlet isLongDragOver = false;\n\n\t\t\tif (e.target instanceof HTMLElement) {\n\t\t\t\tconst currentTarget = e.target.closest<HTMLElement>(targetsSelector);\n\n\t\t\t\tif (currentTarget === lastTarget && Date.now() - lastTargetDragOverStart >= LONG_DRAG_OVER_THRESHOLD) {\n\t\t\t\t\tisLongDragOver = true;\n\t\t\t\t} else if (currentTarget !== lastTarget) {\n\t\t\t\t\tlastTarget = currentTarget;\n\t\t\t\t\tlastTargetDragOverStart = Date.now();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\torigHandler.apply(this, [e, isLongDragOver]);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n};\n\nexport default longDragOverHandler;\n"]}
|
|
@@ -19,11 +19,10 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
19
19
|
};
|
|
20
20
|
_doNotSyncAttributes: Set<string>;
|
|
21
21
|
_state: import("../UI5ElementMetadata.js").State;
|
|
22
|
+
_internals?: ElementInternals | undefined;
|
|
22
23
|
_getRealDomRef?: (() => HTMLElement) | undefined;
|
|
23
|
-
staticAreaItem?: import("../StaticAreaItem.js").default | undefined;
|
|
24
24
|
readonly _id: string;
|
|
25
25
|
render(): object;
|
|
26
|
-
renderStatic(): object;
|
|
27
26
|
connectedCallback(): Promise<void>;
|
|
28
27
|
disconnectedCallback(): void;
|
|
29
28
|
onBeforeRendering(): void;
|
|
@@ -43,6 +42,7 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
43
42
|
}) => void): void;
|
|
44
43
|
_onChildChange(slotName: string, childChangeInfo: import("../UI5Element.js").ChangeInfo): void;
|
|
45
44
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
45
|
+
formAssociatedCallback(): void;
|
|
46
46
|
_updateAttribute(name: string, newValue: import("../UI5ElementMetadata.js").PropertyValue): void;
|
|
47
47
|
_upgradeProperty(this: Record<string, any>, propertyName: string): void;
|
|
48
48
|
_upgradeAllProperties(): void;
|
|
@@ -71,7 +71,11 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
71
71
|
readonly effectiveDir: string | undefined;
|
|
72
72
|
readonly isUI5Element: boolean;
|
|
73
73
|
readonly classes: import("../types.js").ClassMap;
|
|
74
|
-
|
|
74
|
+
readonly accessibilityInfo: import("../types.js").AccessibilityInfo;
|
|
75
|
+
readonly validity: ValidityState | undefined;
|
|
76
|
+
readonly validationMessage: string | undefined;
|
|
77
|
+
checkValidity(): boolean | undefined;
|
|
78
|
+
reportValidity(): boolean | undefined;
|
|
75
79
|
accessKey: string;
|
|
76
80
|
readonly accessKeyLabel: string;
|
|
77
81
|
autocapitalize: string;
|
|
@@ -260,6 +264,9 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
260
264
|
ariaValueNow: string | null;
|
|
261
265
|
ariaValueText: string | null;
|
|
262
266
|
role: string | null;
|
|
267
|
+
ariaBraileLabel: string | null;
|
|
268
|
+
ariaBraileRoleDescription: string | null;
|
|
269
|
+
ariaDescription: string | null;
|
|
263
270
|
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
|
|
264
271
|
getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
|
|
265
272
|
after(...nodes: (string | Node)[]): void;
|
|
@@ -395,17 +402,14 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
395
402
|
blur(): void;
|
|
396
403
|
};
|
|
397
404
|
template?: import("../renderer/executeTemplate.js").TemplateFunction | undefined;
|
|
398
|
-
staticAreaTemplate?: import("../renderer/executeTemplate.js").TemplateFunction | undefined;
|
|
399
405
|
_metadata: import("../UI5ElementMetadata.js").default;
|
|
400
|
-
|
|
401
|
-
|
|
406
|
+
renderer: import("../UI5Element.js").Renderer;
|
|
407
|
+
readonly formAssociated: boolean;
|
|
402
408
|
readonly observedAttributes: string[];
|
|
403
409
|
_needsShadowDOM(): boolean;
|
|
404
|
-
_needsStaticArea(): boolean;
|
|
405
410
|
_generateAccessors(): void;
|
|
406
411
|
metadata: import("../UI5ElementMetadata.js").Metadata;
|
|
407
|
-
|
|
408
|
-
readonly staticAreaStyles: import("../types.js").ComponentStylesData;
|
|
412
|
+
styles: import("../types.js").ComponentStylesData;
|
|
409
413
|
readonly dependencies: (typeof UI5Element)[];
|
|
410
414
|
getUniqueDependencies(this: typeof UI5Element): (typeof UI5Element)[];
|
|
411
415
|
whenDependenciesDefined(): Promise<(typeof UI5Element)[]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const designTimePropertyAsArray: (value: string) => string[] | null;
|
|
2
|
+
export default designTimePropertyAsArray;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const designTimePropertyAsArray = (value) => {
|
|
2
2
|
const m = /\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(value);
|
|
3
3
|
return m && m[2] ? m[2].split(/,/) : null;
|
|
4
4
|
};
|
|
5
|
+
export default designTimePropertyAsArray;
|
|
5
6
|
//# sourceMappingURL=getDesigntimePropertyAsArray.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDesigntimePropertyAsArray.js","sourceRoot":"","sources":["../../src/util/getDesigntimePropertyAsArray.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"getDesigntimePropertyAsArray.js","sourceRoot":"","sources":["../../src/util/getDesigntimePropertyAsArray.ts"],"names":[],"mappings":"AAAA,MAAM,yBAAyB,GAAG,CAAC,KAAa,EAAE,EAAE;IACnD,MAAM,CAAC,GAAG,oCAAoC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["const designTimePropertyAsArray = (value: string) => {\n\tconst m = /\\$([-a-z0-9A-Z._]+)(?::([^$]*))?\\$/.exec(value);\n\treturn m && m[2] ? m[2].split(/,/) : null;\n};\n\nexport default designTimePropertyAsArray;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1.1,
|
|
3
|
+
"tags": [
|
|
4
|
+
{
|
|
5
|
+
"name": "ui5element",
|
|
6
|
+
"description": "Base class for all UI5 Web Components\n\n\n---\n\n\n\n\n### **Methods:**\n - **onBeforeRendering(): _void_** - Called every time before the component renders.\n- **onAfterRendering(): _void_** - Called every time after the component renders.\n- **onEnterDOM(): _void_** - Called on connectedCallback - added to the DOM.\n- **onExitDOM(): _void_** - Called on disconnectedCallback - removed from the DOM.\n- **attachInvalidate(callback: _(param: InvalidationInfo) => void_): _void_** - Attach a callback that will be executed whenever the component is invalidated\n- **detachInvalidate(callback: _(param: InvalidationInfo) => void_): _void_** - Detach the callback that is executed whenever the component is invalidated\n- **onInvalidation(changeInfo: _ChangeInfo_): _void_** - A callback that is executed each time an already rendered component is invalidated (scheduled for re-rendering)\n- **getDomRef(): _HTMLElement | undefined_** - Returns the DOM Element inside the Shadow Root that corresponds to the opening tag in the UI5 Web Component's template\n*Note:* For logical (abstract) elements (items, options, etc...), returns the part of the parent's DOM that represents this option\nUse this method instead of \"this.shadowRoot\" to read the Shadow DOM, if ever necessary\n- **getFocusDomRef(): _HTMLElement | undefined_** - Returns the DOM Element marked with \"data-sap-focus-ref\" inside the template.\nThis is the element that will receive the focus by default.\n- **getFocusDomRefAsync(): _Promise<HTMLElement | undefined>_** - Waits for dom ref and then returns the DOM Element marked with \"data-sap-focus-ref\" inside the template.\nThis is the element that will receive the focus by default.\n- **focus(focusOptions: _FocusOptions_): _Promise<void>_** - Set the focus to the element, returned by \"getFocusDomRef()\" (marked by \"data-sap-focus-ref\")\n- **getSlottedNodes(): _Array<T>_** - Returns the actual children, associated with a slot.\nUseful when there are transitive slots in nested component scenarios and you don't want to get a list of the slots, but rather of their content.\n- **attachComponentStateFinalized(callback: _() => void_): _void_** - Attach a callback that will be executed whenever the component's state is finalized\n- **detachComponentStateFinalized(callback: _() => void_): _void_** - Detach the callback that is executed whenever the component's state is finalized\n- **getUniqueDependencies(): _Array<typeof UI5Element>_** - Returns a list of the unique dependencies for this UI5 Web Component\n- **define(): _Promise<typeof UI5Element>_** - Registers a UI5 Web Component in the browser window object\n- **getMetadata(): _UI5ElementMetadata_** - Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents')\nNote: not to be confused with the \"get metadata()\" method, which returns an object for this class's metadata only",
|
|
7
|
+
"attributes": [
|
|
8
|
+
{
|
|
9
|
+
"name": "effective-dir",
|
|
10
|
+
"description": "Determines whether the component should be rendered in RTL mode or not.\nReturns: \"rtl\", \"ltr\" or undefined",
|
|
11
|
+
"values": [{ "name": "any" }]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "is-ui5-element",
|
|
15
|
+
"description": "Used to duck-type UI5 elements without using instanceof",
|
|
16
|
+
"values": [{ "name": "any" }]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"references": []
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|