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
@@ -1,6 +1,6 @@
1
1
  import { jQueryReplacement } from "../core/jq";
2
2
  import { Slick } from "./slick.core";
3
- var $ = jQueryReplacement;
3
+ let $ = jQueryReplacement;
4
4
  $.deepExtend(Slick, {
5
5
  Data: {
6
6
  GroupItemMetadataProvider: GroupItemMetadataProvider
@@ -43,7 +43,7 @@ export function GroupItemMetadataProvider(options) {
43
43
  if (!options.enableExpandCollapse) {
44
44
  return item.title;
45
45
  }
46
- var indentation = item.level * 15 + "px";
46
+ let indentation = item.level * 15 + "px";
47
47
  return (options.checkboxSelect ? '<span class="' + options.checkboxSelectCssClass +
48
48
  ' ' + (item.selectChecked ? 'checked' : 'unchecked') + '"></span>' : '') +
49
49
  "<span class='" + options.toggleCssClass + " " +
@@ -55,12 +55,12 @@ export function GroupItemMetadataProvider(options) {
55
55
  "</span>";
56
56
  }
57
57
  function defaultTotalsCellFormatter(row, cell, value, columnDef, item, grid) {
58
- var formatter_res;
58
+ let formatter_res;
59
59
  if (columnDef.groupTotalsFormatter) {
60
60
  formatter_res = columnDef.groupTotalsFormatter(item, columnDef, grid) || "";
61
61
  }
62
62
  else {
63
- var res = (item.avg && item.avg[columnDef.field])
63
+ let res = (item.avg && item.avg[columnDef.field])
64
64
  || (item.sum && item.sum[columnDef.field])
65
65
  || (item.max && item.max[columnDef.field])
66
66
  || (item.min && item.min[columnDef.field]);
@@ -1,26 +1,15 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import "./slick.tree.css";
13
- export var IndentFormatter = function (row, cell, value, columnDef, dataContext, grid) {
14
- var result = "";
15
- var hierachy = grid._hierachy;
2
+ export let IndentFormatter = function (row, cell, value, columnDef, dataContext, grid) {
3
+ let result = "";
4
+ const hierachy = grid._hierachy;
16
5
  if (hierachy != null) {
17
- var options = hierachy.getOptions();
18
- var level = hierachy.getLevel(dataContext);
6
+ const options = hierachy.getOptions();
7
+ const level = hierachy.getLevel(dataContext);
19
8
  if (level > 0) {
20
9
  result += "<span class='jsl-indent' style='min-width:" + (level * hierachy.getOptions().indentInRem) + "rem;'></span>";
21
10
  }
22
11
  if (options.enableCollapsing) {
23
- var hasChildren = hierachy.hasChildren(dataContext);
12
+ const hasChildren = hierachy.hasChildren(dataContext);
24
13
  if (hasChildren) {
25
14
  if (dataContext[options.collapsedStateField]) {
26
15
  result += "<span class='jsl-toggle'>" + options.expandIconHTML + "</span>";
@@ -39,83 +28,85 @@ export var IndentFormatter = function (row, cell, value, columnDef, dataContext,
39
28
  }
40
29
  return result;
41
30
  };
42
- var GridTree = /** @class */ (function () {
43
- function GridTree(grid, o) {
31
+ export class GridTree {
32
+ constructor(grid, o) {
44
33
  this.grid = grid;
45
- this.options = __assign({
46
- enableCollapsing: true,
47
- indentInRem: 1,
48
- hiddenStateField: "_hidden_by_h",
49
- collapsedStateField: "_callapsed",
50
- expandIconHTML: "▶", // "˃",
51
- collapseIconHTML: "▼" // "˅"
52
- }, o);
34
+ this.options = {
35
+ ...{
36
+ enableCollapsing: true,
37
+ indentInRem: 1,
38
+ hiddenStateField: "_hidden_by_h",
39
+ collapsedStateField: "_callapsed",
40
+ expandIconHTML: "▶", // "˃",
41
+ collapseIconHTML: "▼" // "˅"
42
+ }, ...o
43
+ };
53
44
  this.primaryKey = this.grid.getOptions().primaryKey;
54
45
  grid._hierachy = this;
55
46
  grid.refresh();
56
47
  this.initEvents();
57
48
  }
58
- GridTree.prototype.getOptions = function () {
49
+ getOptions() {
59
50
  return this.options;
60
- };
61
- GridTree.prototype.getLevel = function (item) {
62
- var level = 0;
63
- var parent = this.getParent(item);
51
+ }
52
+ getLevel(item) {
53
+ let level = 0;
54
+ let parent = this.getParent(item);
64
55
  while (parent != null) {
65
56
  parent = this.getParent(parent);
66
57
  level++;
67
58
  }
68
59
  return level;
69
- };
70
- GridTree.prototype.getParent = function (item) {
60
+ }
61
+ getParent(item) {
71
62
  return this.grid.dataView.getItemById(item[this.options.parentColumn]);
72
- };
73
- GridTree.prototype.hasChildren = function (item) {
63
+ }
64
+ hasChildren(item) {
74
65
  return this.rowHasChildren(this.grid.dataView.getIdxByItem(item));
75
- };
76
- GridTree.prototype.getDirectChildren = function (item) {
77
- var id = item[this.primaryKey];
78
- var result = [];
79
- var data = this.grid.getData();
80
- for (var i = 0; i < data.length; i++) {
81
- var pid = data[i][this.options.parentColumn];
66
+ }
67
+ getDirectChildren(item) {
68
+ const id = item[this.primaryKey];
69
+ const result = [];
70
+ const data = this.grid.getData();
71
+ for (let i = 0; i < data.length; i++) {
72
+ const pid = data[i][this.options.parentColumn];
82
73
  if (pid === id) {
83
74
  result.push(data[i]);
84
75
  }
85
76
  }
86
77
  return result;
87
- };
88
- GridTree.prototype.getAllChildren = function (item) {
89
- var parentid = item[this.primaryKey];
90
- var result = [];
91
- var data = this.grid.getData();
92
- for (var i = 0; i < data.length; i++) {
78
+ }
79
+ getAllChildren(item) {
80
+ const parentid = item[this.primaryKey];
81
+ const result = [];
82
+ const data = this.grid.getData();
83
+ for (let i = 0; i < data.length; i++) {
93
84
  if (data[i][this.options.parentColumn] === parentid) {
94
85
  result.push(data[i]);
95
- result.push.apply(result, this.getAllChildren(data[i]));
86
+ result.push(...this.getAllChildren(data[i]));
96
87
  }
97
88
  }
98
89
  return result;
99
- };
100
- GridTree.prototype.rowHasChildren = function (row) {
101
- var data = this.grid.getData();
90
+ }
91
+ rowHasChildren(row) {
92
+ const data = this.grid.getData();
102
93
  if (data.length > row + 1) {
103
94
  return data[row + 1][this.options.parentColumn] === data[row][this.primaryKey];
104
95
  }
105
96
  return false;
106
- };
107
- GridTree.prototype.toggleExpand = function (item) {
97
+ }
98
+ toggleExpand(item) {
108
99
  if (item[this.options.collapsedStateField]) {
109
100
  this.expand(item);
110
101
  }
111
102
  else {
112
103
  this.collapse(item);
113
104
  }
114
- };
115
- GridTree.prototype.expand = function (item) {
105
+ }
106
+ expand(item) {
116
107
  item[this.options.collapsedStateField] = false;
117
- var data = this.grid.getData();
118
- var i = this.grid.dataView.getIdxByItem(item);
108
+ const data = this.grid.getData();
109
+ let i = this.grid.dataView.getIdxByItem(item);
119
110
  while (i < data.length) {
120
111
  data[i][this.options.hiddenStateField] = false;
121
112
  if (this.rowHasChildren(i)) {
@@ -127,22 +118,22 @@ var GridTree = /** @class */ (function () {
127
118
  i++;
128
119
  }
129
120
  this.grid.refreshData();
130
- };
131
- GridTree.prototype.indent = function (rows) {
132
- var realRows = this.filterChildren(rows);
133
- var data = this.grid.getData();
121
+ }
122
+ indent(rows) {
123
+ const realRows = this.filterChildren(rows);
124
+ const data = this.grid.getData();
134
125
  //get indexes of rows
135
- var indexes = [];
136
- for (var i = 0; i < realRows.length; i++) {
126
+ const indexes = [];
127
+ for (let i = 0; i < realRows.length; i++) {
137
128
  indexes.push(this.grid.dataView.getIdxByItem(realRows[i]));
138
129
  }
139
130
  //sort indexes
140
- indexes.sort(function (a, b) { return a > b ? 1 : (a < b ? -1 : 0); });
131
+ indexes.sort((a, b) => a > b ? 1 : (a < b ? -1 : 0));
141
132
  //change parents to indent rows
142
- for (var i = 0; i < indexes.length; i++) {
143
- var rowIdx = indexes[i];
144
- var parentID = data[rowIdx][this.options.parentColumn];
145
- for (var tmp = rowIdx - 1; tmp >= 0; tmp--) {
133
+ for (let i = 0; i < indexes.length; i++) {
134
+ const rowIdx = indexes[i];
135
+ const parentID = data[rowIdx][this.options.parentColumn];
136
+ for (let tmp = rowIdx - 1; tmp >= 0; tmp--) {
146
137
  if (data[tmp][this.options.parentColumn] === parentID) {
147
138
  data[rowIdx][this.options.parentColumn] = data[tmp][this.primaryKey];
148
139
  break;
@@ -150,18 +141,18 @@ var GridTree = /** @class */ (function () {
150
141
  }
151
142
  }
152
143
  this.grid.refreshData();
153
- };
154
- GridTree.prototype.outdent = function (rows) {
155
- var rows2 = this.filterChildren(rows);
156
- var data = this.grid.getData();
157
- for (var i = 0; i < rows2.length; i++) {
158
- var row = rows2[i];
159
- var oldparent = row[this.options.parentColumn];
144
+ }
145
+ outdent(rows) {
146
+ const rows2 = this.filterChildren(rows);
147
+ const data = this.grid.getData();
148
+ for (let i = 0; i < rows2.length; i++) {
149
+ const row = rows2[i];
150
+ const oldparent = row[this.options.parentColumn];
160
151
  if (oldparent) {
161
- var newparent = data[this.grid.dataView.getIdxById(oldparent)][this.options.parentColumn];
152
+ const newparent = data[this.grid.dataView.getIdxById(oldparent)][this.options.parentColumn];
162
153
  row[this.options.parentColumn] = newparent;
163
154
  //make all subsequent items with same ParentID have current row as new parentid
164
- var idx = this.grid.dataView.getIdxById(row[this.primaryKey]);
155
+ let idx = this.grid.dataView.getIdxById(row[this.primaryKey]);
165
156
  while (++idx < data.length) {
166
157
  if (data[idx][this.options.parentColumn] === oldparent) {
167
158
  data[idx][this.options.parentColumn] = row[this.primaryKey];
@@ -171,50 +162,47 @@ var GridTree = /** @class */ (function () {
171
162
  }
172
163
  }
173
164
  this.grid.refreshData();
174
- };
175
- GridTree.prototype.filterChildren = function (rows) {
176
- var result = [];
177
- var dict = {};
178
- for (var i = 0; i < rows.length; i++) {
165
+ }
166
+ filterChildren(rows) {
167
+ const result = [];
168
+ const dict = {};
169
+ for (let i = 0; i < rows.length; i++) {
179
170
  dict[rows[i][this.primaryKey]] = true;
180
171
  }
181
- for (var i = 0; i < rows.length; i++) {
182
- var row = rows[i];
183
- var parentid = row[this.options.parentColumn];
172
+ for (let i = 0; i < rows.length; i++) {
173
+ const row = rows[i];
174
+ const parentid = row[this.options.parentColumn];
184
175
  if (!parentid || !dict[parentid]) {
185
176
  result.push(row);
186
177
  }
187
178
  }
188
179
  return result;
189
- };
190
- GridTree.prototype.collapse = function (item) {
180
+ }
181
+ collapse(item) {
191
182
  item[this.options.collapsedStateField] = true;
192
- var children = this.getAllChildren(item);
193
- for (var i = 0; i < children.length; i++) {
183
+ const children = this.getAllChildren(item);
184
+ for (let i = 0; i < children.length; i++) {
194
185
  children[i][this.options.hiddenStateField] = true;
195
186
  }
196
187
  this.grid.refreshData();
197
- };
198
- GridTree.prototype.initEvents = function () {
199
- var _this = this;
188
+ }
189
+ initEvents() {
200
190
  // collapse / expand click events
201
191
  if (this.options.enableCollapsing) {
202
- this.grid.onClick.subscribe(function (e, args) {
192
+ this.grid.onClick.subscribe((e, args) => {
203
193
  if (e.target.classList.contains("jsl-toggle")) {
204
194
  e.stopImmediatePropagation();
205
- _this.toggleExpand(_this.grid.dataView.getItem(args.row));
195
+ this.toggleExpand(this.grid.dataView.getItem(args.row));
206
196
  }
207
197
  });
208
198
  }
209
199
  // filters
210
- var hiddenFilter = {
200
+ const hiddenFilter = {
211
201
  field: this.options.hiddenStateField,
212
- match: function (itm, field) {
213
- return !itm[_this.options.hiddenStateField];
202
+ match: (itm, field) => {
203
+ return !itm[this.options.hiddenStateField];
214
204
  }
215
205
  };
216
206
  this.grid.addFilter(hiddenFilter);
217
- };
218
- return GridTree;
219
- }());
220
- export { GridTree };
207
+ }
208
+ }