Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into pre-8.0.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jansiegel committed Jul 10, 2020
2 parents bc5eaee + 6d24b71 commit 858ab75
Show file tree
Hide file tree
Showing 30 changed files with 1,974 additions and 578 deletions.
9 changes: 9 additions & 0 deletions src/3rdparty/walkontable/css/walkontable.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,22 @@
border-right-width: 0;
}

/* Property controlled by top overlay */
.ht_master:not(.innerBorderTop) thead tr:last-child th,
.ht_master:not(.innerBorderTop) ~ .handsontable thead tr:last-child th,
.ht_master:not(.innerBorderTop) thead tr.lastChild th,
.ht_master:not(.innerBorderTop) ~ .handsontable thead tr.lastChild th {
border-bottom-width: 0;
}

/* Property controlled by bottom overlay */
.ht_master:not(.innerBorderBottom) thead tr:last-child th,
.ht_master:not(.innerBorderBottom) ~ .handsontable thead tr:last-child th,
.ht_master:not(.innerBorderBottom) thead tr.lastChild th,
.ht_master:not(.innerBorderBottom) ~ .handsontable thead tr.lastChild th {
border-bottom-width: 0;
}

.handsontable th {
background-color: #f0f0f0;
color: #222;
Expand Down
47 changes: 22 additions & 25 deletions src/3rdparty/walkontable/src/overlay/bottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
hasClass,
outerHeight,
removeClass,
resetCssTransform
} from './../../../../helpers/dom/element';
import BottomOverlayTable from './../table/bottom';
import Overlay from './_base';
Expand Down Expand Up @@ -42,22 +41,6 @@ class BottomOverlay extends Overlay {
return new BottomOverlayTable(...args);
}

/**
*
*/
repositionOverlay() {
const { wtTable, rootDocument } = this.wot;
const cloneRoot = this.clone.wtTable.holder.parentNode;
let scrollbarWidth = getScrollbarWidth(rootDocument);

if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {
scrollbarWidth = 0;
}

cloneRoot.style.top = '';
cloneRoot.style.bottom = `${scrollbarWidth}px`;
}

/**
* Checks if overlay should be fully rendered.
*
Expand All @@ -79,16 +62,17 @@ class BottomOverlay extends Overlay {
}

const overlayRoot = this.clone.wtTable.holder.parentNode;
let headerPosition = 0;

overlayRoot.style.top = '';

let headerPosition = 0;
const preventOverflow = this.wot.getSetting('preventOverflow');

if (this.trimmingContainer === this.wot.rootWindow && (!preventOverflow || preventOverflow !== 'vertical')) {
const { rootDocument, wtTable } = this.wot;
const bottom = wtTable.hider.offsetTop + wtTable.hider.offsetHeight;
const bodyHeight = rootDocument.body.offsetHeight;
const hiderRect = wtTable.hider.getBoundingClientRect();
const bottom = Math.ceil(hiderRect.bottom);
const bodyHeight = rootDocument.documentElement.clientHeight;
let finalLeft;
let finalBottom;

Expand All @@ -104,13 +88,11 @@ class BottomOverlay extends Overlay {
headerPosition = finalBottom;
finalBottom += 'px';

overlayRoot.style.top = '';
overlayRoot.style.left = finalLeft;
overlayRoot.style.bottom = finalBottom;

} else {
headerPosition = this.getScrollPosition();
resetCssTransform(overlayRoot);
this.repositionOverlay();
}

Expand All @@ -121,6 +103,21 @@ class BottomOverlay extends Overlay {
return positionChanged;
}

/**
* Updates the bottom overlay position.
*/
repositionOverlay() {
const { wtTable, rootDocument } = this.wot;
const cloneRoot = this.clone.wtTable.holder.parentNode;
let scrollbarWidth = getScrollbarWidth(rootDocument);

if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {
scrollbarWidth = 0;
}

cloneRoot.style.bottom = `${scrollbarWidth}px`;
}

