tabulator-tables 5.2.7 → 5.3.2

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/.eslintignore +3 -0
  2. package/.eslintrc.js +28 -0
  3. package/.github/workflows/bad-files-check.yml +39 -0
  4. package/.github/workflows/lint-and-test.yml +31 -0
  5. package/README.md +3 -3
  6. package/bower.json +1 -1
  7. package/build/Bundler.js +77 -77
  8. package/dist/css/tabulator.css +12 -7
  9. package/dist/css/tabulator.css.map +1 -1
  10. package/dist/css/tabulator.min.css +1 -1
  11. package/dist/css/tabulator.min.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap3.css +12 -7
  13. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  14. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  15. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  16. package/dist/css/tabulator_bootstrap4.css +12 -7
  17. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  18. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  19. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  20. package/dist/css/tabulator_bootstrap5.css +12 -7
  21. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  22. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  23. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  24. package/dist/css/tabulator_bulma.css +12 -7
  25. package/dist/css/tabulator_bulma.css.map +1 -1
  26. package/dist/css/tabulator_bulma.min.css +1 -1
  27. package/dist/css/tabulator_bulma.min.css.map +1 -1
  28. package/dist/css/tabulator_materialize.css +12 -7
  29. package/dist/css/tabulator_materialize.css.map +1 -1
  30. package/dist/css/tabulator_materialize.min.css +1 -1
  31. package/dist/css/tabulator_materialize.min.css.map +1 -1
  32. package/dist/css/tabulator_midnight.css +12 -7
  33. package/dist/css/tabulator_midnight.css.map +1 -1
  34. package/dist/css/tabulator_midnight.min.css +1 -1
  35. package/dist/css/tabulator_midnight.min.css.map +1 -1
  36. package/dist/css/tabulator_modern.css +12 -7
  37. package/dist/css/tabulator_modern.css.map +1 -1
  38. package/dist/css/tabulator_modern.min.css +1 -1
  39. package/dist/css/tabulator_modern.min.css.map +1 -1
  40. package/dist/css/tabulator_semanticui.css +12 -7
  41. package/dist/css/tabulator_semanticui.css.map +1 -1
  42. package/dist/css/tabulator_semanticui.min.css +1 -1
  43. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  44. package/dist/css/tabulator_simple.css +12 -7
  45. package/dist/css/tabulator_simple.css.map +1 -1
  46. package/dist/css/tabulator_simple.min.css +1 -1
  47. package/dist/css/tabulator_simple.min.css.map +1 -1
  48. package/dist/css/tabulator_site.css +12 -7
  49. package/dist/css/tabulator_site.css.map +1 -1
  50. package/dist/css/tabulator_site.min.css +1 -1
  51. package/dist/css/tabulator_site.min.css.map +1 -1
  52. package/dist/js/jquery_wrapper.js +37 -37
  53. package/dist/js/tabulator.js +1551 -793
  54. package/dist/js/tabulator.js.map +1 -1
  55. package/dist/js/tabulator.min.js +2 -2
  56. package/dist/js/tabulator.min.js.map +1 -1
  57. package/dist/js/tabulator_esm.js +4300 -3581
  58. package/dist/js/tabulator_esm.js.map +1 -1
  59. package/dist/js/tabulator_esm.min.js +2 -2
  60. package/dist/js/tabulator_esm.min.js.map +1 -1
  61. package/package.json +4 -1
  62. package/src/js/builds/jquery_wrapper.js +37 -37
  63. package/src/js/core/ColumnManager.js +270 -232
  64. package/src/js/core/CoreFeature.js +16 -2
  65. package/src/js/core/FooterManager.js +10 -10
  66. package/src/js/core/Module.js +8 -8
  67. package/src/js/core/RowManager.js +139 -156
  68. package/src/js/core/Tabulator.js +88 -74
  69. package/src/js/core/TabulatorFull.js +1 -1
  70. package/src/js/core/cell/Cell.js +15 -16
  71. package/src/js/core/cell/CellComponent.js +2 -2
  72. package/src/js/core/column/Column.js +81 -68
  73. package/src/js/core/column/ColumnComponent.js +4 -4
  74. package/src/js/core/column/defaults/options.js +1 -1
  75. package/src/js/core/defaults/options.js +4 -2
  76. package/src/js/core/rendering/Renderer.js +19 -19
  77. package/src/js/core/rendering/renderers/BasicHorizontal.js +1 -2
  78. package/src/js/core/rendering/renderers/BasicVertical.js +1 -1
  79. package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +42 -58
  80. package/src/js/core/rendering/renderers/VirtualDomVertical.js +31 -22
  81. package/src/js/core/row/Row.js +32 -8
  82. package/src/js/core/row/RowComponent.js +8 -4
  83. package/src/js/core/tools/Alert.js +44 -45
  84. package/src/js/core/tools/ComponentFunctionBinder.js +4 -2
  85. package/src/js/core/tools/DataLoader.js +3 -3
  86. package/src/js/core/tools/DeprecationAdvisor.js +47 -0
  87. package/src/js/core/tools/ExternalEventBus.js +5 -5
  88. package/src/js/core/tools/InteractionMonitor.js +41 -39
  89. package/src/js/core/tools/InternalEventBus.js +5 -5
  90. package/src/js/core/tools/ModuleBinder.js +6 -6
  91. package/src/js/core/tools/OptionsList.js +4 -4
  92. package/src/js/core/tools/Popup.js +211 -202
  93. package/src/js/modules/Accessor/Accessor.js +16 -16
  94. package/src/js/modules/Accessor/defaults/accessors.js +1 -1
  95. package/src/js/modules/Ajax/Ajax.js +7 -7
  96. package/src/js/modules/Ajax/defaults/loaderPromise.js +19 -19
  97. package/src/js/modules/Ajax/defaults/urlGenerator.js +1 -1
  98. package/src/js/modules/Clipboard/Clipboard.js +23 -23
  99. package/src/js/modules/Clipboard/defaults/pasteParsers.js +0 -2
  100. package/src/js/modules/ColumnCalcs/CalcComponent.js +2 -2
  101. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +55 -51
  102. package/src/js/modules/ColumnCalcs/defaults/calculations.js +1 -1
  103. package/src/js/modules/DataTree/DataTree.js +24 -15
  104. package/src/js/modules/Download/Download.js +15 -8
  105. package/src/js/modules/Download/defaults/downloaders/csv.js +28 -28
  106. package/src/js/modules/Download/defaults/downloaders/html.js +2 -2
  107. package/src/js/modules/Download/defaults/downloaders/json.js +14 -14
  108. package/src/js/modules/Download/defaults/downloaders/jsonLines.js +1 -1
  109. package/src/js/modules/Download/defaults/downloaders/pdf.js +17 -19
  110. package/src/js/modules/Download/defaults/downloaders/xlsx.js +2 -2
  111. package/src/js/modules/Edit/Edit.js +219 -201
  112. package/src/js/modules/Edit/List.js +1026 -1006
  113. package/src/js/modules/Edit/defaults/editors/autocomplete.js +3 -3
  114. package/src/js/modules/Edit/defaults/editors/date.js +110 -0
  115. package/src/js/modules/Edit/defaults/editors/datetime.js +97 -0
  116. package/src/js/modules/Edit/defaults/editors/input.js +7 -7
  117. package/src/js/modules/Edit/defaults/editors/list.js +2 -2
  118. package/src/js/modules/Edit/defaults/editors/number.js +12 -12
  119. package/src/js/modules/Edit/defaults/editors/progress.js +11 -11
  120. package/src/js/modules/Edit/defaults/editors/range.js +5 -5
  121. package/src/js/modules/Edit/defaults/editors/select.js +3 -3
  122. package/src/js/modules/Edit/defaults/editors/star.js +9 -9
  123. package/src/js/modules/Edit/defaults/editors/textarea.js +97 -92
  124. package/src/js/modules/Edit/defaults/editors/tickCross.js +1 -3
  125. package/src/js/modules/Edit/defaults/editors/time.js +98 -0
  126. package/src/js/modules/Edit/defaults/editors.js +8 -2
  127. package/src/js/modules/Edit/inputMask.js +19 -26
  128. package/src/js/modules/Export/Export.js +69 -65
  129. package/src/js/modules/Filter/Filter.js +88 -95
  130. package/src/js/modules/Format/Format.js +24 -26
  131. package/src/js/modules/Format/defaults/formatters/buttonCross.js +1 -1
  132. package/src/js/modules/Format/defaults/formatters/buttonTick.js +1 -1
  133. package/src/js/modules/Format/defaults/formatters/color.js +1 -1
  134. package/src/js/modules/Format/defaults/formatters/datetime.js +7 -7
  135. package/src/js/modules/Format/defaults/formatters/datetimediff.js +7 -7
  136. package/src/js/modules/Format/defaults/formatters/handle.js +1 -1
  137. package/src/js/modules/Format/defaults/formatters/html.js +1 -1
  138. package/src/js/modules/Format/defaults/formatters/image.js +9 -9
  139. package/src/js/modules/Format/defaults/formatters/link.js +10 -10
  140. package/src/js/modules/Format/defaults/formatters/lookup.js +1 -1
  141. package/src/js/modules/Format/defaults/formatters/money.js +1 -1
  142. package/src/js/modules/Format/defaults/formatters/plaintext.js +1 -1
  143. package/src/js/modules/Format/defaults/formatters/progress.js +41 -42
  144. package/src/js/modules/Format/defaults/formatters/responsiveCollapse.js +3 -3
  145. package/src/js/modules/Format/defaults/formatters/rowSelection.js +1 -1
  146. package/src/js/modules/Format/defaults/formatters/rownum.js +9 -2
  147. package/src/js/modules/Format/defaults/formatters/star.js +1 -1
  148. package/src/js/modules/Format/defaults/formatters/textarea.js +1 -1
  149. package/src/js/modules/Format/defaults/formatters/tickCross.js +1 -1
  150. package/src/js/modules/Format/defaults/formatters/traffic.js +14 -14
  151. package/src/js/modules/FrozenColumns/FrozenColumns.js +6 -8
  152. package/src/js/modules/FrozenRows/FrozenRows.js +37 -7
  153. package/src/js/modules/GroupRows/Group.js +7 -7
  154. package/src/js/modules/GroupRows/GroupComponent.js +2 -2
  155. package/src/js/modules/GroupRows/GroupRows.js +34 -11
  156. package/src/js/modules/History/History.js +2 -2
  157. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +3 -6
  158. package/src/js/modules/Import/Import.js +158 -159
  159. package/src/js/modules/Import/defaults/importers/array.js +5 -0
  160. package/src/js/modules/Import/defaults/importers/csv.js +49 -49
  161. package/src/js/modules/Import/defaults/importers/json.js +6 -6
  162. package/src/js/modules/Import/defaults/importers.js +2 -0
  163. package/src/js/modules/Interaction/Interaction.js +42 -43
  164. package/src/js/modules/Keybindings/Keybindings.js +14 -14
  165. package/src/js/modules/Keybindings/defaults/actions.js +1 -2
  166. package/src/js/modules/Layout/Layout.js +4 -5
  167. package/src/js/modules/Layout/defaults/modes/fitColumns.js +13 -16
  168. package/src/js/modules/Layout/defaults/modes/fitData.js +6 -4
  169. package/src/js/modules/Layout/defaults/modes/fitDataGeneral.js +2 -2
  170. package/src/js/modules/Layout/defaults/modes/fitDataStretch.js +2 -2
  171. package/src/js/modules/Localize/Localize.js +7 -7
  172. package/src/js/modules/Menu/Menu.js +8 -11
  173. package/src/js/modules/MoveColumns/MoveColumns.js +3 -6
  174. package/src/js/modules/MoveRows/MoveRows.js +30 -36
  175. package/src/js/modules/Mutator/Mutator.js +9 -9
  176. package/src/js/modules/Page/Page.js +73 -80
  177. package/src/js/modules/Page/defaults/pageCounters/pages.js +2 -2
  178. package/src/js/modules/Page/defaults/pageCounters/rows.js +1 -1
  179. package/src/js/modules/Persistence/Persistence.js +40 -44
  180. package/src/js/modules/Persistence/defaults/readers.js +1 -1
  181. package/src/js/modules/Popup/Popup.js +4 -5
  182. package/src/js/modules/Print/Print.js +2 -2
  183. package/src/js/modules/ReactiveData/ReactiveData.js +178 -115
  184. package/src/js/modules/ResizeColumns/ResizeColumns.js +3 -3
  185. package/src/js/modules/ResizeRows/ResizeRows.js +1 -1
  186. package/src/js/modules/ResizeTable/ResizeTable.js +77 -46
  187. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -5
  188. package/src/js/modules/SelectRow/SelectRow.js +26 -28
  189. package/src/js/modules/Sort/Sort.js +113 -85
  190. package/src/js/modules/Sort/defaults/sorters/alphanum.js +1 -1
  191. package/src/js/modules/Sort/defaults/sorters/array.js +24 -28
  192. package/src/js/modules/Sort/defaults/sorters/boolean.js +1 -1
  193. package/src/js/modules/Sort/defaults/sorters/date.js +1 -1
  194. package/src/js/modules/Sort/defaults/sorters/datetime.js +13 -13
  195. package/src/js/modules/Sort/defaults/sorters/exists.js +1 -1
  196. package/src/js/modules/Sort/defaults/sorters/number.js +1 -1
  197. package/src/js/modules/Sort/defaults/sorters/string.js +7 -7
  198. package/src/js/modules/Sort/defaults/sorters/time.js +1 -1
  199. package/src/js/modules/Tooltip/Tooltip.js +5 -7
  200. package/src/js/modules/Validate/Validate.js +10 -13
  201. package/src/js/modules/Validate/defaults/validators.js +8 -3
  202. package/src/scss/tabulator.scss +28 -17
  203. package/src/scss/themes/bootstrap/functions4.scss +1 -1
  204. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +8 -8
  205. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +8 -8
  206. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +8 -8
  207. package/src/scss/themes/bulma/tabulator_bulma.scss +7 -7
  208. package/src/scss/themes/materialize/tabulator_materialize.scss +6 -6
  209. package/src/scss/themes/materialize/variables.scss +1 -1
  210. package/src/scss/themes/semanticui/tabulator_semanticui.scss +7 -7
  211. package/src/scss/themes/tabulator_midnight.scss +7 -7
  212. package/src/scss/themes/tabulator_modern.scss +14 -14
  213. package/src/scss/themes/tabulator_simple.scss +8 -8
  214. package/src/scss/themes/tabulator_site.scss +15 -15
