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,17 +1,8 @@
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 "./TabsStyle.scss";
11
2
  import { refresh } from "jsl-render";
12
3
  import { helper } from "../../core/helper";
13
- var TabsComponent = /** @class */ (function () {
14
- function TabsComponent(options) {
4
+ export class TabsComponent {
5
+ constructor(options) {
15
6
  var _a, _b, _c;
16
7
  this.options = options;
17
8
  this.State = { selectedIndex: null };
@@ -19,23 +10,22 @@ var TabsComponent = /** @class */ (function () {
19
10
  this.options.tabs = (_b = this.options.tabs) !== null && _b !== void 0 ? _b : [];
20
11
  this.options.selectedIndex = (_c = this.options.selectedIndex) !== null && _c !== void 0 ? _c : 0;
21
12
  }
22
- TabsComponent.prototype.getActiveTabIndex = function () {
13
+ getActiveTabIndex() {
23
14
  var _a;
24
15
  return (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex;
25
- };
26
- TabsComponent.prototype.render = function () {
27
- var _this = this;
16
+ }
17
+ render() {
28
18
  var _a, _b, _c, _d, _e;
29
19
  this.checkForDuplicateIds();
30
- var index = -1;
31
- var activeIndex = (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex;
20
+ let index = -1;
21
+ const activeIndex = (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex;
32
22
  if (activeIndex > -1 &&
33
23
  this.options.tabs[activeIndex].content == null &&
34
24
  this.options.tabs[activeIndex].onCreate) {
35
25
  this.options.tabs[activeIndex].content = this.options.tabs[activeIndex].onCreate();
36
26
  }
37
- var tabs = [];
38
- for (var idx = 0; idx < this.options.tabs.length; idx++) {
27
+ const tabs = [];
28
+ for (let idx = 0; idx < this.options.tabs.length; idx++) {
39
29
  if (!this.options.tabs[idx].id) {
40
30
  this.options.tabs[idx].id = helper.newDomGuid();
41
31
  }
@@ -61,34 +51,34 @@ var TabsComponent = /** @class */ (function () {
61
51
  }
62
52
  }
63
53
  return {
64
- tag: "div", attr: { class: "stabcomponent " + (this.options.class || ""), style: this.options.style }, children: __spreadArray([
54
+ tag: "div", attr: { class: "stabcomponent " + (this.options.class || ""), style: this.options.style }, children: [
65
55
  {
66
- tag: "div", attr: { class: "tab-header-row" }, children: this.options.tabs.map(function (x) {
56
+ tag: "div", attr: { class: "tab-header-row" }, children: this.options.tabs.map((x) => {
67
57
  index++;
68
- var currIndex = index;
58
+ const currIndex = index;
69
59
  return {
70
60
  tag: "div", attr: {
71
- class: "tab-item " + (index === activeIndex ? "active " : "") + (_this.options.tabs[currIndex].enabled === false ? "disabled " : ""),
72
- click: function (evt) {
61
+ class: "tab-item " + (index === activeIndex ? "active " : "") + (this.options.tabs[currIndex].enabled === false ? "disabled " : ""),
62
+ click: (evt) => {
73
63
  var _a;
74
- if ((_a = _this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
75
- _this.SetSelectedTab(currIndex);
76
- if (_this.options.onSelect) {
77
- _this.options.onSelect(currIndex);
64
+ if ((_a = this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
65
+ this.SetSelectedTab(currIndex);
66
+ if (this.options.onSelect) {
67
+ this.options.onSelect(currIndex);
78
68
  }
79
69
  }
80
70
  }
81
71
  }, children: [
82
- { tag: "span", attr: { style: "vertical-align: middle; vertical-align: -webkit-baseline-middle; vertical-align: -moz-middle-with-baseline;" }, children: [_this.toNode(x.header, "span")] },
83
- _this.options.tabs[index].canClose
72
+ { tag: "span", attr: { style: "vertical-align: middle; vertical-align: -webkit-baseline-middle; vertical-align: -moz-middle-with-baseline;" }, children: [this.toNode(x.header, "span")] },
73
+ this.options.tabs[index].canClose
84
74
  ?
85
75
  {
86
76
  tag: "div", attr: {
87
- class: "close-button", click: function (evt) {
77
+ class: "close-button", click: (evt) => {
88
78
  var _a;
89
- if ((_a = _this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
79
+ if ((_a = this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
90
80
  evt.stopPropagation();
91
- _this.closeTabIndex(currIndex, true);
81
+ this.closeTabIndex(currIndex, true);
92
82
  }
93
83
  }
94
84
  }, content: "X"
@@ -98,19 +88,19 @@ var TabsComponent = /** @class */ (function () {
98
88
  ]
99
89
  };
100
90
  })
101
- }
102
- ], tabs, true)
91
+ }, ...tabs
92
+ ]
103
93
  };
104
- };
105
- TabsComponent.prototype.AddTab = function (tabItem) {
94
+ }
95
+ AddTab(tabItem) {
106
96
  var _a;
107
97
  tabItem.enabled = (_a = tabItem.enabled) !== null && _a !== void 0 ? _a : true;
108
98
  this.options.tabs.push(tabItem);
109
99
  this.checkForDuplicateIds();
110
100
  return this.options.tabs.length - 1;
111
- };
112
- TabsComponent.prototype.EnableAll = function () {
113
- for (var i = 0; i < this.options.tabs.length; i++) {
101
+ }
102
+ EnableAll() {
103
+ for (let i = 0; i < this.options.tabs.length; i++) {
114
104
  this.options.tabs[i].enabled = true;
115
105
  }
116
106
  if (this.renderer != null) {
@@ -119,9 +109,9 @@ var TabsComponent = /** @class */ (function () {
119
109
  else {
120
110
  refresh();
121
111
  }
122
- };
123
- TabsComponent.prototype.DisableAll = function () {
124
- for (var i = 0; i < this.options.tabs.length; i++) {
112
+ }
113
+ DisableAll() {
114
+ for (let i = 0; i < this.options.tabs.length; i++) {
125
115
  this.options.tabs[i].enabled = false;
126
116
  }
127
117
  if (this.renderer != null) {
@@ -130,11 +120,11 @@ var TabsComponent = /** @class */ (function () {
130
120
  else {
131
121
  refresh();
132
122
  }
133
- };
134
- TabsComponent.prototype.GetByID = function (id) {
135
- return this.options.tabs.filter(function (f) { return f.id === id; })[0];
136
- };
137
- TabsComponent.prototype.closeTabIndex = function (index, raiseSelectEvent) {
123
+ }
124
+ GetByID(id) {
125
+ return this.options.tabs.filter((f) => f.id === id)[0];
126
+ }
127
+ closeTabIndex(index, raiseSelectEvent) {
138
128
  var _a, _b;
139
129
  // console.log("closing tab index " + index);
140
130
  if (this.options.tabs[index].onClosing) {
@@ -142,8 +132,8 @@ var TabsComponent = /** @class */ (function () {
142
132
  return false;
143
133
  }
144
134
  }
145
- this.options.tabs = this.options.tabs.filter(function (_, currIdx) { return currIdx !== index; });
146
- var newSelectedIndex = (_b = (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex) !== null && _b !== void 0 ? _b : 0;
135
+ this.options.tabs = this.options.tabs.filter((_, currIdx) => currIdx !== index);
136
+ let newSelectedIndex = (_b = (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex) !== null && _b !== void 0 ? _b : 0;
147
137
  if (this.options.tabs.length <= newSelectedIndex) {
148
138
  newSelectedIndex--;
149
139
  this.SetSelectedTab(newSelectedIndex);
@@ -154,17 +144,17 @@ var TabsComponent = /** @class */ (function () {
154
144
  }
155
145
  }
156
146
  return true;
157
- };
147
+ }
158
148
  // public onCreate(node: IJSLVNode) {
159
149
  // this.ref = node.dom as HTMLDivElement;
160
150
  // }
161
151
  // public onUpdate(node: IJSLVNode) {
162
152
  // this.ref = node.dom as HTMLDivElement;
163
153
  // }
164
- TabsComponent.prototype.onInit = function (renderer) {
154
+ onInit(renderer) {
165
155
  this.renderer = renderer;
166
- };
167
- TabsComponent.prototype.SetSelectedTab = function (index) {
156
+ }
157
+ SetSelectedTab(index) {
168
158
  var _a;
169
159
  if (((_a = this.options.tabs[index]) === null || _a === void 0 ? void 0 : _a.onCreate) != null && this.options.tabs[index].content == null) {
170
160
  this.options.tabs[index].content = this.options.tabs[index].onCreate();
@@ -177,28 +167,25 @@ var TabsComponent = /** @class */ (function () {
177
167
  else {
178
168
  refresh();
179
169
  }
180
- };
181
- TabsComponent.prototype.toNode = function (content, tag) {
170
+ }
171
+ toNode(content, tag) {
182
172
  if (content == null) {
183
173
  return undefined;
184
174
  }
185
175
  if (typeof content === "string") {
186
- return { tag: tag !== null && tag !== void 0 ? tag : "div", content: content };
176
+ return { tag: tag !== null && tag !== void 0 ? tag : "div", content };
187
177
  }
188
178
  return content;
189
- };
190
- TabsComponent.prototype.checkForDuplicateIds = function () {
179
+ }
180
+ checkForDuplicateIds() {
191
181
  if (this.options.tabs == null || this.options.tabs.length === 0) {
192
182
  return;
193
183
  }
194
- var ids = {};
195
- for (var _i = 0, _a = this.options.tabs; _i < _a.length; _i++) {
196
- var tab = _a[_i];
184
+ const ids = {};
185
+ for (const tab of this.options.tabs) {
197
186
  if (tab.id && ids[tab.id] !== undefined) {
198
187
  throw new Error("Tab Control has duplicate id " + tab.id);
199
188
  }
200
189
  }
201
- };
202
- return TabsComponent;
203
- }());
204
- export { TabsComponent };
190
+ }
191
+ }
@@ -1,28 +1,19 @@
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 "./TimeComponent.scss";
13
2
  import { EventHandler } from "../../interaction/eventhandler";
14
3
  import { helper } from "../../core/helper";
15
4
  import { date } from "../../core/date";
16
- var TimeComponent = /** @class */ (function () {
17
- function TimeComponent(options) {
5
+ export class TimeComponent {
6
+ constructor(options) {
18
7
  var _a;
19
- this.options = __assign({
20
- enabled: true,
21
- id: helper.newDomGuid(),
22
- inputMode: "HourMinute",
23
- bindMode: "toModel",
24
- placeholder: (options === null || options === void 0 ? void 0 : options.inputMode) === "HourMinuteSecond" ? "__:__:__" : "__:__"
25
- }, options);
8
+ this.options = {
9
+ ...{
10
+ enabled: true,
11
+ id: helper.newDomGuid(),
12
+ inputMode: "HourMinute",
13
+ bindMode: "toModel",
14
+ placeholder: (options === null || options === void 0 ? void 0 : options.inputMode) === "HourMinuteSecond" ? "__:__:__" : "__:__"
15
+ }, ...options
16
+ };
26
17
  if (this.options.bindTo != null && this.options.bindMode !== "fromModel" && this.options.property != null && this.options.value == null) {
27
18
  this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
28
19
  this.options.converter.toUI(this.options.bindTo[this.options.property]) :
@@ -30,17 +21,17 @@ var TimeComponent = /** @class */ (function () {
30
21
  }
31
22
  this.options.onChange = EventHandler.Create(this.options.onChange);
32
23
  }
33
- TimeComponent.prototype.render = function () {
24
+ render() {
34
25
  var _a, _b;
35
- var val = this.options.value;
26
+ let val = this.options.value;
36
27
  if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
37
- var current = this.getValue();
38
- var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
28
+ const current = this.getValue();
29
+ const newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
39
30
  this.options.converter.toUI(this.options.bindTo[this.options.property]) :
40
31
  this.options.bindTo[this.options.property]);
41
- var newValStr = date.formatTime(newVal, this.options.inputMode);
32
+ const newValStr = date.formatTime(newVal, this.options.inputMode);
33
+ val = newVal;
42
34
  if (newValStr !== current) {
43
- val = newVal;
44
35
  if (this.currentDom != null) {
45
36
  this.currentDom.value = newValStr;
46
37
  }
@@ -57,23 +48,23 @@ var TimeComponent = /** @class */ (function () {
57
48
  change: this.raiseChangeEvent
58
49
  }
59
50
  };
60
- };
61
- TimeComponent.prototype.onCreate = function (node) {
51
+ }
52
+ onCreate(node) {
62
53
  this.currentDom = node.dom;
63
- };
64
- TimeComponent.prototype.onUpdate = function (node) {
54
+ }
55
+ onUpdate(node) {
65
56
  this.currentDom = node.dom;
66
- };
67
- TimeComponent.prototype.getValue = function () {
57
+ }
58
+ getValue() {
68
59
  if (this.currentDom == null) {
69
60
  return "";
70
61
  }
71
62
  return this.currentDom.value;
72
- };
73
- TimeComponent.prototype.getValueAsDate = function (datePart) {
74
- var x = datePart ? new Date(datePart.getTime()) : new Date();
63
+ }
64
+ getValueAsDate(datePart) {
65
+ const x = datePart ? new Date(datePart.getTime()) : new Date();
75
66
  try {
76
- var parts = this.getValue().split(":");
67
+ const parts = this.getValue().split(":");
77
68
  x.setHours(parseInt(parts[0], 10));
78
69
  if (parts.length > 1) {
79
70
  x.setMinutes(parseInt(parts[1], 10));
@@ -96,18 +87,16 @@ var TimeComponent = /** @class */ (function () {
96
87
  x.setSeconds(0);
97
88
  }
98
89
  return x;
99
- };
100
- TimeComponent.prototype.raiseChangeEvent = function (e, node) {
90
+ }
91
+ raiseChangeEvent(e, node) {
101
92
  var _a;
102
93
  if (this.options.enabled) {
103
- var val = this.getValueAsDate(this.options.value);
94
+ const val = this.getValueAsDate(this.options.value);
104
95
  if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
105
96
  this.options.bindTo[this.options.property] =
106
97
  ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(val) : val;
107
98
  }
108
99
  this.options.onChange.notify(val);
109
100
  }
110
- };
111
- return TimeComponent;
112
- }());
113
- export { TimeComponent };
101
+ }
102
+ }
@@ -1,23 +1,22 @@
1
1
  import "./TreeViewStyle.scss";
2
- var TreeViewComponent = /** @class */ (function () {
3
- function TreeViewComponent(options) {
2
+ export class TreeViewComponent {
3
+ constructor(options) {
4
4
  this.options = options;
5
5
  }
6
- TreeViewComponent.prototype.isEqual = function (node) {
6
+ isEqual(node) {
7
7
  return this.__proto__ === node.__proto__;
8
- };
9
- TreeViewComponent.prototype.render = function () {
8
+ }
9
+ render() {
10
10
  var _a, _b;
11
11
  return {
12
12
  tag: "div", attr: { style: this.options.style, class: "treeview-comp hover " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") }, children: [
13
13
  { tag: "ul", attr: { class: "tv-ul" }, children: [this.renderNode((_b = this.filteredData) !== null && _b !== void 0 ? _b : this.options.data)] }
14
14
  ]
15
15
  };
16
- };
17
- TreeViewComponent.prototype.renderNode = function (el) {
18
- var _this = this;
16
+ }
17
+ renderNode(el) {
19
18
  function getInput() {
20
- var res = { tag: "input", attr: { class: "tv-input", type: "checkbox", id: el.id } };
19
+ const res = { tag: "input", attr: { class: "tv-input", type: "checkbox", id: el.id } };
21
20
  if (el.collapsed) {
22
21
  res.attr.checked = "checked";
23
22
  }
@@ -27,11 +26,11 @@ var TreeViewComponent = /** @class */ (function () {
27
26
  { tag: "li", children: [
28
27
  getInput(),
29
28
  this.addChild({ tag: "label", attr: { for: el.id } }, this.options.renderItem != null ? this.options.renderItem(el) : el.content),
30
- { tag: "ul", attr: { class: "tv-ul" }, children: el.children.map(function (c) { return _this.renderNode(c); }) }
29
+ { tag: "ul", attr: { class: "tv-ul" }, children: el.children.map((c) => this.renderNode(c)) }
31
30
  ] } :
32
31
  this.addChild({ tag: "li" }, this.options.renderItem != null ? this.options.renderItem(el) : el.content);
33
- };
34
- TreeViewComponent.prototype.addChild = function (parent, content) {
32
+ }
33
+ addChild(parent, content) {
35
34
  if (typeof content === "string") {
36
35
  parent.content = content;
37
36
  }
@@ -39,7 +38,5 @@ var TreeViewComponent = /** @class */ (function () {
39
38
  parent.children = [content];
40
39
  }
41
40
  return parent;
42
- };
43
- return TreeViewComponent;
44
- }());
45
- export { TreeViewComponent };
41
+ }
42
+ }
@@ -1,19 +1,8 @@
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 "./VirtualRenderStyle.scss";
13
- var VirtualRenderComponent = /** @class */ (function () {
14
- function VirtualRenderComponent(options) {
2
+ export class VirtualRenderComponent {
3
+ constructor(options) {
15
4
  this.State = { scrollPos: 0 };
16
- var defaultOptions = {
5
+ const defaultOptions = {
17
6
  data: null,
18
7
  renderRow: null,
19
8
  bufferSizeInPx: 200,
@@ -21,63 +10,62 @@ var VirtualRenderComponent = /** @class */ (function () {
21
10
  rowTag: "div",
22
11
  viewportSizeInPX: window.innerHeight
23
12
  };
24
- this.options = __assign(__assign({}, defaultOptions), options);
13
+ this.options = { ...defaultOptions, ...options };
25
14
  }
26
- VirtualRenderComponent.prototype.isEqual = function (node) {
15
+ isEqual(node) {
27
16
  return this.__proto__ === node.__proto__;
28
- };
29
- VirtualRenderComponent.prototype.setData = function (data) {
17
+ }
18
+ setData(data) {
30
19
  this.options.data = data;
31
- };
32
- VirtualRenderComponent.prototype.onInit = function (renderer) {
20
+ }
21
+ onInit(renderer) {
33
22
  this.State.renderer = renderer;
34
- };
35
- VirtualRenderComponent.prototype.render = function () {
36
- var _this = this;
23
+ }
24
+ render() {
37
25
  var _a, _b;
38
- var o = this.options;
39
- var vrBody = {
26
+ const o = this.options;
27
+ const vrBody = {
40
28
  tag: "div",
41
29
  attr: { class: "v-r-child", style: "height:" + (o.data.length * o.rowHeight) + "px;position:relative" },
42
30
  children: this.getChildren()
43
31
  };
44
- var vrContainer = {
32
+ const vrContainer = {
45
33
  tag: "div", attr: {
46
34
  class: "v-r-comp " + ((_a = o.class) !== null && _a !== void 0 ? _a : ""),
47
35
  style: "overflow-y:auto;" + ((_b = o.style) !== null && _b !== void 0 ? _b : ""),
48
- scroll: function (e, node) {
49
- var newScrollPos = node.dom.scrollTop;
50
- if (Math.abs(_this.State.scrollPos - newScrollPos) < o.bufferSizeInPx) {
36
+ scroll: (e, node) => {
37
+ const newScrollPos = node.dom.scrollTop;
38
+ if (Math.abs(this.State.scrollPos - newScrollPos) < o.bufferSizeInPx) {
51
39
  return false;
52
40
  }
53
- _this.State.scrollPos = newScrollPos;
54
- vrBody.children = _this.getChildren();
41
+ this.State.scrollPos = newScrollPos;
42
+ vrBody.children = this.getChildren();
55
43
  node.children[0].children = [{ tag: "dummy" }];
56
- _this.State.renderer.updateNode(node.children[0], vrBody);
44
+ this.State.renderer.updateNode(node.children[0], vrBody);
57
45
  return false;
58
46
  }
59
47
  }, children: [vrBody]
60
48
  };
61
49
  return vrContainer;
62
- };
50
+ }
63
51
  // public scrollRowToTop(idx: number) {
64
52
  // }
65
53
  // public scrollRowToCenter(idx: number) {
66
54
  // }
67
55
  // public scrollRowToBottom(idx: number) {
68
56
  // }
69
- VirtualRenderComponent.prototype.getChildren = function () {
70
- var o = this.options;
71
- var children = [];
72
- var viewport = {
57
+ getChildren() {
58
+ const o = this.options;
59
+ const children = [];
60
+ const viewport = {
73
61
  top: Math.floor((this.State.scrollPos - o.bufferSizeInPx) / o.rowHeight),
74
62
  bottom: Math.ceil((this.State.scrollPos + o.viewportSizeInPX + o.bufferSizeInPx) / o.rowHeight)
75
63
  };
76
- for (var idx = viewport.top; idx < viewport.bottom; idx++) {
64
+ for (let idx = viewport.top; idx < viewport.bottom; idx++) {
77
65
  if (idx < 0 || idx >= o.data.length) {
78
66
  continue;
79
67
  }
80
- var node = {
68
+ const node = {
81
69
  tag: o.rowTag, attr: {
82
70
  style: {
83
71
  top: (idx * o.rowHeight) + "px",
@@ -88,7 +76,7 @@ var VirtualRenderComponent = /** @class */ (function () {
88
76
  }
89
77
  }, children: []
90
78
  };
91
- var result = o.renderRow({ index: idx, container: node, rowData: o.data[idx] });
79
+ const result = o.renderRow({ index: idx, container: node, rowData: o.data[idx] });
92
80
  if (typeof result === "string") {
93
81
  node.content = result;
94
82
  }
@@ -98,7 +86,5 @@ var VirtualRenderComponent = /** @class */ (function () {
98
86
  children.push(node);
99
87
  }
100
88
  return children;
101
- };
102
- return VirtualRenderComponent;
103
- }());
104
- export { VirtualRenderComponent };
89
+ }
90
+ }
@@ -1,7 +1,7 @@
1
1
  var _a;
2
- var _w = window;
2
+ let _w = window;
3
3
  _w._current_culture = "";
4
- var culture = (_a = _w._culture) !== null && _a !== void 0 ? _a : {
4
+ let culture = (_a = _w._culture) !== null && _a !== void 0 ? _a : {
5
5
  info: { thousandSep: ",", decimalSep: ".", dateFormat: "yy-mm-dd", numberFormat: "#,0.####" },
6
6
  /**
7
7
  * sets a culture