@ui5/webcomponents-localization 0.0.0-dff5837d7 → 0.0.0-e03cd01f3

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.
Files changed (243) hide show
  1. package/.eslintignore +2 -0
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +2218 -0
  4. package/LICENSE.txt +201 -0
  5. package/README.md +38 -10
  6. package/dist/.tsbuildinfo +1 -0
  7. package/dist/Assets-fetch.d.ts +1 -0
  8. package/dist/Assets-fetch.js +3 -0
  9. package/dist/Assets-fetch.js.map +1 -0
  10. package/dist/Assets-node.d.ts +11 -0
  11. package/dist/Assets-node.js +12 -0
  12. package/dist/Assets-node.js.map +1 -0
  13. package/dist/Assets.d.ts +1 -0
  14. package/dist/Assets.js +1 -0
  15. package/dist/Assets.js.map +1 -0
  16. package/dist/CalendarUtils.d.ts +3 -0
  17. package/dist/CalendarUtils.js +6 -0
  18. package/dist/CalendarUtils.js.map +1 -0
  19. package/dist/DateFormat.d.ts +5 -0
  20. package/dist/DateFormat.js +6 -2
  21. package/dist/DateFormat.js.map +1 -0
  22. package/dist/LocaleData.d.ts +5 -0
  23. package/dist/LocaleData.js +6 -2
  24. package/dist/LocaleData.js.map +1 -0
  25. package/dist/dates/CalendarDate.d.ts +42 -0
  26. package/dist/dates/CalendarDate.js +171 -181
  27. package/dist/dates/CalendarDate.js.map +1 -0
  28. package/dist/dates/ExtremeDates.d.ts +5 -0
  29. package/dist/dates/ExtremeDates.js +29 -0
  30. package/dist/dates/ExtremeDates.js.map +1 -0
  31. package/dist/dates/UI5Date.d.ts +5 -0
  32. package/dist/dates/UI5Date.js +7 -0
  33. package/dist/dates/UI5Date.js.map +1 -0
  34. package/dist/dates/UniversalDate.d.ts +47 -0
  35. package/dist/dates/UniversalDate.js +5 -0
  36. package/dist/dates/UniversalDate.js.map +1 -0
  37. package/dist/dates/convertMonthNumbersToMonthNames.d.ts +16 -0
  38. package/dist/dates/convertMonthNumbersToMonthNames.js +30 -0
  39. package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -0
  40. package/dist/dates/getDaysInMonth.d.ts +3 -0
  41. package/dist/dates/getDaysInMonth.js +10 -0
  42. package/dist/dates/getDaysInMonth.js.map +1 -0
  43. package/dist/dates/getRoundedTimestamp.d.ts +7 -0
  44. package/dist/dates/getRoundedTimestamp.js +15 -0
  45. package/dist/dates/getRoundedTimestamp.js.map +1 -0
  46. package/dist/dates/getTodayUTCTimestamp.d.ts +7 -0
  47. package/dist/dates/getTodayUTCTimestamp.js +9 -0
  48. package/dist/dates/getTodayUTCTimestamp.js.map +1 -0
  49. package/dist/dates/modifyDateBy.d.ts +14 -0
  50. package/dist/dates/modifyDateBy.js +55 -0
  51. package/dist/dates/modifyDateBy.js.map +1 -0
  52. package/dist/dates/transformDateToSecondaryType.d.ts +7 -0
  53. package/dist/dates/transformDateToSecondaryType.js +18 -0
  54. package/dist/dates/transformDateToSecondaryType.js.map +1 -0
  55. package/dist/features/calendar/Buddhist.js +1 -0
  56. package/dist/features/calendar/Buddhist.js.map +1 -0
  57. package/dist/features/calendar/Gregorian.js +1 -0
  58. package/dist/features/calendar/Gregorian.js.map +1 -0
  59. package/dist/features/calendar/Islamic.js +1 -0
  60. package/dist/features/calendar/Islamic.js.map +1 -0
  61. package/dist/features/calendar/Japanese.js +1 -0
  62. package/dist/features/calendar/Japanese.js.map +1 -0
  63. package/dist/features/calendar/Persian.js +1 -0
  64. package/dist/features/calendar/Persian.js.map +1 -0
  65. package/dist/generated/assets/cldr/Unicode-Data-Files-LICENSE.txt +27 -0
  66. package/dist/generated/assets/cldr/ar.json +1693 -512
  67. package/dist/generated/assets/cldr/ar_EG.json +1693 -512
  68. package/dist/generated/assets/cldr/ar_SA.json +1788 -608
  69. package/dist/generated/assets/cldr/bg.json +1666 -664
  70. package/dist/generated/assets/cldr/ca.json +1638 -551
  71. package/dist/generated/assets/cldr/cnr.json +6169 -0
  72. package/dist/generated/assets/cldr/cs.json +1621 -410
  73. package/dist/generated/assets/cldr/cy.json +6932 -0
  74. package/dist/generated/assets/cldr/da.json +1582 -543
  75. package/dist/generated/assets/cldr/de.json +1507 -375
  76. package/dist/generated/assets/cldr/de_AT.json +1497 -365
  77. package/dist/generated/assets/cldr/de_CH.json +1516 -384
  78. package/dist/generated/assets/cldr/el.json +1223 -274
  79. package/dist/generated/assets/cldr/el_CY.json +1223 -274
  80. package/dist/generated/assets/cldr/en.json +1622 -548
  81. package/dist/generated/assets/cldr/en_AU.json +1760 -638
  82. package/dist/generated/assets/cldr/en_GB.json +1633 -529
  83. package/dist/generated/assets/cldr/en_HK.json +1716 -609
  84. package/dist/generated/assets/cldr/en_IE.json +1681 -577
  85. package/dist/generated/assets/cldr/en_IN.json +1664 -556
  86. package/dist/generated/assets/cldr/en_NZ.json +1700 -596
  87. package/dist/generated/assets/cldr/en_PG.json +1701 -597
  88. package/dist/generated/assets/cldr/en_SG.json +1690 -583
  89. package/dist/generated/assets/cldr/en_ZA.json +1678 -574
  90. package/dist/generated/assets/cldr/es.json +1896 -705
  91. package/dist/generated/assets/cldr/es_AR.json +1838 -646
  92. package/dist/generated/assets/cldr/es_BO.json +1883 -691
  93. package/dist/generated/assets/cldr/es_CL.json +1724 -640
  94. package/dist/generated/assets/cldr/es_CO.json +1640 -555
  95. package/dist/generated/assets/cldr/es_MX.json +2053 -861
  96. package/dist/generated/assets/cldr/es_PE.json +1568 -592
  97. package/dist/generated/assets/cldr/es_UY.json +1596 -620
  98. package/dist/generated/assets/cldr/es_VE.json +1614 -638
  99. package/dist/generated/assets/cldr/et.json +1429 -369
  100. package/dist/generated/assets/cldr/fa.json +1551 -484
  101. package/dist/generated/assets/cldr/fi.json +1531 -344
  102. package/dist/generated/assets/cldr/fr.json +1438 -420
  103. package/dist/generated/assets/cldr/fr_BE.json +1435 -417
  104. package/dist/generated/assets/cldr/fr_CA.json +1574 -556
  105. package/dist/generated/assets/cldr/fr_CH.json +1388 -370
  106. package/dist/generated/assets/cldr/fr_LU.json +1438 -420
  107. package/dist/generated/assets/cldr/he.json +1700 -537
  108. package/dist/generated/assets/cldr/hi.json +1224 -194
  109. package/dist/generated/assets/cldr/hr.json +1763 -486
  110. package/dist/generated/assets/cldr/hu.json +1393 -304
  111. package/dist/generated/assets/cldr/id.json +1643 -571
  112. package/dist/generated/assets/cldr/it.json +1492 -456
  113. package/dist/generated/assets/cldr/it_CH.json +1492 -456
  114. package/dist/generated/assets/cldr/ja.json +1146 -87
  115. package/dist/generated/assets/cldr/kk.json +1785 -571
  116. package/dist/generated/assets/cldr/ko.json +1195 -163
  117. package/dist/generated/assets/cldr/lt.json +1386 -289
  118. package/dist/generated/assets/cldr/lv.json +1372 -370
  119. package/dist/generated/assets/cldr/mk.json +6045 -0
  120. package/dist/generated/assets/cldr/ms.json +1601 -552
  121. package/dist/generated/assets/cldr/nb.json +1268 -210
  122. package/dist/generated/assets/cldr/nl.json +1744 -426
  123. package/dist/generated/assets/cldr/nl_BE.json +1744 -426
  124. package/dist/generated/assets/cldr/pl.json +1906 -493
  125. package/dist/generated/assets/cldr/pt.json +1916 -606
  126. package/dist/generated/assets/cldr/pt_PT.json +1874 -634
  127. package/dist/generated/assets/cldr/ro.json +1593 -483
  128. package/dist/generated/assets/cldr/ru.json +1611 -515
  129. package/dist/generated/assets/cldr/ru_UA.json +1605 -509
  130. package/dist/generated/assets/cldr/sk.json +1632 -570
  131. package/dist/generated/assets/cldr/sl.json +1535 -431
  132. package/dist/generated/assets/cldr/sr.json +1462 -347
  133. package/dist/generated/assets/cldr/sr_Latn.json +6226 -0
  134. package/dist/generated/assets/cldr/sv.json +1511 -446
  135. package/dist/generated/assets/cldr/th.json +1316 -238
  136. package/dist/generated/assets/cldr/tr.json +1552 -437
  137. package/dist/generated/assets/cldr/uk.json +1622 -521
  138. package/dist/generated/assets/cldr/vi.json +1426 -430
  139. package/dist/generated/assets/cldr/zh_CN.json +1428 -343
  140. package/dist/generated/assets/cldr/zh_HK.json +1399 -313
  141. package/dist/generated/assets/cldr/zh_SG.json +1404 -318
  142. package/dist/generated/assets/cldr/zh_TW.json +1259 -194
  143. package/dist/generated/json-imports/LocaleData-fetch.d.ts +1 -0
  144. package/dist/generated/json-imports/LocaleData-fetch.js +93 -0
  145. package/dist/generated/json-imports/LocaleData-fetch.js.map +1 -0
  146. package/dist/generated/json-imports/LocaleData-node.d.ts +1 -0
  147. package/dist/generated/json-imports/LocaleData-node.js +93 -0
  148. package/dist/generated/json-imports/LocaleData-node.js.map +1 -0
  149. package/dist/generated/json-imports/LocaleData.d.ts +1 -0
  150. package/dist/generated/json-imports/LocaleData.js +92 -95
  151. package/dist/generated/json-imports/LocaleData.js.map +1 -0
  152. package/dist/getCachedLocaleDataInstance.d.ts +4 -0
  153. package/dist/getCachedLocaleDataInstance.js +10 -0
  154. package/dist/getCachedLocaleDataInstance.js.map +1 -0
  155. package/dist/locale/getLocaleData.d.ts +11 -0
  156. package/dist/locale/getLocaleData.js +13 -17
  157. package/dist/locale/getLocaleData.js.map +1 -0
  158. package/dist/sap/base/Event.js +59 -0
  159. package/dist/sap/base/Eventing.js +146 -0
  160. package/dist/sap/base/Log.js +2 -248
  161. package/dist/sap/base/assert.js +31 -9
  162. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  163. package/dist/sap/base/config.js +17 -0
  164. package/dist/sap/base/i18n/Formatting.d.ts +8 -0
  165. package/dist/sap/base/i18n/Formatting.js +11 -0
  166. package/dist/sap/base/i18n/Formatting.js.map +1 -0
  167. package/dist/sap/base/i18n/LanguageTag.js +173 -0
  168. package/dist/sap/base/i18n/Localization.d.ts +4 -0
  169. package/dist/sap/base/i18n/Localization.js +12 -0
  170. package/dist/sap/base/i18n/Localization.js.map +1 -0
  171. package/dist/sap/base/i18n/date/CalendarType.js +43 -0
  172. package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
  173. package/dist/sap/base/i18n/date/TimezoneUtils.js +319 -0
  174. package/dist/sap/base/strings/camelize.js +30 -0
  175. package/dist/sap/base/strings/formatMessage.js +88 -15
  176. package/dist/sap/base/util/LoaderExtensions.d.ts +4 -0
  177. package/dist/sap/base/util/LoaderExtensions.js +11 -4
  178. package/dist/sap/base/util/LoaderExtensions.js.map +1 -0
  179. package/dist/sap/base/util/ObjectPath.d.ts +4 -0
  180. package/dist/sap/base/util/ObjectPath.js +4 -33
  181. package/dist/sap/base/util/ObjectPath.js.map +1 -0
  182. package/dist/sap/base/util/Version.js +157 -0
  183. package/dist/sap/base/util/_merge.js +83 -26
  184. package/dist/sap/base/util/array/uniqueSort.js +37 -15
  185. package/dist/sap/base/util/deepClone.js +102 -0
  186. package/dist/sap/base/util/deepEqual.js +75 -55
  187. package/dist/sap/base/util/extend.js +58 -7
  188. package/dist/sap/base/util/isEmptyObject.js +34 -0
  189. package/dist/sap/base/util/isPlainObject.js +35 -1
  190. package/dist/sap/base/util/now.js +24 -3
  191. package/dist/sap/base/util/resolveReference.js +3 -0
  192. package/dist/sap/base/util/uid.js +27 -0
  193. package/dist/sap/ui/base/DataType.js +657 -0
  194. package/dist/sap/ui/base/Interface.js +50 -6
  195. package/dist/sap/ui/base/Metadata.js +435 -173
  196. package/dist/sap/ui/base/Object.js +287 -27
  197. package/dist/sap/ui/core/CalendarType.js +24 -8
  198. package/dist/sap/ui/core/Configuration.d.ts +17 -0
  199. package/dist/sap/ui/core/Configuration.js +23 -0
  200. package/dist/sap/ui/core/Configuration.js.map +1 -0
  201. package/dist/sap/ui/core/Core.d.ts +25 -0
  202. package/dist/sap/ui/core/Core.js +7 -32
  203. package/dist/sap/ui/core/Core.js.map +1 -0
  204. package/dist/sap/ui/core/FormatSettings.d.ts +9 -0
  205. package/dist/sap/ui/core/FormatSettings.js +12 -0
  206. package/dist/sap/ui/core/FormatSettings.js.map +1 -0
  207. package/dist/sap/ui/core/Locale.js +190 -116
  208. package/dist/sap/ui/core/LocaleData.js +2668 -2679
  209. package/dist/sap/ui/core/Supportability.js +5 -0
  210. package/dist/sap/ui/core/Theming.js +539 -0
  211. package/dist/sap/ui/core/date/Buddhist.js +162 -93
  212. package/dist/sap/ui/core/date/CalendarUtils.js +65 -0
  213. package/dist/sap/ui/core/date/CalendarWeekNumbering.js +30 -0
  214. package/dist/sap/ui/core/date/Gregorian.js +25 -10
  215. package/dist/sap/ui/core/date/Islamic.js +298 -185
  216. package/dist/sap/ui/core/date/Japanese.js +212 -117
  217. package/dist/sap/ui/core/date/Persian.js +324 -195
  218. package/dist/sap/ui/core/date/UI5Date.js +991 -0
  219. package/dist/sap/ui/core/date/UniversalDate.js +1251 -209
  220. package/dist/sap/ui/core/date/_Calendars.js +10 -1
  221. package/dist/sap/ui/core/format/DateFormat.js +3163 -1781
  222. package/dist/sap/ui/core/format/TimezoneUtil.js +24 -0
  223. package/package-scripts.cjs +35 -0
  224. package/package.json +27 -22
  225. package/tsconfig.json +24 -0
  226. package/used-modules.txt +28 -2
  227. package/dist/dates/calculateWeekNumber.js +0 -51
  228. package/dist/sap/ui/Device.js +0 -5
  229. package/package-scripts.js +0 -31
  230. package/src/Assets.js +0 -2
  231. package/src/DateFormat.js +0 -3
  232. package/src/LocaleData.js +0 -3
  233. package/src/dates/CalendarDate.js +0 -203
  234. package/src/dates/calculateWeekNumber.js +0 -51
  235. package/src/locale/getLocaleData.js +0 -27
  236. package/src/sap/base/util/LoaderExtensions.js +0 -7
  237. package/src/sap/ui/core/Core.js +0 -38
  238. /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
  239. /package/{src/features/calendar/Buddhist.js → dist/features/calendar/Buddhist.d.ts} +0 -0
  240. /package/{src/features/calendar/Gregorian.js → dist/features/calendar/Gregorian.d.ts} +0 -0
  241. /package/{src/features/calendar/Islamic.js → dist/features/calendar/Islamic.d.ts} +0 -0
  242. /package/{src/features/calendar/Japanese.js → dist/features/calendar/Japanese.d.ts} +0 -0
  243. /package/{src/features/calendar/Persian.js → dist/features/calendar/Persian.d.ts} +0 -0
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ import TimezoneUtils from "../../../base/i18n/date/TimezoneUtils.js";
7
+ /**
8
+ * Static collection of utility functions to handle time zone related conversions
9
+ *
10
+ * @author SAP SE
11
+ * @version 1.120.17
12
+ * @namespace
13
+ * @name module:sap/ui/core/format/TimezoneUtils
14
+ * @private
15
+ * @ui5-restricted sap.ui.core.Configuration, sap.ui.core.format.DateFormat
16
+ *
17
+ * @borrows sap/base/i18n/date/TimezoneUtils.isValidTimezone as isValidTimezone
18
+ * @borrows sap/base/i18n/date/TimezoneUtils.convertToTimezone as convertToTimezone
19
+ * @borrows sap/base/i18n/date/TimezoneUtils._getParts as _getParts
20
+ * @borrows sap/base/i18n/date/TimezoneUtils._getDateFromParts as _getDateFromParts
21
+ * @borrows sap/base/i18n/date/TimezoneUtils.calculateOffset as calculateOffset
22
+ * @borrows sap/base/i18n/date/TimezoneUtils.getLocalTimezone as getLocalTimezone
23
+ */
24
+ export default TimezoneUtils;
@@ -0,0 +1,35 @@
1
+ const resolve = require("resolve");
2
+ const path = require("path");
3
+
4
+ const LIB = path.join(__dirname, `../tools/lib/`);
5
+ const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
6
+ const amdToES6 = resolve.sync("@ui5/webcomponents-tools/lib/amd-to-es6/index.js");
7
+ const noRequire = resolve.sync("@ui5/webcomponents-tools/lib/amd-to-es6/no-remaining-require.js");
8
+ const generateCLDR = resolve.sync("@ui5/webcomponents-localization/lib/generate-json-imports/cldr.js");
9
+
10
+ const scripts = {
11
+ clean: {
12
+ "default": "ui5nps clean.generated clean.dist",
13
+ "generated": `ui5nps-script "${LIB}/rimraf/rimraf.js src/generated`,
14
+ "dist": `ui5nps-script "${LIB}/rimraf/rimraf.js dist`,
15
+ },
16
+ lint: `ui5nps-script "${LIB}eslint/eslint.js"`,
17
+ generate: "ui5nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports",
18
+ build: {
19
+ "default": "ui5nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports build.typescript build.no-remaining-require",
20
+ "amd-to-es6": `ui5nps-script "${amdToES6}" dist/`,
21
+ "no-remaining-require": `ui5nps-script "${noRequire}" dist/`,
22
+ typescript: "tsc --build",
23
+ jsonImports: `ui5nps-script ${generateCLDR}`,
24
+ },
25
+ typescript: "tsc --build",
26
+ copy: {
27
+ "used-modules": `ui5nps-script "${copyUsedModules}" ./used-modules.txt dist/`,
28
+ cldr: `ui5nps-script "${LIB}copy-and-watch/index.js" "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*" dist/generated/assets/cldr/`,
29
+ overlay: `ui5nps-script "${LIB}copy-and-watch/index.js" "overlay/**/*.js" dist/`,
30
+ },
31
+ };
32
+
33
+ module.exports = {
34
+ scripts,
35
+ };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-localization",
3
- "version": "0.0.0-dff5837d7",
3
+ "version": "0.0.0-e03cd01f3",
4
4
  "description": "Localization for UI5 Web Components",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
