jsl-ui 9.18.3 → 9.18.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.d.ts +17 -0
- package/lib/components/IntervalComponent.js +68 -0
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -0
- package/lib/components/auto-suggest/AutoSuggestComponent.js +49 -0
- package/lib/components/button/ButtonComponent.d.ts +18 -0
- package/lib/components/button/ButtonComponent.js +46 -0
- package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -0
- package/lib/components/checkbox/CheckBoxComponent.js +94 -0
- package/lib/components/checkbox/CheckBoxStyle.scss +86 -0
- package/lib/components/date/DateComponent.d.ts +32 -0
- package/lib/components/date/DateComponent.js +106 -0
- package/lib/components/date-range/DateRangeComponent.d.ts +35 -0
- package/lib/components/date-range/DateRangeComponent.js +136 -0
- package/lib/components/date-range/DateRangeStyle.scss +12 -0
- package/lib/components/date-time/DateTimeComponent.d.ts +15 -0
- package/lib/components/date-time/DateTimeComponent.js +53 -0
- package/lib/components/date-time/DateTimeStyle.scss +7 -0
- package/lib/components/dialog/DialogComponent.d.ts +67 -0
- package/lib/components/dialog/DialogComponent.js +242 -0
- package/lib/components/drop-down/DropDownComponent.d.ts +27 -0
- package/lib/components/drop-down/DropDownComponent.js +74 -0
- package/lib/components/expander/ExpanderComponent.d.ts +27 -0
- package/lib/components/expander/ExpanderComponent.js +90 -0
- package/lib/components/expander/ExpanderStyle.scss +47 -0
- package/lib/components/expander/OldExpanderStyle.scss +37 -0
- package/lib/components/form-field/FormComponent.d.ts +12 -0
- package/lib/components/form-field/FormComponent.js +26 -0
- package/lib/components/form-field/FormFieldComponent.d.ts +38 -0
- package/lib/components/form-field/FormFieldComponent.js +139 -0
- package/lib/components/form-field/FormFieldStyle.scss +87 -0
- package/lib/components/grid/GridComponent.d.ts +26 -0
- package/lib/components/grid/GridComponent.js +116 -0
- package/lib/components/input/InputComponent.d.ts +33 -0
- package/lib/components/input/InputComponent.js +144 -0
- package/lib/components/loading/LoadingComponent.d.ts +8 -0
- package/lib/components/loading/LoadingComponent.js +22 -0
- package/lib/components/loading/LoadingStyle.css +29 -0
- package/lib/components/navigation/NavigationComponent.d.ts +34 -0
- package/lib/components/navigation/NavigationComponent.js +70 -0
- package/lib/components/navigation/NavigationStyle.scss +226 -0
- package/lib/components/notification/Notification.d.ts +17 -0
- package/lib/components/notification/Notification.js +56 -0
- package/lib/components/notification/Notification.scss +19 -0
- package/lib/components/number/NumberComponent.d.ts +25 -0
- package/lib/components/number/NumberComponent.js +87 -0
- package/lib/components/overlay/OverlayComponent.d.ts +27 -0
- package/lib/components/overlay/OverlayComponent.js +149 -0
- package/lib/components/overlay/overlay.css +57 -0
- package/lib/components/progress/ProgressComponent.d.ts +18 -0
- package/lib/components/progress/ProgressComponent.js +42 -0
- package/lib/components/progress/ProgressStyle.scss +15 -0
- package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -0
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +34 -0
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +76 -0
- package/lib/components/select/SelectComponent.d.ts +79 -0
- package/lib/components/select/SelectComponent.js +362 -0
- package/lib/components/select/SelectDDAreaComponent.d.ts +32 -0
- package/lib/components/select/SelectDDAreaComponent.js +317 -0
- package/lib/components/select/SelectStyle.scss +187 -0
- package/lib/components/slider/nouislider.css +310 -0
- package/lib/components/slider/nouislider.d.ts +44 -0
- package/lib/components/slider/nouislider.js +2158 -0
- package/lib/components/stack-panel/SplitterComponent.d.ts +21 -0
- package/lib/components/stack-panel/SplitterComponent.js +126 -0
- package/lib/components/stack-panel/SplitterStyle.scss +45 -0
- package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -0
- package/lib/components/stack-panel/StackPanelComponent.js +64 -0
- package/lib/components/stack-panel/StackPanelStyle.scss +53 -0
- package/lib/components/tabs/TabsComponent.d.ts +39 -0
- package/lib/components/tabs/TabsComponent.js +177 -0
- package/lib/components/tabs/TabsStyle.scss +76 -0
- package/lib/components/time/TimeComponent.d.ts +29 -0
- package/lib/components/time/TimeComponent.js +113 -0
- package/lib/components/time/TimeComponent.scss +4 -0
- package/lib/components/tree-view/TreeViewComponent.d.ts +23 -0
- package/lib/components/tree-view/TreeViewComponent.js +45 -0
- package/lib/components/tree-view/TreeViewStyle.scss +96 -0
- package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -0
- package/lib/components/virtual-render/VirtualRenderComponent.js +104 -0
- package/lib/components/virtual-render/VirtualRenderStyle.scss +9 -0
- package/lib/core/culture.d.ts +5 -0
- package/lib/core/culture.js +385 -0
- package/lib/core/date.d.ts +14 -0
- package/lib/core/date.js +350 -0
- package/lib/core/helper.d.ts +12 -0
- package/lib/core/helper.js +101 -0
- package/lib/core/jq.d.ts +37 -0
- package/lib/core/jq.js +371 -0
- package/lib/core/lang.d.ts +24 -0
- package/lib/core/lang.js +28 -0
- package/lib/core/numeric.d.ts +7 -0
- package/lib/core/numeric.js +143 -0
- package/lib/core/polyfills.d.ts +0 -0
- package/lib/core/polyfills.js +22 -0
- package/lib/core.d.ts +6 -0
- package/lib/core.js +6 -0
- package/lib/grid/controls/slick.columnpicker.css +46 -0
- package/lib/grid/controls/slick.draggablegrouping.css +52 -0
- package/lib/grid/controls/slick.gridmenu.css +127 -0
- package/lib/grid/controls/slick.pager.css +41 -0
- package/lib/grid/examples/examples.css +203 -0
- package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -0
- package/lib/grid/filterDialogs/dateRangeFilter.js +156 -0
- package/lib/grid/filterDialogs/excelFilter.d.ts +9 -0
- package/lib/grid/filterDialogs/excelFilter.js +313 -0
- package/lib/grid/plugins/ext.overlay.css +28 -0
- package/lib/grid/plugins/ext.overlay.d.ts +2 -0
- package/lib/grid/plugins/ext.overlay.js +291 -0
- package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -0
- package/lib/grid/plugins/slick.cellrangedecorator.js +68 -0
- package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -0
- package/lib/grid/plugins/slick.cellrangeselector.js +144 -0
- package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -0
- package/lib/grid/plugins/slick.cellselectionmodel.js +194 -0
- package/lib/grid/plugins/slick.headerbuttons.css +40 -0
- package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -0
- package/lib/grid/plugins/slick.headerbuttons.js +156 -0
- package/lib/grid/plugins/slick.headermenu.css +101 -0
- package/lib/grid/plugins/slick.headermenu.d.ts +74 -0
- package/lib/grid/plugins/slick.headermenu.js +260 -0
- package/lib/grid/plugins/slick.rowdetailview.css +37 -0
- package/lib/grid/plugins/slick.rowmovemanager.css +8 -0
- package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -0
- package/lib/grid/plugins/slick.rowmovemanager.js +249 -0
- package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -0
- package/lib/grid/plugins/slick.rowselectionmodel.js +167 -0
- package/lib/grid/slick-default-theme.css +154 -0
- package/lib/grid/slick.core.d.ts +90 -0
- package/lib/grid/slick.core.js +574 -0
- package/lib/grid/slick.creator.d.ts +80 -0
- package/lib/grid/slick.creator.js +723 -0
- package/lib/grid/slick.dataview.d.ts +71 -0
- package/lib/grid/slick.dataview.js +1080 -0
- package/lib/grid/slick.editors.core.d.ts +4 -0
- package/lib/grid/slick.editors.core.js +232 -0
- package/lib/grid/slick.editors.date.d.ts +2 -0
- package/lib/grid/slick.editors.date.js +125 -0
- package/lib/grid/slick.editors.lookup.d.ts +14 -0
- package/lib/grid/slick.editors.lookup.js +353 -0
- package/lib/grid/slick.editors.nav.d.ts +6 -0
- package/lib/grid/slick.editors.nav.js +22 -0
- package/lib/grid/slick.formatters.d.ts +17 -0
- package/lib/grid/slick.formatters.js +137 -0
- package/lib/grid/slick.grid.css +325 -0
- package/lib/grid/slick.grid.d.ts +284 -0
- package/lib/grid/slick.grid.js +5395 -0
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -0
- package/lib/grid/slick.groupitemmetadataprovider.js +165 -0
- package/lib/grid/slick.tree.css +20 -0
- package/lib/grid/slick.tree.d.ts +33 -0
- package/lib/grid/slick.tree.js +220 -0
- package/lib/grid.d.ts +13 -0
- package/lib/grid.js +13 -0
- package/lib/index.css +2576 -0
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +56 -0
- package/lib/index.js +61 -10198
- package/lib/index.js.map +1 -1
- package/lib/interaction/dataconverter.d.ts +4 -0
- package/lib/interaction/dataconverter.js +1 -0
- package/lib/interaction/eventhandler.d.ts +13 -0
- package/lib/interaction/eventhandler.js +42 -0
- package/lib/interaction/moveable.css +0 -0
- package/lib/interaction/moveable.d.ts +39 -0
- package/lib/interaction/moveable.js +172 -0
- package/lib/interaction/resizable.css +33 -0
- package/lib/interaction/resizable.d.ts +37 -0
- package/lib/interaction/resizable.js +123 -0
- package/lib/ui/auto.suggest.css +14 -0
- package/lib/ui/auto.suggest.d.ts +17 -0
- package/lib/ui/auto.suggest.js +255 -0
- package/lib/ui/base.css +150 -0
- package/lib/ui/date.picker/css/date-range-picker.css +87 -0
- package/lib/ui/date.picker/css/tiny-date-picker.css +326 -0
- package/lib/ui/date.picker/date-picker-options.d.ts +11 -0
- package/lib/ui/date.picker/date-picker-options.js +76 -0
- package/lib/ui/date.picker/lib/date-manip.d.ts +74 -0
- package/lib/ui/date.picker/lib/date-manip.js +120 -0
- package/lib/ui/date.picker/lib/dom.d.ts +23 -0
- package/lib/ui/date.picker/lib/dom.js +28 -0
- package/lib/ui/date.picker/lib/emitter.d.ts +13 -0
- package/lib/ui/date.picker/lib/emitter.js +49 -0
- package/lib/ui/date.picker/lib/fns.d.ts +23 -0
- package/lib/ui/date.picker/lib/fns.js +43 -0
- package/lib/ui/date.picker/mode/base-mode.d.ts +26 -0
- package/lib/ui/date.picker/mode/base-mode.js +248 -0
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -0
- package/lib/ui/date.picker/mode/dropdown-mode.js +50 -0
- package/lib/ui/date.picker/mode/index.d.ts +28 -0
- package/lib/ui/date.picker/mode/index.js +18 -0
- package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -0
- package/lib/ui/date.picker/mode/modal-mode.js +17 -0
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -0
- package/lib/ui/date.picker/mode/permanent-mode.js +19 -0
- package/lib/ui/date.picker/views/day-picker.d.ts +40 -0
- package/lib/ui/date.picker/views/day-picker.js +155 -0
- package/lib/ui/date.picker/views/month-picker.d.ts +26 -0
- package/lib/ui/date.picker/views/month-picker.js +65 -0
- package/lib/ui/date.picker/views/year-picker.d.ts +20 -0
- package/lib/ui/date.picker/views/year-picker.js +66 -0
- package/lib/ui/date.picker.d.ts +66 -0
- package/lib/ui/date.picker.js +32 -0
- package/lib/ui/dialog.css +109 -0
- package/lib/ui/dialog.d.ts +22 -0
- package/lib/ui/dialog.js +113 -0
- package/lib/ui/drop.down.css +472 -0
- package/lib/ui/drop.down.d.ts +52 -0
- package/lib/ui/drop.down.js +2112 -0
- package/lib/ui/number.input.css +3 -0
- package/lib/ui/number.input.d.ts +12 -0
- package/lib/ui/number.input.js +64 -0
- package/lib/ui/tabs.css +53 -0
- package/package.json +1 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Contains basic SlickGrid editors.
|
|
3
|
+
*/
|
|
4
|
+
import { numeric } from "../core/numeric";
|
|
5
|
+
import { handleKeydownLRNav, handleKeydownLRNoNav } from "./slick.editors.nav";
|
|
6
|
+
export function TextEditor(args) {
|
|
7
|
+
var input;
|
|
8
|
+
var defaultValue;
|
|
9
|
+
var scope = this;
|
|
10
|
+
this.init = function () {
|
|
11
|
+
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys;
|
|
12
|
+
input = document.createElement("input");
|
|
13
|
+
input.type = "text";
|
|
14
|
+
input.className = "editor-text";
|
|
15
|
+
if (args.column.maxLength > 0) {
|
|
16
|
+
input.maxLength = args.column.maxLength;
|
|
17
|
+
}
|
|
18
|
+
input.addEventListener("keydown", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav);
|
|
19
|
+
args.container.appendChild(input);
|
|
20
|
+
input.focus();
|
|
21
|
+
input.select();
|
|
22
|
+
};
|
|
23
|
+
this.destroy = function () {
|
|
24
|
+
input.parentElement.removeChild(input);
|
|
25
|
+
};
|
|
26
|
+
this.focus = function () {
|
|
27
|
+
input.focus();
|
|
28
|
+
};
|
|
29
|
+
this.getValue = function () {
|
|
30
|
+
return input.value;
|
|
31
|
+
};
|
|
32
|
+
this.setValue = function (val) {
|
|
33
|
+
input.value = val;
|
|
34
|
+
};
|
|
35
|
+
this.loadValue = function (item) {
|
|
36
|
+
defaultValue = item[args.column.field] || "";
|
|
37
|
+
input.value = defaultValue;
|
|
38
|
+
input.defaultValue = defaultValue;
|
|
39
|
+
input.select();
|
|
40
|
+
};
|
|
41
|
+
this.serializeValue = function () {
|
|
42
|
+
return input.value;
|
|
43
|
+
};
|
|
44
|
+
this.applyValue = function (item, state) {
|
|
45
|
+
item[args.column.field] = state;
|
|
46
|
+
};
|
|
47
|
+
this.isValueChanged = function () {
|
|
48
|
+
return (!(input.value == "" && defaultValue == null)) && (input.value != defaultValue);
|
|
49
|
+
};
|
|
50
|
+
this.validate = function () {
|
|
51
|
+
if (args.column.validator) {
|
|
52
|
+
var validationResults = args.column.validator(input.value);
|
|
53
|
+
if (!validationResults.valid) {
|
|
54
|
+
return validationResults;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
valid: true,
|
|
59
|
+
msg: null
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
this.init();
|
|
63
|
+
}
|
|
64
|
+
export function MultiLineTextEditor(args) {
|
|
65
|
+
var input;
|
|
66
|
+
var defaultValue;
|
|
67
|
+
var scope = this;
|
|
68
|
+
this.init = function () {
|
|
69
|
+
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys;
|
|
70
|
+
input = document.createElement("textarea");
|
|
71
|
+
if (args.column.maxLength > 0) {
|
|
72
|
+
input.maxLength = args.column.maxLength;
|
|
73
|
+
}
|
|
74
|
+
input.className = "editor-text";
|
|
75
|
+
input.addEventListener("keydown", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav);
|
|
76
|
+
args.container.appendChild(input);
|
|
77
|
+
input.focus();
|
|
78
|
+
input.select();
|
|
79
|
+
};
|
|
80
|
+
this.destroy = function () {
|
|
81
|
+
input.parentElement.removeChild(input);
|
|
82
|
+
};
|
|
83
|
+
this.focus = function () {
|
|
84
|
+
input.focus();
|
|
85
|
+
};
|
|
86
|
+
this.getValue = function () {
|
|
87
|
+
return input.value;
|
|
88
|
+
};
|
|
89
|
+
this.setValue = function (val) {
|
|
90
|
+
input.value = val;
|
|
91
|
+
};
|
|
92
|
+
this.loadValue = function (item) {
|
|
93
|
+
defaultValue = item[args.column.field] || "";
|
|
94
|
+
input.value = defaultValue;
|
|
95
|
+
input.defaultValue = defaultValue;
|
|
96
|
+
input.select();
|
|
97
|
+
};
|
|
98
|
+
this.serializeValue = function () {
|
|
99
|
+
return input.value;
|
|
100
|
+
};
|
|
101
|
+
this.applyValue = function (item, state) {
|
|
102
|
+
item[args.column.field] = state;
|
|
103
|
+
};
|
|
104
|
+
this.isValueChanged = function () {
|
|
105
|
+
return (!(input.value == "" && defaultValue == null)) && (input.value != defaultValue);
|
|
106
|
+
};
|
|
107
|
+
this.validate = function () {
|
|
108
|
+
if (args.column.validator) {
|
|
109
|
+
var validationResults = args.column.validator(input.value);
|
|
110
|
+
if (!validationResults.valid) {
|
|
111
|
+
return validationResults;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
valid: true,
|
|
116
|
+
msg: null
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
this.init();
|
|
120
|
+
}
|
|
121
|
+
export function NumericEditor(args) {
|
|
122
|
+
var input;
|
|
123
|
+
var defaultValue;
|
|
124
|
+
var scope = this;
|
|
125
|
+
this.init = function () {
|
|
126
|
+
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys;
|
|
127
|
+
input = document.createElement("input");
|
|
128
|
+
input.type = "text";
|
|
129
|
+
input.className = "editor-text right";
|
|
130
|
+
input.addEventListener("keydown", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav);
|
|
131
|
+
args.container.appendChild(input);
|
|
132
|
+
input.focus();
|
|
133
|
+
input.select();
|
|
134
|
+
};
|
|
135
|
+
this.destroy = function () {
|
|
136
|
+
input.parentElement.removeChild(input);
|
|
137
|
+
};
|
|
138
|
+
this.focus = function () {
|
|
139
|
+
input.focus();
|
|
140
|
+
};
|
|
141
|
+
// function getDecimalPlaces() {
|
|
142
|
+
// // returns the number of fixed decimal places or null
|
|
143
|
+
// var rtn = args.column.editorFixedDecimalPlaces;
|
|
144
|
+
// if (typeof rtn == 'undefined') {
|
|
145
|
+
// rtn = (<any>FloatEditor).DefaultDecimalPlaces;
|
|
146
|
+
// }
|
|
147
|
+
// return (!rtn && rtn!==0 ? null : rtn);
|
|
148
|
+
// }
|
|
149
|
+
this.loadValue = function (item) {
|
|
150
|
+
defaultValue = item[args.column.field];
|
|
151
|
+
var val_as_str = numeric.format(defaultValue, args.column.format);
|
|
152
|
+
input.value = val_as_str;
|
|
153
|
+
input.select();
|
|
154
|
+
};
|
|
155
|
+
this.serializeValue = function () {
|
|
156
|
+
return numeric.parse(input.value);
|
|
157
|
+
};
|
|
158
|
+
this.applyValue = function (item, state) {
|
|
159
|
+
item[args.column.field] = state;
|
|
160
|
+
};
|
|
161
|
+
this.isValueChanged = function () {
|
|
162
|
+
return numeric.parse(input.value) !== defaultValue;
|
|
163
|
+
};
|
|
164
|
+
this.validate = function () {
|
|
165
|
+
if (input.value !== "" && numeric.parse(input.value) === undefined) {
|
|
166
|
+
return {
|
|
167
|
+
valid: false,
|
|
168
|
+
msg: "Please enter a valid number"
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (args.column.validator) {
|
|
172
|
+
var validationResults = args.column.validator(numeric.parse(input.value));
|
|
173
|
+
if (!validationResults.valid) {
|
|
174
|
+
return validationResults;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
valid: true,
|
|
179
|
+
msg: null
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
this.init();
|
|
183
|
+
}
|
|
184
|
+
export function BooleanEditor(args) {
|
|
185
|
+
var $select;
|
|
186
|
+
var defaultValue;
|
|
187
|
+
var scope = this;
|
|
188
|
+
this.init = function () {
|
|
189
|
+
$select = document.createElement("select");
|
|
190
|
+
$select.setAttribute("tabIndex", "0");
|
|
191
|
+
$select.className = "editor-yesno"; // <OPTION value='-'>-</OPTION>
|
|
192
|
+
$select.innerHTML = "<OPTION value='yes'>✔</OPTION><OPTION value='no'>-</OPTION>";
|
|
193
|
+
args.container.appendChild($select);
|
|
194
|
+
args.container.style.textAlign = "center";
|
|
195
|
+
$select.focus();
|
|
196
|
+
};
|
|
197
|
+
this.destroy = function () {
|
|
198
|
+
$select.parentElement.removeChild($select);
|
|
199
|
+
};
|
|
200
|
+
this.focus = function () {
|
|
201
|
+
$select.focus();
|
|
202
|
+
};
|
|
203
|
+
this.loadValue = function (item) {
|
|
204
|
+
defaultValue = item[args.column.field];
|
|
205
|
+
$select.value = defaultValue == null ? "-" : (defaultValue ? "yes" : "no");
|
|
206
|
+
$select.focus();
|
|
207
|
+
//$select.select();
|
|
208
|
+
};
|
|
209
|
+
this.serializeValue = function () {
|
|
210
|
+
if ($select.value === "-") {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
return ($select.value === "yes");
|
|
214
|
+
};
|
|
215
|
+
this.applyValue = function (item, state) {
|
|
216
|
+
item[args.column.field] = state;
|
|
217
|
+
};
|
|
218
|
+
this.isValueChanged = function () {
|
|
219
|
+
if ($select.value === "-" && defaultValue == null) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
var v = $select.value === "yes";
|
|
223
|
+
return (v !== defaultValue);
|
|
224
|
+
};
|
|
225
|
+
this.validate = function () {
|
|
226
|
+
return {
|
|
227
|
+
valid: true,
|
|
228
|
+
msg: null
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
this.init();
|
|
232
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { handleKeydownLRNav, handleKeydownLRNoNav } from "./slick.editors.nav";
|
|
2
|
+
import { DatePicker } from "../ui/date.picker";
|
|
3
|
+
import { date } from "../core/date";
|
|
4
|
+
export function DateEditor(args) {
|
|
5
|
+
var input;
|
|
6
|
+
var defaultValue;
|
|
7
|
+
var scope = this;
|
|
8
|
+
var datePicker;
|
|
9
|
+
this.init = function () {
|
|
10
|
+
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys;
|
|
11
|
+
input = document.createElement("input");
|
|
12
|
+
input.type = "text";
|
|
13
|
+
input.className = "editor-text";
|
|
14
|
+
input.addEventListener("keydown", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav);
|
|
15
|
+
args.container.appendChild(input);
|
|
16
|
+
datePicker = DatePicker(input, { mode: 'dp-below' });
|
|
17
|
+
datePicker.on("close", function () {
|
|
18
|
+
input.focus();
|
|
19
|
+
input.select();
|
|
20
|
+
});
|
|
21
|
+
input.focus();
|
|
22
|
+
};
|
|
23
|
+
this.destroy = function () {
|
|
24
|
+
datePicker.destroy();
|
|
25
|
+
input.remove();
|
|
26
|
+
};
|
|
27
|
+
this.show = function () {
|
|
28
|
+
//so far not necessary
|
|
29
|
+
};
|
|
30
|
+
this.hide = function () {
|
|
31
|
+
datePicker.close();
|
|
32
|
+
};
|
|
33
|
+
this.position = function (position) {
|
|
34
|
+
//so far not necessary
|
|
35
|
+
};
|
|
36
|
+
this.focus = function () {
|
|
37
|
+
input.focus();
|
|
38
|
+
};
|
|
39
|
+
this.loadValue = function (item) {
|
|
40
|
+
defaultValue = date.onlyDate(item[args.column.field]);
|
|
41
|
+
var val_as_str = date.format(defaultValue, args.column.format);
|
|
42
|
+
input.value = val_as_str;
|
|
43
|
+
input.select();
|
|
44
|
+
};
|
|
45
|
+
this.serializeValue = function () {
|
|
46
|
+
return date.onlyDate(date.parse(input.value, args.column.format));
|
|
47
|
+
};
|
|
48
|
+
this.applyValue = function (item, state) {
|
|
49
|
+
item[args.column.field] = state;
|
|
50
|
+
};
|
|
51
|
+
this.isValueChanged = function () {
|
|
52
|
+
return (!(input.value == "" && !defaultValue)) && !date.equal(date.onlyDate(date.parse(input.value, args.column.format)), defaultValue);
|
|
53
|
+
};
|
|
54
|
+
this.validate = function () {
|
|
55
|
+
if (args.column.validator) {
|
|
56
|
+
var validationResults = args.column.validator(date.onlyDate(date.parse(input.value, args.column.format)));
|
|
57
|
+
if (!validationResults.valid) {
|
|
58
|
+
return validationResults;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
valid: true,
|
|
63
|
+
msg: null
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
this.init();
|
|
67
|
+
}
|
|
68
|
+
export function TimeEditor(args) {
|
|
69
|
+
var input;
|
|
70
|
+
var defaultValue;
|
|
71
|
+
var scope = this;
|
|
72
|
+
this.init = function () {
|
|
73
|
+
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys;
|
|
74
|
+
input = document.createElement("input");
|
|
75
|
+
input.type = "time";
|
|
76
|
+
input.className = "editor-text";
|
|
77
|
+
if (args.column.maxLength > 0) {
|
|
78
|
+
input.maxLength = args.column.maxLength;
|
|
79
|
+
}
|
|
80
|
+
input.addEventListener("keydown", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav);
|
|
81
|
+
args.container.appendChild(input);
|
|
82
|
+
input.focus();
|
|
83
|
+
input.select();
|
|
84
|
+
};
|
|
85
|
+
this.destroy = function () {
|
|
86
|
+
input.parentElement.removeChild(input);
|
|
87
|
+
};
|
|
88
|
+
this.focus = function () {
|
|
89
|
+
input.focus();
|
|
90
|
+
};
|
|
91
|
+
this.getValue = function () {
|
|
92
|
+
return input.value;
|
|
93
|
+
};
|
|
94
|
+
this.setValue = function (val) {
|
|
95
|
+
input.value = val;
|
|
96
|
+
};
|
|
97
|
+
this.loadValue = function (item) {
|
|
98
|
+
defaultValue = item[args.column.field] || "";
|
|
99
|
+
input.value = defaultValue;
|
|
100
|
+
input.defaultValue = defaultValue;
|
|
101
|
+
input.select();
|
|
102
|
+
};
|
|
103
|
+
this.serializeValue = function () {
|
|
104
|
+
return input.value;
|
|
105
|
+
};
|
|
106
|
+
this.applyValue = function (item, state) {
|
|
107
|
+
item[args.column.field] = state;
|
|
108
|
+
};
|
|
109
|
+
this.isValueChanged = function () {
|
|
110
|
+
return (!(input.value == "" && defaultValue == null)) && (input.value != defaultValue);
|
|
111
|
+
};
|
|
112
|
+
this.validate = function () {
|
|
113
|
+
if (args.column.validator) {
|
|
114
|
+
var validationResults = args.column.validator(input.value);
|
|
115
|
+
if (!validationResults.valid) {
|
|
116
|
+
return validationResults;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
valid: true,
|
|
121
|
+
msg: null
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
this.init();
|
|
125
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IJSLVNode } from "jsl-render";
|
|
2
|
+
import { ISelectRenderArg } from "../components/select/SelectComponent";
|
|
3
|
+
export declare function MultiLookupEditor(args: any): void;
|
|
4
|
+
export interface ILookupEditorOptions {
|
|
5
|
+
enableSearch?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
placeholder?: boolean;
|
|
8
|
+
allowEmpty?: boolean;
|
|
9
|
+
rowHeight?: number;
|
|
10
|
+
onRender?: (args: ISelectRenderArg) => void | IJSLVNode;
|
|
11
|
+
matchSearch?: (data: any, term: string) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function LookupEditor(args: any): void;
|
|
14
|
+
export declare function AutoSuggestEditor(args: any): void;
|