@nuralyui/dropdown 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuralyui/dropdown",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -33,7 +33,7 @@ let HyDropdownMenu = class HyDropdownMenu extends LitElement {
33
33
  this.menuOption.removeEventListener('mouseleave', this.onMouseLeaveMenu);
34
34
  }
35
35
  render() {
36
- return html `<div @click=${this.onClickMenu}>
36
+ return html `<div @mousedown=${this.onClickMenu}>
37
37
  ${this.icon ? html `<hy-icon name=${this.icon}></hy-icon>` : nothing}
38
38
  <span class="menu-label"> ${this.label}</span>
39
39
  <hy-icon
@@ -1 +1 @@
1
- {"version":3,"file":"hy-dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown/templates/hy-dropdown-menu.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AAGnD,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,UAAU;IAA9C;;QAKE,aAAQ,GAAG,KAAK,CAAC;QAQjB,iBAAY,GAAG,KAAK,CAAC;QAOrB,qBAAgB,GAAG,GAAG,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC/C,CAAC,CAAC;QACF,qBAAgB,GAAG,GAAG,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,IAAI,CAAC,YAAY,GAAG,KAAK,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EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;iDACI;AAE9B;IADC,KAAK,EAAE;oDACa;AAbV,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA8C1B;SA9CY,cAAc","sourcesContent":["import {LitElement, html, nothing} from 'lit';\nimport {customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './hy-dropdown-menu.style.js';\nimport {DropDownDirection} from '../dropdown.types';\n@customElement('hy-dropdown-menu')\nexport class HyDropdownMenu extends LitElement {\n static override styles = styles;\n @query('div')\n menuOption!: HTMLElement;\n @property({reflect: true, type: Boolean})\n disabled = false;\n @property({reflect: true, type: String})\n icon!: string;\n @property()\n label!: string;\n @property({reflect: true})\n direction!: DropDownDirection;\n @state()\n showChildren = false;\n\n override firstUpdated(): void {\n this.menuOption.addEventListener('mouseenter', this.onMouseEnterMenu);\n this.menuOption.addEventListener('mouseleave', this.onMouseLeaveMenu);\n }\n\n onMouseEnterMenu = () => {\n if (!this.disabled) this.showChildren = true;\n };\n onMouseLeaveMenu = () => {\n if (!this.disabled) this.showChildren = false;\n };\n onClickMenu(menuClickEvent: Event) {\n menuClickEvent.stopPropagation();\n }\n\n override disconnectedCallback(): void {\n this.menuOption.removeEventListener('mouseenter', this.onMouseEnterMenu);\n this.menuOption.removeEventListener('mouseleave', this.onMouseLeaveMenu);\n }\n\n override render() {\n return html`<div @click=${this.onClickMenu}>\n ${this.icon ? html`<hy-icon name=${this.icon}></hy-icon>` : nothing}\n <span class=\"menu-label\"> ${this.label}</span>\n <hy-icon\n name=\"${this.direction == DropDownDirection.Right ? 'caret-right' : 'caret-left'}\"\n id=\"caret-icon\"\n ></hy-icon>\n <slot style=\"display:${this.showChildren ? 'block' : 'none'}\"></slot>\n </div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"hy-dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown/templates/hy-dropdown-menu.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAA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C,CAAC,CAAC,OAAO;kCACvC,IAAI,CAAC,KAAK;;gBAE5B,IAAI,CAAC,SAAS,yCAA2B,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY;;;6BAG3D,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;WACtD,CAAC;IACV,CAAC;CACF,CAAA;AA7CiB,qBAAM,GAAG,MAAO,CAAA;AAEhC;IADC,KAAK,CAAC,KAAK,CAAC;kDACY;AAEzB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC;gDACxB;AAEjB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;4CAC1B;AAEd;IADC,QAAQ,EAAE;6CACI;AAEf;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;iDACI;AAE9B;IADC,KAAK,EAAE;oDACa;AAbV,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA8C1B;SA9CY,cAAc","sourcesContent":["import {LitElement, html, nothing} from 'lit';\nimport {customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './hy-dropdown-menu.style.js';\nimport {DropDownDirection} from '../dropdown.types';\n@customElement('hy-dropdown-menu')\nexport class HyDropdownMenu extends LitElement {\n static override styles = styles;\n @query('div')\n menuOption!: HTMLElement;\n @property({reflect: true, type: Boolean})\n disabled = false;\n @property({reflect: true, type: String})\n icon!: string;\n @property()\n label!: string;\n @property({reflect: true})\n direction!: DropDownDirection;\n @state()\n showChildren = false;\n\n override firstUpdated(): void {\n this.menuOption.addEventListener('mouseenter', this.onMouseEnterMenu);\n this.menuOption.addEventListener('mouseleave', this.onMouseLeaveMenu);\n }\n\n onMouseEnterMenu = () => {\n if (!this.disabled) this.showChildren = true;\n };\n onMouseLeaveMenu = () => {\n if (!this.disabled) this.showChildren = false;\n };\n onClickMenu(menuClickEvent: Event) {\n menuClickEvent.stopPropagation();\n }\n\n override disconnectedCallback(): void {\n this.menuOption.removeEventListener('mouseenter', this.onMouseEnterMenu);\n this.menuOption.removeEventListener('mouseleave', this.onMouseLeaveMenu);\n }\n\n override render() {\n return html`<div @mousedown=${this.onClickMenu}>\n ${this.icon ? html`<hy-icon name=${this.icon}></hy-icon>` : nothing}\n <span class=\"menu-label\"> ${this.label}</span>\n <hy-icon\n name=\"${this.direction == DropDownDirection.Right ? 'caret-right' : 'caret-left'}\"\n id=\"caret-icon\"\n ></hy-icon>\n <slot style=\"display:${this.showChildren ? 'block' : 'none'}\"></slot>\n </div>`;\n }\n}\n"]}