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
|
@@ -3,13 +3,13 @@ import { DatePicker } from "../../ui/date.picker";
|
|
|
3
3
|
import { NumberInput } from "../../ui/number.input";
|
|
4
4
|
import { helper } from "../../core/helper";
|
|
5
5
|
import { AutoSuggest } from "../../ui/auto.suggest";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export class FormFieldComponent {
|
|
7
|
+
constructor(options) {
|
|
8
8
|
this.options = options;
|
|
9
9
|
this.id = options.id || helper.newDomGuid();
|
|
10
10
|
this.type = this.options.type === "password" ? "password" : "text";
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
render() {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
return {
|
|
15
15
|
tag: "div",
|
|
@@ -42,9 +42,9 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
42
42
|
]
|
|
43
43
|
}]
|
|
44
44
|
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
}
|
|
46
|
+
onCreate(node) {
|
|
47
|
+
const InputDom = node.dom.firstElementChild.children[1];
|
|
48
48
|
if (this.options.type === "number") {
|
|
49
49
|
NumberInput(InputDom, this.options.numberOptions);
|
|
50
50
|
}
|
|
@@ -54,20 +54,20 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
54
54
|
else if (this.options.type === "autosuggest") {
|
|
55
55
|
AutoSuggest(InputDom, this.options.autoSuggestOptions);
|
|
56
56
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
57
|
+
}
|
|
58
|
+
onRemove(node) {
|
|
59
59
|
if (this.datepickerRef != null) {
|
|
60
60
|
this.datepickerRef.destroy();
|
|
61
61
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
}
|
|
63
|
+
validate() {
|
|
64
|
+
const value = this.getValue();
|
|
65
65
|
if (this.options.required && !value) {
|
|
66
66
|
this.validationMessage = " ";
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
69
|
if (this.options.onValidate) {
|
|
70
|
-
|
|
70
|
+
const validationResult = this.options.onValidate(value);
|
|
71
71
|
if (validationResult === false) {
|
|
72
72
|
this.validationMessage = " ";
|
|
73
73
|
return false;
|
|
@@ -79,13 +79,13 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
79
79
|
}
|
|
80
80
|
this.validationMessage = null;
|
|
81
81
|
return true;
|
|
82
|
-
}
|
|
83
|
-
|
|
82
|
+
}
|
|
83
|
+
getValue() {
|
|
84
84
|
var _a;
|
|
85
85
|
return (_a = document.getElementById(this.id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
}
|
|
87
|
+
setValue(value) {
|
|
88
|
+
const el = document.getElementById(this.id);
|
|
89
89
|
if (el == null) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
@@ -96,13 +96,13 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
96
96
|
else {
|
|
97
97
|
el.parentElement.classList.remove("form-field--is-filled");
|
|
98
98
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
}
|
|
100
|
+
setInActive(evt, node) {
|
|
101
|
+
const formField = node.dom.parentElement.parentElement;
|
|
102
102
|
if (formField == null) {
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
setTimeout(
|
|
105
|
+
setTimeout(() => {
|
|
106
106
|
formField.classList.remove("form-field--is-active");
|
|
107
107
|
if (node.dom.value === "") {
|
|
108
108
|
formField.classList.remove("form-field--is-filled");
|
|
@@ -116,9 +116,9 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
return false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
}
|
|
120
|
+
setActive(evt, node) {
|
|
121
|
+
const formField = node.dom.parentElement.parentElement;
|
|
122
122
|
if (formField == null) {
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
@@ -128,13 +128,11 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
return false;
|
|
131
|
-
}
|
|
132
|
-
|
|
131
|
+
}
|
|
132
|
+
onInput(evt, node) {
|
|
133
133
|
if (this.options.onInput) {
|
|
134
134
|
this.options.onInput(evt, node);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
}());
|
|
140
|
-
export { FormFieldComponent };
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -1,91 +1,87 @@
|
|
|
1
1
|
import { Slick } from "../../grid/slick.core";
|
|
2
2
|
import { createJSLGrid } from "../../grid/slick.creator";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _this = this;
|
|
3
|
+
export class GridComponent {
|
|
4
|
+
constructor(data, columns, options, height) {
|
|
6
5
|
this.data = data;
|
|
7
6
|
this.columns = columns;
|
|
8
7
|
this.options = options;
|
|
9
8
|
this.currentlyVisible = true;
|
|
10
9
|
this.checkVisibleTimeout = 0;
|
|
11
10
|
this.initEventsFnc = [];
|
|
12
|
-
this.resizeEventListener =
|
|
13
|
-
|
|
14
|
-
if (
|
|
11
|
+
this.resizeEventListener = () => {
|
|
12
|
+
this.ref.then((g) => {
|
|
13
|
+
if (this.isVisible(g) && !this.anyInputIsFocused()) {
|
|
15
14
|
g.resizeCanvas();
|
|
16
15
|
}
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
|
-
|
|
18
|
+
let style = "";
|
|
20
19
|
if (!options.autoHeight) {
|
|
21
20
|
style = "height:" + (height !== null && height !== void 0 ? height : "400px");
|
|
22
21
|
}
|
|
23
22
|
this.rootTag = {
|
|
24
23
|
tag: "div",
|
|
25
24
|
attr: {
|
|
26
|
-
style
|
|
25
|
+
style
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
|
-
this.ref = new Promise(
|
|
30
|
-
|
|
28
|
+
this.ref = new Promise((resolve, reject) => {
|
|
29
|
+
this.refResolver = resolve;
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
|
|
32
|
+
getRootTag() {
|
|
34
33
|
return this.rootTag;
|
|
35
|
-
}
|
|
36
|
-
|
|
34
|
+
}
|
|
35
|
+
getRef() {
|
|
37
36
|
return this.ref;
|
|
38
|
-
}
|
|
39
|
-
|
|
37
|
+
}
|
|
38
|
+
initEvents(fnc) {
|
|
40
39
|
this.initEventsFnc.push(fnc);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var _this = this;
|
|
40
|
+
}
|
|
41
|
+
onCreate(vnode) {
|
|
44
42
|
// let grid;
|
|
45
|
-
setTimeout(
|
|
46
|
-
if (Array.isArray(
|
|
47
|
-
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
if (Array.isArray(this.data)) {
|
|
45
|
+
this.gridRef = createJSLGrid(vnode.dom, this.data, this.columns, this.options);
|
|
48
46
|
}
|
|
49
47
|
else {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
for (
|
|
54
|
-
|
|
48
|
+
const rawData = [];
|
|
49
|
+
this.gridRef = createJSLGrid(vnode.dom, rawData, this.columns, this.options);
|
|
50
|
+
this.data.then((result) => {
|
|
51
|
+
for (let i = 0; i < result.length; i++) {
|
|
52
|
+
rawData.push(result[i]);
|
|
55
53
|
}
|
|
56
|
-
|
|
54
|
+
this.gridRef.refreshData();
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
for (
|
|
61
|
-
|
|
57
|
+
this.refResolver(this.gridRef);
|
|
58
|
+
for (let idx = 0; idx < this.initEventsFnc.length; idx++) {
|
|
59
|
+
this.initEventsFnc[idx](this.gridRef);
|
|
62
60
|
}
|
|
63
|
-
window.addEventListener("resize",
|
|
64
|
-
|
|
61
|
+
window.addEventListener("resize", this.resizeEventListener);
|
|
62
|
+
this.checkVisibility(this.gridRef);
|
|
65
63
|
}, 1);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var _this = this;
|
|
64
|
+
}
|
|
65
|
+
onRemove(vnode) {
|
|
69
66
|
if (this.gridRef != null) {
|
|
70
67
|
this.gridRef.destroy();
|
|
71
68
|
this.gridRef = null;
|
|
72
69
|
}
|
|
73
|
-
this.ref = new Promise(
|
|
74
|
-
|
|
70
|
+
this.ref = new Promise((resolve, reject) => {
|
|
71
|
+
this.refResolver = resolve;
|
|
75
72
|
});
|
|
76
73
|
if (this.checkVisibleTimeout !== 0) {
|
|
77
74
|
clearTimeout(this.checkVisibleTimeout);
|
|
78
75
|
}
|
|
79
76
|
window.removeEventListener("resize", this.resizeEventListener);
|
|
80
|
-
}
|
|
81
|
-
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
82
79
|
return this.rootTag;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
var _this = this;
|
|
80
|
+
}
|
|
81
|
+
checkVisibility(g) {
|
|
86
82
|
if (!this.isVisible(g)) {
|
|
87
83
|
this.currentlyVisible = false;
|
|
88
|
-
this.checkVisibleTimeout = setTimeout(
|
|
84
|
+
this.checkVisibleTimeout = setTimeout(() => { this.checkVisibility(g); }, 1000);
|
|
89
85
|
}
|
|
90
86
|
else {
|
|
91
87
|
if (!this.currentlyVisible) {
|
|
@@ -95,14 +91,14 @@ var GridComponent = /** @class */ (function () {
|
|
|
95
91
|
}
|
|
96
92
|
this.checkVisibleTimeout = 0;
|
|
97
93
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
94
|
+
}
|
|
95
|
+
anyInputIsFocused() {
|
|
100
96
|
// this check is necessary because of mobile virtual keyboard
|
|
101
97
|
// -> virtual keyboard triggers window resize event -> which would reset any editors
|
|
102
98
|
return Slick.GlobalEditorLock.isActive() && document.querySelector("input:focus") != null;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
}
|
|
100
|
+
isVisible(g) {
|
|
101
|
+
let el = g.getViewportNode().parentElement;
|
|
106
102
|
while (el != null && el !== document.body) {
|
|
107
103
|
if (getComputedStyle(el, null).display === "none") {
|
|
108
104
|
return false;
|
|
@@ -110,7 +106,5 @@ var GridComponent = /** @class */ (function () {
|
|
|
110
106
|
el = el.parentElement;
|
|
111
107
|
}
|
|
112
108
|
return el != null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
}());
|
|
116
|
-
export { GridComponent };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { EventHandler } from "../../interaction/eventhandler";
|
|
13
2
|
// tslint:disable-next-line: max-classes-per-file
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
export class InputComponent {
|
|
4
|
+
get onChange() {
|
|
5
|
+
return this.options.onChange;
|
|
6
|
+
}
|
|
7
|
+
get onInput() {
|
|
8
|
+
return this.options.onInput;
|
|
9
|
+
}
|
|
10
|
+
constructor(options) {
|
|
16
11
|
var _a;
|
|
17
|
-
this.options =
|
|
12
|
+
this.options = { ...{ type: "text", enabled: true, bindMode: "toModel" }, ...options };
|
|
18
13
|
if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
|
|
19
14
|
this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
20
15
|
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
@@ -26,32 +21,18 @@ var InputComponent = /** @class */ (function () {
|
|
|
26
21
|
this.options.type = "text";
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
|
-
Object.defineProperty(InputComponent.prototype, "onChange", {
|
|
30
|
-
get: function () {
|
|
31
|
-
return this.options.onChange;
|
|
32
|
-
},
|
|
33
|
-
enumerable: false,
|
|
34
|
-
configurable: true
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(InputComponent.prototype, "onInput", {
|
|
37
|
-
get: function () {
|
|
38
|
-
return this.options.onInput;
|
|
39
|
-
},
|
|
40
|
-
enumerable: false,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
24
|
// public isEqual(node: IJSLComponent): boolean {
|
|
44
25
|
// return (this as any).__proto__ === (node as any).__proto__;
|
|
45
26
|
// }
|
|
46
|
-
|
|
27
|
+
render() {
|
|
47
28
|
var _a;
|
|
48
|
-
|
|
29
|
+
let val = this.options.value;
|
|
49
30
|
if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
50
31
|
if (this.onInput.count() > 0) {
|
|
51
32
|
this.options.bindOnInput = true;
|
|
52
33
|
}
|
|
53
34
|
// const current = this.getValue();
|
|
54
|
-
|
|
35
|
+
const newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
55
36
|
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
56
37
|
this.options.bindTo[this.options.property]);
|
|
57
38
|
// if (newVal !== current)
|
|
@@ -78,15 +59,15 @@ var InputComponent = /** @class */ (function () {
|
|
|
78
59
|
},
|
|
79
60
|
content: this.options.type === "textarea" ? val : undefined
|
|
80
61
|
};
|
|
81
|
-
}
|
|
82
|
-
|
|
62
|
+
}
|
|
63
|
+
getValue() {
|
|
83
64
|
if (this.currentDom == null) {
|
|
84
65
|
return this.options.value || "";
|
|
85
66
|
// return "";
|
|
86
67
|
}
|
|
87
68
|
return this.currentDom.value;
|
|
88
|
-
}
|
|
89
|
-
|
|
69
|
+
}
|
|
70
|
+
setValue(value) {
|
|
90
71
|
var _a;
|
|
91
72
|
this.options.value = value;
|
|
92
73
|
if (this.currentDom != null) {
|
|
@@ -96,10 +77,10 @@ var InputComponent = /** @class */ (function () {
|
|
|
96
77
|
this.options.bindTo[this.options.property] =
|
|
97
78
|
((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
|
|
98
79
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
80
|
+
}
|
|
81
|
+
onCreate(node) {
|
|
101
82
|
this.currentDom = node.dom;
|
|
102
|
-
}
|
|
83
|
+
}
|
|
103
84
|
// public onUpdate(node: IJSLVNode) {
|
|
104
85
|
// this.currentDom = node.dom as HTMLInputElement;
|
|
105
86
|
// if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
@@ -117,31 +98,29 @@ var InputComponent = /** @class */ (function () {
|
|
|
117
98
|
// }
|
|
118
99
|
// }
|
|
119
100
|
// }
|
|
120
|
-
|
|
101
|
+
raiseChangeEvent(e, node) {
|
|
121
102
|
var _a;
|
|
122
103
|
if (this.options.enabled) {
|
|
123
|
-
|
|
104
|
+
const value = node.dom.value;
|
|
124
105
|
if (this.options.bindMode !== "fromModel" && this.options.bindTo && this.options.property) {
|
|
125
106
|
this.options.bindTo[this.options.property] =
|
|
126
107
|
((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
|
|
127
108
|
}
|
|
128
109
|
this.options.onChange.notify(value);
|
|
129
110
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
111
|
+
}
|
|
112
|
+
raiseInputEvent(e, node) {
|
|
132
113
|
var _a;
|
|
133
114
|
if (this.onInput.count() === 0) {
|
|
134
115
|
return false;
|
|
135
116
|
}
|
|
136
117
|
if (this.options.enabled) {
|
|
137
|
-
|
|
118
|
+
const value = node.dom.value;
|
|
138
119
|
if (this.options.bindOnInput && this.options.bindMode !== "fromModel" && this.options.bindTo && this.options.property) {
|
|
139
120
|
this.options.bindTo[this.options.property] =
|
|
140
121
|
((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
|
|
141
122
|
}
|
|
142
123
|
this.options.onInput.notify(value);
|
|
143
124
|
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
}());
|
|
147
|
-
export { InputComponent };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import "./LoadingStyle.css";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export class LoadingComponent {
|
|
3
|
+
constructor(sizeInRem) {
|
|
4
4
|
this.sizeInRem = sizeInRem;
|
|
5
5
|
if (sizeInRem == null) {
|
|
6
6
|
this.sizeInRem = 6;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
isEqual(node) {
|
|
10
10
|
return this.__proto__ === node.__proto__;
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
13
|
return {
|
|
14
14
|
tag: "div",
|
|
15
15
|
attr: { style: "font-size:" + this.sizeInRem + "rem" },
|
|
16
16
|
content: "<div class='lds-dual-ring'></div>",
|
|
17
17
|
raw: true
|
|
18
18
|
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}());
|
|
22
|
-
export { LoadingComponent };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,33 +1,12 @@
|
|
|
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
|
-
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));
|
|
20
|
-
};
|
|
21
1
|
import "./NavigationStyle.scss";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.options =
|
|
2
|
+
export class NavigationComponent {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.options = { position: "fixed", id: "luxbar-checkbox", alignment: "left", ...options };
|
|
25
5
|
}
|
|
26
|
-
|
|
6
|
+
isEqual(node) {
|
|
27
7
|
return this.__proto__ === node.__proto__;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var _this = this;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
31
10
|
var _a, _b;
|
|
32
11
|
return {
|
|
33
12
|
tag: "header",
|
|
@@ -37,34 +16,32 @@ var NavigationComponent = /** @class */ (function () {
|
|
|
37
16
|
children: [
|
|
38
17
|
{ tag: "input", attr: { type: "checkbox", class: "luxbar-checkbox", id: this.options.id } },
|
|
39
18
|
{ tag: "div", attr: { class: "luxbar-menu luxbar-menu-" + this.options.alignment + " luxbar-menu-light" },
|
|
40
|
-
children: [{ tag: "ul", attr: { class: "luxbar-navigation" }, children:
|
|
19
|
+
children: [{ tag: "ul", attr: { class: "luxbar-navigation" }, children: [
|
|
41
20
|
{ tag: "li", attr: { class: "luxbar-header" }, children: [
|
|
42
21
|
{ tag: "a", attr: { href: (_b = this.options.titleLink) !== null && _b !== void 0 ? _b : "#", class: "luxbar-brand" }, children: [this.toNode(this.options.title)] },
|
|
43
22
|
{ tag: "label", attr: { class: "luxbar-hamburger luxbar-hamburger-spin", for: this.options.id },
|
|
44
23
|
children: [{ tag: "span" }] },
|
|
45
|
-
] }
|
|
46
|
-
|
|
24
|
+
] },
|
|
25
|
+
...this.options.data.map((x) => this.itemToNode(x))
|
|
26
|
+
] }] }
|
|
47
27
|
] }
|
|
48
28
|
]
|
|
49
29
|
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var _this = this;
|
|
30
|
+
}
|
|
31
|
+
itemToNode(x) {
|
|
53
32
|
var _a, _b, _c;
|
|
54
33
|
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: [
|
|
55
34
|
{ tag: "a", attr: { href: (_b = x.link) !== null && _b !== void 0 ? _b : "#", target: x.target, click: x.click }, children: [this.toNode(x.content)] },
|
|
56
|
-
(((_c = x.children) === null || _c === void 0 ? void 0 : _c.length) > 0 ? { tag: "ul", children: x.children.map(
|
|
35
|
+
(((_c = x.children) === null || _c === void 0 ? void 0 : _c.length) > 0 ? { tag: "ul", children: x.children.map((c) => this.itemToNode(c)) } : undefined)
|
|
57
36
|
] };
|
|
58
|
-
}
|
|
59
|
-
|
|
37
|
+
}
|
|
38
|
+
isActive(link) {
|
|
60
39
|
return location.hash.startsWith(link);
|
|
61
|
-
}
|
|
62
|
-
|
|
40
|
+
}
|
|
41
|
+
toNode(content) {
|
|
63
42
|
if (typeof content === "string") {
|
|
64
|
-
return { tag: "span", content
|
|
43
|
+
return { tag: "span", content };
|
|
65
44
|
}
|
|
66
45
|
return content;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}());
|
|
70
|
-
export { NavigationComponent };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import "./Notification.scss";
|
|
2
2
|
import { JSLRender } from "jsl-render";
|
|
3
3
|
import { helper } from "../../core/helper";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
Notification.show = function (options) {
|
|
4
|
+
export class Notification {
|
|
5
|
+
static show(options) {
|
|
8
6
|
if (Notification.container == null) {
|
|
9
7
|
Notification.createContainer();
|
|
10
8
|
}
|
|
11
|
-
|
|
9
|
+
const id = helper.newDomGuid();
|
|
12
10
|
// add
|
|
13
|
-
|
|
11
|
+
const notification = {
|
|
14
12
|
tag: "div",
|
|
15
|
-
attr: { id
|
|
13
|
+
attr: { id, style: options.style, class: "jsl-notification " + (options.class || "") },
|
|
16
14
|
animation: { attr: "opacity", from: 0, to: 1, duration: 600 },
|
|
17
15
|
children: [
|
|
18
16
|
typeof options.content === "string" ? { tag: "div", content: options.content } : options.content
|
|
@@ -22,48 +20,46 @@ var Notification = /** @class */ (function () {
|
|
|
22
20
|
Notification.renderer.refresh();
|
|
23
21
|
// remove
|
|
24
22
|
if (options.timeOut) {
|
|
25
|
-
setTimeout(
|
|
26
|
-
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
const idx = Notification.containerVNode.children.indexOf(notification);
|
|
27
25
|
if (idx >= 0) {
|
|
28
26
|
Notification.containerVNode.children.splice(idx, 1);
|
|
29
27
|
}
|
|
30
28
|
Notification.renderer.refresh();
|
|
31
29
|
}, options.timeOut);
|
|
32
30
|
}
|
|
33
|
-
notification.attr.click =
|
|
31
|
+
notification.attr.click = () => {
|
|
34
32
|
var _a;
|
|
35
33
|
if (options.onClick != null) {
|
|
36
34
|
options.onClick();
|
|
37
35
|
}
|
|
38
36
|
if (((_a = options.closeOnClick) !== null && _a !== void 0 ? _a : true) === true) {
|
|
39
|
-
|
|
37
|
+
const idx = Notification.containerVNode.children.indexOf(notification);
|
|
40
38
|
if (idx >= 0) {
|
|
41
39
|
Notification.containerVNode.children.splice(idx, 1);
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
};
|
|
45
43
|
return id;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Notification.containerVNode.children = Notification.containerVNode.children.filter(
|
|
44
|
+
}
|
|
45
|
+
static clearNotification(id) {
|
|
46
|
+
Notification.containerVNode.children = Notification.containerVNode.children.filter((x) => { var _a; return ((_a = x.attr) === null || _a === void 0 ? void 0 : _a.id) !== id; });
|
|
49
47
|
Notification.renderer.refresh();
|
|
50
|
-
}
|
|
51
|
-
|
|
48
|
+
}
|
|
49
|
+
static clearAll() {
|
|
52
50
|
if (Notification.containerVNode != null) {
|
|
53
51
|
Notification.containerVNode.children = [];
|
|
54
52
|
}
|
|
55
53
|
if (Notification.renderer != null) {
|
|
56
54
|
Notification.renderer.refresh();
|
|
57
55
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
56
|
+
}
|
|
57
|
+
static createContainer() {
|
|
60
58
|
Notification.container = document.createElement("div");
|
|
61
59
|
document.body.appendChild(Notification.container);
|
|
62
60
|
Notification.container.className = "jsl-notification-container";
|
|
63
61
|
Notification.containerVNode = { tag: "div", children: [] };
|
|
64
62
|
Notification.renderer = new JSLRender(Notification.container, false);
|
|
65
63
|
Notification.renderer.render(Notification.containerVNode);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
}());
|
|
69
|
-
export { Notification };
|
|
64
|
+
}
|
|
65
|
+
}
|