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,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 { NumberInput } from "../../ui/number.input";
13
2
  import { numeric } from "../../core/numeric";
14
3
  import { helper } from "../../core/helper";
15
4
  import { EventHandler } from "../../interaction/eventhandler";
16
- var NumberComponent = /** @class */ (function () {
17
- function NumberComponent(options) {
5
+ export class NumberComponent {
6
+ constructor(options) {
18
7
  var _a;
19
- this.options = __assign({ onChange: new EventHandler(), bindMode: "toModel" }, options);
8
+ this.options = { ...{ onChange: new EventHandler(), 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]) :
@@ -25,24 +14,20 @@ var NumberComponent = /** @class */ (function () {
25
14
  this.options.onChange = EventHandler.Create(this.options.onChange);
26
15
  this.id = options.id || helper.newDomGuid();
27
16
  }
28
- Object.defineProperty(NumberComponent.prototype, "onChange", {
29
- get: function () {
30
- return this.options.onChange;
31
- },
32
- enumerable: false,
33
- configurable: true
34
- });
35
- NumberComponent.prototype.render = function () {
17
+ get onChange() {
18
+ return this.options.onChange;
19
+ }
20
+ render() {
36
21
  var _a;
37
- var val = this.options.value;
22
+ let val = this.options.value;
38
23
  if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
39
- var current = this.getValue();
40
- var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
24
+ const current = this.getValue();
25
+ const newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
41
26
  this.options.converter.toUI(this.options.bindTo[this.options.property]) :
42
27
  this.options.bindTo[this.options.property]);
43
- var newValStr = numeric.format(newVal, this.options.format);
28
+ const newValStr = numeric.format(newVal, this.options.format);
29
+ val = newVal;
44
30
  if (newValStr !== current) {
45
- val = newVal;
46
31
  if (this.currentDom != null) {
47
32
  this.currentDom.value = newValStr;
48
33
  }
@@ -58,17 +43,17 @@ var NumberComponent = /** @class */ (function () {
58
43
  placeholder: this.options.placeholder
59
44
  }
60
45
  };
61
- };
62
- NumberComponent.prototype.getValue = function () {
46
+ }
47
+ getValue() {
63
48
  if (this.currentDom == null) {
64
49
  return null;
65
50
  }
66
51
  return this.currentDom.value;
67
- };
68
- NumberComponent.prototype.getValueAsNumber = function () {
52
+ }
53
+ getValueAsNumber() {
69
54
  return numeric.parse(this.getValue());
70
- };
71
- NumberComponent.prototype.setValue = function (value) {
55
+ }
56
+ setValue(value) {
72
57
  var _a;
73
58
  this.options.value = value;
74
59
  if (this.currentDom != null) {
@@ -78,21 +63,18 @@ var NumberComponent = /** @class */ (function () {
78
63
  this.options.bindTo[this.options.property] =
79
64
  this.options.bindTo[this.options.property] = ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
80
65
  }
81
- };
82
- NumberComponent.prototype.onCreate = function (node) {
83
- var _this = this;
66
+ }
67
+ onCreate(node) {
84
68
  this.currentDom = node.dom;
85
- var handler = new EventHandler(function (value) {
69
+ const handler = new EventHandler((value) => {
86
70
  var _a;
87
- if (_this.options.bindTo != null && _this.options.bindMode !== "fromModel" && _this.options.property != null) {
88
- if (_this.options.bindTo && _this.options.property) {
89
- _this.options.bindTo[_this.options.property] = ((_a = _this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? _this.options.converter.toData(value) : value;
71
+ if (this.options.bindTo != null && this.options.bindMode !== "fromModel" && this.options.property != null) {
72
+ if (this.options.bindTo && this.options.property) {
73
+ this.options.bindTo[this.options.property] = ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
90
74
  }
91
75
  }
92
- _this.options.onChange.notify(value);
76
+ this.options.onChange.notify(value);
93
77
  });
94
- NumberInput(this.currentDom, __assign(__assign({}, this.options), { onChange: handler }));
95
- };
96
- return NumberComponent;
97
- }());
98
- export { NumberComponent };
78
+ NumberInput(this.currentDom, { ...this.options, onChange: handler });
79
+ }
80
+ }
@@ -1,46 +1,17 @@
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 "./overlay.css";
13
2
  import { JSLRender } from "jsl-render";
14
- var OverlayComponent = /** @class */ (function () {
15
- function OverlayComponent(options) {
16
- var _this = this;
17
- this.closeIcon = {
18
- tag: "div", content: "✖" /*"🗙"*/, attr: {
19
- class: "overl-close-btn", click: function () {
20
- _this.close();
21
- }
22
- }
23
- };
24
- this.options = __assign({ closeOnEscape: true, closeOnOverlayClick: true, showCloseButton: true, direction: "left", animate: true }, options);
25
- if (this.options.closeOnEscape) {
26
- this.onKeydownEvent = document.addEventListener("keydown", function (args) {
27
- if (args.keyCode === 27) { // escape
28
- _this.close();
29
- }
30
- });
31
- }
32
- }
33
- OverlayComponent.show = function (options) {
34
- var container = document.createElement("div");
3
+ export class OverlayComponent {
4
+ static show(options) {
5
+ const container = document.createElement("div");
35
6
  document.body.appendChild(container);
36
- var oldRenderer = JSLRender.lastCreatedRenderer;
37
- var oldLastDlg = OverlayComponent.lastRenderedDlg;
38
- var renderer = new JSLRender(container, oldRenderer != null);
7
+ const oldRenderer = JSLRender.lastCreatedRenderer;
8
+ const oldLastDlg = OverlayComponent.lastRenderedDlg;
9
+ const renderer = new JSLRender(container, oldRenderer != null);
39
10
  if (oldRenderer != null) {
40
11
  JSLRender.lastCreatedRenderer = renderer;
41
12
  }
42
- var o = __assign({}, options);
43
- o.onClose = function () {
13
+ const o = { ...options };
14
+ o.onClose = () => {
44
15
  if (options.onClose) {
45
16
  if (options.onClose() === false) {
46
17
  return;
@@ -53,12 +24,12 @@ var OverlayComponent = /** @class */ (function () {
53
24
  }
54
25
  OverlayComponent.lastRenderedDlg = oldLastDlg;
55
26
  };
56
- var dlg = new OverlayComponent(o);
27
+ const dlg = new OverlayComponent(o);
57
28
  OverlayComponent.lastRenderedDlg = dlg;
58
29
  renderer.render(dlg);
59
30
  return dlg;
60
- };
61
- OverlayComponent.prototype.close = function () {
31
+ }
32
+ close() {
62
33
  if (this.options.onClose) {
63
34
  if (this.options.onClose() === false) {
64
35
  return;
@@ -68,14 +39,31 @@ var OverlayComponent = /** @class */ (function () {
68
39
  if (this.onKeydownEvent != null) {
69
40
  document.removeEventListener("keydown", this.onKeydownEvent);
70
41
  }
71
- };
72
- OverlayComponent.prototype.onCreate = function (node) {
73
- var bodyDom = node.dom.querySelector(".overl-body");
42
+ }
43
+ constructor(options) {
44
+ this.closeIcon = {
45
+ tag: "div", content: "✖" /*"🗙"*/, attr: {
46
+ class: "overl-close-btn", click: () => {
47
+ this.close();
48
+ }
49
+ }
50
+ };
51
+ this.options = { closeOnEscape: true, closeOnOverlayClick: true, showCloseButton: true, direction: "left", animate: true, ...options };
52
+ if (this.options.closeOnEscape) {
53
+ this.onKeydownEvent = document.addEventListener("keydown", (args) => {
54
+ if (args.keyCode === 27) { // escape
55
+ this.close();
56
+ }
57
+ });
58
+ }
59
+ }
60
+ onCreate(node) {
61
+ const bodyDom = node.dom.querySelector(".overl-body");
74
62
  if (bodyDom != null) {
75
63
  if (this.options.direction === "left") {
76
64
  node.dom.style.width = this.options.size;
77
65
  if (this.options.animate) {
78
- var realWidth = bodyDom.getBoundingClientRect().width;
66
+ const realWidth = bodyDom.getBoundingClientRect().width;
79
67
  node.dom.style.left = -realWidth + "px";
80
68
  JSLRender.animate(node, { attr: "left", from: -realWidth + "px", to: "0px", duration: 500, easing: "easeOutSine" });
81
69
  }
@@ -83,7 +71,7 @@ var OverlayComponent = /** @class */ (function () {
83
71
  else {
84
72
  node.dom.style.height = this.options.size;
85
73
  if (this.options.animate) {
86
- var realHeight = bodyDom.getBoundingClientRect().height;
74
+ const realHeight = bodyDom.getBoundingClientRect().height;
87
75
  node.dom.style.top = -realHeight + "px";
88
76
  JSLRender.animate(node, { attr: "top", from: -realHeight + "px", to: "0px", duration: 500, easing: "easeOutSine" });
89
77
  }
@@ -92,10 +80,9 @@ var OverlayComponent = /** @class */ (function () {
92
80
  else {
93
81
  console.error("overl-body class not found");
94
82
  }
95
- };
96
- OverlayComponent.prototype.render = function () {
97
- var _this = this;
98
- var body = this.toNode(this.options.content);
83
+ }
84
+ render() {
85
+ const body = this.toNode(this.options.content);
99
86
  // let styleW = "";
100
87
  // let styleH = "";
101
88
  // if (this.options.width != null) {
@@ -119,11 +106,11 @@ var OverlayComponent = /** @class */ (function () {
119
106
  // const headerStyle = this.options.allowMove ? "cursor:move" : undefined;
120
107
  return {
121
108
  tag: "div", attr: {
122
- class: "jsl-overlay-overlay", click: function (e) {
123
- if (_this.options.closeOnOverlayClick && e.target.classList.contains("jsl-overlay-overlay")) {
124
- _this.close();
109
+ class: "jsl-overlay-overlay", click: (e) => {
110
+ if (this.options.closeOnOverlayClick && e.target.classList.contains("jsl-overlay-overlay")) {
111
+ this.close();
125
112
  }
126
- }, wheel: function (e) {
113
+ }, wheel: (e) => {
127
114
  e.stopImmediatePropagation();
128
115
  e.stopPropagation();
129
116
  }
@@ -137,13 +124,11 @@ var OverlayComponent = /** @class */ (function () {
137
124
  ]
138
125
  // }]
139
126
  };
140
- };
141
- OverlayComponent.prototype.toNode = function (content) {
127
+ }
128
+ toNode(content) {
142
129
  if (typeof content === "string") {
143
- return { tag: "div", content: content };
130
+ return { tag: "div", content };
144
131
  }
145
132
  return content;
146
- };
147
- return OverlayComponent;
148
- }());
149
- export { OverlayComponent };
133
+ }
134
+ }
@@ -1,23 +1,23 @@
1
1
  import "./ProgressStyle.scss";
2
2
  import { numeric } from "../../core/numeric";
3
- var ProgressComponent = /** @class */ (function () {
4
- function ProgressComponent(progress, options) {
3
+ export class ProgressComponent {
4
+ constructor(progress, options) {
5
5
  this.progress = progress;
6
6
  this.options = options;
7
7
  }
8
- ProgressComponent.prototype.isEqual = function (node) {
8
+ isEqual(node) {
9
9
  return this.__proto__ === node.__proto__;
10
- };
11
- ProgressComponent.prototype.render = function () {
10
+ }
11
+ render() {
12
12
  var _a, _b, _c, _d, _e, _f, _g;
13
- var style = "width: " + this.progress + "%";
13
+ let style = "width: " + this.progress + "%";
14
14
  if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.color) {
15
15
  style += ";background:" + this.options.color;
16
16
  }
17
17
  if ((_b = this.options) === null || _b === void 0 ? void 0 : _b.style) {
18
18
  style += ";" + this.options.style;
19
19
  }
20
- var content = "";
20
+ let content = "";
21
21
  if ((_c = this.options) === null || _c === void 0 ? void 0 : _c.showPercent) {
22
22
  content = numeric.format(this.progress, (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.percentFormat) !== null && _e !== void 0 ? _e : "0. %");
23
23
  }
@@ -26,17 +26,15 @@ var ProgressComponent = /** @class */ (function () {
26
26
  attr: { class: "progress-comp " + ((_g = (_f = this.options) === null || _f === void 0 ? void 0 : _f.class) !== null && _g !== void 0 ? _g : "") },
27
27
  children: [{
28
28
  tag: "div",
29
- attr: { class: "bar", style: style },
30
- content: content
29
+ attr: { class: "bar", style },
30
+ content
31
31
  }]
32
32
  };
33
- };
34
- ProgressComponent.prototype.setProgress = function (progress) {
33
+ }
34
+ setProgress(progress) {
35
35
  this.progress = progress;
36
- };
37
- ProgressComponent.prototype.getProgress = function () {
36
+ }
37
+ getProgress() {
38
38
  return this.progress;
39
- };
40
- return ProgressComponent;
41
- }());
42
- export { ProgressComponent };
39
+ }
40
+ }
@@ -1,34 +1,23 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
1
  import "./RibbonMenuStyle.scss";
11
- var RibbonMenuComponent = /** @class */ (function () {
2
+ export class RibbonMenuComponent {
12
3
  // private options: IStackPanelOptions;
13
- function RibbonMenuComponent(groups) {
4
+ constructor(groups) {
14
5
  this.groups = groups;
15
6
  // this.options = {...{orientation: "horizontal", verticalAlign: "stretch"}, ...options};
16
7
  }
17
- RibbonMenuComponent.prototype.isEqual = function (node) {
8
+ isEqual(node) {
18
9
  return this.__proto__ === node.__proto__;
19
- };
20
- RibbonMenuComponent.prototype.render = function () {
10
+ }
11
+ render() {
21
12
  return {
22
13
  tag: "div", attr: { class: "ribbon-menu-comp" },
23
- children: this.groups.map(function (g) {
14
+ children: this.groups.map((g) => {
24
15
  var _a;
25
16
  return {
26
17
  tag: "div", attr: { class: "ribbon-group" },
27
- children: __spreadArray([{ tag: "div", attr: { class: "ribbon-legend" }, content: (_a = g.title) !== null && _a !== void 0 ? _a : "" }], g.children, true)
18
+ children: [{ tag: "div", attr: { class: "ribbon-legend" }, content: (_a = g.title) !== null && _a !== void 0 ? _a : "" }, ...g.children]
28
19
  };
29
20
  })
30
21
  };
31
- };
32
- return RibbonMenuComponent;
33
- }());
34
- export { RibbonMenuComponent };
22
+ }
23
+ }