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.
- package/lib/components/IntervalComponent.js +32 -35
- package/lib/components/auto-suggest/AutoSuggestComponent.js +19 -21
- package/lib/components/button/ButtonComponent.js +13 -30
- package/lib/components/checkbox/CheckBoxComponent.js +22 -39
- package/lib/components/date/DateComponent.js +29 -46
- package/lib/components/date-range/DateRangeComponent.js +48 -63
- package/lib/components/date-time/DateTimeComponent.js +17 -31
- package/lib/components/dialog/DialogComponent.js +75 -134
- package/lib/components/drop-down/DropDownComponent.js +23 -37
- package/lib/components/expander/ExpanderComponent.js +20 -23
- package/lib/components/form-field/FormComponent.js +9 -12
- package/lib/components/form-field/FormFieldComponent.js +28 -30
- package/lib/components/grid/GridComponent.js +46 -52
- package/lib/components/input/InputComponent.js +26 -47
- package/lib/components/loading/LoadingComponent.js +7 -9
- package/lib/components/navigation/NavigationComponent.js +20 -43
- package/lib/components/notification/Notification.js +18 -22
- package/lib/components/number/NumberComponent.js +28 -46
- package/lib/components/overlay/OverlayComponent.js +45 -60
- package/lib/components/progress/ProgressComponent.js +15 -17
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +9 -20
- package/lib/components/select/SelectComponent.js +105 -122
- package/lib/components/select/SelectDDAreaComponent.js +108 -122
- package/lib/components/slider/nouislider.js +1 -1
- package/lib/components/stack-panel/SplitterComponent.js +27 -29
- package/lib/components/stack-panel/StackPanelComponent.js +17 -31
- package/lib/components/tabs/TabsComponent.js +53 -66
- package/lib/components/time/TimeComponent.js +32 -43
- package/lib/components/tree-view/TreeViewComponent.js +13 -16
- package/lib/components/virtual-render/VirtualRenderComponent.js +30 -44
- package/lib/core/culture.js +2 -2
- package/lib/core/date.js +68 -72
- package/lib/core/helper.js +30 -34
- package/lib/core/jq.js +54 -63
- package/lib/core/lang.js +24 -28
- package/lib/core/numeric.js +35 -39
- package/lib/grid/filterDialogs/dateRangeFilter.js +98 -148
- package/lib/grid/filterDialogs/excelFilter.js +205 -271
- package/lib/grid/plugins/ext.overlay.js +9 -9
- package/lib/grid/plugins/slick.cellrangedecorator.js +2 -2
- package/lib/grid/plugins/slick.cellrangeselector.js +1 -1
- package/lib/grid/plugins/slick.cellselectionmodel.js +8 -8
- package/lib/grid/plugins/slick.headerbuttons.js +1 -1
- package/lib/grid/plugins/slick.headermenu.js +1 -1
- package/lib/grid/plugins/slick.rowmovemanager.js +2 -2
- package/lib/grid/plugins/slick.rowselectionmodel.js +1 -1
- package/lib/grid/slick.core.js +1 -1
- package/lib/grid/slick.creator.js +144 -144
- package/lib/grid/slick.dataview.js +127 -138
- package/lib/grid/slick.editors.core.js +1 -1
- package/lib/grid/slick.editors.date.js +2 -2
- package/lib/grid/slick.editors.lookup.js +36 -37
- package/lib/grid/slick.editors.nav.js +1 -1
- package/lib/grid/slick.formatters.js +26 -26
- package/lib/grid/slick.grid.js +163 -166
- package/lib/grid/slick.groupitemmetadataprovider.js +4 -4
- package/lib/grid/slick.tree.js +91 -103
- package/lib/index.js.map +1 -1
- package/lib/interaction/eventhandler.js +20 -23
- package/lib/interaction/moveable.js +76 -90
- package/lib/interaction/resizable.js +58 -72
- package/lib/ui/auto.suggest.js +13 -28
- package/lib/ui/date.picker/lib/fns.js +1 -5
- package/lib/ui/dialog.js +28 -43
- package/lib/ui/drop.down.js +4 -4
- package/lib/ui/number.input.js +8 -19
- 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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
13
|
+
getActiveTabIndex() {
|
|
23
14
|
var _a;
|
|
24
15
|
return (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var _this = this;
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
28
18
|
var _a, _b, _c, _d, _e;
|
|
29
19
|
this.checkForDuplicateIds();
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
38
|
-
for (
|
|
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:
|
|
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(
|
|
56
|
+
tag: "div", attr: { class: "tab-header-row" }, children: this.options.tabs.map((x) => {
|
|
67
57
|
index++;
|
|
68
|
-
|
|
58
|
+
const currIndex = index;
|
|
69
59
|
return {
|
|
70
60
|
tag: "div", attr: {
|
|
71
|
-
class: "tab-item " + (index === activeIndex ? "active " : "") + (
|
|
72
|
-
click:
|
|
61
|
+
class: "tab-item " + (index === activeIndex ? "active " : "") + (this.options.tabs[currIndex].enabled === false ? "disabled " : ""),
|
|
62
|
+
click: (evt) => {
|
|
73
63
|
var _a;
|
|
74
|
-
if ((_a =
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
|
|
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: [
|
|
83
|
-
|
|
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:
|
|
77
|
+
class: "close-button", click: (evt) => {
|
|
88
78
|
var _a;
|
|
89
|
-
if ((_a =
|
|
79
|
+
if ((_a = this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
|
|
90
80
|
evt.stopPropagation();
|
|
91
|
-
|
|
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
|
-
]
|
|
91
|
+
}, ...tabs
|
|
92
|
+
]
|
|
103
93
|
};
|
|
104
|
-
}
|
|
105
|
-
|
|
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
|
-
|
|
113
|
-
for (
|
|
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
|
-
|
|
124
|
-
for (
|
|
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
|
-
|
|
135
|
-
return this.options.tabs.filter(
|
|
136
|
-
}
|
|
137
|
-
|
|
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(
|
|
146
|
-
|
|
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
|
-
|
|
154
|
+
onInit(renderer) {
|
|
165
155
|
this.renderer = renderer;
|
|
166
|
-
}
|
|
167
|
-
|
|
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
|
-
|
|
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
|
|
176
|
+
return { tag: tag !== null && tag !== void 0 ? tag : "div", content };
|
|
187
177
|
}
|
|
188
178
|
return content;
|
|
189
|
-
}
|
|
190
|
-
|
|
179
|
+
}
|
|
180
|
+
checkForDuplicateIds() {
|
|
191
181
|
if (this.options.tabs == null || this.options.tabs.length === 0) {
|
|
192
182
|
return;
|
|
193
183
|
}
|
|
194
|
-
|
|
195
|
-
for (
|
|
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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
5
|
+
export class TimeComponent {
|
|
6
|
+
constructor(options) {
|
|
18
7
|
var _a;
|
|
19
|
-
this.options =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
24
|
+
render() {
|
|
34
25
|
var _a, _b;
|
|
35
|
-
|
|
26
|
+
let val = this.options.value;
|
|
36
27
|
if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
+
}
|
|
52
|
+
onCreate(node) {
|
|
62
53
|
this.currentDom = node.dom;
|
|
63
|
-
}
|
|
64
|
-
|
|
54
|
+
}
|
|
55
|
+
onUpdate(node) {
|
|
65
56
|
this.currentDom = node.dom;
|
|
66
|
-
}
|
|
67
|
-
|
|
57
|
+
}
|
|
58
|
+
getValue() {
|
|
68
59
|
if (this.currentDom == null) {
|
|
69
60
|
return "";
|
|
70
61
|
}
|
|
71
62
|
return this.currentDom.value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
}
|
|
64
|
+
getValueAsDate(datePart) {
|
|
65
|
+
const x = datePart ? new Date(datePart.getTime()) : new Date();
|
|
75
66
|
try {
|
|
76
|
-
|
|
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
|
-
|
|
90
|
+
}
|
|
91
|
+
raiseChangeEvent(e, node) {
|
|
101
92
|
var _a;
|
|
102
93
|
if (this.options.enabled) {
|
|
103
|
-
|
|
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
|
-
|
|
112
|
-
}());
|
|
113
|
-
export { TimeComponent };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import "./TreeViewStyle.scss";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export class TreeViewComponent {
|
|
3
|
+
constructor(options) {
|
|
4
4
|
this.options = options;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
isEqual(node) {
|
|
7
7
|
return this.__proto__ === node.__proto__;
|
|
8
|
-
}
|
|
9
|
-
|
|
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
|
-
|
|
18
|
-
var _this = this;
|
|
16
|
+
}
|
|
17
|
+
renderNode(el) {
|
|
19
18
|
function getInput() {
|
|
20
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
2
|
+
export class VirtualRenderComponent {
|
|
3
|
+
constructor(options) {
|
|
15
4
|
this.State = { scrollPos: 0 };
|
|
16
|
-
|
|
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 =
|
|
13
|
+
this.options = { ...defaultOptions, ...options };
|
|
25
14
|
}
|
|
26
|
-
|
|
15
|
+
isEqual(node) {
|
|
27
16
|
return this.__proto__ === node.__proto__;
|
|
28
|
-
}
|
|
29
|
-
|
|
17
|
+
}
|
|
18
|
+
setData(data) {
|
|
30
19
|
this.options.data = data;
|
|
31
|
-
}
|
|
32
|
-
|
|
20
|
+
}
|
|
21
|
+
onInit(renderer) {
|
|
33
22
|
this.State.renderer = renderer;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var _this = this;
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
37
25
|
var _a, _b;
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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:
|
|
49
|
-
|
|
50
|
-
if (Math.abs(
|
|
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
|
-
|
|
54
|
-
vrBody.children =
|
|
41
|
+
this.State.scrollPos = newScrollPos;
|
|
42
|
+
vrBody.children = this.getChildren();
|
|
55
43
|
node.children[0].children = [{ tag: "dummy" }];
|
|
56
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
103
|
-
}());
|
|
104
|
-
export { VirtualRenderComponent };
|
|
89
|
+
}
|
|
90
|
+
}
|
package/lib/core/culture.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
|
|
2
|
+
let _w = window;
|
|
3
3
|
_w._current_culture = "";
|
|
4
|
-
|
|
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
|