@@ -2,11 +2,11 @@ import List from '../../List.js';
2
2
 
3
3
  export default function(cell, onRendered, success, cancel, editorParams){
4
4
 
5
- console.warn("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam");
5
+ this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam");
6
6
 
7
7
  editorParams.autocomplete = true;
8
8
 
9
- var list = new List(this, cell, onRendered, success, cancel, editorParams);
9
+ var list = new List(this, cell, onRendered, success, cancel, editorParams);
10
10
 
11
- return list.input;
11
+ return list.input;
12
12
  }
@@ -0,0 +1,110 @@
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
+ }
@@ -0,0 +1,97 @@
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
+ }
@@ -53,17 +53,17 @@ export default function(cell, onRendered, success, cancel, editorParams){
53
53
  switch(e.keyCode){
54
54
  // case 9:
55
55
  case 13:
56
- onChange(e);
57
- break;
56
+ onChange(e);
57
+ break;
58
58
 
59
59
  case 27:
60
- cancel();
61
- break;
60
+ cancel();
61
+ break;
62
62
 
63
63
  case 35:
64
64
  case 36:
65
- e.stopPropagation();
66
- break;
65
+ e.stopPropagation();
66
+ break;
67
67
  }
68
68
  });
69
69
 
@@ -72,4 +72,4 @@ export default function(cell, onRendered, success, cancel, editorParams){
72
72
  }
