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
|
@@ -1,14 +1,3 @@
|
|
|
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 { JSLRender } from "jsl-render";
|
|
13
2
|
import { SelectComponent } from "../components/select/SelectComponent";
|
|
14
3
|
import { AutoSuggestComponent } from "../components/auto-suggest/AutoSuggestComponent";
|
|
@@ -29,12 +18,11 @@ export function MultiLookupEditor(args) {
|
|
|
29
18
|
// e.stopImmediatePropagation();
|
|
30
19
|
// }
|
|
31
20
|
});
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
let vl = args.column.valueList;
|
|
22
|
+
let data = [];
|
|
34
23
|
if (vl) {
|
|
35
24
|
if (Array.isArray(vl)) {
|
|
36
|
-
for (
|
|
37
|
-
var element = vl_1[_i];
|
|
25
|
+
for (const element of vl) {
|
|
38
26
|
if (typeof element === "string") {
|
|
39
27
|
data.push({ text: element, value: element });
|
|
40
28
|
}
|
|
@@ -44,7 +32,7 @@ export function MultiLookupEditor(args) {
|
|
|
44
32
|
}
|
|
45
33
|
}
|
|
46
34
|
else {
|
|
47
|
-
for (
|
|
35
|
+
for (const key in vl) {
|
|
48
36
|
if (!vl.hasOwnProperty(key)) {
|
|
49
37
|
continue;
|
|
50
38
|
}
|
|
@@ -55,7 +43,14 @@ export function MultiLookupEditor(args) {
|
|
|
55
43
|
else {
|
|
56
44
|
console.warn("No value list found for column " + args.column.id);
|
|
57
45
|
}
|
|
58
|
-
select = new SelectComponent(
|
|
46
|
+
select = new SelectComponent({
|
|
47
|
+
data,
|
|
48
|
+
dropdownWidth: args.column.width + "px",
|
|
49
|
+
multiple: true,
|
|
50
|
+
style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;",
|
|
51
|
+
openOnEnter: false,
|
|
52
|
+
...args.column.editorOptions
|
|
53
|
+
});
|
|
59
54
|
new JSLRender(args.container).render(select);
|
|
60
55
|
//dropdown = DropDown(input, { data: data, multiple: true, searchable: false, defaultSelected: false });
|
|
61
56
|
};
|
|
@@ -85,8 +80,8 @@ export function MultiLookupEditor(args) {
|
|
|
85
80
|
item[args.column.field] = state;
|
|
86
81
|
};
|
|
87
82
|
this.isValueChanged = function () {
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
const a = defaultValue || [];
|
|
84
|
+
const b = select.getValue() || [];
|
|
90
85
|
return a.toString() !== b.toString();
|
|
91
86
|
};
|
|
92
87
|
this.validate = function () {
|
|
@@ -122,12 +117,11 @@ export function LookupEditor(args) {
|
|
|
122
117
|
};
|
|
123
118
|
this.init = function () {
|
|
124
119
|
// input = document.createElement("div");
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
let vl = args.column.valueList;
|
|
121
|
+
let data = [];
|
|
127
122
|
if (vl) {
|
|
128
123
|
if (Array.isArray(vl)) {
|
|
129
|
-
for (
|
|
130
|
-
var element = vl_2[_i];
|
|
124
|
+
for (const element of vl) {
|
|
131
125
|
if (typeof element === "string") {
|
|
132
126
|
data.push({ text: element, value: element });
|
|
133
127
|
}
|
|
@@ -137,7 +131,7 @@ export function LookupEditor(args) {
|
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
133
|
else {
|
|
140
|
-
for (
|
|
134
|
+
for (const key in vl) {
|
|
141
135
|
if (!vl.hasOwnProperty(key)) {
|
|
142
136
|
continue;
|
|
143
137
|
}
|
|
@@ -149,14 +143,20 @@ export function LookupEditor(args) {
|
|
|
149
143
|
console.warn("No value list found for column " + args.column.id);
|
|
150
144
|
}
|
|
151
145
|
// args.container.appendChild(input);
|
|
152
|
-
dropdown = new SelectComponent(
|
|
146
|
+
dropdown = new SelectComponent({
|
|
147
|
+
data,
|
|
148
|
+
dropdownWidth: args.column.width + "px",
|
|
149
|
+
style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;",
|
|
150
|
+
openOnEnter: false,
|
|
153
151
|
// onAppend: (dom) => {
|
|
154
152
|
// (args.grid as ISlickGrid<any>).getContainerNode().appendChild(dom);
|
|
155
153
|
// },
|
|
156
|
-
onChange:
|
|
154
|
+
onChange: (e) => {
|
|
157
155
|
args.commitChangesOnly();
|
|
158
156
|
// args.grid.getEditorLock().commitChangesOnly();
|
|
159
|
-
}
|
|
157
|
+
},
|
|
158
|
+
...args.column.editorOptions
|
|
159
|
+
});
|
|
160
160
|
//dropdown = DropDown(input, { ...{ data, searchable: false, defaultSelected: false, pagination: 100 }, ...args.column.editorOptions });
|
|
161
161
|
new JSLRender(args.container, false).render(dropdown);
|
|
162
162
|
// dropdown.show();
|
|
@@ -173,7 +173,7 @@ export function LookupEditor(args) {
|
|
|
173
173
|
};
|
|
174
174
|
this.position = function (position) {
|
|
175
175
|
if (dropdown.isExpanded() && reposition) {
|
|
176
|
-
|
|
176
|
+
const dd = document.querySelector(".sel-comp-dd");
|
|
177
177
|
if (dd.classList.contains("sel-comp-dd-up")) {
|
|
178
178
|
dd.style.top = (position.top - dd.getBoundingClientRect().height) + "px";
|
|
179
179
|
}
|
|
@@ -243,12 +243,11 @@ export function AutoSuggestEditor(args) {
|
|
|
243
243
|
};
|
|
244
244
|
this.init = function () {
|
|
245
245
|
// input = document.createElement("div");
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
let vl = args.column.valueList;
|
|
247
|
+
let data = [];
|
|
248
248
|
if (vl) {
|
|
249
249
|
if (Array.isArray(vl)) {
|
|
250
|
-
for (
|
|
251
|
-
var element = vl_3[_i];
|
|
250
|
+
for (const element of vl) {
|
|
252
251
|
if (typeof element === "string") {
|
|
253
252
|
data.push({ text: element, value: element });
|
|
254
253
|
}
|
|
@@ -258,7 +257,7 @@ export function AutoSuggestEditor(args) {
|
|
|
258
257
|
}
|
|
259
258
|
}
|
|
260
259
|
else {
|
|
261
|
-
for (
|
|
260
|
+
for (const key in vl) {
|
|
262
261
|
if (!vl.hasOwnProperty(key)) {
|
|
263
262
|
continue;
|
|
264
263
|
}
|
|
@@ -281,11 +280,11 @@ export function AutoSuggestEditor(args) {
|
|
|
281
280
|
// });
|
|
282
281
|
dropdown = new AutoSuggestComponent({
|
|
283
282
|
style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;box-sizing:border-box;",
|
|
284
|
-
source:
|
|
285
|
-
|
|
286
|
-
suggest(data.filter(
|
|
283
|
+
source: (val, suggest) => {
|
|
284
|
+
const term = (val || "").toLowerCase();
|
|
285
|
+
suggest(data.filter((x) => {
|
|
287
286
|
return term === "" || x.text.toLowerCase().indexOf(term) >= 0;
|
|
288
|
-
}).map(
|
|
287
|
+
}).map((x) => x.text));
|
|
289
288
|
},
|
|
290
289
|
cache: false
|
|
291
290
|
});
|
|
@@ -15,34 +15,34 @@ function escapeHTMLChars(text) {
|
|
|
15
15
|
}
|
|
16
16
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export let EmptyFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
19
19
|
return "";
|
|
20
20
|
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
21
|
+
export let ComponentFormatter = EmptyFormatter;
|
|
22
|
+
export let YesNoFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
23
23
|
return value ? "Yes" : "No";
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export let CheckboxFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
26
26
|
return '<div style="text-align:center">' + (value ? "✔" : "-") + '</div>'; // ❌
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export let CheckmarkFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
29
29
|
return value ? "✔" : "";
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export let NumericFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
32
32
|
return {
|
|
33
33
|
addClasses: ["right"],
|
|
34
34
|
text: numeric.format(value, columnDef.format)
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export let DateFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
38
38
|
return date.format(value, columnDef.format);
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export let HtmlFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
41
41
|
return value || "";
|
|
42
42
|
};
|
|
43
|
-
export
|
|
43
|
+
export let LookupFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
44
44
|
var _a;
|
|
45
|
-
|
|
45
|
+
let vl = columnDef.valueList;
|
|
46
46
|
if (vl) {
|
|
47
47
|
if (Array.isArray(vl)) {
|
|
48
48
|
if (vl.length > 0) {
|
|
@@ -50,8 +50,8 @@ export var LookupFormatter = function (row, cell, value, columnDef, dataContext)
|
|
|
50
50
|
return escapeHTMLChars(vl.indexOf(value) >= 0 ? value : ""); //TODO: desired?
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
|
|
54
|
-
return escapeHTMLChars((_a = vlList.filter(
|
|
53
|
+
const vlList = vl;
|
|
54
|
+
return escapeHTMLChars((_a = vlList.filter((x) => x.value === value)[0]) === null || _a === void 0 ? void 0 : _a.text);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
@@ -67,12 +67,12 @@ export var LookupFormatter = function (row, cell, value, columnDef, dataContext)
|
|
|
67
67
|
}
|
|
68
68
|
return escapeHTMLChars(value);
|
|
69
69
|
};
|
|
70
|
-
export
|
|
70
|
+
export let MultiLookupFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
71
71
|
if (value == null || value.length === 0) {
|
|
72
72
|
return "";
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const vl = columnDef.valueList;
|
|
75
|
+
let result = "";
|
|
76
76
|
if (vl == null) {
|
|
77
77
|
console.warn("No values list found for column " + columnDef.id);
|
|
78
78
|
return result;
|
|
@@ -80,20 +80,20 @@ export var MultiLookupFormatter = function (row, cell, value, columnDef, dataCon
|
|
|
80
80
|
if (Array.isArray(vl)) {
|
|
81
81
|
if (vl.length > 0) {
|
|
82
82
|
if (typeof (vl[0]) === "string") {
|
|
83
|
-
result = value.filter(
|
|
83
|
+
result = value.filter((v) => vl.indexOf(v) >= 0).join(", ");
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
|
-
|
|
87
|
-
result = vlList.filter(
|
|
86
|
+
const vlList = vl;
|
|
87
|
+
result = vlList.filter((x) => value.indexOf(x.value) >= 0).map((x) => { var _a; return (_a = x.text) !== null && _a !== void 0 ? _a : ""; }).join(", ");
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
|
-
result = value.map(
|
|
92
|
+
result = value.map((v) => vl[v]).filter((v) => v != null).join(", ");
|
|
93
93
|
}
|
|
94
94
|
return result || "";
|
|
95
95
|
};
|
|
96
|
-
export
|
|
96
|
+
export let TextFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
97
97
|
if (value == null) {
|
|
98
98
|
return "";
|
|
99
99
|
}
|
|
@@ -108,16 +108,16 @@ export var TextFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
|
108
108
|
// return " " + escapeHTMLChars(value + "");
|
|
109
109
|
// }
|
|
110
110
|
// };
|
|
111
|
-
export
|
|
111
|
+
export let TooltipFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
112
112
|
if (value == null) {
|
|
113
113
|
return "";
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
|
|
116
|
+
const result = escapeHTMLChars(value + "");
|
|
117
117
|
return { text: result, toolTip: result };
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
export
|
|
120
|
+
export let MultiLineTextFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
121
121
|
var txt = "";
|
|
122
122
|
if (value != null) {
|
|
123
123
|
txt = escapeHTMLChars(value + "");
|
|
@@ -132,13 +132,13 @@ function pad(nr) {
|
|
|
132
132
|
return nr.toString();
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
export
|
|
135
|
+
export let TimeFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
136
136
|
return value ? (pad(value.getHours()) + ":" + pad(value.getMinutes())) : "";
|
|
137
137
|
};
|
|
138
|
-
export
|
|
138
|
+
export let DateTimeFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
139
139
|
return DateFormatter(row, cell, value, columnDef, dataContext) + " " +
|
|
140
140
|
TimeFormatter(row, cell, value, columnDef, dataContext);
|
|
141
141
|
};
|
|
142
|
-
export
|
|
142
|
+
export let ButtonFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
143
143
|
return "<button class='grid-btn'>...</button>";
|
|
144
144
|
};
|