melondtable 1.19.0 → 1.21.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/LICENSE +0 -1
- package/dist/melondtable.cjs.js +197 -24
- package/dist/melondtable.css +34 -3
- package/dist/melondtable.js +257 -91
- package/dist/melondtable.min.css +1 -1
- package/dist/melondtable.min.js +1 -1
- package/package.json +6 -3
- package/src/body-renderer.js +15 -1
- package/src/cellmanager.js +25 -4
- package/src/columnmanager.js +42 -7
- package/src/datamanager.js +13 -10
- package/src/datatable.js +4 -0
- package/src/defaults.js +17 -0
- package/src/style.css +32 -3
- package/src/style.js +64 -1
- package/src/translations/de.json +17 -0
- package/src/translations/en.json +2 -0
- package/src/translations/fr.json +2 -0
- package/src/translations/index.js +7 -7
- package/src/translations/it.json +17 -0
- package/src/translations/pt.json +0 -15
- package/src/translations/sw.json +0 -15
package/LICENSE
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
MIT
|
package/dist/melondtable.cjs.js
CHANGED
|
@@ -1985,6 +1985,7 @@ class DataManager {
|
|
|
1985
1985
|
sortable: false,
|
|
1986
1986
|
focusable: false,
|
|
1987
1987
|
dropdown: false,
|
|
1988
|
+
sticky: true,
|
|
1988
1989
|
width: 32
|
|
1989
1990
|
};
|
|
1990
1991
|
this.columns.push(cell);
|
|
@@ -1993,16 +1994,14 @@ class DataManager {
|
|
|
1993
1994
|
if (this.options.serialNoColumn && !this.hasColumnById('_rowIndex')) {
|
|
1994
1995
|
let cell = {
|
|
1995
1996
|
id: '_rowIndex',
|
|
1996
|
-
content: '',
|
|
1997
|
+
content: this.options.serialNoColumnLabel || '',
|
|
1997
1998
|
align: 'center',
|
|
1998
1999
|
editable: false,
|
|
1999
|
-
resizable:
|
|
2000
|
+
resizable: true,
|
|
2000
2001
|
focusable: false,
|
|
2001
|
-
dropdown: false
|
|
2002
|
+
dropdown: false,
|
|
2003
|
+
sticky: true
|
|
2002
2004
|
};
|
|
2003
|
-
if (this.options.data.length > 1000) {
|
|
2004
|
-
cell.resizable = true;
|
|
2005
|
-
}
|
|
2006
2005
|
this.columns.push(cell);
|
|
2007
2006
|
}
|
|
2008
2007
|
}
|
|
@@ -2207,14 +2206,18 @@ class DataManager {
|
|
|
2207
2206
|
}
|
|
2208
2207
|
}
|
|
2209
2208
|
|
|
2209
|
+
const sortValue = cell => {
|
|
2210
|
+
const hook = cell.column && cell.column.sortValue;
|
|
2211
|
+
const value = hook ? hook(cell) : cell.content;
|
|
2212
|
+
return value == null ? '' : value;
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2210
2215
|
this.rowViewOrder.sort((a, b) => {
|
|
2211
2216
|
const aIndex = a;
|
|
2212
2217
|
const bIndex = b;
|
|
2213
2218
|
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
aContent = aContent == null ? '' : aContent;
|
|
2217
|
-
bContent = bContent == null ? '' : bContent;
|
|
2219
|
+
const aContent = sortValue(this.getCell(colIndex, a));
|
|
2220
|
+
const bContent = sortValue(this.getCell(colIndex, b));
|
|
2218
2221
|
|
|
2219
2222
|
if (sortOrder === 'none') {
|
|
2220
2223
|
return aIndex - bIndex;
|
|
@@ -2586,6 +2589,7 @@ class CellManager {
|
|
|
2586
2589
|
this.bindKeyboardSelection();
|
|
2587
2590
|
this.bindCopyCellContents();
|
|
2588
2591
|
this.bindMouseEvents();
|
|
2592
|
+
this.bindWheelEvents();
|
|
2589
2593
|
this.bindTreeEvents();
|
|
2590
2594
|
}
|
|
2591
2595
|
|
|
@@ -2634,6 +2638,7 @@ class CellManager {
|
|
|
2634
2638
|
}
|
|
2635
2639
|
|
|
2636
2640
|
this.focusCell($cell);
|
|
2641
|
+
sessionStorage.setItem('dt-last-nav-method', 'key');
|
|
2637
2642
|
return true;
|
|
2638
2643
|
};
|
|
2639
2644
|
|
|
@@ -2742,6 +2747,12 @@ class CellManager {
|
|
|
2742
2747
|
$.on(this.bodyScrollable, 'mousemove', '.dt-cell', throttle$1(selectArea, 50));
|
|
2743
2748
|
}
|
|
2744
2749
|
|
|
2750
|
+
bindWheelEvents() {
|
|
2751
|
+
$.on(this.bodyScrollable, 'wheel', (e) => {
|
|
2752
|
+
sessionStorage.setItem('dt-last-nav-method', 'scroll');
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2745
2756
|
bindTreeEvents() {
|
|
2746
2757
|
$.on(this.bodyScrollable, 'click', '.dt-tree-node__toggle', (e, $toggle) => {
|
|
2747
2758
|
const $cell = $.closest('.dt-cell', $toggle);
|
|
@@ -2866,11 +2877,13 @@ class CellManager {
|
|
|
2866
2877
|
// this function is called after hyperlist renders the rows after scroll,
|
|
2867
2878
|
// focusCell calls clearSelection which resets the area selection
|
|
2868
2879
|
// so a flag to skip it
|
|
2869
|
-
// we
|
|
2870
|
-
// because it fights with the user scroll
|
|
2880
|
+
// we skip scroll to cell
|
|
2881
|
+
// and also skip DOM focus (if user is scrolling) because it fights with the user scroll
|
|
2882
|
+
const skipDOMFocus = sessionStorage.getItem('dt-last-nav-method') !== 'key';
|
|
2883
|
+
|
|
2871
2884
|
this.focusCell($cell, {
|
|
2885
|
+
skipDOMFocus,
|
|
2872
2886
|
skipClearSelection: 1,
|
|
2873
|
-
skipDOMFocus: 1,
|
|
2874
2887
|
skipScrollToCell: 1
|
|
2875
2888
|
});
|
|
2876
2889
|
}
|
|
@@ -3267,6 +3280,7 @@ class CellManager {
|
|
|
3267
3280
|
}
|
|
3268
3281
|
|
|
3269
3282
|
this.focusCell($cell);
|
|
3283
|
+
sessionStorage.setItem('dt-last-nav-method', 'key');
|
|
3270
3284
|
return true;
|
|
3271
3285
|
}
|
|
3272
3286
|
|
|
@@ -3365,8 +3379,15 @@ class CellManager {
|
|
|
3365
3379
|
});
|
|
3366
3380
|
|
|
3367
3381
|
const row = this.datamanager.getRow(rowIndex);
|
|
3382
|
+
const column = cell.column || this.datamanager.getColumn(colIndex) || {};
|
|
3368
3383
|
|
|
3369
3384
|
const isBodyCell = !(isHeader || isFilter || isTotalRow);
|
|
3385
|
+
const isSticky = Boolean(column.sticky);
|
|
3386
|
+
const stickyColumns = this.datamanager.getColumns().filter(col => col.sticky);
|
|
3387
|
+
const lastStickyColumn = stickyColumns[stickyColumns.length - 1];
|
|
3388
|
+
const isLastStickyColumn = isSticky &&
|
|
3389
|
+
lastStickyColumn &&
|
|
3390
|
+
lastStickyColumn.colIndex === colIndex;
|
|
3370
3391
|
|
|
3371
3392
|
const className = [
|
|
3372
3393
|
'dt-cell',
|
|
@@ -3376,7 +3397,10 @@ class CellManager {
|
|
|
3376
3397
|
isHeader ? 'dt-cell--header' : '',
|
|
3377
3398
|
isHeader ? `dt-cell--header-${colIndex}` : '',
|
|
3378
3399
|
isFilter ? 'dt-cell--filter' : '',
|
|
3379
|
-
isBodyCell && (row && row.meta.isTreeNodeClose) ? 'dt-cell--tree-close' : ''
|
|
3400
|
+
isBodyCell && (row && row.meta.isTreeNodeClose) ? 'dt-cell--tree-close' : '',
|
|
3401
|
+
isSticky ? 'dt-cell--sticky' : '',
|
|
3402
|
+
isSticky && !isBodyCell ? 'dt-cell--sticky-top' : '',
|
|
3403
|
+
isLastStickyColumn ? 'dt-cell--sticky-last' : ''
|
|
3380
3404
|
].join(' ');
|
|
3381
3405
|
|
|
3382
3406
|
return `
|
|
@@ -3574,7 +3598,7 @@ class ColumnManager {
|
|
|
3574
3598
|
});
|
|
3575
3599
|
|
|
3576
3600
|
$.on(this.$dropdownList, 'click', '.dt-dropdown__list-item', (e, $item) => {
|
|
3577
|
-
if (
|
|
3601
|
+
if (this._dropdownActiveColIndex == null) return;
|
|
3578
3602
|
const dropdownItems = this.options.headerDropdown;
|
|
3579
3603
|
const { index } = $.data($item);
|
|
3580
3604
|
const colIndex = this._dropdownActiveColIndex;
|
|
@@ -3589,6 +3613,11 @@ class ColumnManager {
|
|
|
3589
3613
|
_this.hideDropdown();
|
|
3590
3614
|
}
|
|
3591
3615
|
|
|
3616
|
+
this.stickDropdownIndex = this.options.headerDropdown
|
|
3617
|
+
.findIndex(item => item.stickyAction === 'stick');
|
|
3618
|
+
this.unstickDropdownIndex = this.options.headerDropdown
|
|
3619
|
+
.findIndex(item => item.stickyAction === 'unstick');
|
|
3620
|
+
|
|
3592
3621
|
this.hideDropdown();
|
|
3593
3622
|
}
|
|
3594
3623
|
|
|
@@ -3605,6 +3634,7 @@ class ColumnManager {
|
|
|
3605
3634
|
const $cell = $.closest('.dt-cell', e.target);
|
|
3606
3635
|
const { colIndex } = $.data($cell);
|
|
3607
3636
|
this._dropdownActiveColIndex = colIndex;
|
|
3637
|
+
this.updateStickyDropdownItems(this.getColumn(colIndex));
|
|
3608
3638
|
}
|
|
3609
3639
|
|
|
3610
3640
|
hideDropdown() {
|
|
@@ -3640,12 +3670,6 @@ class ColumnManager {
|
|
|
3640
3670
|
document.body.classList.remove('dt-resize');
|
|
3641
3671
|
if (!$resizingCell) return;
|
|
3642
3672
|
isDragging = false;
|
|
3643
|
-
|
|
3644
|
-
const {
|
|
3645
|
-
colIndex
|
|
3646
|
-
} = $.data($resizingCell);
|
|
3647
|
-
this.setColumnWidth(colIndex);
|
|
3648
|
-
this.style.setBodyStyle();
|
|
3649
3673
|
$resizingCell = null;
|
|
3650
3674
|
};
|
|
3651
3675
|
$.on(document.body, 'mouseup', onMouseup);
|
|
@@ -3673,6 +3697,9 @@ class ColumnManager {
|
|
|
3673
3697
|
width: finalWidth
|
|
3674
3698
|
});
|
|
3675
3699
|
this.setColumnHeaderWidth(colIndex);
|
|
3700
|
+
this.setColumnWidth(colIndex);
|
|
3701
|
+
this.style.refreshStickyColumns();
|
|
3702
|
+
this.style.setBodyStyle();
|
|
3676
3703
|
};
|
|
3677
3704
|
$.on(document.body, 'mousemove', onMouseMove);
|
|
3678
3705
|
this.instance.on('onDestroy', () => {
|
|
@@ -3709,6 +3736,7 @@ class ColumnManager {
|
|
|
3709
3736
|
this.datamanager.updateColumn(colIndex, { width });
|
|
3710
3737
|
this.setColumnHeaderWidth(colIndex);
|
|
3711
3738
|
this.setColumnWidth(colIndex);
|
|
3739
|
+
this.style.refreshStickyColumns();
|
|
3712
3740
|
});
|
|
3713
3741
|
}
|
|
3714
3742
|
|
|
@@ -3785,6 +3813,20 @@ class ColumnManager {
|
|
|
3785
3813
|
});
|
|
3786
3814
|
}
|
|
3787
3815
|
|
|
3816
|
+
setColumnSticky(colIndex, sticky) {
|
|
3817
|
+
const column = this.getColumn(colIndex);
|
|
3818
|
+
if (!column || column.sticky === sticky) {
|
|
3819
|
+
return;
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
this.instance.freeze();
|
|
3823
|
+
this.datamanager.updateColumn(colIndex, { sticky });
|
|
3824
|
+
|
|
3825
|
+
this.refreshHeader();
|
|
3826
|
+
this.rowmanager.refreshRows()
|
|
3827
|
+
.then(() => this.instance.unfreeze());
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3788
3830
|
switchColumn(oldIndex, newIndex) {
|
|
3789
3831
|
this.instance.freeze();
|
|
3790
3832
|
this.datamanager.switchColumn(oldIndex, newIndex)
|
|
@@ -3974,6 +4016,23 @@ class ColumnManager {
|
|
|
3974
4016
|
toggleDropdownItem(index) {
|
|
3975
4017
|
$('.dt-dropdown__list', this.instance.dropdownContainer).children[index].classList.toggle('dt-hidden');
|
|
3976
4018
|
}
|
|
4019
|
+
|
|
4020
|
+
updateStickyDropdownItems(column) {
|
|
4021
|
+
if (!column) return;
|
|
4022
|
+
if (this.stickDropdownIndex === -1 || this.unstickDropdownIndex === -1) return;
|
|
4023
|
+
|
|
4024
|
+
const stickItem = this.$dropdownList.children[this.stickDropdownIndex];
|
|
4025
|
+
const unstickItem = this.$dropdownList.children[this.unstickDropdownIndex];
|
|
4026
|
+
if (!(stickItem && unstickItem)) return;
|
|
4027
|
+
|
|
4028
|
+
if (column.sticky) {
|
|
4029
|
+
stickItem.classList.add('dt-hidden');
|
|
4030
|
+
unstickItem.classList.remove('dt-hidden');
|
|
4031
|
+
} else {
|
|
4032
|
+
stickItem.classList.remove('dt-hidden');
|
|
4033
|
+
unstickItem.classList.add('dt-hidden');
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
3977
4036
|
}
|
|
3978
4037
|
|
|
3979
4038
|
class RowManager {
|
|
@@ -4841,12 +4900,26 @@ class BodyRenderer {
|
|
|
4841
4900
|
}
|
|
4842
4901
|
|
|
4843
4902
|
render() {
|
|
4844
|
-
const rows = this.
|
|
4903
|
+
const rows = this.getRowsToRender();
|
|
4845
4904
|
this.renderRows(rows);
|
|
4846
4905
|
// setDimensions requires atleast 1 row to exist in dom
|
|
4847
4906
|
this.instance.setDimensions();
|
|
4848
4907
|
}
|
|
4849
4908
|
|
|
4909
|
+
// Keep the current tree expand/collapse state on a full re-render
|
|
4910
|
+
getRowsToRender() {
|
|
4911
|
+
const rows = this.datamanager.getRowsForView();
|
|
4912
|
+
let closedIndent = null;
|
|
4913
|
+
return rows.filter(row => {
|
|
4914
|
+
const { indent, isTreeNodeClose } = row.meta;
|
|
4915
|
+
if (closedIndent !== null && indent > closedIndent) {
|
|
4916
|
+
return false;
|
|
4917
|
+
}
|
|
4918
|
+
closedIndent = isTreeNodeClose ? indent : null;
|
|
4919
|
+
return true;
|
|
4920
|
+
});
|
|
4921
|
+
}
|
|
4922
|
+
|
|
4850
4923
|
renderFooter() {
|
|
4851
4924
|
if (!this.options.showTotalRow) return;
|
|
4852
4925
|
|
|
@@ -4976,6 +5049,7 @@ class Style {
|
|
|
4976
5049
|
|
|
4977
5050
|
bindScrollHeader() {
|
|
4978
5051
|
this._settingHeaderPosition = false;
|
|
5052
|
+
this.updateStickyTopPositions(0);
|
|
4979
5053
|
|
|
4980
5054
|
$.on(this.bodyScrollable, 'scroll', (e) => {
|
|
4981
5055
|
if (this._settingHeaderPosition) return;
|
|
@@ -4983,7 +5057,8 @@ class Style {
|
|
|
4983
5057
|
this._settingHeaderPosition = true;
|
|
4984
5058
|
|
|
4985
5059
|
requestAnimationFrame(() => {
|
|
4986
|
-
const
|
|
5060
|
+
const scrollLeft = e.target.scrollLeft;
|
|
5061
|
+
const left = -scrollLeft;
|
|
4987
5062
|
|
|
4988
5063
|
$.style(this.header, {
|
|
4989
5064
|
transform: `translateX(${left}px)`
|
|
@@ -4991,6 +5066,7 @@ class Style {
|
|
|
4991
5066
|
$.style(this.footer, {
|
|
4992
5067
|
transform: `translateX(${left}px)`
|
|
4993
5068
|
});
|
|
5069
|
+
this.updateStickyTopPositions(scrollLeft);
|
|
4994
5070
|
this._settingHeaderPosition = false;
|
|
4995
5071
|
if (this.instance.noData) {
|
|
4996
5072
|
$.style($('.no-data-message'), {
|
|
@@ -5088,6 +5164,7 @@ class Style {
|
|
|
5088
5164
|
this.setupColumnWidth();
|
|
5089
5165
|
this.distributeRemainingWidth();
|
|
5090
5166
|
this.setColumnStyle();
|
|
5167
|
+
this.refreshStickyColumns();
|
|
5091
5168
|
this.setBodyStyle();
|
|
5092
5169
|
}
|
|
5093
5170
|
|
|
@@ -5245,6 +5322,12 @@ class Style {
|
|
|
5245
5322
|
this.columnmanager.setColumnHeaderWidth(column.colIndex);
|
|
5246
5323
|
this.columnmanager.setColumnWidth(column.colIndex);
|
|
5247
5324
|
});
|
|
5325
|
+
this.refreshStickyColumns();
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
refreshStickyColumns() {
|
|
5329
|
+
this.setStickyColumnStyle();
|
|
5330
|
+
this.updateStickyTopPositions(this.bodyScrollable.scrollLeft || 0);
|
|
5248
5331
|
}
|
|
5249
5332
|
|
|
5250
5333
|
setBodyStyle() {
|
|
@@ -5306,6 +5389,59 @@ class Style {
|
|
|
5306
5389
|
return $(`.dt-cell--col-${colIndex}`, this.header);
|
|
5307
5390
|
}
|
|
5308
5391
|
|
|
5392
|
+
setStickyColumnStyle() {
|
|
5393
|
+
if (!this.datamanager || !this.datamanager.getColumns) return;
|
|
5394
|
+
|
|
5395
|
+
const columns = this.datamanager.getColumns();
|
|
5396
|
+
if (!columns.some(column => column.sticky) && !(this._stickySelectors || []).length) return;
|
|
5397
|
+
|
|
5398
|
+
const stickySelectors = [];
|
|
5399
|
+
let stickyOffset = 0;
|
|
5400
|
+
let normalOffset = 0;
|
|
5401
|
+
|
|
5402
|
+
columns.forEach((column) => {
|
|
5403
|
+
const $headerCell = this.getColumnHeaderElement(column.colIndex);
|
|
5404
|
+
const renderedWidth = $headerCell ? $headerCell.offsetWidth : column.width;
|
|
5405
|
+
|
|
5406
|
+
if (column.sticky) {
|
|
5407
|
+
const selector = `.dt-cell--col-${column.colIndex}.dt-cell--sticky`;
|
|
5408
|
+
const style = {
|
|
5409
|
+
left: `${stickyOffset}px`
|
|
5410
|
+
};
|
|
5411
|
+
|
|
5412
|
+
column.stickyLeft = stickyOffset;
|
|
5413
|
+
column.stickyScrollTrigger = normalOffset - stickyOffset;
|
|
5414
|
+
column.renderedWidth = renderedWidth;
|
|
5415
|
+
this.setStyle(selector, style);
|
|
5416
|
+
stickySelectors.push(selector);
|
|
5417
|
+
stickyOffset += renderedWidth;
|
|
5418
|
+
}
|
|
5419
|
+
normalOffset += renderedWidth;
|
|
5420
|
+
});
|
|
5421
|
+
|
|
5422
|
+
const staleSelectors = (this._stickySelectors || [])
|
|
5423
|
+
.filter(selector => !stickySelectors.includes(selector));
|
|
5424
|
+
|
|
5425
|
+
staleSelectors.forEach(selector => this.removeStyle(selector));
|
|
5426
|
+
this._stickySelectors = stickySelectors;
|
|
5427
|
+
}
|
|
5428
|
+
|
|
5429
|
+
updateStickyTopPositions(scrollLeft) {
|
|
5430
|
+
if (!this.datamanager || !this.datamanager.getColumns) return;
|
|
5431
|
+
|
|
5432
|
+
const stickyColumns = this.datamanager.getColumns().filter(column => column.sticky);
|
|
5433
|
+
|
|
5434
|
+
stickyColumns.forEach((column) => {
|
|
5435
|
+
const trigger = Math.max(0, column.stickyScrollTrigger || 0);
|
|
5436
|
+
const compensation = Math.max(0, scrollLeft - trigger);
|
|
5437
|
+
const cells = $.each(`.dt-cell--col-${column.colIndex}.dt-cell--sticky-top`, this.wrapper) || [];
|
|
5438
|
+
|
|
5439
|
+
$.style(cells, {
|
|
5440
|
+
transform: compensation ? `translateX(${compensation}px)` : ''
|
|
5441
|
+
});
|
|
5442
|
+
});
|
|
5443
|
+
}
|
|
5444
|
+
|
|
5309
5445
|
getRowIndexColumnWidth() {
|
|
5310
5446
|
const rowCount = this.datamanager.getRowCount();
|
|
5311
5447
|
const padding = 22;
|
|
@@ -5369,7 +5505,11 @@ class Keyboard {
|
|
|
5369
5505
|
}
|
|
5370
5506
|
}
|
|
5371
5507
|
|
|
5508
|
+
var Freeze = "Freeze";
|
|
5509
|
+
var Unfreeze = "Unfreeze";
|
|
5372
5510
|
var en = {
|
|
5511
|
+
Freeze: Freeze,
|
|
5512
|
+
Unfreeze: Unfreeze,
|
|
5373
5513
|
"Sort Ascending": "Sort Ascending",
|
|
5374
5514
|
"Sort Descending": "Sort Descending",
|
|
5375
5515
|
"Reset sorting": "Reset sorting",
|
|
@@ -5379,7 +5519,11 @@ var en = {
|
|
|
5379
5519
|
"{count} rows selected": {"1":"{count} row selected","default":"{count} rows selected"}
|
|
5380
5520
|
};
|
|
5381
5521
|
|
|
5522
|
+
var Freeze$1 = "Bevriezen";
|
|
5523
|
+
var Unfreeze$1 = "Ontdooien";
|
|
5382
5524
|
var de = {
|
|
5525
|
+
Freeze: Freeze$1,
|
|
5526
|
+
Unfreeze: Unfreeze$1,
|
|
5383
5527
|
"Sort Ascending": "Aufsteigend sortieren",
|
|
5384
5528
|
"Sort Descending": "Absteigend sortieren",
|
|
5385
5529
|
"Reset sorting": "Sortierung zurücksetzen",
|
|
@@ -5389,7 +5533,11 @@ var de = {
|
|
|
5389
5533
|
"{count} rows selected": {"1":"{count} Zeile ausgewählt","default":"{count} Zeilen ausgewählt"}
|
|
5390
5534
|
};
|
|
5391
5535
|
|
|
5536
|
+
var Freeze$2 = "Geler";
|
|
5537
|
+
var Unfreeze$2 = "Dégeler";
|
|
5392
5538
|
var fr = {
|
|
5539
|
+
Freeze: Freeze$2,
|
|
5540
|
+
Unfreeze: Unfreeze$2,
|
|
5393
5541
|
"Sort Ascending": "Trier par ordre croissant",
|
|
5394
5542
|
"Sort Descending": "Trier par ordre décroissant",
|
|
5395
5543
|
"Reset sorting": "Réinitialiser le tri",
|
|
@@ -5399,7 +5547,11 @@ var fr = {
|
|
|
5399
5547
|
"{count} rows selected": {"1":"{count} ligne sélectionnée","default":"{count} lignes sélectionnées"}
|
|
5400
5548
|
};
|
|
5401
5549
|
|
|
5550
|
+
var Freeze$3 = "Congelare";
|
|
5551
|
+
var Unfreeze$3 = "Dégeler";
|
|
5402
5552
|
var it = {
|
|
5553
|
+
Freeze: Freeze$3,
|
|
5554
|
+
Unfreeze: Unfreeze$3,
|
|
5403
5555
|
"Sort Ascending": "Ordinamento ascendente",
|
|
5404
5556
|
"Sort Descending": "Ordinamento decrescente",
|
|
5405
5557
|
"Reset sorting": "Azzeramento ordinamento",
|
|
@@ -5681,6 +5833,22 @@ function getDefaultOptions(instance) {
|
|
|
5681
5833
|
action: function (column) {
|
|
5682
5834
|
this.removeColumn(column.colIndex);
|
|
5683
5835
|
}
|
|
5836
|
+
},
|
|
5837
|
+
{
|
|
5838
|
+
label: instance.translate('Freeze'),
|
|
5839
|
+
stickyAction: 'stick',
|
|
5840
|
+
display: 'hidden',
|
|
5841
|
+
action: function (column) {
|
|
5842
|
+
this.setColumnSticky(column.colIndex, true);
|
|
5843
|
+
}
|
|
5844
|
+
},
|
|
5845
|
+
{
|
|
5846
|
+
label: instance.translate('Unfreeze'),
|
|
5847
|
+
stickyAction: 'unstick',
|
|
5848
|
+
display: 'hidden',
|
|
5849
|
+
action: function (column) {
|
|
5850
|
+
this.setColumnSticky(column.colIndex, false);
|
|
5851
|
+
}
|
|
5684
5852
|
}
|
|
5685
5853
|
],
|
|
5686
5854
|
events: {
|
|
@@ -5705,6 +5873,7 @@ function getDefaultOptions(instance) {
|
|
|
5705
5873
|
freezeMessage: '',
|
|
5706
5874
|
getEditor: null,
|
|
5707
5875
|
serialNoColumn: true,
|
|
5876
|
+
serialNoColumnLabel: '',
|
|
5708
5877
|
checkboxColumn: false,
|
|
5709
5878
|
clusterize: true,
|
|
5710
5879
|
logs: false,
|
|
@@ -5936,6 +6105,10 @@ class DataTable {
|
|
|
5936
6105
|
this.columnmanager.removeColumn(colIndex);
|
|
5937
6106
|
}
|
|
5938
6107
|
|
|
6108
|
+
setColumnSticky(colIndex, sticky) {
|
|
6109
|
+
this.columnmanager.setColumnSticky(colIndex, sticky);
|
|
6110
|
+
}
|
|
6111
|
+
|
|
5939
6112
|
scrollToLastColumn() {
|
|
5940
6113
|
this.datatableWrapper.scrollLeft = 9999;
|
|
5941
6114
|
}
|
|
@@ -6015,7 +6188,7 @@ var unpkg = "dist/melondtable.min.js";
|
|
|
6015
6188
|
var jsdelivr = "dist/melondtable.min.js";
|
|
6016
6189
|
var scripts = {"start":"yarn run dev","build":"rollup -c && NODE_ENV=production rollup -c","dev":"rollup -c -w","cy:server":"http-server -p 8989","cy:open":"cypress open","cy:run":"cypress run","test":"start-server-and-test cy:server http://localhost:8989 cy:run","test-local":"start-server-and-test cy:server http://localhost:8989 cy:open","travis-deploy-once":"travis-deploy-once","semantic-release":"semantic-release","lint":"eslint src","lint-and-build":"yarn lint && yarn build","commit":"npx git-cz"};
|
|
6017
6190
|
var files = ["dist","src"];
|
|
6018
|
-
var devDependencies = {"autoprefixer":"^9.0.0","chai":"3.5.0","cypress":"^9.2.0","cz-conventional-changelog":"^2.1.0","deepmerge":"^2.0.1","eslint":"^5.0.1","eslint-config-airbnb":"^16.1.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.11.0","http-server":"^0.11.1","mocha":"3.3.0","postcss-custom-properties":"^7.0.0","postcss-nested":"^3.0.0","rollup":"^0.59.4","rollup-plugin-commonjs":"^8.3.0","rollup-plugin-eslint":"^4.0.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.3","rollup-plugin-postcss":"^1.2.8","rollup-plugin-uglify-es":"^0.0.1","semantic-release":"^
|
|
6191
|
+
var devDependencies = {"autoprefixer":"^9.0.0","chai":"3.5.0","cypress":"^9.2.0","cz-conventional-changelog":"^2.1.0","deepmerge":"^2.0.1","eslint":"^5.0.1","eslint-config-airbnb":"^16.1.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.11.0","http-server":"^0.11.1","mocha":"3.3.0","postcss-custom-properties":"^7.0.0","postcss-nested":"^3.0.0","rollup":"^0.59.4","rollup-plugin-commonjs":"^8.3.0","rollup-plugin-eslint":"^4.0.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.3","rollup-plugin-postcss":"^1.2.8","rollup-plugin-uglify-es":"^0.0.1","semantic-release":"^25.0.3","start-server-and-test":"^1.4.1","travis-deploy-once":"^5.0.1"};
|
|
6019
6192
|
var repository = {"type":"git","url":"https://github.com/amonak/melondtable.git"};
|
|
6020
6193
|
var keywords = ["datatable","data","grid","table"];
|
|
6021
6194
|
var author = "Alphamonak Solutions";
|
package/dist/melondtable.css
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
--dt-header-cell-bg: #fff;
|
|
20
20
|
--dt-header-cell-bg: var(--dt-cell-bg);
|
|
21
21
|
--dt-no-data-message-width: 90px;
|
|
22
|
+
--dt-scroll-left: 0px;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
.datatable *, .datatable *::after, .datatable *::before {
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
display: none;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
.dt-row:last-child:not(.dt-row-filter) {
|
|
83
|
+
.dt-row:last-child:not(.dt-row-filter) .dt-cell {
|
|
83
84
|
border-bottom: 1px solid #d1d8dd;
|
|
84
85
|
border-bottom: 1px solid var(--dt-border-color);
|
|
85
86
|
}
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
border: 1px solid #d1d8dd;
|
|
89
90
|
border: 1px solid var(--dt-border-color);
|
|
90
91
|
border-bottom: none;
|
|
91
|
-
border-
|
|
92
|
+
border-left: none;
|
|
92
93
|
position: relative;
|
|
93
94
|
outline: none;
|
|
94
95
|
padding: 0;
|
|
@@ -106,8 +107,14 @@
|
|
|
106
107
|
-moz-user-select: none;
|
|
107
108
|
-ms-user-select: none;
|
|
108
109
|
user-select: none;
|
|
110
|
+
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
.dt-cell:first-child {
|
|
114
|
+
border-left: 1px solid #d1d8dd;
|
|
115
|
+
border-left: 1px solid var(--dt-border-color);
|
|
116
|
+
}
|
|
117
|
+
|
|
111
118
|
.dt-cell__content {
|
|
112
119
|
padding: 0.5rem;
|
|
113
120
|
padding: var(--dt-spacer-2);
|
|
@@ -198,6 +205,29 @@
|
|
|
198
205
|
border-right: 1px solid var(--dt-border-color);
|
|
199
206
|
}
|
|
200
207
|
|
|
208
|
+
.dt-cell--sticky {
|
|
209
|
+
position: -webkit-sticky;
|
|
210
|
+
position: sticky;
|
|
211
|
+
left: 0;
|
|
212
|
+
z-index: 1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.dt-cell--sticky-top {
|
|
216
|
+
z-index: 4;
|
|
217
|
+
will-change: transform;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dt-cell--sticky-last::after {
|
|
221
|
+
content: '';
|
|
222
|
+
position: absolute;
|
|
223
|
+
top: 0;
|
|
224
|
+
right: -1px;
|
|
225
|
+
width: 8px;
|
|
226
|
+
height: 100%;
|
|
227
|
+
pointer-events: none;
|
|
228
|
+
box-shadow: 4px 0 6px -4px rgba(15, 23, 42, 0.2);
|
|
229
|
+
}
|
|
230
|
+
|
|
201
231
|
.datatable[dir=rtl] .dt-cell__resize-handle {
|
|
202
232
|
right: unset;
|
|
203
233
|
left: -3px;
|
|
@@ -235,7 +265,7 @@
|
|
|
235
265
|
.dt-dropdown__list {
|
|
236
266
|
position: fixed;
|
|
237
267
|
min-width: 8rem;
|
|
238
|
-
z-index:
|
|
268
|
+
z-index: 10;
|
|
239
269
|
cursor: pointer;
|
|
240
270
|
background-color: #fff;
|
|
241
271
|
background-color: var(--dt-cell-bg);
|
|
@@ -279,6 +309,7 @@
|
|
|
279
309
|
left: 50%;
|
|
280
310
|
-webkit-transform: translateX(-50%);
|
|
281
311
|
transform: translateX(-50%);
|
|
312
|
+
z-index: 5;
|
|
282
313
|
}
|
|
283
314
|
|
|
284
315
|
.dt-toast__message {
|