73
73
 
74
74
  return input;
75
- };
75
+ }
@@ -1,7 +1,7 @@
1
1
  import List from '../../List.js';
2
2
 
3
3
  export default function(cell, onRendered, success, cancel, editorParams){
4
- var list = new List(this, cell, onRendered, success, cancel, editorParams);
4
+ var list = new List(this, cell, onRendered, success, cancel, editorParams);
5
5
 
6
- return list.input;
6
+ return list.input;
7
7
  }
@@ -78,25 +78,25 @@ export default function(cell, onRendered, success, cancel, editorParams){
78
78
  switch(e.keyCode){
79
79
  case 13:
80
80
  // case 9:
81
- onChange();
82
- break;
81
+ onChange();
82
+ break;
83
83
 
84
84
  case 27:
85
- cancel();
86
- break;
85
+ cancel();
86
+ break;
87
87
 
88
88
  case 38: //up arrow
89
89
  case 40: //down arrow
90
- if(vertNav == "editor"){
91
- e.stopImmediatePropagation();
92
- e.stopPropagation();
93
- }
94
- break;
90
+ if(vertNav == "editor"){
91
+ e.stopImmediatePropagation();
92
+ e.stopPropagation();
93
+ }
94
+ break;
95
95
 
96
96
  case 35:
97
97
  case 36:
98
- e.stopPropagation();
99
- break;
98
+ e.stopPropagation();
99
+ break;
100
100
  }
101
101
  });
