@ui5/webcomponents-localization 0.0.0-dff5837d7 → 0.0.0-e55c2cec6
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 +260 -0
- package/README.md +36 -6
- package/dist/Assets-static.d.ts +1 -0
- package/dist/Assets-static.js +3 -0
- package/dist/Assets-static.js.map +1 -0
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +1 -0
- package/dist/Assets.js.map +1 -0
- package/dist/DateFormat.d.ts +6 -0
- package/dist/DateFormat.js +6 -2
- package/dist/DateFormat.js.map +1 -0
- package/dist/LocaleData.d.ts +6 -0
- package/dist/LocaleData.js +6 -2
- package/dist/LocaleData.js.map +1 -0
- package/dist/dates/CalendarDate.d.ts +41 -0
- package/dist/dates/CalendarDate.js +170 -181
- package/dist/dates/CalendarDate.js.map +1 -0
- package/dist/dates/ExtremeDates.d.ts +5 -0
- package/dist/dates/ExtremeDates.js +29 -0
- package/dist/dates/ExtremeDates.js.map +1 -0
- package/dist/dates/UniversalDate.d.ts +46 -0
- package/dist/dates/UniversalDate.js +5 -0
- package/dist/dates/UniversalDate.js.map +1 -0
- package/dist/dates/calculateWeekNumber.d.ts +4 -0
- package/dist/dates/calculateWeekNumber.js +42 -48
- package/dist/dates/calculateWeekNumber.js.map +1 -0
- package/dist/dates/convertMonthNumbersToMonthNames.d.ts +16 -0
- package/dist/dates/convertMonthNumbersToMonthNames.js +30 -0
- package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -0
- package/dist/dates/getDaysInMonth.d.ts +3 -0
- package/dist/dates/getDaysInMonth.js +10 -0
- package/dist/dates/getDaysInMonth.js.map +1 -0
- package/dist/dates/getRoundedTimestamp.d.ts +7 -0
- package/dist/dates/getRoundedTimestamp.js +14 -0
- package/dist/dates/getRoundedTimestamp.js.map +1 -0
- package/dist/dates/getTodayUTCTimestamp.d.ts +7 -0
- package/dist/dates/getTodayUTCTimestamp.js +8 -0
- package/dist/dates/getTodayUTCTimestamp.js.map +1 -0
- package/dist/dates/modifyDateBy.d.ts +13 -0
- package/dist/dates/modifyDateBy.js +40 -0
- package/dist/dates/modifyDateBy.js.map +1 -0
- package/dist/dates/transformDateToSecondaryType.d.ts +7 -0
- package/dist/dates/transformDateToSecondaryType.js +17 -0
- package/dist/dates/transformDateToSecondaryType.js.map +1 -0
- package/{src/features/calendar/Buddhist.js → dist/features/calendar/Buddhist.d.ts} +0 -0
- package/dist/features/calendar/Buddhist.js +1 -0
- package/dist/features/calendar/Buddhist.js.map +1 -0
- package/{src/features/calendar/Gregorian.js → dist/features/calendar/Gregorian.d.ts} +0 -0
- package/dist/features/calendar/Gregorian.js +1 -0
- package/dist/features/calendar/Gregorian.js.map +1 -0
- package/{src/features/calendar/Islamic.js → dist/features/calendar/Islamic.d.ts} +0 -0
- package/dist/features/calendar/Islamic.js +1 -0
- package/dist/features/calendar/Islamic.js.map +1 -0
- package/{src/features/calendar/Japanese.js → dist/features/calendar/Japanese.d.ts} +0 -0
- package/dist/features/calendar/Japanese.js +1 -0
- package/dist/features/calendar/Japanese.js.map +1 -0
- package/{src/features/calendar/Persian.js → dist/features/calendar/Persian.d.ts} +0 -0
- package/dist/features/calendar/Persian.js +1 -0
- package/dist/features/calendar/Persian.js.map +1 -0
- package/dist/generated/assets/cldr/ar.json +803 -3
- package/dist/generated/assets/cldr/ar_EG.json +803 -3
- package/dist/generated/assets/cldr/ar_SA.json +803 -3
- package/dist/generated/assets/cldr/bg.json +768 -3
- package/dist/generated/assets/cldr/ca.json +802 -3
- package/dist/generated/assets/cldr/cs.json +801 -3
- package/dist/generated/assets/cldr/cy.json +6614 -0
- package/dist/generated/assets/cldr/da.json +768 -3
- package/dist/generated/assets/cldr/de.json +802 -3
- package/dist/generated/assets/cldr/de_AT.json +802 -3
- package/dist/generated/assets/cldr/de_CH.json +802 -3
- package/dist/generated/assets/cldr/el.json +701 -3
- package/dist/generated/assets/cldr/el_CY.json +701 -3
- package/dist/generated/assets/cldr/en.json +767 -3
- package/dist/generated/assets/cldr/en_AU.json +768 -4
- package/dist/generated/assets/cldr/en_GB.json +767 -3
- package/dist/generated/assets/cldr/en_HK.json +767 -3
- package/dist/generated/assets/cldr/en_IE.json +767 -3
- package/dist/generated/assets/cldr/en_IN.json +767 -3
- package/dist/generated/assets/cldr/en_NZ.json +767 -3
- package/dist/generated/assets/cldr/en_PG.json +767 -3
- package/dist/generated/assets/cldr/en_SG.json +767 -3
- package/dist/generated/assets/cldr/en_ZA.json +767 -3
- package/dist/generated/assets/cldr/es.json +734 -3
- package/dist/generated/assets/cldr/es_AR.json +734 -3
- package/dist/generated/assets/cldr/es_BO.json +737 -6
- package/dist/generated/assets/cldr/es_CL.json +737 -6
- package/dist/generated/assets/cldr/es_CO.json +734 -3
- package/dist/generated/assets/cldr/es_MX.json +737 -6
- package/dist/generated/assets/cldr/es_PE.json +737 -6
- package/dist/generated/assets/cldr/es_UY.json +737 -6
- package/dist/generated/assets/cldr/es_VE.json +736 -5
- package/dist/generated/assets/cldr/et.json +767 -3
- package/dist/generated/assets/cldr/fa.json +769 -3
- package/dist/generated/assets/cldr/fi.json +801 -3
- package/dist/generated/assets/cldr/fr.json +767 -3
- package/dist/generated/assets/cldr/fr_BE.json +767 -3
- package/dist/generated/assets/cldr/fr_CA.json +767 -3
- package/dist/generated/assets/cldr/fr_CH.json +767 -3
- package/dist/generated/assets/cldr/fr_LU.json +767 -3
- package/dist/generated/assets/cldr/he.json +802 -3
- package/dist/generated/assets/cldr/hi.json +734 -3
- package/dist/generated/assets/cldr/hr.json +767 -3
- package/dist/generated/assets/cldr/hu.json +835 -3
- package/dist/generated/assets/cldr/id.json +767 -3
- package/dist/generated/assets/cldr/it.json +767 -3
- package/dist/generated/assets/cldr/it_CH.json +767 -3
- package/dist/generated/assets/cldr/ja.json +801 -3
- package/dist/generated/assets/cldr/kk.json +767 -3
- package/dist/generated/assets/cldr/ko.json +801 -3
- package/dist/generated/assets/cldr/lt.json +767 -3
- package/dist/generated/assets/cldr/lv.json +767 -3
- package/dist/generated/assets/cldr/ms.json +735 -3
- package/dist/generated/assets/cldr/nb.json +768 -3
- package/dist/generated/assets/cldr/nl.json +734 -3
- package/dist/generated/assets/cldr/nl_BE.json +734 -3
- package/dist/generated/assets/cldr/pl.json +801 -3
- package/dist/generated/assets/cldr/pt.json +767 -3
- package/dist/generated/assets/cldr/pt_PT.json +767 -3
- package/dist/generated/assets/cldr/ro.json +767 -3
- package/dist/generated/assets/cldr/ru.json +767 -3
- package/dist/generated/assets/cldr/ru_UA.json +767 -3
- package/dist/generated/assets/cldr/sk.json +801 -3
- package/dist/generated/assets/cldr/sl.json +801 -3
- package/dist/generated/assets/cldr/sr.json +767 -3
- package/dist/generated/assets/cldr/sr_Latn.json +5891 -0
- package/dist/generated/assets/cldr/sv.json +768 -3
- package/dist/generated/assets/cldr/th.json +835 -3
- package/dist/generated/assets/cldr/tr.json +835 -3
- package/dist/generated/assets/cldr/uk.json +767 -3
- package/dist/generated/assets/cldr/vi.json +767 -3
- package/dist/generated/assets/cldr/zh_CN.json +803 -4
- package/dist/generated/assets/cldr/zh_HK.json +803 -4
- package/dist/generated/assets/cldr/zh_SG.json +803 -4
- package/dist/generated/assets/cldr/zh_TW.json +802 -3
- package/dist/generated/json-imports/LocaleData-static.js +90 -0
- package/dist/generated/json-imports/LocaleData.js +88 -91
- package/dist/getCachedLocaleDataInstance.d.ts +4 -0
- package/dist/getCachedLocaleDataInstance.js +10 -0
- package/dist/getCachedLocaleDataInstance.js.map +1 -0
- package/dist/locale/getLocaleData.d.ts +11 -0
- package/dist/locale/getLocaleData.js +13 -17
- package/dist/locale/getLocaleData.js.map +1 -0
- package/dist/sap/base/Log.js +28 -37
- package/dist/sap/base/assert.js +5 -10
- package/dist/sap/base/util/LoaderExtensions.d.ts +4 -0
- package/dist/sap/base/util/LoaderExtensions.js +11 -4
- package/dist/sap/base/util/LoaderExtensions.js.map +1 -0
- package/dist/sap/base/util/array/uniqueSort.js +7 -7
- package/dist/sap/base/util/deepEqual.js +1 -5
- package/dist/sap/ui/base/Interface.js +3 -5
- package/dist/sap/ui/base/Metadata.js +1 -3
- package/dist/sap/ui/base/Object.js +26 -2
- package/dist/sap/ui/core/Configuration.d.ts +17 -0
- package/dist/sap/ui/core/Configuration.js +20 -0
- package/dist/sap/ui/core/Configuration.js.map +1 -0
- package/dist/sap/ui/core/Core.d.ts +26 -0
- package/dist/sap/ui/core/Core.js +7 -32
- package/dist/sap/ui/core/Core.js.map +1 -0
- package/dist/sap/ui/core/FormatSettings.d.ts +10 -0
- package/dist/sap/ui/core/FormatSettings.js +13 -0
- package/dist/sap/ui/core/FormatSettings.js.map +1 -0
- package/dist/sap/ui/core/Locale.js +70 -31
- package/dist/sap/ui/core/LocaleData.js +133 -1506
- package/dist/sap/ui/core/date/Buddhist.js +0 -6
- package/dist/sap/ui/core/date/CalendarUtils.js +36 -0
- package/dist/sap/ui/core/date/CalendarWeekNumbering.js +7 -0
- package/dist/sap/ui/core/date/Islamic.js +3 -3
- package/dist/sap/ui/core/date/Japanese.js +4 -4
- package/dist/sap/ui/core/date/UniversalDate.js +82 -23
- package/dist/sap/ui/core/format/DateFormat.js +530 -222
- package/dist/sap/ui/core/format/TimezoneUtil.js +94 -0
- package/package-scripts.js +14 -7
- package/package.json +13 -14
- package/src/Assets-static.ts +2 -0
- package/src/{Assets.js → Assets.ts} +0 -0
- package/src/DateFormat.ts +8 -0
- package/src/LocaleData.ts +8 -0
- package/src/dates/{CalendarDate.js → CalendarDate.ts} +64 -35
- package/src/dates/ExtremeDates.ts +40 -0
- package/src/dates/UniversalDate.ts +51 -0
- package/src/dates/{calculateWeekNumber.js → calculateWeekNumber.ts} +5 -3
- package/src/dates/convertMonthNumbersToMonthNames.ts +34 -0
- package/src/dates/getDaysInMonth.ts +11 -0
- package/src/dates/getRoundedTimestamp.ts +14 -0
- package/src/dates/getTodayUTCTimestamp.ts +10 -0
- package/src/dates/modifyDateBy.ts +42 -0
- package/src/dates/transformDateToSecondaryType.ts +21 -0
- package/src/features/calendar/Buddhist.ts +1 -0
- package/src/features/calendar/Gregorian.ts +1 -0
- package/src/features/calendar/Islamic.ts +1 -0
- package/src/features/calendar/Japanese.ts +1 -0
- package/src/features/calendar/Persian.ts +1 -0
- package/src/getCachedLocaleDataInstance.ts +15 -0
- package/src/locale/{getLocaleData.js → getLocaleData.ts} +9 -8
- package/src/sap/base/util/LoaderExtensions.ts +17 -0
- package/src/sap/ui/core/{Core.js → Configuration.ts} +5 -21
- package/src/sap/ui/core/Core.ts +15 -0
- package/src/sap/ui/core/FormatSettings.ts +15 -0
- package/tsconfig.json +13 -0
- package/used-modules.txt +4 -1
- package/src/DateFormat.js +0 -3
- package/src/LocaleData.js +0 -3
- package/src/sap/base/util/LoaderExtensions.js +0 -7
@@ -0,0 +1,90 @@
|
|
1
|
+
import { registerLocaleDataLoader } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
|
+
|
3
|
+
import ar from "../assets/cldr/ar.json";
|
4
|
+
import ar_EG from "../assets/cldr/ar_EG.json";
|
5
|
+
import ar_SA from "../assets/cldr/ar_SA.json";
|
6
|
+
import bg from "../assets/cldr/bg.json";
|
7
|
+
import ca from "../assets/cldr/ca.json";
|
8
|
+
import cs from "../assets/cldr/cs.json";
|
9
|
+
import da from "../assets/cldr/da.json";
|
10
|
+
import de from "../assets/cldr/de.json";
|
11
|
+
import de_AT from "../assets/cldr/de_AT.json";
|
12
|
+
import de_CH from "../assets/cldr/de_CH.json";
|
13
|
+
import el from "../assets/cldr/el.json";
|
14
|
+
import el_CY from "../assets/cldr/el_CY.json";
|
15
|
+
import en from "../assets/cldr/en.json";
|
16
|
+
import en_AU from "../assets/cldr/en_AU.json";
|
17
|
+
import en_GB from "../assets/cldr/en_GB.json";
|
18
|
+
import en_HK from "../assets/cldr/en_HK.json";
|
19
|
+
import en_IE from "../assets/cldr/en_IE.json";
|
20
|
+
import en_IN from "../assets/cldr/en_IN.json";
|
21
|
+
import en_NZ from "../assets/cldr/en_NZ.json";
|
22
|
+
import en_PG from "../assets/cldr/en_PG.json";
|
23
|
+
import en_SG from "../assets/cldr/en_SG.json";
|
24
|
+
import en_ZA from "../assets/cldr/en_ZA.json";
|
25
|
+
import es from "../assets/cldr/es.json";
|
26
|
+
import es_AR from "../assets/cldr/es_AR.json";
|
27
|
+
import es_BO from "../assets/cldr/es_BO.json";
|
28
|
+
import es_CL from "../assets/cldr/es_CL.json";
|
29
|
+
import es_CO from "../assets/cldr/es_CO.json";
|
30
|
+
import es_MX from "../assets/cldr/es_MX.json";
|
31
|
+
import es_PE from "../assets/cldr/es_PE.json";
|
32
|
+
import es_UY from "../assets/cldr/es_UY.json";
|
33
|
+
import es_VE from "../assets/cldr/es_VE.json";
|
34
|
+
import et from "../assets/cldr/et.json";
|
35
|
+
import fa from "../assets/cldr/fa.json";
|
36
|
+
import fi from "../assets/cldr/fi.json";
|
37
|
+
import fr from "../assets/cldr/fr.json";
|
38
|
+
import fr_BE from "../assets/cldr/fr_BE.json";
|
39
|
+
import fr_CA from "../assets/cldr/fr_CA.json";
|
40
|
+
import fr_CH from "../assets/cldr/fr_CH.json";
|
41
|
+
import fr_LU from "../assets/cldr/fr_LU.json";
|
42
|
+
import he from "../assets/cldr/he.json";
|
43
|
+
import hi from "../assets/cldr/hi.json";
|
44
|
+
import hr from "../assets/cldr/hr.json";
|
45
|
+
import hu from "../assets/cldr/hu.json";
|
46
|
+
import id from "../assets/cldr/id.json";
|
47
|
+
import it from "../assets/cldr/it.json";
|
48
|
+
import it_CH from "../assets/cldr/it_CH.json";
|
49
|
+
import ja from "../assets/cldr/ja.json";
|
50
|
+
import kk from "../assets/cldr/kk.json";
|
51
|
+
import ko from "../assets/cldr/ko.json";
|
52
|
+
import lt from "../assets/cldr/lt.json";
|
53
|
+
import lv from "../assets/cldr/lv.json";
|
54
|
+
import ms from "../assets/cldr/ms.json";
|
55
|
+
import nb from "../assets/cldr/nb.json";
|
56
|
+
import nl from "../assets/cldr/nl.json";
|
57
|
+
import nl_BE from "../assets/cldr/nl_BE.json";
|
58
|
+
import pl from "../assets/cldr/pl.json";
|
59
|
+
import pt from "../assets/cldr/pt.json";
|
60
|
+
import pt_PT from "../assets/cldr/pt_PT.json";
|
61
|
+
import ro from "../assets/cldr/ro.json";
|
62
|
+
import ru from "../assets/cldr/ru.json";
|
63
|
+
import ru_UA from "../assets/cldr/ru_UA.json";
|
64
|
+
import sk from "../assets/cldr/sk.json";
|
65
|
+
import sl from "../assets/cldr/sl.json";
|
66
|
+
import sr from "../assets/cldr/sr.json";
|
67
|
+
import sr_Latn from "../assets/cldr/sr_Latn.json";
|
68
|
+
import sv from "../assets/cldr/sv.json";
|
69
|
+
import th from "../assets/cldr/th.json";
|
70
|
+
import tr from "../assets/cldr/tr.json";
|
71
|
+
import uk from "../assets/cldr/uk.json";
|
72
|
+
import vi from "../assets/cldr/vi.json";
|
73
|
+
import zh_CN from "../assets/cldr/zh_CN.json";
|
74
|
+
import zh_HK from "../assets/cldr/zh_HK.json";
|
75
|
+
import zh_SG from "../assets/cldr/zh_SG.json";
|
76
|
+
import zh_TW from "../assets/cldr/zh_TW.json";
|
77
|
+
|
78
|
+
const cldrData = {
|
79
|
+
ar,ar_EG,ar_SA,bg,ca,cs,da,de,de_AT,de_CH,el,el_CY,en,en_AU,en_GB,en_HK,en_IE,en_IN,en_NZ,en_PG,en_SG,en_ZA,es,es_AR,es_BO,es_CL,es_CO,es_MX,es_PE,es_UY,es_VE,et,fa,fi,fr,fr_BE,fr_CA,fr_CH,fr_LU,he,hi,hr,hu,id,it,it_CH,ja,kk,ko,lt,lv,ms,nb,nl,nl_BE,pl,pt,pt_PT,ro,ru,ru_UA,sk,sl,sr,sr_Latn,sv,th,tr,uk,vi,zh_CN,zh_HK,zh_SG,zh_TW
|
80
|
+
};
|
81
|
+
|
82
|
+
const fetchCldrJson = async (localeId) => {
|
83
|
+
if (typeof cldrData[localeId] === "object") {
|
84
|
+
// inlined from build
|
85
|
+
throw new Error("[LocaleData] Inlined JSON not supported with static imports of assets. Use dynamic imports of assets or configure JSON imports as URLs")
|
86
|
+
}
|
87
|
+
return (await fetch(cldrData[localeId])).json();
|
88
|
+
}
|
89
|
+
|
90
|
+
Object.keys(cldrData).forEach(localeId => registerLocaleDataLoader(localeId, fetchCldrJson));
|
@@ -1,96 +1,93 @@
|
|
1
|
-
import {
|
1
|
+
import { registerLocaleDataLoader } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
2
|
|
3
|
-
|
4
|
-
import ar_EG from "../assets/cldr/ar_EG.json";
|
5
|
-
import ar_SA from "../assets/cldr/ar_SA.json";
|
6
|
-
import bg from "../assets/cldr/bg.json";
|
7
|
-
import ca from "../assets/cldr/ca.json";
|
8
|
-
import cs from "../assets/cldr/cs.json";
|
9
|
-
import da from "../assets/cldr/da.json";
|
10
|
-
import de from "../assets/cldr/de.json";
|
11
|
-
import de_AT from "../assets/cldr/de_AT.json";
|
12
|
-
import de_CH from "../assets/cldr/de_CH.json";
|
13
|
-
import el from "../assets/cldr/el.json";
|
14
|
-
import el_CY from "../assets/cldr/el_CY.json";
|
15
|
-
import en from "../assets/cldr/en.json";
|
16
|
-
import en_AU from "../assets/cldr/en_AU.json";
|
17
|
-
import en_GB from "../assets/cldr/en_GB.json";
|
18
|
-
import en_HK from "../assets/cldr/en_HK.json";
|
19
|
-
import en_IE from "../assets/cldr/en_IE.json";
|
20
|
-
import en_IN from "../assets/cldr/en_IN.json";
|
21
|
-
import en_NZ from "../assets/cldr/en_NZ.json";
|
22
|
-
import en_PG from "../assets/cldr/en_PG.json";
|
23
|
-
import en_SG from "../assets/cldr/en_SG.json";
|
24
|
-
import en_ZA from "../assets/cldr/en_ZA.json";
|
25
|
-
import es from "../assets/cldr/es.json";
|
26
|
-
import es_AR from "../assets/cldr/es_AR.json";
|
27
|
-
import es_BO from "../assets/cldr/es_BO.json";
|
28
|
-
import es_CL from "../assets/cldr/es_CL.json";
|
29
|
-
import es_CO from "../assets/cldr/es_CO.json";
|
30
|
-
import es_MX from "../assets/cldr/es_MX.json";
|
31
|
-
import es_PE from "../assets/cldr/es_PE.json";
|
32
|
-
import es_UY from "../assets/cldr/es_UY.json";
|
33
|
-
import es_VE from "../assets/cldr/es_VE.json";
|
34
|
-
import et from "../assets/cldr/et.json";
|
35
|
-
import fa from "../assets/cldr/fa.json";
|
36
|
-
import fi from "../assets/cldr/fi.json";
|
37
|
-
import fr from "../assets/cldr/fr.json";
|
38
|
-
import fr_BE from "../assets/cldr/fr_BE.json";
|
39
|
-
import fr_CA from "../assets/cldr/fr_CA.json";
|
40
|
-
import fr_CH from "../assets/cldr/fr_CH.json";
|
41
|
-
import fr_LU from "../assets/cldr/fr_LU.json";
|
42
|
-
import he from "../assets/cldr/he.json";
|
43
|
-
import hi from "../assets/cldr/hi.json";
|
44
|
-
import hr from "../assets/cldr/hr.json";
|
45
|
-
import hu from "../assets/cldr/hu.json";
|
46
|
-
import id from "../assets/cldr/id.json";
|
47
|
-
import it from "../assets/cldr/it.json";
|
48
|
-
import it_CH from "../assets/cldr/it_CH.json";
|
49
|
-
import ja from "../assets/cldr/ja.json";
|
50
|
-
import kk from "../assets/cldr/kk.json";
|
51
|
-
import ko from "../assets/cldr/ko.json";
|
52
|
-
import lt from "../assets/cldr/lt.json";
|
53
|
-
import lv from "../assets/cldr/lv.json";
|
54
|
-
import ms from "../assets/cldr/ms.json";
|
55
|
-
import nb from "../assets/cldr/nb.json";
|
56
|
-
import nl from "../assets/cldr/nl.json";
|
57
|
-
import nl_BE from "../assets/cldr/nl_BE.json";
|
58
|
-
import pl from "../assets/cldr/pl.json";
|
59
|
-
import pt from "../assets/cldr/pt.json";
|
60
|
-
import pt_PT from "../assets/cldr/pt_PT.json";
|
61
|
-
import ro from "../assets/cldr/ro.json";
|
62
|
-
import ru from "../assets/cldr/ru.json";
|
63
|
-
import ru_UA from "../assets/cldr/ru_UA.json";
|
64
|
-
import sk from "../assets/cldr/sk.json";
|
65
|
-
import sl from "../assets/cldr/sl.json";
|
66
|
-
import sr from "../assets/cldr/sr.json";
|
67
|
-
import sv from "../assets/cldr/sv.json";
|
68
|
-
import th from "../assets/cldr/th.json";
|
69
|
-
import tr from "../assets/cldr/tr.json";
|
70
|
-
import uk from "../assets/cldr/uk.json";
|
71
|
-
import vi from "../assets/cldr/vi.json";
|
72
|
-
import zh_CN from "../assets/cldr/zh_CN.json";
|
73
|
-
import zh_HK from "../assets/cldr/zh_HK.json";
|
74
|
-
import zh_SG from "../assets/cldr/zh_SG.json";
|
75
|
-
import zh_TW from "../assets/cldr/zh_TW.json";
|
3
|
+
const availableLocales = ["ar","ar_EG","ar_SA","bg","ca","cs","da","de","de_AT","de_CH","el","el_CY","en","en_AU","en_GB","en_HK","en_IE","en_IN","en_NZ","en_PG","en_SG","en_ZA","es","es_AR","es_BO","es_CL","es_CO","es_MX","es_PE","es_UY","es_VE","et","fa","fi","fr","fr_BE","fr_CA","fr_CH","fr_LU","he","hi","hr","hu","id","it","it_CH","ja","kk","ko","lt","lv","ms","nb","nl","nl_BE","pl","pt","pt_PT","ro","ru","ru_UA","sk","sl","sr","sr_Latn","sv","th","tr","uk","vi","zh_CN","zh_HK","zh_SG","zh_TW"];
|
76
4
|
|
77
|
-
const
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
5
|
+
const importCldrJson = async (localeId) => {
|
6
|
+
switch (localeId) {
|
7
|
+
case "ar": return (await import("../assets/cldr/ar.json")).default;
|
8
|
+
case "ar_EG": return (await import("../assets/cldr/ar_EG.json")).default;
|
9
|
+
case "ar_SA": return (await import("../assets/cldr/ar_SA.json")).default;
|
10
|
+
case "bg": return (await import("../assets/cldr/bg.json")).default;
|
11
|
+
case "ca": return (await import("../assets/cldr/ca.json")).default;
|
12
|
+
case "cs": return (await import("../assets/cldr/cs.json")).default;
|
13
|
+
case "da": return (await import("../assets/cldr/da.json")).default;
|
14
|
+
case "de": return (await import("../assets/cldr/de.json")).default;
|
15
|
+
case "de_AT": return (await import("../assets/cldr/de_AT.json")).default;
|
16
|
+
case "de_CH": return (await import("../assets/cldr/de_CH.json")).default;
|
17
|
+
case "el": return (await import("../assets/cldr/el.json")).default;
|
18
|
+
case "el_CY": return (await import("../assets/cldr/el_CY.json")).default;
|
19
|
+
case "en": return (await import("../assets/cldr/en.json")).default;
|
20
|
+
case "en_AU": return (await import("../assets/cldr/en_AU.json")).default;
|
21
|
+
case "en_GB": return (await import("../assets/cldr/en_GB.json")).default;
|
22
|
+
case "en_HK": return (await import("../assets/cldr/en_HK.json")).default;
|
23
|
+
case "en_IE": return (await import("../assets/cldr/en_IE.json")).default;
|
24
|
+
case "en_IN": return (await import("../assets/cldr/en_IN.json")).default;
|
25
|
+
case "en_NZ": return (await import("../assets/cldr/en_NZ.json")).default;
|
26
|
+
case "en_PG": return (await import("../assets/cldr/en_PG.json")).default;
|
27
|
+
case "en_SG": return (await import("../assets/cldr/en_SG.json")).default;
|
28
|
+
case "en_ZA": return (await import("../assets/cldr/en_ZA.json")).default;
|
29
|
+
case "es": return (await import("../assets/cldr/es.json")).default;
|
30
|
+
case "es_AR": return (await import("../assets/cldr/es_AR.json")).default;
|
31
|
+
case "es_BO": return (await import("../assets/cldr/es_BO.json")).default;
|
32
|
+
case "es_CL": return (await import("../assets/cldr/es_CL.json")).default;
|
33
|
+
case "es_CO": return (await import("../assets/cldr/es_CO.json")).default;
|
34
|
+
case "es_MX": return (await import("../assets/cldr/es_MX.json")).default;
|
35
|
+
case "es_PE": return (await import("../assets/cldr/es_PE.json")).default;
|
36
|
+
case "es_UY": return (await import("../assets/cldr/es_UY.json")).default;
|
37
|
+
case "es_VE": return (await import("../assets/cldr/es_VE.json")).default;
|
38
|
+
case "et": return (await import("../assets/cldr/et.json")).default;
|
39
|
+
case "fa": return (await import("../assets/cldr/fa.json")).default;
|
40
|
+
case "fi": return (await import("../assets/cldr/fi.json")).default;
|
41
|
+
case "fr": return (await import("../assets/cldr/fr.json")).default;
|
42
|
+
case "fr_BE": return (await import("../assets/cldr/fr_BE.json")).default;
|
43
|
+
case "fr_CA": return (await import("../assets/cldr/fr_CA.json")).default;
|
44
|
+
case "fr_CH": return (await import("../assets/cldr/fr_CH.json")).default;
|
45
|
+
case "fr_LU": return (await import("../assets/cldr/fr_LU.json")).default;
|
46
|
+
case "he": return (await import("../assets/cldr/he.json")).default;
|
47
|
+
case "hi": return (await import("../assets/cldr/hi.json")).default;
|
48
|
+
case "hr": return (await import("../assets/cldr/hr.json")).default;
|
49
|
+
case "hu": return (await import("../assets/cldr/hu.json")).default;
|
50
|
+
case "id": return (await import("../assets/cldr/id.json")).default;
|
51
|
+
case "it": return (await import("../assets/cldr/it.json")).default;
|
52
|
+
case "it_CH": return (await import("../assets/cldr/it_CH.json")).default;
|
53
|
+
case "ja": return (await import("../assets/cldr/ja.json")).default;
|
54
|
+
case "kk": return (await import("../assets/cldr/kk.json")).default;
|
55
|
+
case "ko": return (await import("../assets/cldr/ko.json")).default;
|
56
|
+
case "lt": return (await import("../assets/cldr/lt.json")).default;
|
57
|
+
case "lv": return (await import("../assets/cldr/lv.json")).default;
|
58
|
+
case "ms": return (await import("../assets/cldr/ms.json")).default;
|
59
|
+
case "nb": return (await import("../assets/cldr/nb.json")).default;
|
60
|
+
case "nl": return (await import("../assets/cldr/nl.json")).default;
|
61
|
+
case "nl_BE": return (await import("../assets/cldr/nl_BE.json")).default;
|
62
|
+
case "pl": return (await import("../assets/cldr/pl.json")).default;
|
63
|
+
case "pt": return (await import("../assets/cldr/pt.json")).default;
|
64
|
+
case "pt_PT": return (await import("../assets/cldr/pt_PT.json")).default;
|
65
|
+
case "ro": return (await import("../assets/cldr/ro.json")).default;
|
66
|
+
case "ru": return (await import("../assets/cldr/ru.json")).default;
|
67
|
+
case "ru_UA": return (await import("../assets/cldr/ru_UA.json")).default;
|
68
|
+
case "sk": return (await import("../assets/cldr/sk.json")).default;
|
69
|
+
case "sl": return (await import("../assets/cldr/sl.json")).default;
|
70
|
+
case "sr": return (await import("../assets/cldr/sr.json")).default;
|
71
|
+
case "sr_Latn": return (await import("../assets/cldr/sr_Latn.json")).default;
|
72
|
+
case "sv": return (await import("../assets/cldr/sv.json")).default;
|
73
|
+
case "th": return (await import("../assets/cldr/th.json")).default;
|
74
|
+
case "tr": return (await import("../assets/cldr/tr.json")).default;
|
75
|
+
case "uk": return (await import("../assets/cldr/uk.json")).default;
|
76
|
+
case "vi": return (await import("../assets/cldr/vi.json")).default;
|
77
|
+
case "zh_CN": return (await import("../assets/cldr/zh_CN.json")).default;
|
78
|
+
case "zh_HK": return (await import("../assets/cldr/zh_HK.json")).default;
|
79
|
+
case "zh_SG": return (await import("../assets/cldr/zh_SG.json")).default;
|
80
|
+
case "zh_TW": return (await import("../assets/cldr/zh_TW.json")).default;
|
81
|
+
default: throw "unknown locale"
|
82
|
+
}
|
87
83
|
}
|
88
84
|
|
89
|
-
|
90
|
-
|
91
|
-
if (typeof
|
92
|
-
|
93
|
-
} else {
|
94
|
-
registerCldr(key, value);
|
85
|
+
const importAndCheck = async (localeId) => {
|
86
|
+
const data = await importCldrJson(localeId);
|
87
|
+
if (typeof data === "string" && data.endsWith(".json")) {
|
88
|
+
throw new Error(`[LocaleData] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use 'import ".../Assets-static.js"'. Check the "Assets" documentation for more information.`);
|
95
89
|
}
|
96
|
-
|
90
|
+
return data;
|
91
|
+
}
|
92
|
+
|
93
|
+
availableLocales.forEach(localeId => registerLocaleDataLoader(localeId, importAndCheck));
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import LocaleData from "./LocaleData.js";
|
2
|
+
const cache = new Map();
|
3
|
+
const getCachedLocaleDataInstance = (locale) => {
|
4
|
+
if (!cache.has(locale)) {
|
5
|
+
cache.set(locale, new LocaleData(locale));
|
6
|
+
}
|
7
|
+
return cache.get(locale);
|
8
|
+
};
|
9
|
+
export default getCachedLocaleDataInstance;
|
10
|
+
//# sourceMappingURL=getCachedLocaleDataInstance.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getCachedLocaleDataInstance.js","sourceRoot":"","sources":["../src/getCachedLocaleDataInstance.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;AAE5C,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,EAAE;IACtD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACvB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,UAAU,CAAC,MAA4B,CAAC,CAAC,CAAC;KAChE;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import LocaleData from "../LocaleData.js";
|
2
|
+
/**
|
3
|
+
* Fetches and returns а LocaleData object for the required locale
|
4
|
+
* For more information on this object's API, please see:
|
5
|
+
* https://sdk.openui5.org/api/sap.ui.core.LocaleData
|
6
|
+
*
|
7
|
+
* @param { string } lang - if left empty, will use the configured/current locale
|
8
|
+
* @returns { Promise<LocaleData> }
|
9
|
+
*/
|
10
|
+
declare const getLocaleData: (lang: string) => Promise<LocaleData>;
|
11
|
+
export default getLocaleData;
|
@@ -1,27 +1,23 @@
|
|
1
1
|
import { fetchCldr } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
2
|
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
3
|
-
import LocaleData from "../
|
4
|
-
|
3
|
+
import LocaleData from "../LocaleData.js";
|
5
4
|
const instances = new Map();
|
6
|
-
|
7
5
|
/**
|
8
6
|
* Fetches and returns а LocaleData object for the required locale
|
9
7
|
* For more information on this object's API, please see:
|
10
|
-
* https://
|
8
|
+
* https://sdk.openui5.org/api/sap.ui.core.LocaleData
|
11
9
|
*
|
12
|
-
* @param lang - if left empty, will use the configured/current locale
|
13
|
-
* @returns {LocaleData}
|
10
|
+
* @param { string } lang - if left empty, will use the configured/current locale
|
11
|
+
* @returns { Promise<LocaleData> }
|
14
12
|
*/
|
15
|
-
const getLocaleData = async lang => {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
return instances.get(localeLang);
|
13
|
+
const getLocaleData = async (lang) => {
|
14
|
+
const locale = getLocale(lang);
|
15
|
+
const localeLang = locale.getLanguage();
|
16
|
+
if (!instances.has(localeLang)) {
|
17
|
+
await fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());
|
18
|
+
instances.set(localeLang, new LocaleData(locale));
|
19
|
+
}
|
20
|
+
return instances.get(localeLang);
|
25
21
|
};
|
26
|
-
|
27
22
|
export default getLocaleData;
|
23
|
+
//# sourceMappingURL=getLocaleData.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getLocaleData.js","sourceRoot":"","sources":["../../src/locale/getLocaleData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6DAA6D,CAAC;AACxF,OAAO,SAAS,MAAM,kDAAkD,CAAC;AAEzE,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,IAAY,EAAuB,EAAE;IACjE,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAExC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC/B,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9E,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,UAAU,CAAC,MAA4B,CAAC,CAAC,CAAC;KACxE;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/sap/base/Log.js
CHANGED
@@ -10,7 +10,7 @@ Log.Level = {
|
|
10
10
|
TRACE: 5,
|
11
11
|
ALL: 5 + 1
|
12
12
|
};
|
13
|
-
var
|
13
|
+
var aLog = [], mMaxLevel = { '': Log.Level.ERROR }, iLogEntriesLimit = 3000, oListener = null, bLogSupportInfo = false;
|
14
14
|
function pad0(i, w) {
|
15
15
|
return ('000' + String(i)).slice(-w);
|
16
16
|
}
|
@@ -72,26 +72,26 @@ function getLogEntryListenerInstance() {
|
|
72
72
|
}
|
73
73
|
return oListener;
|
74
74
|
}
|
75
|
-
Log.fatal = function (sMessage,
|
76
|
-
log(Log.Level.FATAL, sMessage,
|
75
|
+
Log.fatal = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
76
|
+
log(Log.Level.FATAL, sMessage, vDetails, sComponent, fnSupportInfo);
|
77
77
|
};
|
78
|
-
Log.error = function (sMessage,
|
79
|
-
log(Log.Level.ERROR, sMessage,
|
78
|
+
Log.error = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
79
|
+
log(Log.Level.ERROR, sMessage, vDetails, sComponent, fnSupportInfo);
|
80
80
|
};
|
81
|
-
Log.warning = function (sMessage,
|
82
|
-
log(Log.Level.WARNING, sMessage,
|
81
|
+
Log.warning = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
82
|
+
log(Log.Level.WARNING, sMessage, vDetails, sComponent, fnSupportInfo);
|
83
83
|
};
|
84
|
-
Log.info = function (sMessage,
|
85
|
-
log(Log.Level.INFO, sMessage,
|
84
|
+
Log.info = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
85
|
+
log(Log.Level.INFO, sMessage, vDetails, sComponent, fnSupportInfo);
|
86
86
|
};
|
87
|
-
Log.debug = function (sMessage,
|
88
|
-
log(Log.Level.DEBUG, sMessage,
|
87
|
+
Log.debug = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
88
|
+
log(Log.Level.DEBUG, sMessage, vDetails, sComponent, fnSupportInfo);
|
89
89
|
};
|
90
|
-
Log.trace = function (sMessage,
|
91
|
-
log(Log.Level.TRACE, sMessage,
|
90
|
+
Log.trace = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
91
|
+
log(Log.Level.TRACE, sMessage, vDetails, sComponent, fnSupportInfo);
|
92
92
|
};
|
93
93
|
Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
|
94
|
-
sComponent = sComponent ||
|
94
|
+
sComponent = sComponent || '';
|
95
95
|
if (!_bDefault || mMaxLevel[sComponent] == null) {
|
96
96
|
mMaxLevel[sComponent] = iLogLevel;
|
97
97
|
var sLogLevel;
|
@@ -104,24 +104,23 @@ Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
|
|
104
104
|
}
|
105
105
|
};
|
106
106
|
Log.getLevel = function (sComponent) {
|
107
|
-
return level(sComponent
|
107
|
+
return level(sComponent);
|
108
108
|
};
|
109
109
|
Log.isLoggable = function (iLevel, sComponent) {
|
110
|
-
return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent
|
110
|
+
return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent);
|
111
111
|
};
|
112
112
|
Log.logSupportInfo = function (bEnabled) {
|
113
113
|
bLogSupportInfo = bEnabled;
|
114
114
|
};
|
115
|
-
function log(iLevel, sMessage,
|
116
|
-
if (!fnSupportInfo && !sComponent && typeof
|
117
|
-
fnSupportInfo =
|
118
|
-
|
115
|
+
function log(iLevel, sMessage, vDetails, sComponent, fnSupportInfo) {
|
116
|
+
if (!fnSupportInfo && !sComponent && typeof vDetails === 'function') {
|
117
|
+
fnSupportInfo = vDetails;
|
118
|
+
vDetails = '';
|
119
119
|
}
|
120
120
|
if (!fnSupportInfo && typeof sComponent === 'function') {
|
121
121
|
fnSupportInfo = sComponent;
|
122
122
|
sComponent = '';
|
123
123
|
}
|
124
|
-
sComponent = sComponent || sDefaultComponent;
|
125
124
|
if (iLevel <= level(sComponent)) {
|
126
125
|
var fNow = now(), oNow = new Date(fNow), iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000), oLogEntry = {
|
127
126
|
time: pad0(oNow.getHours(), 2) + ':' + pad0(oNow.getMinutes(), 2) + ':' + pad0(oNow.getSeconds(), 2) + '.' + pad0(oNow.getMilliseconds(), 3) + pad0(iMicroSeconds, 3),
|
@@ -129,7 +128,7 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
|
|
129
128
|
timestamp: fNow,
|
130
129
|
level: iLevel,
|
131
130
|
message: String(sMessage || ''),
|
132
|
-
details: String(
|
131
|
+
details: String(vDetails || ''),
|
133
132
|
component: String(sComponent || '')
|
134
133
|
};
|
135
134
|
if (bLogSupportInfo && typeof fnSupportInfo === 'function') {
|
@@ -145,35 +144,27 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
|
|
145
144
|
oListener.onLogEntry(oLogEntry);
|
146
145
|
}
|
147
146
|
if (console) {
|
148
|
-
var isDetailsError =
|
147
|
+
var isDetailsError = vDetails instanceof Error, logText = oLogEntry.date + ' ' + oLogEntry.time + ' ' + oLogEntry.message + ' - ' + oLogEntry.details + ' ' + oLogEntry.component;
|
149
148
|
switch (iLevel) {
|
150
149
|
case Log.Level.FATAL:
|
151
150
|
case Log.Level.ERROR:
|
152
|
-
isDetailsError ? console.error(logText, '\n',
|
151
|
+
isDetailsError ? console.error(logText, '\n', vDetails) : console.error(logText);
|
153
152
|
break;
|
154
153
|
case Log.Level.WARNING:
|
155
|
-
isDetailsError ? console.warn(logText, '\n',
|
154
|
+
isDetailsError ? console.warn(logText, '\n', vDetails) : console.warn(logText);
|
156
155
|
break;
|
157
156
|
case Log.Level.INFO:
|
158
157
|
if (console.info) {
|
159
|
-
isDetailsError ? console.info(logText, '\n',
|
158
|
+
isDetailsError ? console.info(logText, '\n', vDetails) : console.info(logText);
|
160
159
|
} else {
|
161
|
-
isDetailsError ? console.log(logText, '\n',
|
160
|
+
isDetailsError ? console.log(logText, '\n', vDetails) : console.log(logText);
|
162
161
|
}
|
163
162
|
break;
|
164
163
|
case Log.Level.DEBUG:
|
165
|
-
|
166
|
-
isDetailsError ? console.debug(logText, '\n', sDetails) : console.debug(logText);
|
167
|
-
} else {
|
168
|
-
isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText);
|
169
|
-
}
|
164
|
+
isDetailsError ? console.debug(logText, '\n', vDetails) : console.debug(logText);
|
170
165
|
break;
|
171
166
|
case Log.Level.TRACE:
|
172
|
-
|
173
|
-
isDetailsError ? console.trace(logText, '\n', sDetails) : console.trace(logText);
|
174
|
-
} else {
|
175
|
-
isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText);
|
176
|
-
}
|
167
|
+
isDetailsError ? console.trace(logText, '\n', vDetails) : console.trace(logText);
|
177
168
|
break;
|
178
169
|
}
|
179
170
|
if (console.info && oLogEntry.supportInfo) {
|
package/dist/sap/base/assert.js
CHANGED
@@ -1,12 +1,7 @@
|
|
1
|
-
import Log from './Log.js';
|
2
1
|
var fnAssert = function (bResult, vMessage) {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
} else {
|
8
|
-
Log.debug('[Assertions] ' + sMessage);
|
9
|
-
}
|
10
|
-
}
|
2
|
+
if (!bResult) {
|
3
|
+
var sMessage = typeof vMessage === "function" ? vMessage() : vMessage;
|
4
|
+
console.assert(bResult, sMessage);
|
5
|
+
}
|
11
6
|
};
|
12
|
-
export default fnAssert;
|
7
|
+
export default fnAssert;
|
@@ -1,7 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { getLocaleData } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
|
+
const loadResource = (moduleName) => {
|
3
|
+
const moduleFormat = moduleName.match(/sap\/ui\/core\/cldr\/(\w+)\.json/);
|
4
|
+
if (!moduleFormat) {
|
5
|
+
throw new Error(`Unknown module "${moduleName}"`);
|
6
|
+
}
|
7
|
+
const localeId = moduleFormat[1];
|
8
|
+
return getLocaleData(localeId);
|
9
|
+
};
|
3
10
|
const LoaderExtensions = {
|
4
|
-
|
11
|
+
loadResource,
|
5
12
|
};
|
6
|
-
|
7
13
|
export default LoaderExtensions;
|
14
|
+
//# sourceMappingURL=LoaderExtensions.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LoaderExtensions.js","sourceRoot":"","sources":["../../../../src/sap/base/util/LoaderExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAC;AAE5F,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC3C,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC1E,IAAI,CAAC,YAAY,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;KAClD;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACjC,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACxB,YAAY;CACZ,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import assert from '../../assert.js';
|
2
2
|
var fnUniqueSort = function (aArray) {
|
3
|
-
assert(aArray
|
4
|
-
var
|
5
|
-
if (
|
3
|
+
assert(Array.isArray(aArray), 'uniqueSort: input parameter must be an Array');
|
4
|
+
var iLength = aArray.length;
|
5
|
+
if (iLength > 1) {
|
6
6
|
aArray.sort();
|
7
7
|
var j = 0;
|
8
|
-
for (var i = 1; i <
|
9
|
-
if (aArray[i]
|
8
|
+
for (var i = 1; i < iLength; i++) {
|
9
|
+
if (aArray.indexOf(aArray[i]) === i) {
|
10
10
|
aArray[++j] = aArray[i];
|
11
11
|
}
|
12
12
|
}
|
13
|
-
if (++j <
|
14
|
-
aArray.splice(j,
|
13
|
+
if (++j < iLength) {
|
14
|
+
aArray.splice(j, iLength - j);
|
15
15
|
}
|
16
16
|
}
|
17
17
|
return aArray;
|
@@ -14,11 +14,7 @@ var fnEqual = function (a, b, maxDepth, contains, depth) {
|
|
14
14
|
Log.warning('deepEqual comparison exceeded maximum recursion depth of ' + maxDepth + '. Treating values as unequal');
|
15
15
|
return false;
|
16
16
|
}
|
17
|
-
if (a === b) {
|
18
|
-
return true;
|
19
|
-
}
|
20
|
-
var bIsReallyNaN = typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);
|
21
|
-
if (bIsReallyNaN) {
|
17
|
+
if (a === b || Number.isNaN(a) && Number.isNaN(b)) {
|
22
18
|
return true;
|
23
19
|
}
|
24
20
|
if (Array.isArray(a) && Array.isArray(b)) {
|
@@ -1,16 +1,14 @@
|
|
1
|
-
var
|
2
|
-
var Interface = function (oObject, aMethods, bFacade) {
|
1
|
+
var Interface = function (oObject, aMethods, _bReturnFacade) {
|
3
2
|
if (!oObject) {
|
4
3
|
return oObject;
|
5
4
|
}
|
6
|
-
BaseObject = BaseObject || sap.ui.requireSync("sap/ui/base/Object");
|
7
5
|
function fCreateDelegator(oObject, sMethodName) {
|
8
6
|
return function () {
|
9
7
|
var tmp = oObject[sMethodName].apply(oObject, arguments);
|
10
|
-
if (
|
8
|
+
if (_bReturnFacade) {
|
11
9
|
return this;
|
12
10
|
} else {
|
13
|
-
return tmp
|
11
|
+
return typeof tmp.getInterface === "function" ? tmp.getInterface() : tmp;
|
14
12
|
}
|
15
13
|
};
|
16
14
|
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import ObjectPath from '../../base/util/ObjectPath.js';
|
2
|
-
import Device from '../Device.js';
|
3
2
|
import assert from '../../base/assert.js';
|
4
3
|
import Log from '../../base/Log.js';
|
5
4
|
import uniqueSort from '../../base/util/array/uniqueSort.js';
|
@@ -112,7 +111,6 @@ Metadata.prototype.isInstanceOf = function (sInterface) {
|
|
112
111
|
}
|
113
112
|
return false;
|
114
113
|
};
|
115
|
-
var WRITABLE_IFF_PHANTOM = !!Device.browser.phantomJS;
|
116
114
|
Object.defineProperty(Metadata.prototype, '_mImplementedTypes', {
|
117
115
|
get: function () {
|
118
116
|
if (this === Metadata.prototype) {
|
@@ -128,7 +126,7 @@ Object.defineProperty(Metadata.prototype, '_mImplementedTypes', {
|
|
128
126
|
}
|
129
127
|
Object.defineProperty(this, '_mImplementedTypes', {
|
130
128
|
value: Object.freeze(result),
|
131
|
-
writable:
|
129
|
+
writable: false,
|
132
130
|
configurable: false
|
133
131
|
});
|
134
132
|
return result;
|