-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into fix.issue.115
- Loading branch information
Showing
31 changed files
with
883 additions
and
226 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<head><script defer="defer" src="assets/js/runtime.js"></script><script defer="defer" src="assets/js/vendors.babel.js"></script><script defer="defer" src="assets/js/vendors.bootstrap-icons.js"></script><script defer="defer" src="assets/js/main.js"></script></head><script src="index.js"></script> | ||
<head><script defer="defer" src="assets/js/runtime.js"></script><script defer="defer" src="assets/js/vendors.babel.js"></script><script defer="defer" src="assets/js/vendors.maplibre-gl.js"></script><script defer="defer" src="assets/js/main.js"></script></head><script src="index.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
div { | ||
font-family: var(--font-family); | ||
} | ||
|
||
.action-button-container, | ||
.action-button-container > a, | ||
.action-button-container > a > .abutton { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.top-icon { | ||
padding-top: 1em; | ||
} | ||
|
||
.abutton-title { | ||
margin-bottom: var(--abutton-title-spacer-y); | ||
font-weight: 900; | ||
text-transform: uppercase; | ||
} | ||
|
||
.abutton-text:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
.abutton-body { | ||
padding: var(--abutton-spacer-y) var(--abutton-spacer-x); | ||
} | ||
|
||
.abutton { | ||
display: flex; | ||
flex-direction: column; | ||
min-width: 0; | ||
--abutton-spacer-y: 1em; | ||
--abutton-spacer-x: 1em; | ||
--abutton-title-spacer-y: 0.5em; | ||
} | ||
|
||
.btn { | ||
--bs-btn-padding-x: 0rem; | ||
--bs-btn-padding-y: 0rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import styles from '!!raw-loader!./ActionButton.css'; | ||
import varStyles from '!!raw-loader!../../../shared/variables.css'; | ||
import bootstrapStyles from '!!raw-loader!../../../shared/themed-bootstrap.css'; | ||
|
||
const template = document.createElement('template'); | ||
|
||
template.innerHTML = ` | ||
<div class="action-button-container"> | ||
<a class="btn" role="button" href=""> | ||
<div class="abutton"> | ||
<div class="w-100 top-icon"> | ||
<cod-icon data-icon="" data-size="x-large"> | ||
</cod-icon> | ||
</div> | ||
<div class="abutton-body"> | ||
<h4 class="abutton-title"></h4> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
`; | ||
|
||
class ActionButton extends HTMLElement { | ||
static observedAttributes = []; | ||
|
||
constructor() { | ||
// Always call super first in constructor | ||
super(); | ||
// Create a shadow root | ||
const shadow = this.attachShadow({ mode: 'open' }); | ||
shadow.appendChild(template.content.cloneNode(true)); | ||
|
||
// Add styles | ||
const bootStyles = document.createElement('style'); | ||
bootStyles.textContent = bootstrapStyles; | ||
const variableStyles = document.createElement('style'); | ||
variableStyles.textContent = varStyles; | ||
const itemStyles = document.createElement('style'); | ||
itemStyles.textContent = styles; | ||
shadow.appendChild(bootStyles); | ||
shadow.appendChild(variableStyles); | ||
shadow.appendChild(itemStyles); | ||
} | ||
|
||
connectedCallback() { | ||
// Update the title. | ||
const title = this.getAttribute('title'); | ||
const titleElt = this.shadowRoot.querySelector('h4.abutton-title'); | ||
titleElt.innerText = title; | ||
|
||
// Update the icon. | ||
const icon = this.getAttribute('icon'); | ||
const iconElt = this.shadowRoot.querySelector('cod-icon'); | ||
iconElt.setAttribute('data-icon', icon); | ||
|
||
// Update the button link and style. | ||
const btnColor = this.getAttribute('btn-color') ?? 'btn-outline-primary'; | ||
const href = this.getAttribute('href'); | ||
const target = this.getAttribute('target'); | ||
const aElt = this.shadowRoot.querySelector('a.btn'); | ||
aElt.classList.add('btn', btnColor); | ||
aElt.setAttribute('href', href); | ||
if (target) { | ||
aElt.setAttribute('target', target); | ||
} | ||
} | ||
} | ||
|
||
export { ActionButton as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import ActionButton from './ActionButton'; | ||
customElements.define('cod-action-button', ActionButton); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.