102
102
 
@@ -105,4 +105,4 @@ export default function(cell, onRendered, success, cancel, editorParams){
105
105
  }
106
106
 
107
107
  return input;
108
- };
108
+ }
@@ -98,23 +98,23 @@ export default function(cell, onRendered, success, cancel, editorParams){
98
98
  element.addEventListener("keydown", function(e){
99
99
  switch(e.keyCode){
100
100
  case 39: //right arrow
101
- e.preventDefault();
102
- bar.style.width = (bar.clientWidth + element.clientWidth/100) + "px";
103
- break;
101
+ e.preventDefault();
102
+ bar.style.width = (bar.clientWidth + element.clientWidth/100) + "px";
103
+ break;
104
104
 
105
105
  case 37: //left arrow
106
- e.preventDefault();
107
- bar.style.width = (bar.clientWidth - element.clientWidth/100) + "px";
108
- break;
106
+ e.preventDefault();
107
+ bar.style.width = (bar.clientWidth - element.clientWidth/100) + "px";
108
+ break;
109
109
 
110
110
  case 9: //tab
111
111
  case 13: //enter
112
- updateValue();
113
- break;
112
+ updateValue();
113
+ break;
114
114
 
115
115
  case 27: //escape
116
- cancel();
117
- break;
116
+ cancel();
117
+ break;
118
118
 
119
119
  }
120
120
  });
@@ -124,4 +124,4 @@ export default function(cell, onRendered, success, cancel, editorParams){
124
124
  });
