@ui5/webcomponents-localization 0.0.0-d1315d658 → 0.0.0-d160e83dd

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 (177) hide show
  1. package/.eslintignore +2 -1
  2. package/CHANGELOG.md +1174 -0
  3. package/README.md +3 -5
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/Assets-fetch.d.ts +1 -0
  6. package/dist/Assets-fetch.js +3 -0
  7. package/dist/Assets-fetch.js.map +1 -0
  8. package/dist/CalendarUtils.d.ts +3 -0
  9. package/dist/CalendarUtils.js +6 -0
  10. package/dist/CalendarUtils.js.map +1 -0
  11. package/dist/DateFormat.d.ts +0 -1
  12. package/dist/LocaleData.d.ts +0 -1
  13. package/dist/dates/CalendarDate.d.ts +0 -1
  14. package/dist/dates/CalendarDate.js.map +1 -1
  15. package/dist/dates/ExtremeDates.d.ts +1 -1
  16. package/dist/dates/ExtremeDates.js.map +1 -1
  17. package/dist/dates/UI5Date.d.ts +0 -1
  18. package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -1
  19. package/dist/dates/getRoundedTimestamp.js.map +1 -1
  20. package/dist/dates/modifyDateBy.js.map +1 -1
  21. package/dist/dates/transformDateToSecondaryType.js.map +1 -1
  22. package/dist/generated/assets/cldr/Unicode-Data-Files-LICENSE.txt +27 -0
  23. package/dist/generated/assets/cldr/ar.json +7085 -5531
  24. package/dist/generated/assets/cldr/ar_EG.json +7085 -5531
  25. package/dist/generated/assets/cldr/ar_SA.json +7084 -5530
  26. package/dist/generated/assets/cldr/bg.json +5979 -4452
  27. package/dist/generated/assets/cldr/ca.json +6081 -4440
  28. package/dist/generated/assets/cldr/cnr.json +6169 -0
  29. package/dist/generated/assets/cldr/cs.json +6707 -4960
  30. package/dist/generated/assets/cldr/cy.json +6930 -5211
  31. package/dist/generated/assets/cldr/da.json +5925 -4308
  32. package/dist/generated/assets/cldr/de.json +6046 -4313
  33. package/dist/generated/assets/cldr/de_AT.json +6047 -4314
  34. package/dist/generated/assets/cldr/de_CH.json +6045 -4312
  35. package/dist/generated/assets/cldr/el.json +5830 -4281
  36. package/dist/generated/assets/cldr/el_CY.json +5830 -4281
  37. package/dist/generated/assets/cldr/en.json +6042 -4316
  38. package/dist/generated/assets/cldr/en_AU.json +6082 -4319
  39. package/dist/generated/assets/cldr/en_GB.json +6073 -4329
  40. package/dist/generated/assets/cldr/en_HK.json +6082 -4337
  41. package/dist/generated/assets/cldr/en_IE.json +6073 -4328
  42. package/dist/generated/assets/cldr/en_IN.json +6078 -4333
  43. package/dist/generated/assets/cldr/en_NZ.json +6073 -4328
  44. package/dist/generated/assets/cldr/en_PG.json +6074 -4329
  45. package/dist/generated/assets/cldr/en_SG.json +6078 -4333
  46. package/dist/generated/assets/cldr/en_ZA.json +6074 -4329
  47. package/dist/generated/assets/cldr/es.json +6101 -4331
  48. package/dist/generated/assets/cldr/es_AR.json +6104 -4334
  49. package/dist/generated/assets/cldr/es_BO.json +6103 -4333
  50. package/dist/generated/assets/cldr/es_CL.json +5996 -4334
  51. package/dist/generated/assets/cldr/es_CO.json +5996 -4333
  52. package/dist/generated/assets/cldr/es_MX.json +6105 -4335
  53. package/dist/generated/assets/cldr/es_PE.json +5887 -4333
  54. package/dist/generated/assets/cldr/es_UY.json +5889 -4335
  55. package/dist/generated/assets/cldr/es_VE.json +5888 -4334
  56. package/dist/generated/assets/cldr/et.json +6025 -4340
  57. package/dist/generated/assets/cldr/fa.json +5948 -4367
  58. package/dist/generated/assets/cldr/fi.json +6193 -4463
  59. package/dist/generated/assets/cldr/fr.json +5995 -4357
  60. package/dist/generated/assets/cldr/fr_BE.json +5995 -4357
  61. package/dist/generated/assets/cldr/fr_CA.json +5989 -4351
  62. package/dist/generated/assets/cldr/fr_CH.json +6013 -4375
  63. package/dist/generated/assets/cldr/fr_LU.json +5995 -4357
  64. package/dist/generated/assets/cldr/he.json +6539 -4869
  65. package/dist/generated/assets/cldr/hi.json +5857 -4295
  66. package/dist/generated/assets/cldr/hr.json +6194 -4583
  67. package/dist/generated/assets/cldr/hu.json +5943 -4364
  68. package/dist/generated/assets/cldr/id.json +5728 -4060
  69. package/dist/generated/assets/cldr/it.json +5984 -4299
  70. package/dist/generated/assets/cldr/it_CH.json +5984 -4299
  71. package/dist/generated/assets/cldr/ja.json +5887 -4211
  72. package/dist/generated/assets/cldr/kk.json +5937 -4339
  73. package/dist/generated/assets/cldr/ko.json +5768 -4189
  74. package/dist/generated/assets/cldr/lt.json +6576 -4850
  75. package/dist/generated/assets/cldr/lv.json +6112 -4587
  76. package/dist/generated/assets/cldr/mk.json +6045 -0
  77. package/dist/generated/assets/cldr/ms.json +5562 -4021
  78. package/dist/generated/assets/cldr/nb.json +6033 -4335
  79. package/dist/generated/assets/cldr/nl.json +6200 -4294
  80. package/dist/generated/assets/cldr/nl_BE.json +6200 -4294
  81. package/dist/generated/assets/cldr/pl.json +6587 -4667
  82. package/dist/generated/assets/cldr/pt.json +6113 -4235
  83. package/dist/generated/assets/cldr/pt_PT.json +6178 -4372
  84. package/dist/generated/assets/cldr/ro.json +6198 -4563
  85. package/dist/generated/assets/cldr/ru.json +6501 -4909
  86. package/dist/generated/assets/cldr/ru_UA.json +6501 -4909
  87. package/dist/generated/assets/cldr/sk.json +6430 -4939
  88. package/dist/generated/assets/cldr/sl.json +6442 -4910
  89. package/dist/generated/assets/cldr/sr.json +6239 -4585
  90. package/dist/generated/assets/cldr/sr_Latn.json +6224 -4574
  91. package/dist/generated/assets/cldr/sv.json +6074 -4362
  92. package/dist/generated/assets/cldr/th.json +5873 -4214
  93. package/dist/generated/assets/cldr/tr.json +6092 -4400
  94. package/dist/generated/assets/cldr/uk.json +6452 -4858
  95. package/dist/generated/assets/cldr/vi.json +5667 -4070
  96. package/dist/generated/assets/cldr/zh_CN.json +5715 -4100
  97. package/dist/generated/assets/cldr/zh_HK.json +5724 -4108
  98. package/dist/generated/assets/cldr/zh_SG.json +5724 -4108
  99. package/dist/generated/assets/cldr/zh_TW.json +5791 -4131
  100. package/dist/generated/json-imports/LocaleData-fetch.d.ts +1 -0
  101. package/dist/generated/json-imports/LocaleData-fetch.js +93 -0
  102. package/dist/generated/json-imports/LocaleData-fetch.js.map +1 -0
  103. package/dist/generated/json-imports/LocaleData.d.ts +1 -0
  104. package/dist/generated/json-imports/LocaleData.js +89 -89
  105. package/dist/generated/json-imports/LocaleData.js.map +1 -0
  106. package/dist/getCachedLocaleDataInstance.js.map +1 -1
  107. package/dist/locale/getLocaleData.js.map +1 -1
  108. package/dist/sap/base/Event.js +59 -0
  109. package/dist/sap/base/Eventing.js +146 -0
  110. package/dist/sap/base/Log.js +2 -239
  111. package/dist/sap/base/assert.js +28 -1
  112. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  113. package/dist/sap/base/config.js +17 -0
  114. package/dist/sap/base/i18n/Formatting.d.ts +8 -0
  115. package/dist/sap/base/i18n/Formatting.js +11 -0
  116. package/dist/sap/base/i18n/Formatting.js.map +1 -0
  117. package/dist/sap/base/i18n/LanguageTag.js +168 -30
  118. package/dist/sap/base/i18n/date/CalendarType.js +36 -1
  119. package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +76 -1
  120. package/dist/sap/base/i18n/date/TimezoneUtils.js +242 -12
  121. package/dist/sap/base/strings/camelize.js +30 -0
  122. package/dist/sap/base/strings/formatMessage.js +88 -15
  123. package/dist/sap/base/util/LoaderExtensions.js.map +1 -1
  124. package/dist/sap/base/util/ObjectPath.d.ts +4 -0
  125. package/dist/sap/base/util/ObjectPath.js +4 -33
  126. package/dist/sap/base/util/ObjectPath.js.map +1 -0
  127. package/dist/sap/base/util/Version.js +157 -0
  128. package/dist/sap/base/util/_merge.js +83 -26
  129. package/dist/sap/base/util/array/uniqueSort.js +37 -15
  130. package/dist/sap/base/util/deepClone.js +102 -0
  131. package/dist/sap/base/util/deepEqual.js +75 -51
  132. package/dist/sap/base/util/extend.js +58 -7
  133. package/dist/sap/base/util/isEmptyObject.js +34 -0
  134. package/dist/sap/base/util/isPlainObject.js +35 -1
  135. package/dist/sap/base/util/now.js +24 -3
  136. package/dist/sap/base/util/resolveReference.js +3 -0
  137. package/dist/sap/base/util/uid.js +27 -0
  138. package/dist/sap/ui/base/DataType.js +657 -0
  139. package/dist/sap/ui/base/Interface.js +47 -1
  140. package/dist/sap/ui/base/Metadata.js +433 -180
  141. package/dist/sap/ui/base/Object.js +284 -48
  142. package/dist/sap/ui/core/CalendarType.js +23 -1
  143. package/dist/sap/ui/core/Configuration.d.ts +2 -2
  144. package/dist/sap/ui/core/Configuration.js +2 -0
  145. package/dist/sap/ui/core/Configuration.js.map +1 -1
  146. package/dist/sap/ui/core/Core.d.ts +3 -4
  147. package/dist/sap/ui/core/FormatSettings.d.ts +1 -2
  148. package/dist/sap/ui/core/FormatSettings.js +0 -2
  149. package/dist/sap/ui/core/FormatSettings.js.map +1 -1
  150. package/dist/sap/ui/core/Locale.js +189 -57
  151. package/dist/sap/ui/core/LocaleData.js +2670 -1380
  152. package/dist/sap/ui/core/Supportability.js +5 -0
  153. package/dist/sap/ui/core/Theming.js +539 -0
  154. package/dist/sap/ui/core/date/Buddhist.js +162 -87
  155. package/dist/sap/ui/core/date/CalendarUtils.js +61 -21
  156. package/dist/sap/ui/core/date/CalendarWeekNumbering.js +29 -1
  157. package/dist/sap/ui/core/date/Gregorian.js +25 -10
  158. package/dist/sap/ui/core/date/Islamic.js +298 -185
  159. package/dist/sap/ui/core/date/Japanese.js +210 -115
  160. package/dist/sap/ui/core/date/Persian.js +324 -195
  161. package/dist/sap/ui/core/date/UI5Date.js +923 -237
  162. package/dist/sap/ui/core/date/UniversalDate.js +1238 -245
  163. package/dist/sap/ui/core/date/_Calendars.js +10 -1
  164. package/dist/sap/ui/core/format/DateFormat.js +3163 -2145
  165. package/dist/sap/ui/core/format/TimezoneUtil.js +23 -1
  166. package/package-scripts.cjs +12 -21
  167. package/package.json +12 -6
  168. package/tsconfig.json +20 -10
  169. package/used-modules.txt +19 -1
  170. package/dist/Assets-static.d.ts +0 -1
  171. package/dist/Assets-static.js +0 -3
  172. package/dist/Assets-static.js.map +0 -1
  173. package/dist/dates/calculateWeekNumber.d.ts +0 -5
  174. package/dist/dates/calculateWeekNumber.js +0 -45
  175. package/dist/dates/calculateWeekNumber.js.map +0 -1
  176. package/dist/generated/json-imports/LocaleData-static.js +0 -90
  177. package/dist/sap/ui/Device.js +0 -5