7
+ "type": "module",
7
8
  "keywords": [
8
9
  "openui5",
9
10
  "sapui5",
@@ -11,31 +12,35 @@
11
12
  ],
12
13
  "repository": {
13
14
  "type": "git",
14
- "url": "https://github.com/SAP/ui5-webcomponents.git",
15
+ "url": "https://github.com/UI5/webcomponents.git",
15
16
  "directory": "packages/localization"
16
17
  },
18
+ "exports": {
19
+ "./dist/*": "./dist/*",
20
+ "./package.json": "./package.json",
21
+ "./*": "./dist/*"
22
+ },
17
23
  "scripts": {
18
- "clean": "nps clean",
19
- "lint": "nps lint",
20
- "start": "nps start",
21
- "build": "nps build",
22
- "prepublishOnly": "npm run clean && npm run build"
24
+ "clean": "wc-dev clean",
25
+ "lint": "wc-dev lint",
26
+ "start": "wc-dev start",
27
+ "build": "wc-dev build",
28
+ "generate": "wc-dev generate",
29
+ "prepublishOnly": "tsc -b"
23
30
  },
24
31
  "devDependencies": {
25
- "@buxlabs/amd-to-es6": "^0.15.0",
26
- "@openui5/sap.ui.core": "1.76.0",
27
- "@ui5/webcomponents-tools": "0.0.0-dff5837d7",
28
- "chromedriver": "latest",
29
- "copy-and-watch": "^0.1.4",
30
- "escodegen": "^1.11.0",
31
- "esprima": "^4.0.1",
32
- "glob": "^7.1.3",
33
- "mkdirp": "^0.5.1",
34
- "path-exists-cli": "^1.0.0",
35
- "replace-in-file": "^3.4.2",
36
- "rimraf": "^2.6.2"
32
+ "@babel/core": "^7.23.7",
33
+ "@babel/generator": "^7.23.6",
34
+ "@babel/parser": "^7.23.6",
35
+ "@openui5/sap.ui.core": "1.120.17",
36
+ "@ui5/webcomponents-tools": "0.0.0-e03cd01f3",
37
+ "babel-plugin-amd-to-esm": "^2.0.3",
38
+ "estree-walk": "^2.2.0",
39
+ "resolve": "^1.20.0"
37
40
  },