125
125
 
126
126
  return bar;
127
- };
127
+ }
@@ -66,14 +66,14 @@ export default function(cell, onRendered, success, cancel, editorParams){
66
66
  switch(e.keyCode){
67
67
  case 13:
68
68
  // case 9:
69
- onChange();
70
- break;
69
+ onChange();
70
+ break;
71
71
 
72
72
  case 27:
73
- cancel();
74
- break;
73
+ cancel();
74
+ break;
75
75
  }
76
76
  });
77
77
 
78
78
  return input;
79
- };
79
+ }
@@ -2,9 +2,9 @@ import List from '../../List.js';
2
2
 
3
3
  export default function(cell, onRendered, success, cancel, editorParams){
4
4
 
5
- console.warn("The select editor has been deprecated, please use the new list editor");
5
+ this.deprecationMsg("The select editor has been deprecated, please use the new list editor");
6
6
 
7
- var list = new List(this, cell, onRendered, success, cancel, editorParams);
7
+ var list = new List(this, cell, onRendered, success, cancel, editorParams);
8
8
 
9
- return list.input;
9
+ return list.input;
10
10
  }
@@ -125,22 +125,22 @@ export default function(cell, onRendered, success, cancel, editorParams){
125
125
  element.addEventListener("keydown", function(e){
126
126
  switch(e.keyCode){
127
127
  case 39: //right arrow
128
- changeValue(value + 1);
129
- break;
128
+ changeValue(value + 1);
129
+ break;
130
130
 
131
131
  case 37: //left arrow
132
- changeValue(value - 1);
133
- break;
132
+ changeValue(value - 1);
133
+ break;
134
134
 
135
135
  case 13: //enter
136
- success(value);
137
- break;
136
+ success(value);
137
+ break;
138
138
 
139
139
  case 27: //escape
140
- cancel();
141
- break;
140
+ cancel();
141
+ break;
142
142
  }
143
143
  });
144
144
 
145
145
  return starsHolder;
146
- };
146
+ }
@@ -2,115 +2,120 @@ import maskInput from '../../inputMask.js';
2
2
 
