Skip to content

Commit f7b1e1e

Browse files
authored
fix: reconfigure zindex values so as it works with app-layout
vaadin/spreadsheet#774
1 parent 51f49bb commit f7b1e1e

5 files changed

Lines changed: 48 additions & 45 deletions

File tree

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/Cell.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Cell {
2727

2828
public static final String CELL_COMMENT_TRIANGLE_CLASSNAME = "cell-comment-triangle";
2929
public static final String CELL_INVALID_FORMULA_CLASSNAME = "cell-invalidformula-triangle";
30-
private static final int ZINDEXVALUE = 2;
30+
private static final int ZINDEXVALUE = 1;
3131
private final DivElement element;
3232
private DivElement cellCommentTriangle;
3333
private DivElement invalidFormulaTriangle;

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/CellComment.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public CellComment(final SheetWidget owner, Element paneElement) {
7676
setOwner(owner);
7777
setAnimationEnabled(false);
7878
setVisible(false);
79-
setZIndex(30);
79+
setZIndex(0);
8080

8181
invalidFormula = new VLabel();
8282
invalidFormula.setVisible(false);
@@ -105,11 +105,11 @@ public void onClick(ClickEvent event) {
105105
}
106106

107107
public void bringForward() {
108-
setZIndex(35);
108+
setZIndex(1);
109109
}
110110

111111
public void pushBack() {
112-
setZIndex(30);
112+
setZIndex(0);
113113
}
114114

115115
@Override

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/CopyPasteTextBox.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public CopyPasteTextBox(SheetWidget widget, CopyPasteHandler handler) {
8080
this.handler = handler;
8181

8282
getElement().getStyle().setPosition(Position.ABSOLUTE);
83-
getElement().getStyle().setZIndex(100);
83+
getElement().getStyle().setZIndex(1);
8484
getElement().getStyle().setLeft(-1000, Unit.PX);
8585

8686
// gets round browser security (field must be 'visible' when copying)

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/SelectionWidget.java‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@
3737

3838
public class SelectionWidget extends Composite {
3939

40+
private static final int ZINDEXVALUE = 2;
41+
4042
private class SelectionOutlineWidget extends Widget {
4143

44+
4245
private static final int eventBits = Event.ONMOUSEDOWN
4346
| Event.ONMOUSEMOVE | Event.ONMOUSEUP | Event.TOUCHEVENTS
4447
| Event.ONLOSECAPTURE;
@@ -613,13 +616,13 @@ public SelectionWidget(SheetHandler actionHandler, SheetWidget sheetWidget) {
613616
bottomRight = new SelectionOutlineWidget();
614617
initWidget(bottomRight);
615618

616-
bottomRight.setZIndex(8);
619+
bottomRight.setZIndex(ZINDEXVALUE);
617620
bottomRight.addStyleName("bottom-right");
618621
setVisible(false);
619622

620623
paintBottomRight = new PaintOutlineWidget();
621624
paintBottomRight.addStyleName("bottom-right");
622-
paintBottomRight.setZIndex(9);
625+
paintBottomRight.setZIndex(ZINDEXVALUE);
623626

624627
Element bottomRightPane = sheetWidget.getBottomRightPane();
625628
bottomRight.setSheetElement(bottomRightPane);
@@ -632,12 +635,12 @@ public void setHorizontalSplitPosition(int horizontalSplitPosition) {
632635
bottomLeft = new SelectionOutlineWidget();
633636
bottomLeft.setSheetElement(sheetWidget.getBottomLeftPane());
634637
bottomLeft.setVisible(false);
635-
bottomLeft.setZIndex(18);
638+
bottomLeft.setZIndex(ZINDEXVALUE);
636639
bottomLeft.addStyleName("bottom-left");
637640
paintBottomLeft = new PaintOutlineWidget();
638641
paintBottomLeft.setSheetElement(sheetWidget.getBottomLeftPane());
639642
paintBottomLeft.setVisible(false);
640-
paintBottomLeft.setZIndex(19);
643+
paintBottomLeft.setZIndex(ZINDEXVALUE);
641644
paintBottomLeft.addStyleName("bottom-left");
642645
} else if (horizontalSplitPosition == 0 && bottomLeft != null) {
643646
bottomLeft.remove();
@@ -655,12 +658,12 @@ public void setVerticalSplitPosition(int verticalSplitPosition) {
655658
topRight = new SelectionOutlineWidget();
656659
topRight.setSheetElement(sheetWidget.getTopRightPane());
657660
topRight.setVisible(false);
658-
topRight.setZIndex(18);
661+
topRight.setZIndex(ZINDEXVALUE);
659662
topRight.addStyleName("top-right");
660663
paintTopRight = new PaintOutlineWidget();
661664
paintTopRight.setSheetElement(sheetWidget.getTopRightPane());
662665
paintTopRight.setVisible(false);
663-
paintTopRight.setZIndex(19);
666+
paintTopRight.setZIndex(ZINDEXVALUE);
664667
paintTopRight.addStyleName("top-left");
665668
} else if (verticalSplitPosition == 0 && topRight != null) {
666669
topRight.remove();
@@ -678,12 +681,12 @@ private void updateTopLeft() {
678681
topLeft = new SelectionOutlineWidget();
679682
topLeft.setSheetElement(sheetWidget.getTopLeftPane());
680683
topLeft.setVisible(false);
681-
topLeft.setZIndex(28);
684+
topLeft.setZIndex(ZINDEXVALUE);
682685
topLeft.addStyleName("top-left");
683686
paintTopLeft = new PaintOutlineWidget();
684687
paintTopLeft.setSheetElement(sheetWidget.getTopLeftPane());
685688
paintTopLeft.setVisible(false);
686-
paintTopLeft.setZIndex(29);
689+
paintTopLeft.setZIndex(ZINDEXVALUE);
687690
paintTopLeft.addStyleName("top-left");
688691
} else if (topLeft != null
689692
&& (verticalSplitPosition == 0 || horizontalSplitPosition == 0)) {

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow/src/main/resources/META-INF/resources/frontend/vaadin-spreadsheet/spreadsheet-styles-valo.css‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ v-window-closebox
223223
clip: rect(0, 0, 0, 0);
224224
left: .2em;
225225
top: .2em;
226-
z-index: 0;
226+
z-index: 1;
227227
margin: 0; }
228228
:root .spreadsheetport .v-checkbox > input:focus ~ label:before {
229229
border-color: #197de1;
@@ -526,7 +526,7 @@ v-window-closebox
526526
.spreadsheetport .v-window-maximizebox,
527527
.spreadsheetport .v-window-restorebox {
528528
position: absolute;
529-
z-index: 3;
529+
z-index: 1;
530530
top: 0;
531531
right: 0;
532532
box-sizing: border-box;
@@ -685,7 +685,7 @@ v-window-closebox
685685
position: absolute;
686686
top: 0;
687687
width: 100%;
688-
z-index: 200; }
688+
z-index: 0; }
689689
.spreadsheetport .v-spreadsheet .functionbar .functionfield,
690690
.spreadsheetport .v-spreadsheet .functionbar .addressfield {
691691
-webkit-box-sizing: border-box;
@@ -764,7 +764,7 @@ v-window-closebox
764764
outline: solid #222222 1px;
765765
-moz-outline-offset: -2px;
766766
outline-offset: -2px;
767-
z-index: 3; }
767+
z-index: 1; }
768768
.spreadsheetport .v-spreadsheet .sheet .cell > .v-button {
769769
overflow: hidden;
770770
text-overflow: ellipsis; }
@@ -773,11 +773,11 @@ v-window-closebox
773773
.spreadsheetport .v-spreadsheet .sheet div.merged-cell {
774774
display: block;
775775
overflow: hidden;
776-
z-index: 5 !important; }
776+
z-index: 1 !important; }
777777
.spreadsheetport .v-spreadsheet .sheet div.custom-editor-cell {
778778
padding: 2px; }
779779
.spreadsheetport .v-spreadsheet .sheet.bottom-right-pane div.merged-cell {
780-
z-index: 5 !important; }
780+
z-index: 1 !important; }
781781
.spreadsheetport .v-spreadsheet .sheet > input[type="text"] {
782782
border: 0 !important;
783783
-webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.75);
@@ -788,7 +788,7 @@ v-window-closebox
788788
overflow: hidden;
789789
padding: 0 !important;
790790
position: absolute;
791-
z-index: 26 !important; }
791+
z-index: 1 !important; }
792792
.spreadsheetport .v-spreadsheet .sheet .floater {
793793
border-right: 0;
794794
border-bottom: 0;
@@ -798,10 +798,10 @@ v-window-closebox
798798
border-right: 0px;
799799
border-bottom: 0px; }
800800
.spreadsheetport .v-spreadsheet .top-left-pane div.merged-cell {
801-
z-index: 25 !important; }
801+
z-index: 1 !important; }
802802
.spreadsheetport .v-spreadsheet .top-right-pane div.merged-cell,
803803
.spreadsheetport .v-spreadsheet .bottom-left-pane div.merged-cell {
804-
z-index: 15 !important; }
804+
z-index: 1 !important; }
805805
.spreadsheetport .v-spreadsheet .top-left-pane,
806806
.spreadsheetport .v-spreadsheet .top-right-pane,
807807
.spreadsheetport .v-spreadsheet .bottom-left-pane {
@@ -821,7 +821,7 @@ v-window-closebox
821821
height: 100%;
822822
left: 0;
823823
padding-bottom: 28px;
824-
z-index: 10; }
824+
z-index: 0; }
825825
.spreadsheetport .v-spreadsheet .bottom-left-pane .rh {
826826
left: 0;
827827
margin-top: 0 !important; }
@@ -832,7 +832,7 @@ v-window-closebox
832832
.spreadsheetport .v-spreadsheet .top-left-pane {
833833
left: 0;
834834
top: 30px;
835-
z-index: 20; }
835+
z-index: 0; }
836836
.spreadsheetport .v-spreadsheet .top-left-pane .ch {
837837
top: 0;
838838
margin-left: 50px; }
@@ -848,7 +848,7 @@ v-window-closebox
848848
.spreadsheetport .v-spreadsheet .top-right-pane {
849849
top: 30px;
850850
width: 100%;
851-
z-index: 11; }
851+
z-index: 0; }
852852
.spreadsheetport .v-spreadsheet .top-right-pane .ch {
853853
top: 0;
854854
margin-left: 0 !important; }
@@ -883,7 +883,7 @@ v-window-closebox
883883
cursor: e-resize;
884884
-webkit-touch-callout: none;
885885
width: 50px;
886-
z-index: 29;
886+
z-index: 2;
887887
display: flex;
888888
justify-content: center;
889889
vertical-align: middle;
@@ -900,7 +900,7 @@ v-window-closebox
900900
position: absolute;
901901
left: 0;
902902
width: 49px;
903-
z-index: 30; }
903+
z-index: 2; }
904904
.spreadsheetport .v-spreadsheet .rh .header-resize-dnd-first {
905905
top: 0; }
906906
.spreadsheetport .v-spreadsheet .rh .header-resize-dnd-second {
@@ -924,7 +924,7 @@ v-window-closebox
924924
height: 27px;
925925
line-height: 27px;
926926
-webkit-touch-callout: none;
927-
z-index: 29; }
927+
z-index: 2; }
928928
.spreadsheetport .v-spreadsheet .ch.selected-column-header {
929929
background: #e6edf4 !important;
930930
border-bottom: 2px solid #63b1ff; }
@@ -936,7 +936,7 @@ v-window-closebox
936936
position: absolute;
937937
top: 0;
938938
width: 3px;
939-
z-index: 30; }
939+
z-index: 2; }
940940
.spreadsheetport .v-spreadsheet .ch .header-resize-dnd-first {
941941
left: 0; }
942942
.spreadsheetport .v-spreadsheet .ch .header-resize-dnd-second {
@@ -966,7 +966,7 @@ v-window-closebox
966966
padding: 0;
967967
visibility: hidden;
968968
width: 0;
969-
z-index: 25;
969+
z-index: 2;
970970
position: absolute; }
971971
.spreadsheetport .v-spreadsheet.col-resizing .resize-line,
972972
.spreadsheetport .v-spreadsheet.col-resizing .sheet > div.resize-line {
@@ -1001,7 +1001,7 @@ v-window-closebox
10011001
height: 27px;
10021002
border-bottom: 1px solid #C7C7C7;
10031003
border-right: 1px solid #C7C7C7;
1004-
z-index: 100; }
1004+
z-index: 1; }
10051005
.spreadsheetport .v-spreadsheet .sheet > div.sheet-image {
10061006
background: transparent;
10071007
border: none;
@@ -1010,12 +1010,12 @@ v-window-closebox
10101010
width: auto;
10111011
position: absolute; }
10121012
.spreadsheetport .v-spreadsheet .bottom-right-pane.sheet > div.sheet-image {
1013-
z-index: 10; }
1013+
z-index: 1; }
10141014
.spreadsheetport .v-spreadsheet .top-left-pane > div.sheet-image {
1015-
z-index: 25; }
1015+
z-index: 1; }
10161016
.spreadsheetport .v-spreadsheet .top-right-pane > div.sheet-image,
10171017
.spreadsheetport .v-spreadsheet .bottom-left-pane > div.sheet-image {
1018-
z-index: 15; }
1018+
z-index: 1; }
10191019
.spreadsheetport .v-spreadsheet .sheet .cell-comment-triangle {
10201020
border-color: transparent #FFCF16 transparent transparent;
10211021
border-style: solid;
@@ -1041,7 +1041,7 @@ v-window-closebox
10411041
right: 0;
10421042
top: 0;
10431043
width: 0;
1044-
z-index: 2; }
1044+
z-index: 1; }
10451045
.spreadsheetport .v-spreadsheet .sheet .comment-overlay-line {
10461046
background-color: #A7A7A7 !important;
10471047
border: none !important;
@@ -1052,7 +1052,7 @@ v-window-closebox
10521052
-webkit-transform-origin: 0% 50%;
10531053
-ms-transform-origin: 0% 50%;
10541054
transform-origin: 0% 50%;
1055-
z-index: 21; }
1055+
z-index: 1; }
10561056
.spreadsheetport .v-spreadsheet div.sheet-selection {
10571057
background-color: transparent !important;
10581058
border: none !important;
@@ -1111,15 +1111,15 @@ v-window-closebox
11111111
bottom: 0;
11121112
left: 0;
11131113
overflow: hidden;
1114-
z-index: 50; }
1114+
z-index: 1; }
11151115
.spreadsheetport .v-spreadsheet .sheet-tabsheet .sheet-tabsheet-options {
11161116
background: #fafafa;
11171117
cursor: pointer;
11181118
display: inline-block;
11191119
height: 28px;
11201120
position: absolute;
11211121
width: 130px;
1122-
z-index: 60;
1122+
z-index: 1;
11231123
left: 0;
11241124
top: 0; }
11251125
.spreadsheetport .v-spreadsheet .sheet-tabsheet .sheet-tabsheet-options div {
@@ -1319,7 +1319,7 @@ v-window-closebox
13191319
position: absolute;
13201320
left: 0;
13211321
width: 100%;
1322-
z-index: 11;
1322+
z-index: 1;
13231323
background-color: #fafafa;
13241324
border-bottom: 1px solid #C7C7C7;
13251325
box-sizing: border-box; }
@@ -1369,15 +1369,15 @@ v-window-closebox
13691369
.spreadsheetport .v-spreadsheet .col-group-border .border {
13701370
position: absolute;
13711371
width: 100%;
1372-
z-index: 15;
1372+
z-index: 1;
13731373
border-bottom: 1px dotted #C7C7C7;
13741374
margin-top: 20px; }
13751375
.spreadsheetport .v-spreadsheet .row-group-pane,
13761376
.spreadsheetport .v-spreadsheet .row-group-freeze-pane {
13771377
position: absolute;
13781378
left: 0;
13791379
height: 100%;
1380-
z-index: 11;
1380+
z-index: 1;
13811381
background-color: #fafafa;
13821382
border-right: 1px solid #C7C7C7;
13831383
box-sizing: border-box; }
@@ -1425,7 +1425,7 @@ v-window-closebox
14251425
.spreadsheetport .v-spreadsheet .row-group-border .border {
14261426
position: absolute;
14271427
height: 100%;
1428-
z-index: 15;
1428+
z-index: 1;
14291429
border-right: 1px dotted #C7C7C7;
14301430
/*margin-top: 20px;*/ }
14311431
.spreadsheetport .v-spreadsheet .expandbutton {
@@ -1450,7 +1450,7 @@ v-window-closebox
14501450
.spreadsheetport .v-spreadsheet .grouping-corner {
14511451
position: absolute;
14521452
left: 0;
1453-
z-index: 15;
1453+
z-index: 1;
14541454
border-right: 1px solid #C7C7C7;
14551455
border-bottom: 1px solid #C7C7C7;
14561456
box-sizing: border-box;
@@ -1461,15 +1461,15 @@ v-window-closebox
14611461
border-bottom: 1px solid #C7C7C7;
14621462
border-right: 1px solid #C7C7C7;
14631463
background-color: #fafafa;
1464-
z-index: 15; }
1464+
z-index: 1; }
14651465
.spreadsheetport .v-spreadsheet .row-group-summary {
14661466
position: absolute;
14671467
box-sizing: border-box;
14681468
border-bottom: 1px solid #C7C7C7;
14691469
border-right: 1px solid #C7C7C7;
14701470
background-color: #fafafa;
14711471
left: 0;
1472-
z-index: 15; }
1472+
z-index: 1; }
14731473
.v-ie .spreadsheetport .v-spreadsheet .grouping .expand {
14741474
line-height: 13px; }
14751475
.spreadsheetport .v-spreadsheet-comment-overlay {

0 commit comments

Comments
 (0)