jsl-ui 9.28.2 → 9.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/lib/components/IntervalComponent.js +32 -35
  2. package/lib/components/auto-suggest/AutoSuggestComponent.js +19 -21
  3. package/lib/components/button/ButtonComponent.js +13 -30
  4. package/lib/components/checkbox/CheckBoxComponent.js +22 -39
  5. package/lib/components/date/DateComponent.js +29 -46
  6. package/lib/components/date-range/DateRangeComponent.js +48 -63
  7. package/lib/components/date-time/DateTimeComponent.js +17 -31
  8. package/lib/components/dialog/DialogComponent.js +75 -134
  9. package/lib/components/drop-down/DropDownComponent.js +23 -37
  10. package/lib/components/expander/ExpanderComponent.js +20 -23
  11. package/lib/components/form-field/FormComponent.js +9 -12
  12. package/lib/components/form-field/FormFieldComponent.js +28 -30
  13. package/lib/components/grid/GridComponent.js +46 -52
  14. package/lib/components/input/InputComponent.js +26 -47
  15. package/lib/components/loading/LoadingComponent.js +7 -9
  16. package/lib/components/navigation/NavigationComponent.js +20 -43
  17. package/lib/components/notification/Notification.js +18 -22
  18. package/lib/components/number/NumberComponent.js +28 -46
  19. package/lib/components/overlay/OverlayComponent.js +45 -60
  20. package/lib/components/progress/ProgressComponent.js +15 -17
  21. package/lib/components/ribbon-menu/RibbonMenuComponent.js +9 -20
  22. package/lib/components/select/SelectComponent.js +105 -122
  23. package/lib/components/select/SelectDDAreaComponent.js +108 -122
  24. package/lib/components/slider/nouislider.js +1 -1
  25. package/lib/components/stack-panel/SplitterComponent.js +27 -29
  26. package/lib/components/stack-panel/StackPanelComponent.js +17 -31
  27. package/lib/components/tabs/TabsComponent.js +53 -66
  28. package/lib/components/time/TimeComponent.js +32 -43
  29. package/lib/components/tree-view/TreeViewComponent.js +13 -16
  30. package/lib/components/virtual-render/VirtualRenderComponent.js +30 -44
  31. package/lib/core/culture.js +2 -2
  32. package/lib/core/date.js +68 -72
  33. package/lib/core/helper.js +30 -34
  34. package/lib/core/jq.js +54 -63
  35. package/lib/core/lang.js +24 -28
  36. package/lib/core/numeric.js +35 -39
  37. package/lib/grid/filterDialogs/dateRangeFilter.js +98 -148
  38. package/lib/grid/filterDialogs/excelFilter.js +205 -271
  39. package/lib/grid/plugins/ext.overlay.js +9 -9
  40. package/lib/grid/plugins/slick.cellrangedecorator.js +2 -2
  41. package/lib/grid/plugins/slick.cellrangeselector.js +1 -1
  42. package/lib/grid/plugins/slick.cellselectionmodel.js +8 -8
  43. package/lib/grid/plugins/slick.headerbuttons.js +1 -1
  44. package/lib/grid/plugins/slick.headermenu.js +1 -1
  45. package/lib/grid/plugins/slick.rowmovemanager.js +2 -2
  46. package/lib/grid/plugins/slick.rowselectionmodel.js +1 -1
  47. package/lib/grid/slick.core.js +1 -1
  48. package/lib/grid/slick.creator.js +144 -144
  49. package/lib/grid/slick.dataview.js +127 -138
  50. package/lib/grid/slick.editors.core.js +1 -1
  51. package/lib/grid/slick.editors.date.js +2 -2
  52. package/lib/grid/slick.editors.lookup.js +36 -37
  53. package/lib/grid/slick.editors.nav.js +1 -1
  54. package/lib/grid/slick.formatters.js +26 -26
  55. package/lib/grid/slick.grid.js +163 -166
  56. package/lib/grid/slick.groupitemmetadataprovider.js +4 -4
  57. package/lib/grid/slick.tree.js +91 -103
  58. package/lib/index.js.map +1 -1
  59. package/lib/interaction/eventhandler.js +20 -23
  60. package/lib/interaction/moveable.js +76 -90
  61. package/lib/interaction/resizable.js +58 -72
  62. package/lib/ui/auto.suggest.js +13 -28
  63. package/lib/ui/date.picker/lib/fns.js +1 -5
  64. package/lib/ui/dialog.js +28 -43
  65. package/lib/ui/drop.down.js +4 -4
  66. package/lib/ui/number.input.js +8 -19
  67. package/package.json +1 -1