38
41
  "dependencies": {
39
- "@ui5/webcomponents-base": "0.0.0-dff5837d7"
40
- }
41
- }
42
+ "@types/openui5": "^1.113.0",
43
+ "@ui5/webcomponents-base": "0.0.0-e03cd01f3"
44
+ },
45
+ "gitHead": "f28ab61f9c4395563d4664b411455d7c28f47597"
46
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "@ui5/webcomponents-tools/tsconfig.json",
3
+ "include": [
4
+ "src/**/*"
5
+ ],
6
+ "compilerOptions": {
7
+ "outDir": "dist",
8
+ "composite": true,
9
+ "rootDir": "src",
10
+ "module": "NodeNext",
11
+ "moduleResolution": "NodeNext",
12
+ "tsBuildInfoFile": "dist/.tsbuildinfo",
13
+ "paths": {
14
+ "@ui5/webcomponents-base/dist/*": [
15
+ "../base/src/*"
16
+ ],
17
+ },
18
+ },
19
+ "references": [
20
+ {
21
+ "path": "../base"
22
+ }
23
+ ]
24
+ }
package/used-modules.txt CHANGED
@@ -1,25 +1,51 @@
1
1
  # Needed files from OpenUI5 - the commented ones are currently overlaid, therefore should not be copied
