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
@@ -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
- var FormFieldComponent = /** @class */ (function () {
7
- function FormFieldComponent(options) {
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
- FormFieldComponent.prototype.render = function () {
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
- FormFieldComponent.prototype.onCreate = function (node) {
47
- var InputDom = node.dom.firstElementChild.children[1];
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
- FormFieldComponent.prototype.onRemove = function (node) {
57
+ }
58
+ onRemove(node) {
59
59
  if (this.datepickerRef != null) {
60
60
  this.datepickerRef.destroy();
61
61
  }
62
- };
63
- FormFieldComponent.prototype.validate = function () {
64
- var value = this.getValue();
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
- var validationResult = this.options.onValidate(value);
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
- FormFieldComponent.prototype.getValue = function () {
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
- FormFieldComponent.prototype.setValue = function (value) {
88
- var el = document.getElementById(this.id);
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
- FormFieldComponent.prototype.setInActive = function (evt, node) {
101
- var formField = node.dom.parentElement.parentElement;
99
+ }
100
+ setInActive(evt, node) {
101
+ const formField = node.dom.parentElement.parentElement;
102
102
  if (formField == null) {
103
103
  return;
104
104
  }
105
- setTimeout(function () {
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
- FormFieldComponent.prototype.setActive = function (evt, node) {
121
- var formField = node.dom.parentElement.parentElement;
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
- FormFieldComponent.prototype.onInput = function (evt, node) {
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
- return FormFieldComponent;
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
- var GridComponent = /** @class */ (function () {
4
- function GridComponent(data, columns, options, height) {
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 = function () {
13
- _this.ref.then(function (g) {
14
- if (_this.isVisible(g) && !_this.anyInputIsFocused()) {
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
- var style = "";
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: style
25
+ style
27
26
  }
28
27
  };
29
- this.ref = new Promise(function (resolve, reject) {
30
- _this.refResolver = resolve;
28
+ this.ref = new Promise((resolve, reject) => {
29
+ this.refResolver = resolve;
31
30
  });
32
31
  }
33
- GridComponent.prototype.getRootTag = function () {
32
+ getRootTag() {
34
33
  return this.rootTag;
35
- };
36
- GridComponent.prototype.getRef = function () {
34
+ }
35
+ getRef() {
37
36
  return this.ref;
38
- };
39
- GridComponent.prototype.initEvents = function (fnc) {
37
+ }
38
+ initEvents(fnc) {
40
39
  this.initEventsFnc.push(fnc);
41
- };
42
- GridComponent.prototype.onCreate = function (vnode) {
43
- var _this = this;
40
+ }
41
+ onCreate(vnode) {
44
42
  // let grid;
45
- setTimeout(function () {
46
- if (Array.isArray(_this.data)) {
47
- _this.gridRef = createJSLGrid(vnode.dom, _this.data, _this.columns, _this.options);
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
- var rawData_1 = [];
51
- _this.gridRef = createJSLGrid(vnode.dom, rawData_1, _this.columns, _this.options);
52
- _this.data.then(function (result) {
53
- for (var i = 0; i < result.length; i++) {
54
- rawData_1.push(result[i]);
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
- _this.gridRef.refreshData();
54
+ this.gridRef.refreshData();
57
55
  });
58
56
  }
59
- _this.refResolver(_this.gridRef);
60
- for (var idx = 0; idx < _this.initEventsFnc.length; idx++) {
61
- _this.initEventsFnc[idx](_this.gridRef);
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", _this.resizeEventListener);
64
- _this.checkVisibility(_this.gridRef);
61
+ window.addEventListener("resize", this.resizeEventListener);
62
+ this.checkVisibility(this.gridRef);
65
63
  }, 1);
66
- };
67
- GridComponent.prototype.onRemove = function (vnode) {
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(function (resolve, reject) {
74
- _this.refResolver = resolve;
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
- GridComponent.prototype.render = function () {
77
+ }
78
+ render() {
82
79
  return this.rootTag;
83
- };
84
- GridComponent.prototype.checkVisibility = function (g) {
85
- var _this = this;
80
+ }
81
+ checkVisibility(g) {
86
82
  if (!this.isVisible(g)) {
87
83
  this.currentlyVisible = false;
88
- this.checkVisibleTimeout = setTimeout(function () { _this.checkVisibility(g); }, 1000);
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
- GridComponent.prototype.anyInputIsFocused = function () {
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
- GridComponent.prototype.isVisible = function (g) {
105
- var el = g.getViewportNode().parentElement;
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
- return GridComponent;
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
- var InputComponent = /** @class */ (function () {
15
- function InputComponent(options) {
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 = __assign({ type: "text", enabled: true, bindMode: "toModel" }, 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
- InputComponent.prototype.render = function () {
27
+ render() {
47
28
  var _a;
48
- var val = this.options.value;
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
- var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
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
- InputComponent.prototype.getValue = function () {
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
- InputComponent.prototype.setValue = function (value) {
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
- InputComponent.prototype.onCreate = function (node) {
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
- InputComponent.prototype.raiseChangeEvent = function (e, node) {
101
+ raiseChangeEvent(e, node) {
121
102
  var _a;
122
103
  if (this.options.enabled) {
123
- var value = node.dom.value;
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
- InputComponent.prototype.raiseInputEvent = function (e, node) {
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
- var value = node.dom.value;
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
- return InputComponent;
146
- }());
147
- export { InputComponent };
125
+ }
126
+ }
@@ -1,22 +1,20 @@
1
1
  import "./LoadingStyle.css";
2
- var LoadingComponent = /** @class */ (function () {
3
- function LoadingComponent(sizeInRem) {
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
- LoadingComponent.prototype.isEqual = function (node) {
9
+ isEqual(node) {
10
10
  return this.__proto__ === node.__proto__;
11
- };
12
- LoadingComponent.prototype.render = function () {
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
- return LoadingComponent;
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
- var NavigationComponent = /** @class */ (function () {
23
- function NavigationComponent(options) {
24
- this.options = __assign({ position: "fixed", id: "luxbar-checkbox", alignment: "left" }, options);
2
+ export class NavigationComponent {
3
+ constructor(options) {
4
+ this.options = { position: "fixed", id: "luxbar-checkbox", alignment: "left", ...options };
25
5
  }
26
- NavigationComponent.prototype.isEqual = function (node) {
6
+ isEqual(node) {
27
7
  return this.__proto__ === node.__proto__;
28
- };
29
- NavigationComponent.prototype.render = function () {
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: __spreadArray([
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
- ], this.options.data.map(function (x) { return _this.itemToNode(x); }), true) }] }
24
+ ] },
25
+ ...this.options.data.map((x) => this.itemToNode(x))
26
+ ] }] }
47
27
  ] }
48
28
  ]
49
29
  };
50
- };
51
- NavigationComponent.prototype.itemToNode = function (x) {
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(function (c) { return _this.itemToNode(c); }) } : undefined)
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
- NavigationComponent.prototype.isActive = function (link) {
37
+ }
38
+ isActive(link) {
60
39
  return location.hash.startsWith(link);
61
- };
62
- NavigationComponent.prototype.toNode = function (content) {
40
+ }
41
+ toNode(content) {
63
42
  if (typeof content === "string") {
64
- return { tag: "span", content: content };
43
+ return { tag: "span", content };
65
44
  }
66
45
  return content;
67
- };
68
- return NavigationComponent;
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
- var Notification = /** @class */ (function () {
5
- function Notification() {
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
- var id = helper.newDomGuid();
9
+ const id = helper.newDomGuid();
12
10
  // add
13
- var notification = {
11
+ const notification = {
14
12
  tag: "div",
15
- attr: { id: id, style: options.style, class: "jsl-notification " + (options.class || "") },
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(function () {
26
- var idx = Notification.containerVNode.children.indexOf(notification);
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 = function () {
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
- var idx = Notification.containerVNode.children.indexOf(notification);
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
- Notification.clearNotification = function (id) {
48
- Notification.containerVNode.children = Notification.containerVNode.children.filter(function (x) { var _a; return ((_a = x.attr) === null || _a === void 0 ? void 0 : _a.id) !== id; });
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
- Notification.clearAll = function () {
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
- Notification.createContainer = function () {
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
- return Notification;
68
- }());
69
- export { Notification };
64
+ }
65
+ }