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,19 +1,10 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
1
  import { VirtualRenderComponent } from "../virtual-render/VirtualRenderComponent";
11
2
  import { EventHandler } from "../../interaction/eventhandler";
12
3
  function isInternetExplorer() {
13
4
  return window.navigator.userAgent.indexOf("MSIE ") > 0 || !!window.navigator.userAgent.match(/Trident.*rv\:11\./);
14
5
  }
15
- var SelectDDAreaComponent = /** @class */ (function () {
16
- function SelectDDAreaComponent(options, component, args) {
6
+ export class SelectDDAreaComponent {
7
+ constructor(options, component, args) {
17
8
  this.options = options;
18
9
  this.component = component;
19
10
  this.args = args;
@@ -24,57 +15,54 @@ var SelectDDAreaComponent = /** @class */ (function () {
24
15
  }
25
16
  this.focusFirst();
26
17
  }
27
- SelectDDAreaComponent.prototype.onCreate = function (node) {
28
- var _this = this;
18
+ onCreate(node) {
29
19
  var _a, _b;
30
20
  this.dom = node.dom;
31
21
  this.scrollContainer = this.dom.querySelector(".sel-dd-items");
32
- var item = this.component.getSelected();
22
+ let item = this.component.getSelected();
33
23
  if (item != null) {
34
24
  if (Array.isArray(item)) {
35
25
  item = item[0];
36
26
  }
37
27
  if (item != null) {
38
- var d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
39
- var idx = d.indexOf(item);
28
+ const d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
29
+ const idx = d.indexOf(item);
40
30
  this.scrollContainer.scrollTop = this.options.rowHeight * idx;
41
31
  }
42
32
  }
43
33
  //bugfix for IE -> blur event of search box is called when user clicks scroll bar
44
34
  if (isInternetExplorer()) {
45
- this.scrollContainer.addEventListener("scroll", function (e) {
46
- _this.isScrolling = true;
47
- setTimeout(function () {
48
- _this.isScrolling = false;
49
- _this.dom.querySelector(".sel-search input").focus();
35
+ this.scrollContainer.addEventListener("scroll", (e) => {
36
+ this.isScrolling = true;
37
+ setTimeout(() => {
38
+ this.isScrolling = false;
39
+ this.dom.querySelector(".sel-search input").focus();
50
40
  }, 20);
51
41
  });
52
- this.scrollContainer.addEventListener("mousedown", function (e) {
53
- if (e.offsetX > _this.scrollContainer.clientWidth || e.offsetY > _this.scrollContainer.clientHeight) {
54
- _this.isScrolling = true;
55
- setTimeout(function () {
56
- _this.isScrolling = false;
57
- _this.dom.querySelector(".sel-search input").focus();
42
+ this.scrollContainer.addEventListener("mousedown", (e) => {
43
+ if (e.offsetX > this.scrollContainer.clientWidth || e.offsetY > this.scrollContainer.clientHeight) {
44
+ this.isScrolling = true;
45
+ setTimeout(() => {
46
+ this.isScrolling = false;
47
+ this.dom.querySelector(".sel-search input").focus();
58
48
  }, 20);
59
49
  }
60
50
  });
61
51
  }
62
- };
63
- SelectDDAreaComponent.prototype.render = function () {
64
- var _this = this;
52
+ }
53
+ render() {
65
54
  var _a;
66
- var data = (_a = this.filteredData) !== null && _a !== void 0 ? _a : this.options.data;
55
+ let data = (_a = this.filteredData) !== null && _a !== void 0 ? _a : this.options.data;
67
56
  if (this.options.groupProperty != null) {
68
- var sortedData = __spreadArray([], data, true);
69
- sortedData.sort(function (a, b) {
70
- return a[_this.options.groupProperty] < b[_this.options.groupProperty] ? -1
71
- : a[_this.options.groupProperty] > b[_this.options.groupProperty] ? 1 : (data.indexOf(a) - data.indexOf(b) // preserve order if it is for same group
57
+ const sortedData = [...data];
58
+ sortedData.sort((a, b) => {
59
+ return a[this.options.groupProperty] < b[this.options.groupProperty] ? -1
60
+ : a[this.options.groupProperty] > b[this.options.groupProperty] ? 1 : (data.indexOf(a) - data.indexOf(b) // preserve order if it is for same group
72
61
  );
73
62
  });
74
63
  data = [];
75
- var prevGroupVal = NaN;
76
- for (var _i = 0, sortedData_1 = sortedData; _i < sortedData_1.length; _i++) {
77
- var x = sortedData_1[_i];
64
+ let prevGroupVal = NaN;
65
+ for (const x of sortedData) {
78
66
  if (x[this.options.groupProperty] !== prevGroupVal) {
79
67
  // create group entry
80
68
  data.push({ __isGroup: true, __groupValue: x[this.options.groupProperty] });
@@ -85,75 +73,78 @@ var SelectDDAreaComponent = /** @class */ (function () {
85
73
  }
86
74
  this.onRender.notify(data);
87
75
  this.renderedData = data;
88
- var ddNode = {
76
+ const ddNode = {
89
77
  tag: "div", animation: this.options.enableAnimation ? { attr: "opacity", from: "0", to: "1", duration: 400 } : undefined, children: [
90
78
  {
91
79
  tag: "div", attr: { class: "sel-search", style: this.options.enableSearch ? undefined : "height:0;padding:0;margin:0;border:none;" },
92
80
  children: [
93
81
  {
94
82
  tag: "input", attr: {
95
- type: "text", value: this.args.searchTxt, placeholder: "Search", blur: function (e) {
83
+ type: "text", value: this.args.searchTxt, placeholder: "Search", blur: (e) => {
96
84
  e.preventDefault();
97
85
  if (isInternetExplorer()) {
98
- requestAnimationFrame(function () {
99
- if (!_this.isScrolling) {
100
- _this.component.close();
86
+ requestAnimationFrame(() => {
87
+ if (!this.isScrolling) {
88
+ this.component.close();
101
89
  }
102
90
  });
103
91
  }
104
92
  else {
105
- _this.component.close();
93
+ this.component.close();
106
94
  }
107
95
  return false;
108
- }, input: function (e, node) {
109
- if (!_this.options.enableSearch) {
96
+ }, input: (e, node) => {
97
+ if (!this.options.enableSearch) {
110
98
  return false;
111
99
  }
112
- var term = node.dom.value;
100
+ const term = node.dom.value;
113
101
  if (!term) {
114
- _this.clearSearch();
102
+ this.clearSearch();
115
103
  }
116
104
  else {
117
- _this.search(term);
105
+ this.search(term);
118
106
  }
119
- }, keydown: function (e, node) {
107
+ }, keydown: (e, node) => {
120
108
  var _a;
121
- if (!_this.options.enableKeyboard) {
109
+ if (!this.options.enableKeyboard) {
122
110
  return;
123
111
  }
124
112
  if (e.which === SelectDDAreaComponent.ESCAPE_KEY) {
125
113
  node.dom.blur();
126
114
  }
127
115
  else if (e.which === SelectDDAreaComponent.DOWN_KEY) {
128
- _this.navigateDown();
116
+ this.navigateDown();
129
117
  }
130
118
  else if (e.which === SelectDDAreaComponent.UP_KEY) {
131
- _this.navigateUp();
119
+ this.navigateUp();
132
120
  }
133
121
  else if (e.which === SelectDDAreaComponent.ENTER_KEY) { // TODO: multiselect
134
- var focus_1 = _this.component.getFocus();
135
- if (focus_1 == null) {
122
+ // e.preventDefault();
123
+ // e.stopPropagation();
124
+ // e.stopImmediatePropagation();
125
+ let focus = this.component.getFocus();
126
+ if (focus == null) {
136
127
  // if only 1 result is left then auto select this entry
137
- var d = (_a = _this.filteredData) !== null && _a !== void 0 ? _a : _this.options.data;
128
+ const d = (_a = this.filteredData) !== null && _a !== void 0 ? _a : this.options.data;
138
129
  if (d.length === 1) {
139
- focus_1 = d[0];
130
+ focus = d[0];
140
131
  }
141
132
  }
142
- if (_this.options.multiple) {
143
- if (focus_1 != null) {
144
- var currentSelection = _this.component.getSelected();
145
- if (currentSelection.indexOf(focus_1) >= 0) {
146
- currentSelection.splice(currentSelection.indexOf(focus_1), 1);
133
+ if (this.options.multiple) {
134
+ if (focus != null) {
135
+ const currentSelection = this.component.getSelected();
136
+ if (currentSelection.indexOf(focus) >= 0) {
137
+ currentSelection.splice(currentSelection.indexOf(focus), 1);
147
138
  }
148
139
  else {
149
- currentSelection.push(focus_1);
140
+ currentSelection.push(focus);
150
141
  }
151
- _this.component.setSelected(currentSelection);
142
+ this.component.setSelected(currentSelection);
152
143
  }
153
144
  }
154
145
  else {
155
- if (focus_1 != null) {
156
- _this.component.setSelected(focus_1);
146
+ if (focus != null) {
147
+ this.component.setSelected(focus);
157
148
  }
158
149
  node.dom.blur();
159
150
  }
@@ -168,38 +159,36 @@ var SelectDDAreaComponent = /** @class */ (function () {
168
159
  ]
169
160
  },
170
161
  new VirtualRenderComponent({
171
- class: "sel-dd-items" + (this.options.multiple ? " multiple" : ""),
172
- data: data,
162
+ class: "sel-dd-items" + (this.options.multiple ? " multiple" : ""), data,
173
163
  style: this.options.enableSearch ? "height:calc(100% - 1.8rem)" : "height:100%",
174
164
  viewportSizeInPX: this.args.renderHeight + 20,
175
165
  bufferSizeInPx: 20,
176
- renderRow: function (args) {
177
- var result = { tag: "div", attr: { class: "sel-dd-item" } };
178
- if (_this.options.groupProperty && args.rowData.__isGroup) {
166
+ renderRow: (args) => {
167
+ const result = { tag: "div", attr: { class: "sel-dd-item" } };
168
+ if (this.options.groupProperty && args.rowData.__isGroup) {
179
169
  result.attr.class += " sel-dd-group";
180
- var groupValue = args.rowData.__groupValue;
181
- var groupArgs = {
182
- groupValue: groupValue,
183
- node: result
170
+ const groupValue = args.rowData.__groupValue;
171
+ const groupArgs = {
172
+ groupValue, node: result
184
173
  };
185
- var resGroup = _this.options.onRenderGroup(groupArgs);
174
+ const resGroup = this.options.onRenderGroup(groupArgs);
186
175
  if (resGroup != null) {
187
176
  result.children = [resGroup];
188
177
  }
189
- result.attr.mousedown = function (evt) {
178
+ result.attr.mousedown = (evt) => {
190
179
  evt.preventDefault();
191
180
  evt.stopPropagation();
192
181
  evt.stopImmediatePropagation();
193
182
  };
194
183
  return result;
195
184
  }
196
- var renderArg = {
185
+ const renderArg = {
197
186
  data: args.rowData,
198
187
  node: result,
199
- isFocused: _this.component.getFocus() === args.rowData,
200
- isSelected: _this.options.multiple ?
201
- _this.component.getSelected().indexOf(args.rowData) >= 0 :
202
- _this.component.getSelected() === args.rowData,
188
+ isFocused: this.component.getFocus() === args.rowData,
189
+ isSelected: this.options.multiple ?
190
+ this.component.getSelected().indexOf(args.rowData) >= 0 :
191
+ this.component.getSelected() === args.rowData,
203
192
  isCurrent: false
204
193
  };
205
194
  if (renderArg.isFocused) {
@@ -208,25 +197,25 @@ var SelectDDAreaComponent = /** @class */ (function () {
208
197
  if (renderArg.isSelected) {
209
198
  result.attr.class += " selected";
210
199
  }
211
- result.attr.mousedown = function (evt) {
212
- if (_this.options.multiple) {
200
+ result.attr.mousedown = (evt) => {
201
+ if (this.options.multiple) {
213
202
  evt.preventDefault();
214
203
  evt.stopPropagation();
215
204
  evt.stopImmediatePropagation();
216
- var currentSelection = _this.component.getSelected();
205
+ const currentSelection = this.component.getSelected();
217
206
  if (currentSelection.indexOf(args.rowData) >= 0) {
218
207
  currentSelection.splice(currentSelection.indexOf(args.rowData), 1);
219
- _this.component.setSelected(currentSelection);
208
+ this.component.setSelected(currentSelection);
220
209
  }
221
210
  else {
222
- _this.component.setSelected(args.rowData);
211
+ this.component.setSelected(args.rowData);
223
212
  }
224
213
  }
225
214
  else {
226
- _this.component.setSelected(args.rowData);
215
+ this.component.setSelected(args.rowData);
227
216
  }
228
217
  };
229
- var res = _this.options.onRender(renderArg);
218
+ const res = this.options.onRender(renderArg);
230
219
  if (res != null) {
231
220
  result.children = [res];
232
221
  }
@@ -237,21 +226,21 @@ var SelectDDAreaComponent = /** @class */ (function () {
237
226
  ]
238
227
  };
239
228
  return ddNode;
240
- };
241
- SelectDDAreaComponent.prototype.navigateDown = function () {
229
+ }
230
+ navigateDown() {
242
231
  var _a, _b, _c;
243
- var d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
244
- var selItem = (_c = this.component.getFocus()) !== null && _c !== void 0 ? _c : this.component.getSelected();
232
+ const d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
233
+ let selItem = (_c = this.component.getFocus()) !== null && _c !== void 0 ? _c : this.component.getSelected();
245
234
  if (selItem == null) {
246
- this.component.setFocus(d.filter(function (x) { return !x.__isGroup; })[0]);
235
+ this.component.setFocus(d.filter((x) => !x.__isGroup)[0]);
247
236
  return;
248
237
  }
249
238
  if (Array.isArray(selItem)) {
250
239
  selItem = selItem[0];
251
240
  }
252
- var idx = d.indexOf(selItem);
241
+ let idx = d.indexOf(selItem);
253
242
  if (idx < 0) {
254
- this.component.setFocus(d.filter(function (x) { return !x.__isGroup; })[0]);
243
+ this.component.setFocus(d.filter((x) => !x.__isGroup)[0]);
255
244
  }
256
245
  else {
257
246
  while (idx < d.length - 1) {
@@ -263,19 +252,19 @@ var SelectDDAreaComponent = /** @class */ (function () {
263
252
  }
264
253
  }
265
254
  }
266
- };
267
- SelectDDAreaComponent.prototype.navigateUp = function () {
255
+ }
256
+ navigateUp() {
268
257
  var _a, _b, _c;
269
- var d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
270
- var selItem = (_c = this.component.getFocus()) !== null && _c !== void 0 ? _c : this.component.getSelected();
258
+ const d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
259
+ let selItem = (_c = this.component.getFocus()) !== null && _c !== void 0 ? _c : this.component.getSelected();
271
260
  if (selItem == null) {
272
- this.component.setFocus(d.filter(function (x) { return !x.__isGroup; })[0]);
261
+ this.component.setFocus(d.filter((x) => !x.__isGroup)[0]);
273
262
  return;
274
263
  }
275
264
  if (Array.isArray(selItem)) {
276
265
  selItem = selItem[0];
277
266
  }
278
- var idx = d.indexOf(selItem);
267
+ let idx = d.indexOf(selItem);
279
268
  while (idx > 0) {
280
269
  idx--;
281
270
  if (!d[idx].__isGroup) {
@@ -284,34 +273,31 @@ var SelectDDAreaComponent = /** @class */ (function () {
284
273
  return;
285
274
  }
286
275
  }
287
- this.component.setFocus(d.filter(function (x) { return !x.__isGroup; })[0]);
288
- };
289
- SelectDDAreaComponent.prototype.search = function (term) {
290
- var _this = this;
276
+ this.component.setFocus(d.filter((x) => !x.__isGroup)[0]);
277
+ }
278
+ search(term) {
291
279
  var _a, _b, _c, _d;
292
- var oldLen = (_b = (_a = this.filteredData) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
293
- this.filteredData = this.options.data.filter(function (d) { return _this.options.matchSearch(d, term); });
294
- var newLen = (_d = (_c = this.filteredData) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;
280
+ const oldLen = (_b = (_a = this.filteredData) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
281
+ this.filteredData = this.options.data.filter((d) => this.options.matchSearch(d, term));
282
+ const newLen = (_d = (_c = this.filteredData) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;
295
283
  if (oldLen !== newLen && this.scrollContainer != null) {
296
284
  this.scrollContainer.scrollTop = 0;
297
285
  }
298
286
  this.focusFirst();
299
- };
300
- SelectDDAreaComponent.prototype.clearSearch = function () {
287
+ }
288
+ clearSearch() {
301
289
  this.filteredData = null;
302
290
  this.focusFirst();
303
- };
304
- SelectDDAreaComponent.prototype.focusFirst = function () {
291
+ }
292
+ focusFirst() {
305
293
  var _a;
306
294
  if (this.options.focusFirstItem && (this.component.getSelected() == null || this.component.getSelected().length === 0)) /* TODO multiselect */ {
307
295
  this.component.setFocus(((_a = this.filteredData) !== null && _a !== void 0 ? _a : this.options.data)[0]);
308
296
  }
309
- };
310
- SelectDDAreaComponent.ESCAPE_KEY = 27;
311
- SelectDDAreaComponent.DOWN_KEY = 40;
312
- SelectDDAreaComponent.UP_KEY = 38;
313
- SelectDDAreaComponent.ENTER_KEY = 13;
314
- SelectDDAreaComponent.TAB_KEY = 9;
315
- return SelectDDAreaComponent;
316
- }());
317
- export { SelectDDAreaComponent };
297
+ }
298
+ }
299
+ SelectDDAreaComponent.ESCAPE_KEY = 27;
300
+ SelectDDAreaComponent.DOWN_KEY = 40;
301
+ SelectDDAreaComponent.UP_KEY = 38;
302
+ SelectDDAreaComponent.ENTER_KEY = 13;
303
+ SelectDDAreaComponent.TAB_KEY = 9;
@@ -1,5 +1,5 @@
1
1
  import "./nouislider.css";
2
- export var noUiSlider = (function () {
2
+ export let noUiSlider = (function () {
3
3
  "use strict";
4
4
  var VERSION = "14.6.0";
5
5
  //region Helper Methods
@@ -1,6 +1,6 @@
1
1
  import "./SplitterStyle.scss";
2
- var SplitterComponent = /** @class */ (function () {
3
- function SplitterComponent(options) {
2
+ export class SplitterComponent {
3
+ constructor(options) {
4
4
  // tslint:disable-next-line: variable-name
5
5
  this._is_splitter = true;
6
6
  this.options = options !== null && options !== void 0 ? options : {};
@@ -21,20 +21,20 @@ var SplitterComponent = /** @class */ (function () {
21
21
  this.registerListener();
22
22
  }
23
23
  }
24
- SplitterComponent.prototype.isEqual = function (node) {
24
+ isEqual(node) {
25
25
  return this.__proto__ === node.__proto__;
26
- };
27
- SplitterComponent.prototype.render = function () {
26
+ }
27
+ render() {
28
28
  return { tag: "div", attr: { class: "split-comp" } };
29
- };
30
- SplitterComponent.prototype.registerListener = function () {
31
- var dragStartX = 0;
32
- var draggedEl;
33
- var elLeft;
34
- var elRight;
35
- var elLeftWidth;
36
- var elRightWidth;
37
- var isDown;
29
+ }
30
+ registerListener() {
31
+ let dragStartX = 0;
32
+ let draggedEl;
33
+ let elLeft;
34
+ let elRight;
35
+ let elLeftWidth;
36
+ let elRightWidth;
37
+ let isDown;
38
38
  function mousemove(e) {
39
39
  var _a;
40
40
  if (!isDown) {
@@ -43,16 +43,16 @@ var SplitterComponent = /** @class */ (function () {
43
43
  e.preventDefault();
44
44
  // e.stopPropagation();
45
45
  // e.stopImmediatePropagation();
46
- var x;
47
- var orientation = draggedEl.parentElement.classList.contains("vstackpanel") ? "vertical" : "horizontal";
48
- var component = draggedEl._component;
46
+ let x;
47
+ const orientation = draggedEl.parentElement.classList.contains("vstackpanel") ? "vertical" : "horizontal";
48
+ const component = draggedEl._component;
49
49
  if (orientation === "horizontal") {
50
50
  x = e.pageX != null ? e.pageX : e.touches[0].pageX;
51
51
  }
52
52
  else {
53
53
  x = e.pageY != null ? e.pageY : e.touches[0].pageY;
54
54
  }
55
- var delta = dragStartX - x;
55
+ const delta = dragStartX - x;
56
56
  if ((elLeftWidth - delta) < component.options.minSizesInPX[0] ||
57
57
  (elRightWidth + delta) < component.options.minSizesInPX[1]) {
58
58
  return;
@@ -78,9 +78,9 @@ var SplitterComponent = /** @class */ (function () {
78
78
  // document.removeEventListener("touchmove", mousemove);
79
79
  document.removeEventListener("mouseup", mousedown);
80
80
  document.removeEventListener("touchend", mousedown);
81
- var component = draggedEl._component;
82
- var area1 = draggedEl.previousElementSibling;
83
- var args = {};
81
+ const component = draggedEl._component;
82
+ const area1 = draggedEl.previousElementSibling;
83
+ const args = {};
84
84
  if (area1 != null) {
85
85
  args.size1InPX = area1.getBoundingClientRect().width;
86
86
  }
@@ -89,8 +89,8 @@ var SplitterComponent = /** @class */ (function () {
89
89
  function mousedown(e) {
90
90
  if (e.target.classList.contains("split-comp")) {
91
91
  isDown = true;
92
- var orientation_1 = e.target.parentElement.classList.contains("vstackpanel") ? "vertical" : "horizontal";
93
- if (orientation_1 === "horizontal") {
92
+ const orientation = e.target.parentElement.classList.contains("vstackpanel") ? "vertical" : "horizontal";
93
+ if (orientation === "horizontal") {
94
94
  dragStartX = e.pageX != null ? e.pageX : e.touches[0].pageX;
95
95
  }
96
96
  else {
@@ -100,7 +100,7 @@ var SplitterComponent = /** @class */ (function () {
100
100
  elLeft = draggedEl.previousElementSibling;
101
101
  elRight = draggedEl.nextElementSibling;
102
102
  if (elLeft != null && elRight != null) {
103
- if (orientation_1 === "horizontal") {
103
+ if (orientation === "horizontal") {
104
104
  elLeftWidth = elLeft.getBoundingClientRect().width;
105
105
  elRightWidth = elRight.getBoundingClientRect().width;
106
106
  }
@@ -119,8 +119,6 @@ var SplitterComponent = /** @class */ (function () {
119
119
  document.addEventListener("touchstart", mousedown);
120
120
  document.removeEventListener("mousemove", mousemove);
121
121
  document.removeEventListener("touchmove", mousemove);
122
- };
123
- SplitterComponent.listenerRegistered = false;
124
- return SplitterComponent;
125
- }());
126
- export { SplitterComponent };
122
+ }
123
+ }
124
+ SplitterComponent.listenerRegistered = false;
@@ -1,26 +1,14 @@
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 "./StackPanelStyle.scss";
13
- var StackPanelComponent = /** @class */ (function () {
14
- function StackPanelComponent(children, options) {
2
+ export class StackPanelComponent {
3
+ constructor(children, options) {
15
4
  this.children = children;
16
- this.options = __assign({ orientation: "horizontal", valign: "stretch" }, options);
5
+ this.options = { ...{ orientation: "horizontal", valign: "stretch" }, ...options };
17
6
  }
18
- StackPanelComponent.prototype.isEqual = function (node) {
7
+ isEqual(node) {
19
8
  return this.__proto__ === node.__proto__;
20
- };
21
- StackPanelComponent.prototype.render = function () {
22
- var _this = this;
23
- var c = this.options.orientation === "horizontal" ? "stackpanel-comp hstackpanel" : "stackpanel-comp vstackpanel";
9
+ }
10
+ render() {
11
+ let c = this.options.orientation === "horizontal" ? "stackpanel-comp hstackpanel" : "stackpanel-comp vstackpanel";
24
12
  if (this.options.responsive) {
25
13
  c += " responsive";
26
14
  }
@@ -30,23 +18,23 @@ var StackPanelComponent = /** @class */ (function () {
30
18
  if (this.options.class) {
31
19
  c += " " + this.options.class;
32
20
  }
33
- var va = this.options.valign;
34
- var s = "align-items:" + (va === "top" ? "flex-start" : (va === "bottom" ? "flex-end" : va));
21
+ const va = this.options.valign;
22
+ let s = "align-items:" + (va === "top" ? "flex-start" : (va === "bottom" ? "flex-end" : va));
35
23
  if (this.options.style) {
36
24
  s += ";" + this.options.style;
37
25
  }
38
26
  return {
39
27
  tag: "div", attr: { class: c, style: s },
40
- children: this.children.map(function (x, idx) { return x != null && x._is_splitter === true ? x : ({
28
+ children: this.children.map((x, idx) => x != null && x._is_splitter === true ? x : ({
41
29
  tag: "div",
42
- attr: { style: _this.getSize(idx) + (_this.options.flexForChildren ? ";display:flex" : "") },
30
+ attr: { style: this.getSize(idx) + (this.options.flexForChildren ? ";display:flex" : "") },
43
31
  children: [x]
44
- }); })
32
+ }))
45
33
  };
46
- };
47
- StackPanelComponent.prototype.getSize = function (idx) {
34
+ }
35
+ getSize(idx) {
48
36
  if (this.options.sizes != null && this.options.sizes[idx] != null) {
49
- var s = this.options.sizes[idx];
37
+ const s = this.options.sizes[idx];
50
38
  if (s === "*") {
51
39
  return undefined;
52
40
  }
@@ -58,7 +46,5 @@ var StackPanelComponent = /** @class */ (function () {
58
46
  }
59
47
  }
60
48
  return "flex-grow:1;";
61
- };
62
- return StackPanelComponent;
63
- }());
64
- export { StackPanelComponent };
49
+ }
50
+ }