@ui5/webcomponents-base 0.0.0-96e98c995 → 0.0.0-974b11d82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/CHANGELOG.md +53 -0
- package/bundle.esm.js +3 -1
- package/dist/Boot.js +4 -0
- package/dist/Boot.js.map +1 -1
- package/dist/Device.js +109 -34
- package/dist/Device.js.map +1 -1
- package/dist/InitialConfiguration.js +1 -1
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/UI5Element.d.ts +19 -8
- package/dist/UI5Element.js +3 -2
- package/dist/UI5Element.js.map +1 -1
- package/dist/api.json +1 -1
- package/dist/asset-registries/Icons.d.ts +1 -1
- package/dist/asset-registries/Icons.js +21 -21
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +1 -1
- package/dist/asset-registries/Themes.d.ts +1 -0
- package/dist/assets/bundle.esm.ea2cc5c5.js +60 -0
- package/dist/assets-meta/IconCollectionsAlias.d.ts +24 -10
- package/dist/assets-meta/IconCollectionsAlias.js +29 -9
- package/dist/assets-meta/IconCollectionsAlias.js.map +1 -1
- package/dist/config/FormatSettings.d.ts +5 -1
- package/dist/config/FormatSettings.js +5 -1
- package/dist/config/FormatSettings.js.map +1 -1
- package/dist/config/Icons.d.ts +43 -18
- package/dist/config/Icons.js +80 -25
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/RTL.js +3 -0
- package/dist/config/RTL.js.map +1 -1
- package/dist/decorators/customElement.d.ts +17 -2
- package/dist/decorators/customElement.js +17 -2
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/delegate/ResizeHandler.d.ts +2 -1
- package/dist/delegate/ResizeHandler.js +3 -1
- package/dist/delegate/ResizeHandler.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +3 -0
- package/dist/features/F6Navigation.js +77 -38
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/LegacyDateFormats.d.ts +18 -0
- package/dist/features/LegacyDateFormats.js +20 -0
- package/dist/features/LegacyDateFormats.js.map +1 -0
- package/dist/features/OpenUI5Support.d.ts +2 -0
- package/dist/features/OpenUI5Support.js +1 -0
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/css/BusyIndicator.css.d.ts +3 -0
- package/dist/generated/css/BusyIndicator.css.js +7 -5
- package/dist/generated/css/BusyIndicator.css.js.map +1 -0
- package/dist/generated/css/FontFace.css.d.ts +3 -0
- package/dist/generated/css/FontFace.css.js +7 -5
- package/dist/generated/css/FontFace.css.js.map +1 -0
- package/dist/generated/css/OverrideFontFace.css.d.ts +3 -0
- package/dist/generated/css/OverrideFontFace.css.js +7 -5
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +3 -0
- package/dist/generated/css/SystemCSSVars.css.js +7 -5
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
- package/dist/getSharedResource.js +9 -1
- package/dist/getSharedResource.js.map +1 -1
- package/dist/global.d.ts +0 -6
- package/dist/renderer/LitRenderer.d.ts +3 -3
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/theming/CustomStyle.js +7 -5
- package/dist/theming/CustomStyle.js.map +1 -1
- package/dist/theming/getStylesString.d.ts +1 -1
- package/dist/updateShadowRoot.js +4 -0
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/AriaLabelHelper.d.ts +10 -1
- package/dist/util/AriaLabelHelper.js +135 -8
- package/dist/util/AriaLabelHelper.js.map +1 -1
- package/dist/util/FocusableElements.js +11 -2
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +8 -9
- package/lib/generate-styles/index.js +10 -5
- package/package-scripts.js +8 -4
- package/package.json +2 -2
- package/src/Boot.ts +4 -0
- package/src/Device.ts +113 -34
- package/src/InitialConfiguration.ts +1 -1
- package/src/UI5Element.ts +28 -8
- package/src/asset-registries/Icons.ts +26 -27
- package/src/asset-registries/Illustrations.ts +1 -1
- package/src/asset-registries/Themes.ts +5 -0
- package/src/assets-meta/IconCollectionsAlias.ts +32 -9
- package/src/config/FormatSettings.ts +16 -2
- package/src/config/Icons.ts +92 -25
- package/src/config/RTL.ts +4 -0
- package/src/decorators/customElement.ts +42 -2
- package/src/delegate/ResizeHandler.ts +7 -2
- package/src/features/F6Navigation.ts +98 -44
- package/src/features/LegacyDateFormats.ts +40 -0
- package/src/features/OpenUI5Support.ts +5 -0
- package/src/generated/css/BusyIndicator.css.ts +9 -0
- package/src/generated/css/FontFace.css.ts +9 -0
- package/src/generated/css/OverrideFontFace.css.ts +9 -0
- package/src/generated/css/SystemCSSVars.css.ts +9 -0
- package/src/getSharedResource.ts +10 -1
- package/src/global.d.ts +0 -6
- package/src/renderer/LitRenderer.ts +2 -2
- package/src/theming/CustomStyle.ts +7 -5
- package/src/theming/getEffectiveLinksHrefs.ts +1 -1
- package/src/theming/getStylesString.ts +1 -1
- package/src/updateShadowRoot.ts +5 -0
- package/src/util/AriaLabelHelper.ts +167 -12
- package/src/util/FocusableElements.ts +12 -2
- package/dist/assets/bundle.esm.ba5d36d4.js +0 -56
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import LegacyDateFormats from "../features/LegacyDateFormats.js";
|
|
1
2
|
import { getFormatSettings } from "../InitialConfiguration.js";
|
|
3
|
+
import { getFeature } from "../FeaturesRegistry.js";
|
|
2
4
|
let formatSettings;
|
|
3
5
|
/**
|
|
4
6
|
* Returns the first day of the week from the configured format settings or based on the current locale.
|
|
@@ -11,5 +13,7 @@ const getFirstDayOfWeek = () => {
|
|
|
11
13
|
}
|
|
12
14
|
return formatSettings.firstDayOfWeek;
|
|
13
15
|
};
|
|
14
|
-
|
|
16
|
+
const legacyDateFormats = getFeature("LegacyDateFormats");
|
|
17
|
+
const getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };
|
|
18
|
+
export { getFirstDayOfWeek, getLegacyDateCalendarCustomizing, };
|
|
15
19
|
//# sourceMappingURL=FormatSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../src/config/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../src/config/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,IAAI,cAA8B,CAAC;AAEnC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAAuB,EAAE;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE;QACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;KACrC;IAED,OAAO,cAAc,CAAC,cAAc,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;AAEpF,MAAM,gCAAgC,GAAG,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvI,OAAO,EACN,iBAAiB,EACjB,gCAAgC,GAChC,CAAC"}
|
package/dist/config/Icons.d.ts
CHANGED
|
@@ -1,30 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type IconCollection = "SAP-icons" | "SAP-icons-v4" | "SAP-icons-v5" | "horizon" | "tnt" | "tnt-v2" | "tnt-v3" | "business-suite" | "business-suite-v1" | "business-suite-v2" | string;
|
|
2
|
+
declare enum RegisteredIconCollection {
|
|
3
|
+
SAPIconsV4 = "SAP-icons-v4",
|
|
4
|
+
SAPIconsV5 = "SAP-icons-v5",
|
|
5
|
+
SAPIconsTNTV2 = "tnt-v2",
|
|
6
|
+
SAPIconsTNTV3 = "tnt-v3",
|
|
7
|
+
SAPBSIconsV1 = "business-suite-v1",
|
|
8
|
+
SAPBSIconsV2 = "business-suite-v2"
|
|
4
9
|
}
|
|
5
10
|
/**
|
|
6
|
-
* Sets the default icon collection
|
|
7
|
-
*
|
|
11
|
+
* Sets the default icon collection for a given theme.
|
|
12
|
+
*
|
|
13
|
+
* SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)
|
|
14
|
+
* and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: "tnt/actor", "business-suite/1x2-grid-layout", etc.
|
|
15
|
+
* This method allows setting another (built-in or custom) icon collection as default per theme.
|
|
16
|
+
*
|
|
17
|
+
* <b>Usage</b>
|
|
18
|
+
* <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
|
|
19
|
+
*
|
|
20
|
+
* <pre>
|
|
21
|
+
* setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
|
|
22
|
+
*
|
|
23
|
+
* <ui5-icon name="home"></ui5-icon>
|
|
24
|
+
* </pre>
|
|
25
|
+
*
|
|
26
|
+
* <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
|
|
27
|
+
*
|
|
28
|
+
* <pre>
|
|
29
|
+
* setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
|
|
30
|
+
*
|
|
31
|
+
* <ui5-icon name="custom-icon-name"></ui5-icon>
|
|
32
|
+
* </pre>
|
|
8
33
|
*
|
|
9
|
-
* Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
|
|
10
34
|
* @public
|
|
11
|
-
* @param {string} theme
|
|
12
|
-
* @param {
|
|
35
|
+
* @param { string } theme
|
|
36
|
+
* @param { string } collectionName
|
|
13
37
|
*/
|
|
14
|
-
declare const setDefaultIconCollection: (theme: string, collectionName:
|
|
38
|
+
declare const setDefaultIconCollection: (theme: string, collectionName: IconCollection) => void;
|
|
15
39
|
/**
|
|
16
|
-
* Returns the default icon collection
|
|
17
|
-
* that is configured.
|
|
40
|
+
* Returns the configured default icon collection for a given theme.
|
|
18
41
|
*
|
|
19
|
-
* @param {string} theme
|
|
42
|
+
* @param { string } theme
|
|
20
43
|
* @public
|
|
21
|
-
* @returns {string | undefined}
|
|
44
|
+
* @returns { string | undefined }
|
|
22
45
|
*/
|
|
23
46
|
declare const getDefaultIconCollection: (theme: string) => string | undefined;
|
|
24
47
|
/**
|
|
25
|
-
* Returns the effective icon collection
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
48
|
+
* Returns the effective icon collection,
|
|
49
|
+
* based on the default icon collection configuration and the current theme:
|
|
50
|
+
* @param { IconCollection } collectionName
|
|
51
|
+
* @returns { IconCollection } the effective collection name
|
|
28
52
|
*/
|
|
29
|
-
declare const
|
|
30
|
-
export { setDefaultIconCollection, getDefaultIconCollection,
|
|
53
|
+
declare const getEffectiveIconCollection: (collectionName?: IconCollection) => IconCollection;
|
|
54
|
+
export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, };
|
|
55
|
+
export type { IconCollection, };
|
package/dist/config/Icons.js
CHANGED
|
@@ -1,48 +1,103 @@
|
|
|
1
1
|
import { getTheme, isThemeFamily } from "./Theme.js";
|
|
2
|
+
import { getIconCollectionByAlias } from "../assets-meta/IconCollectionsAlias.js";
|
|
2
3
|
const IconCollectionConfiguration = new Map();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
// All registered icon collections - all icon collections resolves to these options at the end
|
|
5
|
+
var RegisteredIconCollection;
|
|
6
|
+
(function (RegisteredIconCollection) {
|
|
7
|
+
RegisteredIconCollection["SAPIconsV4"] = "SAP-icons-v4";
|
|
8
|
+
RegisteredIconCollection["SAPIconsV5"] = "SAP-icons-v5";
|
|
9
|
+
RegisteredIconCollection["SAPIconsTNTV2"] = "tnt-v2";
|
|
10
|
+
RegisteredIconCollection["SAPIconsTNTV3"] = "tnt-v3";
|
|
11
|
+
RegisteredIconCollection["SAPBSIconsV1"] = "business-suite-v1";
|
|
12
|
+
RegisteredIconCollection["SAPBSIconsV2"] = "business-suite-v2";
|
|
13
|
+
})(RegisteredIconCollection || (RegisteredIconCollection = {}));
|
|
8
14
|
/**
|
|
9
|
-
* Sets the default icon collection
|
|
10
|
-
*
|
|
15
|
+
* Sets the default icon collection for a given theme.
|
|
16
|
+
*
|
|
17
|
+
* SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)
|
|
18
|
+
* and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: "tnt/actor", "business-suite/1x2-grid-layout", etc.
|
|
19
|
+
* This method allows setting another (built-in or custom) icon collection as default per theme.
|
|
20
|
+
*
|
|
21
|
+
* <b>Usage</b>
|
|
22
|
+
* <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
|
|
23
|
+
*
|
|
24
|
+
* <pre>
|
|
25
|
+
* setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
|
|
26
|
+
*
|
|
27
|
+
* <ui5-icon name="home"></ui5-icon>
|
|
28
|
+
* </pre>
|
|
29
|
+
*
|
|
30
|
+
* <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
|
|
31
|
+
*
|
|
32
|
+
* <pre>
|
|
33
|
+
* setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
|
|
34
|
+
*
|
|
35
|
+
* <ui5-icon name="custom-icon-name"></ui5-icon>
|
|
36
|
+
* </pre>
|
|
11
37
|
*
|
|
12
|
-
* Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
|
|
13
38
|
* @public
|
|
14
|
-
* @param {string} theme
|
|
15
|
-
* @param {
|
|
39
|
+
* @param { string } theme
|
|
40
|
+
* @param { string } collectionName
|
|
16
41
|
*/
|
|
17
42
|
const setDefaultIconCollection = (theme, collectionName) => {
|
|
18
|
-
if (collectionName === "horizon") {
|
|
19
|
-
collectionName = IconCollection.v5;
|
|
20
|
-
}
|
|
21
43
|
IconCollectionConfiguration.set(theme, collectionName);
|
|
22
44
|
};
|
|
23
45
|
/**
|
|
24
|
-
* Returns the default icon collection
|
|
25
|
-
* that is configured.
|
|
46
|
+
* Returns the configured default icon collection for a given theme.
|
|
26
47
|
*
|
|
27
|
-
* @param {string} theme
|
|
48
|
+
* @param { string } theme
|
|
28
49
|
* @public
|
|
29
|
-
* @returns {string | undefined}
|
|
50
|
+
* @returns { string | undefined }
|
|
30
51
|
*/
|
|
31
52
|
const getDefaultIconCollection = (theme) => {
|
|
32
53
|
return IconCollectionConfiguration.get(theme);
|
|
33
54
|
};
|
|
34
55
|
/**
|
|
35
|
-
* Returns the effective icon collection
|
|
36
|
-
*
|
|
37
|
-
* @
|
|
56
|
+
* Returns the effective icon collection,
|
|
57
|
+
* based on the default icon collection configuration and the current theme:
|
|
58
|
+
* @param { IconCollection } collectionName
|
|
59
|
+
* @returns { IconCollection } the effective collection name
|
|
38
60
|
*/
|
|
39
|
-
const
|
|
61
|
+
const getEffectiveIconCollection = (collectionName) => {
|
|
40
62
|
const currentTheme = getTheme();
|
|
41
63
|
const currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);
|
|
42
|
-
|
|
43
|
-
|
|
64
|
+
// when no collection is set and default collection is configured - return the configured icon collection
|
|
65
|
+
if (!collectionName && currentThemeConfiguration) {
|
|
66
|
+
return getIconCollectionByAlias(currentThemeConfiguration);
|
|
67
|
+
}
|
|
68
|
+
// when collection is set - return the theme dependant icon collection
|
|
69
|
+
// when collection is not set and there is no default icon collection configured - return theme dependant icon collection
|
|
70
|
+
return getIconCollectionByTheme(collectionName);
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Returns the icon theme dependant collection, based on the collection name and current theme as follows:
|
|
74
|
+
*
|
|
75
|
+
* - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon" (or as confugred via setDefaultIconCollection)
|
|
76
|
+
* - "SAP-icons-v4" (and its alias "SAP-icons") forces "SAP-icons v4" in any theme and resolves to itself "SAP-icons-v4"
|
|
77
|
+
* - "SAP-icons-v5" (and its alias "horizon") forces "SAP-icons v5" in any theme and resolves to itself "SAP-icons-v5"
|
|
78
|
+
* - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
|
|
79
|
+
* - "tnt-v2" forces "TNT icons v2" in any theme and resolves to itself "tnt-v2"
|
|
80
|
+
* - "tnt-v3" forces "TNT icons v3" in any theme and resolves to itself "tnt-v3"
|
|
81
|
+
* - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
|
|
82
|
+
* - "business-suite-v1" forces "Business Suite icons v1" in any theme and resolves to itself "business-suite-v1"
|
|
83
|
+
* - "business-suite-v2" forces "Business Suite icons v2" in any theme and resolves to itself "business-suite-v2"
|
|
84
|
+
*
|
|
85
|
+
* <b>Note:</b> "SAP-icons-v4", "SAP-icons-v5", "tnt-v2", "tnt-v3", "business-suite-v1" and "business-suite-v2" are just returned
|
|
86
|
+
* @param { IconCollection } collectionName
|
|
87
|
+
* @returns { RegisteredIconCollection } the registered collection name
|
|
88
|
+
*/
|
|
89
|
+
const getIconCollectionByTheme = (collectionName) => {
|
|
90
|
+
const horizonThemeFamily = isThemeFamily("sap_horizon");
|
|
91
|
+
if (!collectionName) {
|
|
92
|
+
return horizonThemeFamily ? RegisteredIconCollection.SAPIconsV5 : RegisteredIconCollection.SAPIconsV4;
|
|
93
|
+
}
|
|
94
|
+
if (collectionName === "tnt") {
|
|
95
|
+
return horizonThemeFamily ? RegisteredIconCollection.SAPIconsTNTV3 : RegisteredIconCollection.SAPIconsTNTV2;
|
|
96
|
+
}
|
|
97
|
+
if (collectionName === "business-suite") {
|
|
98
|
+
return horizonThemeFamily ? RegisteredIconCollection.SAPBSIconsV2 : RegisteredIconCollection.SAPBSIconsV1;
|
|
44
99
|
}
|
|
45
|
-
return
|
|
100
|
+
return collectionName;
|
|
46
101
|
};
|
|
47
|
-
export { setDefaultIconCollection, getDefaultIconCollection,
|
|
102
|
+
export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, };
|
|
48
103
|
//# sourceMappingURL=Icons.js.map
|
package/dist/config/Icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/config/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/config/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,MAAM,2BAA2B,GAAG,IAAI,GAAG,EAAkB,CAAC;AAK9D,8FAA8F;AAC9F,IAAK,wBAOJ;AAPD,WAAK,wBAAwB;IAC5B,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,oDAAwB,CAAA;IACxB,oDAAwB,CAAA;IACxB,8DAAkC,CAAA;IAClC,8DAAkC,CAAA;AACnC,CAAC,EAPI,wBAAwB,KAAxB,wBAAwB,QAO5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAE,cAA8B,EAAE,EAAE;IAClF,2BAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,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B,wBAAwB,GACxB,CAAC"}
|
package/dist/config/RTL.js
CHANGED
|
@@ -24,6 +24,9 @@ const impliesRTL = (language) => {
|
|
|
24
24
|
* @returns {boolean} whether RTL should be used
|
|
25
25
|
*/
|
|
26
26
|
const getRTL = () => {
|
|
27
|
+
if (typeof document === "undefined") {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
27
30
|
const configurationRTL = getConfiguredRTL();
|
|
28
31
|
if (configurationRTL !== undefined) {
|
|
29
32
|
return !!configurationRTL;
|
package/dist/config/RTL.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTL.js","sourceRoot":"","sources":["../../src/config/RTL.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,4BAA4B,MAAM,yCAAyC,CAAC;AACnF,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AAEzE,MAAM,mBAAmB,GAAG;IAC3B,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACV,CAAC;AAEF,MAAM,aAAa,GAAG,4BAA4B,CAAC,6BAA6B,CAAC,IAAI,EAAE,CAAC;AAExF;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,EAAE;IACvC,QAAQ,GAAG,CAAC,QAAQ,IAAI,mBAAmB,CAAC,QAA4C,CAAC,CAAC,IAAI,QAAQ,CAAC;IAEvG,OAAO,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,GAAG,GAAY,EAAE;IAC5B,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;IAE5C,IAAI,gBAAgB,KAAK,SAAS,EAAE;QACnC,OAAO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AC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,sBAAsB"}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import type UI5Element from "../UI5Element.js";
|
|
2
|
+
import type { Renderer } from "../UI5Element.js";
|
|
3
|
+
import type { TemplateFunction as Template } from "../renderer/executeTemplate.js";
|
|
4
|
+
import type { ComponentStylesData as Styles } from "../types.js";
|
|
1
5
|
/**
|
|
2
6
|
* Returns a custom element class decorator.
|
|
3
7
|
*
|
|
4
|
-
* @param { string }
|
|
8
|
+
* @param { string | object } tagNameOrComponentSettings
|
|
5
9
|
* @returns { ClassDecorator }
|
|
6
10
|
*/
|
|
7
|
-
declare const customElement: (
|
|
11
|
+
declare const customElement: (tagNameOrComponentSettings: string | {
|
|
12
|
+
tag?: string;
|
|
13
|
+
renderer?: Renderer;
|
|
14
|
+
styles?: Styles;
|
|
15
|
+
template?: Template;
|
|
16
|
+
dependencies?: Array<typeof UI5Element>;
|
|
17
|
+
staticAreaStyles?: Styles;
|
|
18
|
+
staticAreaTemplate?: Template;
|
|
19
|
+
languageAware?: boolean;
|
|
20
|
+
themeAware?: boolean;
|
|
21
|
+
fastNavigation?: boolean;
|
|
22
|
+
}) => ClassDecorator;
|
|
8
23
|
export default customElement;
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns a custom element class decorator.
|
|
3
3
|
*
|
|
4
|
-
* @param { string }
|
|
4
|
+
* @param { string | object } tagNameOrComponentSettings
|
|
5
5
|
* @returns { ClassDecorator }
|
|
6
6
|
*/
|
|
7
|
-
const customElement = (
|
|
7
|
+
const customElement = (tagNameOrComponentSettings) => {
|
|
8
8
|
return (target) => {
|
|
9
9
|
if (!Object.prototype.hasOwnProperty.call(target, "decoratorMetadata")) {
|
|
10
10
|
target.decoratorMetadata = {};
|
|
11
11
|
}
|
|
12
|
+
if (typeof tagNameOrComponentSettings === "string") {
|
|
13
|
+
target.decoratorMetadata.tag = tagNameOrComponentSettings;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const { tag, languageAware = false, themeAware = false, fastNavigation = false, } = tagNameOrComponentSettings;
|
|
12
17
|
target.decoratorMetadata.tag = tag;
|
|
18
|
+
target.decoratorMetadata.languageAware = languageAware;
|
|
19
|
+
target.decoratorMetadata.themeAware = themeAware;
|
|
20
|
+
target.decoratorMetadata.fastNavigation = fastNavigation;
|
|
21
|
+
["render", "renderer", "template", "staticAreaTemplate", "styles", "staticAreaStyles", "dependencies"].forEach((customElementEntity) => {
|
|
22
|
+
const _customElementEntity = customElementEntity === "render" ? "renderer" : customElementEntity;
|
|
23
|
+
const customElementEntityValue = tagNameOrComponentSettings[_customElementEntity];
|
|
24
|
+
customElementEntityValue && Object.defineProperty(target, customElementEntity, {
|
|
25
|
+
get: () => customElementEntityValue,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
13
28
|
};
|
|
14
29
|
};
|
|
15
30
|
export default customElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,0BAWtB,EAAkB,EAAE;IACpB,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE;YACvE,MAAM,CAAC,iBAAiB,GAAG,EAAE,CAAC;SAC9B;QAED,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE;YACnD,MAAM,CAAC,iBAAiB,CAAC,GAAG,GAAG,0BAA0B,CAAC;YAC1D,OAAO;SACP;QAED,MAAM,EACL,GAAG,EACH,aAAa,GAAG,KAAK,EACrB,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,KAAK,GACrB,GAAG,0BAA0B,CAAC;QAEhC,MAAM,CAAC,iBAAiB,CAAC,GAAG,GAAG,GAAG,CAAC;QACnC,MAAM,CAAC,iBAAiB,CAAC,aAAa,GAAG,aAAa,CAAC;QACvD,MAAM,CAAC,iBAAiB,CAAC,UAAU,GAAG,UAAU,CAAC;QACjD,MAAM,CAAC,iBAAiB,CAAC,cAAc,GAAG,cAAc,CAAC;QAEzD,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,mBAA2B,EAAE,EAAE;YAC9I,MAAM,oBAAoB,GAAG,mBAAmB,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC;YACjG,MAAM,wBAAwB,GAAG,0BAA0B,CAAC,oBAAwC,CAAC,CAAC;YAEtG,wBAAwB,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE;gBAC9E,GAAG,EAAE,GAAG,EAAE,CAAC,wBAAwB;aACnC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ResizeObserverCallback = () => void;
|
|
1
|
+
type ResizeObserverCallback = () => Promise<void> | void;
|
|
2
2
|
/**
|
|
3
3
|
* Allows to register/deregister resize observers for a DOM element
|
|
4
4
|
*
|
|
@@ -22,3 +22,4 @@ declare class ResizeHandler {
|
|
|
22
22
|
static deregister(element: HTMLElement, callback: ResizeObserverCallback): void;
|
|
23
23
|
}
|
|
24
24
|
export default ResizeHandler;
|
|
25
|
+
export type { ResizeObserverCallback, };
|
|
@@ -6,7 +6,9 @@ const getResizeObserver = () => {
|
|
|
6
6
|
resizeObserver = new window.ResizeObserver(entries => {
|
|
7
7
|
entries.forEach(entry => {
|
|
8
8
|
const callbacks = observedElements.get(entry.target);
|
|
9
|
-
|
|
9
|
+
// Callbacks could be async and we need to handle returned promises to comply with the eslint "no-misused-promises" rule.
|
|
10
|
+
// Although Promise.all awaits all, we don't additonal task after calling the callbacks and should not make any difference.
|
|
11
|
+
callbacks && Promise.all(callbacks.map((callback) => callback()));
|
|
10
12
|
});
|
|
11
13
|
});
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandler.js","sourceRoot":"","sources":["../../src/delegate/ResizeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,IAAI,cAA8B,CAAC;AACnC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA8C,CAAC;AAE/E,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,IAAI,CAAC,cAAc,EAAE;QACpB,cAAc,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YACpD,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACvB,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAC;gBACpE,SAAS,
|
|
1
|
+
{"version":3,"file":"ResizeHandler.js","sourceRoot":"","sources":["../../src/delegate/ResizeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,IAAI,cAA8B,CAAC;AACnC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA8C,CAAC;AAE/E,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,IAAI,CAAC,cAAc,EAAE;QACpB,cAAc,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YACpD,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACvB,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,C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C,CAAC;KACjD;AACF,CAAC,CAAC;AAEF;;;;;IAKI;AACJ,MAAM,aAAa;IAClB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAoB,EAAE,QAAgC;QACrE,IAAI,gBAAgB,GAA4B,OAAO,CAAC;QAExD,IAAI,oBAAoB,CAAC,gBAAgB,CAAC,EAAE;YAC3C,gBAAgB,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;SAChD;QAED,IAAI,gBAAgB,YAAY,WAAW,EAAE;YAC5C,OAAO,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;SACpC;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,2CAA2C,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB;SAC1F;IACF,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,OAAoB,EAAE,QAAgC;QACvE,IAAI,gBAAgB,GAA4B,OAAO,CAAC;QAExD,IAAI,oBAAoB,CAAC,gBAAgB,CAAC,EAAE;YAC3C,gBAAgB,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;SAChD;QAED,IAAI,gBAAgB,YAAY,WAAW,EAAE;YAC5C,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;SACtC;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB;SAC5F;IACF,CAAC;CACD;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -5,6 +5,9 @@ declare class F6Navigation {
|
|
|
5
5
|
groups: Array<HTMLElement>;
|
|
6
6
|
constructor();
|
|
7
7
|
attachEventListeners(): void;
|
|
8
|
+
groupElementToFocus(nextElement: HTMLElement): Promise<HTMLElement | undefined>;
|
|
9
|
+
findNextFocusableGroupElement(currentIndex: number): Promise<HTMLElement | undefined>;
|
|
10
|
+
findPreviousFocusableGroupElement(currentIndex: number): Promise<HTMLElement | undefined>;
|
|
8
11
|
_keydownHandler(event: KeyboardEvent): Promise<void>;
|
|
9
12
|
removeEventListeners(): void;
|
|
10
13
|
updateGroups(): void;
|
|
@@ -3,6 +3,7 @@ import { isF6Next, isF6Previous } from "../Keys.js";
|
|
|
3
3
|
import { instanceOfUI5Element } from "../UI5Element.js";
|
|
4
4
|
import { getFirstFocusableElement } from "../util/FocusableElements.js";
|
|
5
5
|
import getFastNavigationGroups from "../util/getFastNavigationGroups.js";
|
|
6
|
+
import isElementClickable from "../util/isElementClickable.js";
|
|
6
7
|
class F6Navigation {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.selectedGroup = null;
|
|
@@ -13,47 +14,51 @@ class F6Navigation {
|
|
|
13
14
|
attachEventListeners() {
|
|
14
15
|
document.addEventListener("keydown", this.keydownHandler);
|
|
15
16
|
}
|
|
16
|
-
async
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
return;
|
|
17
|
+
async groupElementToFocus(nextElement) {
|
|
18
|
+
const nextElementDomRef = instanceOfUI5Element(nextElement) ? nextElement.getDomRef() : nextElement;
|
|
19
|
+
if (nextElementDomRef) {
|
|
20
|
+
if (isElementClickable(nextElementDomRef)) {
|
|
21
|
+
return nextElementDomRef;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (this.selectedGroup) {
|
|
26
|
-
nextIndex = this.groups.indexOf(this.selectedGroup);
|
|
23
|
+
const elementToFocus = await getFirstFocusableElement(nextElementDomRef);
|
|
24
|
+
if (elementToFocus) {
|
|
25
|
+
return elementToFocus;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async findNextFocusableGroupElement(currentIndex) {
|
|
30
|
+
let elementToFocus;
|
|
31
|
+
/* eslint-disable no-await-in-loop */
|
|
32
|
+
for (let index = 0; index < this.groups.length; index++) {
|
|
33
|
+
let nextElement;
|
|
34
|
+
if (currentIndex > -1) {
|
|
35
|
+
if (currentIndex + 1 >= this.groups.length) {
|
|
36
|
+
currentIndex = 0;
|
|
37
|
+
nextElement = this.groups[currentIndex];
|
|
31
38
|
}
|
|
32
39
|
else {
|
|
33
|
-
|
|
40
|
+
currentIndex += 1;
|
|
41
|
+
nextElement = this.groups[currentIndex];
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
else {
|
|
37
|
-
|
|
45
|
+
currentIndex = 0;
|
|
46
|
+
nextElement = this.groups[currentIndex];
|
|
38
47
|
}
|
|
39
|
-
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
elementToFocus?.focus();
|
|
48
|
+
elementToFocus = await this.groupElementToFocus(nextElement);
|
|
49
|
+
if (elementToFocus) {
|
|
50
|
+
break;
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
/* eslint-enable no-await-in-loop */
|
|
54
|
+
return elementToFocus;
|
|
55
|
+
}
|
|
56
|
+
async findPreviousFocusableGroupElement(currentIndex) {
|
|
57
|
+
let elementToFocus;
|
|
58
|
+
/* eslint-disable no-await-in-loop */
|
|
59
|
+
for (let index = 0; index < this.groups.length; index++) {
|
|
52
60
|
let nextElement;
|
|
53
|
-
if (
|
|
54
|
-
nextIndex = this.groups.indexOf(this.selectedGroup);
|
|
55
|
-
}
|
|
56
|
-
if (nextIndex > 0) {
|
|
61
|
+
if (currentIndex > 0) {
|
|
57
62
|
// Handle the situation where the first focusable element of two neighbor groups is the same
|
|
58
63
|
// For example:
|
|
59
64
|
// <ui5-flexible-column-layout>
|
|
@@ -62,19 +67,53 @@ class F6Navigation {
|
|
|
62
67
|
// </ui5-list>
|
|
63
68
|
// </ui5-flexible-column-layout>
|
|
64
69
|
// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)
|
|
65
|
-
const firstFocusable = await
|
|
66
|
-
const shouldSkipParent = firstFocusable === await
|
|
67
|
-
|
|
70
|
+
const firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);
|
|
71
|
+
const shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);
|
|
72
|
+
currentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;
|
|
73
|
+
if (currentIndex < 0) {
|
|
74
|
+
currentIndex = this.groups.length - 1;
|
|
75
|
+
}
|
|
76
|
+
nextElement = this.groups[currentIndex];
|
|
68
77
|
}
|
|
69
78
|
else {
|
|
70
|
-
|
|
79
|
+
currentIndex = this.groups.length - 1;
|
|
80
|
+
nextElement = this.groups[currentIndex];
|
|
71
81
|
}
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
elementToFocus?.focus();
|
|
82
|
+
elementToFocus = await this.groupElementToFocus(nextElement);
|
|
83
|
+
if (elementToFocus) {
|
|
84
|
+
break;
|
|
76
85
|
}
|
|
77
86
|
}
|
|
87
|
+
/* eslint-enable no-await-in-loop */
|
|
88
|
+
return elementToFocus;
|
|
89
|
+
}
|
|
90
|
+
async _keydownHandler(event) {
|
|
91
|
+
const forward = isF6Next(event);
|
|
92
|
+
const backward = isF6Previous(event);
|
|
93
|
+
if (!(forward || backward)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.updateGroups();
|
|
97
|
+
if (this.groups.length < 1) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
let elementToFocus;
|
|
102
|
+
if (this.groups.length === 0) {
|
|
103
|
+
elementToFocus = await this.groupElementToFocus(this.groups[0]);
|
|
104
|
+
return elementToFocus?.focus();
|
|
105
|
+
}
|
|
106
|
+
let currentIndex = -1;
|
|
107
|
+
if (this.selectedGroup) {
|
|
108
|
+
currentIndex = this.groups.indexOf(this.selectedGroup);
|
|
109
|
+
}
|
|
110
|
+
if (forward) {
|
|
111
|
+
elementToFocus = await this.findNextFocusableGroupElement(currentIndex);
|
|
112
|
+
}
|
|
113
|
+
if (backward) {
|
|
114
|
+
elementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);
|
|
115
|
+
}
|
|
116
|
+
elementToFocus?.focus();
|
|
78
117
|
}
|
|
79
118
|
removeEventListeners() {
|
|
80
119
|
document.removeEventListener("keydown", this.keydownHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAE/D,MAAM,YAAY;IAMjB;QAHA,kBAAa,GAAuB,IAAI,CAAC;QACzC,WAAM,GAAuB,EAAE,CAAC;QAG/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAmC,CAAC;QACxF,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,oBAAoB;QACnB,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI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AAC,CAAC;IACtD,CAAC;IAED,gBAAgB,CAAC,OAA6B,MAAM,CAAC,QAAQ;QAC5D,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,OAAO,GAAgC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjE,OAAO,OAAO,IAAK,OAAmB,CAAC,YAAY,CAAC,0BAA0B,CAAC,KAAK,MAAM,IAAI,OAAO,KAAK,WAAW,EAAE;YACtH,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAE,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;SAC/F;QAED,IAAI,CAAC,aAAa,GAAG,OAAsB,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,IAA0B;QACpC,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;YACxD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;SACtD;QAED,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;SACpC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FormatSettings } from "../config/FormatSettings.js";
|
|
2
|
+
type IslamicToGregorianMapping = {
|
|
3
|
+
dateFormat: string;
|
|
4
|
+
islamicMonthStart: string;
|
|
5
|
+
gregDate: string;
|
|
6
|
+
};
|
|
7
|
+
type LegacyDateCalendarCustomizing = Array<IslamicToGregorianMapping>;
|
|
8
|
+
declare class LegacyDateFormats {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the currently set customizing data for Islamic calendar support
|
|
11
|
+
*
|
|
12
|
+
* @return {object[]} Returns an array that contains the customizing data.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
static getLegacyDateCalendarCustomizing(this: void): LegacyDateCalendarCustomizing;
|
|
16
|
+
}
|
|
17
|
+
export default LegacyDateFormats;
|
|
18
|
+
export type { FormatSettings, LegacyDateCalendarCustomizing, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getFormatSettings } from "../InitialConfiguration.js";
|
|
2
|
+
import { registerFeature } from "../FeaturesRegistry.js";
|
|
3
|
+
let formatSettings;
|
|
4
|
+
class LegacyDateFormats {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the currently set customizing data for Islamic calendar support
|
|
7
|
+
*
|
|
8
|
+
* @return {object[]} Returns an array that contains the customizing data.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
static getLegacyDateCalendarCustomizing() {
|
|
12
|
+
if (formatSettings === undefined) {
|
|
13
|
+
formatSettings = getFormatSettings();
|
|
14
|
+
}
|
|
15
|
+
return formatSettings.legacyDateCalendarCustomizing || [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
registerFeature("LegacyDateFormats", LegacyDateFormats);
|
|
19
|
+
export default LegacyDateFormats;
|
|
20
|
+
//# sourceMappingURL=LegacyDateFormats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyDateFormats.js","sourceRoot":"","sources":["../../src/features/LegacyDateFormats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAazD,IAAI,cAA8B,CAAC;AAEnC,MAAM,iBAAiB;IACtB;;;;;OAKG;IACH,MAAM,CAAC,gCAAgC;QACtC,IAAI,cAAc,KAAK,SAAS,EAAE;YACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;SACrC;QAED,OAAO,cAAc,CAAC,6BAA6B,IAAI,EAAE,CAAC;IAC3D,CAAC;CACD;AAED,eAAe,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;AAExD,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CLDRData } from "../asset-registries/LocaleData.js";
|
|
2
|
+
import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
|
|
2
3
|
declare class OpenUI5Support {
|
|
3
4
|
static isLoaded(): boolean;
|
|
4
5
|
static init(): Promise<void>;
|
|
@@ -11,6 +12,7 @@ declare class OpenUI5Support {
|
|
|
11
12
|
calendarType: string;
|
|
12
13
|
formatSettings: {
|
|
13
14
|
firstDayOfWeek: any;
|
|
15
|
+
legacyDateCalendarCustomizing: LegacyDateCalendarCustomizing;
|
|
14
16
|
};
|
|
15
17
|
} | undefined;
|
|
16
18
|
static getLocaleDataObject(): CLDRData | undefined;
|
|
@@ -38,6 +38,7 @@ class OpenUI5Support {
|
|
|
38
38
|
calendarType: config.getCalendarType(),
|
|
39
39
|
formatSettings: {
|
|
40
40
|
firstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,
|
|
41
|
+
legacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),
|
|
41
42
|
},
|
|
42
43
|
};
|
|
43
44
|
}
|