@digital-blueprint/greenlight-app
Version:
[GitHub Repository](https://github.com/digital-blueprint/greenlight-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/greenlight-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/greenlight-app/) | [Greenlight Bundle](ht
116 lines (107 loc) • 4.85 kB
JavaScript
let t,e,i=t=>t;function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},r.apply(this,arguments)}
/*!
* License: LGPL-2.1-or-later
* Dependencies:
*
* @webcomponents/scoped-custom-element-registry: 0.0.7 (BSD-3-Clause)
* @dbp-toolkit/app-shell: 0.3.3 (LGPL-2.1-or-later)
* @dbp-toolkit/language-select: 0.3.1 (LGPL-2.1-or-later)
* @dbp-toolkit/common: 0.3.4 (LGPL-2.1-or-later)
* @dbp-toolkit/auth: 0.3.1 (LGPL-2.1-or-later)
* event-target-shim: 6.0.2 (MIT)
* @dbp-toolkit/notification: 0.3.1 (LGPL-2.1-or-later)
* @dbp-toolkit/theme-switcher: 0.0.5 (LGPL-2.1-or-later)
* path-to-regexp: 6.2.0 (MIT)
* universal-router: 9.1.0 (MIT)
* generateUrls: 9.1.0 (MIT)
* @dbp-toolkit/matomo: 0.2.6 (LGPL-2.1-or-later)
* @tugraz/web-components: 0.3.6 (LGPL-2.1-or-later)
* @babel/runtime: 7.20.13 (MIT)
* i18next: 22.4.9 (MIT)
* @lit/reactive-element: 1.6.1 (BSD-3-Clause)
* lit-html: 2.6.1 (BSD-3-Clause)
* lit-element: 3.2.2 (BSD-3-Clause)
* @open-wc/dedupe-mixin: 1.3.1 (MIT)
* @open-wc/scoped-elements: 2.1.4 (MIT)
* jose: 4.11.2 (MIT)
* @dbp-toolkit/file-handling: 0.3.5 (LGPL-2.1-or-later)
* webdav: 4.8.0 (MIT)
* tabulator-tables: 5.1.8 (MIT)
* file-saver: 2.0.5 (MIT)
* @dbp-toolkit/qr-code-scanner: 0.3.1 (LGPL-2.1-or-later)
* async-mutex: 0.4.0 (MIT)
* pdfjs-dist: 2.16.105 (Apache-2.0)
* dommatrix: 1.0.3 (MIT)
* web-streams-polyfill: 3.2.1 (MIT)
* mockdate: 3.0.5 (MIT)
* certlogic-js: 1.2.2 (Apache-2.0)
* string-similarity: 4.0.4 (ISC)
* @popperjs/core: 2.11.5 (MIT)
* tippy.js: 6.3.7 (MIT)
* @dbp-toolkit/tooltip: 0.0.3 (LGPL-2.1-or-later)
*/import{A as a,i as n,g as o,j as s,y as d}from"./notification.23e517da.es.js";class b extends a{constructor(){super(),this.value1="",this.value2="",this.name1="",this.name2="",this.name="",this.disabled=!1,this._active=""}static get properties(){return r({},super.properties,{value1:{type:String},value2:{type:String},name1:{type:String},name2:{type:String},name:{type:String,reflect:!0},disabled:{type:Boolean},_active:{type:Boolean}})}static get styles(){return n(t||(t=i`
${0}
${0}
:host {
display: block;
}
div {
white-space: nowrap;
display: flex;
}
#button1 {
border-right: 0px;
}
.active {
background-color: var(--dbp-on-secondary-surface) !important;
color: var(--dbp-secondary-surface) !important;
border: var(--dbp-border) !important;
border-color: var(--dbp-secondary-surface-border-color);
}
.button {
flex-grow: 1;
margin: 0px;
}
.button:first-child {
border-radius: var(--dbp-border-radius) 0 0 var(--dbp-border-radius);
}
.button:last-child {
border-radius: 0 var(--dbp-border-radius) var(--dbp-border-radius) 0;
}
only screen and (orientation: portrait) and (max-width: 768px) {
div {
display: block;
white-space: inherit;
}
#button1 {
width: 100%;
margin-bottom: 0px;
border-right: 1px solid;
border-bottom: 0px;
min-height: 40px;
}
#button2 {
width: 100%;
margin-top: 0px;
min-height: 40px;
}
}
`),o(),s())}update(t){t.forEach(((t,e)=>{"name"===e&&(this[e]===this.name1?this._active="button1":this[e]===this.name2&&(this._active="button2"))})),super.update(t)}render(){const t=function(t){this._active=t.target.id,this.name="button1"===this._active?this.name1:this.name2;const e=new CustomEvent("change",{bubbles:!0,cancelable:!1});this.dispatchEvent(e)};return d(e||(e=i`
<div>
<button
="${0}"
class="button ${0}"
id="${0}"
?disabled="${0}">
${0}
</button>
<button
="${0}"
class="button ${0}"
id="${0}"
?disabled="${0}">
${0}
</button>
</div>
`),t,"button1"===this._active?"active":"","button1",this.disabled,this.value1,t,"button2"===this._active?"active":"","button2",this.disabled,this.value2)}}export{b as T};
//# sourceMappingURL=textswitch.aac4259d.es.js.map