@eclipse-scout/core 22.0.23 → 22.0.29

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.
@@ -80044,11 +80044,10 @@ function assertValue(value, msg) {
80044
80044
  /**
80045
80045
  * Throws an error if the given value is not an instance of the given type. Otherwise, the value is returned.
80046
80046
  *
80047
- * @template T
80048
- * @param {T} value - value to check
80047
+ * @param {*} value - value to check
80049
80048
  * @param {*} type - type to check against with "instanceof"
80050
80049
  * @param {string} [msg] - optional error message when the assertion fails
80051
- * @return {T}
80050
+ * @return {*}
80052
80051
  */
80053
80052
 
80054
80053
  function assertInstance(value, type, msg) {
@@ -109265,11 +109264,22 @@ class DateFormat {
109265
109264
  // (e.g. MMMM) to short (e.g. M).
109266
109265
 
109267
109266
  this._patternDefinitions = [// --- Year ---
109267
+ // This definition can _format_ dates with years with 4 or more digits.
109268
+ // See: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
109269
+ // chapter 'Date and Time Patterns', paragraph 'Year'
109270
+ // We do not allow to _parse_ a date with 5 or more digits. We could allow that in a
109271
+ // future release, but it could have an impact on backend logic, databases, etc.
109268
109272
  new _index__WEBPACK_IMPORTED_MODULE_0__.DateFormatPatternDefinition({
109269
109273
  type: _index__WEBPACK_IMPORTED_MODULE_0__.DateFormatPatternType.YEAR,
109270
109274
  terms: ['yyyy'],
109275
+ // meaning: any number of digits is allowed
109271
109276
  dateFormat: this,
109272
- formatFunction: (formatContext, acceptedTerm) => _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(formatContext.inputDate.getFullYear(), 4).slice(-4),
109277
+ formatFunction: (formatContext, acceptedTerm) => {
109278
+ let year = formatContext.inputDate.getFullYear();
109279
+ let numDigits = Math.max(4, year.toString().length); // min. digits = 4
109280
+
109281
+ return _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(formatContext.inputDate.getFullYear(), numDigits).slice(-numDigits);
109282
+ },
109273
109283
  parseRegExp: /^(\d{4})(.*)$/,
109274
109284
  applyMatchFunction: (parseContext, match, acceptedTerm) => {
109275
109285
  parseContext.matchInfo.year = match;
@@ -119069,7 +119079,7 @@ class Tree extends _index__WEBPACK_IMPORTED_MODULE_0__.Widget {
119069
119079
  let scrollTop = this.$data[0].scrollTop;
119070
119080
  let scrollLeft = this.$data[0].scrollLeft;
119071
119081
 
119072
- if (this.scrollTop !== scrollTop) {
119082
+ if (this.scrollTop !== scrollTop && this.rendered) {
119073
119083
  this._renderViewport();
119074
119084
  }
119075
119085
 
@@ -120749,10 +120759,7 @@ class Tree extends _index__WEBPACK_IMPORTED_MODULE_0__.Widget {
120749
120759
  _addToVisibleFlatListNoCheck(node, insertIndex, animatedRendering) {
120750
120760
  _index__WEBPACK_IMPORTED_MODULE_0__.arrays.insert(this.visibleNodesFlat, node, insertIndex);
120751
120761
  this.visibleNodesMap[node.id] = true;
120752
-
120753
- if (this.rendered) {
120754
- this.showNode(node, animatedRendering, insertIndex);
120755
- }
120762
+ this.showNode(node, animatedRendering, insertIndex);
120756
120763
  }
120757
120764
 
120758
120765
  scrollTo(node, options) {
@@ -121026,10 +121033,18 @@ class Tree extends _index__WEBPACK_IMPORTED_MODULE_0__.Widget {
121026
121033
  nodes[i].childNodeIndex = i;
121027
121034
  }
121028
121035
  }
121036
+ /**
121037
+ * @param {TreeNode} [parentNode]
121038
+ */
121039
+
121029
121040
 
121030
121041
  insertNode(node, parentNode) {
121031
121042
  this.insertNodes([node], parentNode);
121032
121043
  }
121044
+ /**
121045
+ * @param {TreeNode} [parentNode]
121046
+ */
121047
+
121033
121048
 
121034
121049
  insertNodes(nodes, parentNode) {
121035
121050
  nodes = _index__WEBPACK_IMPORTED_MODULE_0__.arrays.ensure(nodes).slice();
@@ -122033,7 +122048,7 @@ class Tree extends _index__WEBPACK_IMPORTED_MODULE_0__.Widget {
122033
122048
  }
122034
122049
 
122035
122050
  hideNode(node, useAnimation, suppressDetachHandling) {
122036
- if (!node.attached) {
122051
+ if (!this.rendered || !node.attached) {
122037
122052
  return;
122038
122053
  }
122039
122054
 
@@ -127983,6 +127998,8 @@ function compareDays(date1, date2) {
127983
127998
  * are guaranteed to be digits. If the date argument is omitted, the current date is
127984
127999
  * used. The returned string in in UTC if the argument 'utc' is true, otherwise the
127985
128000
  * result is in local time (default).
128001
+ *
128002
+ * @deprecated this function will be deleted in release 23.1. Use DateFormat.js instead
127986
128003
  */
127987
128004
 
127988
128005
  function timestamp(date, utc) {
@@ -128106,7 +128123,7 @@ function parseJsonDate(jsonDate) {
128106
128123
  milliseconds = '000',
128107
128124
  utc = false; // Date + Time
128108
128125
 
128109
- let matches = /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})\.(\d{3})(Z?)$/.exec(jsonDate);
128126
+ let matches = /^\+?(\d{4,5})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})\.(\d{3})(Z?)$/.exec(jsonDate);
128110
128127
 
128111
128128
  if (matches !== null) {
128112
128129
  year = matches[1];
@@ -128119,7 +128136,7 @@ function parseJsonDate(jsonDate) {
128119
128136
  utc = matches[8] === 'Z';
128120
128137
  } else {
128121
128138
  // Date only
128122
- matches = /^(\d{4})-(\d{2})-(\d{2})(Z?)$/.exec(jsonDate);
128139
+ matches = /^\+?(\d{4,5})-(\d{2})-(\d{2})(Z?)$/.exec(jsonDate);
128123
128140
 
128124
128141
  if (matches !== null) {
128125
128142
  year = matches[1];
@@ -128190,12 +128207,12 @@ function toJsonDate(date, utc, includeDate, includeTime) {
128190
128207
 
128191
128208
  if (utc) {
128192
128209
  // (note: month is 0-indexed)
128193
- datePart = _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCFullYear(), 4) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCMonth() + 1, 2) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCDate(), 2);
128210
+ datePart = getYearPart(date) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCMonth() + 1, 2) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCDate(), 2);
128194
128211
  timePart = _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCHours(), 2) + ':' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCMinutes(), 2) + ':' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCSeconds(), 2) + '.' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getUTCMilliseconds(), 3);
128195
128212
  utcPart = 'Z';
128196
128213
  } else {
128197
128214
  // (note: month is 0-indexed)
128198
- datePart = _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getFullYear(), 4) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getMonth() + 1, 2) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getDate(), 2);
128215
+ datePart = getYearPart(date) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getMonth() + 1, 2) + '-' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getDate(), 2);
128199
128216
  timePart = _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getHours(), 2) + ':' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getMinutes(), 2) + ':' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getSeconds(), 2) + '.' + _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(date.getMilliseconds(), 3);
