jsl-ui 9.28.2 → 9.28.4

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 (67) hide show
  1. package/lib/components/IntervalComponent.js +32 -35
  2. package/lib/components/auto-suggest/AutoSuggestComponent.js +19 -21
  3. package/lib/components/button/ButtonComponent.js +13 -30
  4. package/lib/components/checkbox/CheckBoxComponent.js +22 -39
  5. package/lib/components/date/DateComponent.js +29 -46
  6. package/lib/components/date-range/DateRangeComponent.js +48 -63
  7. package/lib/components/date-time/DateTimeComponent.js +17 -31
  8. package/lib/components/dialog/DialogComponent.js +75 -134
  9. package/lib/components/drop-down/DropDownComponent.js +23 -37
  10. package/lib/components/expander/ExpanderComponent.js +20 -23
  11. package/lib/components/form-field/FormComponent.js +9 -12
  12. package/lib/components/form-field/FormFieldComponent.js +28 -30
  13. package/lib/components/grid/GridComponent.js +46 -52
  14. package/lib/components/input/InputComponent.js +26 -47
  15. package/lib/components/loading/LoadingComponent.js +7 -9
  16. package/lib/components/navigation/NavigationComponent.js +20 -43
  17. package/lib/components/notification/Notification.js +18 -22
  18. package/lib/components/number/NumberComponent.js +28 -46
  19. package/lib/components/overlay/OverlayComponent.js +45 -60
  20. package/lib/components/progress/ProgressComponent.js +15 -17
  21. package/lib/components/ribbon-menu/RibbonMenuComponent.js +9 -20
  22. package/lib/components/select/SelectComponent.js +105 -122
  23. package/lib/components/select/SelectDDAreaComponent.js +108 -122
  24. package/lib/components/slider/nouislider.js +1 -1
  25. package/lib/components/stack-panel/SplitterComponent.js +27 -29
  26. package/lib/components/stack-panel/StackPanelComponent.js +17 -31
  27. package/lib/components/tabs/TabsComponent.js +53 -66
  28. package/lib/components/time/TimeComponent.js +32 -43
  29. package/lib/components/tree-view/TreeViewComponent.js +13 -16
  30. package/lib/components/virtual-render/VirtualRenderComponent.js +30 -44
  31. package/lib/core/culture.js +2 -2
  32. package/lib/core/date.js +68 -72
  33. package/lib/core/helper.js +30 -34
  34. package/lib/core/jq.js +54 -63
  35. package/lib/core/lang.js +24 -28
  36. package/lib/core/numeric.js +35 -39
  37. package/lib/grid/filterDialogs/dateRangeFilter.js +98 -148
  38. package/lib/grid/filterDialogs/excelFilter.js +205 -271
  39. package/lib/grid/plugins/ext.overlay.js +9 -9
  40. package/lib/grid/plugins/slick.cellrangedecorator.js +2 -2
  41. package/lib/grid/plugins/slick.cellrangeselector.js +1 -1
  42. package/lib/grid/plugins/slick.cellselectionmodel.js +8 -8
  43. package/lib/grid/plugins/slick.headerbuttons.js +1 -1
  44. package/lib/grid/plugins/slick.headermenu.js +1 -1
  45. package/lib/grid/plugins/slick.rowmovemanager.js +2 -2
  46. package/lib/grid/plugins/slick.rowselectionmodel.js +1 -1
  47. package/lib/grid/slick.core.js +1 -1
  48. package/lib/grid/slick.creator.js +144 -144
  49. package/lib/grid/slick.dataview.js +127 -138
  50. package/lib/grid/slick.editors.core.js +1 -1
  51. package/lib/grid/slick.editors.date.js +2 -2
  52. package/lib/grid/slick.editors.lookup.js +36 -37
  53. package/lib/grid/slick.editors.nav.js +1 -1
  54. package/lib/grid/slick.formatters.js +26 -26
  55. package/lib/grid/slick.grid.js +163 -166
  56. package/lib/grid/slick.groupitemmetadataprovider.js +4 -4
  57. package/lib/grid/slick.tree.js +91 -103
  58. package/lib/index.js.map +1 -1
  59. package/lib/interaction/eventhandler.js +20 -23
  60. package/lib/interaction/moveable.js +76 -90
  61. package/lib/interaction/resizable.js +58 -72
  62. package/lib/ui/auto.suggest.js +13 -28
  63. package/lib/ui/date.picker/lib/fns.js +1 -5
  64. package/lib/ui/dialog.js +28 -43
  65. package/lib/ui/drop.down.js +4 -4
  66. package/lib/ui/number.input.js +8 -19
  67. package/package.json +1 -1