2
2
 
3
- sap/base/Log.js
3
+ # ./ui5loader-autoconfig.js
4
+ # sap/base/Log.js
4
5
  sap/base/assert.js
6
+ # sap/base/config.js
7
+ sap/base/config/MemoryConfigurationProvider.js
8
+ sap/base/Event.js
9
+ sap/base/Eventing.js
10
+ sap/ui/base/DataType.js
11
+ sap/base/i18n/LanguageTag.js
12
+ sap/base/i18n/date/CalendarWeekNumbering.js
13
+ sap/base/i18n/date/TimezoneUtils.js
14
+ sap/base/i18n/date/CalendarType.js
15
+ sap/base/i18n/Localization.js
5
16
  sap/base/strings/formatMessage.js
17
+ sap/base/strings/camelize.js
6
18
  sap/base/util/ObjectPath.js
19
+ sap/base/util/resolveReference.js
7
20
  sap/base/util/array/uniqueSort.js
8
21
  sap/base/util/deepEqual.js
9
22
  sap/base/util/isPlainObject.js
23
+ sap/base/util/isEmptyObject.js
10
24
  sap/base/util/now.js
25
+ sap/base/util/uid.js
11
26
  sap/base/util/_merge.js
12
27
  sap/base/util/extend.js
28
+ sap/base/util/deepClone.js
29
+ sap/base/util/Version.js
13
30
  sap/ui/base/Interface.js
