tabulator-tables 5.4.3 → 5.4.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.
Files changed (253) hide show
  1. package/.babelrc.json +3 -3
  2. package/.editorconfig +6 -6
  3. package/.eslintignore +3 -3
  4. package/.eslintrc.js +28 -28
  5. package/.github/ISSUE_TEMPLATE/bug_report.md +58 -58
  6. package/.github/ISSUE_TEMPLATE/documentation.md +14 -14
  7. package/.github/ISSUE_TEMPLATE/feature_request.md +24 -24
  8. package/.github/ISSUE_TEMPLATE/question.md +12 -12
  9. package/.github/workflows/bad-files-check.yml +39 -39
  10. package/.github/workflows/lint-and-test.yml +30 -30
  11. package/CODE_OF_CONDUCT.md +46 -46
  12. package/CONTRIBUTING.md +22 -22
  13. package/LICENSE +20 -20
  14. package/README.md +76 -76
  15. package/bower.json +40 -40
  16. package/build/Bundler.js +185 -185
  17. package/build/rollup.js +6 -6
  18. package/dist/css/tabulator.css +0 -5
  19. package/dist/css/tabulator.css.map +1 -1
  20. package/dist/css/tabulator.min.css +1 -1
  21. package/dist/css/tabulator.min.css.map +1 -1
  22. package/dist/css/tabulator_bootstrap3.css +0 -5
  23. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  24. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  25. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  26. package/dist/css/tabulator_bootstrap4.css +0 -5
  27. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  28. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  29. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  30. package/dist/css/tabulator_bootstrap5.css +0 -5
  31. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  32. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  33. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  34. package/dist/css/tabulator_bulma.css +0 -5
  35. package/dist/css/tabulator_bulma.css.map +1 -1
  36. package/dist/css/tabulator_bulma.min.css +1 -1
  37. package/dist/css/tabulator_bulma.min.css.map +1 -1
  38. package/dist/css/tabulator_materialize.css +0 -5
  39. package/dist/css/tabulator_materialize.css.map +1 -1
  40. package/dist/css/tabulator_materialize.min.css +1 -1
  41. package/dist/css/tabulator_materialize.min.css.map +1 -1
  42. package/dist/css/tabulator_midnight.css +0 -5
  43. package/dist/css/tabulator_midnight.css.map +1 -1
  44. package/dist/css/tabulator_midnight.min.css +1 -1
  45. package/dist/css/tabulator_midnight.min.css.map +1 -1
  46. package/dist/css/tabulator_modern.css +0 -5
  47. package/dist/css/tabulator_modern.css.map +1 -1
  48. package/dist/css/tabulator_modern.min.css +1 -1
  49. package/dist/css/tabulator_modern.min.css.map +1 -1
  50. package/dist/css/tabulator_semanticui.css +102 -107
  51. package/dist/css/tabulator_semanticui.css.map +1 -1
  52. package/dist/css/tabulator_semanticui.min.css +1 -1
  53. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  54. package/dist/css/tabulator_simple.css +0 -5
  55. package/dist/css/tabulator_simple.css.map +1 -1
  56. package/dist/css/tabulator_simple.min.css +1 -1
  57. package/dist/css/tabulator_simple.min.css.map +1 -1
  58. package/dist/css/tabulator_site.css +0 -5
  59. package/dist/css/tabulator_site.css.map +1 -1
  60. package/dist/css/tabulator_site.min.css +1 -1
  61. package/dist/css/tabulator_site.min.css.map +1 -1
  62. package/dist/js/jquery_wrapper.js +55 -55
  63. package/dist/js/tabulator.js +25847 -25711
  64. package/dist/js/tabulator.js.map +1 -1
  65. package/dist/js/tabulator.min.js +2 -2
  66. package/dist/js/tabulator.min.js.map +1 -1
  67. package/dist/js/tabulator_esm.js +25926 -25790
  68. package/dist/js/tabulator_esm.js.map +1 -1
  69. package/dist/js/tabulator_esm.min.js +2 -2
  70. package/dist/js/tabulator_esm.min.js.map +1 -1
  71. package/package.json +65 -65
  72. package/src/js/builds/esm.js +14 -14
  73. package/src/js/builds/jquery_wrapper.js +55 -55
  74. package/src/js/core/ColumnManager.js +730 -730
  75. package/src/js/core/CoreFeature.js +138 -138
  76. package/src/js/core/FooterManager.js +101 -101
  77. package/src/js/core/Module.js +141 -141
  78. package/src/js/core/RowManager.js +1112 -1101
  79. package/src/js/core/Tabulator.js +895 -892
  80. package/src/js/core/TabulatorFull.js +10 -10
  81. package/src/js/core/cell/Cell.js +295 -295
  82. package/src/js/core/cell/CellComponent.js +76 -76
  83. package/src/js/core/column/Column.js +949 -949
  84. package/src/js/core/column/ColumnComponent.js +152 -152
  85. package/src/js/core/column/defaults/options.js +17 -17
  86. package/src/js/core/defaults/options.js +65 -65
  87. package/src/js/core/modules/core.js +2 -2
  88. package/src/js/core/modules/optional.js +34 -34
  89. package/src/js/core/rendering/Renderer.js +203 -203
  90. package/src/js/core/rendering/renderers/BasicHorizontal.js +19 -19
  91. package/src/js/core/rendering/renderers/BasicVertical.js +79 -78
  92. package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +577 -577
  93. package/src/js/core/rendering/renderers/VirtualDomVertical.js +579 -579
  94. package/src/js/core/row/PseudoRow.js +44 -44
  95. package/src/js/core/row/Row.js +457 -457
  96. package/src/js/core/row/RowComponent.js +93 -93
  97. package/src/js/core/tools/Alert.js +61 -61
  98. package/src/js/core/tools/ComponentFunctionBinder.js +32 -32
  99. package/src/js/core/tools/DataLoader.js +119 -119
  100. package/src/js/core/tools/DeprecationAdvisor.js +46 -46
  101. package/src/js/core/tools/ExternalEventBus.js +104 -104
  102. package/src/js/core/tools/Helpers.js +46 -46
  103. package/src/js/core/tools/InteractionMonitor.js +321 -321
  104. package/src/js/core/tools/InternalEventBus.js +161 -161
  105. package/src/js/core/tools/ModuleBinder.js +104 -104
  106. package/src/js/core/tools/OptionsList.js +44 -40
  107. package/src/js/core/tools/Popup.js +304 -304
  108. package/src/js/core/tools/TableRegistry.js +61 -61
  109. package/src/js/modules/Accessor/Accessor.js +115 -115
  110. package/src/js/modules/Ajax/Ajax.js +143 -143
  111. package/src/js/modules/Ajax/defaults/config.js +2 -2
  112. package/src/js/modules/Ajax/defaults/contentTypeFormatters.js +44 -44
  113. package/src/js/modules/Ajax/defaults/loaderPromise.js +86 -86
  114. package/src/js/modules/Ajax/defaults/urlGenerator.js +43 -43
  115. package/src/js/modules/Clipboard/Clipboard.js +279 -279
  116. package/src/js/modules/Clipboard/defaults/pasteActions.js +10 -10
  117. package/src/js/modules/Clipboard/defaults/pasteParsers.js +74 -74
  118. package/src/js/modules/ColumnCalcs/CalcComponent.js +47 -47
  119. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +581 -568
  120. package/src/js/modules/ColumnCalcs/defaults/calculations.js +85 -85
  121. package/src/js/modules/Comms/Comms.js +51 -51
  122. package/src/js/modules/DataTree/DataTree.js +603 -603
  123. package/src/js/modules/Download/Download.js +148 -148
  124. package/src/js/modules/Download/defaults/downloaders/csv.js +61 -61
  125. package/src/js/modules/Download/defaults/downloaders/html.js +4 -4
  126. package/src/js/modules/Download/defaults/downloaders/json.js +33 -33
  127. package/src/js/modules/Download/defaults/downloaders/jsonLines.js +31 -31
  128. package/src/js/modules/Download/defaults/downloaders/pdf.js +111 -111
  129. package/src/js/modules/Download/defaults/downloaders/xlsx.js +98 -98
  130. package/src/js/modules/Download/defaults/downloaders.js +14 -14
  131. package/src/js/modules/Edit/Edit.js +735 -736
  132. package/src/js/modules/Edit/List.js +1037 -1033
  133. package/src/js/modules/Edit/defaults/editors/autocomplete.js +11 -11
  134. package/src/js/modules/Edit/defaults/editors/date.js +138 -110
  135. package/src/js/modules/Edit/defaults/editors/datetime.js +125 -97
  136. package/src/js/modules/Edit/defaults/editors/input.js +76 -74
  137. package/src/js/modules/Edit/defaults/editors/list.js +6 -6
  138. package/src/js/modules/Edit/defaults/editors/number.js +109 -107
  139. package/src/js/modules/Edit/defaults/editors/progress.js +126 -126
  140. package/src/js/modules/Edit/defaults/editors/range.js +80 -78
  141. package/src/js/modules/Edit/defaults/editors/select.js +9 -9
  142. package/src/js/modules/Edit/defaults/editors/star.js +145 -145
  143. package/src/js/modules/Edit/defaults/editors/textarea.js +122 -120
  144. package/src/js/modules/Edit/defaults/editors/tickCross.js +94 -96
  145. package/src/js/modules/Edit/defaults/editors/time.js +126 -98
  146. package/src/js/modules/Edit/defaults/editors.js +28 -28
  147. package/src/js/modules/Edit/inputMask.js +73 -73
  148. package/src/js/modules/Export/Export.js +623 -623
  149. package/src/js/modules/Export/ExportColumn.js +10 -10
  150. package/src/js/modules/Export/ExportRow.js +9 -9
  151. package/src/js/modules/Filter/Filter.js +892 -892
  152. package/src/js/modules/Filter/defaults/filters.js +107 -107
  153. package/src/js/modules/Format/Format.js +212 -212
  154. package/src/js/modules/Format/defaults/formatters/buttonCross.js +2 -2
  155. package/src/js/modules/Format/defaults/formatters/buttonTick.js +2 -2
  156. package/src/js/modules/Format/defaults/formatters/color.js +3 -3
  157. package/src/js/modules/Format/defaults/formatters/datetime.js +36 -36
  158. package/src/js/modules/Format/defaults/formatters/datetimediff.js +40 -40
  159. package/src/js/modules/Format/defaults/formatters/handle.js +3 -3
  160. package/src/js/modules/Format/defaults/formatters/html.js +2 -2
  161. package/src/js/modules/Format/defaults/formatters/image.js +39 -39
  162. package/src/js/modules/Format/defaults/formatters/link.js +77 -77
  163. package/src/js/modules/Format/defaults/formatters/lookup.js +9 -9
  164. package/src/js/modules/Format/defaults/formatters/money.js +36 -36
  165. package/src/js/modules/Format/defaults/formatters/plaintext.js +2 -2
  166. package/src/js/modules/Format/defaults/formatters/progress.js +132 -132
  167. package/src/js/modules/Format/defaults/formatters/responsiveCollapse.js +43 -43
  168. package/src/js/modules/Format/defaults/formatters/rowSelection.js +59 -59
  169. package/src/js/modules/Format/defaults/formatters/rownum.js +9 -9
  170. package/src/js/modules/Format/defaults/formatters/star.js +37 -37
  171. package/src/js/modules/Format/defaults/formatters/textarea.js +3 -3
  172. package/src/js/modules/Format/defaults/formatters/tickCross.js +21 -21
  173. package/src/js/modules/Format/defaults/formatters/traffic.js +46 -46
  174. package/src/js/modules/Format/defaults/formatters.js +42 -42
  175. package/src/js/modules/FrozenColumns/FrozenColumns.js +299 -299
  176. package/src/js/modules/FrozenRows/FrozenRows.js +169 -159
  177. package/src/js/modules/GroupRows/Group.js +597 -598
  178. package/src/js/modules/GroupRows/GroupComponent.js +66 -66
  179. package/src/js/modules/GroupRows/GroupRows.js +639 -639
  180. package/src/js/modules/History/History.js +171 -171
  181. package/src/js/modules/History/defaults/redoers.js +24 -24
  182. package/src/js/modules/History/defaults/undoers.js +24 -24
  183. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +181 -181
  184. package/src/js/modules/Import/Import.js +193 -193
  185. package/src/js/modules/Import/defaults/importers/array.js +4 -4
  186. package/src/js/modules/Import/defaults/importers/csv.js +62 -62
  187. package/src/js/modules/Import/defaults/importers/json.js +7 -7
  188. package/src/js/modules/Import/defaults/importers.js +8 -8
  189. package/src/js/modules/Interaction/Interaction.js +325 -325
  190. package/src/js/modules/Keybindings/Keybindings.js +172 -172
  191. package/src/js/modules/Keybindings/defaults/actions.js +118 -118
  192. package/src/js/modules/Keybindings/defaults/bindings.js +12 -12
  193. package/src/js/modules/Layout/Layout.js +49 -49
  194. package/src/js/modules/Layout/defaults/modes/fitColumns.js +171 -171
  195. package/src/js/modules/Layout/defaults/modes/fitData.js +9 -9
  196. package/src/js/modules/Layout/defaults/modes/fitDataGeneral.js +9 -9
  197. package/src/js/modules/Layout/defaults/modes/fitDataStretch.js +39 -39
  198. package/src/js/modules/Layout/defaults/modes.js +11 -11
  199. package/src/js/modules/Localize/Localize.js +185 -185
  200. package/src/js/modules/Localize/defaults/langs.js +36 -36
  201. package/src/js/modules/Menu/Menu.js +302 -302
  202. package/src/js/modules/MoveColumns/MoveColumns.js +299 -299
  203. package/src/js/modules/MoveRows/MoveRows.js +635 -635
  204. package/src/js/modules/Mutator/Mutator.js +161 -161
  205. package/src/js/modules/Page/Page.js +881 -881
  206. package/src/js/modules/Page/defaults/pageCounters/pages.js +32 -32
  207. package/src/js/modules/Page/defaults/pageCounters/rows.js +39 -39
  208. package/src/js/modules/Page/defaults/pageCounters.js +7 -7
  209. package/src/js/modules/Persistence/Persistence.js +458 -458
  210. package/src/js/modules/Persistence/defaults/readers.js +29 -29
  211. package/src/js/modules/Persistence/defaults/writers.js +12 -12
  212. package/src/js/modules/Popup/Popup.js +231 -231
  213. package/src/js/modules/Print/Print.js +137 -137
  214. package/src/js/modules/ReactiveData/ReactiveData.js +408 -408
  215. package/src/js/modules/ResizeColumns/ResizeColumns.js +309 -309
  216. package/src/js/modules/ResizeRows/ResizeRows.js +111 -111
  217. package/src/js/modules/ResizeTable/ResizeTable.js +159 -159
  218. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +345 -345
  219. package/src/js/modules/SelectRow/SelectRow.js +446 -444
  220. package/src/js/modules/Sort/Sort.js +470 -470
  221. package/src/js/modules/Sort/defaults/sorters/alphanum.js +43 -43
  222. package/src/js/modules/Sort/defaults/sorters/array.js +53 -53
  223. package/src/js/modules/Sort/defaults/sorters/boolean.js +6 -6
  224. package/src/js/modules/Sort/defaults/sorters/date.js +9 -9
  225. package/src/js/modules/Sort/defaults/sorters/datetime.js +43 -43
  226. package/src/js/modules/Sort/defaults/sorters/exists.js +6 -6
  227. package/src/js/modules/Sort/defaults/sorters/number.js +39 -39
  228. package/src/js/modules/Sort/defaults/sorters/string.js +33 -33
  229. package/src/js/modules/Sort/defaults/sorters/time.js +9 -9
  230. package/src/js/modules/Sort/defaults/sorters.js +20 -20
  231. package/src/js/modules/Tooltip/Tooltip.js +130 -130
  232. package/src/js/modules/Validate/Validate.js +305 -305
  233. package/src/js/modules/Validate/defaults/validators.js +138 -138
  234. package/src/scss/tabulator.scss +1464 -1467
  235. package/src/scss/themes/bootstrap/functions4.scss +118 -118
  236. package/src/scss/themes/bootstrap/functions5.scss +302 -302
  237. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +284 -284
  238. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +544 -544
  239. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +574 -574
  240. package/src/scss/themes/bootstrap/variables3.scss +870 -870
  241. package/src/scss/themes/bootstrap/variables4.scss +930 -930
  242. package/src/scss/themes/bootstrap/variables5.scss +1641 -1641
  243. package/src/scss/themes/bulma/tabulator_bulma.scss +252 -252
  244. package/src/scss/themes/bulma/variables.scss +197 -197
  245. package/src/scss/themes/materialize/tabulator_materialize.scss +265 -265
  246. package/src/scss/themes/materialize/variables.scss +70 -70
  247. package/src/scss/themes/semanticui/tabulator_semanticui.scss +561 -561
  248. package/src/scss/themes/semanticui/variables.scss +839 -839
  249. package/src/scss/themes/semanticui/variables_table.scss +247 -247
  250. package/src/scss/themes/tabulator_midnight.scss +158 -158
  251. package/src/scss/themes/tabulator_modern.scss +231 -231
  252. package/src/scss/themes/tabulator_simple.scss +102 -102
  253. package/src/scss/themes/tabulator_site.scss +189 -189