128200
128217
  utcPart = '';
128201
128218
  }
@@ -128216,6 +128233,16 @@ function toJsonDate(date, utc, includeDate, includeTime) {
128216
128233
 
128217
128234
  result += utcPart;
128218
128235
  return result;
128236
+
128237
+ function getYearPart(date) {
128238
+ let year = date.getFullYear();
128239
+
128240
+ if (year > 9999) {
128241
+ return '+' + year;
128242
+ }
128243
+
128244
+ return _index__WEBPACK_IMPORTED_MODULE_0__.strings.padZeroLeft(year, 4);
128245
+ }
128219
128246
  }
128220
128247
  function toJsonDateRange(range) {
128221
128248
  return {
@@ -128229,7 +128256,7 @@ function toJsonDateRange(range) {
128229
128256
  *
128230
128257
  * The format is as follows:
128231
128258
  *
128232
- * [Year#4]-[Month#2]-[Day#2] [Hours#2]:[Minutes#2]:[Seconds#2].[Milliseconds#3][Z]
128259
+ * [Year#4|5]-[Month#2]-[Day#2] [Hours#2]:[Minutes#2]:[Seconds#2].[Milliseconds#3][Z]
128233
128260
  *
128234
128261
  * The year component is mandatory, but all others are optional (starting from the beginning).
128235
128262
  * The date is constructed using the local time zone. If the last character is 'Z', then
@@ -128238,7 +128265,7 @@ function toJsonDateRange(range) {
128238
128265
 
128239
128266
  function create(dateString) {
128240
128267
  if (dateString) {
128241
- let matches = /^(\d{4})(?:-(\d{2})(?:-(\d{2})(?: (\d{2})(?::(\d{2})(?::(\d{2})(?:\.(\d{3}))?(Z?))?)?)?)?)?/.exec(dateString);
128268
+ let matches = /^(\d{4,5})(?:-(\d{2})(?:-(\d{2})(?: (\d{2})(?::(\d{2})(?::(\d{2})(?:\.(\d{3}))?(Z?))?)?)?)?)?/.exec(dateString);
128242
128269
 
128243
128270
  if (matches === null) {
128244
128271
  throw new Error('Unparsable date: ' + dateString);