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.
Files changed (214) hide show
  1. package/lib/grid.css +0 -8
  2. package/lib/index.css.map +1 -1
  3. package/lib/index.js +10198 -61
  4. package/lib/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/lib/components/IntervalComponent.d.ts +0 -17
  7. package/lib/components/IntervalComponent.js +0 -68
  8. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +0 -22
  9. package/lib/components/auto-suggest/AutoSuggestComponent.js +0 -49
  10. package/lib/components/button/ButtonComponent.d.ts +0 -18
  11. package/lib/components/button/ButtonComponent.js +0 -46
  12. package/lib/components/checkbox/CheckBoxComponent.d.ts +0 -28
  13. package/lib/components/checkbox/CheckBoxComponent.js +0 -94
  14. package/lib/components/checkbox/CheckBoxStyle.scss +0 -86
  15. package/lib/components/date/DateComponent.d.ts +0 -32
  16. package/lib/components/date/DateComponent.js +0 -106
  17. package/lib/components/date-range/DateRangeComponent.d.ts +0 -35
  18. package/lib/components/date-range/DateRangeComponent.js +0 -136
  19. package/lib/components/date-range/DateRangeStyle.scss +0 -12
  20. package/lib/components/date-time/DateTimeComponent.d.ts +0 -15
  21. package/lib/components/date-time/DateTimeComponent.js +0 -53
  22. package/lib/components/date-time/DateTimeStyle.scss +0 -7
  23. package/lib/components/dialog/DialogComponent.d.ts +0 -67
  24. package/lib/components/dialog/DialogComponent.js +0 -242
  25. package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
  26. package/lib/components/drop-down/DropDownComponent.js +0 -74
  27. package/lib/components/expander/ExpanderComponent.d.ts +0 -27
  28. package/lib/components/expander/ExpanderComponent.js +0 -90
  29. package/lib/components/expander/ExpanderStyle.scss +0 -47
  30. package/lib/components/expander/OldExpanderStyle.scss +0 -37
  31. package/lib/components/form-field/FormComponent.d.ts +0 -12
  32. package/lib/components/form-field/FormComponent.js +0 -26
  33. package/lib/components/form-field/FormFieldComponent.d.ts +0 -38
  34. package/lib/components/form-field/FormFieldComponent.js +0 -139
  35. package/lib/components/form-field/FormFieldStyle.scss +0 -87
  36. package/lib/components/grid/GridComponent.d.ts +0 -26
  37. package/lib/components/grid/GridComponent.js +0 -116
  38. package/lib/components/input/InputComponent.d.ts +0 -33
  39. package/lib/components/input/InputComponent.js +0 -144
  40. package/lib/components/loading/LoadingComponent.d.ts +0 -8
  41. package/lib/components/loading/LoadingComponent.js +0 -22
  42. package/lib/components/loading/LoadingStyle.css +0 -29
  43. package/lib/components/navigation/NavigationComponent.d.ts +0 -34
  44. package/lib/components/navigation/NavigationComponent.js +0 -70
  45. package/lib/components/navigation/NavigationStyle.scss +0 -226
  46. package/lib/components/notification/Notification.d.ts +0 -17
  47. package/lib/components/notification/Notification.js +0 -56
  48. package/lib/components/notification/Notification.scss +0 -19
  49. package/lib/components/number/NumberComponent.d.ts +0 -25
  50. package/lib/components/number/NumberComponent.js +0 -87
  51. package/lib/components/overlay/OverlayComponent.d.ts +0 -27
  52. package/lib/components/overlay/OverlayComponent.js +0 -149
  53. package/lib/components/overlay/overlay.css +0 -57
  54. package/lib/components/progress/ProgressComponent.d.ts +0 -18
  55. package/lib/components/progress/ProgressComponent.js +0 -42
  56. package/lib/components/progress/ProgressStyle.scss +0 -15
  57. package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +0 -12
  58. package/lib/components/ribbon-menu/RibbonMenuComponent.js +0 -34
  59. package/lib/components/ribbon-menu/RibbonMenuStyle.scss +0 -76
  60. package/lib/components/select/SelectComponent.d.ts +0 -79
  61. package/lib/components/select/SelectComponent.js +0 -362
  62. package/lib/components/select/SelectDDAreaComponent.d.ts +0 -32
  63. package/lib/components/select/SelectDDAreaComponent.js +0 -317
  64. package/lib/components/select/SelectStyle.scss +0 -187
  65. package/lib/components/slider/nouislider.css +0 -310
  66. package/lib/components/slider/nouislider.d.ts +0 -44
  67. package/lib/components/slider/nouislider.js +0 -2158
  68. package/lib/components/stack-panel/SplitterComponent.d.ts +0 -21
  69. package/lib/components/stack-panel/SplitterComponent.js +0 -126
  70. package/lib/components/stack-panel/SplitterStyle.scss +0 -45
  71. package/lib/components/stack-panel/StackPanelComponent.d.ts +0 -20
  72. package/lib/components/stack-panel/StackPanelComponent.js +0 -64
  73. package/lib/components/stack-panel/StackPanelStyle.scss +0 -53
  74. package/lib/components/tabs/TabsComponent.d.ts +0 -39
  75. package/lib/components/tabs/TabsComponent.js +0 -177
  76. package/lib/components/tabs/TabsStyle.scss +0 -76
  77. package/lib/components/time/TimeComponent.d.ts +0 -29
  78. package/lib/components/time/TimeComponent.js +0 -113
  79. package/lib/components/time/TimeComponent.scss +0 -4
  80. package/lib/components/tree-view/TreeViewComponent.d.ts +0 -23
  81. package/lib/components/tree-view/TreeViewComponent.js +0 -45
  82. package/lib/components/tree-view/TreeViewStyle.scss +0 -96
  83. package/lib/components/virtual-render/VirtualRenderComponent.d.ts +0 -30
  84. package/lib/components/virtual-render/VirtualRenderComponent.js +0 -104
  85. package/lib/components/virtual-render/VirtualRenderStyle.scss +0 -9
  86. package/lib/core/culture.d.ts +0 -5
  87. package/lib/core/culture.js +0 -385
  88. package/lib/core/date.d.ts +0 -14
  89. package/lib/core/date.js +0 -350
  90. package/lib/core/helper.d.ts +0 -12
  91. package/lib/core/helper.js +0 -101
  92. package/lib/core/jq.d.ts +0 -37
  93. package/lib/core/jq.js +0 -371
  94. package/lib/core/lang.d.ts +0 -24
  95. package/lib/core/lang.js +0 -28
  96. package/lib/core/numeric.d.ts +0 -7
  97. package/lib/core/numeric.js +0 -143
  98. package/lib/core/polyfills.d.ts +0 -0
  99. package/lib/core/polyfills.js +0 -22
  100. package/lib/core.d.ts +0 -6
  101. package/lib/core.js +0 -6
  102. package/lib/grid/controls/slick.columnpicker.css +0 -46
  103. package/lib/grid/controls/slick.draggablegrouping.css +0 -52
  104. package/lib/grid/controls/slick.gridmenu.css +0 -127
  105. package/lib/grid/controls/slick.pager.css +0 -41
  106. package/lib/grid/examples/examples.css +0 -203
  107. package/lib/grid/filterDialogs/dateRangeFilter.d.ts +0 -7
  108. package/lib/grid/filterDialogs/dateRangeFilter.js +0 -156
  109. package/lib/grid/filterDialogs/excelFilter.d.ts +0 -9
  110. package/lib/grid/filterDialogs/excelFilter.js +0 -313
  111. package/lib/grid/plugins/ext.overlay.css +0 -28
  112. package/lib/grid/plugins/ext.overlay.d.ts +0 -2
  113. package/lib/grid/plugins/ext.overlay.js +0 -291
  114. package/lib/grid/plugins/slick.cellrangedecorator.d.ts +0 -12
  115. package/lib/grid/plugins/slick.cellrangedecorator.js +0 -68
  116. package/lib/grid/plugins/slick.cellrangeselector.d.ts +0 -1
  117. package/lib/grid/plugins/slick.cellrangeselector.js +0 -144
  118. package/lib/grid/plugins/slick.cellselectionmodel.d.ts +0 -1
  119. package/lib/grid/plugins/slick.cellselectionmodel.js +0 -194
  120. package/lib/grid/plugins/slick.headerbuttons.css +0 -40
  121. package/lib/grid/plugins/slick.headerbuttons.d.ts +0 -55
  122. package/lib/grid/plugins/slick.headerbuttons.js +0 -156
  123. package/lib/grid/plugins/slick.headermenu.css +0 -101
  124. package/lib/grid/plugins/slick.headermenu.d.ts +0 -74
  125. package/lib/grid/plugins/slick.headermenu.js +0 -260
  126. package/lib/grid/plugins/slick.rowdetailview.css +0 -37
  127. package/lib/grid/plugins/slick.rowmovemanager.css +0 -8
  128. package/lib/grid/plugins/slick.rowmovemanager.d.ts +0 -18
  129. package/lib/grid/plugins/slick.rowmovemanager.js +0 -249
  130. package/lib/grid/plugins/slick.rowselectionmodel.d.ts +0 -1
  131. package/lib/grid/plugins/slick.rowselectionmodel.js +0 -167
  132. package/lib/grid/slick-default-theme.css +0 -154
  133. package/lib/grid/slick.core.d.ts +0 -90
  134. package/lib/grid/slick.core.js +0 -574
  135. package/lib/grid/slick.creator.d.ts +0 -80
  136. package/lib/grid/slick.creator.js +0 -723
  137. package/lib/grid/slick.dataview.d.ts +0 -71
  138. package/lib/grid/slick.dataview.js +0 -1080
  139. package/lib/grid/slick.editors.core.d.ts +0 -4
  140. package/lib/grid/slick.editors.core.js +0 -232
  141. package/lib/grid/slick.editors.date.d.ts +0 -2
  142. package/lib/grid/slick.editors.date.js +0 -125
  143. package/lib/grid/slick.editors.lookup.d.ts +0 -14
  144. package/lib/grid/slick.editors.lookup.js +0 -353
  145. package/lib/grid/slick.editors.nav.d.ts +0 -6
  146. package/lib/grid/slick.editors.nav.js +0 -22
  147. package/lib/grid/slick.formatters.d.ts +0 -17
  148. package/lib/grid/slick.formatters.js +0 -137
  149. package/lib/grid/slick.grid.css +0 -325
  150. package/lib/grid/slick.grid.d.ts +0 -284
  151. package/lib/grid/slick.grid.js +0 -5395
  152. package/lib/grid/slick.groupitemmetadataprovider.d.ts +0 -39
  153. package/lib/grid/slick.groupitemmetadataprovider.js +0 -165
  154. package/lib/grid/slick.tree.css +0 -20
  155. package/lib/grid/slick.tree.d.ts +0 -33
  156. package/lib/grid/slick.tree.js +0 -220
  157. package/lib/grid.d.ts +0 -13
  158. package/lib/grid.js +0 -13
  159. package/lib/index.css +0 -2584
  160. package/lib/index.d.ts +0 -56
  161. package/lib/interaction/dataconverter.d.ts +0 -4
  162. package/lib/interaction/dataconverter.js +0 -1
  163. package/lib/interaction/eventhandler.d.ts +0 -13
  164. package/lib/interaction/eventhandler.js +0 -42
  165. package/lib/interaction/moveable.css +0 -0
  166. package/lib/interaction/moveable.d.ts +0 -39
  167. package/lib/interaction/moveable.js +0 -172
  168. package/lib/interaction/resizable.css +0 -33
  169. package/lib/interaction/resizable.d.ts +0 -37
  170. package/lib/interaction/resizable.js +0 -123
  171. package/lib/ui/auto.suggest.css +0 -14
  172. package/lib/ui/auto.suggest.d.ts +0 -17
  173. package/lib/ui/auto.suggest.js +0 -255
  174. package/lib/ui/base.css +0 -150
  175. package/lib/ui/date.picker/css/date-range-picker.css +0 -87
  176. package/lib/ui/date.picker/css/tiny-date-picker.css +0 -326
  177. package/lib/ui/date.picker/date-picker-options.d.ts +0 -11
  178. package/lib/ui/date.picker/date-picker-options.js +0 -76
  179. package/lib/ui/date.picker/lib/date-manip.d.ts +0 -74
  180. package/lib/ui/date.picker/lib/date-manip.js +0 -120
  181. package/lib/ui/date.picker/lib/dom.d.ts +0 -23
  182. package/lib/ui/date.picker/lib/dom.js +0 -28
  183. package/lib/ui/date.picker/lib/emitter.d.ts +0 -13
  184. package/lib/ui/date.picker/lib/emitter.js +0 -49
  185. package/lib/ui/date.picker/lib/fns.d.ts +0 -23
  186. package/lib/ui/date.picker/lib/fns.js +0 -43
  187. package/lib/ui/date.picker/mode/base-mode.d.ts +0 -26
  188. package/lib/ui/date.picker/mode/base-mode.js +0 -248
  189. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +0 -28
  190. package/lib/ui/date.picker/mode/dropdown-mode.js +0 -50
  191. package/lib/ui/date.picker/mode/index.d.ts +0 -28
  192. package/lib/ui/date.picker/mode/index.js +0 -18
  193. package/lib/ui/date.picker/mode/modal-mode.d.ts +0 -25
  194. package/lib/ui/date.picker/mode/modal-mode.js +0 -17
  195. package/lib/ui/date.picker/mode/permanent-mode.d.ts +0 -29
  196. package/lib/ui/date.picker/mode/permanent-mode.js +0 -19
  197. package/lib/ui/date.picker/views/day-picker.d.ts +0 -40
  198. package/lib/ui/date.picker/views/day-picker.js +0 -155
  199. package/lib/ui/date.picker/views/month-picker.d.ts +0 -26
  200. package/lib/ui/date.picker/views/month-picker.js +0 -65
  201. package/lib/ui/date.picker/views/year-picker.d.ts +0 -20
  202. package/lib/ui/date.picker/views/year-picker.js +0 -66
  203. package/lib/ui/date.picker.d.ts +0 -66
  204. package/lib/ui/date.picker.js +0 -32
  205. package/lib/ui/dialog.css +0 -109
  206. package/lib/ui/dialog.d.ts +0 -22
  207. package/lib/ui/dialog.js +0 -113
  208. package/lib/ui/drop.down.css +0 -472
  209. package/lib/ui/drop.down.d.ts +0 -52
  210. package/lib/ui/drop.down.js +0 -2112
  211. package/lib/ui/number.input.css +0 -3
  212. package/lib/ui/number.input.d.ts +0 -12
  213. package/lib/ui/number.input.js +0 -64
  214. 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,6 +0,0 @@
1
- export declare let keyCodes: {
2
- LEFT: number;
3
- RIGHT: number;
4
- };
5
- export declare function handleKeydownLRNav(e: any): void;
6
- export declare function handleKeydownLRNoNav(e: any): void;
@@ -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, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
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
- };