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.
- package/.eslintignore +3 -0
- package/.eslintrc.js +28 -0
- package/.github/workflows/bad-files-check.yml +39 -0
- package/.github/workflows/lint-and-test.yml +31 -0
- package/README.md +3 -3
- package/bower.json +1 -1
- package/build/Bundler.js +77 -77
- package/dist/css/tabulator.css +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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 +12 -7
- 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/jquery_wrapper.js +37 -37
- package/dist/js/tabulator.js +1551 -793
- 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 +4300 -3581
- 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 +4 -1
- package/src/js/builds/jquery_wrapper.js +37 -37
- package/src/js/core/ColumnManager.js +270 -232
- package/src/js/core/CoreFeature.js +16 -2
- package/src/js/core/FooterManager.js +10 -10
- package/src/js/core/Module.js +8 -8
- package/src/js/core/RowManager.js +139 -156
- package/src/js/core/Tabulator.js +88 -74
- package/src/js/core/TabulatorFull.js +1 -1
- package/src/js/core/cell/Cell.js +15 -16
- package/src/js/core/cell/CellComponent.js +2 -2
- package/src/js/core/column/Column.js +81 -68
- package/src/js/core/column/ColumnComponent.js +4 -4
- package/src/js/core/column/defaults/options.js +1 -1
- package/src/js/core/defaults/options.js +4 -2
- package/src/js/core/rendering/Renderer.js +19 -19
- package/src/js/core/rendering/renderers/BasicHorizontal.js +1 -2
- package/src/js/core/rendering/renderers/BasicVertical.js +1 -1
- package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +42 -58
- package/src/js/core/rendering/renderers/VirtualDomVertical.js +31 -22
- package/src/js/core/row/Row.js +32 -8
- package/src/js/core/row/RowComponent.js +8 -4
- package/src/js/core/tools/Alert.js +44 -45
- package/src/js/core/tools/ComponentFunctionBinder.js +4 -2
- package/src/js/core/tools/DataLoader.js +3 -3
- package/src/js/core/tools/DeprecationAdvisor.js +47 -0
- package/src/js/core/tools/ExternalEventBus.js +5 -5
- package/src/js/core/tools/InteractionMonitor.js +41 -39
- package/src/js/core/tools/InternalEventBus.js +5 -5
- package/src/js/core/tools/ModuleBinder.js +6 -6
- package/src/js/core/tools/OptionsList.js +4 -4
- package/src/js/core/tools/Popup.js +211 -202
- package/src/js/modules/Accessor/Accessor.js +16 -16
- package/src/js/modules/Accessor/defaults/accessors.js +1 -1
- package/src/js/modules/Ajax/Ajax.js +7 -7
- package/src/js/modules/Ajax/defaults/loaderPromise.js +19 -19
- package/src/js/modules/Ajax/defaults/urlGenerator.js +1 -1
- package/src/js/modules/Clipboard/Clipboard.js +23 -23
- package/src/js/modules/Clipboard/defaults/pasteParsers.js +0 -2
- package/src/js/modules/ColumnCalcs/CalcComponent.js +2 -2
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +55 -51
- package/src/js/modules/ColumnCalcs/defaults/calculations.js +1 -1
- package/src/js/modules/DataTree/DataTree.js +24 -15
- package/src/js/modules/Download/Download.js +15 -8
- package/src/js/modules/Download/defaults/downloaders/csv.js +28 -28
- package/src/js/modules/Download/defaults/downloaders/html.js +2 -2
- package/src/js/modules/Download/defaults/downloaders/json.js +14 -14
- package/src/js/modules/Download/defaults/downloaders/jsonLines.js +1 -1
- package/src/js/modules/Download/defaults/downloaders/pdf.js +17 -19
- package/src/js/modules/Download/defaults/downloaders/xlsx.js +2 -2
- package/src/js/modules/Edit/Edit.js +219 -201
- package/src/js/modules/Edit/List.js +1026 -1006
- package/src/js/modules/Edit/defaults/editors/autocomplete.js +3 -3
- package/src/js/modules/Edit/defaults/editors/date.js +110 -0
- package/src/js/modules/Edit/defaults/editors/datetime.js +97 -0
- package/src/js/modules/Edit/defaults/editors/input.js +7 -7
- package/src/js/modules/Edit/defaults/editors/list.js +2 -2
- package/src/js/modules/Edit/defaults/editors/number.js +12 -12
- package/src/js/modules/Edit/defaults/editors/progress.js +11 -11
- package/src/js/modules/Edit/defaults/editors/range.js +5 -5
- package/src/js/modules/Edit/defaults/editors/select.js +3 -3
- package/src/js/modules/Edit/defaults/editors/star.js +9 -9
- package/src/js/modules/Edit/defaults/editors/textarea.js +97 -92
- package/src/js/modules/Edit/defaults/editors/tickCross.js +1 -3
- package/src/js/modules/Edit/defaults/editors/time.js +98 -0
- package/src/js/modules/Edit/defaults/editors.js +8 -2
- package/src/js/modules/Edit/inputMask.js +19 -26
- package/src/js/modules/Export/Export.js +69 -65
- package/src/js/modules/Filter/Filter.js +88 -95
- package/src/js/modules/Format/Format.js +24 -26
- package/src/js/modules/Format/defaults/formatters/buttonCross.js +1 -1
- package/src/js/modules/Format/defaults/formatters/buttonTick.js +1 -1
- package/src/js/modules/Format/defaults/formatters/color.js +1 -1
- package/src/js/modules/Format/defaults/formatters/datetime.js +7 -7
- package/src/js/modules/Format/defaults/formatters/datetimediff.js +7 -7
- package/src/js/modules/Format/defaults/formatters/handle.js +1 -1
- package/src/js/modules/Format/defaults/formatters/html.js +1 -1
- package/src/js/modules/Format/defaults/formatters/image.js +9 -9
- package/src/js/modules/Format/defaults/formatters/link.js +10 -10
- package/src/js/modules/Format/defaults/formatters/lookup.js +1 -1
- package/src/js/modules/Format/defaults/formatters/money.js +1 -1
- package/src/js/modules/Format/defaults/formatters/plaintext.js +1 -1
- package/src/js/modules/Format/defaults/formatters/progress.js +41 -42
- package/src/js/modules/Format/defaults/formatters/responsiveCollapse.js +3 -3
- package/src/js/modules/Format/defaults/formatters/rowSelection.js +1 -1
- package/src/js/modules/Format/defaults/formatters/rownum.js +9 -2
- package/src/js/modules/Format/defaults/formatters/star.js +1 -1
- package/src/js/modules/Format/defaults/formatters/textarea.js +1 -1
- package/src/js/modules/Format/defaults/formatters/tickCross.js +1 -1
- package/src/js/modules/Format/defaults/formatters/traffic.js +14 -14
- package/src/js/modules/FrozenColumns/FrozenColumns.js +6 -8
- package/src/js/modules/FrozenRows/FrozenRows.js +37 -7
- package/src/js/modules/GroupRows/Group.js +7 -7
- package/src/js/modules/GroupRows/GroupComponent.js +2 -2
- package/src/js/modules/GroupRows/GroupRows.js +34 -11
- package/src/js/modules/History/History.js +2 -2
- package/src/js/modules/HtmlTableImport/HtmlTableImport.js +3 -6
- package/src/js/modules/Import/Import.js +158 -159
- package/src/js/modules/Import/defaults/importers/array.js +5 -0
- package/src/js/modules/Import/defaults/importers/csv.js +49 -49
- package/src/js/modules/Import/defaults/importers/json.js +6 -6
- package/src/js/modules/Import/defaults/importers.js +2 -0
- package/src/js/modules/Interaction/Interaction.js +42 -43
- package/src/js/modules/Keybindings/Keybindings.js +14 -14
- package/src/js/modules/Keybindings/defaults/actions.js +1 -2
- package/src/js/modules/Layout/Layout.js +4 -5
- package/src/js/modules/Layout/defaults/modes/fitColumns.js +13 -16
- package/src/js/modules/Layout/defaults/modes/fitData.js +6 -4
- package/src/js/modules/Layout/defaults/modes/fitDataGeneral.js +2 -2
- package/src/js/modules/Layout/defaults/modes/fitDataStretch.js +2 -2
- package/src/js/modules/Localize/Localize.js +7 -7
- package/src/js/modules/Menu/Menu.js +8 -11
- package/src/js/modules/MoveColumns/MoveColumns.js +3 -6
- package/src/js/modules/MoveRows/MoveRows.js +30 -36
- package/src/js/modules/Mutator/Mutator.js +9 -9
- package/src/js/modules/Page/Page.js +73 -80
- package/src/js/modules/Page/defaults/pageCounters/pages.js +2 -2
- package/src/js/modules/Page/defaults/pageCounters/rows.js +1 -1
- package/src/js/modules/Persistence/Persistence.js +40 -44
- package/src/js/modules/Persistence/defaults/readers.js +1 -1
- package/src/js/modules/Popup/Popup.js +4 -5
- package/src/js/modules/Print/Print.js +2 -2
- package/src/js/modules/ReactiveData/ReactiveData.js +178 -115
- package/src/js/modules/ResizeColumns/ResizeColumns.js +3 -3
- package/src/js/modules/ResizeRows/ResizeRows.js +1 -1
- package/src/js/modules/ResizeTable/ResizeTable.js +77 -46
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -5
- package/src/js/modules/SelectRow/SelectRow.js +26 -28
- package/src/js/modules/Sort/Sort.js +113 -85
- package/src/js/modules/Sort/defaults/sorters/alphanum.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/array.js +24 -28
- package/src/js/modules/Sort/defaults/sorters/boolean.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/date.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/datetime.js +13 -13
- package/src/js/modules/Sort/defaults/sorters/exists.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/number.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/string.js +7 -7
- package/src/js/modules/Sort/defaults/sorters/time.js +1 -1
- package/src/js/modules/Tooltip/Tooltip.js +5 -7
- package/src/js/modules/Validate/Validate.js +10 -13
- package/src/js/modules/Validate/defaults/validators.js +8 -3
- package/src/scss/tabulator.scss +28 -17
- package/src/scss/themes/bootstrap/functions4.scss +1 -1
- package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +8 -8
- package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +8 -8
- package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +8 -8
- package/src/scss/themes/bulma/tabulator_bulma.scss +7 -7
- package/src/scss/themes/materialize/tabulator_materialize.scss +6 -6
- package/src/scss/themes/materialize/variables.scss +1 -1
- package/src/scss/themes/semanticui/tabulator_semanticui.scss +7 -7
- package/src/scss/themes/tabulator_midnight.scss +7 -7
- package/src/scss/themes/tabulator_modern.scss +14 -14
- package/src/scss/themes/tabulator_simple.scss +8 -8
- package/src/scss/themes/tabulator_site.scss +15 -15
|
@@ -25,8 +25,8 @@ class Keybindings extends Module{
|
|
|
25
25
|
this.pressedKeys = [];
|
|
26
26
|
|
|
27
27
|
if(bindings !== false){
|
|
28
|
-
Object.assign(mergedBindings, Keybindings.bindings)
|
|
29
|
-
Object.assign(mergedBindings, bindings)
|
|
28
|
+
Object.assign(mergedBindings, Keybindings.bindings);
|
|
29
|
+
Object.assign(mergedBindings, bindings);
|
|
30
30
|
|
|
31
31
|
this.mapBindings(mergedBindings);
|
|
32
32
|
this.bindEvents();
|
|
@@ -71,26 +71,26 @@ class Keybindings extends Module{
|
|
|
71
71
|
symbols.forEach((symbol) => {
|
|
72
72
|
switch(symbol){
|
|
73
73
|
case "ctrl":
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
binding.ctrl = true;
|
|
75
|
+
break;
|
|
76
76
|
|
|
77
77
|
case "shift":
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
binding.shift = true;
|
|
79
|
+
break;
|
|
80
80
|
|
|
81
81
|
case "meta":
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
binding.meta = true;
|
|
83
|
+
break;
|
|
84
84
|
|
|
85
85
|
default:
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
symbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);
|
|
87
|
+
binding.keys.push(symbol);
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
if(!this.watchKeys[symbol]){
|
|
90
|
+
this.watchKeys[symbol] = [];
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
this.watchKeys[symbol].push(binding);
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
@@ -5,8 +5,7 @@ export default {
|
|
|
5
5
|
},
|
|
6
6
|
scrollPageUp:function(e){
|
|
7
7
|
var rowManager = this.table.rowManager,
|
|
8
|
-
newPos = rowManager.scrollTop - rowManager.element.clientHeight
|
|
9
|
-
scrollMax = rowManager.element.scrollHeight;
|
|
8
|
+
newPos = rowManager.scrollTop - rowManager.element.clientHeight;
|
|
10
9
|
|
|
11
10
|
e.preventDefault();
|
|
12
11
|
|
|
@@ -35,11 +35,10 @@ class Layout extends Module{
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
//trigger table layout
|
|
38
|
-
layout(){
|
|
39
|
-
this.dispatch("layout-refreshing")
|
|
40
|
-
Layout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);
|
|
41
|
-
|
|
42
|
-
this.dispatch("layout-refreshed")
|
|
38
|
+
layout(dataChanged){
|
|
39
|
+
this.dispatch("layout-refreshing");
|
|
40
|
+
Layout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);
|
|
41
|
+
this.dispatch("layout-refreshed");
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//resize columns to fit
|
|
2
|
-
export default function(columns){
|
|
3
|
-
var totalWidth = this.table.element.
|
|
2
|
+
export default function(columns, forced){
|
|
3
|
+
var totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width
|
|
4
4
|
var fixedWidth = 0; //total width of columns with a defined width
|
|
5
5
|
var flexWidth = 0; //total width available to flexible columns
|
|
6
|
-
var flexGrowUnits = 0; //total number of widthGrow blocks
|
|
6
|
+
var flexGrowUnits = 0; //total number of widthGrow blocks across all columns
|
|
7
7
|
var flexColWidth = 0; //desired width of flexible columns
|
|
8
8
|
var flexColumns = []; //array of flexible width columns
|
|
9
9
|
var fixedShrinkColumns = []; //array of fixed width columns that can shrink
|
|
10
|
-
var flexShrinkUnits = 0; //total number of widthShrink blocks
|
|
10
|
+
var flexShrinkUnits = 0; //total number of widthShrink blocks across all columns
|
|
11
11
|
var overflowWidth = 0; //horizontal overflow width
|
|
12
|
-
var gapFill=0; //number of pixels to be added to final column to close and half pixel gaps
|
|
12
|
+
var gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps
|
|
13
13
|
|
|
14
14
|
function calcWidth(width){
|
|
15
15
|
var colWidth;
|
|
@@ -29,7 +29,6 @@ export default function(columns){
|
|
|
29
29
|
|
|
30
30
|
//ensure columns resize to take up the correct amount of space
|
|
31
31
|
function scaleColumns(columns, freeSpace, colWidth, shrinkCols){
|
|
32
|
-
|
|
33
32
|
var oversizeCols = [],
|
|
34
33
|
oversizeSpace = 0,
|
|
35
34
|
remainingSpace = 0,
|
|
@@ -44,7 +43,7 @@ export default function(columns){
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
function calcShrink(col){
|
|
47
|
-
return (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))
|
|
46
|
+
return (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
columns.forEach(function(col, i){
|
|
@@ -78,9 +77,7 @@ export default function(columns){
|
|
|
78
77
|
|
|
79
78
|
nextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;
|
|
80
79
|
|
|
81
|
-
gap = remainingSpace
|
|
82
|
-
|
|
83
|
-
gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);
|
|
80
|
+
gap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);
|
|
84
81
|
}else{
|
|
85
82
|
gap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;
|
|
86
83
|
|
|
@@ -137,17 +134,17 @@ export default function(columns){
|
|
|
137
134
|
flexWidth = totalWidth - fixedWidth;
|
|
138
135
|
|
|
139
136
|
//calculate correct column size
|
|
140
|
-
flexColWidth = Math.floor(flexWidth / flexGrowUnits)
|
|
137
|
+
flexColWidth = Math.floor(flexWidth / flexGrowUnits);
|
|
141
138
|
|
|
142
139
|
//generate column widths
|
|
143
|
-
|
|
140
|
+
gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);
|
|
144
141
|
|
|
145
142
|
//increase width of last column to account for rounding errors
|
|
146
143
|
if(flexColumns.length && gapFill > 0){
|
|
147
|
-
flexColumns[flexColumns.length-1].width +=
|
|
144
|
+
flexColumns[flexColumns.length-1].width += gapFill;
|
|
148
145
|
}
|
|
149
146
|
|
|
150
|
-
//
|
|
147
|
+
//calculate space for columns to be shrunk into
|
|
151
148
|
flexColumns.forEach(function(col){
|
|
152
149
|
flexWidth -= col.width;
|
|
153
150
|
});
|
|
@@ -160,7 +157,7 @@ export default function(columns){
|
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
//decrease width of last column to account for rounding errors
|
|
163
|
-
if(fixedShrinkColumns.length){
|
|
160
|
+
if(gapFill && fixedShrinkColumns.length){
|
|
164
161
|
fixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;
|
|
165
162
|
}
|
|
166
163
|
|
|
@@ -171,4 +168,4 @@ export default function(columns){
|
|
|
171
168
|
fixedShrinkColumns.forEach(function(col){
|
|
172
169
|
col.column.setWidth(col.width);
|
|
173
170
|
});
|
|
174
|
-
}
|
|
171
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
//resize columns to fit data they contain
|
|
2
|
-
export default function(columns){
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export default function(columns, forced){
|
|
3
|
+
if(forced){
|
|
4
|
+
this.table.columnManager.renderer.reinitializeColumnWidths(columns);
|
|
5
|
+
}
|
|
6
|
+
|
|
5
7
|
if(this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)){
|
|
6
8
|
this.table.modules.responsiveLayout.update();
|
|
7
9
|
}
|
|
8
|
-
}
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable
|
|
2
|
-
export default function(columns){
|
|
2
|
+
export default function(columns, forced){
|
|
3
3
|
columns.forEach(function(column){
|
|
4
4
|
column.reinitializeWidth();
|
|
5
5
|
});
|
|
@@ -7,4 +7,4 @@ export default function(columns){
|
|
|
7
7
|
if(this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)){
|
|
8
8
|
this.table.modules.responsiveLayout.update();
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//resize columns to fit data the contain and stretch last column to fill table
|
|
2
|
-
export default function(columns){
|
|
2
|
+
export default function(columns, forced){
|
|
3
3
|
var colsWidth = 0,
|
|
4
4
|
tableWidth = this.table.rowManager.element.clientWidth,
|
|
5
5
|
gap = 0,
|
|
@@ -37,4 +37,4 @@ export default function(columns){
|
|
|
37
37
|
this.table.modules.responsiveLayout.update();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -36,7 +36,7 @@ class Localize extends Module{
|
|
|
36
36
|
this.registerTableFunction("getLang", this.getLang.bind(this));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
//set header
|
|
39
|
+
//set header placeholder
|
|
40
40
|
setHeaderFilterPlaceholder(placeholder){
|
|
41
41
|
this.langList.default.headerFilters.default = placeholder;
|
|
42
42
|
}
|
|
@@ -62,7 +62,7 @@ class Localize extends Module{
|
|
|
62
62
|
_setLangProp(lang, values){
|
|
63
63
|
for(let key in values){
|
|
64
64
|
if(lang[key] && typeof lang[key] == "object"){
|
|
65
|
-
this._setLangProp(lang[key], values[key])
|
|
65
|
+
this._setLangProp(lang[key], values[key]);
|
|
66
66
|
}else{
|
|
67
67
|
lang[key] = values[key];
|
|
68
68
|
}
|
|
@@ -73,7 +73,7 @@ class Localize extends Module{
|
|
|
73
73
|
setLocale(desiredLocale){
|
|
74
74
|
desiredLocale = desiredLocale || "default";
|
|
75
75
|
|
|
76
|
-
//fill in any matching
|
|
76
|
+
//fill in any matching language values
|
|
77
77
|
function traverseLang(trans, path){
|
|
78
78
|
for(var prop in trans){
|
|
79
79
|
if(typeof trans[prop] == "object"){
|
|
@@ -87,7 +87,7 @@ class Localize extends Module{
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
//
|
|
90
|
+
//determining correct locale to load
|
|
91
91
|
if(desiredLocale === true && navigator.language){
|
|
92
92
|
//get local from system
|
|
93
93
|
desiredLocale = navigator.language.toLowerCase();
|
|
@@ -134,8 +134,8 @@ class Localize extends Module{
|
|
|
134
134
|
|
|
135
135
|
//get text for current locale
|
|
136
136
|
getText(path, value){
|
|
137
|
-
var
|
|
138
|
-
pathArray =
|
|
137
|
+
var fillPath = value ? path + "|" + value : path,
|
|
138
|
+
pathArray = fillPath.split("|"),
|
|
139
139
|
text = this._getLangElement(pathArray, this.locale);
|
|
140
140
|
|
|
141
141
|
// if(text === false){
|
|
@@ -177,7 +177,7 @@ class Localize extends Module{
|
|
|
177
177
|
callback(this.getText(path), this.lang);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
//
|
|
180
|
+
//iterate through bindings and trigger updates
|
|
181
181
|
_executeBindings(){
|
|
182
182
|
for(let path in this.bindings){
|
|
183
183
|
this.bindings[path].forEach((binding) => {
|
|
@@ -30,17 +30,15 @@ class Menu extends Module{
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
initialize(){
|
|
33
|
-
this.
|
|
33
|
+
this.deprecatedOptionsCheck();
|
|
34
34
|
this.initializeRowWatchers();
|
|
35
35
|
this.initializeGroupWatchers();
|
|
36
36
|
|
|
37
37
|
this.subscribe("column-init", this.initializeColumn.bind(this));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
if(
|
|
42
|
-
console.warn("Use of the menuContainer option is now deprecated. Please use the popupContainer option instead");
|
|
43
|
-
|
|
40
|
+
deprecatedOptionsCheck(){
|
|
41
|
+
if(!this.deprecationCheck("menuContainer", "popupContainer")){
|
|
44
42
|
this.table.options.popupContainer = this.table.options.menuContainer;
|
|
45
43
|
}
|
|
46
44
|
}
|
|
@@ -68,14 +66,13 @@ class Menu extends Module{
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
initializeColumn(column){
|
|
71
|
-
var
|
|
72
|
-
def = column.definition;
|
|
69
|
+
var def = column.definition;
|
|
73
70
|
|
|
74
71
|
//handle column events
|
|
75
72
|
if(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){
|
|
76
73
|
this.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, "headerContextMenu");
|
|
77
74
|
this.subscribe("column-contextmenu", this.columnSubscribers.headerContextMenu);
|
|
78
|
-
this.table.on("headerTapHold", this.loadMenuTableColumnEvent.bind(this, "headerContextMenu"))
|
|
75
|
+
this.table.on("headerTapHold", this.loadMenuTableColumnEvent.bind(this, "headerContextMenu"));
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
if(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){
|
|
@@ -91,7 +88,7 @@ class Menu extends Module{
|
|
|
91
88
|
if(def.contextMenu && !this.columnSubscribers.contextMenu){
|
|
92
89
|
this.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, "contextMenu");
|
|
93
90
|
this.subscribe("cell-contextmenu", this.columnSubscribers.contextMenu);
|
|
94
|
-
this.table.on("cellTapHold", this.loadMenuTableCellEvent.bind(this, "contextMenu"))
|
|
91
|
+
this.table.on("cellTapHold", this.loadMenuTableCellEvent.bind(this, "contextMenu"));
|
|
95
92
|
}
|
|
96
93
|
|
|
97
94
|
if(def.clickMenu && !this.columnSubscribers.clickMenu){
|
|
@@ -188,7 +185,7 @@ class Menu extends Module{
|
|
|
188
185
|
}else{
|
|
189
186
|
this.nestedMenuBlock = setTimeout(() => {
|
|
190
187
|
this.nestedMenuBlock = false;
|
|
191
|
-
}, 100)
|
|
188
|
+
}, 100);
|
|
192
189
|
}
|
|
193
190
|
|
|
194
191
|
if(this.rootPopup){
|
|
@@ -271,7 +268,7 @@ class Menu extends Module{
|
|
|
271
268
|
|
|
272
269
|
this.currentComponent = component;
|
|
273
270
|
|
|
274
|
-
this.dispatchExternal("menuOpened", component.getComponent())
|
|
271
|
+
this.dispatchExternal("menuOpened", component.getComponent());
|
|
275
272
|
}
|
|
276
273
|
}
|
|
277
274
|
}
|
|
@@ -12,7 +12,7 @@ class MoveColumns extends Module{
|
|
|
12
12
|
this.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click
|
|
13
13
|
this.moving = false; //currently moving column
|
|
14
14
|
this.toCol = false; //destination column
|
|
15
|
-
this.toColAfter = false; //position of moving column relative to the
|
|
15
|
+
this.toColAfter = false; //position of moving column relative to the destination column
|
|
16
16
|
this.startX = 0; //starting position within header element
|
|
17
17
|
this.autoScrollMargin = 40; //auto scroll on edge when within margin
|
|
18
18
|
this.autoScrollStep = 5; //auto scroll distance in pixels
|
|
@@ -90,13 +90,11 @@ class MoveColumns extends Module{
|
|
|
90
90
|
bindTouchEvents(column){
|
|
91
91
|
var colEl = column.getElement(),
|
|
92
92
|
startXMove = false, //shifting center position of the cell
|
|
93
|
-
|
|
94
|
-
currentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;
|
|
93
|
+
nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;
|
|
95
94
|
|
|
96
95
|
colEl.addEventListener("touchstart", (e) => {
|
|
97
96
|
this.checkTimeout = setTimeout(() => {
|
|
98
97
|
this.touchMove = true;
|
|
99
|
-
currentCol = column;
|
|
100
98
|
nextCol = column.nextColumn();
|
|
101
99
|
nextColWidth = nextCol ? nextCol.getWidth()/2 : 0;
|
|
102
100
|
prevCol = column.prevColumn();
|
|
@@ -110,7 +108,7 @@ class MoveColumns extends Module{
|
|
|
110
108
|
}, {passive: true});
|
|
111
109
|
|
|
112
110
|
colEl.addEventListener("touchmove", (e) => {
|
|
113
|
-
var
|
|
111
|
+
var diff, moveToCol;
|
|
114
112
|
|
|
115
113
|
if(this.moving){
|
|
116
114
|
this.moveHover(e);
|
|
@@ -144,7 +142,6 @@ class MoveColumns extends Module{
|
|
|
144
142
|
}
|
|
145
143
|
|
|
146
144
|
if(moveToCol){
|
|
147
|
-
currentCol = moveToCol;
|
|
148
145
|
nextCol = moveToCol.nextColumn();
|
|
149
146
|
nextColWidthLast = nextColWidth;
|
|
150
147
|
nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;
|
|
@@ -12,7 +12,7 @@ class MoveRows extends Module{
|
|
|
12
12
|
this.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click
|
|
13
13
|
this.moving = false; //currently moving row
|
|
14
14
|
this.toRow = false; //destination row
|
|
15
|
-
this.toRowAfter = false; //position of moving row relative to the
|
|
15
|
+
this.toRowAfter = false; //position of moving row relative to the destination row
|
|
16
16
|
this.hasHandle = false; //row has handle instead of fully movable row
|
|
17
17
|
this.startY = 0; //starting Y position within header element
|
|
18
18
|
this.startX = 0; //starting X position within header element
|
|
@@ -65,25 +65,26 @@ class MoveRows extends Module{
|
|
|
65
65
|
|
|
66
66
|
initializeGroupHeader(group){
|
|
67
67
|
var self = this,
|
|
68
|
-
config = {}
|
|
69
|
-
rowEl;
|
|
68
|
+
config = {};
|
|
70
69
|
|
|
71
70
|
//inter table drag drop
|
|
72
71
|
config.mouseup = function(e){
|
|
73
|
-
self.tableRowDrop(e,
|
|
72
|
+
self.tableRowDrop(e, group);
|
|
74
73
|
}.bind(self);
|
|
75
74
|
|
|
76
75
|
//same table drag drop
|
|
77
76
|
config.mousemove = function(e){
|
|
77
|
+
var rowEl;
|
|
78
|
+
|
|
78
79
|
if(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){
|
|
79
80
|
if(self.toRow !== group || !self.toRowAfter){
|
|
80
|
-
|
|
81
|
+
rowEl = group.getElement();
|
|
81
82
|
rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
|
|
82
83
|
self.moveRow(group, true);
|
|
83
84
|
}
|
|
84
85
|
}else{
|
|
85
86
|
if(self.toRow !== group || self.toRowAfter){
|
|
86
|
-
|
|
87
|
+
rowEl = group.getElement();
|
|
87
88
|
if(rowEl.previousSibling){
|
|
88
89
|
rowEl.parentNode.insertBefore(self.placeholderElement, rowEl);
|
|
89
90
|
self.moveRow(group, false);
|
|
@@ -182,13 +183,11 @@ class MoveRows extends Module{
|
|
|
182
183
|
|
|
183
184
|
bindTouchEvents(row, element){
|
|
184
185
|
var startYMove = false, //shifting center position of the cell
|
|
185
|
-
|
|
186
|
-
currentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;
|
|
186
|
+
nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;
|
|
187
187
|
|
|
188
188
|
element.addEventListener("touchstart", (e) => {
|
|
189
189
|
this.checkTimeout = setTimeout(() => {
|
|
190
190
|
this.touchMove = true;
|
|
191
|
-
currentRow = row;
|
|
192
191
|
nextRow = row.nextRow();
|
|
193
192
|
nextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;
|
|
194
193
|
prevRow = row.prevRow();
|
|
@@ -200,10 +199,10 @@ class MoveRows extends Module{
|
|
|
200
199
|
this.startMove(e, row);
|
|
201
200
|
}, this.checkPeriod);
|
|
202
201
|
}, {passive: true});
|
|
203
|
-
this.moving, this.toRow, this.toRowAfter
|
|
202
|
+
this.moving, this.toRow, this.toRowAfter;
|
|
204
203
|
element.addEventListener("touchmove", (e) => {
|
|
205
204
|
|
|
206
|
-
var
|
|
205
|
+
var diff, moveToRow;
|
|
207
206
|
|
|
208
207
|
if(this.moving){
|
|
209
208
|
e.preventDefault();
|
|
@@ -221,7 +220,7 @@ class MoveRows extends Module{
|
|
|
221
220
|
moveToRow = nextRow;
|
|
222
221
|
|
|
223
222
|
if(moveToRow !== row){
|
|
224
|
-
startYMove = e.touches[0].pageY
|
|
223
|
+
startYMove = e.touches[0].pageY;
|
|
225
224
|
moveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);
|
|
226
225
|
this.moveRow(moveToRow, true);
|
|
227
226
|
}
|
|
@@ -239,7 +238,6 @@ class MoveRows extends Module{
|
|
|
239
238
|
}
|
|
240
239
|
|
|
241
240
|
if(moveToRow){
|
|
242
|
-
currentRow = moveToRow;
|
|
243
241
|
nextRow = moveToRow.nextRow();
|
|
244
242
|
nextRowHeightLast = nextRowHeight;
|
|
245
243
|
nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;
|
|
@@ -392,10 +390,9 @@ class MoveRows extends Module{
|
|
|
392
390
|
moveHoverTable(e){
|
|
393
391
|
var rowHolder = this.table.rowManager.getElement(),
|
|
394
392
|
scrollTop = rowHolder.scrollTop,
|
|
395
|
-
yPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
this.hoverElement.style.top = (yPos - this.startY) + "px";
|
|
393
|
+
yPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;
|
|
394
|
+
|
|
395
|
+
this.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + "px";
|
|
399
396
|
}
|
|
400
397
|
|
|
401
398
|
moveHoverConnections(e){
|
|
@@ -496,7 +493,7 @@ class MoveRows extends Module{
|
|
|
496
493
|
}
|
|
497
494
|
}
|
|
498
495
|
|
|
499
|
-
//close
|
|
496
|
+
//close incoming connection
|
|
500
497
|
disconnect(table){
|
|
501
498
|
if(table === this.connectedTable){
|
|
502
499
|
this.connectedTable = false;
|
|
@@ -514,7 +511,7 @@ class MoveRows extends Module{
|
|
|
514
511
|
|
|
515
512
|
this.dispatchExternal("movableRowsReceivingStop", table);
|
|
516
513
|
}else{
|
|
517
|
-
console.warn("Move Row Error - trying to disconnect from non connected table")
|
|
514
|
+
console.warn("Move Row Error - trying to disconnect from non connected table");
|
|
518
515
|
}
|
|
519
516
|
}
|
|
520
517
|
|
|
@@ -525,16 +522,16 @@ class MoveRows extends Module{
|
|
|
525
522
|
|
|
526
523
|
switch(typeof this.table.options.movableRowsSender){
|
|
527
524
|
case "string":
|
|
528
|
-
|
|
529
|
-
|
|
525
|
+
sender = this.senders[this.table.options.movableRowsSender];
|
|
526
|
+
break;
|
|
530
527
|
|
|
531
528
|
case "function":
|
|
532
|
-
|
|
533
|
-
|
|
529
|
+
sender = this.table.options.movableRowsSender;
|
|
530
|
+
break;
|
|
534
531
|
}
|
|
535
532
|
|
|
536
533
|
if(sender){
|
|
537
|
-
sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)
|
|
534
|
+
sender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);
|
|
538
535
|
}else{
|
|
539
536
|
if(this.table.options.movableRowsSender){
|
|
540
537
|
console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender);
|
|
@@ -557,18 +554,18 @@ class MoveRows extends Module{
|
|
|
557
554
|
|
|
558
555
|
switch(typeof this.table.options.movableRowsReceiver){
|
|
559
556
|
case "string":
|
|
560
|
-
|
|
561
|
-
|
|
557
|
+
receiver = this.receivers[this.table.options.movableRowsReceiver];
|
|
558
|
+
break;
|
|
562
559
|
|
|
563
560
|
case "function":
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
receiver = this.table.options.movableRowsReceiver;
|
|
562
|
+
break;
|
|
566
563
|
}
|
|
567
564
|
|
|
568
565
|
if(receiver){
|
|
569
|
-
success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)
|
|
566
|
+
success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);
|
|
570
567
|
}else{
|
|
571
|
-
console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver)
|
|
568
|
+
console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver);
|
|
572
569
|
}
|
|
573
570
|
|
|
574
571
|
if(success){
|
|
@@ -586,16 +583,13 @@ class MoveRows extends Module{
|
|
|
586
583
|
commsReceived(table, action, data){
|
|
587
584
|
switch(action){
|
|
588
585
|
case "connect":
|
|
589
|
-
|
|
590
|
-
break;
|
|
586
|
+
return this.connect(table, data.row);
|
|
591
587
|
|
|
592
588
|
case "disconnect":
|
|
593
|
-
|
|
594
|
-
break;
|
|
589
|
+
return this.disconnect(table);
|
|
595
590
|
|
|
596
591
|
case "dropcomplete":
|
|
597
|
-
|
|
598
|
-
break;
|
|
592
|
+
return this.dropComplete(table, data.row, data.success);
|
|
599
593
|
}
|
|
600
594
|
}
|
|
601
595
|
}
|
|
@@ -7,7 +7,7 @@ class Mutator extends Module{
|
|
|
7
7
|
constructor(table){
|
|
8
8
|
super(table);
|
|
9
9
|
|
|
10
|
-
this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of
|
|
10
|
+
this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of mutation types
|
|
11
11
|
this.enabled = true;
|
|
12
12
|
|
|
13
13
|
this.registerColumnOption("mutator");
|
|
@@ -67,16 +67,16 @@ class Mutator extends Module{
|
|
|
67
67
|
//set column mutator
|
|
68
68
|
switch(typeof value){
|
|
69
69
|
case "string":
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
if(Mutator.mutators[value]){
|
|
71
|
+
mutator = Mutator.mutators[value];
|
|
72
|
+
}else{
|
|
73
|
+
console.warn("Mutator Error - No such mutator found, ignoring: ", value);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
76
|
|
|
77
77
|
case "function":
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
mutator = value;
|
|
79
|
+
break;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return mutator;
|