jsl-ui 9.28.2 → 9.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/IntervalComponent.js +32 -35
- package/lib/components/auto-suggest/AutoSuggestComponent.js +19 -21
- package/lib/components/button/ButtonComponent.js +13 -30
- package/lib/components/checkbox/CheckBoxComponent.js +22 -39
- package/lib/components/date/DateComponent.js +29 -46
- package/lib/components/date-range/DateRangeComponent.js +48 -63
- package/lib/components/date-time/DateTimeComponent.js +17 -31
- package/lib/components/dialog/DialogComponent.js +75 -134
- package/lib/components/drop-down/DropDownComponent.js +23 -37
- package/lib/components/expander/ExpanderComponent.js +20 -23
- package/lib/components/form-field/FormComponent.js +9 -12
- package/lib/components/form-field/FormFieldComponent.js +28 -30
- package/lib/components/grid/GridComponent.js +46 -52
- package/lib/components/input/InputComponent.js +26 -47
- package/lib/components/loading/LoadingComponent.js +7 -9
- package/lib/components/navigation/NavigationComponent.js +20 -43
- package/lib/components/notification/Notification.js +18 -22
- package/lib/components/number/NumberComponent.js +28 -46
- package/lib/components/overlay/OverlayComponent.js +45 -60
- package/lib/components/progress/ProgressComponent.js +15 -17
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +9 -20
- package/lib/components/select/SelectComponent.js +105 -122
- package/lib/components/select/SelectDDAreaComponent.js +108 -122
- package/lib/components/slider/nouislider.js +1 -1
- package/lib/components/stack-panel/SplitterComponent.js +27 -29
- package/lib/components/stack-panel/StackPanelComponent.js +17 -31
- package/lib/components/tabs/TabsComponent.js +53 -66
- package/lib/components/time/TimeComponent.js +32 -43
- package/lib/components/tree-view/TreeViewComponent.js +13 -16
- package/lib/components/virtual-render/VirtualRenderComponent.js +30 -44
- package/lib/core/culture.js +2 -2
- package/lib/core/date.js +68 -72
- package/lib/core/helper.js +30 -34
- package/lib/core/jq.js +54 -63
- package/lib/core/lang.js +24 -28
- package/lib/core/numeric.js +35 -39
- package/lib/grid/filterDialogs/dateRangeFilter.js +98 -148
- package/lib/grid/filterDialogs/excelFilter.js +205 -271
- package/lib/grid/plugins/ext.overlay.js +9 -9
- package/lib/grid/plugins/slick.cellrangedecorator.js +2 -2
- package/lib/grid/plugins/slick.cellrangeselector.js +1 -1
- package/lib/grid/plugins/slick.cellselectionmodel.js +8 -8
- package/lib/grid/plugins/slick.headerbuttons.js +1 -1
- package/lib/grid/plugins/slick.headermenu.js +1 -1
- package/lib/grid/plugins/slick.rowmovemanager.js +2 -2
- package/lib/grid/plugins/slick.rowselectionmodel.js +1 -1
- package/lib/grid/slick.core.js +1 -1
- package/lib/grid/slick.creator.js +144 -144
- package/lib/grid/slick.dataview.js +127 -138
- package/lib/grid/slick.editors.core.js +1 -1
- package/lib/grid/slick.editors.date.js +2 -2
- package/lib/grid/slick.editors.lookup.js +36 -37
- package/lib/grid/slick.editors.nav.js +1 -1
- package/lib/grid/slick.formatters.js +26 -26
- package/lib/grid/slick.grid.js +163 -166
- package/lib/grid/slick.groupitemmetadataprovider.js +4 -4
- package/lib/grid/slick.tree.js +91 -103
- package/lib/index.js.map +1 -1
- package/lib/interaction/eventhandler.js +20 -23
- package/lib/interaction/moveable.js +76 -90
- package/lib/interaction/resizable.js +58 -72
- package/lib/ui/auto.suggest.js +13 -28
- package/lib/ui/date.picker/lib/fns.js +1 -5
- package/lib/ui/dialog.js +28 -43
- package/lib/ui/drop.down.js +4 -4
- package/lib/ui/number.input.js +8 -19
- package/package.json +1 -1
package/lib/ui/dialog.js
CHANGED
|
@@ -1,69 +1,56 @@
|
|
|
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 "./dialog.css";
|
|
13
|
-
|
|
2
|
+
const defaultOptions = {
|
|
14
3
|
autoOpen: false,
|
|
15
4
|
autoFocus: "input,button,textarea",
|
|
16
5
|
closeOnOverlayClick: true,
|
|
17
6
|
modal: true,
|
|
18
7
|
closeOnEscape: true
|
|
19
8
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _this = this;
|
|
9
|
+
export class JSLDialog {
|
|
10
|
+
constructor(el, options) {
|
|
23
11
|
this.options = options;
|
|
24
12
|
this.overlay = el;
|
|
25
13
|
this.el = el.firstElementChild;
|
|
26
14
|
if (this.options.closeOnOverlayClick) {
|
|
27
|
-
this.overlay.addEventListener("mousedown",
|
|
28
|
-
if (evt.target ===
|
|
29
|
-
|
|
15
|
+
this.overlay.addEventListener("mousedown", (evt) => {
|
|
16
|
+
if (evt.target === this.overlay) {
|
|
17
|
+
this.close();
|
|
30
18
|
}
|
|
31
19
|
});
|
|
32
|
-
this.overlay.addEventListener("touchstart",
|
|
33
|
-
if (evt.target ===
|
|
34
|
-
|
|
20
|
+
this.overlay.addEventListener("touchstart", (evt) => {
|
|
21
|
+
if (evt.target === this.overlay) {
|
|
22
|
+
this.close();
|
|
35
23
|
}
|
|
36
24
|
});
|
|
37
25
|
}
|
|
38
26
|
}
|
|
39
|
-
|
|
40
|
-
var _this = this;
|
|
27
|
+
open(modal) {
|
|
41
28
|
if ((modal !== undefined && !modal) || !this.options.modal) {
|
|
42
29
|
this.overlay.style.background = "transparent";
|
|
43
30
|
this.overlay.style.pointerEvents = "none";
|
|
44
31
|
}
|
|
45
32
|
this.overlay.style.display = "block";
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
const $footer = this.el.querySelector(".dlg-footer");
|
|
34
|
+
const $body = this.el.querySelector(".dlg-body");
|
|
48
35
|
if ($footer != null && $body != null) {
|
|
49
36
|
// TODO ?
|
|
50
37
|
}
|
|
51
38
|
if (this.options.autoFocus) {
|
|
52
|
-
setTimeout(
|
|
53
|
-
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
const firstInput = this.el.querySelector(this.options.autoFocus);
|
|
54
41
|
if (firstInput != null) {
|
|
55
42
|
firstInput.focus();
|
|
56
43
|
}
|
|
57
44
|
}, 0);
|
|
58
45
|
}
|
|
59
46
|
if (this.options.closeOnEscape || this.options.OkOnEnter) {
|
|
60
|
-
this.onKeydownEvent =
|
|
47
|
+
this.onKeydownEvent = (args) => {
|
|
61
48
|
var _a;
|
|
62
|
-
if (args.keyCode === 27 &&
|
|
63
|
-
|
|
49
|
+
if (args.keyCode === 27 && this.options.closeOnEscape) { // escape
|
|
50
|
+
this.close();
|
|
64
51
|
}
|
|
65
|
-
else if (args.keyCode === 13 &&
|
|
66
|
-
|
|
52
|
+
else if (args.keyCode === 13 && this.options.OkOnEnter) { // ok
|
|
53
|
+
const ok_btn = this.el.querySelector(".dlg-ok-btn");
|
|
67
54
|
if (ok_btn != null) {
|
|
68
55
|
(_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
69
56
|
ok_btn.click();
|
|
@@ -75,8 +62,8 @@ var JSLDialog = /** @class */ (function () {
|
|
|
75
62
|
if (this.options.onOpen) {
|
|
76
63
|
this.options.onOpen();
|
|
77
64
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
65
|
+
}
|
|
66
|
+
close() {
|
|
80
67
|
if (this.options.onClose) {
|
|
81
68
|
if (this.options.onClose() === false) {
|
|
82
69
|
return;
|
|
@@ -86,23 +73,21 @@ var JSLDialog = /** @class */ (function () {
|
|
|
86
73
|
if (this.onKeydownEvent != null) {
|
|
87
74
|
document.removeEventListener("keydown", this.onKeydownEvent);
|
|
88
75
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
76
|
+
}
|
|
77
|
+
getOverlay() {
|
|
91
78
|
return this.overlay;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
}());
|
|
95
|
-
export { JSLDialog };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
96
81
|
export function Dialog(input, options) {
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
const o = { ...defaultOptions, ...options };
|
|
83
|
+
let el;
|
|
99
84
|
if (typeof input === "string") {
|
|
100
85
|
el = document.querySelector(input);
|
|
101
86
|
}
|
|
102
87
|
else {
|
|
103
88
|
el = input;
|
|
104
89
|
}
|
|
105
|
-
|
|
90
|
+
const result = new JSLDialog(el, o);
|
|
106
91
|
if (!o.autoOpen) {
|
|
107
92
|
el.style.display = "none";
|
|
108
93
|
}
|
package/lib/ui/drop.down.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import "./drop.down.css";
|
|
8
8
|
import { UILang } from "../core/lang";
|
|
9
|
-
|
|
9
|
+
let Selectr;
|
|
10
10
|
(function () {
|
|
11
11
|
/**
|
|
12
12
|
* Event Emitter
|
|
@@ -341,7 +341,7 @@ var Selectr;
|
|
|
341
341
|
};
|
|
342
342
|
var removeActive = function (container) {
|
|
343
343
|
var items = container.querySelectorAll("li.active");
|
|
344
|
-
for (
|
|
344
|
+
for (let i = 0; i < items.length; i++) {
|
|
345
345
|
items[i].classList.remove("active");
|
|
346
346
|
}
|
|
347
347
|
};
|
|
@@ -1237,7 +1237,7 @@ var Selectr;
|
|
|
1237
1237
|
removeActive(that.tree);
|
|
1238
1238
|
util.addClass(e.target, "active");
|
|
1239
1239
|
that.navIndex = -1;
|
|
1240
|
-
for (
|
|
1240
|
+
for (let idx = 0; idx < that.items.length; idx++) {
|
|
1241
1241
|
if (that.items[idx].dom === e.target) {
|
|
1242
1242
|
that.navIndex = idx;
|
|
1243
1243
|
}
|
|
@@ -2107,6 +2107,6 @@ var Selectr;
|
|
|
2107
2107
|
return option;
|
|
2108
2108
|
};
|
|
2109
2109
|
})();
|
|
2110
|
-
export
|
|
2110
|
+
export let DropDown = function (input, config) {
|
|
2111
2111
|
return new Selectr(input, config);
|
|
2112
2112
|
};
|
package/lib/ui/number.input.js
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
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 "./number.input.css";
|
|
13
2
|
import { numeric } from "../core/numeric";
|
|
14
3
|
import { EventHandler } from "../interaction/eventhandler";
|
|
15
|
-
|
|
4
|
+
const defaultOptions = { format: "0.###", formatOnBlur: true, commitOnEnter: true, placeholder: false, enabled: true };
|
|
16
5
|
export function NumberInput(input, options) {
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
let el;
|
|
7
|
+
const o = { ...defaultOptions, ...options };
|
|
19
8
|
o.onChange = EventHandler.Create(o.onChange);
|
|
20
9
|
if (typeof input === "string") {
|
|
21
10
|
el = document.querySelector(input);
|
|
@@ -43,20 +32,20 @@ export function NumberInput(input, options) {
|
|
|
43
32
|
}
|
|
44
33
|
else {
|
|
45
34
|
if (o.formatOnBlur) {
|
|
46
|
-
el.addEventListener("blur",
|
|
47
|
-
|
|
35
|
+
el.addEventListener("blur", (evt) => {
|
|
36
|
+
const val = numeric.parse(el.value);
|
|
48
37
|
el.value = numeric.format(val, o.format);
|
|
49
38
|
});
|
|
50
39
|
}
|
|
51
40
|
if (o.onChange != null) {
|
|
52
|
-
el.addEventListener("change",
|
|
41
|
+
el.addEventListener("change", (evt) => {
|
|
53
42
|
o.onChange.notify(numeric.parse(el.value));
|
|
54
43
|
});
|
|
55
44
|
}
|
|
56
|
-
el.addEventListener("keydown",
|
|
45
|
+
el.addEventListener("keydown", (evt) => {
|
|
57
46
|
if (evt.which === 13) {
|
|
58
47
|
if (o.formatOnBlur) {
|
|
59
|
-
|
|
48
|
+
const val = numeric.parse(el.value);
|
|
60
49
|
el.value = numeric.format(val, o.format);
|
|
61
50
|
}
|
|
62
51
|
o.onChange.notify(numeric.parse(el.value));
|