package/lib/core/date.js CHANGED
@@ -6,20 +6,18 @@ import culture from "./culture";
6
6
  var _helper = {
7
7
  _defaults: { shortYearCutoff: "+10", dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] },
8
8
  _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
9
- _daylightSavingAdjust: function (date) {
9
+ _daylightSavingAdjust(date) {
10
10
  if (!date) {
11
11
  return null;
12
12
  }
13
13
  date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
14
14
  return date;
15
15
  },
16
- _getDaysInMonth: function (year, month) {
16
+ _getDaysInMonth(year, month) {
17
17
  return 32 - _helper._daylightSavingAdjust(new Date(year, month, 32)).getDate();
18
18
  }
19
19
  };
20
- var date = /** @class */ (function () {
21
- function date() {
22
- }
20
+ export class date {
23
21
  /* Parse a string value into a date object.
24
22
  See formatDate below for the possible formats.
25
23
 
@@ -32,7 +30,7 @@ dayNames string[7] - names of the days from Sunday (optional)
32
30
  monthNamesShort string[12] - abbreviated names of the months (optional)
33
31
  monthNames string[12] - names of the months (optional)
34
32
  @return Date - the extracted date value or null if value is blank */
35
- date.parse = function (value, format, settings) {
33
+ static parse(value, format, settings) {
36
34
  if (value === null) {
37
35
  return null;
38
36
  }
@@ -44,33 +42,33 @@ monthNames string[12] - names of the months (optional)
44
42
  }
45
43
  format = format || culture.info.dateFormat;
46
44
  //value = (typeof value == 'object' ? value.toString() : value + '');
47
- var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || _helper._defaults.shortYearCutoff;
45
+ let shortYearCutoff = (settings ? settings.shortYearCutoff : null) || _helper._defaults.shortYearCutoff;
48
46
  shortYearCutoff = (typeof shortYearCutoff != "string" ? shortYearCutoff :
49
47
  new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
50
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || _helper._defaults.dayNamesShort;
51
- var dayNames = (settings ? settings.dayNames : null) || _helper._defaults.dayNames;
52
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || _helper._defaults.monthNamesShort;
53
- var monthNames = (settings ? settings.monthNames : null) || _helper._defaults.monthNames;
54
- var year = -1;
55
- var month = -1;
56
- var day = -1;
57
- var doy = -1;
58
- var literal = false;
48
+ let dayNamesShort = (settings ? settings.dayNamesShort : null) || _helper._defaults.dayNamesShort;
49
+ let dayNames = (settings ? settings.dayNames : null) || _helper._defaults.dayNames;
50
+ let monthNamesShort = (settings ? settings.monthNamesShort : null) || _helper._defaults.monthNamesShort;
51
+ let monthNames = (settings ? settings.monthNames : null) || _helper._defaults.monthNames;
52
+ let year = -1;
53
+ let month = -1;
54
+ let day = -1;
55
+ let doy = -1;
56
+ let literal = false;
59
57
  // Check whether a format character is doubled
60
- var lookAhead = function (match) {
61
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
58
+ let lookAhead = function (match) {
59
+ let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
62
60
  if (matches) {
63
61
  iFormat++;
64
62
  }
65
63
  return matches;
66
64
  };
67
65
  // Extract a number from the string value
68
- var getNumber = function (match) {
69
- var isDoubled = lookAhead(match);
70
- var size = (match == "@" ? 14 : (match == "!" ? 20 :
66
+ let getNumber = function (match) {
67
+ let isDoubled = lookAhead(match);
68
+ let size = (match == "@" ? 14 : (match == "!" ? 20 :
71
69
  (match == "y" && isDoubled ? 4 : (match == "o" ? 3 : 2))));
72
- var digits = new RegExp("^\\d{1," + size + "}");
73
- var num = value.substring(iValue).match(digits);
70
+ let digits = new RegExp("^\\d{1," + size + "}");
71
+ let num = value.substring(iValue).match(digits);
74
72
  if (!num) {
75
73
  throw "Missing number at position " + iValue;
76
74
  }
@@ -78,9 +76,9 @@ monthNames string[12] - names of the months (optional)
78
76
  return parseInt(num[0], 10);
79
77
  };
80
78
  // Extract a name from the string value and convert to an index
81
- var getName = function (match, shortNames, longNames) {
82
- var names = (lookAhead(match) ? longNames : shortNames);
83
- for (var i = 0; i < names.length; i++) {
79
+ let getName = function (match, shortNames, longNames) {
80
+ let names = (lookAhead(match) ? longNames : shortNames);
81
+ for (let i = 0; i < names.length; i++) {
84
82
  if (value.substr(iValue, names[i].length).toLowerCase() == names[i].toLowerCase()) {
85
83
  iValue += names[i].length;
86
84
  return i + 1;
@@ -89,13 +87,13 @@ monthNames string[12] - names of the months (optional)
89
87
  throw new Error("Unknown name at position " + iValue);
90
88
  };
91
89
  // Confirm that a literal character matches the string value
92
- var checkLiteral = function () {
90
+ let checkLiteral = function () {
93
91
  if (value.charAt(iValue) != format.charAt(iFormat)) {
94
92
  throw "Unexpected literal at position " + iValue;
95
93
  }
96
94
  iValue++;
97
95
  };
98
- var iValue = 0;
96
+ let iValue = 0;
99
97
  for (var iFormat = 0; iFormat < format.length; iFormat++) {
100
98
  if (literal) {
101
99
  if (format.charAt(iFormat) == "'" && !lookAhead("'")) {
@@ -161,7 +159,7 @@ monthNames string[12] - names of the months (optional)
161
159
  month = 1;
162
160
  day = doy;
163
161
  do {
164
- var dim = _helper._getDaysInMonth(year, month - 1);
162
+ let dim = _helper._getDaysInMonth(year, month - 1);
165
163
  if (day <= dim) {
166
164
  break;
167
165
  }
@@ -169,12 +167,12 @@ monthNames string[12] - names of the months (optional)
169
167
  day -= dim;
170
168
  } while (true);
171
169
  }
172
- var result = _helper._daylightSavingAdjust(new Date(year, month - 1, day));
170
+ let result = _helper._daylightSavingAdjust(new Date(year, month - 1, day));
173
171
  if (result.getFullYear() != year || result.getMonth() + 1 != month || result.getDate() != day) {
174
172
  throw new Error("Invalid date");
175
173
  } // E.g. 31/02/*
176
174
  return result;
177
- };
175
+ }
178
176
  /* Format a date object into a string value.
179
177
  The format can be combinations of the following:
180
178
  d - day of month (no leading zero)
@@ -202,26 +200,26 @@ dayNames string[7] - names of the days from Sunday (optional)
202
200
  monthNamesShort string[12] - abbreviated names of the months (optional)
203
201
  monthNames string[12] - names of the months (optional)
204
202
  @return string - the date in the above format */
205
- date.format = function (date, format, settings) {
203
+ static format(date, format, settings) {
206
204
  if (!date || isNaN(date)) {
207
205
  return "";
208
206
  }
209
207
  format = format || culture.info.dateFormat;
210
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || _helper._defaults.dayNamesShort;
211
- var dayNames = (settings ? settings.dayNames : null) || _helper._defaults.dayNames;
212
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || _helper._defaults.monthNamesShort;
213
- var monthNames = (settings ? settings.monthNames : null) || _helper._defaults.monthNames;
208
+ let dayNamesShort = (settings ? settings.dayNamesShort : null) || _helper._defaults.dayNamesShort;
209
+ let dayNames = (settings ? settings.dayNames : null) || _helper._defaults.dayNames;
210
+ let monthNamesShort = (settings ? settings.monthNamesShort : null) || _helper._defaults.monthNamesShort;
211
+ let monthNames = (settings ? settings.monthNames : null) || _helper._defaults.monthNames;
214
212
  // Check whether a format character is doubled
215
- var lookAhead = function (match) {
216
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
213
+ let lookAhead = function (match) {
214
+ let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
217
215
  if (matches) {
218
216
  iFormat++;
219
217
  }
220
218
  return matches;
221
219
  };
222
220
  // Format a number, with leading zero if necessary
223
- var formatNumber = function (match, value, len) {
224
- var num = "" + value;
221
+ let formatNumber = function (match, value, len) {
222
+ let num = "" + value;
225
223
  if (lookAhead(match)) {
226
224
  while (num.length < len) {
227
225
  num = "0" + num;
@@ -230,11 +228,11 @@ monthNames string[12] - names of the months (optional)
230
228
  return num;
231
229
  };
232
230
  // Format a name, short or long as requested
233
- var formatName = function (match, value, shortNames, longNames) {
231
+ let formatName = function (match, value, shortNames, longNames) {
234
232
  return (lookAhead(match) ? longNames[value] : shortNames[value]);
235
233
  };
236
- var output = "";
237
- var literal = false;
234
+ let output = "";
235
+ let literal = false;
238
236
  if (date) {
239
237
  for (var iFormat = 0; iFormat < format.length; iFormat++) {
240
238
  if (literal) {
@@ -287,8 +285,8 @@ monthNames string[12] - names of the months (optional)
287
285
  }
288
286
  }
289
287
  return output;
290
- };
291
- date.formatTime = function (value, inputMode) {
288
+ }
289
+ static formatTime(value, inputMode) {
292
290
  if (inputMode === "HourMinute") {
293
291
  return value ? (pad(value.getHours()) + ":" + pad(value.getMinutes())) : "";
294
292
  }
@@ -296,50 +294,48 @@ monthNames string[12] - names of the months (optional)
296
294
  return value ? (pad(value.getHours()) + ":" + pad(value.getMinutes()) + ":" + pad(value.getSeconds())) : "";
297
295
  }
298
296
  return "";
299
- };
300
- date.now = function () {
297
+ }
298
+ static now() {
301
299
  return new Date();
302
- };
303
- date.addSeconds = function (d, seconds) {
304
- var future = new Date(d);
300
+ }
301
+ static addSeconds(d, seconds) {
302
+ const future = new Date(d);
305
303
  future.setSeconds(d.getSeconds() + seconds);
306
304
  return future;
307
- };
308
- date.addMinutes = function (d, minutes) {
309
- var future = new Date(d);
305
+ }
306
+ static addMinutes(d, minutes) {
307
+ const future = new Date(d);
310
308
  future.setMinutes(d.getMinutes() + minutes);
311
309
  return future;
312
- };
313
- date.addHours = function (d, hours) {
314
- var future = new Date(d);
310
+ }
311
+ static addHours(d, hours) {
312
+ const future = new Date(d);
315
313
  future.setHours(d.getHours() + hours);
316
314
  return future;
317
- };
318
- date.addDays = function (d, days) {
319
- var future = new Date(d);
315
+ }
316
+ static addDays(d, days) {
317
+ const future = new Date(d);
320
318
  future.setDate(d.getDate() + days);
321
319
  return future;
322
- };
323
- date.getDaysBetween = function (startDate, endDate) {
320
+ }
321
+ static getDaysBetween(startDate, endDate) {
324
322
  return Math.round((endDate - startDate) / (1000.0 * 3600.0 * 24.0));
325
- };
326
- date.getMsBetween = function (startDate, endDate) {
323
+ }
324
+ static getMsBetween(startDate, endDate) {
327
325
  return endDate.getTime() - startDate.getTime();
328
- };
329
- date.onlyDate = function (d) {
326
+ }
327
+ static onlyDate(d) {
330
328
  if (d == null) {
331
329
  return d;
332
330
  }
333
- var result = new Date(d);
331
+ const result = new Date(d);
334
332
  result.setHours(0, 0, 0, 0);
335
333
  return result;
336
- };
337
- date.equal = function (date1, date2) {
334
+ }
335
+ static equal(date1, date2) {
338
336
  return (date1 && date1.getTime()) === (date2 && date2.getTime());
339
- };
340
- return date;
341
- }());
342
- export { date };
337
+ }
338
+ }
343
339
  function pad(nr) {
344
340
  if (nr < 10) {
345
341
  return "0" + nr.toString();
@@ -1,14 +1,12 @@
1
- var helper = /** @class */ (function () {
2
- function helper() {
3
- }
4
- helper.random = function () {
1
+ export class helper {
2
+ static random() {
5
3
  return (Math.random() * (new Date().getTime() || 1)) % 1;
6
- };
7
- helper.newGuid = function () {
8
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); });
9
- };
10
- helper.newSeqGuid = function () {
11
- var d = new Date().getTime().toString(16);
4
+ }
5
+ static newGuid() {
6
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { const r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); });
7
+ }
8
+ static newSeqGuid() {
9
+ let d = new Date().getTime().toString(16);
12
10
  while (d.length < 12) {
13
11
  d = "0" + d;
14
12
  }
@@ -17,36 +15,36 @@ var helper = /** @class */ (function () {
17
15
  }
18
16
  return "xxxxxxxx-xxxx-4xxx-yxxx-".replace(/[xy]/g, function (c) { var r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); })
19
17
  + d;
20
- };
21
- helper.newDomGuid = function () {
22
- return "axxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); });
23
- };
24
- helper.isObject = function (obj) {
18
+ }
19
+ static newDomGuid() {
20
+ return "axxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { const r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); });
21
+ }
22
+ static isObject(obj) {
25
23
  return obj ? Object.prototype.toString.call(obj) === "[object Object]" : false;
26
- };
27
- helper.isGuid = function (id) {
24
+ }
25
+ static isGuid(id) {
28
26
  if (!id) {
29
27
  return false;
30
28
  }
31
29
  return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(id);
32
- };
33
- helper.getParams = function () {
30
+ }
31
+ static getParams() {
34
32
  var match, pl = /\+/g, // Regex for replacing addition symbol with a space
35
33
  search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, query = window.location.search.substring(1);
36
34
  var urlParams = {};
37
35
  while (match = search.exec(query))
38
36
  urlParams[decode(match[1])] = decode(match[2]);
39
37
  return urlParams;
40
- };
41
- helper.isCyclic = function (o) {
42
- var seenObjects = [];
38
+ }
39
+ static isCyclic(o) {
40
+ const seenObjects = [];
43
41
  function detect(obj) {
44
42
  if (obj && typeof obj === 'object') {
45
43
  if (seenObjects.indexOf(obj) !== -1) {
46
44
  return true;
47
45
  }
48
46
  seenObjects.push(obj);
49
- for (var key in obj) {
47
+ for (const key in obj) {
50
48
  if (obj.hasOwnProperty(key) && detect(obj[key])) {
51
49
  return true;
52
50
  }
@@ -55,27 +53,25 @@ var helper = /** @class */ (function () {
55
53
  return false;
56
54
  }
57
55
  return detect(o);
58
- };
59
- helper.correctDates = function (data) {
60
- for (var key in data) {
56
+ }
57
+ static correctDates(data) {
58
+ for (let key in data) {
61
59
  if (data[key] && typeof data[key] === "object")
62
60
  data[key] = helper.correctDates(data[key]);
63
61
  //else if (data[key] && data[key].toString().substring(0, 6) === "/Date\(")
64
62
  // data[key] = new Date(parseInt(data[key].substr(6))+ timezone_offset);
65
63
  else if (data[key] && dateISO.test(data[key].toString())) {
66
- var x = Date.fromString(data[key]);
64
+ let x = Date.fromString(data[key]);
67
65
  data[key] = new Date(x.getTime() + (x.getTimezoneOffset() * 60000));
68
66
  }
69
67
  }
70
68
  return data;
71
- };
72
- helper.isTouchScreen = function () {
69
+ }
70
+ static isTouchScreen() {
73
71
  return ("ontouchstart" in window) || (navigator.msMaxTouchPoints > 0);
74
- };
75
- helper.emptyGuid = "00000000-0000-0000-0000-000000000000";
76
- return helper;
77
- }());
78
- export { helper };
72
+ }
73
+ }
74
+ helper.emptyGuid = "00000000-0000-0000-0000-000000000000";
79
75
  var dateISO = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.*/i;
80
76
  (function () {
81
77
  var d = window.Date;