diff --git a/.gitignore b/.gitignore index b6ee8df..980923d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /args/config*.json /args/param.json /args/keys*.json -*test* \ No newline at end of file +*test* +args/app-config.json diff --git a/public/components.js b/public/components.js index 369eb45..31f5316 100644 --- a/public/components.js +++ b/public/components.js @@ -74,11 +74,13 @@ smButton.innerHTML = ` background-color: rgba(var(--text-color), 0.3); } @media (hover: hover){ - :host(:not([disabled])) .button:hover{ + :host(:not([disabled])) .button:hover, + :host(:focus-within:not([disabled])) .button{ -webkit-box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); - box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); + box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); } - :host([variant='outlined']) .button:hover{ + :host([variant='outlined']:not([disabled])) .button:hover, + :host(:focus-within[variant='outlined']:not([disabled])) .button:hover{ -webkit-box-shadow: 0 0 0 1px rgba(var(--text-color), 0.2) inset, 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.4rem 0.8rem rgba(0, 0, 0, 0.12); box-shadow: 0 0 0 1px rgba(var(--text-color), 0.2) inset, 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.4rem 0.8rem rgba(0, 0, 0, 0.12); } @@ -120,9 +122,12 @@ customElements.define('sm-button', this.removeAttribute('disabled'); } } + focusIn() { + this.focus(); + } handleKeyDown(e) { - if (!this.hasAttribute('disabled') && (e.key === 'Enter' || e.code === 'Space')) { + if (!this.hasAttribute('disabled') && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); this.click(); } @@ -986,6 +991,24 @@ customElements.define('sm-notifications', class extends HTMLElement { }); } }); +class Stack { + constructor() { + this.items = []; + } + push(element) { + this.items.push(element); + } + pop() { + if (this.items.length == 0) + return "Underflow"; + return this.items.pop(); + } + peek() { + return this.items[this.items.length - 1]; + } +} +const popupStack = new Stack(); + const smPopup = document.createElement('template'); smPopup.innerHTML = ` -