fix(core): update
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { customElement, DeesElement, type TemplateResult, property, html, css, cssManager, type CSSResult, } from '@design.estate/dees-element';
|
||||
import * as domtools from '@design.estate/dees-domtools';
|
||||
import { demoFunc } from './dees-input-dropdown.demo.js';
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
@ -9,15 +10,7 @@ declare global {
|
||||
|
||||
@customElement('dees-input-dropdown')
|
||||
export class DeesInputDropdown extends DeesElement {
|
||||
public static demo = () => html`
|
||||
<dees-input-dropdown
|
||||
.options=${[
|
||||
{option: 'option 1', key: 'option1'},
|
||||
{option: 'option 2', key: 'option2'},
|
||||
{option: 'option 3', key: 'option3'}
|
||||
]}
|
||||
></dees-input-dropdown>
|
||||
`
|
||||
public static demo = demoFunc
|
||||
|
||||
// INSTANCE
|
||||
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
||||
@ -100,12 +93,11 @@ export class DeesInputDropdown extends DeesElement {
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
opacity: 0;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
background: ${cssManager.bdTheme('#ffffff', '#222222')};
|
||||
max-width: 420px;
|
||||
box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
|
||||
min-height: 40px;
|
||||
margin-top: -40px;
|
||||
z-index: 100;
|
||||
border-radius: 3px;
|
||||
padding: 4px;
|
||||
@ -135,12 +127,8 @@ export class DeesInputDropdown extends DeesElement {
|
||||
|
||||
public render(): TemplateResult {
|
||||
return html`
|
||||
${domtools.elementBasic.styles}
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<div class="maincontainer">
|
||||
<div class="selectedBox show" @click="${event => {this.toggleSelectionBox();}}">
|
||||
<div class="selectedBox show" @click="${event => {this.openSelectionBox();}}">
|
||||
${this.selectedOption?.option}
|
||||
</div>
|
||||
<div class="selectionBox">
|
||||
@ -165,12 +153,16 @@ export class DeesInputDropdown extends DeesElement {
|
||||
detail: selectedOption,
|
||||
bubbles: true
|
||||
}));
|
||||
this.toggleSelectionBox();
|
||||
this.openSelectionBox();
|
||||
this.changeSubject.next(this);
|
||||
}
|
||||
|
||||
public toggleSelectionBox() {
|
||||
public openSelectionBox() {
|
||||
this.shadowRoot.querySelector('.selectedBox').classList.toggle('show');
|
||||
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show');
|
||||
}
|
||||
|
||||
public closeSelectionBox() {
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user