UNPKG

@dbp-topics/check-in

Version:

[GitLab Repository](https://gitlab.tugraz.at/dbp/check-in/checkin) | [npmjs package](https://www.npmjs.com/package/@dbp-topics/check-in) | [Unpkg CDN](https://unpkg.com/browse/@dbp-topics/check-in/) | [Checkin Bundle](https://gitlab.tugraz.at/dbp/check-in

101 lines (92 loc) 4.37 kB
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.5 (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.18.9 (MIT) * i18next: 21.9.1 (MIT) * @lit/reactive-element: 1.4.1 (BSD-3-Clause) * lit-html: 2.3.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.3 (MIT) * @dbp-toolkit/qr-code-scanner: 0.3.1 (LGPL-2.1-or-later) * async-mutex: 0.3.2 (MIT) */import{A as a,i as o,g as n,f as s,y as d}from"./notification.d05eb818.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 o(t||(t=i` ${0} ${0} div { white-space: nowrap; display: flex; } #button1 { border-right: 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; } .active { background-color: var(--dbp-secondary-surface) !important; color: var(--dbp-on-secondary-surface) !important; } .button { flex-grow: 1; margin: 0px; } .button:hover { background-color: var(--dbp-hover-background-color) !important; color: var(--dbp-hover-color) !important; } @media 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; } } `),n(),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 @click="${0}" class="button ${0}" id="${0}" ?disabled="${0}"> ${0} </button> <button @click="${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.eaecfc8c.es.js.map