/**
* Sets the main overlay's vertical scroll position.
*
Expand Down Expand Up @@ -342,15 +339,15 @@ class BottomOverlay extends Overlay {

if ((areFixedRowsBottomChanged || fixedRowsBottom === 0) && columnHeaders.length > 0) {
const masterParent = this.wot.wtTable.holder.parentNode;
const previousState = hasClass(masterParent, 'innerBorderTop');
const previousState = hasClass(masterParent, 'innerBorderBottom');

this.cachedFixedRowsBottom = this.wot.getSetting('fixedRowsBottom');

if (position || this.wot.getSetting('totalRows') === 0) {
addClass(masterParent, 'innerBorderTop');
addClass(masterParent, 'innerBorderBottom');
positionChanged = !previousState;
} else {
removeClass(masterParent, 'innerBorderTop');
removeClass(masterParent, 'innerBorderBottom');
positionChanged = previousState;
}

Expand Down
39 changes: 19 additions & 20 deletions src/3rdparty/walkontable/src/overlay/bottomLeftCorner.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,6 @@ class BottomLeftCornerOverlay extends Overlay {
return wot.getSetting('shouldRenderBottomOverlay') && wot.getSetting('shouldRenderLeftOverlay');
}

/**
* Reposition the overlay.
*/
repositionOverlay() {
const { wtTable, rootDocument } = this.wot;
const cloneRoot = this.clone.wtTable.holder.parentNode;
let scrollbarWidth = getScrollbarWidth(rootDocument);

if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {
scrollbarWidth = 0;
}

cloneRoot.style.top = '';
cloneRoot.style.bottom = `${scrollbarWidth}px`;
}

/**
* Updates the corner overlay position.
*
Expand All @@ -78,9 +62,10 @@ class BottomLeftCornerOverlay extends Overlay {

if (this.trimmingContainer === wot.rootWindow) {
const { rootDocument, wtTable } = this.wot;
const bottom = wtTable.hider.offsetTop + wtTable.hider.offsetHeight;
const left = wtTable.hider.offsetLeft;
const bodyHeight = rootDocument.body.offsetHeight;
const hiderRect = wtTable.hider.getBoundingClientRect();
const bottom = Math.ceil(hiderRect.bottom);
const left = Math.ceil(hiderRect.left);
const bodyHeight = rootDocument.documentElement.clientHeight;
let finalLeft;
let finalBottom;

Expand All @@ -99,7 +84,6 @@ class BottomLeftCornerOverlay extends Overlay {
finalBottom += 'px';
finalLeft += 'px';

overlayRoot.style.top = '';
overlayRoot.style.left = finalLeft;
overlayRoot.style.bottom = finalBottom;

Expand All @@ -120,6 +104,21 @@ class BottomLeftCornerOverlay extends Overlay {

return false;
}

/**
* Reposition the overlay.
*/
repositionOverlay() {
const { wtTable, rootDocument } = this.wot;
const cloneRoot = this.clone.wtTable.holder.parentNode;
let scrollbarWidth = getScrollbarWidth(rootDocument);

if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {
scrollbarWidth = 0;
}

cloneRoot.style.bottom = `${scrollbarWidth}px`;
}
}

Overlay.registerOverlay(Overlay.CLONE_BOTTOM_LEFT_CORNER, BottomLeftCornerOverlay);
Expand Down
5 changes: 3 additions & 2 deletions src/3rdparty/walkontable/src/overlay/left.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ class LeftOverlay extends Overlay {
const preventOverflow = this.wot.getSetting('preventOverflow');

if (this.trimmingContainer === this.wot.rootWindow && (!preventOverflow || preventOverflow !== 'horizontal')) {
const left = wtTable.hider.offsetLeft;
const right = left + wtTable.hider.offsetWidth;
const hiderRect = wtTable.hider.getBoundingClientRect();
const left = Math.ceil(hiderRect.left);
const right = Math.ceil(hiderRect.right);
let finalLeft;
let finalTop;

Expand Down
5 changes: 3 additions & 2 deletions src/3rdparty/walkontable/src/overlay/top.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ class TopOverlay extends Overlay {

if (this.trimmingContainer === this.wot.rootWindow && (!preventOverflow || preventOverflow !== 'vertical')) {
const { wtTable } = this.wot;
const top = wtTable.hider.offsetTop;
const bottom = top + wtTable.hider.offsetHeight;
const hiderRect = wtTable.hider.getBoundingClientRect();
const top = Math.ceil(hiderRect.top);
const bottom = Math.ceil(hiderRect.bottom);
let finalLeft;
let finalTop;

Expand Down
9 changes: 5 additions & 4 deletions src/3rdparty/walkontable/src/overlay/topLeftCorner.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ class TopLeftCornerOverlay extends Overlay {

if (this.trimmingContainer === this.wot.rootWindow) {
const { wtTable } = this.wot;
const top = wtTable.hider.offsetTop;
const left = wtTable.hider.offsetLeft;
const bottom = top + wtTable.hider.offsetHeight;
const right = left + wtTable.hider.offsetWidth;
const hiderRect = wtTable.hider.getBoundingClientRect();
const top = Math.ceil(hiderRect.top);
const left = Math.ceil(hiderRect.left);
const bottom = Math.ceil(hiderRect.bottom);
const right = Math.ceil(hiderRect.right);
let finalLeft = '0';
let finalTop = '0';

Expand Down
Loading

0 comments on commit 858ab75

Please sign in to comment.