|
8 | 8 | /// @param {Map} $palette [$default-palette] - The palette used as basis for styling the component.
|
9 | 9 | /// @param {Color} $header-background [null] - The table header background color.
|
10 | 10 | /// @param {Color} $header-text-color [null] - The table header text color.
|
| 11 | +/// @param {Color} $ghost-header-text-color [null] - The dragged header text color. |
| 12 | +/// @param {Color} $ghost-header-icon-color [null] - The dragged header icon color. |
| 13 | +/// @param {Color} $ghost-header-background [null] - The dragged header background color. |
11 | 14 | /// @param {Color} $content-background [null] - The table body background color.
|
12 | 15 | /// @param {Color} $content-text-color [null] - The table body text color.
|
13 | 16 | /// @param {Color} $row-selected-background [null] - The selected row background color.
|
|
35 | 38 | $content-background: null,
|
36 | 39 | $content-text-color: null,
|
37 | 40 |
|
| 41 | + $ghost-header-text-color: null, |
| 42 | + $ghost-header-icon-color: null, |
| 43 | + $ghost-header-background: null, |
| 44 | +
|
38 | 45 | $row-selected-background: null,
|
39 | 46 | $row-selected-text-color: null,
|
40 | 47 | $row-hover-background: null,
|
|
48 | 55 | $cell-selected-text-color: null,
|
49 | 56 | $cell-editing-background: null,
|
50 | 57 |
|
51 |
| - $resize-line-color: null |
| 58 | + $resize-line-color: null, |
| 59 | + $drop-indicator-color: null |
52 | 60 | ) {
|
53 | 61 | $default-theme: (
|
54 | 62 | name: 'igx-grid',
|
|
59 | 67 | content-background: #fff,
|
60 | 68 | content-text-color: igx-color($palette, 'grays', 800),
|
61 | 69 |
|
| 70 | + ghost-header-text-color: igx-color($palette, 'grays', 600), |
| 71 | + ghost-header-icon-color: igx-color($palette, 'grays'), |
| 72 | + ghost-header-background: #fff, |
| 73 | + |
62 | 74 | row-selected-background: hexrgba(igx-color($palette, 'grays', 800)),
|
63 | 75 | row-selected-text-color: igx-contrast-color($palette, 'grays', 900),
|
64 | 76 | row-hover-background: hexrgba(igx-color($palette, 'grays', 100)),
|
|
72 | 84 | cell-selected-text-color: igx-contrast-color($palette, 'primary'),
|
73 | 85 | cell-editing-background: #fff,
|
74 | 86 |
|
75 |
| - resize-line-color: igx-color($palette, 'secondary') |
| 87 | + resize-line-color: igx-color($palette, 'secondary'), |
| 88 | + |
| 89 | + drop-indicator-color: igx-color($palette, 'secondary') |
76 | 90 | );
|
77 | 91 |
|
| 92 | + @if not($ghost-header-icon-color) and $ghost-header-background { |
| 93 | + $ghost-header-icon-color: rgba(text-contrast($ghost-header-background), .07); |
| 94 | + } |
| 95 | + |
| 96 | + @if not($ghost-header-text-color) and $ghost-header-background { |
| 97 | + $ghost-header-text-color: text-contrast($ghost-header-background); |
| 98 | + } |
| 99 | + |
78 | 100 | @if not($header-text-color) and $header-background {
|
79 | 101 | $header-text-color: text-contrast($header-background);
|
80 | 102 | }
|
|
109 | 131 | header-background: $header-background,
|
110 | 132 | header-text-color: $header-text-color,
|
111 | 133 |
|
| 134 | + ghost-header-text-color: $ghost-header-text-color, |
| 135 | + ghost-header-icon-color: $ghost-header-icon-color, |
| 136 | + ghost-header-background: $ghost-header-background, |
| 137 | + |
112 | 138 | content-background: $content-background,
|
113 | 139 | content-text-color: $content-text-color,
|
114 | 140 |
|
|
125 | 151 | cell-editing-background: $cell-editing-background,
|
126 | 152 | cell-selected-text-color: $cell-selected-text-color,
|
127 | 153 |
|
128 |
| - resize-line-color: $resize-line-color |
| 154 | + resize-line-color: $resize-line-color, |
| 155 | + |
| 156 | + drop-indicator-color: $drop-indicator-color |
129 | 157 | ));
|
130 | 158 | }
|
131 | 159 |
|
|
510 | 538 | display: flex;
|
511 | 539 | background: inherit;
|
512 | 540 | }
|
| 541 | + |
| 542 | + |
| 543 | + // Column moving |
| 544 | + |
| 545 | + %igx-grid__th-drop-indicator-left { |
| 546 | + position: absolute; |
| 547 | + width: 1px; |
| 548 | + top: 0; |
| 549 | + left: -1px; |
| 550 | + height: 100%; |
| 551 | + } |
| 552 | + |
| 553 | + |
| 554 | + %igx-grid__th-drop-indicator-right { |
| 555 | + position: absolute; |
| 556 | + width: 1px; |
| 557 | + top: 0; |
| 558 | + right: -1px; |
| 559 | + height: 100%; |
| 560 | + } |
| 561 | + |
| 562 | + %igx-grid__th-drop-indicator--active { |
| 563 | + &%igx-grid__th-drop-indicator-left, |
| 564 | + &%igx-grid__th-drop-indicator-right { |
| 565 | + border-right: 1px dotted --var($theme, 'drop-indicator-color'); |
| 566 | + } |
| 567 | + |
| 568 | + &::after, |
| 569 | + &::before { |
| 570 | + content: ''; |
| 571 | + position: absolute; |
| 572 | + width: 0; |
| 573 | + height: 0; |
| 574 | + border-style: solid; |
| 575 | + left: -4.5px; |
| 576 | + } |
| 577 | + |
| 578 | + &::before { |
| 579 | + bottom: 0; |
| 580 | + border-width: 0 5px 5px; |
| 581 | + border-color: transparent transparent --var($theme, 'drop-indicator-color'); |
| 582 | + } |
| 583 | + |
| 584 | + &::after { |
| 585 | + top: 0; |
| 586 | + border-width: 5px 5px 0; |
| 587 | + border-color: --var($theme, 'drop-indicator-color') transparent transparent; |
| 588 | + } |
| 589 | + } |
| 590 | + |
| 591 | + %grid__scroll-on-drag-left { |
| 592 | + position: absolute; |
| 593 | + width: 15px; |
| 594 | + top: 0; |
| 595 | + left: 0; |
| 596 | + height: 100%; |
| 597 | + z-index: 25; |
| 598 | + } |
| 599 | + |
| 600 | + %grid__scroll-on-drag-right { |
| 601 | + position: absolute; |
| 602 | + width: 15px; |
| 603 | + top: 0; |
| 604 | + right: 0; |
| 605 | + height: 100%; |
| 606 | + z-index: 25; |
| 607 | + } |
| 608 | + |
| 609 | + %grid__scroll-on-drag-pinned { |
| 610 | + position: absolute; |
| 611 | + width: 15px; |
| 612 | + height: 100%; |
| 613 | + top: 0; |
| 614 | + z-index: 25; |
| 615 | + } |
| 616 | + |
| 617 | + %grid__drag-ghost-image { |
| 618 | + background-color: --var($theme, 'ghost-header-background'); |
| 619 | + color: --var($theme, 'ghost-header-text-color'); |
| 620 | + position: absolute; |
| 621 | + z-index: 20; |
| 622 | + height: auto; |
| 623 | + top: -99999px; |
| 624 | + left: -99999px; |
| 625 | + overflow: visible; |
| 626 | + box-shadow: igx-elevation($elevations, 5); |
| 627 | + |
| 628 | + %grid-cell-header-title { |
| 629 | + min-width: rem(24px); |
| 630 | + } |
| 631 | + } |
| 632 | + |
| 633 | + %grid__drag-ghost-image-icon { |
| 634 | + color: --var($theme, 'ghost-header-icon-color'); |
| 635 | + font-size: rem(24px); |
| 636 | + margin-right: rem(8); |
| 637 | + } |
| 638 | + |
| 639 | + %igx-grid__drag-col-header { |
| 640 | + background-color: lighten(--var($theme, 'header-background'), 10%); |
| 641 | + |
| 642 | + %grid-cell-header-title, |
| 643 | + %grid-cell-header-icons { |
| 644 | + opacity: .4; |
| 645 | + } |
| 646 | + } |
513 | 647 | }
|
0 commit comments