@ui5/webcomponents-localization 0.0.0-e7dd012d7 → 0.0.0-ebd9a4db3

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 (237) hide show
  1. package/.eslintignore +2 -0
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +1804 -0
  4. package/README.md +37 -9
  5. package/dist/.tsbuildinfo +1 -0
  6. package/dist/Assets-fetch.d.ts +1 -0
  7. package/dist/Assets-fetch.js +3 -0
  8. package/dist/Assets-fetch.js.map +1 -0
  9. package/dist/Assets.d.ts +1 -0
  10. package/dist/Assets.js +1 -0
  11. package/dist/Assets.js.map +1 -0
  12. package/dist/CalendarUtils.d.ts +3 -0
  13. package/dist/CalendarUtils.js +6 -0
  14. package/dist/CalendarUtils.js.map +1 -0
  15. package/dist/DateFormat.d.ts +5 -0
  16. package/dist/DateFormat.js +6 -2
  17. package/dist/DateFormat.js.map +1 -0
  18. package/dist/LocaleData.d.ts +5 -0
  19. package/dist/LocaleData.js +6 -2
  20. package/dist/LocaleData.js.map +1 -0
  21. package/dist/dates/CalendarDate.d.ts +42 -0
  22. package/dist/dates/CalendarDate.js +171 -201
  23. package/dist/dates/CalendarDate.js.map +1 -0
  24. package/dist/dates/ExtremeDates.d.ts +5 -0
  25. package/dist/dates/ExtremeDates.js +29 -0
  26. package/dist/dates/ExtremeDates.js.map +1 -0
  27. package/dist/dates/UI5Date.d.ts +5 -0
  28. package/dist/dates/UI5Date.js +7 -0
  29. package/dist/dates/UI5Date.js.map +1 -0
  30. package/dist/dates/UniversalDate.d.ts +47 -0
  31. package/dist/dates/UniversalDate.js +5 -0
  32. package/dist/dates/UniversalDate.js.map +1 -0
  33. package/dist/dates/convertMonthNumbersToMonthNames.d.ts +16 -0
  34. package/dist/dates/convertMonthNumbersToMonthNames.js +30 -0
  35. package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -0
  36. package/dist/dates/getDaysInMonth.d.ts +3 -0
  37. package/dist/dates/getDaysInMonth.js +10 -0
  38. package/dist/dates/getDaysInMonth.js.map +1 -0
  39. package/dist/dates/getRoundedTimestamp.d.ts +7 -0
  40. package/dist/dates/getRoundedTimestamp.js +15 -0
  41. package/dist/dates/getRoundedTimestamp.js.map +1 -0
  42. package/dist/dates/getTodayUTCTimestamp.d.ts +7 -0
  43. package/dist/dates/getTodayUTCTimestamp.js +9 -0
  44. package/dist/dates/getTodayUTCTimestamp.js.map +1 -0
  45. package/dist/dates/modifyDateBy.d.ts +14 -0
  46. package/dist/dates/modifyDateBy.js +55 -0
  47. package/dist/dates/modifyDateBy.js.map +1 -0
  48. package/dist/dates/transformDateToSecondaryType.d.ts +7 -0
  49. package/dist/dates/transformDateToSecondaryType.js +18 -0
  50. package/dist/dates/transformDateToSecondaryType.js.map +1 -0
  51. package/dist/features/calendar/Buddhist.js +1 -0
  52. package/dist/features/calendar/Buddhist.js.map +1 -0
  53. package/dist/features/calendar/Gregorian.js +1 -0
  54. package/dist/features/calendar/Gregorian.js.map +1 -0
  55. package/dist/features/calendar/Islamic.js +1 -0
  56. package/dist/features/calendar/Islamic.js.map +1 -0
  57. package/dist/features/calendar/Japanese.js +1 -0
  58. package/dist/features/calendar/Japanese.js.map +1 -0
  59. package/dist/features/calendar/Persian.js +1 -0
  60. package/dist/features/calendar/Persian.js.map +1 -0
  61. package/dist/generated/assets/cldr/Unicode-Data-Files-LICENSE.txt +27 -0
  62. package/dist/generated/assets/cldr/ar.json +1693 -512
  63. package/dist/generated/assets/cldr/ar_EG.json +1693 -512
  64. package/dist/generated/assets/cldr/ar_SA.json +1788 -608
  65. package/dist/generated/assets/cldr/bg.json +1666 -664
  66. package/dist/generated/assets/cldr/ca.json +1638 -551
  67. package/dist/generated/assets/cldr/cnr.json +6169 -0
  68. package/dist/generated/assets/cldr/cs.json +1621 -410
  69. package/dist/generated/assets/cldr/cy.json +6932 -0
  70. package/dist/generated/assets/cldr/da.json +1582 -543
  71. package/dist/generated/assets/cldr/de.json +1507 -375
  72. package/dist/generated/assets/cldr/de_AT.json +1497 -365
  73. package/dist/generated/assets/cldr/de_CH.json +1516 -384
  74. package/dist/generated/assets/cldr/el.json +1223 -274
  75. package/dist/generated/assets/cldr/el_CY.json +1223 -274
  76. package/dist/generated/assets/cldr/en.json +1622 -548
  77. package/dist/generated/assets/cldr/en_AU.json +1760 -638
  78. package/dist/generated/assets/cldr/en_GB.json +1633 -529
  79. package/dist/generated/assets/cldr/en_HK.json +1716 -609
  80. package/dist/generated/assets/cldr/en_IE.json +1681 -577
  81. package/dist/generated/assets/cldr/en_IN.json +1664 -556
  82. package/dist/generated/assets/cldr/en_NZ.json +1700 -596
  83. package/dist/generated/assets/cldr/en_PG.json +1701 -597
  84. package/dist/generated/assets/cldr/en_SG.json +1690 -583
  85. package/dist/generated/assets/cldr/en_ZA.json +1678 -574
  86. package/dist/generated/assets/cldr/es.json +1896 -705
  87. package/dist/generated/assets/cldr/es_AR.json +1838 -646
  88. package/dist/generated/assets/cldr/es_BO.json +1883 -691
  89. package/dist/generated/assets/cldr/es_CL.json +1724 -640
  90. package/dist/generated/assets/cldr/es_CO.json +1640 -555
  91. package/dist/generated/assets/cldr/es_MX.json +2053 -861
  92. package/dist/generated/assets/cldr/es_PE.json +1568 -592
  93. package/dist/generated/assets/cldr/es_UY.json +1596 -620
  94. package/dist/generated/assets/cldr/es_VE.json +1614 -638
  95. package/dist/generated/assets/cldr/et.json +1429 -369
  96. package/dist/generated/assets/cldr/fa.json +1551 -484
  97. package/dist/generated/assets/cldr/fi.json +1531 -344
  98. package/dist/generated/assets/cldr/fr.json +1438 -420
  99. package/dist/generated/assets/cldr/fr_BE.json +1435 -417
  100. package/dist/generated/assets/cldr/fr_CA.json +1574 -556
  101. package/dist/generated/assets/cldr/fr_CH.json +1388 -370
  102. package/dist/generated/assets/cldr/fr_LU.json +1438 -420
  103. package/dist/generated/assets/cldr/he.json +1700 -537
  104. package/dist/generated/assets/cldr/hi.json +1224 -194
  105. package/dist/generated/assets/cldr/hr.json +1763 -486
  106. package/dist/generated/assets/cldr/hu.json +1393 -304
  107. package/dist/generated/assets/cldr/id.json +1643 -571
  108. package/dist/generated/assets/cldr/it.json +1492 -456
  109. package/dist/generated/assets/cldr/it_CH.json +1492 -456
  110. package/dist/generated/assets/cldr/ja.json +1146 -87
  111. package/dist/generated/assets/cldr/kk.json +1785 -571
  112. package/dist/generated/assets/cldr/ko.json +1195 -163
  113. package/dist/generated/assets/cldr/lt.json +1386 -289
  114. package/dist/generated/assets/cldr/lv.json +1372 -370
  115. package/dist/generated/assets/cldr/mk.json +6045 -0
  116. package/dist/generated/assets/cldr/ms.json +1601 -552
  117. package/dist/generated/assets/cldr/nb.json +1268 -210
  118. package/dist/generated/assets/cldr/nl.json +1744 -426
  119. package/dist/generated/assets/cldr/nl_BE.json +1744 -426
  120. package/dist/generated/assets/cldr/pl.json +1906 -493
  121. package/dist/generated/assets/cldr/pt.json +1916 -606
  122. package/dist/generated/assets/cldr/pt_PT.json +1874 -634
  123. package/dist/generated/assets/cldr/ro.json +1593 -483
  124. package/dist/generated/assets/cldr/ru.json +1611 -515
  125. package/dist/generated/assets/cldr/ru_UA.json +1605 -509
  126. package/dist/generated/assets/cldr/sk.json +1632 -570
  127. package/dist/generated/assets/cldr/sl.json +1535 -431
  128. package/dist/generated/assets/cldr/sr.json +1462 -347
  129. package/dist/generated/assets/cldr/sr_Latn.json +6226 -0
  130. package/dist/generated/assets/cldr/sv.json +1511 -446
  131. package/dist/generated/assets/cldr/th.json +1316 -238
  132. package/dist/generated/assets/cldr/tr.json +1552 -437
  133. package/dist/generated/assets/cldr/uk.json +1622 -521
  134. package/dist/generated/assets/cldr/vi.json +1426 -430
  135. package/dist/generated/assets/cldr/zh_CN.json +1428 -343
  136. package/dist/generated/assets/cldr/zh_HK.json +1399 -313
  137. package/dist/generated/assets/cldr/zh_SG.json +1404 -318
  138. package/dist/generated/assets/cldr/zh_TW.json +1259 -194
  139. package/dist/generated/json-imports/LocaleData-fetch.d.ts +1 -0
  140. package/dist/generated/json-imports/LocaleData-fetch.js +93 -0
  141. package/dist/generated/json-imports/LocaleData-fetch.js.map +1 -0
  142. package/dist/generated/json-imports/LocaleData.d.ts +1 -0
  143. package/dist/generated/json-imports/LocaleData.js +92 -95
  144. package/dist/generated/json-imports/LocaleData.js.map +1 -0
  145. package/dist/getCachedLocaleDataInstance.d.ts +4 -0
  146. package/dist/getCachedLocaleDataInstance.js +6 -9
  147. package/dist/getCachedLocaleDataInstance.js.map +1 -0
  148. package/dist/locale/getLocaleData.d.ts +11 -0
  149. package/dist/locale/getLocaleData.js +13 -17
  150. package/dist/locale/getLocaleData.js.map +1 -0
  151. package/dist/sap/base/Event.js +59 -0
  152. package/dist/sap/base/Eventing.js +146 -0
  153. package/dist/sap/base/Log.js +2 -248
  154. package/dist/sap/base/assert.js +31 -9
  155. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  156. package/dist/sap/base/config.js +17 -0
  157. package/dist/sap/base/i18n/Formatting.d.ts +8 -0
  158. package/dist/sap/base/i18n/Formatting.js +11 -0
  159. package/dist/sap/base/i18n/Formatting.js.map +1 -0
  160. package/dist/sap/base/i18n/LanguageTag.js +173 -0
  161. package/dist/sap/base/i18n/Localization.d.ts +4 -0
  162. package/dist/sap/base/i18n/Localization.js +12 -0
  163. package/dist/sap/base/i18n/Localization.js.map +1 -0
  164. package/dist/sap/base/i18n/date/CalendarType.js +43 -0
  165. package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
  166. package/dist/sap/base/i18n/date/TimezoneUtils.js +319 -0
  167. package/dist/sap/base/strings/camelize.js +30 -0
  168. package/dist/sap/base/strings/formatMessage.js +88 -15
  169. package/dist/sap/base/util/LoaderExtensions.d.ts +4 -0
  170. package/dist/sap/base/util/LoaderExtensions.js +11 -4
  171. package/dist/sap/base/util/LoaderExtensions.js.map +1 -0
  172. package/dist/sap/base/util/ObjectPath.d.ts +4 -0
  173. package/dist/sap/base/util/ObjectPath.js +4 -33
  174. package/dist/sap/base/util/ObjectPath.js.map +1 -0
  175. package/dist/sap/base/util/Version.js +157 -0
  176. package/dist/sap/base/util/_merge.js +83 -26
  177. package/dist/sap/base/util/array/uniqueSort.js +37 -15
  178. package/dist/sap/base/util/deepClone.js +102 -0
  179. package/dist/sap/base/util/deepEqual.js +75 -55
  180. package/dist/sap/base/util/extend.js +58 -7
  181. package/dist/sap/base/util/isEmptyObject.js +34 -0
  182. package/dist/sap/base/util/isPlainObject.js +35 -1
  183. package/dist/sap/base/util/now.js +24 -3
  184. package/dist/sap/base/util/resolveReference.js +3 -0
  185. package/dist/sap/base/util/uid.js +27 -0
  186. package/dist/sap/ui/base/DataType.js +657 -0
  187. package/dist/sap/ui/base/Interface.js +50 -6
  188. package/dist/sap/ui/base/Metadata.js +435 -173
  189. package/dist/sap/ui/base/Object.js +287 -27
  190. package/dist/sap/ui/core/CalendarType.js +24 -8
  191. package/dist/sap/ui/core/Configuration.d.ts +17 -0
  192. package/dist/sap/ui/core/Configuration.js +23 -0
  193. package/dist/sap/ui/core/Configuration.js.map +1 -0
  194. package/dist/sap/ui/core/Core.d.ts +25 -0
  195. package/dist/sap/ui/core/Core.js +7 -32
  196. package/dist/sap/ui/core/Core.js.map +1 -0
  197. package/dist/sap/ui/core/FormatSettings.d.ts +9 -0
  198. package/dist/sap/ui/core/FormatSettings.js +12 -0
  199. package/dist/sap/ui/core/FormatSettings.js.map +1 -0
  200. package/dist/sap/ui/core/Locale.js +190 -116
  201. package/dist/sap/ui/core/LocaleData.js +2668 -2679
  202. package/dist/sap/ui/core/Supportability.js +5 -0
  203. package/dist/sap/ui/core/Theming.js +539 -0
  204. package/dist/sap/ui/core/date/Buddhist.js +162 -93
  205. package/dist/sap/ui/core/date/CalendarUtils.js +65 -0
  206. package/dist/sap/ui/core/date/CalendarWeekNumbering.js +30 -0
  207. package/dist/sap/ui/core/date/Gregorian.js +25 -10
  208. package/dist/sap/ui/core/date/Islamic.js +298 -185
  209. package/dist/sap/ui/core/date/Japanese.js +212 -117
  210. package/dist/sap/ui/core/date/Persian.js +324 -195
  211. package/dist/sap/ui/core/date/UI5Date.js +991 -0
  212. package/dist/sap/ui/core/date/UniversalDate.js +1251 -209
  213. package/dist/sap/ui/core/date/_Calendars.js +10 -1
  214. package/dist/sap/ui/core/format/DateFormat.js +3163 -1781
  215. package/dist/sap/ui/core/format/TimezoneUtil.js +24 -0
  216. package/package-scripts.cjs +28 -0
  217. package/package.json +21 -15
  218. package/tsconfig.json +24 -0
  219. package/used-modules.txt +28 -2
  220. package/dist/dates/calculateWeekNumber.js +0 -51
  221. package/dist/sap/ui/Device.js +0 -5
  222. package/package-scripts.js +0 -31
  223. package/src/Assets.js +0 -2
  224. package/src/DateFormat.js +0 -3
  225. package/src/LocaleData.js +0 -3
  226. package/src/dates/CalendarDate.js +0 -223
  227. package/src/dates/calculateWeekNumber.js +0 -51
  228. package/src/getCachedLocaleDataInstance.js +0 -13
  229. package/src/locale/getLocaleData.js +0 -27
  230. package/src/sap/base/util/LoaderExtensions.js +0 -7
  231. package/src/sap/ui/core/Core.js +0 -38
  232. /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
  233. /package/{src/features/calendar/Buddhist.js → dist/features/calendar/Buddhist.d.ts} +0 -0
  234. /package/{src/features/calendar/Gregorian.js → dist/features/calendar/Gregorian.d.ts} +0 -0
  235. /package/{src/features/calendar/Islamic.js → dist/features/calendar/Islamic.d.ts} +0 -0
  236. /package/{src/features/calendar/Japanese.js → dist/features/calendar/Japanese.d.ts} +0 -0
  237. /package/{src/features/calendar/Persian.js → dist/features/calendar/Persian.d.ts} +0 -0