@@ -1,68 +1,65 @@
1
- var IntervalComponent = /** @class */ (function () {
2
- function IntervalComponent(fnc, options) {
1
+ export class IntervalComponent {
2
+ constructor(fnc, options) {
3
3
  this.fnc = fnc;
4
4
  this.options = options;
5
5
  }
6
- IntervalComponent.prototype.isEqual = function (node) {
6
+ isEqual(node) {
7
7
  return this.__proto__ === node.__proto__;
8
- };
9
- IntervalComponent.prototype.render = function () {
8
+ }
9
+ render() {
10
10
  return { tag: "input", attr: { type: "hidden" } };
11
- };
12
- IntervalComponent.prototype.onInit = function (render) {
11
+ }
12
+ onInit(render) {
13
13
  this.renderer = render;
14
- };
15
- IntervalComponent.prototype.onCreate = function (node) {
16
- var _this = this;
17
- var timeoutRef = node.dom.value;
14
+ }
15
+ onCreate(node) {
16
+ const timeoutRef = node.dom.value;
18
17
  if (timeoutRef && timeoutRef !== "0") {
19
18
  clearTimeout(parseInt(timeoutRef, 10));
20
19
  node.dom.value = "";
21
20
  }
22
- var f = function () {
23
- var result;
21
+ const f = () => {
22
+ let result;
24
23
  try {
25
- result = _this.fnc();
24
+ result = this.fnc();
26
25
  }
27
26
  catch (e) {
28
27
  console.error(e);
29
- if (_this.options.stopOnError) {
28
+ if (this.options.stopOnError) {
30
29
  return;
31
30
  }
32
31
  }
33
- var isPromise = result && typeof result.then === "function" && typeof result.catch === "function";
32
+ const isPromise = result && typeof result.then === "function" && typeof result.catch === "function";
34
33
  if (isPromise) {
35
- result.then(function () {
36
- if (!_this.options.noRefresh) {
37
- _this.renderer.refresh();
34
+ result.then(() => {
35
+ if (!this.options.noRefresh) {
36
+ this.renderer.refresh();
38
37
  }
39
- node.dom.value = setTimeout(f, _this.options.interval).toString();
40
- }).catch(function (e) {
38
+ node.dom.value = setTimeout(f, this.options.interval).toString();
39
+ }).catch((e) => {
41
40
  console.error(e);
42
- if (!_this.options.stopOnError) {
43
- if (!_this.options.noRefresh) {
44
- _this.renderer.refresh();
41
+ if (!this.options.stopOnError) {
42
+ if (!this.options.noRefresh) {
43
+ this.renderer.refresh();
45
44
  }
46
- node.dom.value = setTimeout(f, _this.options.interval).toString();
45
+ node.dom.value = setTimeout(f, this.options.interval).toString();
47
46
  }
48
47
  });
49
48
  }
50
49
  else {
51
- if (!_this.options.noRefresh) {
52
- _this.renderer.refresh();
50
+ if (!this.options.noRefresh) {
51
+ this.renderer.refresh();
53
52
  }
54
- node.dom.value = setTimeout(f, _this.options.interval).toString();
53
+ node.dom.value = setTimeout(f, this.options.interval).toString();
55
54
  }
56
55
  };
57
56
  f();
58
- };
59
- IntervalComponent.prototype.onRemove = function (node) {
60
- var timeoutRef = node.dom.value;
57
+ }
58
+ onRemove(node) {
59
+ const timeoutRef = node.dom.value;
61
60
  if (timeoutRef && timeoutRef !== "0") {
62
61
  clearTimeout(parseInt(timeoutRef, 10));
63
62
  node.dom.value = "";
64
63
  }
65
- };
66
- return IntervalComponent;
67
- }());
68
- export { IntervalComponent };
64
+ }
65
+ }
@@ -1,49 +1,47 @@
1
1
  import { AutoSuggest } from "../../ui/auto.suggest";
2
- var AutoSuggestComponent = /** @class */ (function () {
3
- function AutoSuggestComponent(options) {
2
+ export class AutoSuggestComponent {
3
+ constructor(options) {
4
4
  this.options = options;
5
5
  // this.id = this.options.id ?? helper.newDomGuid();
6
6
  }
7
- AutoSuggestComponent.prototype.render = function () {
7
+ render() {
8
8
  var _a;
9
9
  return {
10
10
  tag: "input",
11
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
- };
14
- AutoSuggestComponent.prototype.getRef = function () {
13
+ }
14
+ getRef() {
15
15
  return this.ref;
16
- };
17
- AutoSuggestComponent.prototype.getValue = function () {
16
+ }
17
+ getValue() {
18
18
  if (this.dom == null) {
19
19
  return "";
20
20
  }
21
21
  return this.dom.value;
22
- };
23
- AutoSuggestComponent.prototype.setValue = function (val) {
22
+ }
23
+ setValue(val) {
24
24
  if (this.dom == null) {
25
25
  return;
26
26
  }
27
27
  this.dom.value = val;
28
- };
29
- AutoSuggestComponent.prototype.focus = function () {
28
+ }
29
+ focus() {
30
30
  if (this.dom == null) {
31
31
  return;
32
32
  }
33
33
  this.dom.focus();
34
- };
35
- AutoSuggestComponent.prototype.onCreate = function (node) {
34
+ }
35
+ onCreate(node) {
36
36
  this.dom = node.dom;
37
37
  AutoSuggest(node.dom, this.options);
38
- };
39
- AutoSuggestComponent.prototype.onUpdate = function (node) {
38
+ }
39
+ onUpdate(node) {
40
40
  this.dom = node.dom;
41
- };
42
- AutoSuggestComponent.prototype.onRemove = function () {
41
+ }
42
+ onRemove() {
43
43
  if (this.ref != null) {
44
44
  this.ref.destroy();
45
45
  }
46
- };
47
- return AutoSuggestComponent;
48
- }());
49
- export { AutoSuggestComponent };
46
+ }
47
+ }
@@ -1,31 +1,16 @@
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
- var ButtonComponent = /** @class */ (function () {
14
- function ButtonComponent(options) {
15
- this.options = __assign({ enabled: true, class: "" }, options);
2
+ export class ButtonComponent {
3
+ get click() {
4
+ return this.options.click;
5
+ }
6
+ constructor(options) {
7
+ this.options = { ...{ enabled: true, class: "" }, ...options };
16
8
  this.options.click = EventHandler.Create(this.options.click);
17
9
  }
18
- Object.defineProperty(ButtonComponent.prototype, "click", {
19
- get: function () {
20
- return this.options.click;
21
- },
22
- enumerable: false,
23
- configurable: true
24
- });
25
- ButtonComponent.prototype.isEqual = function (node) {
10
+ isEqual(node) {
26
11
  return this.__proto__ === node.__proto__;
27
- };
28
- ButtonComponent.prototype.render = function () {
12
+ }
13
+ render() {
29
14
  return {
30
15
  tag: "button",
31
16
  attr: {
@@ -35,12 +20,10 @@ var ButtonComponent = /** @class */ (function () {
35
20
  content: typeof this.options.content === "string" ? this.options.content : "",
36
21
  children: typeof this.options.content !== "string" ? [this.options.content] : []
37
22
  };
38
- };
39
- ButtonComponent.prototype.raiseEvent = function (evt) {
23
+ }
24
+ raiseEvent(evt) {
40
25
  if (this.options.enabled) {
41
26
  this.options.click.notify(evt);
42
27
  }
43
- };
44
- return ButtonComponent;
45
- }());
46
- export { ButtonComponent };
28
+ }
29
+ }
@@ -1,21 +1,13 @@
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 "./CheckBoxStyle.scss";
13
2
  import { EventHandler } from "../../interaction/eventhandler";
14
3
  import { helper } from "../../core/helper";
15
- var CheckBoxComponent = /** @class */ (function () {
16
- function CheckBoxComponent(options) {
4
+ export class CheckBoxComponent {
5
+ get onChange() {
6
+ return this.options.onChange;
7
+ }
8
+ constructor(options) {
17
9
  var _a;
18
- this.options = __assign({ enabled: true, class: "", bindMode: "toModel" }, options);
10
+ this.options = { ...{ enabled: true, class: "", bindMode: "toModel" }, ...options };
19
11
  if (!this.options.id) {
20
12
  this.options.id = helper.newDomGuid();
21
13
  }
@@ -26,26 +18,19 @@ var CheckBoxComponent = /** @class */ (function () {
26
18
  }
27
19
  this.options.onChange = EventHandler.Create(this.options.onChange);
28
20
  }
29
- Object.defineProperty(CheckBoxComponent.prototype, "onChange", {
30
- get: function () {
31
- return this.options.onChange;
32
- },
33
- enumerable: false,
34
- configurable: true
35
- });
36
21
  // public isEqual(node: IJSLComponent): boolean {
37
22
  // return (this as any).__proto__ === (node as any).__proto__;
38
23
  // }
39
- CheckBoxComponent.prototype.render = function () {
24
+ render() {
40
25
  var _a;
41
- var val = this.options.value;
26
+ let val = this.options.value;
42
27
  if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
43
- var current = this.getValue();
44
- var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
28
+ const current = this.getValue();
29
+ const newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
45
30
  this.options.converter.toUI(this.options.bindTo[this.options.property]) :
46
31
  this.options.bindTo[this.options.property]);
32
+ val = newVal;
47
33
  if (newVal !== current) {
48
- val = newVal;
49
34
  if (this.currentDom != null) {
50
35
  this.currentDom.checked = val;
51
36
  }
@@ -66,12 +51,12 @@ var CheckBoxComponent = /** @class */ (function () {
66
51
  }
67
52
  }, { tag: "label", content: this.options.label, attr: { for: this.options.id } }]
68
53
  };
69
- };
70
- CheckBoxComponent.prototype.getValue = function () {
54
+ }
55
+ getValue() {
71
56
  var _a;
72
57
  return ((_a = this.currentDom) === null || _a === void 0 ? void 0 : _a.checked) || false;
73
- };
74
- CheckBoxComponent.prototype.setValue = function (val) {
58
+ }
59
+ setValue(val) {
75
60
  var _a;
76
61
  if (this.currentDom != null) {
77
62
  this.currentDom.checked = val;
@@ -79,20 +64,18 @@ var CheckBoxComponent = /** @class */ (function () {
79
64
  if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
80
65
  this.options.bindTo[this.options.property] = ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(val) : val;
81
66
  }
82
- };
83
- CheckBoxComponent.prototype.onCreate = function (node) {
67
+ }
68
+ onCreate(node) {
84
69
  this.currentDom = node.dom.querySelector("input");
85
- };
86
- CheckBoxComponent.prototype.raiseEvent = function (e, node) {
70
+ }
71
+ raiseEvent(e, node) {
87
72
  var _a;
88
73
  if (this.options.enabled) {
89
- var value = node.dom.checked;
74
+ const value = node.dom.checked;
90
75
  if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
91
76
  this.options.bindTo[this.options.property] = ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
92
77
  }
93
78
  this.options.onChange.notify(value);
94
79
  }
95
- };
96
- return CheckBoxComponent;
97
- }());
98
- export { CheckBoxComponent };
80
+ }
81
+ }
@@ -1,22 +1,11 @@
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 { DatePicker } from "../../ui/date.picker";
13
2
  import { date } from "../../core/date";
14
3
  import { helper } from "../../core/helper";
15
4
  import { EventHandler } from "../../interaction/eventhandler";
16
- var DateComponent = /** @class */ (function () {
17
- function DateComponent(options) {
5
+ export class DateComponent {
6
+ constructor(options) {
18
7
  var _a;
19
- this.options = __assign({ enabled: true, id: helper.newDomGuid(), bindMode: "toModel" }, options);
8
+ this.options = { ...{ enabled: true, id: helper.newDomGuid(), bindMode: "toModel" }, ...options };
20
9
  if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
21
10
  this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
22
11
  this.options.converter.toUI(this.options.bindTo[this.options.property]) :
@@ -24,24 +13,20 @@ var DateComponent = /** @class */ (function () {
24
13
  }
25
14
  this.options.onChange = EventHandler.Create(this.options.onChange);
26
15
  }
27
- Object.defineProperty(DateComponent.prototype, "onChange", {
28
- get: function () {
29
- return this.options.onChange;
30
- },
31
- enumerable: false,
32
- configurable: true
33
- });
34
- DateComponent.prototype.render = function () {
16
+ get onChange() {
17
+ return this.options.onChange;
18
+ }
19
+ render() {
35
20
  var _a;
36
- var val = this.options.value;
21
+ let val = this.options.value;
37
22
  if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
38
- var current = this.getValue();
39
- var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
23
+ const current = this.getValue();
24
+ const newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
40
25
  this.options.converter.toUI(this.options.bindTo[this.options.property]) :
41
26
  this.options.bindTo[this.options.property]);
42
- var newValStr = date.format(newVal);
27
+ const newValStr = date.format(newVal);
28
+ val = newVal;
43
29
  if (newValStr !== current) {
44
- val = newVal;
45
30
  if (this.currentDom != null) {
46
31
  this.currentDom.value = newValStr;
47
32
  }
@@ -59,14 +44,14 @@ var DateComponent = /** @class */ (function () {
59
44
  change: this.raiseEvent,
60
45
  }
61
46
  };
62
- };
63
- DateComponent.prototype.getValue = function () {
47
+ }
48
+ getValue() {
64
49
  if (this.currentDom == null) {
65
50
  return "";
66
51
  }
67
52
  return this.currentDom.value;
68
- };
69
- DateComponent.prototype.getValueAsDate = function () {
53
+ }
54
+ getValueAsDate() {
70
55
  if (this.currentDom == null) {
71
56
  return null;
72
57
  }
@@ -74,33 +59,31 @@ var DateComponent = /** @class */ (function () {
74
59
  return this.options.parse(this.currentDom.value);
75
60
  }
76
61
  return date.parse(this.currentDom.value);
77
- };
78
- DateComponent.prototype.getRef = function () {
62
+ }
63
+ getRef() {
79
64
  return this.ref;
80
- };
81
- DateComponent.prototype.onCreate = function (node) {
65
+ }
66
+ onCreate(node) {
82
67
  this.currentDom = node.dom;
83
68
  this.ref = DatePicker(this.currentDom, this.options);
84
- };
85
- DateComponent.prototype.onUpdate = function (node) {
69
+ }
70
+ onUpdate(node) {
86
71
  this.currentDom = node.dom;
87
- };
88
- DateComponent.prototype.onRemove = function () {
72
+ }
73
+ onRemove() {
89
74
  if (this.ref != null) {
90
75
  this.ref.destroy();
91
76
  }
92
- };
93
- DateComponent.prototype.raiseEvent = function (e, node) {
77
+ }
78
+ raiseEvent(e, node) {
94
79
  var _a;
95
80
  if (this.options.enabled) {
96
- var val = date.parse(node.dom.value);
81
+ const val = date.parse(node.dom.value);
97
82
  if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
98
83
  this.options.bindTo[this.options.property] =
99
84
  ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(val) : val;
100
85
  }
101
86
  this.options.onChange.notify(val);
102
87
  }
103
- };
104
- return DateComponent;
105
- }());
106
- export { DateComponent };
88
+ }
89
+ }
@@ -1,25 +1,13 @@
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 "./DateRangeStyle.scss";
13
2
  import { noUiSlider } from "../slider/nouislider";
14
3
  import { DateComponent } from "../date/DateComponent";
15
4
  import { date } from "../../core/date";
16
5
  import { EventHandler } from "../../interaction/eventhandler";
17
- var DateRangeComponent = /** @class */ (function () {
18
- function DateRangeComponent(o) {
19
- var _this = this;
6
+ export class DateRangeComponent {
7
+ constructor(o) {
20
8
  this.State = { currentMin: null, currentMax: null };
21
9
  this.manualChange = false;
22
- this.options = __assign({}, o);
10
+ this.options = { ...o };
23
11
  if (this.options.minValue == null) {
24
12
  this.options.minValue = this.options.min;
25
13
  }
@@ -32,16 +20,16 @@ var DateRangeComponent = /** @class */ (function () {
32
20
  max: this.options.max,
33
21
  value: this.options.minValue,
34
22
  style: "width:6rem;",
35
- onChange: function (val) {
36
- if (_this.manualChange) {
23
+ onChange: (val) => {
24
+ if (this.manualChange) {
37
25
  return;
38
26
  }
39
- _this.manualChange = true;
40
- var min = _this.minDate.getValueAsDate();
41
- var max = _this.maxDate.getValueAsDate();
42
- _this.slider.set([date.getDaysBetween(_this.options.min, min), date.getDaysBetween(_this.options.min, max)]);
43
- _this.manualChange = false;
44
- _this.triggerChange();
27
+ this.manualChange = true;
28
+ const min = this.minDate.getValueAsDate();
29
+ const max = this.maxDate.getValueAsDate();
30
+ this.slider.set([date.getDaysBetween(this.options.min, min), date.getDaysBetween(this.options.min, max)]);
31
+ this.manualChange = false;
32
+ this.triggerChange();
45
33
  }
46
34
  });
47
35
  this.maxDate = new DateComponent({
@@ -49,20 +37,20 @@ var DateRangeComponent = /** @class */ (function () {
49
37
  max: this.options.max,
50
38
  value: this.options.maxValue,
51
39
  style: "width:6rem;text-align:right;",
52
- onChange: function (val) {
53
- if (_this.manualChange) {
40
+ onChange: (val) => {
41
+ if (this.manualChange) {
54
42
  return;
55
43
  }
56
- _this.manualChange = true;
57
- var min = _this.minDate.getValueAsDate();
58
- var max = _this.maxDate.getValueAsDate();
59
- _this.slider.set([date.getDaysBetween(_this.options.min, min), date.getDaysBetween(_this.options.min, max)]);
60
- _this.manualChange = false;
61
- _this.triggerChange();
44
+ this.manualChange = true;
45
+ const min = this.minDate.getValueAsDate();
46
+ const max = this.maxDate.getValueAsDate();
47
+ this.slider.set([date.getDaysBetween(this.options.min, min), date.getDaysBetween(this.options.min, max)]);
48
+ this.manualChange = false;
49
+ this.triggerChange();
62
50
  }
63
51
  });
64
52
  }
65
- DateRangeComponent.prototype.render = function () {
53
+ render() {
66
54
  var _a;
67
55
  return {
68
56
  tag: "div", attr: { style: this.options.style, class: "date-range-comp " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") }, children: [
@@ -79,58 +67,55 @@ var DateRangeComponent = /** @class */ (function () {
79
67
  }
80
68
  ]
81
69
  };
82
- };
83
- DateRangeComponent.prototype.onCreate = function (node) {
84
- var _this = this;
85
- var diffInDays = date.getDaysBetween(this.options.min, this.options.max);
70
+ }
71
+ onCreate(node) {
72
+ const diffInDays = date.getDaysBetween(this.options.min, this.options.max);
86
73
  if (this.options.increment !== "days") {
87
74
  console.warn(" only days as increments are currently supported");
88
75
  }
89
- var min = 0;
90
- var max = diffInDays;
76
+ const min = 0;
77
+ const max = diffInDays;
91
78
  this.slider = noUiSlider.create(node.dom.querySelector(".slider-div"), {
92
79
  start: [date.getDaysBetween(this.options.min, this.options.minValue),
93
80
  date.getDaysBetween(this.options.min, this.options.maxValue)],
94
81
  connect: true,
95
82
  step: 1,
96
83
  range: {
97
- min: min,
98
- max: max
84
+ min,
85
+ max
99
86
  },
100
87
  });
101
- this.slider.on("update", function (values) {
102
- if (_this.manualChange) {
88
+ this.slider.on("update", (values) => {
89
+ if (this.manualChange) {
103
90
  return;
104
91
  }
105
- _this.manualChange = true;
106
- _this.State.currentMin = values[0];
107
- _this.State.currentMax = values[1];
108
- var minVal = date.addDays(_this.options.min, parseFloat(values[0]));
109
- var maxVal = date.addDays(_this.options.min, parseFloat(values[1]));
110
- _this.minDate.getRef().setState({ selectedDate: minVal });
111
- _this.maxDate.getRef().setState({ selectedDate: maxVal });
112
- _this.manualChange = false;
113
- _this.triggerChange();
92
+ this.manualChange = true;
93
+ this.State.currentMin = values[0];
94
+ this.State.currentMax = values[1];
95
+ const minVal = date.addDays(this.options.min, parseFloat(values[0]));
96
+ const maxVal = date.addDays(this.options.min, parseFloat(values[1]));
97
+ this.minDate.getRef().setState({ selectedDate: minVal });
98
+ this.maxDate.getRef().setState({ selectedDate: maxVal });
99
+ this.manualChange = false;
100
+ this.triggerChange();
114
101
  });
115
- };
116
- DateRangeComponent.prototype.onRemove = function () {
102
+ }
103
+ onRemove() {
117
104
  if (this.slider != null) {
118
105
  this.slider.destroy();
119
106
  this.slider = null;
120
107
  }
121
- };
122
- DateRangeComponent.prototype.getMin = function () {
108
+ }
109
+ getMin() {
123
110
  return this.minDate.getValueAsDate();
124
- };
125
- DateRangeComponent.prototype.getMax = function () {
111
+ }
112
+ getMax() {
126
113
  return this.maxDate.getValueAsDate();
127
- };
128
- DateRangeComponent.prototype.triggerChange = function () {
114
+ }
115
+ triggerChange() {
129
116
  this.options.onChange.notify({
130
117
  minValue: this.getMin(),
131
118
  maxValue: this.getMin()
132
119
  });
133
- };
134
- return DateRangeComponent;
135
- }());
136
- export { DateRangeComponent };
120
+ }
121
+ }