3
3
  //resizable text area element
4
4
  export default function(cell, onRendered, success, cancel, editorParams){
5
- var self = this,
6
- cellValue = cell.getValue(),
7
- vertNav = editorParams.verticalNavigation || "hybrid",
8
- value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""),
9
- count = (value.match(/(?:\r\n|\r|\n)/g) || []).length + 1,
10
- input = document.createElement("textarea"),
11
- scrollHeight = 0;
12
-
13
- //create and style input
14
- input.style.display = "block";
15
- input.style.padding = "2px";
16
- input.style.height = "100%";
17
- input.style.width = "100%";
18
- input.style.boxSizing = "border-box";
19
- input.style.whiteSpace = "pre-wrap";
20
- input.style.resize = "none";
21
-
22
- if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
23
- for (let key in editorParams.elementAttributes){
24
- if(key.charAt(0) == "+"){
25
- key = key.slice(1);
26
- input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
27
- }else{
28
- input.setAttribute(key, editorParams.elementAttributes[key]);
29
- }
30
- }
31
- }
32
-
33
- input.value = value;
34
-
35
- onRendered(function(){
36
- input.focus({preventScroll: true});
37
- input.style.height = "100%";
38
-
39
- input.scrollHeight;
40
- input.style.height = input.scrollHeight + "px";
41
- cell.getRow().normalizeHeight();
42
-
43
- if(editorParams.selectContents){
5
+ var cellValue = cell.getValue(),
6
+ vertNav = editorParams.verticalNavigation || "hybrid",
7
+ value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""),
8
+ input = document.createElement("textarea"),
9
+ scrollHeight = 0;
10
+
11
+ //create and style input
12
+ input.style.display = "block";
13
+ input.style.padding = "2px";
14
+ input.style.height = "100%";
15
+ input.style.width = "100%";
16
+ input.style.boxSizing = "border-box";
17
+ input.style.whiteSpace = "pre-wrap";
18
+ input.style.resize = "none";
19
+
20
+ if(editorParams.elementAttributes && typeof editorParams.elementAttributes == "object"){
21
+ for (let key in editorParams.elementAttributes){
22
+ if(key.charAt(0) == "+"){
23
+ key = key.slice(1);
24
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
25
+ }else{
26
+ input.setAttribute(key, editorParams.elementAttributes[key]);
27
+ }
28
+ }
29
+ }
30
+
31
+ input.value = value;
32
+
33
+ onRendered(function(){
34
+ input.focus({preventScroll: true});
35
+ input.style.height = "100%";
36
+
37
+ input.scrollHeight;
38
+ input.style.height = input.scrollHeight + "px";
39
+ cell.getRow().normalizeHeight();
40
+
41
+ if(editorParams.selectContents){
44
42
  input.select();
45
43
  }
46
- });
44
+ });
47
45
 