@@ -1,64 +1,300 @@
1
- import Metadata from './Metadata.js';
2
- import Log from '../../base/Log.js';
3
- var BaseObject = Metadata.createClass('sap.ui.base.Object', {
4
- constructor: function () {
5
- if (!(this instanceof BaseObject)) {
6
- throw Error('Cannot instantiate object: "new" is missing!');
7
- }
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!");
8
34
  }
35
+ }
9
36
  });
10
- BaseObject.prototype.destroy = function () {
11
- };
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
+ */
12
57
  BaseObject.prototype.getInterface = function () {
13
- var oInterface = new BaseObject._Interface(this, this.getMetadata().getAllPublicMethods());
14
- this.getInterface = function () {
15
- return oInterface;
16
- };
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 () {
17
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;
18
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
+ */
19
178
  BaseObject.defineClass = function (sClassName, oStaticInfo, FNMetaImpl) {
20
- var oMetadata = new (FNMetaImpl || Metadata)(sClassName, oStaticInfo);
21
- var fnClass = oMetadata.getClass();
22
- fnClass.getMetadata = fnClass.prototype.getMetadata = function () {
23
- return oMetadata;
24
- };
25
- if (!oMetadata.isFinal()) {
26
- fnClass.extend = function (sSCName, oSCClassInfo, fnSCMetaImpl) {
27
- return Metadata.createClass(fnClass, sSCName, oSCClassInfo, fnSCMetaImpl || FNMetaImpl);
28
- };
29
- }
30
- 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 () {
31
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;
32
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
+ */
33
219
  BaseObject.prototype.isA = function (vTypeName) {
34
- return this.getMetadata().isA(vTypeName);
220
+ return this.getMetadata().isA(vTypeName);
35
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
+ */
36
237
  BaseObject.isA = function (oObject, vTypeName) {
37
- return oObject instanceof BaseObject && oObject.isA(vTypeName);
238
+ return oObject instanceof BaseObject && oObject.isA(vTypeName);
38
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
+ */
39
265
  BaseObject._Interface = function (oObject, aMethods, _bReturnFacade) {
40
- if (!oObject) {
41
- return oObject;
42
- }
43
- function fCreateDelegator(oObject, sMethodName) {
44
- return function () {
45
- var tmp = oObject[sMethodName].apply(oObject, arguments);
46
- if (_bReturnFacade) {
47
- return this;
48
- } else {
49
- return tmp instanceof BaseObject ? tmp.getInterface() : tmp;
50
- }
51
- };
52
- }
53
- if (!aMethods) {
54
- return {};
55
- }
56
- var sMethodName;
57
- for (var i = 0, ml = aMethods.length; i < ml; i++) {
58
- sMethodName = aMethods[i];
59
- if (!oObject[sMethodName] || typeof oObject[sMethodName] === 'function') {
60
- this[sMethodName] = fCreateDelegator(oObject, sMethodName);
61
- }
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);
62
297
  }
298
+ }
63
299
  };
64
300
  export default BaseObject;
@@ -1,2 +1,24 @@
1
- import CalendarType from '../../base/i18n/date/CalendarType.js';
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);
2
24
  export default CalendarType;
@@ -7,11 +7,11 @@ declare const Configuration: {
7
7
  getSupportedLanguages: () => string[] | null;
8
8
  getOriginInfo: () => void;
9
9
  getFormatSettings: () => {
10
- getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
10
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
11
11
  getLegacyDateFormat: () => void;
12
12
  getCustomLocaleData: () => void;
13
- getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
14
13
  };
15
14
  getTimezone: () => string;
15
+ getCalendarWeekNumbering: () => string;
16
16
  };
17
17
  export default Configuration;
@@ -16,6 +16,8 @@ const Configuration = {
16
16
  getOriginInfo: emptyFn,
17
17
  getFormatSettings: () => FormatSettings,
18
18
  getTimezone: () => getConfigTimezone() || TimezoneUtil.getLocalTimezone(),
19
+ // Calculate calendar week numbering by active format locale
20
+ getCalendarWeekNumbering: () => "Default",
19
21
  };
20
22
  export default Configuration;
21
23
  //# sourceMappingURL=Configuration.js.map
@@ -1 +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;CACnF,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};\n\nexport default Configuration;\n"]}
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"]}
@@ -8,19 +8,18 @@ declare const Core: {
8
8
  getSupportedLanguages: () => string[] | null;
9
9
  getOriginInfo: () => void;
10
10
  getFormatSettings: () => {
11
- getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
11
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
12
12
  getLegacyDateFormat: () => void;
13
13
  getCustomLocaleData: () => void;
14
- getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
15
14
  };
16
15
  getTimezone: () => string;
16
+ getCalendarWeekNumbering: () => string;
17
17
  };
18
18
  getLibraryResourceBundle: void;
19
19
  getFormatSettings: () => {
20
- getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
20
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
21
21
  getLegacyDateFormat: () => void;
22
22
  getCustomLocaleData: () => void;
23
- getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
24
23
  };
25
24
  };
26
25
  export default Core;
@@ -2,9 +2,8 @@
2
2
  * OpenUI5 FormatSettings shim
3
3
  */
4
4
  declare const FormatSettings: {
5
- getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale").default;
5
+ getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
6
6
  getLegacyDateFormat: () => void;
7
7
  getCustomLocaleData: () => void;
8
- getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats").default.getLegacyDateCalendarCustomizing;
9
8
  };
10
9
  export default FormatSettings;
@@ -1,5 +1,4 @@
1
1
  import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
2
- import { getLegacyDateCalendarCustomizing } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
3
2
  const emptyFn = () => { };
4
3
  /**
5
4
  * OpenUI5 FormatSettings shim
@@ -8,7 +7,6 @@ const FormatSettings = {
8
7
  getFormatLocale: getLocale,
9
8
  getLegacyDateFormat: emptyFn,
10
9
  getCustomLocaleData: emptyFn,
11
- getLegacyDateCalendarCustomizing,
12
10
  };
13
11
  export default FormatSettings;
14
12
  //# sourceMappingURL=FormatSettings.js.map
@@ -1 +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"]}
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"]}