@ui5/webcomponents-localization 0.0.0-dc606098a → 0.0.0-ddc5fe31b

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 (230) hide show
  1. package/.eslintignore +2 -0
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +847 -0
  4. package/README.md +37 -6
  5. package/dist/.tsbuildinfo +1 -0
  6. package/dist/Assets-static.d.ts +1 -0
  7. package/dist/Assets-static.js +3 -0
  8. package/dist/Assets-static.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/DateFormat.d.ts +6 -0
  13. package/dist/DateFormat.js +6 -2
  14. package/dist/DateFormat.js.map +1 -0
  15. package/dist/LocaleData.d.ts +6 -0
  16. package/dist/LocaleData.js +6 -2
  17. package/dist/LocaleData.js.map +1 -0
  18. package/dist/dates/CalendarDate.d.ts +43 -0
  19. package/dist/dates/CalendarDate.js +171 -181
  20. package/dist/dates/CalendarDate.js.map +1 -0
  21. package/dist/dates/ExtremeDates.d.ts +5 -0
  22. package/dist/dates/ExtremeDates.js +29 -0
  23. package/dist/dates/ExtremeDates.js.map +1 -0
  24. package/dist/dates/UI5Date.d.ts +6 -0
  25. package/dist/dates/UI5Date.js +7 -0
  26. package/dist/dates/UI5Date.js.map +1 -0
  27. package/dist/dates/UniversalDate.d.ts +47 -0
  28. package/dist/dates/UniversalDate.js +5 -0
  29. package/dist/dates/UniversalDate.js.map +1 -0
  30. package/dist/dates/calculateWeekNumber.d.ts +5 -0
  31. package/dist/dates/calculateWeekNumber.js +42 -48
  32. package/dist/dates/calculateWeekNumber.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/ar.json +5571 -5904
  62. package/dist/generated/assets/cldr/ar_EG.json +5571 -5904
  63. package/dist/generated/assets/cldr/ar_SA.json +5570 -5904
  64. package/dist/generated/assets/cldr/bg.json +4491 -4977
  65. package/dist/generated/assets/cldr/ca.json +4478 -4994
  66. package/dist/generated/assets/cldr/cs.json +5067 -5496
  67. package/dist/generated/assets/cldr/cy.json +5481 -0
  68. package/dist/generated/assets/cldr/da.json +4371 -4886
  69. package/dist/generated/assets/cldr/de.json +4420 -4914
  70. package/dist/generated/assets/cldr/de_AT.json +4421 -4915
  71. package/dist/generated/assets/cldr/de_CH.json +4419 -4913
  72. package/dist/generated/assets/cldr/el.json +4309 -4881
  73. package/dist/generated/assets/cldr/el_CY.json +4309 -4881
  74. package/dist/generated/assets/cldr/en.json +4342 -4968
  75. package/dist/generated/assets/cldr/en_AU.json +4382 -4960
  76. package/dist/generated/assets/cldr/en_GB.json +4373 -4969
  77. package/dist/generated/assets/cldr/en_HK.json +4382 -4975
  78. package/dist/generated/assets/cldr/en_IE.json +4373 -4969
  79. package/dist/generated/assets/cldr/en_IN.json +4378 -4970
  80. package/dist/generated/assets/cldr/en_NZ.json +4373 -4969
  81. package/dist/generated/assets/cldr/en_PG.json +4374 -4970
  82. package/dist/generated/assets/cldr/en_SG.json +4378 -4971
  83. package/dist/generated/assets/cldr/en_ZA.json +4374 -4970
  84. package/dist/generated/assets/cldr/es.json +4584 -4910
  85. package/dist/generated/assets/cldr/es_AR.json +4587 -4912
  86. package/dist/generated/assets/cldr/es_BO.json +4586 -4911
  87. package/dist/generated/assets/cldr/es_CL.json +4479 -4912
  88. package/dist/generated/assets/cldr/es_CO.json +4479 -4911
  89. package/dist/generated/assets/cldr/es_MX.json +4588 -4913
  90. package/dist/generated/assets/cldr/es_PE.json +4370 -4911
  91. package/dist/generated/assets/cldr/es_UY.json +4372 -4913
  92. package/dist/generated/assets/cldr/es_VE.json +4371 -4912
  93. package/dist/generated/assets/cldr/et.json +4373 -4965
  94. package/dist/generated/assets/cldr/fa.json +4429 -4881
  95. package/dist/generated/assets/cldr/fi.json +4514 -5006
  96. package/dist/generated/assets/cldr/fr.json +4383 -4977
  97. package/dist/generated/assets/cldr/fr_BE.json +4383 -4977
  98. package/dist/generated/assets/cldr/fr_CA.json +4377 -4971
  99. package/dist/generated/assets/cldr/fr_CH.json +4401 -4995
  100. package/dist/generated/assets/cldr/fr_LU.json +4383 -4977
  101. package/dist/generated/assets/cldr/he.json +4980 -5376
  102. package/dist/generated/assets/cldr/hi.json +4345 -4827
  103. package/dist/generated/assets/cldr/hr.json +4640 -4917
  104. package/dist/generated/assets/cldr/hu.json +4415 -4854
  105. package/dist/generated/assets/cldr/id.json +4132 -4656
  106. package/dist/generated/assets/cldr/it.json +4355 -4948
  107. package/dist/generated/assets/cldr/it_CH.json +4355 -4948
  108. package/dist/generated/assets/cldr/ja.json +4251 -4828
  109. package/dist/generated/assets/cldr/kk.json +4503 -4723
  110. package/dist/generated/assets/cldr/ko.json +4210 -4736
  111. package/dist/generated/assets/cldr/lt.json +4939 -5479
  112. package/dist/generated/assets/cldr/lv.json +4651 -5110
  113. package/dist/generated/assets/cldr/ms.json +4093 -4513
  114. package/dist/generated/assets/cldr/nb.json +4403 -4975
  115. package/dist/generated/assets/cldr/nl.json +4542 -4882
  116. package/dist/generated/assets/cldr/nl_BE.json +4542 -4882
  117. package/dist/generated/assets/cldr/pl.json +4978 -5174
  118. package/dist/generated/assets/cldr/pt.json +4597 -4803
  119. package/dist/generated/assets/cldr/pt_PT.json +4648 -4938
  120. package/dist/generated/assets/cldr/ro.json +4633 -5088
  121. package/dist/generated/assets/cldr/ru.json +4947 -5405
  122. package/dist/generated/assets/cldr/ru_UA.json +4947 -5405
  123. package/dist/generated/assets/cldr/sk.json +4980 -5368
  124. package/dist/generated/assets/cldr/sl.json +4948 -5338
  125. package/dist/generated/assets/cldr/sr.json +4737 -5124
  126. package/dist/generated/assets/cldr/sr_Latn.json +4724 -0
  127. package/dist/generated/assets/cldr/sv.json +4406 -5009
  128. package/dist/generated/assets/cldr/th.json +4234 -4795
  129. package/dist/generated/assets/cldr/tr.json +4451 -4977
  130. package/dist/generated/assets/cldr/uk.json +4908 -5351
  131. package/dist/generated/assets/cldr/vi.json +4094 -4671
  132. package/dist/generated/assets/cldr/zh_CN.json +4124 -4630
  133. package/dist/generated/assets/cldr/zh_HK.json +4132 -4638
  134. package/dist/generated/assets/cldr/zh_SG.json +4132 -4638
  135. package/dist/generated/assets/cldr/zh_TW.json +4155 -4726
  136. package/dist/generated/json-imports/LocaleData-static.d.ts +1 -0
  137. package/dist/generated/json-imports/LocaleData-static.js +88 -0
  138. package/dist/generated/json-imports/LocaleData-static.js.map +1 -0
  139. package/dist/generated/json-imports/LocaleData.d.ts +1 -0
  140. package/dist/generated/json-imports/LocaleData.js +90 -95
  141. package/dist/generated/json-imports/LocaleData.js.map +1 -0
  142. package/dist/getCachedLocaleDataInstance.d.ts +4 -0
  143. package/dist/getCachedLocaleDataInstance.js +10 -0
  144. package/dist/getCachedLocaleDataInstance.js.map +1 -0
  145. package/dist/locale/getLocaleData.d.ts +11 -0
  146. package/dist/locale/getLocaleData.js +13 -17
  147. package/dist/locale/getLocaleData.js.map +1 -0
  148. package/dist/sap/base/Event.js +59 -0
  149. package/dist/sap/base/Eventing.js +146 -0
  150. package/dist/sap/base/Log.js +2 -248
  151. package/dist/sap/base/assert.js +31 -9
  152. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  153. package/dist/sap/base/config.js +17 -0
  154. package/dist/sap/base/i18n/Formatting.js +1130 -0
  155. package/dist/sap/base/i18n/LanguageTag.js +173 -0
  156. package/dist/sap/base/i18n/Localization.d.ts +4 -0
  157. package/dist/sap/base/i18n/Localization.js +12 -0
  158. package/dist/sap/base/i18n/Localization.js.map +1 -0
  159. package/dist/sap/base/i18n/date/CalendarType.js +43 -0
  160. package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
  161. package/dist/sap/base/i18n/date/TimezoneUtils.js +319 -0
  162. package/dist/sap/base/strings/camelize.js +30 -0
  163. package/dist/sap/base/strings/formatMessage.js +88 -15
  164. package/dist/sap/base/util/LoaderExtensions.d.ts +4 -0
  165. package/dist/sap/base/util/LoaderExtensions.js +11 -4
  166. package/dist/sap/base/util/LoaderExtensions.js.map +1 -0
  167. package/dist/sap/base/util/ObjectPath.d.ts +4 -0
  168. package/dist/sap/base/util/ObjectPath.js +4 -33
  169. package/dist/sap/base/util/ObjectPath.js.map +1 -0
  170. package/dist/sap/base/util/Version.js +157 -0
  171. package/dist/sap/base/util/_merge.js +83 -26
  172. package/dist/sap/base/util/array/uniqueSort.js +37 -15
  173. package/dist/sap/base/util/deepClone.js +102 -0
  174. package/dist/sap/base/util/deepEqual.js +75 -55
  175. package/dist/sap/base/util/extend.js +58 -7
  176. package/dist/sap/base/util/isEmptyObject.js +34 -0
  177. package/dist/sap/base/util/isPlainObject.js +35 -1
  178. package/dist/sap/base/util/now.js +24 -3
  179. package/dist/sap/base/util/resolveReference.js +157 -0
  180. package/dist/sap/base/util/uid.js +27 -0
  181. package/dist/sap/ui/base/DataType.js +657 -0
  182. package/dist/sap/ui/base/Interface.js +50 -6
  183. package/dist/sap/ui/base/Metadata.js +435 -173
  184. package/dist/sap/ui/base/Object.js +287 -27
  185. package/dist/sap/ui/core/CalendarType.js +24 -8
  186. package/dist/sap/ui/core/Configuration.d.ts +18 -0
  187. package/dist/sap/ui/core/Configuration.js +23 -0
  188. package/dist/sap/ui/core/Configuration.js.map +1 -0
  189. package/dist/sap/ui/core/Core.d.ts +27 -0
  190. package/dist/sap/ui/core/Core.js +7 -32
  191. package/dist/sap/ui/core/Core.js.map +1 -0
  192. package/dist/sap/ui/core/FormatSettings.d.ts +10 -0
  193. package/dist/sap/ui/core/FormatSettings.js +14 -0
  194. package/dist/sap/ui/core/FormatSettings.js.map +1 -0
  195. package/dist/sap/ui/core/Locale.js +190 -116
  196. package/dist/sap/ui/core/LocaleData.js +2668 -2679
  197. package/dist/sap/ui/core/Supportability.js +5 -0
  198. package/dist/sap/ui/core/Theming.js +539 -0
  199. package/dist/sap/ui/core/date/Buddhist.js +162 -93
  200. package/dist/sap/ui/core/date/CalendarUtils.js +65 -0
  201. package/dist/sap/ui/core/date/CalendarWeekNumbering.js +30 -0
  202. package/dist/sap/ui/core/date/Gregorian.js +25 -10
  203. package/dist/sap/ui/core/date/Islamic.js +298 -185
  204. package/dist/sap/ui/core/date/Japanese.js +212 -117
  205. package/dist/sap/ui/core/date/Persian.js +324 -195
  206. package/dist/sap/ui/core/date/UI5Date.js +991 -0
  207. package/dist/sap/ui/core/date/UniversalDate.js +1251 -209
  208. package/dist/sap/ui/core/date/_Calendars.js +10 -1
  209. package/dist/sap/ui/core/format/DateFormat.js +3163 -1781
  210. package/dist/sap/ui/core/format/TimezoneUtil.js +24 -0
  211. package/package-scripts.cjs +26 -0
  212. package/package.json +20 -14
  213. package/tsconfig.json +24 -0
  214. package/used-modules.txt +29 -2
  215. package/dist/sap/ui/Device.js +0 -5
  216. package/package-scripts.js +0 -31
  217. package/src/Assets.js +0 -2
  218. package/src/DateFormat.js +0 -3
  219. package/src/LocaleData.js +0 -3
  220. package/src/dates/CalendarDate.js +0 -203
  221. package/src/dates/calculateWeekNumber.js +0 -51
  222. package/src/locale/getLocaleData.js +0 -27
  223. package/src/sap/base/util/LoaderExtensions.js +0 -7
  224. package/src/sap/ui/core/Core.js +0 -38
  225. /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
  226. /package/{src/features/calendar/Buddhist.js → dist/features/calendar/Buddhist.d.ts} +0 -0
  227. /package/{src/features/calendar/Gregorian.js → dist/features/calendar/Gregorian.d.ts} +0 -0
  228. /package/{src/features/calendar/Islamic.js → dist/features/calendar/Islamic.d.ts} +0 -0
  229. /package/{src/features/calendar/Japanese.js → dist/features/calendar/Japanese.d.ts} +0 -0
  230. /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.3
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,18 @@
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 | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
11
+ getLegacyDateFormat: () => void;
12
+ getCustomLocaleData: () => void;
13
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
14
+ };
15
+ getTimezone: () => string;
16
+ getCalendarWeekNumbering: () => string;
17
+ };
18
+ 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,27 @@
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 | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
12
+ getLegacyDateFormat: () => void;
13
+ getCustomLocaleData: () => void;
14
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
15
+ };
16
+ getTimezone: () => string;
17
+ getCalendarWeekNumbering: () => string;
18
+ };
19
+ getLibraryResourceBundle: void;
20
+ getFormatSettings: () => {
21
+ getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
22
+ getLegacyDateFormat: () => void;
23
+ getCustomLocaleData: () => void;
24
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
25
+ };
26
+ };
27
+ 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,10 @@
1
+ /**
2
+ * OpenUI5 FormatSettings shim
3
+ */
4
+ declare const FormatSettings: {
5
+ getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale").default;
6
+ getLegacyDateFormat: () => void;
7
+ getCustomLocaleData: () => void;
8
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats").default.getLegacyDateCalendarCustomizing;
9
+ };
10
+ export default FormatSettings;
@@ -0,0 +1,14 @@
1
+ import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
2
+ import { getLegacyDateCalendarCustomizing } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
3
+ const emptyFn = () => { };
4
+ /**
5
+ * OpenUI5 FormatSettings shim
6
+ */
7
+ const FormatSettings = {
8
+ getFormatLocale: getLocale,
9
+ getLegacyDateFormat: emptyFn,
10
+ getCustomLocaleData: emptyFn,
11
+ getLegacyDateCalendarCustomizing,
12
+ };
13
+ export default FormatSettings;
14
+ //# 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;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AAEzG,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;IAC5B,gCAAgC;CAChC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import getLocale from \"@ui5/webcomponents-base/dist/locale/getLocale.js\";\nimport { getLegacyDateCalendarCustomizing } from \"@ui5/webcomponents-base/dist/config/FormatSettings.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 FormatSettings shim\n */\nconst FormatSettings = {\n\tgetFormatLocale: getLocale,\n\tgetLegacyDateFormat: emptyFn,\n\tgetCustomLocaleData: emptyFn,\n\tgetLegacyDateCalendarCustomizing,\n};\n\nexport default FormatSettings;\n"]}