48
- function onChange(e){
46
+ function onChange(e){
49
47
 
50
- if(((cellValue === null || typeof cellValue === "undefined") && input.value !== "") || input.value !== cellValue){
48
+ if(((cellValue === null || typeof cellValue === "undefined") && input.value !== "") || input.value !== cellValue){
51
49
 
52
- if(success(input.value)){
53
- cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
54
- }
50
+ if(success(input.value)){
51
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
52
+ }
55
53
 
56
- setTimeout(function(){
57
- cell.getRow().normalizeHeight();
58
- },300)
59
- }else{
60
- cancel();
61
- }
62
- }
54
+ setTimeout(function(){
55
+ cell.getRow().normalizeHeight();
56
+ },300);
57
+ }else{
58
+ cancel();
59
+ }
60
+ }
61
+
62
+ //submit new value on blur or change
63
+ input.addEventListener("change", onChange);
64
+ input.addEventListener("blur", onChange);
63
65
 
64
- //submit new value on blur or change
65
- input.addEventListener("change", onChange);
66
- input.addEventListener("blur", onChange);
66
+ input.addEventListener("keyup", function(){
67
67
 
68
- input.addEventListener("keyup", function(){
68
+ input.style.height = "";
69
69
 
70
- input.style.height = "";
70
+ var heightNow = input.scrollHeight;
71
71
 
72
- var heightNow = input.scrollHeight;
72
+ input.style.height = heightNow + "px";
73
73
 
74
- input.style.height = heightNow + "px";
74
+ if(heightNow != scrollHeight){
75
+ scrollHeight = heightNow;
76
+ cell.getRow().normalizeHeight();
77
+ }
78
+ });
75
79
 
76
- if(heightNow != scrollHeight){
77
- scrollHeight = heightNow;
78
- cell.getRow().normalizeHeight();
79
- }
80
- });
80
+ input.addEventListener("keydown", function(e){
81
81
 
82
- input.addEventListener("keydown", function(e){
82
+ switch(e.keyCode){
83
83
 
84
- switch(e.keyCode){
85
- case 27:
86
- cancel();
87
- break;
84
+ case 13:
85
+ if(e.shiftKey && editorParams.shiftEnterSubmit){
86
+ onChange(e);
87
+ }
88
+ break;
88
89
 
89
- case 38: //up arrow
90
- if(vertNav == "editor" || (vertNav == "hybrid" && input.selectionStart)){
91
- e.stopImmediatePropagation();
92
- e.stopPropagation();
93
- }
90
+ case 27:
91
+ cancel();
92
+ break;
94
93
 
95
- break;
94
+ case 38: //up arrow
95
+ if(vertNav == "editor" || (vertNav == "hybrid" && input.selectionStart)){
96
+ e.stopImmediatePropagation();
97
+ e.stopPropagation();
98
+ }
96
99
 
97
- case 40: //down arrow
98
- if(vertNav == "editor" || (vertNav == "hybrid" && input.selectionStart !== input.value.length)){
99
- e.stopImmediatePropagation();
100
- e.stopPropagation();
101
- }
102
- break;
100
+ break;
103
101
 
104
- case 35:
105
- case 36:
106
- e.stopPropagation();
107
- break;
108
- }
109
- });
102
+ case 40: //down arrow
103
+ if(vertNav == "editor" || (vertNav == "hybrid" && input.selectionStart !== input.value.length)){
104
+ e.stopImmediatePropagation();
105
+ e.stopPropagation();
106
+ }
107
+ break;
108
+
109
+ case 35:
110
+ case 36:
111
+ e.stopPropagation();
112
+ break;
113
+ }
114
+ });
110
115
 
111
- if(editorParams.mask){
112
- maskInput(input, editorParams);
113
- }
116
+ if(editorParams.mask){
117
+ maskInput(input, editorParams);
118
+ }
114
119
 
115
- return input;
116
- };
120
+ return input;
121
+ }
@@ -49,8 +49,6 @@ export default function(cell, onRendered, success, cancel, editorParams){
49
49
  checkedValue = editorParams.trueValue;
50
50
  }else if(falseValueSet && !checkedValue){
51
51
  checkedValue = editorParams.falseValue;
52
- }else{
53
- checkedValue = checkedValue;
54
52
  }
55
53
 
56
54
  if(tristate){
@@ -96,4 +94,4 @@ export default function(cell, onRendered, success, cancel, editorParams){
96
94
  });
97
95
 
98
96
  return input;
99
- };
97
+ }