Skip to content

Commit

Permalink
feat(plugin): add example for new Custom Tooltip plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Oct 28, 2021
1 parent 7da3853 commit 44dd1cd
Show file tree
Hide file tree
Showing 15 changed files with 924 additions and 101 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ coverage:
patch:
default:
threshold: 5%
github_checks:
annotations: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ This is no longer the case. Verify if you need this module and configure a polyf
```

### Fully Tested with [Jest](https://jestjs.io/) (Unit Tests) - [Cypress](https://www.cypress.io/) (E2E Tests)
Angular-Slickgrid and Slickgrid-Universal both have **100%** Unit Test Coverage, we are talking about +13,000 lines of code (+3,000 unit tests) that are fully tested with [Jest](https://jestjs.io/). On the UI side, all Angular-Slickgrid Examples are tested with [Cypress](https://www.cypress.io/), there are over +450 Cypress E2E tests.
Angular-Slickgrid and Slickgrid-Universal both have **100%** Unit Test Coverage, we are talking about +13,000 lines of code (+3,000 unit tests) that are fully tested with [Jest](https://jestjs.io/). On the UI side, all Angular-Slickgrid Examples are tested with [Cypress](https://www.cypress.io/), there are over 500 Cypress E2E tests.

## Installation
Refer to the **[Wiki - HOWTO Step by Step](https://github.com/ghiscoding/angular-slickgrid/wiki/HOWTO---Step-by-Step)** and/or clone the [Angular-Slickgrid Demos](https://github.com/ghiscoding/angular-slickgrid-demos) repository. Please don't open any issue unless you have followed these steps (from the Wiki), and if any of the steps are incorrect or confusing, then please let me know.
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
}
},
"dependencies": {
"@slickgrid-universal/common": "^0.18.0",
"@slickgrid-universal/custom-footer-component": "^0.18.0",
"@slickgrid-universal/empty-warning-component": "^0.18.0",
"@slickgrid-universal/event-pub-sub": "^0.18.0",
"@slickgrid-universal/pagination-component": "^0.18.0",
"@slickgrid-universal/rxjs-observable": "^0.18.0",
"@slickgrid-universal/common": "^0.19.0",
"@slickgrid-universal/custom-footer-component": "^0.19.0",
"@slickgrid-universal/empty-warning-component": "^0.19.0",
"@slickgrid-universal/event-pub-sub": "^0.19.0",
"@slickgrid-universal/pagination-component": "^0.19.0",
"@slickgrid-universal/rxjs-observable": "^0.19.0",
"@types/dompurify": "^2.3.0",
"@types/jquery": "^3.5.6",
"dequal": "^2.0.2",
Expand Down Expand Up @@ -119,11 +119,12 @@
"@ng-select/ng-select": "^7.3.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@slickgrid-universal/composite-editor-component": "^0.18.0",
"@slickgrid-universal/excel-export": "^0.18.0",
"@slickgrid-universal/graphql": "^0.18.0",
"@slickgrid-universal/odata": "^0.18.0",
"@slickgrid-universal/text-export": "^0.18.0",
"@slickgrid-universal/composite-editor-component": "^0.19.0",
"@slickgrid-universal/custom-tooltip-plugin": "^0.19.0",
"@slickgrid-universal/excel-export": "^0.19.0",
"@slickgrid-universal/graphql": "^0.19.0",
"@slickgrid-universal/odata": "^0.19.0",
"@slickgrid-universal/text-export": "^0.19.0",
"@types/flatpickr": "^3.1.2",
"@types/jest": "^27.0.2",
"@types/moment": "^2.13.0",
Expand Down Expand Up @@ -166,4 +167,4 @@
"node": ">=14.15.0",
"npm": ">=6.14.8"
}
}
}
2 changes: 2 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { GridClientSideComponent } from './examples/grid-clientside.component';
import { GridColspanComponent } from './examples/grid-colspan.component';
import { GridCompositeEditorComponent } from './examples/grid-composite-editor.component';
import { GridContextMenuComponent } from './examples/grid-contextmenu.component';
import { GridCustomTooltipComponent } from './examples/grid-custom-tooltip.component';
import { GridDraggableGroupingComponent } from './examples/grid-draggrouping.component';
import { GridEditorComponent } from './examples/grid-editor.component';
import { GridFormatterComponent } from './examples/grid-formatter.component';
Expand Down Expand Up @@ -44,6 +45,7 @@ const routes: Routes = [
{ path: 'colspan', component: GridColspanComponent },
{ path: 'composite-editor', component: GridCompositeEditorComponent },
{ path: 'context', component: GridContextMenuComponent },
{ path: 'custom-tooltip', component: GridCustomTooltipComponent },
{ path: 'editor', component: GridEditorComponent },
{ path: 'formatter', component: GridFormatterComponent },
{ path: 'frozen', component: GridFrozenComponent },
Expand Down
5 changes: 5 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@
31- Resize by Cell Content
</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLinkActive="active" [routerLink]="['/custom-tooltip']">
32- Regular & Custom Tooltip
</a>
</li>
</ul>
</section>

Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { GridClientSideComponent } from './examples/grid-clientside.component';
import { GridColspanComponent } from './examples/grid-colspan.component';
import { GridContextMenuComponent } from './examples/grid-contextmenu.component';
import { GridCompositeEditorComponent } from './examples/grid-composite-editor.component';
import { GridCustomTooltipComponent } from './examples/grid-custom-tooltip.component';
import { GridDraggableGroupingComponent } from './examples/grid-draggrouping.component';
import { GridEditorComponent } from './examples/grid-editor.component';
import { GridAngularComponent } from './examples/grid-angular.component';
Expand Down Expand Up @@ -97,6 +98,7 @@ export function appInitializerFactory(translate: TranslateService, injector: Inj
GridColspanComponent,
GridCompositeEditorComponent,
GridContextMenuComponent,
GridCustomTooltipComponent,
GridDraggableGroupingComponent,
GridEditorComponent,
GridFormatterComponent,
Expand Down
1 change: 0 additions & 1 deletion src/app/examples/grid-composite-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
SlickNamespace,
SortComparers,
} from '../modules/angular-slickgrid';
import './grid-composite-editor.component.scss';

const NB_ITEMS = 500;
const URL_COUNTRIES_COLLECTION = 'assets/data/countries.json';
Expand Down
25 changes: 25 additions & 0 deletions src/app/examples/grid-custom-tooltip.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="container-fluid">
<h2>
{{title}}
<span class="float-end">
<a style="font-size: 18px"
target="_blank"
href="https://github.com/ghiscoding/Angular-Slickgrid/blob/master/src/app/examples/grid-custom-tooltip.component.ts">
<span class="fa fa-link"></span> code
</a>
</span>
</h2>
<div class="subtitle" [innerHTML]="subTitle"></div>

<div style="margin-bottom: 20px;">
<label for="pinned-rows">Simulated Server Delay (ms): </label>
<input type="number" id="server-delay" data-test="server-delay" style="width: 60px" [(ngModel)]="serverApiDelay">
</div>

<angular-slickgrid gridId="grid32"
[columnDefinitions]="columnDefinitions"
[gridOptions]="gridOptions"
[dataset]="dataset"
(onAngularGridCreated)="angularGridReady($event.detail)">
</angular-slickgrid>
</div>
58 changes: 58 additions & 0 deletions src/app/examples/grid-custom-tooltip.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@import '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-bootstrap.scss';

// --
// Custom Tooltips CSS Variables (or SASS equivalent)
// ----------------------------------------------------
// :root {
// --slick-tooltip-background-color: #363636;
// --slick-tooltip-border-color: #252525;
// --slick-tooltip-border: 2px solid #252525;
// --slick-tooltip-color: #ffffff;

// --slick-tooltip-arrow-color: var(--slick-tooltip-border-color);
// --slick-tooltip-arrow-size: 10px;
// --slick-tooltip-arrow-side-margin: 15px;
// }

.header-tooltip-title {
font-weight: bold;
font-size: 14px;
}
.headerrow-tooltip-title {
color: #AD0041;
font-style: italic;
font-size: 13px;
font-weight: bold;
}

// it's preferable to use CSS Variables (or SASS) but if you want to change colors of your tooltip for 1 column in particular you can do it this way
// e.g. change css of 5th column 4 (zero index: l4)
.l4 .header-tooltip-title,
.l4 .headerrow-tooltip-title {
color: #ffffff;
}
.l4.slick-custom-tooltip {
color: #ffffff;
background-color: #363636;
border: 2px solid #252525;
}
.l4.slick-custom-tooltip.arrow-down::after,
.l4.slick-custom-tooltip.arrow-up::after {
border-width: 10px; // arrow size
}
.l4.slick-custom-tooltip.arrow-down::after {
border-top-color: #252525; // arrow down color
}
.l4.slick-custom-tooltip.arrow-up::after {
top: -20px; // arrow size * 2
border-bottom-color: #252525; // arrow up color
}
.l4.slick-custom-tooltip.arrow-left-align::after {
margin-left: 15px;
}
.l4.slick-custom-tooltip.arrow-right-align::after {
margin-left: calc(100% - 20px - 15px); // 20px is (arrow size * 2), 15px is your extra side margin
}
.l6.slick-custom-tooltip.arrow-left-align::after {
margin-left: 4px;
}

0 comments on commit 44dd1cd

Please sign in to comment.