@@ -1,40 +1,300 @@
1
- import Interface from './Interface.js';
2
- import Metadata from './Metadata.js';
3
- import Log from '../../base/Log.js';
4
- var BaseObject = Metadata.createClass('sap.ui.base.Object', {
5
- constructor: function () {
6
- if (!(this instanceof BaseObject)) {
7
- throw Error('Cannot instantiate object: "new" is missing!');
8
- }
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
+ /**
7
+ * SAPUI5 base classes
8
+ *
9
+ * @namespace
10
+ * @name sap.ui.base
11
+ * @public
12
+ */
13
+ // Provides class sap.ui.base.Object
14
+ import Metadata from "./Metadata.js";
15
+ import Log from "../../base/Log.js";
16
+ /**
17
+ * Constructor for an <code>sap.ui.base.Object</code>.
18
+ *
19
+ * Subclasses of this class should always call the constructor of their base class.
20
+ *
21
+ * @class Base class for all SAPUI5 Objects.
22
+ * @abstract
23
+ * @author Malte Wedel
24
+ * @version 1.120.17
25
+ * @public
26
+ * @alias sap.ui.base.Object
27
+ * @throws {Error} When an instance of the class or its subclasses is created without the <code>new</code> operator.
28
+ */
29
+ var BaseObject = Metadata.createClass("sap.ui.base.Object", {
30
+ constructor: function () {
31
+ // complain if 'this' is not an instance of a subclass
32
+ if (!(this instanceof BaseObject)) {
33
+ throw Error("Cannot instantiate object: \"new\" is missing!");
9
34
  }
35
+ }
10
36
  });
11
- BaseObject.prototype.destroy = function () {
12
- };
37
+
38
+ /**
39
+ * Destructor method for objects.
40
+ * @public
41
+ */
42
+ BaseObject.prototype.destroy = function () {};
43
+
44
+ /**
45
+ * Returns the public facade of this object.
46
+ *
47
+ * By default, the public facade is implemented as an instance of {@link sap.ui.base.Interface},
48
+ * exposing the <code>publicMethods</code> as defined in the metadata of the class of this object.
49
+ *
50
+ * See the documentation of the {@link #.extend extend} method for an explanation of <code>publicMethods</code>.
51
+ *
52
+ * The facade is created on the first call of <code>getInterface</code> and reused for all later calls.
53
+ *
54
+ * @public
55
+ * @returns {sap.ui.base.Object} A facade for this object, with at least the public methods of the class of this.
56
+ */
13
57
  BaseObject.prototype.getInterface = function () {
14
- var oInterface = new Interface(this, this.getMetadata().getAllPublicMethods());
15
- this.getInterface = function () {
16
- return oInterface;
17
- };
58
+ // New implementation that avoids the overhead of a dedicated member for the interface
59
+ // initially, an Object instance has no associated Interface and the getInterface
60
+ // method is defined only in the prototype. So the code here will be executed.
61
+ // It creates an interface (basically the same code as in the old implementation)
62
+ var oInterface = new BaseObject._Interface(this, this.getMetadata().getAllPublicMethods());
63
+ // Now this Object instance gets a new, private implementation of getInterface
64
+ // that returns the newly created oInterface. Future calls of getInterface on the
65
+ // same Object therefore will return the already created interface
66
+ this.getInterface = function () {
18
67
  return oInterface;
68
+ };
69
+ // as the first caller doesn't benefit from the new method implementation we have to
70
+ // return the created interface as well.
71
+ return oInterface;
19
72
  };
73
+
74
+ /**
75
+ * Returns the metadata for the class that this object belongs to.
76
+ *
77
+ * This method is only defined when metadata has been declared by using {@link sap.ui.base.Object.defineClass}
78
+ * or {@link sap.ui.base.Object.extend}.
79
+ *
80
+ * @return {sap.ui.base.Metadata} metadata for the class of the object
81
+ * @name sap.ui.base.Object#getMetadata
82
+ * @function
83
+ * @public
84
+ */
85
+
86
+ /**
87
+ * The structure of the "metadata" object which is passed when inheriting from sap.ui.base.Object using its static "extend" method.
88
+ * See {@link sap.ui.base.Object.extend} for details on its usage.
89
+ *
90
+ * @typedef {object} sap.ui.base.Object.MetadataOptions
91
+ *
92
+ * @property {string[]} [interfaces] set of names of implemented interfaces (defaults to no interfaces)
93
+ * @property {boolean} [abstract=false] flag that marks the class as abstract (purely informational, defaults to false)
94
+ * @property {boolean} [final=false] flag that marks the class as final (defaults to false)
95
+ * @property {boolean} [deprecated=false] flag that marks the class as deprecated (defaults to false). May lead to an additional warning
96
+ * log message at runtime when the object is still used. For the documentation, also add a <code>@deprecated</code> tag in the JSDoc,
97
+ * describing since when it is deprecated and what any alternatives are.
98
+ *
99
+ * @public
100
+ */
101
+
102
+ /**
103
+ * Creates a subclass of class sap.ui.base.Object with name <code>sClassName</code>
104
+ * and enriches it with the information contained in <code>oClassInfo</code>.
105
+ *
106
+ * <code>oClassInfo</code> might contain three kinds of information:
107
+ * <ul>
108
+ * <li><code>metadata:</code> an (optional) object literal with metadata about the class like implemented interfaces,
109
+ * see {@link sap.ui.base.Object.MetadataOptions MetadataOptions} for details.
110
+ * The information in the object literal will be wrapped by an instance of {@link sap.ui.base.Metadata Metadata}.
111
+ * Subclasses of sap.ui.base.Object can enrich the set of supported metadata (e.g. see {@link sap.ui.core.Element.extend}).
112
+ * </li>
113
+ *
114
+ * <li><code>constructor:</code> a function that serves as a constructor function for the new class.
115
+ * If no constructor function is given, the framework creates a default implementation that delegates all
116
+ * its arguments to the constructor function of the base class.
117
+ * </li>
118
+ *
119
+ * <li><i>any-other-name:</i> any other property in the <code>oClassInfo</code> is copied into the prototype
120
+ * object of the newly created class. Callers can thereby add methods or properties to all instances of the
121
+ * class. But be aware that the given values are shared between all instances of the class. Usually, it doesn't
122
+ * make sense to use primitive values here other than to declare public constants.
123
+ *
124
+ * If such a property has a function as its value, and if the property name does not start with an underscore
125
+ * or with the prefix "on", the property name will be automatically added to the list of public methods of the
126
+ * class (see property <code>publicMethods</code> in the <code>metadata</code> section). If a method's name
127
+ * matches that pattern, but is not meant to be public, it shouldn't be included in the class info object,
128
+ * but be assigned to the prototype instead.
129
+ * </li>
130
+ *
131
+ * </ul>
132
+ *
133
+ * The prototype object of the newly created class uses the same prototype as instances of the base class
134
+ * (prototype chaining).
135
+ *
136
+ * A metadata object is always created, even if there is no <code>metadata</code> entry in the <code>oClassInfo</code>
137
+ * object. A getter for the metadata is always attached to the prototype and to the class (constructor function)
138
+ * itself.
139
+ *
140
+ * Last but not least, with the third argument <code>FNMetaImpl</code> the constructor of a metadata class
141
+ * can be specified. Instances of that class will be used to represent metadata for the newly created class
142
+ * and for any subclass created from it. Typically, only frameworks will use this parameter to enrich the
143
+ * metadata for a new class hierarchy they introduce (e.g. {@link sap.ui.core.Element.extend Element}).
144
+ *
145
+ * @param {string} sClassName name of the class to be created
146
+ * @param {object} [oClassInfo] structured object with information about the class
147
+ * @param {function} [FNMetaImpl] constructor function for the metadata object. If not given, it defaults to sap.ui.base.Metadata.
148
+ * @return {function} the created class / constructor function
149
+ * @public
150
+ * @static
151
+ * @name sap.ui.base.Object.extend
152
+ * @function
153
+ * @since 1.3.1
154
+ */
155
+
156
+ /**
157
+ * Creates metadata for a given class and attaches it to the constructor and prototype of that class.
158
+ *
159
+ * After creation, metadata can be retrieved with getMetadata().
160
+ *
161
+ * The static info can at least contain the following entries:
162
+ * <ul>
163
+ * <li>baseType: {string} fully qualified name of a base class or empty</li>
164
+ * <li>publicMethods: {string} an array of method names that will be visible in the interface proxy returned by {@link #getInterface}</li>
165
+ * </ul>
166
+ *
167
+ * @param {string} sClassName name of an (already declared) constructor function
168
+ * @param {object} oStaticInfo static info used to create the metadata object
169
+ * @param {string} oStaticInfo.baseType qualified name of a base class
170
+ * @param {string[]} oStaticInfo.publicMethods array of names of public methods
171
+ * @param {function} [FNMetaImpl] constructor function for the metadata object. If not given, it defaults to sap.ui.base.Metadata.
172
+ *
173
+ * @return {sap.ui.base.Metadata} the created metadata object
174
+ * @public
175
+ * @static
176
+ * @deprecated Since 1.3.1. Use the static <code>extend</code> method of the desired base class (e.g. {@link sap.ui.base.Object.extend})
177
+ */
20
178
  BaseObject.defineClass = function (sClassName, oStaticInfo, FNMetaImpl) {
21
- var oMetadata = new (FNMetaImpl || Metadata)(sClassName, oStaticInfo);
22
- var fnClass = oMetadata.getClass();
23
- fnClass.getMetadata = fnClass.prototype.getMetadata = function () {
24
- return oMetadata;
25
- };
26
- if (!oMetadata.isFinal()) {
27
- fnClass.extend = function (sSCName, oSCClassInfo, fnSCMetaImpl) {
28
- return Metadata.createClass(fnClass, sSCName, oSCClassInfo, fnSCMetaImpl || FNMetaImpl);
29
- };
30
- }
31
- Log.debug('defined class \'' + sClassName + '\'' + (oMetadata.getParent() ? ' as subclass of ' + oMetadata.getParent().getName() : ''));
179
+ // create Metadata object
180
+ var oMetadata = new (FNMetaImpl || Metadata)(sClassName, oStaticInfo);
181
+ var fnClass = oMetadata.getClass();
182
+ fnClass.getMetadata = fnClass.prototype.getMetadata = function () {
32
183
  return oMetadata;
184
+ };
185
+ // enrich function
186
+ if (!oMetadata.isFinal()) {
187
+ fnClass.extend = function (sSCName, oSCClassInfo, fnSCMetaImpl) {
188
+ return Metadata.createClass(fnClass, sSCName, oSCClassInfo, fnSCMetaImpl || FNMetaImpl);
189
+ };
190
+ }
191
+ Log.debug("defined class '" + sClassName + "'" + (oMetadata.getParent() ? " as subclass of " + oMetadata.getParent().getName() : ""));
192
+ return oMetadata;
33
193
  };
194
+
195
+ /**
196
+ * Checks whether this object is an instance of the named type.
197
+ *
198
+ * This check is solely based on the type names as declared in the class metadata.
199
+ * It compares the given <code>vTypeName</code> with the name of the class of this object,
200
+ * with the names of any base class of that class and with the names of all interfaces
201
+ * implemented by any of the aforementioned classes.
202
+ *
203
+ * Instead of a single type name, an array of type names can be given and the method
204
+ * will check if this object is an instance of any of the listed types (logical or).
205
+ *
206
+ * Should the UI5 class system in future implement additional means of associating classes
207
+ * with type names (e.g. by introducing mixins), then this method might detect matches
208
+ * for those names as well.
209
+ *
210
+ * @example
211
+ * myObject.isA("sap.ui.core.Control"); // true if myObject is an instance of sap.ui.core.Control
212
+ * myObject.isA(["sap.ui.core.Control", "sap.ui.core.Fragment"]); // true if myObject is an instance of sap.ui.core.Control or sap.ui.core.Fragment
213
+ *
214
+ * @param {string|string[]} vTypeName Type or types to check for
215
+ * @returns {boolean} Whether this object is an instance of the given type or of any of the given types
216
+ * @public
217
+ * @since 1.56
218
+ */
34
219
  BaseObject.prototype.isA = function (vTypeName) {
35
- return this.getMetadata().isA(vTypeName);
220
+ return this.getMetadata().isA(vTypeName);
36
221
  };
222
+
223
+ /**
224
+ * Checks whether the given object is an instance of the named type.
225
+ * This function is a short-hand convenience for {@link sap.ui.base.Object#isA}.
226
+ *
227
+ * Please see the API documentation of {@link sap.ui.base.Object#isA} for more details.
228
+ *
229
+ * @param {any} oObject Object which will be checked whether it is an instance of the given type
230
+ * @param {string|string[]} vTypeName Type or types to check for
231
+ * @returns {boolean} Whether the given object is an instance of the given type or of any of the given types
232
+ * @public
233
+ * @since 1.56
234
+ * @static
235
+ * @deprecated Since 1.120, please use {@link sap.ui.base.Object.isObjectA}.
236
+ */
37
237
  BaseObject.isA = function (oObject, vTypeName) {
38
- return oObject instanceof BaseObject && oObject.isA(vTypeName);
238
+ return oObject instanceof BaseObject && oObject.isA(vTypeName);
239
+ };
240
+
241
+ /**
242
+ * Checks whether the given object is an instance of the named type.
243
+ * This function is a short-hand convenience for {@link sap.ui.base.Object#isA}.
244
+ *
245
+ * Please see the API documentation of {@link sap.ui.base.Object#isA} for more details.
246
+ *
247
+ * @param {any} oObject Object which will be checked whether it is an instance of the given type
248
+ * @param {string|string[]} vTypeName Type or types to check for
249
+ * @returns {boolean} Whether the given object is an instance of the given type or of any of the given types
250
+ * @public
251
+ * @since 1.120
252
+ * @static
253
+ */
254
+ BaseObject.isObjectA = function (oObject, vTypeName) {
255
+ return oObject instanceof BaseObject && oObject.isA(vTypeName);
256
+ };
257
+
258
+ /**
259
+ * @param {sap.ui.base.Object} [oObject] Object for which a facade should be created
260
+ * @param {string[]} [aMethods=[]] Names of the methods, that should be available in the new facade
261
+ * @param {boolean} [_bReturnFacade=false] If true, the return value of a function call is this created Interface instance instead of the BaseObject interface
262
+ * @private
263
+ * @static
264
+ */
265
+ BaseObject._Interface = function (oObject, aMethods, _bReturnFacade) {
266
+ // if object is null or undefined, return itself
267
+ if (!oObject) {
268
+ return oObject;
269
+ }
270
+ function fCreateDelegator(oObject, sMethodName) {
271
+ return function () {
272
+ // return oObject[sMethodName].apply(oObject, arguments);
273
+ var tmp = oObject[sMethodName].apply(oObject, arguments);
274
+ // to avoid to hide the implementation behind the interface you need
275
+ // to override the getInterface function in the object or create the interface with bFacade = true
276
+ if (_bReturnFacade) {
277
+ return this;
278
+ } else {
279
+ return tmp instanceof BaseObject ? tmp.getInterface() : tmp;
280
+ }
281
+ };
282
+ }
283
+
284
+ // if there are no methods return
285
+ if (!aMethods) {
286
+ return {};
287
+ }
288
+ var sMethodName;
289
+
290
+ // create functions for all delegated methods
291
+ // PERFOPT: 'cache' length of aMethods to reduce # of resolutions
292
+ for (var i = 0, ml = aMethods.length; i < ml; i++) {
293
+ sMethodName = aMethods[i];
294
+ //!oObject[sMethodName] for 'lazy' loading interface methods ;-)
295
+ if (!oObject[sMethodName] || typeof oObject[sMethodName] === "function") {
296
+ this[sMethodName] = fCreateDelegator(oObject, sMethodName);
297
+ }
298
+ }
39
299
  };
40
300
  export default BaseObject;
@@ -1,8 +1,24 @@
1
- var CalendarType = {
2
- Gregorian: "Gregorian",
3
- Islamic: "Islamic",
4
- Japanese: "Japanese",
5
- Persian: "Persian",
6
- Buddhist: "Buddhist"
7
- };
8
- export default CalendarType;
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
+ // Provides type sap.ui.core.CalendarType.
7
+ import DataType from "../base/DataType.js";
8
+ import CalendarType from "../../base/i18n/date/CalendarType.js";
9
+ /**
10
+ * The types of <code>Calendar</code>.
11
+ *
12
+ * @enum {string}
13
+ * @name sap.ui.core.CalendarType
14
+ * @public
15
+ * @deprecated As of Version 1.120. Please use {@link module:sap/base/18n/date/CalendarType} instead.
16
+ * @borrows module:sap/base/i18n/date/CalendarType.Gregorian as Gregorian
17
+ * @borrows module:sap/base/i18n/date/CalendarType.Islamic as Islamic
18
+ * @borrows module:sap/base/i18n/date/CalendarType.Japanese as Japanese
19
+ * @borrows module:sap/base/i18n/date/CalendarType.Persian as Persian
20
+ * @borrows module:sap/base/i18n/date/CalendarType.Buddhist as Buddhist
21
+ */
22
+
23
+ DataType.registerEnum("sap.ui.core.CalendarType", CalendarType);
24
+ export default CalendarType;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * OpenUI5 Configuration Shim
3
+ */
4
+ declare const Configuration: {
5
+ getLanguage: () => string | undefined;
6
+ getCalendarType: () => import("@ui5/webcomponents-base/dist/types/CalendarType.js").default;
7
+ getSupportedLanguages: () => string[] | null;
8
+ getOriginInfo: () => void;
9
+ getFormatSettings: () => {
10
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
11
+ getLegacyDateFormat: () => void;
12
+ getCustomLocaleData: () => void;
13
+ };
14
+ getTimezone: () => string;
15
+ getCalendarWeekNumbering: () => string;
16
+ };
17
+ export default Configuration;
@@ -0,0 +1,23 @@
1
+ import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
2
+ import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
3
+ import { getTimezone as getConfigTimezone } from "@ui5/webcomponents-base/dist/config/Timezone.js";
4
+ import getDesigntimePropertyAsArray from "@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js";
5
+ // @ts-ignore
6
+ import TimezoneUtil from "./format/TimezoneUtil.js";
7
+ import FormatSettings from "./FormatSettings.js";
8
+ const emptyFn = () => { };
9
+ /**
10
+ * OpenUI5 Configuration Shim
11
+ */
12
+ const Configuration = {
13
+ getLanguage,
14
+ getCalendarType,
15
+ 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$"),
16
+ getOriginInfo: emptyFn,
17
+ getFormatSettings: () => FormatSettings,
18
+ getTimezone: () => getConfigTimezone() || TimezoneUtil.getLocalTimezone(),
19
+ // Calculate calendar week numbering by active format locale
20
+ getCalendarWeekNumbering: () => "Default",
21
+ };
22
+ export default Configuration;
23
+ //# sourceMappingURL=Configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,4BAA4B,MAAM,mEAAmE,CAAC;AAC7G,aAAa;AACb,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,aAAa,GAAG;IACrB,WAAW;IACX,eAAe;IACf,qBAAqB,EAAE,GAAG,EAAE,CAAC,4BAA4B,CAAC,2IAA2I,CAAC;IACtM,aAAa,EAAE,OAAO;IACtB,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;IACvC,WAAW,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE,IAAI,YAAY,CAAC,gBAAgB,EAAY;IACnF,4DAA4D;IAC5D,wBAAwB,EAAE,GAAG,EAAE,CAAC,SAAS;CACzC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { getLanguage } from \"@ui5/webcomponents-base/dist/config/Language.js\";\nimport { getCalendarType } from \"@ui5/webcomponents-base/dist/config/CalendarType.js\";\nimport { getTimezone as getConfigTimezone } from \"@ui5/webcomponents-base/dist/config/Timezone.js\";\nimport getDesigntimePropertyAsArray from \"@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js\";\n// @ts-ignore\nimport TimezoneUtil from \"./format/TimezoneUtil.js\";\nimport FormatSettings from \"./FormatSettings.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 Configuration Shim\n */\nconst Configuration = {\n\tgetLanguage,\n\tgetCalendarType,\n\tgetSupportedLanguages: () => 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$\"),\n\tgetOriginInfo: emptyFn,\n\tgetFormatSettings: () => FormatSettings,\n\tgetTimezone: () => getConfigTimezone() || TimezoneUtil.getLocalTimezone() as string,\n\t// Calculate calendar week numbering by active format locale\n\tgetCalendarWeekNumbering: () => \"Default\",\n};\n\nexport default Configuration;\n"]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * OpenUI5 Core shim
3
+ */
4
+ declare const Core: {
5
+ getConfiguration: () => {
6
+ getLanguage: () => string | undefined;
7
+ getCalendarType: () => import("@ui5/webcomponents-base/dist/types/CalendarType.js").default;
8
+ getSupportedLanguages: () => string[] | null;
9
+ getOriginInfo: () => void;
10
+ getFormatSettings: () => {
11
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
12
+ getLegacyDateFormat: () => void;
13
+ getCustomLocaleData: () => void;
14
+ };
15
+ getTimezone: () => string;
16
+ getCalendarWeekNumbering: () => string;
17
+ };
18
+ getLibraryResourceBundle: void;
19
+ getFormatSettings: () => {
20
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
21
+ getLegacyDateFormat: () => void;
22
+ getCustomLocaleData: () => void;
23
+ };
24
+ };
25
+ export default Core;
@@ -1,38 +1,13 @@
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
-
1
+ import FormatSettings from "./FormatSettings.js";
2
+ import Configuration from "./Configuration.js";
3
+ const emptyFn = () => { };
29
4
  /**
30
5
  * OpenUI5 Core shim
31
6
  */
32
7
  const Core = {
33
- getConfiguration: () => Configuration,
34
- getLibraryResourceBundle: emptyFn(),
35
- getFormatSettings: () => FormatSettings,
8
+ getConfiguration: () => Configuration,
9
+ getLibraryResourceBundle: emptyFn(),
10
+ getFormatSettings: () => FormatSettings,
36
11
  };
37
-
38
12
  export default Core;
13
+ //# sourceMappingURL=Core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Core.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/Core.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,IAAI,GAAG;IACZ,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa;IACrC,wBAAwB,EAAE,OAAO,EAAE;IACnC,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import FormatSettings from \"./FormatSettings.js\";\nimport Configuration from \"./Configuration.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 Core shim\n */\nconst Core = {\n\tgetConfiguration: () => Configuration,\n\tgetLibraryResourceBundle: emptyFn(),\n\tgetFormatSettings: () => FormatSettings,\n};\n\nexport default Core;\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * OpenUI5 FormatSettings shim
3
+ */
4
+ declare const FormatSettings: {
5
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
6
+ getLegacyDateFormat: () => void;
7
+ getCustomLocaleData: () => void;
8
+ };
9
+ export default FormatSettings;
@@ -0,0 +1,12 @@
1
+ import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
2
+ const emptyFn = () => { };
3
+ /**
4
+ * OpenUI5 FormatSettings shim
5
+ */
6
+ const FormatSettings = {
7
+ getFormatLocale: getLocale,
8
+ getLegacyDateFormat: emptyFn,
9
+ getCustomLocaleData: emptyFn,
10
+ };
11
+ export default FormatSettings;
12
+ //# sourceMappingURL=FormatSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kDAAkD,CAAC;AAEzE,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,cAAc,GAAG;IACtB,eAAe,EAAE,SAAS;IAC1B,mBAAmB,EAAE,OAAO;IAC5B,mBAAmB,EAAE,OAAO;CAC5B,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import getLocale from \"@ui5/webcomponents-base/dist/locale/getLocale.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 FormatSettings shim\n */\nconst FormatSettings = {\n\tgetFormatLocale: getLocale,\n\tgetLegacyDateFormat: emptyFn,\n\tgetCustomLocaleData: emptyFn,\n};\n\nexport default FormatSettings;\n"]}