tabulator-tables 5.6.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/build/{Bundler.js → Bundler.mjs} +8 -6
- package/build/rollup.mjs +9 -0
- package/dist/css/tabulator.css +67 -5
- package/dist/css/tabulator.css.map +1 -1
- package/dist/css/tabulator.min.css +1 -1
- package/dist/css/tabulator.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.css +77 -5
- package/dist/css/tabulator_bootstrap3.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.min.css +1 -1
- package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap4.css +83 -5
- package/dist/css/tabulator_bootstrap4.css.map +1 -1
- package/dist/css/tabulator_bootstrap4.min.css +1 -1
- package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap5.css +83 -5
- package/dist/css/tabulator_bootstrap5.css.map +1 -1
- package/dist/css/tabulator_bootstrap5.min.css +1 -1
- package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
- package/dist/css/tabulator_bulma.css +89 -5
- package/dist/css/tabulator_bulma.css.map +1 -1
- package/dist/css/tabulator_bulma.min.css +1 -1
- package/dist/css/tabulator_bulma.min.css.map +1 -1
- package/dist/css/tabulator_materialize.css +82 -5
- package/dist/css/tabulator_materialize.css.map +1 -1
- package/dist/css/tabulator_materialize.min.css +1 -1
- package/dist/css/tabulator_materialize.min.css.map +1 -1
- package/dist/css/tabulator_midnight.css +77 -5
- package/dist/css/tabulator_midnight.css.map +1 -1
- package/dist/css/tabulator_midnight.min.css +1 -1
- package/dist/css/tabulator_midnight.min.css.map +1 -1
- package/dist/css/tabulator_modern.css +87 -5
- package/dist/css/tabulator_modern.css.map +1 -1
- package/dist/css/tabulator_modern.min.css +1 -1
- package/dist/css/tabulator_modern.min.css.map +1 -1
- package/dist/css/tabulator_semanticui.css +79 -5
- package/dist/css/tabulator_semanticui.css.map +1 -1
- package/dist/css/tabulator_semanticui.min.css +1 -1
- package/dist/css/tabulator_semanticui.min.css.map +1 -1
- package/dist/css/tabulator_simple.css +80 -5
- package/dist/css/tabulator_simple.css.map +1 -1
- package/dist/css/tabulator_simple.min.css +1 -1
- package/dist/css/tabulator_simple.min.css.map +1 -1
- package/dist/css/tabulator_site.css +90 -5
- package/dist/css/tabulator_site.css.map +1 -1
- package/dist/css/tabulator_site.min.css +1 -1
- package/dist/css/tabulator_site.min.css.map +1 -1
- package/dist/js/tabulator.js +3865 -2755
- package/dist/js/tabulator.js.map +1 -1
- package/dist/js/tabulator.min.js +2 -2
- package/dist/js/tabulator.min.js.map +1 -1
- package/dist/js/tabulator_esm.js +3857 -2745
- package/dist/js/tabulator_esm.js.map +1 -1
- package/dist/js/tabulator_esm.min.js +2 -2
- package/dist/js/tabulator_esm.min.js.map +1 -1
- package/package.json +17 -17
- package/src/js/builds/esm.js +2 -0
- package/src/js/core/ColumnManager.js +15 -0
- package/src/js/core/Module.js +2 -4
- package/src/js/core/RowManager.js +4 -6
- package/src/js/core/Tabulator.js +36 -23
- package/src/js/core/TabulatorFull.js +15 -5
- package/src/js/core/cell/Cell.js +4 -0
- package/src/js/core/column/Column.js +231 -216
- package/src/js/core/column/ColumnComponent.js +1 -3
- package/src/js/core/defaults/options.js +1 -0
- package/src/js/core/modules/optional.js +2 -1
- package/src/js/core/row/Row.js +23 -11
- package/src/js/core/tools/DataLoader.js +1 -1
- package/src/js/core/tools/ModuleBinder.js +123 -75
- package/src/js/core/tools/TableRegistry.js +58 -55
- package/src/js/modules/Accessor/Accessor.js +7 -8
- package/src/js/modules/Accessor/defaults/accessors.js +5 -1
- package/src/js/modules/Ajax/Ajax.js +10 -12
- package/src/js/modules/Clipboard/Clipboard.js +10 -10
- package/src/js/modules/Clipboard/defaults/pasteActions.js +0 -43
- package/src/js/modules/Clipboard/defaults/pasteParsers.js +0 -55
- package/src/js/modules/Clipboard/extensions/extensions.js +9 -0
- package/src/js/modules/Clipboard/extensions/keybindings/actions.js +9 -0
- package/src/js/modules/Clipboard/extensions/keybindings/bindings.js +3 -0
- package/src/js/modules/ColumnCalcs/CalcComponent.js +2 -4
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +16 -18
- package/src/js/modules/Comms/Comms.js +5 -8
- package/src/js/modules/DataTree/DataTree.js +11 -11
- package/src/js/modules/Download/Download.js +9 -11
- package/src/js/modules/Edit/Edit.js +63 -21
- package/src/js/modules/Edit/List.js +12 -12
- package/src/js/modules/Edit/defaults/editors/datetime.js +1 -1
- package/src/js/modules/Edit/defaults/editors/time.js +1 -1
- package/src/js/modules/Edit/defaults/editors.js +0 -4
- package/src/js/modules/Export/Export.js +70 -62
- package/src/js/modules/Export/ExportColumn.js +2 -4
- package/src/js/modules/Export/ExportRow.js +2 -4
- package/src/js/modules/Export/defaults/columnLookups.js +3 -0
- package/src/js/modules/Export/defaults/rowLookups.js +18 -0
- package/src/js/modules/Filter/Filter.js +7 -9
- package/src/js/modules/Format/Format.js +7 -9
- package/src/js/modules/Format/defaults/formatters.js +0 -4
- package/src/js/modules/FrozenColumns/FrozenColumns.js +9 -6
- package/src/js/modules/FrozenRows/FrozenRows.js +4 -6
- package/src/js/modules/GroupRows/Group.js +2 -4
- package/src/js/modules/GroupRows/GroupComponent.js +2 -4
- package/src/js/modules/GroupRows/GroupRows.js +4 -6
- package/src/js/modules/History/History.js +10 -10
- package/src/js/modules/History/extensions/extensions.js +9 -0
- package/src/js/modules/History/extensions/keybindings/actions.js +27 -0
- package/src/js/modules/History/extensions/keybindings/bindings.js +4 -0
- package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -6
- package/src/js/modules/Import/Import.js +7 -9
- package/src/js/modules/Import/defaults/importers/array.js +2 -4
- package/src/js/modules/Import/defaults/importers/csv.js +2 -4
- package/src/js/modules/Interaction/Interaction.js +4 -6
- package/src/js/modules/Keybindings/Keybindings.js +8 -10
- package/src/js/modules/Keybindings/defaults/actions.js +5 -71
- package/src/js/modules/Keybindings/defaults/bindings.js +0 -16
- package/src/js/modules/Layout/Layout.js +7 -9
- package/src/js/modules/Localize/Localize.js +7 -9
- package/src/js/modules/Menu/Menu.js +7 -9
- package/src/js/modules/MoveColumns/MoveColumns.js +6 -8
- package/src/js/modules/MoveRows/MoveRows.js +13 -45
- package/src/js/modules/MoveRows/defaults/receivers.js +30 -0
- package/src/js/modules/MoveRows/defaults/senders.js +5 -0
- package/src/js/modules/Mutator/Mutator.js +7 -9
- package/src/js/modules/Page/Page.js +7 -9
- package/src/js/modules/Persistence/Persistence.js +10 -12
- package/src/js/modules/Popup/Popup.js +4 -8
- package/src/js/modules/Print/Print.js +4 -6
- package/src/js/modules/ReactiveData/ReactiveData.js +4 -9
- package/src/js/modules/ResizeColumns/ResizeColumns.js +91 -53
- package/src/js/modules/ResizeRows/ResizeRows.js +41 -8
- package/src/js/modules/ResizeTable/ResizeTable.js +4 -6
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +15 -9
- package/src/js/modules/ResponsiveLayout/extensions/extensions.js +9 -0
- package/src/js/modules/SelectRange/Range.js +40 -21
- package/src/js/modules/SelectRange/RangeComponent.js +2 -4
- package/src/js/modules/SelectRange/SelectRange.js +88 -43
- package/src/js/modules/SelectRange/extensions/clipboard/pasteActions.js +45 -0
- package/src/js/modules/SelectRange/extensions/clipboard/pasteParsers.js +57 -0
- package/src/js/modules/SelectRange/extensions/export/columnLookups.js +11 -0
- package/src/js/modules/SelectRange/extensions/export/rowLookups.js +5 -0
- package/src/js/modules/SelectRange/extensions/extensions.js +21 -0
- package/src/js/modules/SelectRange/extensions/keybindings/actions.js +38 -0
- package/src/js/modules/SelectRange/extensions/keybindings/bindings.js +14 -0
- package/src/js/modules/SelectRow/SelectRow.js +12 -12
- package/src/js/modules/SelectRow/extensions/extensions.js +9 -0
- package/src/js/modules/Sort/Sort.js +16 -13
- package/src/js/modules/Spreadsheet/GridCalculator.js +64 -0
- package/src/js/modules/Spreadsheet/Sheet.js +243 -0
- package/src/js/modules/Spreadsheet/SheetComponent.js +59 -0
- package/src/js/modules/Spreadsheet/Spreadsheet.js +309 -0
- package/src/js/modules/Tooltip/Tooltip.js +6 -8
- package/src/js/modules/Validate/Validate.js +7 -9
- package/src/scss/tabulator.scss +86 -10
- package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +14 -0
- package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +18 -0
- package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +18 -0
- package/src/scss/themes/bulma/tabulator_bulma.scss +24 -0
- package/src/scss/themes/materialize/tabulator_materialize.scss +18 -0
- package/src/scss/themes/semanticui/tabulator_semanticui.scss +14 -0
- package/src/scss/themes/tabulator_midnight.scss +34 -21
- package/src/scss/themes/tabulator_modern.scss +23 -0
- package/src/scss/themes/tabulator_simple.scss +15 -0
- package/src/scss/themes/tabulator_site.scss +25 -0
- package/build/rollup.js +0 -6
- package/src/js/modules/Edit/defaults/editors/autocomplete.js +0 -12
- package/src/js/modules/Edit/defaults/editors/select.js +0 -10
- /package/src/js/modules/{Format/defaults → ResponsiveLayout/extensions}/formatters/responsiveCollapse.js +0 -0
- /package/src/js/modules/{Format/defaults → SelectRow/extensions}/formatters/rowSelection.js +0 -0
|
@@ -8,7 +8,12 @@ import Row from '../../core/row/Row.js';
|
|
|
8
8
|
|
|
9
9
|
import defaultCalculations from './defaults/calculations.js';
|
|
10
10
|
|
|
11
|
-
class ColumnCalcs extends Module{
|
|
11
|
+
export default class ColumnCalcs extends Module{
|
|
12
|
+
|
|
13
|
+
static moduleName = "columnCalcs";
|
|
14
|
+
|
|
15
|
+
//load defaults
|
|
16
|
+
static calculations = defaultCalculations;
|
|
12
17
|
|
|
13
18
|
constructor(table){
|
|
14
19
|
super(table);
|
|
@@ -397,19 +402,19 @@ class ColumnCalcs extends Module{
|
|
|
397
402
|
}
|
|
398
403
|
|
|
399
404
|
rowsToData(rows){
|
|
400
|
-
var data = []
|
|
401
|
-
|
|
405
|
+
var data = [],
|
|
406
|
+
hasDataTreeColumnCalcs = this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs,
|
|
407
|
+
dataTree = this.table.modules.dataTree;
|
|
408
|
+
|
|
402
409
|
rows.forEach((row) => {
|
|
403
410
|
data.push(row.getData());
|
|
404
|
-
|
|
405
|
-
if(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
411
|
+
|
|
412
|
+
if(hasDataTreeColumnCalcs && row.modules.dataTree?.open){
|
|
413
|
+
this.rowsToData(dataTree.getFilteredTreeChildren(row)).forEach(dataRow =>{
|
|
414
|
+
data.push(row);
|
|
415
|
+
});
|
|
410
416
|
}
|
|
411
417
|
});
|
|
412
|
-
|
|
413
418
|
return data;
|
|
414
419
|
}
|
|
415
420
|
|
|
@@ -578,11 +583,4 @@ class ColumnCalcs extends Module{
|
|
|
578
583
|
}
|
|
579
584
|
}
|
|
580
585
|
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
ColumnCalcs.moduleName = "columnCalcs";
|
|
584
|
-
|
|
585
|
-
//load defaults
|
|
586
|
-
ColumnCalcs.calculations = defaultCalculations;
|
|
587
|
-
|
|
588
|
-
export default ColumnCalcs;
|
|
586
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Module from '../../core/Module.js';
|
|
2
|
-
import TableRegistry from '../../core/tools/TableRegistry.js';
|
|
3
2
|
|
|
4
|
-
class Comms extends Module{
|
|
3
|
+
export default class Comms extends Module{
|
|
4
|
+
|
|
5
|
+
static moduleName = "comms";
|
|
5
6
|
|
|
6
7
|
constructor(table){
|
|
7
8
|
super(table);
|
|
@@ -15,7 +16,7 @@ class Comms extends Module{
|
|
|
15
16
|
var connections = [],
|
|
16
17
|
connection;
|
|
17
18
|
|
|
18
|
-
connection =
|
|
19
|
+
connection = this.table.constructor.registry.lookupTable(selectors);
|
|
19
20
|
|
|
20
21
|
connection.forEach((con) =>{
|
|
21
22
|
if(this.table !== con){
|
|
@@ -45,8 +46,4 @@ class Comms extends Module{
|
|
|
45
46
|
console.warn("Inter-table Comms Error - no such module:", module);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
Comms.moduleName = "comms";
|
|
51
|
-
|
|
52
|
-
export default Comms;
|
|
49
|
+
}
|
|
@@ -4,7 +4,9 @@ import Row from '../../core/row/Row.js';
|
|
|
4
4
|
|
|
5
5
|
import RowComponent from '../../core/row/RowComponent.js';
|
|
6
6
|
|
|
7
|
-
class DataTree extends Module{
|
|
7
|
+
export default class DataTree extends Module{
|
|
8
|
+
|
|
9
|
+
static moduleName = "dataTree";
|
|
8
10
|
|
|
9
11
|
constructor(table){
|
|
10
12
|
super(table);
|
|
@@ -311,7 +313,7 @@ class DataTree extends Module{
|
|
|
311
313
|
config = row.modules.dataTree;
|
|
312
314
|
|
|
313
315
|
if(!config.index && config.children !== false){
|
|
314
|
-
children = this.getChildren(row);
|
|
316
|
+
children = this.getChildren(row, false, true);
|
|
315
317
|
|
|
316
318
|
children.forEach((child) => {
|
|
317
319
|
child.create();
|
|
@@ -324,7 +326,7 @@ class DataTree extends Module{
|
|
|
324
326
|
return output;
|
|
325
327
|
}
|
|
326
328
|
|
|
327
|
-
getChildren(row, allChildren){
|
|
329
|
+
getChildren(row, allChildren, sortOnly){
|
|
328
330
|
var config = row.modules.dataTree,
|
|
329
331
|
children = [],
|
|
330
332
|
output = [];
|
|
@@ -341,13 +343,13 @@ class DataTree extends Module{
|
|
|
341
343
|
}
|
|
342
344
|
|
|
343
345
|
if(this.table.modExists("sort") && this.table.options.dataTreeSort){
|
|
344
|
-
this.table.modules.sort.sort(children);
|
|
346
|
+
this.table.modules.sort.sort(children, sortOnly);
|
|
345
347
|
}
|
|
346
348
|
|
|
347
349
|
children.forEach((child) => {
|
|
348
350
|
output.push(child);
|
|
349
351
|
|
|
350
|
-
var subChildren = this.getChildren(child);
|
|
352
|
+
var subChildren = this.getChildren(child, false, true);
|
|
351
353
|
|
|
352
354
|
subChildren.forEach((sub) => {
|
|
353
355
|
output.push(sub);
|
|
@@ -584,7 +586,9 @@ class DataTree extends Module{
|
|
|
584
586
|
output.push(component ? childRow.getComponent() : childRow);
|
|
585
587
|
|
|
586
588
|
if(recurse){
|
|
587
|
-
|
|
589
|
+
this.getTreeChildren(childRow, component, recurse).forEach(child => {
|
|
590
|
+
output.push(child);
|
|
591
|
+
});
|
|
588
592
|
}
|
|
589
593
|
}
|
|
590
594
|
});
|
|
@@ -600,8 +604,4 @@ class DataTree extends Module{
|
|
|
600
604
|
redrawNeeded(data){
|
|
601
605
|
return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false);
|
|
602
606
|
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
DataTree.moduleName = "dataTree";
|
|
606
|
-
|
|
607
|
-
export default DataTree;
|
|
607
|
+
}
|
|
@@ -2,7 +2,12 @@ import Module from '../../core/Module.js';
|
|
|
2
2
|
|
|
3
3
|
import defaultDownloaders from './defaults/downloaders.js';
|
|
4
4
|
|
|
5
|
-
class Download extends Module{
|
|
5
|
+
export default class Download extends Module{
|
|
6
|
+
|
|
7
|
+
static moduleName = "download";
|
|
8
|
+
|
|
9
|
+
//load defaults
|
|
10
|
+
static downloaders = defaultDownloaders;
|
|
6
11
|
|
|
7
12
|
constructor(table){
|
|
8
13
|
super(table);
|
|
@@ -10,7 +15,7 @@ class Download extends Module{
|
|
|
10
15
|
this.registerTableOption("downloadEncoder", function(data, mimeType){
|
|
11
16
|
return new Blob([data],{type:mimeType});
|
|
12
17
|
}); //function to manipulate download data
|
|
13
|
-
this.registerTableOption("downloadReady", undefined); //warn of function deprecation
|
|
18
|
+
// this.registerTableOption("downloadReady", undefined); //warn of function deprecation
|
|
14
19
|
this.registerTableOption("downloadConfig", {}); //download config
|
|
15
20
|
this.registerTableOption("downloadRowRange", "active"); //restrict download to active rows only
|
|
16
21
|
|
|
@@ -26,7 +31,7 @@ class Download extends Module{
|
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
deprecatedOptionsCheck(){
|
|
29
|
-
this.deprecationCheck("downloadReady", "downloadEncoder");
|
|
34
|
+
// this.deprecationCheck("downloadReady", "downloadEncoder");
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
///////////////////////////////////
|
|
@@ -139,11 +144,4 @@ class Download extends Module{
|
|
|
139
144
|
break;
|
|
140
145
|
}
|
|
141
146
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
Download.moduleName = "download";
|
|
145
|
-
|
|
146
|
-
//load defaults
|
|
147
|
-
Download.downloaders = defaultDownloaders;
|
|
148
|
-
|
|
149
|
-
export default Download;
|
|
147
|
+
}
|
|
@@ -3,7 +3,12 @@ import Helpers from '../../core/tools/Helpers.js';
|
|
|
3
3
|
|
|
4
4
|
import defaultEditors from './defaults/editors.js';
|
|
5
5
|
|
|
6
|
-
class Edit extends Module{
|
|
6
|
+
export default class Edit extends Module{
|
|
7
|
+
|
|
8
|
+
static moduleName = "edit";
|
|
9
|
+
|
|
10
|
+
//load defaults
|
|
11
|
+
static editors = defaultEditors;
|
|
7
12
|
|
|
8
13
|
constructor(table){
|
|
9
14
|
super(table);
|
|
@@ -13,19 +18,24 @@ class Edit extends Module{
|
|
|
13
18
|
this.recursionBlock = false; //prevent focus recursion
|
|
14
19
|
this.invalidEdit = false;
|
|
15
20
|
this.editedCells = [];
|
|
21
|
+
this.convertEmptyValues = false;
|
|
16
22
|
|
|
17
23
|
this.editors = Edit.editors;
|
|
18
|
-
|
|
24
|
+
|
|
25
|
+
this.registerTableOption("editTriggerEvent", "focus");
|
|
26
|
+
this.registerTableOption("editorEmptyValue");
|
|
27
|
+
this.registerTableOption("editorEmptyValueFunc", this.emptyValueCheck.bind(this));
|
|
28
|
+
|
|
19
29
|
this.registerColumnOption("editable");
|
|
20
30
|
this.registerColumnOption("editor");
|
|
21
31
|
this.registerColumnOption("editorParams");
|
|
32
|
+
this.registerColumnOption("editorEmptyValue");
|
|
33
|
+
this.registerColumnOption("editorEmptyValueFunc");
|
|
22
34
|
|
|
23
35
|
this.registerColumnOption("cellEditing");
|
|
24
36
|
this.registerColumnOption("cellEdited");
|
|
25
37
|
this.registerColumnOption("cellEditCancelled");
|
|
26
38
|
|
|
27
|
-
this.registerTableOption("editTriggerEvent", "focus");
|
|
28
|
-
|
|
29
39
|
this.registerTableFunction("getEditedCells", this.getEditedCells.bind(this));
|
|
30
40
|
this.registerTableFunction("clearCellEdited", this.clearCellEdited.bind(this));
|
|
31
41
|
this.registerTableFunction("navigatePrev", this.navigatePrev.bind(this));
|
|
@@ -62,11 +72,14 @@ class Edit extends Module{
|
|
|
62
72
|
this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
|
|
63
73
|
this.subscribe("keybinding-nav-next", this.keybindingNavigateNext.bind(this));
|
|
64
74
|
|
|
65
|
-
|
|
66
75
|
// this.subscribe("keybinding-nav-left", this.navigateLeft.bind(this, undefined));
|
|
67
76
|
// this.subscribe("keybinding-nav-right", this.navigateRight.bind(this, undefined));
|
|
68
77
|
this.subscribe("keybinding-nav-up", this.navigateUp.bind(this, undefined));
|
|
69
78
|
this.subscribe("keybinding-nav-down", this.navigateDown.bind(this, undefined));
|
|
79
|
+
|
|
80
|
+
if(Object.keys(this.table.options).includes("editorEmptyValue")){
|
|
81
|
+
this.convertEmptyValues = true;
|
|
82
|
+
}
|
|
70
83
|
}
|
|
71
84
|
|
|
72
85
|
|
|
@@ -378,11 +391,16 @@ class Edit extends Module{
|
|
|
378
391
|
|
|
379
392
|
//initialize column editor
|
|
380
393
|
initializeColumn(column){
|
|
394
|
+
var convertEmpty = Object.keys(column.definition).includes("editorEmptyValue");
|
|
395
|
+
|
|
381
396
|
var config = {
|
|
382
397
|
editor:false,
|
|
383
398
|
blocked:false,
|
|
384
399
|
check:column.definition.editable,
|
|
385
|
-
params:column.definition.editorParams || {}
|
|
400
|
+
params:column.definition.editorParams || {},
|
|
401
|
+
convertEmptyValues:convertEmpty,
|
|
402
|
+
editorEmptyValue:column.definition.editorEmptyValue,
|
|
403
|
+
editorEmptyValueFunc:column.definition.editorEmptyValueFunc,
|
|
386
404
|
};
|
|
387
405
|
|
|
388
406
|
//set column editor
|
|
@@ -596,8 +614,9 @@ class Edit extends Module{
|
|
|
596
614
|
allowEdit = true,
|
|
597
615
|
rendered = function(){},
|
|
598
616
|
element = cell.getElement(),
|
|
617
|
+
editFinished = false,
|
|
599
618
|
cellEditor, component, params;
|
|
600
|
-
|
|
619
|
+
|
|
601
620
|
//prevent editing if another cell is refusing to leave focus (eg. validation fail)
|
|
602
621
|
|
|
603
622
|
if(this.currentCell){
|
|
@@ -609,13 +628,15 @@ class Edit extends Module{
|
|
|
609
628
|
|
|
610
629
|
//handle successful value change
|
|
611
630
|
function success(value){
|
|
612
|
-
if(self.currentCell === cell){
|
|
631
|
+
if(self.currentCell === cell && !editFinished){
|
|
613
632
|
var valid = self.chain("edit-success", [cell, value], true, true);
|
|
614
|
-
|
|
633
|
+
|
|
615
634
|
if(valid === true || self.table.options.validationMode === "highlight"){
|
|
635
|
+
|
|
636
|
+
editFinished = true;
|
|
637
|
+
|
|
616
638
|
self.clearEditor();
|
|
617
639
|
|
|
618
|
-
|
|
619
640
|
if(!cell.modules.edit){
|
|
620
641
|
cell.modules.edit = {};
|
|
621
642
|
}
|
|
@@ -625,14 +646,21 @@ class Edit extends Module{
|
|
|
625
646
|
if(self.editedCells.indexOf(cell) == -1){
|
|
626
647
|
self.editedCells.push(cell);
|
|
627
648
|
}
|
|
649
|
+
|
|
650
|
+
value = self.transformEmptyValues(value, cell);
|
|
628
651
|
|
|
629
652
|
cell.setValue(value, true);
|
|
630
|
-
|
|
653
|
+
|
|
631
654
|
return valid === true;
|
|
632
655
|
}else{
|
|
656
|
+
editFinished = true;
|
|
633
657
|
self.invalidEdit = true;
|
|
634
658
|
self.focusCellNoEvent(cell, true);
|
|
635
659
|
rendered();
|
|
660
|
+
|
|
661
|
+
setTimeout(() => {
|
|
662
|
+
editFinished = false;
|
|
663
|
+
}, 10);
|
|
636
664
|
return false;
|
|
637
665
|
}
|
|
638
666
|
}else{
|
|
@@ -642,7 +670,9 @@ class Edit extends Module{
|
|
|
642
670
|
|
|
643
671
|
//handle aborted edit
|
|
644
672
|
function cancel(){
|
|
645
|
-
|
|
673
|
+
// editFinished = true;
|
|
674
|
+
|
|
675
|
+
if(self.currentCell === cell && !editFinished){
|
|
646
676
|
self.cancelEdit();
|
|
647
677
|
}else{
|
|
648
678
|
// console.warn("Edit Success Error - cannot call cancel on a cell that is no longer being edited");
|
|
@@ -730,6 +760,26 @@ class Edit extends Module{
|
|
|
730
760
|
return false;
|
|
731
761
|
}
|
|
732
762
|
}
|
|
763
|
+
|
|
764
|
+
emptyValueCheck(value){
|
|
765
|
+
return value === "" || value === null || typeof value === "undefined";
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
transformEmptyValues(value, cell){
|
|
769
|
+
var mod = cell.column.modules.edit,
|
|
770
|
+
convert = mod.convertEmptyValues || this.convertEmptyValues,
|
|
771
|
+
checkFunc;
|
|
772
|
+
|
|
773
|
+
if(convert){
|
|
774
|
+
checkFunc = mod.editorEmptyValueFunc || this.options("editorEmptyValueFunc");
|
|
775
|
+
|
|
776
|
+
if(checkFunc && checkFunc(value)){
|
|
777
|
+
value = mod.convertEmptyValues ? mod.editorEmptyValue : this.options("editorEmptyValue");
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
return value;
|
|
782
|
+
}
|
|
733
783
|
|
|
734
784
|
blur(element){
|
|
735
785
|
if(!this.confirm("edit-blur", [element]) ){
|
|
@@ -762,12 +812,4 @@ class Edit extends Module{
|
|
|
762
812
|
this.editedCells.splice(editIndex, 1);
|
|
763
813
|
}
|
|
764
814
|
}
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
Edit.moduleName = "edit";
|
|
768
|
-
|
|
769
|
-
//load defaults
|
|
770
|
-
Edit.editors = defaultEditors;
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
export default Edit;
|
|
815
|
+
}
|
|
@@ -46,21 +46,21 @@ export default class Edit{
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
_deprecatedOptionsCheck(){
|
|
49
|
-
if(this.params.listItemFormatter){
|
|
50
|
-
|
|
51
|
-
}
|
|
49
|
+
// if(this.params.listItemFormatter){
|
|
50
|
+
// this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options");
|
|
51
|
+
// }
|
|
52
52
|
|
|
53
|
-
if(this.params.sortValuesList){
|
|
54
|
-
|
|
55
|
-
}
|
|
53
|
+
// if(this.params.sortValuesList){
|
|
54
|
+
// this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options");
|
|
55
|
+
// }
|
|
56
56
|
|
|
57
|
-
if(this.params.searchFunc){
|
|
58
|
-
|
|
59
|
-
}
|
|
57
|
+
// if(this.params.searchFunc){
|
|
58
|
+
// this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options");
|
|
59
|
+
// }
|
|
60
60
|
|
|
61
|
-
if(this.params.searchingPlaceholder){
|
|
62
|
-
|
|
63
|
-
}
|
|
61
|
+
// if(this.params.searchingPlaceholder){
|
|
62
|
+
// this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options");
|
|
63
|
+
// }
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
_initializeValue(){
|
|
@@ -37,7 +37,7 @@ export default function(cell, onRendered, success, cancel, editorParams){
|
|
|
37
37
|
newDatetime = DT.fromFormat(String(cellValue), inputFormat);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("
|
|
40
|
+
cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("HH:mm");
|
|
41
41
|
}else{
|
|
42
42
|
console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
|
|
43
43
|
}
|
|
@@ -37,7 +37,7 @@ export default function(cell, onRendered, success, cancel, editorParams){
|
|
|
37
37
|
newDatetime = DT.fromFormat(String(cellValue), inputFormat);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
cellValue = newDatetime.toFormat("
|
|
40
|
+
cellValue = newDatetime.toFormat("HH:mm");
|
|
41
41
|
|
|
42
42
|
}else{
|
|
43
43
|
console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
|
|
@@ -5,9 +5,7 @@ import range from './editors/range.js';
|
|
|
5
5
|
import date from './editors/date.js';
|
|
6
6
|
import time from './editors/time.js';
|
|
7
7
|
import datetime from './editors/datetime.js';
|
|
8
|
-
import select from './editors/select.js';
|
|
9
8
|
import list from './editors/list.js';
|
|
10
|
-
import autocomplete from './editors/autocomplete.js';
|
|
11
9
|
import star from './editors/star.js';
|
|
12
10
|
import progress from './editors/progress.js';
|
|
13
11
|
import tickCross from './editors/tickCross.js';
|
|
@@ -20,9 +18,7 @@ export default {
|
|
|
20
18
|
date:date,
|
|
21
19
|
time:time,
|
|
22
20
|
datetime:datetime,
|
|
23
|
-
select:select,
|
|
24
21
|
list:list,
|
|
25
|
-
autocomplete:autocomplete,
|
|
26
22
|
star:star,
|
|
27
23
|
progress:progress,
|
|
28
24
|
tickCross:tickCross,
|