@@ -1,12 +1,12 @@
1
- import List from '../../List.js';
2
-
3
- export default function(cell, onRendered, success, cancel, editorParams){
4
-
5
- this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam");
6
-
7
- editorParams.autocomplete = true;
8
-
9
- var list = new List(this, cell, onRendered, success, cancel, editorParams);
10
-
11
- return list.input;
1
+ import List from '../../List.js';
2
+
3
+ export default function(cell, onRendered, success, cancel, editorParams){
4
+
5
+ this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam");
6
+
7
+ editorParams.autocomplete = true;
8
+
9
+ var list = new List(this, cell, onRendered, success, cancel, editorParams);
10
+
11
+ return list.input;
12
12
  }
@@ -1,110 +1,138 @@
1
- //input element
2
- export default function(cell, onRendered, success, cancel, editorParams){
3
- var inputFormat = editorParams.format,
4
- DT = inputFormat ? (window.DateTime || luxon.DateTime) : null;
5
-
6
- //create and style input
7
- var cellValue = cell.getValue(),
8
- input = document.createElement("input");
9
-
10
- function convertDate(value){
11
- var newDatetime;
12
-
13
- if(DT.isDateTime(value)){
14
- newDatetime = value;
15
- }else if(inputFormat === "iso"){
16
- newDatetime = DT.fromISO(String(value));
17
- }else{
18
- newDatetime = DT.fromFormat(String(value), inputFormat);
19
- }
20
-
21
- return newDatetime.toFormat("yyyy-MM-dd");
22
- }
23
-
24
- input.type = "date";
25
- input.style.padding = "4px";
26
- input.style.width = "100%";
27
- input.style.boxSizing = "border-box";
28
-
29
- if(editorParams.max){
30
- input.setAttribute("max", inputFormat ? convertDate(editorParams.max) : editorParams.max);
31
- }
32
-
33
- if(editorParams.min){
34
- input.setAttribute("min", inputFormat ? convertDate(editorParams.min) : editorParams.min);
35
- }
36
-
37
- if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
38
- for (let key in editorParams.elementAttributes){
39
- if(key.charAt(0) == "+"){
40
- key = key.slice(1);
41
- input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
42
- }else{
43
- input.setAttribute(key, editorParams.elementAttributes[key]);
44
- }
45
- }
46
- }
47
-
48
- cellValue = typeof cellValue !== "undefined" ? cellValue : "";
49
-
50
- if(inputFormat){
51
- if(DT){
52
- cellValue = convertDate(cellValue);
53
- }else{
54
- console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js");
55
- }
56
- }
57
-
58
- input.value = cellValue;
59
-
60
- onRendered(function(){
61
- input.focus({preventScroll: true});
62
- input.style.height = "100%";
63
-
64
- if(editorParams.selectContents){
65
- input.select();
66
- }
67
- });
68
-
69
- function onChange(e){
70
- var value = input.value;
71
-
72
- if(((cellValue === null || typeof cellValue === "undefined") && value !== "") || value !== cellValue){
73
-
74
- if(value && inputFormat){
75
- value = DT.fromFormat(String(value), "yyyy-MM-dd").toFormat(inputFormat);
76
- }
77
-
78
- if(success(value)){
79
- cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
80
- }
81
- }else{
82
- cancel();
83
- }
84
- }
85
-
86
- //submit new value on blur or change
87
- input.addEventListener("change", onChange);
88
- input.addEventListener("blur", onChange);
89
-
90
- //submit new value on enter
91
- input.addEventListener("keydown", function(e){
92
- switch(e.keyCode){
93
- // case 9:
94
- case 13:
95
- onChange(e);
96
- break;
97
-
98
- case 27:
99
- cancel();
100
- break;
101
-
102
- case 35:
103
- case 36:
104
- e.stopPropagation();
105
- break;
106
- }
107
- });
108
-
109
- return input;
110
- }
1
+ //input element
2
+ export default function(cell, onRendered, success, cancel, editorParams){
3
+ var inputFormat = editorParams.format,
4
+ vertNav = editorParams.verticalNavigation || "editor",
5
+ DT = inputFormat ? (window.DateTime || luxon.DateTime) : null;
6
+
7
+ //create and style input
8
+ var cellValue = cell.getValue(),
9
+ input = document.createElement("input");
10
+
11
+ function convertDate(value){
12
+ var newDatetime;
13
+
14
+ if(DT.isDateTime(value)){
15
+ newDatetime = value;
16
+ }else if(inputFormat === "iso"){
17
+ newDatetime = DT.fromISO(String(value));
18
+ }else{
19
+ newDatetime = DT.fromFormat(String(value), inputFormat);
20
+ }
21
+
22
+ return newDatetime.toFormat("yyyy-MM-dd");
23
+ }
24
+
25
+ input.type = "date";
26
+ input.style.padding = "4px";
27
+ input.style.width = "100%";
28
+ input.style.boxSizing = "border-box";
29
+
30
+ if(editorParams.max){
31
+ input.setAttribute("max", inputFormat ? convertDate(editorParams.max) : editorParams.max);
32
+ }
33
+
34
+ if(editorParams.min){
35
+ input.setAttribute("min", inputFormat ? convertDate(editorParams.min) : editorParams.min);
36
+ }
37
+
38
+ if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
39
+ for (let key in editorParams.elementAttributes){
40
+ if(key.charAt(0) == "+"){
41
+ key = key.slice(1);
42
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
43
+ }else{
44
+ input.setAttribute(key, editorParams.elementAttributes[key]);
45
+ }
46
+ }
47
+ }
48
+
49
+ cellValue = typeof cellValue !== "undefined" ? cellValue : "";
50
+
51
+ if(inputFormat){
52
+ if(DT){
53
+ cellValue = convertDate(cellValue);
54
+ }else{
55
+ console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
56
+ }
57
+ }
58
+
59
+ input.value = cellValue;
60
+
61
+ onRendered(function(){
62
+ if(cell._getSelf){
63
+ input.focus({preventScroll: true});
64
+ input.style.height = "100%";
65
+
66
+ if(editorParams.selectContents){
67
+ input.select();
68
+ }
69
+ }
70
+ });
71
+
72
+ function onChange(){
73
+ var value = input.value,
74
+ luxDate;
75
+
76
+ if(((cellValue === null || typeof cellValue === "undefined") && value !== "") || value !== cellValue){
77
+
78
+ if(value && inputFormat){
79
+ luxDate = DT.fromFormat(String(value), "yyyy-MM-dd");
80
+
81
+ switch(inputFormat){
82
+ case true:
83
+ value = luxDate;
84
+ break;
85
+
86
+ case "iso":
87
+ value = luxDate.toISO();
88
+ break;
89
+
90
+ default:
91
+ value = luxDate.toFormat(inputFormat);
92
+ }
93
+ }
94
+
95
+ if(success(value)){
96
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
97
+ }
98
+ }else{
99
+ cancel();
100
+ }
101
+ }
102
+
103
+ //submit new value on blur
104
+ input.addEventListener("blur", function(e) {
105
+ if (e.relatedTarget || e.rangeParent || e.explicitOriginalTarget !== input) {
106
+ onChange(); // only on a "true" blur; not when focusing browser's date/time picker
107
+ }
108
+ });
109
+
110
+ //submit new value on enter
111
+ input.addEventListener("keydown", function(e){
112
+ switch(e.keyCode){
113
+ // case 9:
114
+ case 13:
115
+ onChange();
116
+ break;
117
+
118
+ case 27:
119
+ cancel();
120
+ break;
121
+
122
+ case 35:
123
+ case 36:
124
+ e.stopPropagation();
125
+ break;
126
+
127
+ case 38: //up arrow
128
+ case 40: //down arrow
129
+ if(vertNav == "editor"){
130
+ e.stopImmediatePropagation();
131
+ e.stopPropagation();
132
+ }
133
+ break;
134
+ }
135
+ });
136
+
137
+ return input;
138
+ }
@@ -1,97 +1,125 @@
1
- //input element
2
- export default function(cell, onRendered, success, cancel, editorParams){
3
- var inputFormat = editorParams.format,
4
- DT = inputFormat ? (window.DateTime || luxon.DateTime) : null,
5
- newDatetime;
6
-
7
- //create and style input
8
- var cellValue = cell.getValue(),
9
- input = document.createElement("input");
10
-
11
- input.type = "datetime-local";
12
- input.style.padding = "4px";
13
- input.style.width = "100%";
14
- input.style.boxSizing = "border-box";
15
-
16
- if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
17
- for (let key in editorParams.elementAttributes){
18
- if(key.charAt(0) == "+"){
19
- key = key.slice(1);
20
- input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
21
- }else{
22
- input.setAttribute(key, editorParams.elementAttributes[key]);
23
- }
24
- }
25
- }
26
-
27
- cellValue = typeof cellValue !== "undefined" ? cellValue : "";
28
-
29
- if(inputFormat){
30
- if(DT){
31
- if(DT.isDateTime(cellValue)){
32
- newDatetime = cellValue;
33
- }else if(inputFormat === "iso"){
34
- newDatetime = DT.fromISO(String(cellValue));
35
- }else{
36
- newDatetime = DT.fromFormat(String(cellValue), inputFormat);
37
- }
38
-
39
- cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("hh:mm");
40
- }else{
41
- console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js");
42
- }
43
- }
44
-
45
- input.value = cellValue;
46
-
47
- onRendered(function(){
48
- input.focus({preventScroll: true});
49
- input.style.height = "100%";
50
-
51
- if(editorParams.selectContents){
52
- input.select();
53
- }
54
- });
55
-
56
- function onChange(e){
57
- var value = input.value;
58
-
59
- if(((cellValue === null || typeof cellValue === "undefined") && value !== "") || value !== cellValue){
60
-
61
- if(value && inputFormat){
62
- value = DT.fromISO(String(value)).toFormat(inputFormat);
63
- }
64
-
65
- if(success(value)){
66
- cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
67
- }
68
- }else{
69
- cancel();
70
- }
71
- }
72
-
73
- //submit new value on blur or change
74
- input.addEventListener("change", onChange);
75
- input.addEventListener("blur", onChange);
76
-
77
- //submit new value on enter
78
- input.addEventListener("keydown", function(e){
79
- switch(e.keyCode){
80
- // case 9:
81
- case 13:
82
- onChange(e);
83
- break;
84
-
85
- case 27:
86
- cancel();
87
- break;
88
-
89
- case 35:
90
- case 36:
91
- e.stopPropagation();
92
- break;
93
- }
94
- });
95
-
96
- return input;
97
- }
1
+ //input element
2
+ export default function(cell, onRendered, success, cancel, editorParams){
3
+ var inputFormat = editorParams.format,
4
+ vertNav = editorParams.verticalNavigation || "editor",
5
+ DT = inputFormat ? (window.DateTime || luxon.DateTime) : null,
6
+ newDatetime;
7
+
8
+ //create and style input
9
+ var cellValue = cell.getValue(),
10
+ input = document.createElement("input");
11
+
12
+ input.type = "datetime-local";
13
+ input.style.padding = "4px";
14
+ input.style.width = "100%";
15
+ input.style.boxSizing = "border-box";
16
+
17
+ if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
18
+ for (let key in editorParams.elementAttributes){
19
+ if(key.charAt(0) == "+"){
20
+ key = key.slice(1);
21
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
22
+ }else{
23
+ input.setAttribute(key, editorParams.elementAttributes[key]);
24
+ }
25
+ }
26
+ }
27
+
28
+ cellValue = typeof cellValue !== "undefined" ? cellValue : "";
29
+
30
+ if(inputFormat){
31
+ if(DT){
32
+ if(DT.isDateTime(cellValue)){
33
+ newDatetime = cellValue;
34
+ }else if(inputFormat === "iso"){
35
+ newDatetime = DT.fromISO(String(cellValue));
36
+ }else{
37
+ newDatetime = DT.fromFormat(String(cellValue), inputFormat);
38
+ }
39
+
40
+ cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("hh:mm");
41
+ }else{
42
+ console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
43
+ }
44
+ }
45
+
46
+ input.value = cellValue;
47
+
48
+ onRendered(function(){
49
+ if(cell._getSelf){
50
+ input.focus({preventScroll: true});
51
+ input.style.height = "100%";
52
+
53
+ if(editorParams.selectContents){
54
+ input.select();
55
+ }
56
+ }
57
+ });
58
+
59
+ function onChange(){
60
+ var value = input.value,
61
+ luxDateTime;
62
+
63
+ if(((cellValue === null || typeof cellValue === "undefined") && value !== "") || value !== cellValue){
64
+
65
+ if(value && inputFormat){
66
+ luxDateTime = DT.fromISO(String(value));
67
+
68
+ switch(inputFormat){
69
+ case true:
70
+ value = luxDateTime;
71
+ break;
72
+
73
+ case "iso":
74
+ value = luxDateTime.toISO();
75
+ break;
76
+
77
+ default:
78
+ value = luxDateTime.toFormat(inputFormat);
79
+ }
80
+ }
81
+
82
+ if(success(value)){
83
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
84
+ }
85
+ }else{
86
+ cancel();
87
+ }
88
+ }
89
+
90
+ //submit new value on blur
91
+ input.addEventListener("blur", function(e) {
92
+ if (e.relatedTarget || e.rangeParent || e.explicitOriginalTarget !== input) {
93
+ onChange(); // only on a "true" blur; not when focusing browser's date/time picker
94
+ }
95
+ });
96
+
97
+ //submit new value on enter
98
+ input.addEventListener("keydown", function(e){
99
+ switch(e.keyCode){
100
+ // case 9:
101
+ case 13:
102
+ onChange();
103
+ break;
104
+
105
+ case 27:
106
+ cancel();
107
+ break;
108
+
109
+ case 35:
110
+ case 36:
111
+ e.stopPropagation();
112
+ break;
113
+
114
+ case 38: //up arrow
115
+ case 40: //down arrow
116
+ if(vertNav == "editor"){
117
+ e.stopImmediatePropagation();
118
+ e.stopPropagation();
119
+ }
120
+ break;
121
+ }
122
+ });
123
+
124
+ return input;
125
+ }
@@ -1,75 +1,77 @@
1
- import maskInput from '../../inputMask.js';
2
-
3
- //input element
4
- export default function(cell, onRendered, success, cancel, editorParams){
5
- //create and style input
6
- var cellValue = cell.getValue(),
7
- input = document.createElement("input");
8
-
9
- input.setAttribute("type", editorParams.search ? "search" : "text");
10
-
11
- input.style.padding = "4px";
12
- input.style.width = "100%";
13
- input.style.boxSizing = "border-box";
14
-
15
- if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
16
- for (let key in editorParams.elementAttributes){
17
- if(key.charAt(0) == "+"){
18
- key = key.slice(1);
19
- input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
20
- }else{
21
- input.setAttribute(key, editorParams.elementAttributes[key]);
22
- }
23
- }
24
- }
25
-
26
- input.value = typeof cellValue !== "undefined" ? cellValue : "";
27
-
28
- onRendered(function(){
29
- input.focus({preventScroll: true});
30
- input.style.height = "100%";
31
-
32
- if(editorParams.selectContents){
33
- input.select();
34
- }
35
- });
36
-
37
- function onChange(e){
38
- if(((cellValue === null || typeof cellValue === "undefined") && input.value !== "") || input.value !== cellValue){
39
- if(success(input.value)){
40
- cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
41
- }
42
- }else{
43
- cancel();
44
- }
45
- }
46
-
47
- //submit new value on blur or change
48
- input.addEventListener("change", onChange);
49
- input.addEventListener("blur", onChange);
50
-
51
- //submit new value on enter
52
- input.addEventListener("keydown", function(e){
53
- switch(e.keyCode){
54
- // case 9:
55
- case 13:
56
- onChange(e);
57
- break;
58
-
59
- case 27:
60
- cancel();
61
- break;
62
-
63
- case 35:
64
- case 36:
65
- e.stopPropagation();
66
- break;
67
- }
68
- });
69
-
70
- if(editorParams.mask){
71
- maskInput(input, editorParams);
72
- }
73
-
74
- return input;
1
+ import maskInput from '../../inputMask.js';
2
+
3
+ //input element
4
+ export default function(cell, onRendered, success, cancel, editorParams){
5
+ //create and style input
6
+ var cellValue = cell.getValue(),
7
+ input = document.createElement("input");
8
+
9
+ input.setAttribute("type", editorParams.search ? "search" : "text");
10
+
11
+ input.style.padding = "4px";
12
+ input.style.width = "100%";
13
+ input.style.boxSizing = "border-box";
14
+
15
+ if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
16
+ for (let key in editorParams.elementAttributes){
17
+ if(key.charAt(0) == "+"){
18
+ key = key.slice(1);
19
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
20
+ }else{
21
+ input.setAttribute(key, editorParams.elementAttributes[key]);
22
+ }
23
+ }
24
+ }
25
+
26
+ input.value = typeof cellValue !== "undefined" ? cellValue : "";
27
+
28
+ onRendered(function(){
29
+ if(cell._getSelf){
30
+ input.focus({preventScroll: true});
31
+ input.style.height = "100%";
32
+
33
+ if(editorParams.selectContents){
34
+ input.select();
35
+ }
36
+ }
37
+ });
38
+
39
+ function onChange(e){
40
+ if(((cellValue === null || typeof cellValue === "undefined") && input.value !== "") || input.value !== cellValue){
41
+ if(success(input.value)){
42
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
43
+ }
44
+ }else{
45
+ cancel();
46
+ }
47
+ }
48
+
49
+ //submit new value on blur or change
50
+ input.addEventListener("change", onChange);
51
+ input.addEventListener("blur", onChange);
52
+
53
+ //submit new value on enter
54
+ input.addEventListener("keydown", function(e){
55
+ switch(e.keyCode){
56
+ // case 9:
57
+ case 13:
58
+ onChange(e);
59
+ break;
60
+
61
+ case 27:
62
+ cancel();
63
+ break;
64
+
65
+ case 35:
66
+ case 36:
67
+ e.stopPropagation();
68
+ break;
69
+ }
70
+ });
71
+
72
+ if(editorParams.mask){
73
+ maskInput(input, editorParams);
74
+ }
75
+
76
+ return input;
75
77
  }
@@ -1,7 +1,7 @@
1
- import List from '../../List.js';
2
-
3
- export default function(cell, onRendered, success, cancel, editorParams){
4
- var list = new List(this, cell, onRendered, success, cancel, editorParams);
5
-
6
- return list.input;
1
+ import List from '../../List.js';
2
+
3
+ export default function(cell, onRendered, success, cancel, editorParams){
4
+ var list = new List(this, cell, onRendered, success, cancel, editorParams);
5
+
6
+ return list.input;
7
7
  }