jsl-ui 9.18.2 → 9.18.3
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/grid.css +0 -8
- package/lib/index.css.map +1 -1
- package/lib/index.js +10198 -61
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/IntervalComponent.d.ts +0 -17
- package/lib/components/IntervalComponent.js +0 -68
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +0 -22
- package/lib/components/auto-suggest/AutoSuggestComponent.js +0 -49
- package/lib/components/button/ButtonComponent.d.ts +0 -18
- package/lib/components/button/ButtonComponent.js +0 -46
- package/lib/components/checkbox/CheckBoxComponent.d.ts +0 -28
- package/lib/components/checkbox/CheckBoxComponent.js +0 -94
- package/lib/components/checkbox/CheckBoxStyle.scss +0 -86
- package/lib/components/date/DateComponent.d.ts +0 -32
- package/lib/components/date/DateComponent.js +0 -106
- package/lib/components/date-range/DateRangeComponent.d.ts +0 -35
- package/lib/components/date-range/DateRangeComponent.js +0 -136
- package/lib/components/date-range/DateRangeStyle.scss +0 -12
- package/lib/components/date-time/DateTimeComponent.d.ts +0 -15
- package/lib/components/date-time/DateTimeComponent.js +0 -53
- package/lib/components/date-time/DateTimeStyle.scss +0 -7
- package/lib/components/dialog/DialogComponent.d.ts +0 -67
- package/lib/components/dialog/DialogComponent.js +0 -242
- package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
- package/lib/components/drop-down/DropDownComponent.js +0 -74
- package/lib/components/expander/ExpanderComponent.d.ts +0 -27
- package/lib/components/expander/ExpanderComponent.js +0 -90
- package/lib/components/expander/ExpanderStyle.scss +0 -47
- package/lib/components/expander/OldExpanderStyle.scss +0 -37
- package/lib/components/form-field/FormComponent.d.ts +0 -12
- package/lib/components/form-field/FormComponent.js +0 -26
- package/lib/components/form-field/FormFieldComponent.d.ts +0 -38
- package/lib/components/form-field/FormFieldComponent.js +0 -139
- package/lib/components/form-field/FormFieldStyle.scss +0 -87
- package/lib/components/grid/GridComponent.d.ts +0 -26
- package/lib/components/grid/GridComponent.js +0 -116
- package/lib/components/input/InputComponent.d.ts +0 -33
- package/lib/components/input/InputComponent.js +0 -144
- package/lib/components/loading/LoadingComponent.d.ts +0 -8
- package/lib/components/loading/LoadingComponent.js +0 -22
- package/lib/components/loading/LoadingStyle.css +0 -29
- package/lib/components/navigation/NavigationComponent.d.ts +0 -34
- package/lib/components/navigation/NavigationComponent.js +0 -70
- package/lib/components/navigation/NavigationStyle.scss +0 -226
- package/lib/components/notification/Notification.d.ts +0 -17
- package/lib/components/notification/Notification.js +0 -56
- package/lib/components/notification/Notification.scss +0 -19
- package/lib/components/number/NumberComponent.d.ts +0 -25
- package/lib/components/number/NumberComponent.js +0 -87
- package/lib/components/overlay/OverlayComponent.d.ts +0 -27
- package/lib/components/overlay/OverlayComponent.js +0 -149
- package/lib/components/overlay/overlay.css +0 -57
- package/lib/components/progress/ProgressComponent.d.ts +0 -18
- package/lib/components/progress/ProgressComponent.js +0 -42
- package/lib/components/progress/ProgressStyle.scss +0 -15
- package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +0 -12
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +0 -34
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +0 -76
- package/lib/components/select/SelectComponent.d.ts +0 -79
- package/lib/components/select/SelectComponent.js +0 -362
- package/lib/components/select/SelectDDAreaComponent.d.ts +0 -32
- package/lib/components/select/SelectDDAreaComponent.js +0 -317
- package/lib/components/select/SelectStyle.scss +0 -187
- package/lib/components/slider/nouislider.css +0 -310
- package/lib/components/slider/nouislider.d.ts +0 -44
- package/lib/components/slider/nouislider.js +0 -2158
- package/lib/components/stack-panel/SplitterComponent.d.ts +0 -21
- package/lib/components/stack-panel/SplitterComponent.js +0 -126
- package/lib/components/stack-panel/SplitterStyle.scss +0 -45
- package/lib/components/stack-panel/StackPanelComponent.d.ts +0 -20
- package/lib/components/stack-panel/StackPanelComponent.js +0 -64
- package/lib/components/stack-panel/StackPanelStyle.scss +0 -53
- package/lib/components/tabs/TabsComponent.d.ts +0 -39
- package/lib/components/tabs/TabsComponent.js +0 -177
- package/lib/components/tabs/TabsStyle.scss +0 -76
- package/lib/components/time/TimeComponent.d.ts +0 -29
- package/lib/components/time/TimeComponent.js +0 -113
- package/lib/components/time/TimeComponent.scss +0 -4
- package/lib/components/tree-view/TreeViewComponent.d.ts +0 -23
- package/lib/components/tree-view/TreeViewComponent.js +0 -45
- package/lib/components/tree-view/TreeViewStyle.scss +0 -96
- package/lib/components/virtual-render/VirtualRenderComponent.d.ts +0 -30
- package/lib/components/virtual-render/VirtualRenderComponent.js +0 -104
- package/lib/components/virtual-render/VirtualRenderStyle.scss +0 -9
- package/lib/core/culture.d.ts +0 -5
- package/lib/core/culture.js +0 -385
- package/lib/core/date.d.ts +0 -14
- package/lib/core/date.js +0 -350
- package/lib/core/helper.d.ts +0 -12
- package/lib/core/helper.js +0 -101
- package/lib/core/jq.d.ts +0 -37
- package/lib/core/jq.js +0 -371
- package/lib/core/lang.d.ts +0 -24
- package/lib/core/lang.js +0 -28
- package/lib/core/numeric.d.ts +0 -7
- package/lib/core/numeric.js +0 -143
- package/lib/core/polyfills.d.ts +0 -0
- package/lib/core/polyfills.js +0 -22
- package/lib/core.d.ts +0 -6
- package/lib/core.js +0 -6
- package/lib/grid/controls/slick.columnpicker.css +0 -46
- package/lib/grid/controls/slick.draggablegrouping.css +0 -52
- package/lib/grid/controls/slick.gridmenu.css +0 -127
- package/lib/grid/controls/slick.pager.css +0 -41
- package/lib/grid/examples/examples.css +0 -203
- package/lib/grid/filterDialogs/dateRangeFilter.d.ts +0 -7
- package/lib/grid/filterDialogs/dateRangeFilter.js +0 -156
- package/lib/grid/filterDialogs/excelFilter.d.ts +0 -9
- package/lib/grid/filterDialogs/excelFilter.js +0 -313
- package/lib/grid/plugins/ext.overlay.css +0 -28
- package/lib/grid/plugins/ext.overlay.d.ts +0 -2
- package/lib/grid/plugins/ext.overlay.js +0 -291
- package/lib/grid/plugins/slick.cellrangedecorator.d.ts +0 -12
- package/lib/grid/plugins/slick.cellrangedecorator.js +0 -68
- package/lib/grid/plugins/slick.cellrangeselector.d.ts +0 -1
- package/lib/grid/plugins/slick.cellrangeselector.js +0 -144
- package/lib/grid/plugins/slick.cellselectionmodel.d.ts +0 -1
- package/lib/grid/plugins/slick.cellselectionmodel.js +0 -194
- package/lib/grid/plugins/slick.headerbuttons.css +0 -40
- package/lib/grid/plugins/slick.headerbuttons.d.ts +0 -55
- package/lib/grid/plugins/slick.headerbuttons.js +0 -156
- package/lib/grid/plugins/slick.headermenu.css +0 -101
- package/lib/grid/plugins/slick.headermenu.d.ts +0 -74
- package/lib/grid/plugins/slick.headermenu.js +0 -260
- package/lib/grid/plugins/slick.rowdetailview.css +0 -37
- package/lib/grid/plugins/slick.rowmovemanager.css +0 -8
- package/lib/grid/plugins/slick.rowmovemanager.d.ts +0 -18
- package/lib/grid/plugins/slick.rowmovemanager.js +0 -249
- package/lib/grid/plugins/slick.rowselectionmodel.d.ts +0 -1
- package/lib/grid/plugins/slick.rowselectionmodel.js +0 -167
- package/lib/grid/slick-default-theme.css +0 -154
- package/lib/grid/slick.core.d.ts +0 -90
- package/lib/grid/slick.core.js +0 -574
- package/lib/grid/slick.creator.d.ts +0 -80
- package/lib/grid/slick.creator.js +0 -723
- package/lib/grid/slick.dataview.d.ts +0 -71
- package/lib/grid/slick.dataview.js +0 -1080
- package/lib/grid/slick.editors.core.d.ts +0 -4
- package/lib/grid/slick.editors.core.js +0 -232
- package/lib/grid/slick.editors.date.d.ts +0 -2
- package/lib/grid/slick.editors.date.js +0 -125
- package/lib/grid/slick.editors.lookup.d.ts +0 -14
- package/lib/grid/slick.editors.lookup.js +0 -353
- package/lib/grid/slick.editors.nav.d.ts +0 -6
- package/lib/grid/slick.editors.nav.js +0 -22
- package/lib/grid/slick.formatters.d.ts +0 -17
- package/lib/grid/slick.formatters.js +0 -137
- package/lib/grid/slick.grid.css +0 -325
- package/lib/grid/slick.grid.d.ts +0 -284
- package/lib/grid/slick.grid.js +0 -5395
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +0 -39
- package/lib/grid/slick.groupitemmetadataprovider.js +0 -165
- package/lib/grid/slick.tree.css +0 -20
- package/lib/grid/slick.tree.d.ts +0 -33
- package/lib/grid/slick.tree.js +0 -220
- package/lib/grid.d.ts +0 -13
- package/lib/grid.js +0 -13
- package/lib/index.css +0 -2584
- package/lib/index.d.ts +0 -56
- package/lib/interaction/dataconverter.d.ts +0 -4
- package/lib/interaction/dataconverter.js +0 -1
- package/lib/interaction/eventhandler.d.ts +0 -13
- package/lib/interaction/eventhandler.js +0 -42
- package/lib/interaction/moveable.css +0 -0
- package/lib/interaction/moveable.d.ts +0 -39
- package/lib/interaction/moveable.js +0 -172
- package/lib/interaction/resizable.css +0 -33
- package/lib/interaction/resizable.d.ts +0 -37
- package/lib/interaction/resizable.js +0 -123
- package/lib/ui/auto.suggest.css +0 -14
- package/lib/ui/auto.suggest.d.ts +0 -17
- package/lib/ui/auto.suggest.js +0 -255
- package/lib/ui/base.css +0 -150
- package/lib/ui/date.picker/css/date-range-picker.css +0 -87
- package/lib/ui/date.picker/css/tiny-date-picker.css +0 -326
- package/lib/ui/date.picker/date-picker-options.d.ts +0 -11
- package/lib/ui/date.picker/date-picker-options.js +0 -76
- package/lib/ui/date.picker/lib/date-manip.d.ts +0 -74
- package/lib/ui/date.picker/lib/date-manip.js +0 -120
- package/lib/ui/date.picker/lib/dom.d.ts +0 -23
- package/lib/ui/date.picker/lib/dom.js +0 -28
- package/lib/ui/date.picker/lib/emitter.d.ts +0 -13
- package/lib/ui/date.picker/lib/emitter.js +0 -49
- package/lib/ui/date.picker/lib/fns.d.ts +0 -23
- package/lib/ui/date.picker/lib/fns.js +0 -43
- package/lib/ui/date.picker/mode/base-mode.d.ts +0 -26
- package/lib/ui/date.picker/mode/base-mode.js +0 -248
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +0 -28
- package/lib/ui/date.picker/mode/dropdown-mode.js +0 -50
- package/lib/ui/date.picker/mode/index.d.ts +0 -28
- package/lib/ui/date.picker/mode/index.js +0 -18
- package/lib/ui/date.picker/mode/modal-mode.d.ts +0 -25
- package/lib/ui/date.picker/mode/modal-mode.js +0 -17
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +0 -29
- package/lib/ui/date.picker/mode/permanent-mode.js +0 -19
- package/lib/ui/date.picker/views/day-picker.d.ts +0 -40
- package/lib/ui/date.picker/views/day-picker.js +0 -155
- package/lib/ui/date.picker/views/month-picker.d.ts +0 -26
- package/lib/ui/date.picker/views/month-picker.js +0 -65
- package/lib/ui/date.picker/views/year-picker.d.ts +0 -20
- package/lib/ui/date.picker/views/year-picker.js +0 -66
- package/lib/ui/date.picker.d.ts +0 -66
- package/lib/ui/date.picker.js +0 -32
- package/lib/ui/dialog.css +0 -109
- package/lib/ui/dialog.d.ts +0 -22
- package/lib/ui/dialog.js +0 -113
- package/lib/ui/drop.down.css +0 -472
- package/lib/ui/drop.down.d.ts +0 -52
- package/lib/ui/drop.down.js +0 -2112
- package/lib/ui/number.input.css +0 -3
- package/lib/ui/number.input.d.ts +0 -12
- package/lib/ui/number.input.js +0 -64
- package/lib/ui/tabs.css +0 -53
|
@@ -1,353 +0,0 @@
|
|
|
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
|
-
import { JSLRender } from "jsl-render";
|
|
13
|
-
import { SelectComponent } from "../components/select/SelectComponent";
|
|
14
|
-
import { AutoSuggestComponent } from "../components/auto-suggest/AutoSuggestComponent";
|
|
15
|
-
/*
|
|
16
|
-
* Contains extended SlickGrid editors.
|
|
17
|
-
*/
|
|
18
|
-
export function MultiLookupEditor(args) {
|
|
19
|
-
var select;
|
|
20
|
-
var defaultValue;
|
|
21
|
-
// var scope = this;
|
|
22
|
-
this.init = function () {
|
|
23
|
-
// input = document.createElement("select");
|
|
24
|
-
args.container.addEventListener("keydown", function (e) {
|
|
25
|
-
if (e.which === 38 || e.which === 40) {
|
|
26
|
-
e.stopImmediatePropagation();
|
|
27
|
-
}
|
|
28
|
-
// if (e.which === 13) {
|
|
29
|
-
// e.stopImmediatePropagation();
|
|
30
|
-
// }
|
|
31
|
-
});
|
|
32
|
-
var vl = args.column.valueList;
|
|
33
|
-
var data = [];
|
|
34
|
-
if (vl) {
|
|
35
|
-
if (Array.isArray(vl)) {
|
|
36
|
-
for (var _i = 0, vl_1 = vl; _i < vl_1.length; _i++) {
|
|
37
|
-
var element = vl_1[_i];
|
|
38
|
-
if (typeof element === "string") {
|
|
39
|
-
data.push({ text: element, value: element });
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
data.push(element);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
for (var key in vl) {
|
|
48
|
-
if (!vl.hasOwnProperty(key)) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
data.push({ text: vl[key], value: key });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
console.warn("No value list found for column " + args.column.id);
|
|
57
|
-
}
|
|
58
|
-
select = new SelectComponent(__assign({ data: data, dropdownWidth: args.column.width + "px", multiple: true, style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;", openOnEnter: false }, args.column.editorOptions));
|
|
59
|
-
new JSLRender(args.container).render(select);
|
|
60
|
-
//dropdown = DropDown(input, { data: data, multiple: true, searchable: false, defaultSelected: false });
|
|
61
|
-
};
|
|
62
|
-
this.destroy = function () {
|
|
63
|
-
// TODO ? - or not?
|
|
64
|
-
// dropdown.destroy();
|
|
65
|
-
// input.parentElement.removeChild(input);
|
|
66
|
-
};
|
|
67
|
-
this.focus = function () {
|
|
68
|
-
select.show();
|
|
69
|
-
};
|
|
70
|
-
this.getValue = function () {
|
|
71
|
-
return select.getValue();
|
|
72
|
-
};
|
|
73
|
-
this.setValue = function (val) {
|
|
74
|
-
select.setValue(val);
|
|
75
|
-
};
|
|
76
|
-
this.loadValue = function (item) {
|
|
77
|
-
defaultValue = item[args.column.field] || [];
|
|
78
|
-
select.setValue(defaultValue);
|
|
79
|
-
setTimeout(function () { select.show(); }, 1);
|
|
80
|
-
};
|
|
81
|
-
this.serializeValue = function () {
|
|
82
|
-
return select.getValue();
|
|
83
|
-
};
|
|
84
|
-
this.applyValue = function (item, state) {
|
|
85
|
-
item[args.column.field] = state;
|
|
86
|
-
};
|
|
87
|
-
this.isValueChanged = function () {
|
|
88
|
-
var a = defaultValue || [];
|
|
89
|
-
var b = select.getValue() || [];
|
|
90
|
-
return a.toString() !== b.toString();
|
|
91
|
-
};
|
|
92
|
-
this.validate = function () {
|
|
93
|
-
if (args.column.validator) {
|
|
94
|
-
var validationResults = args.column.validator(select.getValue());
|
|
95
|
-
if (!validationResults.valid) {
|
|
96
|
-
return validationResults;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
valid: true,
|
|
101
|
-
msg: null
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
this.init();
|
|
105
|
-
}
|
|
106
|
-
export function LookupEditor(args) {
|
|
107
|
-
// var input: HTMLDivElement;
|
|
108
|
-
var dropdown;
|
|
109
|
-
var defaultValue;
|
|
110
|
-
var scope = this;
|
|
111
|
-
var reposition = true;
|
|
112
|
-
this.keyCaptureList = function (which) {
|
|
113
|
-
if (which === 13) {
|
|
114
|
-
dropdown.show();
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
if (which === 38 || which === 40) {
|
|
118
|
-
if (dropdown.isExpanded()) {
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
this.init = function () {
|
|
124
|
-
// input = document.createElement("div");
|
|
125
|
-
var vl = args.column.valueList;
|
|
126
|
-
var data = [];
|
|
127
|
-
if (vl) {
|
|
128
|
-
if (Array.isArray(vl)) {
|
|
129
|
-
for (var _i = 0, vl_2 = vl; _i < vl_2.length; _i++) {
|
|
130
|
-
var element = vl_2[_i];
|
|
131
|
-
if (typeof element === "string") {
|
|
132
|
-
data.push({ text: element, value: element });
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
data.push(element);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
for (var key in vl) {
|
|
141
|
-
if (!vl.hasOwnProperty(key)) {
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
data.push({ text: vl[key], value: key });
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
console.warn("No value list found for column " + args.column.id);
|
|
150
|
-
}
|
|
151
|
-
// args.container.appendChild(input);
|
|
152
|
-
dropdown = new SelectComponent(__assign({ data: data, dropdownWidth: args.column.width + "px", style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;", openOnEnter: false,
|
|
153
|
-
// onAppend: (dom) => {
|
|
154
|
-
// (args.grid as ISlickGrid<any>).getContainerNode().appendChild(dom);
|
|
155
|
-
// },
|
|
156
|
-
onChange: function (e) {
|
|
157
|
-
args.commitChangesOnly();
|
|
158
|
-
// args.grid.getEditorLock().commitChangesOnly();
|
|
159
|
-
} }, args.column.editorOptions));
|
|
160
|
-
//dropdown = DropDown(input, { ...{ data, searchable: false, defaultSelected: false, pagination: 100 }, ...args.column.editorOptions });
|
|
161
|
-
new JSLRender(args.container, false).render(dropdown);
|
|
162
|
-
// dropdown.show();
|
|
163
|
-
};
|
|
164
|
-
this.show = function () {
|
|
165
|
-
reposition = true;
|
|
166
|
-
// if (dropdown.isExpanded()) {
|
|
167
|
-
// const dd = document.querySelector(".sel-comp-dd") as HTMLDivElement;
|
|
168
|
-
// dd.style.display = "";
|
|
169
|
-
// }
|
|
170
|
-
};
|
|
171
|
-
this.hide = function () {
|
|
172
|
-
reposition = false;
|
|
173
|
-
};
|
|
174
|
-
this.position = function (position) {
|
|
175
|
-
if (dropdown.isExpanded() && reposition) {
|
|
176
|
-
var dd = document.querySelector(".sel-comp-dd");
|
|
177
|
-
if (dd.classList.contains("sel-comp-dd-up")) {
|
|
178
|
-
dd.style.top = (position.top - dd.getBoundingClientRect().height) + "px";
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
dd.style.top = (position.top + args.grid.getOptions().rowHeight) + "px";
|
|
182
|
-
}
|
|
183
|
-
dd.style.left = (position.left) + "px";
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
this.destroy = function () {
|
|
187
|
-
dropdown.destroy();
|
|
188
|
-
// input.parentElement.removeChild(input);
|
|
189
|
-
};
|
|
190
|
-
this.focus = function () {
|
|
191
|
-
// input.focus();
|
|
192
|
-
dropdown.show();
|
|
193
|
-
};
|
|
194
|
-
this.getValue = function () {
|
|
195
|
-
return dropdown.getValue();
|
|
196
|
-
};
|
|
197
|
-
this.setValue = function (val) {
|
|
198
|
-
dropdown.setValue(val != null ? val.toString() : val);
|
|
199
|
-
};
|
|
200
|
-
this.loadValue = function (item) {
|
|
201
|
-
defaultValue = item[args.column.field];
|
|
202
|
-
dropdown.setValue(defaultValue);
|
|
203
|
-
};
|
|
204
|
-
this.serializeValue = function () {
|
|
205
|
-
return dropdown.getValue();
|
|
206
|
-
};
|
|
207
|
-
this.applyValue = function (item, state) {
|
|
208
|
-
item[args.column.field] = state;
|
|
209
|
-
};
|
|
210
|
-
this.isValueChanged = function () {
|
|
211
|
-
return (dropdown.getValue() !== defaultValue);
|
|
212
|
-
};
|
|
213
|
-
this.validate = function () {
|
|
214
|
-
if (args.column.validator) {
|
|
215
|
-
var validationResults = args.column.validator(dropdown.getValue());
|
|
216
|
-
if (!validationResults.valid) {
|
|
217
|
-
return validationResults;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return {
|
|
221
|
-
valid: true,
|
|
222
|
-
msg: null
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
this.init();
|
|
226
|
-
}
|
|
227
|
-
export function AutoSuggestEditor(args) {
|
|
228
|
-
// var input: HTMLDivElement;
|
|
229
|
-
var dropdown;
|
|
230
|
-
var defaultValue;
|
|
231
|
-
var scope = this;
|
|
232
|
-
var reposition = true;
|
|
233
|
-
this.keyCaptureList = function (which) {
|
|
234
|
-
// if (which === 13) {
|
|
235
|
-
// dropdown.show();
|
|
236
|
-
// return false;
|
|
237
|
-
// }
|
|
238
|
-
if (which === 38 || which === 40) {
|
|
239
|
-
// if (dropdown.isExpanded()) {
|
|
240
|
-
return false;
|
|
241
|
-
// }
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
this.init = function () {
|
|
245
|
-
// input = document.createElement("div");
|
|
246
|
-
var vl = args.column.valueList;
|
|
247
|
-
var data = [];
|
|
248
|
-
if (vl) {
|
|
249
|
-
if (Array.isArray(vl)) {
|
|
250
|
-
for (var _i = 0, vl_3 = vl; _i < vl_3.length; _i++) {
|
|
251
|
-
var element = vl_3[_i];
|
|
252
|
-
if (typeof element === "string") {
|
|
253
|
-
data.push({ text: element, value: element });
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
data.push(element);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
for (var key in vl) {
|
|
262
|
-
if (!vl.hasOwnProperty(key)) {
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
|
-
data.push({ text: vl[key], value: key });
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
console.warn("No value list found for column " + args.column.id);
|
|
271
|
-
}
|
|
272
|
-
// dropdown = new SelectComponent({
|
|
273
|
-
// data,
|
|
274
|
-
// dropdownWidth: args.column.width + "px",
|
|
275
|
-
// style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;",
|
|
276
|
-
// openOnEnter: false,
|
|
277
|
-
// // onAppend: (dom) => {
|
|
278
|
-
// // (args.grid as ISlickGrid<any>).getContainerNode().appendChild(dom);
|
|
279
|
-
// // },
|
|
280
|
-
// ...args.column.editorOptions
|
|
281
|
-
// });
|
|
282
|
-
dropdown = new AutoSuggestComponent({
|
|
283
|
-
style: "min-width:0;width:100%;position:absolute;top:0;right:0;bottom:0;left:0;box-sizing:border-box;",
|
|
284
|
-
source: function (val, suggest) {
|
|
285
|
-
var term = (val || "").toLowerCase();
|
|
286
|
-
suggest(data.filter(function (x) {
|
|
287
|
-
return term === "" || x.text.toLowerCase().indexOf(term) >= 0;
|
|
288
|
-
}).map(function (x) { return x.text; }));
|
|
289
|
-
},
|
|
290
|
-
cache: false
|
|
291
|
-
});
|
|
292
|
-
new JSLRender(args.container, false).render(dropdown);
|
|
293
|
-
dropdown.focus();
|
|
294
|
-
};
|
|
295
|
-
this.show = function () {
|
|
296
|
-
reposition = true;
|
|
297
|
-
};
|
|
298
|
-
this.hide = function () {
|
|
299
|
-
reposition = false;
|
|
300
|
-
};
|
|
301
|
-
this.position = function (position) {
|
|
302
|
-
// if (dropdown.isExpanded() && reposition) {
|
|
303
|
-
// const dd = document.querySelector(".sel-comp-dd") as HTMLDivElement;
|
|
304
|
-
// if (dd.classList.contains("sel-comp-dd-up")) {
|
|
305
|
-
// dd.style.top = (position.top - dd.getBoundingClientRect().height) + "px";
|
|
306
|
-
// } else {
|
|
307
|
-
// dd.style.top = (position.top + args.grid.getOptions().rowHeight) + "px";
|
|
308
|
-
// }
|
|
309
|
-
// dd.style.left = (position.left) + "px";
|
|
310
|
-
// }
|
|
311
|
-
};
|
|
312
|
-
this.destroy = function () {
|
|
313
|
-
var _a;
|
|
314
|
-
(_a = dropdown.getRef()) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
315
|
-
};
|
|
316
|
-
this.focus = function () {
|
|
317
|
-
dropdown.focus();
|
|
318
|
-
};
|
|
319
|
-
this.getValue = function () {
|
|
320
|
-
return dropdown.getValue();
|
|
321
|
-
};
|
|
322
|
-
this.setValue = function (val) {
|
|
323
|
-
// dropdown.setValue(val != null ? val.toString() : val);
|
|
324
|
-
dropdown.setValue(val || "");
|
|
325
|
-
};
|
|
326
|
-
this.loadValue = function (item) {
|
|
327
|
-
defaultValue = item[args.column.field];
|
|
328
|
-
// dropdown.setValue(defaultValue);
|
|
329
|
-
dropdown.setValue(defaultValue || "");
|
|
330
|
-
};
|
|
331
|
-
this.serializeValue = function () {
|
|
332
|
-
return dropdown.getValue();
|
|
333
|
-
};
|
|
334
|
-
this.applyValue = function (item, state) {
|
|
335
|
-
item[args.column.field] = state;
|
|
336
|
-
};
|
|
337
|
-
this.isValueChanged = function () {
|
|
338
|
-
return (dropdown.getValue() !== defaultValue);
|
|
339
|
-
};
|
|
340
|
-
this.validate = function () {
|
|
341
|
-
if (args.column.validator) {
|
|
342
|
-
var validationResults = args.column.validator(dropdown.getValue());
|
|
343
|
-
if (!validationResults.valid) {
|
|
344
|
-
return validationResults;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
return {
|
|
348
|
-
valid: true,
|
|
349
|
-
msg: null
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
this.init();
|
|
353
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export var keyCodes = {
|
|
2
|
-
LEFT: 37,
|
|
3
|
-
RIGHT: 39
|
|
4
|
-
};
|
|
5
|
-
/*
|
|
6
|
-
* Depending on the value of Grid option 'editorCellNavOnLRKeys', us
|
|
7
|
-
* Navigate to the cell on the left if the cursor is at the beginning of the input string
|
|
8
|
-
* and to the right cell if it's at the end. Otherwise, move the cursor within the text
|
|
9
|
-
*/
|
|
10
|
-
export function handleKeydownLRNav(e) {
|
|
11
|
-
var cursorPosition = e.target.selectionStart;
|
|
12
|
-
var textLength = e.target.value.length;
|
|
13
|
-
if ((e.which === keyCodes.LEFT && cursorPosition > 0) ||
|
|
14
|
-
e.which === keyCodes.RIGHT && cursorPosition < textLength) {
|
|
15
|
-
e.stopImmediatePropagation();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function handleKeydownLRNoNav(e) {
|
|
19
|
-
if (e.which === keyCodes.LEFT || e.which === keyCodes.RIGHT) {
|
|
20
|
-
e.stopImmediatePropagation();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ISlickFormatter } from './slick.core';
|
|
2
|
-
export declare let EmptyFormatter: ISlickFormatter;
|
|
3
|
-
export declare let ComponentFormatter: ISlickFormatter;
|
|
4
|
-
export declare let YesNoFormatter: ISlickFormatter;
|
|
5
|
-
export declare let CheckboxFormatter: ISlickFormatter;
|
|
6
|
-
export declare let CheckmarkFormatter: ISlickFormatter;
|
|
7
|
-
export declare let NumericFormatter: ISlickFormatter;
|
|
8
|
-
export declare let DateFormatter: ISlickFormatter;
|
|
9
|
-
export declare let HtmlFormatter: ISlickFormatter;
|
|
10
|
-
export declare let LookupFormatter: ISlickFormatter;
|
|
11
|
-
export declare let MultiLookupFormatter: ISlickFormatter;
|
|
12
|
-
export declare let TextFormatter: ISlickFormatter;
|
|
13
|
-
export declare let TooltipFormatter: ISlickFormatter;
|
|
14
|
-
export declare let MultiLineTextFormatter: ISlickFormatter;
|
|
15
|
-
export declare let TimeFormatter: ISlickFormatter;
|
|
16
|
-
export declare let DateTimeFormatter: ISlickFormatter;
|
|
17
|
-
export declare let ButtonFormatter: ISlickFormatter;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Contains basic SlickGrid formatters.
|
|
3
|
-
*
|
|
4
|
-
* NOTE: These are merely examples. You will most likely need to implement something more
|
|
5
|
-
* robust/extensible/localizable/etc. for your use!
|
|
6
|
-
*/
|
|
7
|
-
import { numeric } from '../core/numeric';
|
|
8
|
-
import { date } from '../core/date';
|
|
9
|
-
function escapeHTMLChars(text) {
|
|
10
|
-
if (text == null) {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
if (typeof text.replace !== "function") {
|
|
14
|
-
return text;
|
|
15
|
-
}
|
|
16
|
-
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
17
|
-
}
|
|
18
|
-
export var EmptyFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
19
|
-
return "";
|
|
20
|
-
};
|
|
21
|
-
export var ComponentFormatter = EmptyFormatter;
|
|
22
|
-
export var YesNoFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
23
|
-
return value ? "Yes" : "No";
|
|
24
|
-
};
|
|
25
|
-
export var CheckboxFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
26
|
-
return '<div style="text-align:center">' + (value ? "✔" : "-") + '</div>'; // ❌
|
|
27
|
-
};
|
|
28
|
-
export var CheckmarkFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
29
|
-
return value ? "✔" : "";
|
|
30
|
-
};
|
|
31
|
-
export var NumericFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
32
|
-
return {
|
|
33
|
-
addClasses: ["right"],
|
|
34
|
-
text: numeric.format(value, columnDef.format)
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export var DateFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
38
|
-
return date.format(value, columnDef.format);
|
|
39
|
-
};
|
|
40
|
-
export var HtmlFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
41
|
-
return value || "";
|
|
42
|
-
};
|
|
43
|
-
export var LookupFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
44
|
-
var _a;
|
|
45
|
-
var vl = columnDef.valueList;
|
|
46
|
-
if (vl) {
|
|
47
|
-
if (Array.isArray(vl)) {
|
|
48
|
-
if (vl.length > 0) {
|
|
49
|
-
if (typeof (vl[0]) === "string") {
|
|
50
|
-
return escapeHTMLChars(vl.indexOf(value) >= 0 ? value : ""); //TODO: desired?
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
var vlList = vl;
|
|
54
|
-
return escapeHTMLChars((_a = vlList.filter(function (x) { return x.value === value; })[0]) === null || _a === void 0 ? void 0 : _a.text);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return "";
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return escapeHTMLChars(vl[value]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
console.warn("No values list found for column " + columnDef.id);
|
|
67
|
-
}
|
|
68
|
-
return escapeHTMLChars(value);
|
|
69
|
-
};
|
|
70
|
-
export var MultiLookupFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
71
|
-
if (value == null || value.length === 0) {
|
|
72
|
-
return "";
|
|
73
|
-
}
|
|
74
|
-
var vl = columnDef.valueList;
|
|
75
|
-
var result = "";
|
|
76
|
-
if (vl == null) {
|
|
77
|
-
console.warn("No values list found for column " + columnDef.id);
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
if (Array.isArray(vl)) {
|
|
81
|
-
if (vl.length > 0) {
|
|
82
|
-
if (typeof (vl[0]) === "string") {
|
|
83
|
-
result = value.filter(function (v) { return vl.indexOf(v) >= 0; }).join(", ");
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
var vlList = vl;
|
|
87
|
-
result = vlList.filter(function (x) { return value.indexOf(x.value) >= 0; }).map(function (x) { var _a; return (_a = x.text) !== null && _a !== void 0 ? _a : ""; }).join(", ");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
result = value.map(function (v) { return vl[v]; }).filter(function (v) { return v != null; }).join(", ");
|
|
93
|
-
}
|
|
94
|
-
return result || "";
|
|
95
|
-
};
|
|
96
|
-
export var TextFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
97
|
-
if (value == null) {
|
|
98
|
-
return "";
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return escapeHTMLChars(value + "");
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
export var TooltipFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
105
|
-
if (value == null) {
|
|
106
|
-
return "";
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
var result = escapeHTMLChars(value + "");
|
|
110
|
-
return { text: result, toolTip: result };
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
export var MultiLineTextFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
114
|
-
var txt = "";
|
|
115
|
-
if (value != null) {
|
|
116
|
-
txt = escapeHTMLChars(value + "");
|
|
117
|
-
}
|
|
118
|
-
return { text: txt, addClasses: ["slick-wrap"] };
|
|
119
|
-
};
|
|
120
|
-
function pad(nr) {
|
|
121
|
-
if (nr < 10) {
|
|
122
|
-
return "0" + nr.toString();
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
return nr.toString();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
export var TimeFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
129
|
-
return value ? (pad(value.getHours()) + ":" + pad(value.getMinutes())) : "";
|
|
130
|
-
};
|
|
131
|
-
export var DateTimeFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
132
|
-
return DateFormatter(row, cell, value, columnDef, dataContext) + " " +
|
|
133
|
-
TimeFormatter(row, cell, value, columnDef, dataContext);
|
|
134
|
-
};
|
|
135
|
-
export var ButtonFormatter = function (row, cell, value, columnDef, dataContext) {
|
|
136
|
-
return "<button class='grid-btn'>...</button>";
|
|
137
|
-
};
|