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,34 +1,33 @@
1
- var EventHandler = /** @class */ (function () {
2
- function EventHandler(fnc) {
3
- this.handlers = [];
4
- if (fnc != null) {
5
- this.handlers.push(fnc);
6
- }
7
- }
8
- EventHandler.Create = function (click) {
1
+ export class EventHandler {
2
+ static Create(click) {
9
3
  if (click == null) {
10
4
  return new EventHandler();
11
5
  }
12
6
  if (typeof click === "function") {
13
- var res = new EventHandler();
7
+ const res = new EventHandler();
14
8
  res.subscribe(click);
15
9
  return res;
16
10
  }
17
11
  return click;
18
- };
19
- EventHandler.prototype.subscribe = function (fnc) {
12
+ }
13
+ constructor(fnc) {
14
+ this.handlers = [];
15
+ if (fnc != null) {
16
+ this.handlers.push(fnc);
17
+ }
18
+ }
19
+ subscribe(fnc) {
20
20
  this.handlers.push(fnc);
21
- };
22
- EventHandler.prototype.notify = function (val, val2) {
23
- for (var _i = 0, _a = this.handlers; _i < _a.length; _i++) {
24
- var h = _a[_i];
21
+ }
22
+ notify(val, val2) {
23
+ for (const h of this.handlers) {
25
24
  h(val, val2);
26
25
  }
27
- };
28
- EventHandler.prototype.count = function () {
26
+ }
27
+ count() {
29
28
  return this.handlers.length;
30
- };
31
- EventHandler.prototype.unSubscribe = function (fnc) {
29
+ }
30
+ unSubscribe(fnc) {
32
31
  if (this.handlers.indexOf(fnc) >= 0) {
33
32
  this.handlers.splice(this.handlers.indexOf(fnc), 1);
34
33
  }
@@ -36,7 +35,5 @@ var EventHandler = /** @class */ (function () {
36
35
  // TODO? throw exception?
37
36
  console.warn("handler not found in EventHandler.unSubscribe");
38
37
  }
39
- };
40
- return EventHandler;
41
- }());
42
- export { EventHandler };
38
+ }
39
+ }
@@ -1,18 +1,7 @@
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 "./moveable.css";
13
2
  import "../core/polyfills";
14
3
  import { EventHandler } from "./eventhandler";
15
- var defaultOptions = {
4
+ const defaultOptions = {
16
5
  onStart: new EventHandler(),
17
6
  onStop: new EventHandler(),
18
7
  onMove: new EventHandler(),
@@ -20,9 +9,8 @@ var defaultOptions = {
20
9
  moveDelta: 0,
21
10
  containInParent: true
22
11
  };
23
- var MoveableContainer = /** @class */ (function () {
24
- function MoveableContainer(container, options) {
25
- var _this = this;
12
+ export class MoveableContainer {
13
+ constructor(container, options) {
26
14
  this.container = container;
27
15
  this.options = options;
28
16
  this.resizeX = false;
@@ -30,11 +18,11 @@ var MoveableContainer = /** @class */ (function () {
30
18
  this.initialX = null;
31
19
  this.initialY = null;
32
20
  this.startSize = { x: null, y: null };
33
- this.mouseDownContainer = function (evt) {
34
- var target = evt.target;
35
- var directChild = target;
36
- while (directChild.parentElement != null && directChild.parentElement !== _this.container) {
37
- if (_this.options.selector != null && directChild.matches(_this.options.selector)) {
21
+ this.mouseDownContainer = (evt) => {
22
+ const target = evt.target;
23
+ let directChild = target;
24
+ while (directChild.parentElement != null && directChild.parentElement !== this.container) {
25
+ if (this.options.selector != null && directChild.matches(this.options.selector)) {
38
26
  break;
39
27
  }
40
28
  directChild = directChild.parentElement;
@@ -42,112 +30,112 @@ var MoveableContainer = /** @class */ (function () {
42
30
  if (directChild.parentElement == null) {
43
31
  return;
44
32
  }
45
- if (_this.options.selector != null && !directChild.matches(_this.options.selector)) {
33
+ if (this.options.selector != null && !directChild.matches(this.options.selector)) {
46
34
  return;
47
35
  }
48
- _this.element = directChild;
49
- var canceled = false;
50
- var args = {
51
- evt: evt,
52
- target: _this.element,
53
- x: _this.element.offsetLeft,
54
- y: _this.element.offsetTop,
55
- cancelEvent: function () { canceled = true; }
36
+ this.element = directChild;
37
+ let canceled = false;
38
+ const args = {
39
+ evt,
40
+ target: this.element,
41
+ x: this.element.offsetLeft,
42
+ y: this.element.offsetTop,
43
+ cancelEvent: () => { canceled = true; }
56
44
  };
57
- _this.options.onStart.notify(args);
45
+ this.options.onStart.notify(args);
58
46
  if (canceled) {
59
47
  return;
60
48
  }
61
49
  evt.preventDefault();
62
50
  evt.stopPropagation();
63
51
  evt.stopImmediatePropagation();
64
- _this.initialX = _this.extractArg(evt, "clientX") - _this.element.offsetLeft;
65
- _this.initialY = _this.extractArg(evt, "clientY") - _this.element.offsetTop;
52
+ this.initialX = this.extractArg(evt, "clientX") - this.element.offsetLeft;
53
+ this.initialY = this.extractArg(evt, "clientY") - this.element.offsetTop;
66
54
  // register event listeners
67
- window.addEventListener("mousemove", _this.mouseMove, false);
68
- window.addEventListener("mouseup", _this.mouseUp, false);
69
- window.addEventListener("touchmove", _this.mouseMove, false);
70
- window.addEventListener("touchend", _this.mouseUp, false);
55
+ window.addEventListener("mousemove", this.mouseMove, false);
56
+ window.addEventListener("mouseup", this.mouseUp, false);
57
+ window.addEventListener("touchmove", this.mouseMove, false);
58
+ window.addEventListener("touchend", this.mouseUp, false);
71
59
  };
72
- this.mouseMove = function (evt) {
73
- var raiseEvt = false;
74
- var x = 0;
75
- if (_this.resizeX) {
76
- var val = _this.extractArg(evt, "clientX");
77
- if (_this.startSize != null && _this.startSize.x == null) {
78
- _this.startSize.x = val;
60
+ this.mouseMove = (evt) => {
61
+ let raiseEvt = false;
62
+ let x = 0;
63
+ if (this.resizeX) {
64
+ const val = this.extractArg(evt, "clientX");
65
+ if (this.startSize != null && this.startSize.x == null) {
66
+ this.startSize.x = val;
79
67
  }
80
- if (_this.startSize == null || Math.abs(_this.startSize.x - val) >= _this.options.moveDelta) {
68
+ if (this.startSize == null || Math.abs(this.startSize.x - val) >= this.options.moveDelta) {
81
69
  //if (!this.options.gridX || Math.round(val) % this.options.gridX === 0) {
82
- x = val - _this.initialX;
83
- if (_this.options.gridX) {
84
- x = Math.round(x / _this.options.gridX) * _this.options.gridX;
70
+ x = val - this.initialX;
71
+ if (this.options.gridX) {
72
+ x = Math.round(x / this.options.gridX) * this.options.gridX;
85
73
  }
86
- if (_this.options.containInParent) {
74
+ if (this.options.containInParent) {
87
75
  if (x < 0) {
88
76
  x = 0;
89
77
  }
90
- var maxX = _this.container.clientWidth - _this.element.offsetWidth;
78
+ const maxX = this.container.clientWidth - this.element.offsetWidth;
91
79
  if (x > maxX) {
92
80
  x = maxX;
93
81
  }
94
82
  }
95
- _this.element.style.left = x + "px";
83
+ this.element.style.left = x + "px";
96
84
  raiseEvt = true;
97
- _this.startSize = null;
85
+ this.startSize = null;
98
86
  //}
99
87
  }
100
88
  }
101
- var y = 0;
102
- if (_this.resizeY) {
103
- var val = _this.extractArg(evt, "clientY");
104
- if (_this.startSize != null && _this.startSize.y == null) {
105
- _this.startSize.y = val;
89
+ let y = 0;
90
+ if (this.resizeY) {
91
+ const val = this.extractArg(evt, "clientY");
92
+ if (this.startSize != null && this.startSize.y == null) {
93
+ this.startSize.y = val;
106
94
  }
107
- if (_this.startSize == null || Math.abs(_this.startSize.y - val) >= _this.options.moveDelta) {
95
+ if (this.startSize == null || Math.abs(this.startSize.y - val) >= this.options.moveDelta) {
108
96
  //if (!this.options.gridY || Math.round(val) % this.options.gridY === 0) {
109
- y = val - _this.initialY;
110
- if (_this.options.gridY) {
111
- y = Math.round(y / _this.options.gridY) * _this.options.gridY;
97
+ y = val - this.initialY;
98
+ if (this.options.gridY) {
99
+ y = Math.round(y / this.options.gridY) * this.options.gridY;
112
100
  }
113
- if (_this.options.containInParent) {
101
+ if (this.options.containInParent) {
114
102
  if (y < 0) {
115
103
  y = 0;
116
104
  }
117
- var maxY = _this.container.clientHeight - _this.element.offsetHeight;
105
+ const maxY = this.container.clientHeight - this.element.offsetHeight;
118
106
  if (y > maxY) {
119
107
  y = maxY;
120
108
  }
121
109
  }
122
- _this.element.style.top = y + "px";
110
+ this.element.style.top = y + "px";
123
111
  raiseEvt = true;
124
- _this.startSize = null;
112
+ this.startSize = null;
125
113
  //}
126
114
  }
127
115
  }
128
116
  if (raiseEvt) {
129
- _this.options.onMove.notify({
130
- evt: evt,
131
- target: _this.element,
132
- x: x,
133
- y: y,
134
- cancelEvent: function () { }
117
+ this.options.onMove.notify({
118
+ evt,
119
+ target: this.element,
120
+ x,
121
+ y,
122
+ cancelEvent: () => { }
135
123
  });
136
124
  }
137
125
  };
138
- this.mouseUp = function (evt) {
139
- window.removeEventListener("mousemove", _this.mouseMove, false);
140
- window.removeEventListener("mouseup", _this.mouseUp, false);
141
- window.removeEventListener("touchmove", _this.mouseMove, false);
142
- window.removeEventListener("touchend", _this.mouseUp, false);
143
- _this.options.onStop.notify({
144
- evt: evt,
145
- target: _this.element,
146
- x: _this.element.offsetLeft,
147
- y: _this.element.offsetTop,
148
- cancelEvent: function () { }
126
+ this.mouseUp = (evt) => {
127
+ window.removeEventListener("mousemove", this.mouseMove, false);
128
+ window.removeEventListener("mouseup", this.mouseUp, false);
129
+ window.removeEventListener("touchmove", this.mouseMove, false);
130
+ window.removeEventListener("touchend", this.mouseUp, false);
131
+ this.options.onStop.notify({
132
+ evt,
133
+ target: this.element,
134
+ x: this.element.offsetLeft,
135
+ y: this.element.offsetTop,
136
+ cancelEvent: () => { }
149
137
  });
150
- _this.startSize = { x: null, y: null };
138
+ this.startSize = { x: null, y: null };
151
139
  };
152
140
  if (options.direction === "x" || options.direction === "both") {
153
141
  this.resizeX = true;
@@ -157,18 +145,16 @@ var MoveableContainer = /** @class */ (function () {
157
145
  }
158
146
  this.init();
159
147
  }
160
- MoveableContainer.prototype.init = function () {
148
+ init() {
161
149
  this.container.addEventListener("mousedown", this.mouseDownContainer, false);
162
150
  this.container.addEventListener("touchstart", this.mouseDownContainer, false);
163
- };
164
- MoveableContainer.prototype.extractArg = function (evt, key) {
151
+ }
152
+ extractArg(evt, key) {
165
153
  return evt[key] != null ? evt[key] : (evt.touches.length > 0 ? evt.touches : evt.changedTouches)[0][key];
166
- };
167
- return MoveableContainer;
168
- }());
169
- export { MoveableContainer };
154
+ }
155
+ }
170
156
  export function Moveable(selector, options) {
171
157
  return new MoveableContainer(typeof selector === "string" ?
172
158
  document.querySelector(selector) :
173
- selector, __assign(__assign({}, defaultOptions), options));
159
+ selector, { ...defaultOptions, ...options });
174
160
  }
@@ -1,123 +1,109 @@
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 "./resizable.css";
13
2
  import "../core/polyfills";
14
3
  import { EventHandler } from "./eventhandler";
15
- var defaultOptions = {
4
+ const defaultOptions = {
16
5
  resizeHandlePrefix: "rs-",
17
6
  onStart: new EventHandler(),
18
7
  onStop: new EventHandler(),
19
8
  onResize: new EventHandler(),
20
9
  resizeDelta: 0
21
10
  };
22
- var ResizeContainer = /** @class */ (function () {
23
- function ResizeContainer(container, options) {
24
- var _this = this;
11
+ export class ResizeContainer {
12
+ constructor(container, options) {
25
13
  this.container = container;
26
14
  this.options = options;
27
15
  this.startSize = { x: null, y: null };
28
- this.mouseDownContainer = function (evt) {
29
- var target = evt.target;
30
- if ((" " + target.className).indexOf(" " + _this.options.resizeHandlePrefix) < 0) {
16
+ this.mouseDownContainer = (evt) => {
17
+ const target = evt.target;
18
+ if ((" " + target.className).indexOf(" " + this.options.resizeHandlePrefix) < 0) {
31
19
  return; // not a resize handle
32
20
  }
33
21
  evt.preventDefault();
34
22
  evt.stopPropagation();
35
23
  evt.stopImmediatePropagation();
36
- _this.resizeX = target.classList.contains(_this.options.resizeHandlePrefix + "r") ||
37
- target.classList.contains(_this.options.resizeHandlePrefix + "l");
38
- _this.resizeY = target.classList.contains(_this.options.resizeHandlePrefix + "t") ||
39
- target.classList.contains(_this.options.resizeHandlePrefix + "b");
40
- _this.element = target.parentElement; // TODO change to closest class
41
- _this.options.onStart.notify({ evt: evt, target: _this.element, x: _this.extractArg(evt, "pageX"), y: _this.extractArg(evt, "pageY") });
24
+ this.resizeX = target.classList.contains(this.options.resizeHandlePrefix + "r") ||
25
+ target.classList.contains(this.options.resizeHandlePrefix + "l");
26
+ this.resizeY = target.classList.contains(this.options.resizeHandlePrefix + "t") ||
27
+ target.classList.contains(this.options.resizeHandlePrefix + "b");
28
+ this.element = target.parentElement; // TODO change to closest class
29
+ this.options.onStart.notify({ evt, target: this.element, x: this.extractArg(evt, "pageX"), y: this.extractArg(evt, "pageY") });
42
30
  // register event listeners
43
- window.addEventListener("mousemove", _this.mouseMove, false);
44
- window.addEventListener("mouseup", _this.mouseUp, false);
45
- window.addEventListener("touchmove", _this.mouseMove, false);
46
- window.addEventListener("touchend", _this.mouseUp, false);
31
+ window.addEventListener("mousemove", this.mouseMove, false);
32
+ window.addEventListener("mouseup", this.mouseUp, false);
33
+ window.addEventListener("touchmove", this.mouseMove, false);
34
+ window.addEventListener("touchend", this.mouseUp, false);
47
35
  };
48
- this.mouseMove = function (evt) {
49
- var raiseEvt = false;
50
- if (_this.resizeX) {
51
- var val = _this.extractArg(evt, "clientX") - _this.element.getBoundingClientRect().left;
52
- if (_this.options.minWidth && val < _this.options.minWidth) {
53
- val = _this.options.minWidth;
36
+ this.mouseMove = (evt) => {
37
+ let raiseEvt = false;
38
+ if (this.resizeX) {
39
+ let val = this.extractArg(evt, "clientX") - this.element.getBoundingClientRect().left;
40
+ if (this.options.minWidth && val < this.options.minWidth) {
41
+ val = this.options.minWidth;
54
42
  }
55
- else if (_this.options.maxWidth && val > _this.options.maxWidth) {
56
- val = _this.options.maxWidth;
43
+ else if (this.options.maxWidth && val > this.options.maxWidth) {
44
+ val = this.options.maxWidth;
57
45
  }
58
- if (_this.startSize != null && _this.startSize.x == null) {
59
- _this.startSize.x = val;
46
+ if (this.startSize != null && this.startSize.x == null) {
47
+ this.startSize.x = val;
60
48
  }
61
- if (_this.startSize == null || Math.abs(_this.startSize.x - val) >= _this.options.resizeDelta) {
49
+ if (this.startSize == null || Math.abs(this.startSize.x - val) >= this.options.resizeDelta) {
62
50
  // if (!this.options.gridX || Math.round(val) % this.options.gridX === 0) {
63
- if (_this.options.gridX) {
64
- val = Math.round(val / _this.options.gridX) * _this.options.gridX;
51
+ if (this.options.gridX) {
52
+ val = Math.round(val / this.options.gridX) * this.options.gridX;
65
53
  }
66
- _this.element.style.width = Math.round(val) + "px";
54
+ this.element.style.width = Math.round(val) + "px";
67
55
  raiseEvt = true;
68
- _this.startSize = null;
56
+ this.startSize = null;
69
57
  // }
70
58
  }
71
59
  }
72
- if (_this.resizeY) {
73
- var val = _this.extractArg(evt, "clientY") - _this.element.getBoundingClientRect().top;
74
- if (_this.options.minHeight && val < _this.options.minHeight) {
75
- val = _this.options.minHeight;
60
+ if (this.resizeY) {
61
+ let val = this.extractArg(evt, "clientY") - this.element.getBoundingClientRect().top;
62
+ if (this.options.minHeight && val < this.options.minHeight) {
63
+ val = this.options.minHeight;
76
64
  }
77
- else if (_this.options.maxHeight && val > _this.options.maxHeight) {
78
- val = _this.options.maxHeight;
65
+ else if (this.options.maxHeight && val > this.options.maxHeight) {
66
+ val = this.options.maxHeight;
79
67
  }
80
- if (_this.startSize != null && _this.startSize.y == null) {
81
- _this.startSize.y = val;
68
+ if (this.startSize != null && this.startSize.y == null) {
69
+ this.startSize.y = val;
82
70
  }
83
- if (_this.startSize == null || Math.abs(_this.startSize.y - val) >= _this.options.resizeDelta) {
71
+ if (this.startSize == null || Math.abs(this.startSize.y - val) >= this.options.resizeDelta) {
84
72
  // if (!this.options.gridY || Math.round(val) % this.options.gridY === 0) {
85
- if (_this.options.gridY) {
86
- val = Math.round(val / _this.options.gridY) * _this.options.gridY;
73
+ if (this.options.gridY) {
74
+ val = Math.round(val / this.options.gridY) * this.options.gridY;
87
75
  }
88
- _this.element.style.height = Math.round(val) + "px";
76
+ this.element.style.height = Math.round(val) + "px";
89
77
  raiseEvt = true;
90
- _this.startSize = null;
78
+ this.startSize = null;
91
79
  // }
92
80
  }
93
81
  }
94
82
  if (raiseEvt) {
95
- _this.options.onResize.notify({ evt: evt, target: _this.element, x: _this.extractArg(evt, "pageX"), y: _this.extractArg(evt, "pageY") });
83
+ this.options.onResize.notify({ evt, target: this.element, x: this.extractArg(evt, "pageX"), y: this.extractArg(evt, "pageY") });
96
84
  }
97
85
  };
98
- this.mouseUp = function (evt) {
99
- window.removeEventListener("mousemove", _this.mouseMove, false);
100
- window.removeEventListener("mouseup", _this.mouseUp, false);
101
- window.removeEventListener("touchmove", _this.mouseMove, false);
102
- window.removeEventListener("touchend", _this.mouseUp, false);
103
- _this.options.onStop.notify({ evt: evt, target: _this.element, x: _this.extractArg(evt, "pageX"), y: _this.extractArg(evt, "pageY") });
104
- _this.startSize = { x: null, y: null };
86
+ this.mouseUp = (evt) => {
87
+ window.removeEventListener("mousemove", this.mouseMove, false);
88
+ window.removeEventListener("mouseup", this.mouseUp, false);
89
+ window.removeEventListener("touchmove", this.mouseMove, false);
90
+ window.removeEventListener("touchend", this.mouseUp, false);
91
+ this.options.onStop.notify({ evt, target: this.element, x: this.extractArg(evt, "pageX"), y: this.extractArg(evt, "pageY") });
92
+ this.startSize = { x: null, y: null };
105
93
  };
106
94
  this.init();
107
95
  }
108
- ResizeContainer.prototype.init = function () {
96
+ init() {
109
97
  this.container.classList.add("resizable");
110
98
  this.container.addEventListener("mousedown", this.mouseDownContainer, false);
111
99
  this.container.addEventListener("touchstart", this.mouseDownContainer, false);
112
- };
113
- ResizeContainer.prototype.extractArg = function (evt, key) {
100
+ }
101
+ extractArg(evt, key) {
114
102
  return evt[key] != null ? evt[key] : (evt.touches.length > 0 ? evt.touches : evt.changedTouches)[0][key];
115
- };
116
- return ResizeContainer;
117
- }());
118
- export { ResizeContainer };
103
+ }
104
+ }
119
105
  export function Resizable(selector, options) {
120
106
  return new ResizeContainer(typeof selector === "string" ?
121
107
  document.querySelector(selector) :
122
- selector, __assign(__assign({}, defaultOptions), options));
108
+ selector, { ...defaultOptions, ...options });
123
109
  }
@@ -1,16 +1,5 @@
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 "./auto.suggest.css";
13
- var autoComplete = (function () {
2
+ let autoComplete = (function () {
14
3
  function autoComplete(options) {
15
4
  // helpers
16
5
  function hasClass(el, className) { return el.classList.contains(className); }
@@ -23,8 +12,8 @@ var autoComplete = (function () {
23
12
  }
24
13
  function live(elClass, event, cb, context) {
25
14
  addEvent(context || document, event, function (e) {
26
- var found;
27
- var el = e.target || e.srcElement;
15
+ let found;
16
+ let el = e.target || e.srcElement;
28
17
  while (el && !(found = hasClass(el, elClass))) {
29
18
  el = el.parentElement;
30
19
  }
@@ -33,7 +22,7 @@ var autoComplete = (function () {
33
22
  }
34
23
  });
35
24
  }
36
- var o = {
25
+ const o = {
37
26
  selector: "",
38
27
  source: function (val, s) { return []; },
39
28
  minChars: 0,
@@ -50,15 +39,15 @@ var autoComplete = (function () {
50
39
  },
51
40
  onSelect: function (e, term, item) { }
52
41
  };
53
- for (var k in options) {
42
+ for (const k in options) {
54
43
  if (options.hasOwnProperty(k)) {
55
44
  o[k] = options[k];
56
45
  }
57
46
  }
58
47
  // init
59
- var elems = typeof o.selector === 'object' ? [o.selector] : document.querySelectorAll(o.selector);
60
- var _loop_1 = function (i) {
61
- var that = elems[i];
48
+ let elems = typeof o.selector === 'object' ? [o.selector] : document.querySelectorAll(o.selector);
49
+ for (let i = 0; i < elems.length; i++) {
50
+ let that = elems[i];
62
51
  // create suggestions container "sc"
63
52
  that.sc = document.createElement('div');
64
53
  that.sc.className = 'autocomplete-suggestions ' + o.menuClass;
@@ -98,13 +87,13 @@ var autoComplete = (function () {
98
87
  addEvent(window, 'resize', that.updateSC);
99
88
  document.body.appendChild(that.sc);
100
89
  live('autocomplete-suggestion', 'mouseleave', function (e) {
101
- var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
90
+ const sel = that.sc.querySelector('.autocomplete-suggestion.selected');
102
91
  if (sel) {
103
92
  setTimeout(function () { sel.className = sel.className.replace('selected', ''); }, 20);
104
93
  }
105
94
  }, that.sc);
106
95
  live('autocomplete-suggestion', 'mouseover', function (e) {
107
- var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
96
+ const sel = that.sc.querySelector('.autocomplete-suggestion.selected');
108
97
  if (sel) {
109
98
  sel.className = sel.className.replace('selected', '');
110
99
  }
@@ -113,7 +102,7 @@ var autoComplete = (function () {
113
102
  live('autocomplete-suggestion', 'mousedown', function (e) {
114
103
  // window.setTimeout(() => {
115
104
  if (hasClass(this, 'autocomplete-suggestion')) { // else outside click
116
- var v = this.getAttribute('data-val');
105
+ const v = this.getAttribute('data-val');
117
106
  that.value = v;
118
107
  o.onSelect(e, v, this);
119
108
  that.sc.style.display = 'none';
@@ -134,7 +123,7 @@ var autoComplete = (function () {
134
123
  options.onChange(that.value);
135
124
  };
136
125
  addEvent(that, 'input', that.inputHandler);
137
- suggest = function (data) {
126
+ var suggest = function (data) {
138
127
  var val = that.value;
139
128
  that.cache[val] = data;
140
129
  if (data.length && val.length >= o.minChars) {
@@ -227,10 +216,6 @@ var autoComplete = (function () {
227
216
  if (!o.minChars) {
228
217
  addEvent(that, 'focus', that.focusHandler);
229
218
  }
230
- };
231
- var suggest;
232
- for (var i = 0; i < elems.length; i++) {
233
- _loop_1(i);
234
219
  }
235
220
  // public destroy method
236
221
  this.destroy = function () {
@@ -255,5 +240,5 @@ var autoComplete = (function () {
255
240
  return autoComplete;
256
241
  })();
257
242
  export function AutoSuggest(input, opts) {
258
- return new autoComplete(__assign({ selector: input }, opts));
243
+ return new autoComplete({ selector: input, ...opts });
259
244
  }
@@ -26,11 +26,7 @@ export function noop() { }
26
26
  * @params {Object} o2
27
27
  * @returns {Object}
28
28
  */
29
- export function cp() {
30
- var params = [];
31
- for (var _i = 0; _i < arguments.length; _i++) {
32
- params[_i] = arguments[_i];
33
- }
29
+ export function cp(...params) {
34
30
  var args = arguments;
35
31
  var o1 = args[0];
36
32
  for (var i = 1; i < args.length; ++i) {