jsl-ui 9.5.0 → 9.8.0
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/auto-suggest/AutoSuggestComponent.js +1 -1
- package/lib/components/button/ButtonComponent.js +1 -1
- package/lib/components/checkbox/CheckBoxComponent.js +1 -1
- package/lib/components/date/DateComponent.js +1 -1
- package/lib/components/date-range/DateRangeComponent.js +1 -1
- package/lib/components/dialog/DialogComponent.js +2 -2
- package/lib/components/expander/ExpanderComponent.js +8 -8
- package/lib/components/form-field/FormFieldComponent.js +2 -2
- package/lib/components/grid/GridComponent.js +1 -1
- package/lib/components/input/InputComponent.js +3 -3
- package/lib/components/navigation/NavigationComponent.js +13 -11
- package/lib/components/notification/Notification.js +1 -1
- package/lib/components/number/NumberComponent.js +1 -1
- package/lib/components/progress/ProgressComponent.js +2 -2
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +9 -7
- package/lib/components/select/SelectComponent.js +3 -3
- package/lib/components/select/SelectDDAreaComponent.js +23 -19
- package/lib/components/stack-panel/SplitterComponent.js +1 -1
- package/lib/components/tabs/TabsComponent.d.ts +2 -0
- package/lib/components/tabs/TabsComponent.js +38 -22
- package/lib/components/time/TimeComponent.js +4 -4
- package/lib/components/tree-view/TreeViewComponent.js +1 -1
- package/lib/components/virtual-render/VirtualRenderComponent.js +2 -2
- package/lib/core/culture.js +2 -2
- package/lib/grid/filterDialogs/excelFilter.js +4 -4
- package/lib/grid/plugins/slick.headermenu.js +1 -1
- package/lib/grid/slick.formatters.js +1 -1
- package/lib/grid/slick.grid.js +2 -2
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +4 -4
- package/lib/index.css +1 -8
- package/lib/index.css.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interaction/dataconverter.js +1 -0
- package/lib/ui/dialog.d.ts +1 -0
- package/lib/ui/dialog.js +8 -2
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ var AutoSuggestComponent = /** @class */ (function () {
|
|
|
8
8
|
var _a;
|
|
9
9
|
return {
|
|
10
10
|
tag: "input",
|
|
11
|
-
attr: { value: this.options.value, class: this.options.class, style: this.options.style, placeholder: (_a = this.options.placeholder
|
|
11
|
+
attr: { value: this.options.value, class: this.options.class, style: this.options.style, placeholder: (_a = this.options.placeholder) !== null && _a !== void 0 ? _a : "" }
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
AutoSuggestComponent.prototype.getRef = function () {
|
|
@@ -65,7 +65,7 @@ var DateRangeComponent = /** @class */ (function () {
|
|
|
65
65
|
DateRangeComponent.prototype.render = function () {
|
|
66
66
|
var _a;
|
|
67
67
|
return {
|
|
68
|
-
tag: "div", attr: { style: this.options.style, class: "date-range-comp " + (_a = this.options.class
|
|
68
|
+
tag: "div", attr: { style: this.options.style, class: "date-range-comp " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") }, children: [
|
|
69
69
|
{
|
|
70
70
|
tag: "div", children: [
|
|
71
71
|
this.minDate,
|
|
@@ -34,7 +34,7 @@ var DialogComponent = /** @class */ (function () {
|
|
|
34
34
|
var _a, _b, _c;
|
|
35
35
|
var res = {
|
|
36
36
|
tag: "button", attr: {
|
|
37
|
-
class: "jsl-button " + (_a = options.class
|
|
37
|
+
class: "jsl-button " + ((_a = options.class) !== null && _a !== void 0 ? _a : ""),
|
|
38
38
|
click: function () {
|
|
39
39
|
if (options.onClick != null && options.onClick() === false) {
|
|
40
40
|
return;
|
|
@@ -43,7 +43,7 @@ var DialogComponent = /** @class */ (function () {
|
|
|
43
43
|
DialogComponent.lastRenderedDlg.getRef().close();
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
}, content: (_b = options.content
|
|
46
|
+
}, content: (_b = options.content) !== null && _b !== void 0 ? _b : "OK", raw: (_c = options.raw) !== null && _c !== void 0 ? _c : false
|
|
47
47
|
};
|
|
48
48
|
return res;
|
|
49
49
|
};
|
|
@@ -5,11 +5,11 @@ var ExpanderComponent = /** @class */ (function () {
|
|
|
5
5
|
this.State = { expanded: false, waitingForAnimation: false };
|
|
6
6
|
if (body != null) {
|
|
7
7
|
// old syntax
|
|
8
|
-
this.options = { header: optionsOrHeader, body: body, expanded:
|
|
8
|
+
this.options = { header: optionsOrHeader, body: body, expanded: expanded !== null && expanded !== void 0 ? expanded : true };
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
11
|
this.options = optionsOrHeader;
|
|
12
|
-
this.options.expanded = (_a = this.options.expanded
|
|
12
|
+
this.options.expanded = (_a = this.options.expanded) !== null && _a !== void 0 ? _a : true;
|
|
13
13
|
}
|
|
14
14
|
this.State.expanded = this.options.expanded;
|
|
15
15
|
}
|
|
@@ -21,8 +21,8 @@ var ExpanderComponent = /** @class */ (function () {
|
|
|
21
21
|
},
|
|
22
22
|
raw: true,
|
|
23
23
|
content: "<svg style='" +
|
|
24
|
-
"min-width:" + (_a = this.options.iconSize
|
|
25
|
-
";max-width:" + (_c = this.options.iconSize
|
|
24
|
+
"min-width:" + ((_a = this.options.iconSize) !== null && _a !== void 0 ? _a : "1.5rem") + "; min-height:" + ((_b = this.options.iconSize) !== null && _b !== void 0 ? _b : "1.5rem") +
|
|
25
|
+
";max-width:" + ((_c = this.options.iconSize) !== null && _c !== void 0 ? _c : "1.5rem") + "; max-height:" + ((_d = this.options.iconSize) !== null && _d !== void 0 ? _d : "1.5rem") + ";' " +
|
|
26
26
|
"xml:space='preserve' width='1024px' height='1024px' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='nonzero' clip-rule='evenodd' viewBox='0 0 10240 10240'>" +
|
|
27
27
|
(expanded
|
|
28
28
|
? "<path id='curve0' fill='#FFFFFF' d='M1273 3989l3621 3620c124,125 328,125 452,0l3621 -3620c124,-125 124,-328 0,-453l-905 -905c-125,-125 -328,-125 -453,0l-2489 2489 -2489 -2489c-125,-125 -328,-125 -453,0l-905 905c-124,125 -124,328 0,453z'/>"
|
|
@@ -39,11 +39,11 @@ var ExpanderComponent = /** @class */ (function () {
|
|
|
39
39
|
var animate = this.State.waitingForAnimation;
|
|
40
40
|
this.State.waitingForAnimation = false;
|
|
41
41
|
return {
|
|
42
|
-
tag: "div", attr: { class: "expander-comp " + (this.options.class || ""), style: (_a = this.options.style
|
|
42
|
+
tag: "div", attr: { class: "expander-comp " + (this.options.class || ""), style: (_a = this.options.style) !== null && _a !== void 0 ? _a : "" }, children: [
|
|
43
43
|
{
|
|
44
44
|
tag: "div", attr: {
|
|
45
45
|
class: "header",
|
|
46
|
-
click: function (evt) { var _a; if (_a = _this.options.isToggleOnHeader
|
|
46
|
+
click: function (evt) { var _a; if ((_a = _this.options.isToggleOnHeader) !== null && _a !== void 0 ? _a : true) {
|
|
47
47
|
evt.stopPropagation();
|
|
48
48
|
_this.toggleExpand();
|
|
49
49
|
} },
|
|
@@ -52,8 +52,8 @@ var ExpanderComponent = /** @class */ (function () {
|
|
|
52
52
|
{
|
|
53
53
|
tag: "span", attr: { class: "toggler", click: function (evt) { evt.stopPropagation(); _this.toggleExpand(); } },
|
|
54
54
|
children: [this.State.expanded
|
|
55
|
-
? (_b = this.options.expandedIcon
|
|
56
|
-
: (_c = this.options.collapsedIcon
|
|
55
|
+
? ((_b = this.options.expandedIcon) !== null && _b !== void 0 ? _b : this.getIcon(true))
|
|
56
|
+
: ((_c = this.options.collapsedIcon) !== null && _c !== void 0 ? _c : this.getIcon(false))
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
{ tag: "span", attr: { class: "content" }, children: [this.toNode(this.options.header)] }
|
|
@@ -13,7 +13,7 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
13
13
|
var _a, _b;
|
|
14
14
|
return {
|
|
15
15
|
tag: "div",
|
|
16
|
-
attr: { class: "form-field " + (this.options.value ? "form-field--is-filled " : "") + (_a = this.options.class
|
|
16
|
+
attr: { class: "form-field " + (this.options.value ? "form-field--is-filled " : "") + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") },
|
|
17
17
|
children: [{
|
|
18
18
|
tag: "div",
|
|
19
19
|
attr: { class: "form-field__control" + (this.validationMessage ? " failed__valid" : "") },
|
|
@@ -23,7 +23,7 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
23
23
|
attr: { for: this.id, class: "form-field__label" },
|
|
24
24
|
content: this.options.label +
|
|
25
25
|
(this.options.required ? " *" : "") +
|
|
26
|
-
(this.validationMessage ? (" " + (_b = this.validationMessage
|
|
26
|
+
(this.validationMessage ? (" " + ((_b = this.validationMessage) !== null && _b !== void 0 ? _b : "")) : "")
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
tag: "input",
|
|
@@ -18,7 +18,7 @@ var GridComponent = /** @class */ (function () {
|
|
|
18
18
|
};
|
|
19
19
|
var style = "";
|
|
20
20
|
if (!options.autoHeight) {
|
|
21
|
-
style = "height:" + (
|
|
21
|
+
style = "height:" + (height !== null && height !== void 0 ? height : "400px");
|
|
22
22
|
}
|
|
23
23
|
this.rootTag = {
|
|
24
24
|
tag: "div",
|
|
@@ -30,14 +30,14 @@ var InputComponent = /** @class */ (function () {
|
|
|
30
30
|
get: function () {
|
|
31
31
|
return this.options.onChange;
|
|
32
32
|
},
|
|
33
|
-
enumerable:
|
|
33
|
+
enumerable: false,
|
|
34
34
|
configurable: true
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(InputComponent.prototype, "onInput", {
|
|
37
37
|
get: function () {
|
|
38
38
|
return this.options.onInput;
|
|
39
39
|
},
|
|
40
|
-
enumerable:
|
|
40
|
+
enumerable: false,
|
|
41
41
|
configurable: true
|
|
42
42
|
});
|
|
43
43
|
// public isEqual(node: IJSLComponent): boolean {
|
|
@@ -57,7 +57,7 @@ var InputComponent = /** @class */ (function () {
|
|
|
57
57
|
if (newVal !== current) {
|
|
58
58
|
val = newVal;
|
|
59
59
|
if (this.currentDom != null) {
|
|
60
|
-
this.currentDom.value =
|
|
60
|
+
this.currentDom.value = val !== null && val !== void 0 ? val : "";
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -9,12 +9,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
18
20
|
};
|
|
19
21
|
import "./NavigationStyle.scss";
|
|
20
22
|
var NavigationComponent = /** @class */ (function () {
|
|
@@ -29,19 +31,19 @@ var NavigationComponent = /** @class */ (function () {
|
|
|
29
31
|
var _a, _b;
|
|
30
32
|
return {
|
|
31
33
|
tag: "header",
|
|
32
|
-
attr: { style: this.options.style, class: "nav-comp " + (_a = this.options.class
|
|
34
|
+
attr: { style: this.options.style, class: "nav-comp " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") },
|
|
33
35
|
children: [
|
|
34
36
|
{ tag: "div", attr: { class: "luxbar luxbar-" + this.options.position },
|
|
35
37
|
children: [
|
|
36
38
|
{ tag: "input", attr: { type: "checkbox", class: "luxbar-checkbox", id: this.options.id } },
|
|
37
39
|
{ tag: "div", attr: { class: "luxbar-menu luxbar-menu-" + this.options.alignment + " luxbar-menu-light" },
|
|
38
|
-
children: [{ tag: "ul", attr: { class: "luxbar-navigation" }, children:
|
|
40
|
+
children: [{ tag: "ul", attr: { class: "luxbar-navigation" }, children: __spreadArray([
|
|
39
41
|
{ tag: "li", attr: { class: "luxbar-header" }, children: [
|
|
40
|
-
{ tag: "a", attr: { href: (_b = this.options.titleLink
|
|
42
|
+
{ tag: "a", attr: { href: (_b = this.options.titleLink) !== null && _b !== void 0 ? _b : "#", class: "luxbar-brand" }, children: [this.toNode(this.options.title)] },
|
|
41
43
|
{ tag: "label", attr: { class: "luxbar-hamburger luxbar-hamburger-spin", for: this.options.id },
|
|
42
44
|
children: [{ tag: "span" }] },
|
|
43
45
|
] }
|
|
44
|
-
], this.options.data.map(function (x) { return _this.itemToNode(x); })) }] }
|
|
46
|
+
], this.options.data.map(function (x) { return _this.itemToNode(x); }), true) }] }
|
|
45
47
|
] }
|
|
46
48
|
]
|
|
47
49
|
};
|
|
@@ -50,7 +52,7 @@ var NavigationComponent = /** @class */ (function () {
|
|
|
50
52
|
var _this = this;
|
|
51
53
|
var _a, _b, _c;
|
|
52
54
|
return { tag: "li", attr: { class: "luxbar-item" + (((_a = x.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? " dropdown" : "") + (this.isActive(x.link) ? " active" : "") }, children: [
|
|
53
|
-
{ tag: "a", attr: { href: (_b = x.link
|
|
55
|
+
{ tag: "a", attr: { href: (_b = x.link) !== null && _b !== void 0 ? _b : "#", target: x.target, click: x.click }, children: [this.toNode(x.content)] },
|
|
54
56
|
(((_c = x.children) === null || _c === void 0 ? void 0 : _c.length) > 0 ? { tag: "ul", children: x.children.map(function (c) { return _this.itemToNode(c); }) } : undefined)
|
|
55
57
|
] };
|
|
56
58
|
};
|
|
@@ -30,7 +30,7 @@ var Notification = /** @class */ (function () {
|
|
|
30
30
|
Notification.renderer.refresh();
|
|
31
31
|
}, options.timeOut);
|
|
32
32
|
}
|
|
33
|
-
if ((_a = options.closeOnClick
|
|
33
|
+
if (((_a = options.closeOnClick) !== null && _a !== void 0 ? _a : true) === true) {
|
|
34
34
|
notification.attr.click = function () {
|
|
35
35
|
var idx = Notification.containerVNode.children.indexOf(notification);
|
|
36
36
|
if (idx >= 0) {
|
|
@@ -19,11 +19,11 @@ var ProgressComponent = /** @class */ (function () {
|
|
|
19
19
|
}
|
|
20
20
|
var content = "";
|
|
21
21
|
if ((_c = this.options) === null || _c === void 0 ? void 0 : _c.showPercent) {
|
|
22
|
-
content = numeric.format(this.progress, (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.percentFormat
|
|
22
|
+
content = numeric.format(this.progress, (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.percentFormat) !== null && _e !== void 0 ? _e : "0. %");
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
25
|
tag: "div",
|
|
26
|
-
attr: { class: "progress-comp " + (_g = (_f = this.options) === null || _f === void 0 ? void 0 : _f.class
|
|
26
|
+
attr: { class: "progress-comp " + ((_g = (_f = this.options) === null || _f === void 0 ? void 0 : _f.class) !== null && _g !== void 0 ? _g : "") },
|
|
27
27
|
children: [{
|
|
28
28
|
tag: "div",
|
|
29
29
|
attr: { class: "bar", style: style },
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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));
|
|
7
9
|
};
|
|
8
10
|
import "./RibbonMenuStyle.scss";
|
|
9
11
|
var RibbonMenuComponent = /** @class */ (function () {
|
|
@@ -22,7 +24,7 @@ var RibbonMenuComponent = /** @class */ (function () {
|
|
|
22
24
|
var _a;
|
|
23
25
|
return {
|
|
24
26
|
tag: "div", attr: { class: "ribbon-group" },
|
|
25
|
-
children:
|
|
27
|
+
children: __spreadArray([{ tag: "div", attr: { class: "ribbon-legend" }, content: (_a = g.title) !== null && _a !== void 0 ? _a : "" }], g.children, true)
|
|
26
28
|
};
|
|
27
29
|
})
|
|
28
30
|
};
|
|
@@ -51,7 +51,7 @@ var SelectComponent = /** @class */ (function () {
|
|
|
51
51
|
} : function (args) {
|
|
52
52
|
args.node.content = args.data[_this.options.textColumn];
|
|
53
53
|
},
|
|
54
|
-
matchSearch: function (data, term) { var _a; return ((_a = data[_this.options.textColumn]
|
|
54
|
+
matchSearch: function (data, term) { var _a; return (((_a = data[_this.options.textColumn]) !== null && _a !== void 0 ? _a : "").toString().toLowerCase().indexOf(term.toLowerCase()) >= 0); }
|
|
55
55
|
};
|
|
56
56
|
this.options = __assign(__assign({}, defaultOptions), o);
|
|
57
57
|
this.options.onChange = EventHandler.Create(o.onChange);
|
|
@@ -84,7 +84,7 @@ var SelectComponent = /** @class */ (function () {
|
|
|
84
84
|
return {
|
|
85
85
|
tag: "div", attr: {
|
|
86
86
|
style: this.options.style,
|
|
87
|
-
class: "select-comp " + (this.expanded ? "expanded " : "") + (!this.options.enabled ? "disabled " : "") + (_b = this.options.class
|
|
87
|
+
class: "select-comp " + (this.expanded ? "expanded " : "") + (!this.options.enabled ? "disabled " : "") + ((_b = this.options.class) !== null && _b !== void 0 ? _b : ""),
|
|
88
88
|
mousedown: function (e) { if (_this.expanded || e.which === 3) {
|
|
89
89
|
return;
|
|
90
90
|
} {
|
|
@@ -150,7 +150,7 @@ var SelectComponent = /** @class */ (function () {
|
|
|
150
150
|
var left = Math.round(dimension.left + window.pageXOffset);
|
|
151
151
|
var top = Math.round(dimension.top + window.pageYOffset);
|
|
152
152
|
this.dropdownArea = document.createElement("div");
|
|
153
|
-
this.dropdownArea.className = "sel-comp-dd " + (_a = this.options.dropdownClass
|
|
153
|
+
this.dropdownArea.className = "sel-comp-dd " + ((_a = this.options.dropdownClass) !== null && _a !== void 0 ? _a : "");
|
|
154
154
|
this.dropdownArea.style.width = this.options.dropdownWidth || (Math.round(dimension.width) + "px");
|
|
155
155
|
this.dropdownArea.style.height = this.options.dropdownHeight;
|
|
156
156
|
this.dropdownArea.style.left = left + "px";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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));
|
|
7
9
|
};
|
|
8
10
|
import { VirtualRenderComponent } from "../virtual-render/VirtualRenderComponent";
|
|
9
11
|
import { EventHandler } from "../../interaction/eventhandler";
|
|
@@ -33,7 +35,7 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
33
35
|
item = item[0];
|
|
34
36
|
}
|
|
35
37
|
if (item != null) {
|
|
36
|
-
var d = (_b = (_a = this.renderedData
|
|
38
|
+
var d = (_b = (_a = this.renderedData) !== null && _a !== void 0 ? _a : this.filteredData) !== null && _b !== void 0 ? _b : this.options.data;
|
|
37
39
|
var idx = d.indexOf(item);
|
|
38
40
|
this.scrollContainer.scrollTop = this.options.rowHeight * idx;
|
|
39
41
|
}
|
|
@@ -61,9 +63,9 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
61
63
|
SelectDDAreaComponent.prototype.render = function () {
|
|
62
64
|
var _this = this;
|
|
63
65
|
var _a;
|
|
64
|
-
var data = (_a = this.filteredData
|
|
66
|
+
var data = (_a = this.filteredData) !== null && _a !== void 0 ? _a : this.options.data;
|
|
65
67
|
if (this.options.groupProperty != null) {
|
|
66
|
-
var sortedData =
|
|
68
|
+
var sortedData = __spreadArray([], data, true);
|
|
67
69
|
sortedData.sort(function (a, b) {
|
|
68
70
|
return a[_this.options.groupProperty] < b[_this.options.groupProperty] ? -1
|
|
69
71
|
: a[_this.options.groupProperty] > b[_this.options.groupProperty] ? 1 : (data.indexOf(a) - data.indexOf(b) // preserve order if it is for same group
|
|
@@ -132,7 +134,7 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
132
134
|
var focus_1 = _this.component.getFocus();
|
|
133
135
|
if (focus_1 == null) {
|
|
134
136
|
// if only 1 result is left then auto select this entry
|
|
135
|
-
var d = (_a = _this.filteredData
|
|
137
|
+
var d = (_a = _this.filteredData) !== null && _a !== void 0 ? _a : _this.options.data;
|
|
136
138
|
if (d.length === 1) {
|
|
137
139
|
focus_1 = d[0];
|
|
138
140
|
}
|
|
@@ -166,7 +168,8 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
166
168
|
]
|
|
167
169
|
},
|
|
168
170
|
new VirtualRenderComponent({
|
|
169
|
-
class: "sel-dd-items" + (this.options.multiple ? " multiple" : ""),
|
|
171
|
+
class: "sel-dd-items" + (this.options.multiple ? " multiple" : ""),
|
|
172
|
+
data: data,
|
|
170
173
|
style: this.options.enableSearch ? "height:calc(100% - 1.8rem)" : "height:100%",
|
|
171
174
|
viewportSizeInPX: this.args.renderHeight + 20,
|
|
172
175
|
bufferSizeInPx: 20,
|
|
@@ -176,7 +179,8 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
176
179
|
result.attr.class += " sel-dd-group";
|
|
177
180
|
var groupValue = args.rowData.__groupValue;
|
|
178
181
|
var groupArgs = {
|
|
179
|
-
groupValue: groupValue,
|
|
182
|
+
groupValue: groupValue,
|
|
183
|
+
node: result
|
|
180
184
|
};
|
|
181
185
|
var resGroup = _this.options.onRenderGroup(groupArgs);
|
|
182
186
|
if (resGroup != null) {
|
|
@@ -236,8 +240,8 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
236
240
|
};
|
|
237
241
|
SelectDDAreaComponent.prototype.navigateDown = function () {
|
|
238
242
|
var _a, _b, _c;
|
|
239
|
-
var d = (_b = (_a = this.renderedData
|
|
240
|
-
var selItem = (_c = this.component.getFocus()
|
|
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();
|
|
241
245
|
if (selItem == null) {
|
|
242
246
|
this.component.setFocus(d.filter(function (x) { return !x.__isGroup; })[0]);
|
|
243
247
|
return;
|
|
@@ -262,8 +266,8 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
262
266
|
};
|
|
263
267
|
SelectDDAreaComponent.prototype.navigateUp = function () {
|
|
264
268
|
var _a, _b, _c;
|
|
265
|
-
var d = (_b = (_a = this.renderedData
|
|
266
|
-
var selItem = (_c = this.component.getFocus()
|
|
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();
|
|
267
271
|
if (selItem == null) {
|
|
268
272
|
this.component.setFocus(d.filter(function (x) { return !x.__isGroup; })[0]);
|
|
269
273
|
return;
|
|
@@ -285,9 +289,9 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
285
289
|
SelectDDAreaComponent.prototype.search = function (term) {
|
|
286
290
|
var _this = this;
|
|
287
291
|
var _a, _b, _c, _d;
|
|
288
|
-
var oldLen = (_b = (_a = this.filteredData) === null || _a === void 0 ? void 0 : _a.length
|
|
292
|
+
var oldLen = (_b = (_a = this.filteredData) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
289
293
|
this.filteredData = this.options.data.filter(function (d) { return _this.options.matchSearch(d, term); });
|
|
290
|
-
var newLen = (_d = (_c = this.filteredData) === null || _c === void 0 ? void 0 : _c.length
|
|
294
|
+
var newLen = (_d = (_c = this.filteredData) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;
|
|
291
295
|
if (oldLen !== newLen && this.scrollContainer != null) {
|
|
292
296
|
this.scrollContainer.scrollTop = 0;
|
|
293
297
|
}
|
|
@@ -300,7 +304,7 @@ var SelectDDAreaComponent = /** @class */ (function () {
|
|
|
300
304
|
SelectDDAreaComponent.prototype.focusFirst = function () {
|
|
301
305
|
var _a;
|
|
302
306
|
if (this.options.focusFirstItem && (this.component.getSelected() == null || this.component.getSelected().length === 0)) /* TODO multiselect */ {
|
|
303
|
-
this.component.setFocus((_a = this.filteredData
|
|
307
|
+
this.component.setFocus(((_a = this.filteredData) !== null && _a !== void 0 ? _a : this.options.data)[0]);
|
|
304
308
|
}
|
|
305
309
|
};
|
|
306
310
|
SelectDDAreaComponent.ESCAPE_KEY = 27;
|
|
@@ -3,7 +3,7 @@ var SplitterComponent = /** @class */ (function () {
|
|
|
3
3
|
function SplitterComponent(options) {
|
|
4
4
|
// tslint:disable-next-line: variable-name
|
|
5
5
|
this._is_splitter = true;
|
|
6
|
-
this.options =
|
|
6
|
+
this.options = options !== null && options !== void 0 ? options : {};
|
|
7
7
|
if (this.options.minSizesInPX == null) {
|
|
8
8
|
this.options.minSizesInPX = [];
|
|
9
9
|
}
|
|
@@ -12,6 +12,7 @@ export interface ITabItemOption {
|
|
|
12
12
|
export interface ITabOptions {
|
|
13
13
|
tabs?: ITabItemOption[];
|
|
14
14
|
contentClass?: string;
|
|
15
|
+
class?: string;
|
|
15
16
|
style?: string;
|
|
16
17
|
selectedIndex?: number;
|
|
17
18
|
onSelect?: (index?: number) => boolean | void;
|
|
@@ -34,4 +35,5 @@ export declare class TabsComponent implements IJSLComponent {
|
|
|
34
35
|
onInit(renderer: JSLRender): void;
|
|
35
36
|
SetSelectedTab(index: number): void;
|
|
36
37
|
private toNode;
|
|
38
|
+
private checkForDuplicateIds;
|
|
37
39
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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));
|
|
7
9
|
};
|
|
8
10
|
import "./TabsStyle.scss";
|
|
9
11
|
import { helper } from "../../core/helper";
|
|
@@ -12,15 +14,16 @@ var TabsComponent = /** @class */ (function () {
|
|
|
12
14
|
var _a, _b, _c;
|
|
13
15
|
this.options = options;
|
|
14
16
|
this.State = { selectedIndex: null };
|
|
15
|
-
this.options = (_a = this.options
|
|
16
|
-
this.
|
|
17
|
-
this.options.
|
|
17
|
+
this.options = (_a = this.options) !== null && _a !== void 0 ? _a : {};
|
|
18
|
+
this.checkForDuplicateIds();
|
|
19
|
+
this.options.tabs = (_b = this.options.tabs) !== null && _b !== void 0 ? _b : [];
|
|
20
|
+
this.options.selectedIndex = (_c = this.options.selectedIndex) !== null && _c !== void 0 ? _c : 0;
|
|
18
21
|
}
|
|
19
22
|
TabsComponent.prototype.render = function () {
|
|
20
23
|
var _this = this;
|
|
21
24
|
var _a, _b, _c, _d, _e;
|
|
22
25
|
var index = -1;
|
|
23
|
-
var activeIndex = (_a = this.State.selectedIndex
|
|
26
|
+
var activeIndex = (_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex;
|
|
24
27
|
if (activeIndex > -1 &&
|
|
25
28
|
this.options.tabs[activeIndex].content == null &&
|
|
26
29
|
this.options.tabs[activeIndex].onCreate) {
|
|
@@ -34,8 +37,8 @@ var TabsComponent = /** @class */ (function () {
|
|
|
34
37
|
if (idx === activeIndex) {
|
|
35
38
|
tabs.push({
|
|
36
39
|
tag: "div", attr: {
|
|
37
|
-
class: "tab-content " + (_b = this.options.contentClass
|
|
38
|
-
style: { "max-height": (_c = this.options.maxHeight
|
|
40
|
+
class: "tab-content " + ((_b = this.options.contentClass) !== null && _b !== void 0 ? _b : ""),
|
|
41
|
+
style: { "max-height": ((_c = this.options.maxHeight) !== null && _c !== void 0 ? _c : "100%") },
|
|
39
42
|
id: this.options.tabs[idx].id
|
|
40
43
|
},
|
|
41
44
|
children: [this.toNode(this.options.tabs[idx].content)]
|
|
@@ -44,8 +47,8 @@ var TabsComponent = /** @class */ (function () {
|
|
|
44
47
|
else if (this.options.preserveContent) {
|
|
45
48
|
tabs.push({
|
|
46
49
|
tag: "div", attr: {
|
|
47
|
-
class: "tab-content tab-hidden " + (_d = this.options.contentClass
|
|
48
|
-
style: { "max-height": (_e = this.options.maxHeight
|
|
50
|
+
class: "tab-content tab-hidden " + ((_d = this.options.contentClass) !== null && _d !== void 0 ? _d : ""),
|
|
51
|
+
style: { "max-height": ((_e = this.options.maxHeight) !== null && _e !== void 0 ? _e : "100%") },
|
|
49
52
|
id: this.options.tabs[idx].id
|
|
50
53
|
},
|
|
51
54
|
children: [this.toNode(this.options.tabs[idx].content)]
|
|
@@ -53,7 +56,7 @@ var TabsComponent = /** @class */ (function () {
|
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
return {
|
|
56
|
-
tag: "div", attr: { class: "stabcomponent", style: this.options.style }, children:
|
|
59
|
+
tag: "div", attr: { class: "stabcomponent" + (this.options.class || ""), style: this.options.style }, children: __spreadArray([
|
|
57
60
|
{
|
|
58
61
|
tag: "div", attr: { class: "tab-header-row" }, children: this.options.tabs.map(function (x) {
|
|
59
62
|
index++;
|
|
@@ -63,7 +66,7 @@ var TabsComponent = /** @class */ (function () {
|
|
|
63
66
|
class: "tab-item " + (index === activeIndex ? "active " : "") + (_this.options.tabs[currIndex].enabled === false ? "disabled " : ""),
|
|
64
67
|
click: function (evt) {
|
|
65
68
|
var _a;
|
|
66
|
-
if (_a = _this.options.tabs[currIndex].enabled
|
|
69
|
+
if ((_a = _this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
|
|
67
70
|
_this.SetSelectedTab(currIndex);
|
|
68
71
|
if (_this.options.onSelect) {
|
|
69
72
|
_this.options.onSelect(currIndex);
|
|
@@ -78,7 +81,7 @@ var TabsComponent = /** @class */ (function () {
|
|
|
78
81
|
tag: "div", attr: {
|
|
79
82
|
class: "close-button", click: function (evt) {
|
|
80
83
|
var _a;
|
|
81
|
-
if (_a = _this.options.tabs[currIndex].enabled
|
|
84
|
+
if ((_a = _this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
|
|
82
85
|
evt.stopPropagation();
|
|
83
86
|
_this.closeTabIndex(currIndex);
|
|
84
87
|
}
|
|
@@ -91,13 +94,14 @@ var TabsComponent = /** @class */ (function () {
|
|
|
91
94
|
};
|
|
92
95
|
})
|
|
93
96
|
}
|
|
94
|
-
], tabs)
|
|
97
|
+
], tabs, true)
|
|
95
98
|
};
|
|
96
99
|
};
|
|
97
100
|
TabsComponent.prototype.AddTab = function (tabItem) {
|
|
98
101
|
var _a;
|
|
99
|
-
tabItem.enabled = (_a = tabItem.enabled
|
|
102
|
+
tabItem.enabled = (_a = tabItem.enabled) !== null && _a !== void 0 ? _a : true;
|
|
100
103
|
this.options.tabs.push(tabItem);
|
|
104
|
+
this.checkForDuplicateIds();
|
|
101
105
|
return this.options.tabs.length - 1;
|
|
102
106
|
};
|
|
103
107
|
TabsComponent.prototype.EnableAll = function () {
|
|
@@ -125,8 +129,8 @@ var TabsComponent = /** @class */ (function () {
|
|
|
125
129
|
}
|
|
126
130
|
var currIdx = 0;
|
|
127
131
|
this.options.tabs = this.options.tabs.filter(function (x) { return currIdx++ !== index; });
|
|
128
|
-
if (this.options.tabs.length <= (_a = this.State.selectedIndex
|
|
129
|
-
this.SetSelectedTab((_b = this.State.selectedIndex
|
|
132
|
+
if (this.options.tabs.length <= ((_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex)) {
|
|
133
|
+
this.SetSelectedTab(((_b = this.State.selectedIndex) !== null && _b !== void 0 ? _b : this.options.selectedIndex) - 1);
|
|
130
134
|
}
|
|
131
135
|
};
|
|
132
136
|
// public onCreate(node: IJSLVNode) {
|
|
@@ -152,10 +156,22 @@ var TabsComponent = /** @class */ (function () {
|
|
|
152
156
|
return undefined;
|
|
153
157
|
}
|
|
154
158
|
if (typeof content === "string") {
|
|
155
|
-
return { tag:
|
|
159
|
+
return { tag: tag !== null && tag !== void 0 ? tag : "div", content: content };
|
|
156
160
|
}
|
|
157
161
|
return content;
|
|
158
162
|
};
|
|
163
|
+
TabsComponent.prototype.checkForDuplicateIds = function () {
|
|
164
|
+
if (this.options.tabs == null || this.options.tabs.length === 0) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
var ids = {};
|
|
168
|
+
for (var _i = 0, _a = this.options.tabs; _i < _a.length; _i++) {
|
|
169
|
+
var tab = _a[_i];
|
|
170
|
+
if (tab.id && ids[tab.id] !== undefined) {
|
|
171
|
+
throw new Error("Tab Control has duplicate id " + tab.id);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
159
175
|
return TabsComponent;
|
|
160
176
|
}());
|
|
161
177
|
export { TabsComponent };
|