14
31
  sap/ui/base/Metadata.js
15
32
  sap/ui/base/Object.js
16
33
  sap/ui/core/CalendarType.js
34
+ sap/ui/core/Configuration.js
35
+ sap/ui/core/Supportability.js
17
36
  sap/ui/core/Locale.js
18
37
  sap/ui/core/LocaleData.js
38
+ sap/ui/core/Theming.js
39
+ sap/ui/core/date/CalendarWeekNumbering.js
40
+ sap/ui/core/date/_Calendars.js
19
41
  sap/ui/core/date/Buddhist.js
42
+ sap/ui/core/date/CalendarUtils.js
43
+ sap/ui/core/date/CalendarWeekNumbering.js
20
44
  sap/ui/core/date/Gregorian.js
21
45
  sap/ui/core/date/Islamic.js
22
46
  sap/ui/core/date/Japanese.js
23
47
  sap/ui/core/date/Persian.js
48
+ sap/ui/core/date/UI5Date.js
24
49
  sap/ui/core/date/UniversalDate.js
25
- sap/ui/core/format/DateFormat.js
50
+ sap/ui/core/format/TimezoneUtil.js
51
+ sap/ui/core/format/DateFormat.js
@@ -1,51 +0,0 @@
1
- import UniversalDate from "../sap/ui/core/date/UniversalDate.js";
2
-
3
- const calculateWeekNumber = (confFirstDayOfWeek, oDate, iYear, oLocale, oLocaleData) => {
4
- let iWeekNum = 0;
5
- let iWeekDay = 0;
6
- const iFirstDayOfWeek = Number.isInteger(confFirstDayOfWeek) ? confFirstDayOfWeek : oLocaleData.getFirstDayOfWeek();
7
-
8
- // search Locale for containing "en-US", since sometimes
9
- // when any user settings have been defined, subtag "sapufmt" is added to the locale name
10
- // this is described inside sap.ui.core.Configuration file
11
- if (oLocale && (oLocale.getLanguage() === "en" && oLocale.getRegion() === "US")) {
12
- /*
13
- * in US the week starts with Sunday
14
- * The first week of the year starts with January 1st. But Dec. 31 is still in the last year
15
- * So the week beginning in December and ending in January has 2 week numbers
16
- */
17
- const oJanFirst = new UniversalDate(oDate.getTime());
18
- oJanFirst.setUTCFullYear(iYear, 0, 1);
19
- iWeekDay = oJanFirst.getUTCDay();
20
-
21
- // get the date for the same weekday like jan 1.
22
- const oCheckDate = new UniversalDate(oDate.getTime());
23
- oCheckDate.setUTCDate(oCheckDate.getUTCDate() - oCheckDate.getUTCDay() + iWeekDay);
24
-
25
- iWeekNum = Math.round((oCheckDate.getTime() - oJanFirst.getTime()) / 86400000 / 7) + 1;
26
- } else {
27
- // normally the first week of the year is the one where the first Thursday of the year is
28
- // find Thursday of this week
29
- // if the checked day is before the 1. day of the week use a day of the previous week to check
30
- const oThursday = new UniversalDate(oDate.getTime());
31
- oThursday.setUTCDate(oThursday.getUTCDate() - iFirstDayOfWeek);
32
- iWeekDay = oThursday.getUTCDay();
33
- oThursday.setUTCDate(oThursday.getUTCDate() - iWeekDay + 4);
34
-
35
- const oFirstDayOfYear = new UniversalDate(oThursday.getTime());
36
- oFirstDayOfYear.setUTCMonth(0, 1);
37
- iWeekDay = oFirstDayOfYear.getUTCDay();
38
- let iAddDays = 0;
39
- if (iWeekDay > 4) {
40
- iAddDays = 7; // first day of year is after Thursday, so first Thursday is in the next week
41
- }
42
- const oFirstThursday = new UniversalDate(oFirstDayOfYear.getTime());
43
- oFirstThursday.setUTCDate(1 - iWeekDay + 4 + iAddDays);
44
-
45
- iWeekNum = Math.round((oThursday.getTime() - oFirstThursday.getTime()) / 86400000 / 7) + 1;
46
- }
47
-
48
- return iWeekNum;
49
- };
50
-
51
- export default calculateWeekNumber;
@@ -1,5 +0,0 @@
1
- export default {
2
- browser: {
3
- phantomJS: false
4
- }
5
- };
@@ -1,31 +0,0 @@
1
- const scripts = {
2
- clean: "rimraf dist",
3
- lint: "eslint . --config config/.eslintrc.js",
4
- build: {
5
- "default": "path-exists dist/ || nps build.all",
6
- all: "nps lint clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports copy.src",
7
- "replace-amd": "replace-in-file sap.ui.define define dist/**/*.js",
8
- "replace-export-true": `replace-in-file ", /* bExport= */ true" "" dist/**/*.js`,
9
- "replace-export-false": `replace-in-file ", /* bExport= */ false" "" dist/**/*.js`,
10
- "amd-to-es6": "amdtoes6 --src=dist --replace --glob=**/*.js",
11
- "replace-global-core-usage": "node ./lib/replace-global-core/index.js dist/",
12
- "esm-abs-to-rel": "node ./lib/esm-abs-to-rel/index.js dist/",
13
- jsonImports: "node ./lib/generate-json-imports/cldr.js",
14
- },
15
- copy: {
16
- "used-modules": "node ./lib/copy-list/index.js ./used-modules.txt dist/",
17
- cldr: `copy-and-watch "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*.json" dist/generated/assets/cldr/`,
18
- overlay: `copy-and-watch "overlay/**/*.js" dist/`,
19
- src: `copy-and-watch "src/**/*.js" dist/`,
20
- },
21
- watch: {
22
- default: 'nps watch.src',
23
- src: `nps "copy.src --watch --skip-initial-copy"`,
24
- },
25
- start: "nps watch",
26
- };
27
-
28
-
29
- module.exports = {
30
- scripts,
31
- };
package/src/Assets.js DELETED
@@ -1,2 +0,0 @@
1
- // Currently the base package provides CLDR assets only
2
- import "./generated/json-imports/LocaleData.js";
package/src/DateFormat.js DELETED
@@ -1,3 +0,0 @@
1
- import DateFormat from "./sap/ui/core/format/DateFormat.js";
2
-
3
- export default DateFormat;
package/src/LocaleData.js DELETED
@@ -1,3 +0,0 @@
1
- import LocaleData from "./sap/ui/core/LocaleData.js";
2
-
3
- export default LocaleData;
@@ -1,203 +0,0 @@
1
- import UniversalDate from "../sap/ui/core/date/UniversalDate.js";
2
-
3
- class CalendarDate {
4
- constructor() {
5
- let aArgs = arguments, // eslint-disable-line
6
- oJSDate,
7
- oNow,
8
- sCalendarType;
9
-
10
- switch (aArgs.length) {
11
- case 0: // defaults to the current date
12
- oNow = new Date();
13
- return this.constructor(oNow.getFullYear(), oNow.getMonth(), oNow.getDate());
14
-
15
- case 1: // CalendarDate
16
- case 2: // CalendarDate, sCalendarType
17
- if (!(aArgs[0] instanceof CalendarDate)) {
18
- throw new Error("Invalid arguments: the first argument must be of type sap.ui.unified.calendar.CalendarDate.");
19
- }
20
- sCalendarType = aArgs[1] ? aArgs[1] : aArgs[0]._oUDate.sCalendarType;
21
- // Use source.valueOf() (returns the same point of time regardless calendar type) instead of
22
- // source's getters to avoid non-gregorian Year, Month and Date may be used to construct a Gregorian date
23
- oJSDate = new Date(aArgs[0].valueOf());
24
-
25
- // Make this date really local. Now getters are safe.
26
- oJSDate.setFullYear(oJSDate.getUTCFullYear(), oJSDate.getUTCMonth(), oJSDate.getUTCDate());
27
- oJSDate.setHours(oJSDate.getUTCHours(), oJSDate.getUTCMinutes(), oJSDate.getUTCSeconds(), oJSDate.getUTCMilliseconds());
28
-
29
- this._oUDate = createUniversalUTCDate(oJSDate, sCalendarType);
30
- break;
31
-
32
- case 3: // year, month, date
33
- case 4: // year, month, date, sCalendarType
34
- checkNumericLike(aArgs[0], `Invalid year: ${aArgs[0]}`);
35
- checkNumericLike(aArgs[1], `Invalid month: ${aArgs[1]}`);
36
- checkNumericLike(aArgs[2], `Invalid date: ${aArgs[2]}`);
37
-
38
- oJSDate = new Date(0, 0, 1);
39
- oJSDate.setFullYear(aArgs[0], aArgs[1], aArgs[2]); // 2 digits year is not supported. If so, it is considered as full year as well.
40
-
41
- if (aArgs[3]) {
42
- sCalendarType = aArgs[3];
43
- }
44
- this._oUDate = createUniversalUTCDate(oJSDate, sCalendarType);
45
- break;
46
-
47
- default:
48
- throw new Error(`${"Invalid arguments. Accepted arguments are: 1) oCalendarDate, (optional)calendarType"
49
- + "or 2) year, month, date, (optional) calendarType"}${aArgs}`);
50
- }
51
- }
52
-
53
- getYear() {
54
- return this._oUDate.getUTCFullYear();
55
- }
56
-
57
- setYear(year) {
58
- checkNumericLike(year, `Invalid year: ${year}`);
59
- this._oUDate.setUTCFullYear(year);
60
- return this;
61
- }
62
-
63
- getMonth() {
64
- return this._oUDate.getUTCMonth();
65
- }
66
-
67
- setMonth(month) {
68
- checkNumericLike(month, `Invalid month: ${month}`);
69
- this._oUDate.setUTCMonth(month);
70
- return this;
71
- }
72
-
73
- getDate() {
74
- return this._oUDate.getUTCDate();
75
- }
76
-
77
- setDate(date) {
78
- checkNumericLike(date, `Invalid date: ${date}`);
79
- this._oUDate.setUTCDate(date);
80
- return this;
81
- }
82
-
83
- getDay() {
84
- return this._oUDate.getUTCDay();
85
- }
86
-
87
- getCalendarType() {
88
- return this._oUDate.sCalendarType;
89
- }
90
-
91
- isBefore(oCalendarDate) {
92
- checkCalendarDate(oCalendarDate);
93
- return this.valueOf() < oCalendarDate.valueOf();
94
- }
95
-
96
- isAfter(oCalendarDate) {
97
- checkCalendarDate(oCalendarDate);
98
- return this.valueOf() > oCalendarDate.valueOf();
99
- }
100
-
101
- isSameOrBefore(oCalendarDate) {
102
- checkCalendarDate(oCalendarDate);
103
- return this.valueOf() <= oCalendarDate.valueOf();
104
- }
105
-
106
- isSameOrAfter(oCalendarDate) {
107
- checkCalendarDate(oCalendarDate);
108
- return this.valueOf() >= oCalendarDate.valueOf();
109
- }
110
-
111
- isSame(oCalendarDate) {
112
- checkCalendarDate(oCalendarDate);
113
- return this.valueOf() === oCalendarDate.valueOf();
114
- }
115
-
116
- toLocalJSDate() {
117
- // Use this._oUDate.getTime()(returns the same point of time regardless calendar type) instead of
118
- // this._oUDate's getters to avoid non-gregorian Year, Month and Date to be used to construct a Gregorian date
119
- const oLocalDate = new Date(this._oUDate.getTime());
120
-
121
- // Make this date really local. Now getters are safe.
122
- oLocalDate.setFullYear(oLocalDate.getUTCFullYear(), oLocalDate.getUTCMonth(), oLocalDate.getUTCDate());
123
- oLocalDate.setHours(0, 0, 0, 0);
124
-
125
- return oLocalDate;
126
- }
127
-
128
- toUTCJSDate() {
129
- // Use this._oUDate.getTime()(returns the same point of time regardless calendar type) instead of
130
- // this._oUDate's getters to avoid non-gregorian Year, Month and Date to be used to construct a Gregorian date
131
- const oUTCDate = new Date(this._oUDate.getTime());
132
- oUTCDate.setUTCHours(0, 0, 0, 0);
133
-
134
- return oUTCDate;
135
- }
136
-
137
- toString() {
138
- return `${this._oUDate.sCalendarType}: ${this.getYear()}/${this.getMonth() + 1}/${this.getDate()}`;
139
- }
140
-
141
- valueOf() {
142
- return this._oUDate.getTime();
143
- }
144
-
145
- static fromLocalJSDate(oJSDate, sCalendarType) {
146
- // Cross frame check for a date should be performed here otherwise setDateValue would fail in OPA tests
147
- // because Date object in the test is different than the Date object in the application (due to the iframe).
148
- // We can use jQuery.type or this method:
149
- function isValidDate(date) {
150
- return date && Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date); // eslint-disable-line
151
- }
152
- if (!isValidDate(oJSDate)) {
153
- throw new Error(`Date parameter must be a JavaScript Date object: [${oJSDate}].`);
154
- }
155
- return new CalendarDate(oJSDate.getFullYear(), oJSDate.getMonth(), oJSDate.getDate(), sCalendarType);
156
- }
157
-
158
- static fromTimestamp(iTimestamp, sCalendarType) {
159
- const oCalDate = new CalendarDate(0, 0, 1);
160
- oCalDate._oUDate = UniversalDate.getInstance(new Date(iTimestamp), sCalendarType);
161
- return oCalDate;
162
- }
163
- }
164
-
165
- function createUniversalUTCDate(oDate, sCalendarType) {
166
- if (sCalendarType) {
167
- return UniversalDate.getInstance(createUTCDate(oDate), sCalendarType);
168
- }
169
- return new UniversalDate(createUTCDate(oDate).getTime());
170
- }
171
-
172
- /**
173
- * Creates a JavaScript UTC Date corresponding to the given JavaScript Date.
174
- * @param {Date} oDate JavaScript date object. Time related information is cut.
175
- * @returns {Date} JavaScript date created from the date object, but this time considered as UTC date information.
176
- */
177
- function createUTCDate(oDate) {
178
- const oUTCDate = new Date(Date.UTC(0, 0, 1));
179
-
180
- oUTCDate.setUTCFullYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate());
181
-
182
- return oUTCDate;
183
- }
184
-
185
- function checkCalendarDate(oCalendarDate) {
186
- if (!(oCalendarDate instanceof CalendarDate)) {
187
- throw new Error(`Invalid calendar date: [${oCalendarDate}]. Expected: sap.ui.unified.calendar.CalendarDate`);
188
- }
189
- }
190
-
191
- /**
192
- * Verifies the given value is numeric like, i.e. 3, "3" and throws an error if it is not.
193
- * @param {any} value The value of any type to check. If null or undefined, this method throws an error.
194
- * @param {string} message The message to be used if an error is to be thrown
195
- * @throws will throw an error if the value is null or undefined or is not like a number
196
- */
197
- function checkNumericLike(value, message) {
198
- if (value === undefined || value === Infinity || isNaN(value)) { // eslint-disable-line
199
- throw message;
200
- }
201
- }
202
-
203
- export default CalendarDate;
@@ -1,51 +0,0 @@
1
- import UniversalDate from "../sap/ui/core/date/UniversalDate.js";
2
-
3
- const calculateWeekNumber = (confFirstDayOfWeek, oDate, iYear, oLocale, oLocaleData) => {
4
- let iWeekNum = 0;
5
- let iWeekDay = 0;
6
- const iFirstDayOfWeek = Number.isInteger(confFirstDayOfWeek) ? confFirstDayOfWeek : oLocaleData.getFirstDayOfWeek();
7
-
8
- // search Locale for containing "en-US", since sometimes
9
- // when any user settings have been defined, subtag "sapufmt" is added to the locale name
10
- // this is described inside sap.ui.core.Configuration file
11
- if (oLocale && (oLocale.getLanguage() === "en" && oLocale.getRegion() === "US")) {
12
- /*
13
- * in US the week starts with Sunday
14
- * The first week of the year starts with January 1st. But Dec. 31 is still in the last year
15
- * So the week beginning in December and ending in January has 2 week numbers
16
- */
17
- const oJanFirst = new UniversalDate(oDate.getTime());
18
- oJanFirst.setUTCFullYear(iYear, 0, 1);
19
- iWeekDay = oJanFirst.getUTCDay();
20
-
21
- // get the date for the same weekday like jan 1.
22
- const oCheckDate = new UniversalDate(oDate.getTime());
23
- oCheckDate.setUTCDate(oCheckDate.getUTCDate() - oCheckDate.getUTCDay() + iWeekDay);
24
-
25
- iWeekNum = Math.round((oCheckDate.getTime() - oJanFirst.getTime()) / 86400000 / 7) + 1;
26
- } else {
27
- // normally the first week of the year is the one where the first Thursday of the year is
28
- // find Thursday of this week
29
- // if the checked day is before the 1. day of the week use a day of the previous week to check
30
- const oThursday = new UniversalDate(oDate.getTime());
31
- oThursday.setUTCDate(oThursday.getUTCDate() - iFirstDayOfWeek);
32
- iWeekDay = oThursday.getUTCDay();
33
- oThursday.setUTCDate(oThursday.getUTCDate() - iWeekDay + 4);
34
-
35
- const oFirstDayOfYear = new UniversalDate(oThursday.getTime());
36
- oFirstDayOfYear.setUTCMonth(0, 1);
37
- iWeekDay = oFirstDayOfYear.getUTCDay();
38
- let iAddDays = 0;
39
- if (iWeekDay > 4) {
40
- iAddDays = 7; // first day of year is after Thursday, so first Thursday is in the next week
41
- }
42
- const oFirstThursday = new UniversalDate(oFirstDayOfYear.getTime());
43
- oFirstThursday.setUTCDate(1 - iWeekDay + 4 + iAddDays);
44
-
45
- iWeekNum = Math.round((oThursday.getTime() - oFirstThursday.getTime()) / 86400000 / 7) + 1;
46
- }
47
-
48
- return iWeekNum;
49
- };
50
-
51
- export default calculateWeekNumber;
@@ -1,27 +0,0 @@
1
- import { fetchCldr } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
2
- import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
3
- import LocaleData from "../sap/ui/core/LocaleData.js";
4
-
5
- const instances = new Map();
6
-
7
- /**
8
- * Fetches and returns а LocaleData object for the required locale
9
- * For more information on this object's API, please see:
10
- * https://ui5.sap.com/#/api/sap.ui.core.LocaleData
11
- *
12
- * @param lang - if left empty, will use the configured/current locale
13
- * @returns {LocaleData}
14
- */
15
- const getLocaleData = async lang => {
16
- const locale = getLocale(lang);
17
- const localeLang = locale.getLanguage();
18
-
19
- if (!instances.has(localeLang)) {
20
- await fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());
21
- instances.set(localeLang, LocaleData.getInstance(locale));
22
- }
23
-
24
- return instances.get(localeLang);
25
- };
26
-
27
- export default getLocaleData;
@@ -1,7 +0,0 @@
1
- import { getModuleContent } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
2
-
3
- const LoaderExtensions = {
4
- loadResource: getModuleContent,
5
- };
6
-
7
- export default LoaderExtensions;
@@ -1,38 +0,0 @@
1
- import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
2
- import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
3
- import getDesigntimePropertyAsArray from "@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js";
4
- import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
5
-
6
- const emptyFn = () => {};
7
-
8
- /**
9
- * OpenUI5 FormatSettings shim
10
- */
11
- const FormatSettings = {
12
- getFormatLocale: getLocale,
13
- getLegacyDateFormat: emptyFn,
14
- getLegacyDateCalendarCustomizing: emptyFn,
15
- getCustomLocaleData: emptyFn,
16
- };
17
-
18
- /**
19
- * OpenUI5 Configuration Shim
20
- */
21
- const Configuration = {
22
- getLanguage,
23
- getCalendarType,
24
- getSupportedLanguages: () => getDesigntimePropertyAsArray("$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,es,et,fi,fr,hi,hr,hu,it,iw,ja,ko,lt,lv,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$"),
25
- getOriginInfo: emptyFn,
26
- getFormatSettings: () => FormatSettings,
27
- };
28
-
29
- /**
30
- * OpenUI5 Core shim
31
- */
32
- const Core = {
33
- getConfiguration: () => Configuration,
34
- getLibraryResourceBundle: emptyFn(),
35
- getFormatSettings: () => FormatSettings,
36
- };
37
-
38
- export default Core;
File without changes