Skip to content

Commit

Permalink
feat(plugin): add example for new Custom Tooltip plugin (#663)
Browse files Browse the repository at this point in the history
- new Custom Tooltip, it could be defined in any Column Definition(s) or globally in the Grid Options or a mixed of both.
  • Loading branch information
ghiscoding authored Oct 28, 2021
1 parent 68a7cff commit c61e3b0
Show file tree
Hide file tree
Showing 9 changed files with 896 additions and 90 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
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
"build:demo": "webpack --env production"
},
"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/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",
"aurelia-event-aggregator": "^1.0.3",
"aurelia-framework": "^1.3.1",
"aurelia-i18n": "^3.1.4",
Expand All @@ -78,12 +78,13 @@
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"@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/rxjs-observable": "^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/rxjs-observable": "^0.19.0",
"@slickgrid-universal/text-export": "^0.19.0",
"@types/bluebird": "^3.5.36",
"@types/dompurify": "^2.3.1",
"@types/i18next-xhr-backend": "^1.4.2",
Expand Down
2 changes: 1 addition & 1 deletion src/examples/slickgrid/example23.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Example23 {
This demo shows how to use Filters with Range of Search Values (<a href="https://github.com/ghiscoding/aurelia-slickgrid/wiki/Range-Filters" target="_blank">Wiki docs</a>)
<br/>
<ul class="small">
<li>All input filters support the following operators: (>, >=, <, <=, <>, !=, =, ==, *) and now also the (..) for an input range
<li>All input filters support the following operators: (>, >=, <, <=, <>, !=, =, ==, *) and now also the (..) for an input range</li>
<li>All filters (which support ranges) can be defined via the 2 dots (..) which represents a range, this also works for dates and slider in the "presets"</li>
<ul>
<li>For a numeric range defined in an input filter (must be of type text), you can use 2 dots (..) to represent a range</li>
Expand Down
26 changes: 26 additions & 0 deletions src/examples/slickgrid/example33.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<h2>
${title}
<span class="float-end">
<a style="font-size: 18px"
target="_blank"
href="https://github.com/ghiscoding/aurelia-slickgrid/blob/master/src/examples/slickgrid/example33.ts">
<span class="fa fa-link"></span> code
</a>
</span>
</h2>
<div class="subtitle" innerhtml.bind="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" value.bind="serverApiDelay">
</div>

<aurelia-slickgrid grid-id="grid33"
column-definitions.bind="columnDefinitions"
grid-options.bind="gridOptions"
dataset.bind="dataset"
instances.bind="aureliaGrid"
on-aurelia-grid-created.delegate="aureliaGridReady($event.detail)">
</aurelia-slickgrid>
</template>
58 changes: 58 additions & 0 deletions src/examples/slickgrid/example33.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;
}
Loading

0 comments on commit c61e3b0

Please sign in to comment.